Previous 15994 Revisions Next

r15083 Thursday 3rd May, 2012 at 11:51:16 UTC by Miodrag Milanović
Sync with MAME r16169 (no whatsnew)
[ROOT]makefile
[src/emu]crsshair.c devcb.c devcb.h device.c device.h driver.c driver.h emu.h info.c ioport.c ioport.h machine.c memory.c rendlay.c screen.c screen.h ui.c uiinput.c uimain.c uimain.h uimenu.c validity.c validity.h
[src/emu/cpu/m68000]m68000.h m68kcpu.c
[src/emu/machine]generic.c i8155.c jvsdev.c microtch.c
[src/emu/sound]disc_cls.h disc_inp.c
[src/emu/video]pc_cga.c
[src/ldplayer]ldplayer.c
[src/mame]mame.lst mame.mak
[src/mame/audio]8080bw.c atarijsa.c cchasm.c cyberbal.c harddriv.c mario.c micro3d.c midway.c mw8080bw.c suna8.c
[src/mame/drivers]2mindril.c 30test.c 39in1.c 3do.c 40love.c 5clown.c 8080bw.c ace.c acefruit.c acommand.c actfancr.c adp.c aeroboto.c airbustr.c albazg.c aleck64.c alg.c alpha68k.c ampoker2.c amspdwy.c angelkds.c aquarium.c arabian.c arcadecl.c aristmk4.c aristmk5.c arkanoid.c armedf.c artmagic.c asterix.c asteroid.c astinvad.c astrafr.c astrocde.c astrocorp.c astrof.c asuka.c atarifb.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c atarisy2.c atarisy4.c ataxx.c atetris.c attckufo.c avalnche.c aztarac.c backfire.c badlands.c bagman.c balsente.c baraduke.c batman.c battlane.c battlera.c bbusters.c beaminv.c beathead.c berzerk.c bfcobra.c bfm_sc1.c bfm_sc2.c bfm_sc4h.c bfm_swp.c big10.c bigevglf.c bionicc.c bladestl.c blitz.c blitz68k.c blktiger.c blmbycar.c blockade.c bloodbro.c blstroid.c bmcbowl.c bmcpokr.c bnstars.c bogeyman.c boogwing.c boxer.c brkthru.c bsktball.c btime.c bwidow.c bwing.c byvid.c bzone.c cabal.c calchase.c calomega.c canyon.c capbowl.c cave.c cb2001.c cbasebal.c cbuster.c ccastles.c cchance.c cd32.c cdi.c centiped.c cesclass.c cham24.c champbwl.c chanbara.c chance32.c* changela.c chinagat.c chinsan.c chqflag.c cinemat.c circus.c cischeat.c citycon.c clayshoo.c cliffhgr.c cloak.c cloud9.c clshroad.c cmmb.c cninja.c cntsteer.c combatsc.c compgolf.c coolpool.c cop01.c copsnrob.c corona.c cosmic.c cps1.c cps2.c cps3.c crbaloon.c crgolf.c crshrace.c crystal.c cshooter.c csplayh5.c cubeqst.c cvs.c cyberbal.c cybertnk.c dai3wksi.c dambustr.c darius.c darkhors.c darkseal.c dassault.c dblewing.c dcheese.c dday.c ddealer.c ddenlovr.c ddragon.c ddragon3.c deadang.c dec0.c dec8.c deco156.c deco32.c deco_ld.c deco_mlc.c decocass.c deshoros.c destroyr.c dgpix.c dietgo.c discoboy.c djboy.c djmain.c dkong.c dlair.c dmndrby.c dogfgt.c dooyong.c dragrace.c dribling.c drw80pkr.c dunhuang.c dwarfd.c dynax.c dynduke.c embargo.c enigma2.c eolith.c eolith16.c eprom.c equites.c ertictac.c esd16.c esripsys.c ettrivia.c exerion.c exidy.c exidy440.c exprraid.c exterm.c f-32.c f1gp.c famibox.c fantland.c fcombat.c feversoc.c fgoal.c finalizr.c firebeat.c firefox.c firetrap.c firetrk.c flkatck.c flyball.c foodf.c forte2.c freekick.c fromanc2.c fromance.c funkball.c funkybee.c funkyjet.c fuukifg3.c gaelco2.c gaelco3d.c galaga.c galastrm.c galaxia.c galaxian.c galaxold.c galdrvr.c galivan.c galpani3.c gameplan.c gauntlet.c gcpinbal.c gei.c gijoe.c gladiatr.c go2000.c goal92.c goldnpkr.c goldstar.c gomoku.c goodejan.c gottlieb.c gpworld.c grchamp.c gridlee.c groundfx.c gstream.c gsword.c gticlub.c guab.c gunbustr.c gundealr.c gunpey.c halleys.c hanaawas.c harddriv.c highvdeo.c hitme.c hitpoker.c hnayayoi.c hng64.c homedata.c hornet.c hvyunit.c hyhoo.c icecold.c igs009.c igs011.c igs017.c igspoker.c imolagp.c irobot.c itech32.c itech8.c jack.c jackal.c jackpool.c jaguar.c jalmah.c jangou.c jantotsu.c jchan.c jedi.c jongkyo.c jpmimpct.c jpmsys5.c kaneko16.c karnov.c kas89.c kingdrby.c kingobox.c kinst.c klax.c koikoi.c konamigq.c konamigv.c konamigx.c kongambl.c kopunch.c ksys573.c ladybug.c laserbat.c lastfght.c lazercmd.c leland.c lemmings.c lethal.c lethalj.c liberate.c liberatr.c limenko.c lockon.c looping.c lordgun.c lvcards.c m10.c m107.c m14.c m63.c m72.c m79amb.c macs.c madalien.c madmotor.c magic10.c magicfly.c magtouch.c majorpkr.c malzak.c mappy.c marinedt.c matmania.c maxaflex.c maygay1b.c maygayv1.c mayumi.c mazerbla.c mcatadv.c mcr.c mcr3.c mcr68.c mediagx.c megadrvb.c megasys1.c megatech.c meijinsn.c merit.c meritm.c metlclsh.c metro.c mexico86.c meyc8080.c meyc8088.c mgolf.c midas.c midvunit.c midzeus.c mirage.c mirax.c missile.c mitchell.c mjkjidai.c mjsister.c mlanding.c model1.c model2.c model3.c moo.c mpoker.c mpu3.c mpu4.c mpu4vid.c mpu5.c mquake.c ms32.c msisaac.c mugsmash.c multigam.c mw18w.c mw8080bw.c mwarr.c mystston.c mystwarr.c namcofl.c namcona1.c namconb1.c namcos1.c namcos10.c namcos11.c namcos12.c namcos21.c namcos22.c namcos23.c namcos86.c naomi.c naughtyb.c nbmj8688.c nbmj8891.c nbmj8900.c nbmj8991.c nbmj9195.c nemesis.c neodrvr.c neogeo.c nexus3d.c nightgal.c ninjakd2.c nitedrvr.c niyanpai.c nmg5.c nmk16.c nova2001.c nwk-tr.c nycaptor.c nyny.c offtwall.c ojankohs.c omegrace.c oneshot.c onetwo.c opwolf.c orbit.c othldrby.c othunder.c overdriv.c pachifev.c pacland.c pacman.c paradise.c pastelg.c pcat_nit.c pcxt.c pengadvb.c peplus.c peyper.c pgm.c phoenix.c pingpong.c pinkiri8.c pipedrm.c pktgaldx.c playch10.c playmark.c pluto5.c plygonet.c pntnpuzl.c polepos.c polyplay.c poolshrk.c popeye.c popper.c powerbal.c prehisle.c progolf.c psikyo.c psikyo4.c psikyosh.c pushman.c pzletime.c qdrmfgp.c quantum.c quasar.c quizpani.c raiden.c rainbow.c rallyx.c rampart.c re900.c realbrk.c redalert.c redclash.c relief.c renegade.c rltennis.c rmhaihai.c rohga.c rollrace.c route16.c royalmah.c rpunch.c runaway.c rungun.c safarir.c saturn.c sbowling.c sbrkout.c scobra.c scramble.c scregg.c sderby.c seattle.c segac2.c segae.c segag80r.c segag80v.c segahang.c segaorun.c segas16a.c segas16b.c segas18.c segas24.c segas32.c segaxbd.c segaybd.c seibuspi.c seicross.c sengokmj.c senjyo.c seta.c seta2.c sf.c sfbonus.c sfkick.c shadfrce.c shangha3.c shangkid.c shisen.c shootout.c shuuz.c sidearms.c sigmab98.c simpl156.c skimaxx.c skullxbo.c skydiver.c skyfox.c skykid.c skyraid.c slapshot.c slotcarn.c snesb.c snk.c snk68.c snookr10.c snowbros.c spacefb.c spcforce.c spdodgeb.c speedatk.c spiders.c splash.c splus.c spoker.c spool99.c sprint2.c sprint4.c sprint8.c srmp2.c srmp5.c srmp6.c ssfindo.c sshangha.c ssingles.c ssozumo.c ssrj.c sstrangr.c ssv.c st0016.c stactics.c stadhero.c starfire.c starshp1.c statriv2.c stlforce.c stv.c subs.c subsino2.c suna8.c supbtime.c superchs.c superqix.c suprgolf.c suprnova.c suprridr.c system1.c system16.c tagteam.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_o.c taito_x.c taito_z.c taitoair.c taitogn.c taitojc.c taitosj.c tank8.c tankbatt.c tapatune.c tatsumi.c taxidriv.c tceptor.c tecmo.c tecmosys.c tehkanwc.c tempest.c terracre.c tetrisp2.c thayers.c thedeep.c thepit.c thief.c thunderj.c tiamc1.c tickee.c timetrv.c tmaster.c tmmjprd.c tmnt.c tmspoker.c tnzs.c toaplan1.c toaplan2.c tomcat.c toobin.c topspeed.c toratora.c tourtabl.c tourvis.c toypop.c trackfld.c triplhnt.c truco.c tryout.c tugboat.c tumbleb.c tumblep.c tunhunt.c turbo.c twin16.c twincobr.c twinkle.c tx1.c uapce.c ultratnk.c ultrsprt.c undrfire.c unico.c unkhorse.c upscope.c usgames.c vamphalf.c vaportra.c vball.c vcombat.c vegaeo.c vegas.c vendetta.c vicdual.c videopin.c videopkr.c vindictr.c viper.c vmetal.c voyager.c vpoker.c wardner.c warpsped.c warpwarp.c wecleman.c wgp.c williams.c wink.c wiping.c witch.c wolfpack.c wwfwfest.c xexex.c xmen.c xtheball.c xxmissio.c xybots.c xyonix.c yunsung8.c zac2650.c zaccaria.c zaxxon.c zn.c zr107.c
[src/mame/includes]bfm_sc45.h bombjack.h galpnipt.h iremipt.h lockon.h lordgun.h msisaac.h toaplipt.h
[src/mame/layout]awpdmd.lay awpvid14.lay awpvid16.lay bfm_sc1.lay drwho.lay gamball.lay gldarrow.lay* mpu4.lay mpu4ext.lay
[src/mame/machine]acitya.c ajax.c amiga.c arkanoid.c asteroid.c atari.c atarifb.c balsente.c beezer.c bonzeadv.c bsktball.c bublbobl.c carpolo.c cchip.c cdislave.c dc-ctrl.c dec0.c decocass.c decoprot.c gaelco2.c galaxold.c gaplus.c harddriv.c irobot.c jvs13551.c kaneko16.c leland.c lsasquad.c mcr68.c megadriv.c mexico86.c mhavoc.c micro3d.c midtunit.c midwayic.c midwunit.c midxunit.c midyunit.c mie.c n64.c namcos1.c namcos2.c nb1413m3.c nitedrvr.c opwolf.c pcecommn.c pckeybrd.c pgmprot.c pgmprot1.c pgmprot2.c pgmprot4.c pgmprot6.c playch10.c qix.c rainbow.c scramble.c segamsys.c seicop.c simpsons.c slikshot.c smpc.c snes.c starwars.c stfight.c subs.c tait8741.c taitosj.c tatsumi.c tnzs.c toaplan1.c vectrex.c vertigo.c volfied.c vsnes.c williams.c xevious.c
[src/mame/video]aeroboto.c amiga.c argus.c artmagic.c astrocde.c atari.c atarisy1.c balsente.c bking.c blockade.c bombjack.c btime.c bwing.c canyon.c cave.c centiped.c changela.c cinemat.c cischeat.c cosmic.c cps1.c dc.c dcheese.c deco_mlc.c decocass.c dkong.c dooyong.c dynax.c esripsys.c exerion.c exidy.c exidy440.c f1gp.c fgoal.c gomoku.c hyprduel.c itech32.c itech8.c jaguar.c kangaroo.c lazercmd.c lethalj.c lockon.c lordgun.c lwings.c m52.c m57.c m58.c m62.c m72.c m92.c madalien.c mario.c mcatadv.c mcd212.c metro.c model2.c momoko.c mystston.c n8080.c namcos22.c naughtyb.c neogeo.c niyanpai.c nmk16.c oneshot.c opwolf.c orbit.c pgm.c phoenix.c policetr.c prehisle.c psikyo.c psychic5.c route16.c shisen.c snes.c system1.c thepit.c tmnt.c travrusa.c turbo.c tx1.c undrfire.c vectrex.c vertigo.c wecleman.c zac2650.c
[src/mess/drivers]4004clk.c a2600.c a5105.c a7800.c abc80.c abc80x.c ace.c acrnsys1.c adam.c alphatro.c ami1200.c amico2k.c amiga.c amstr_pc.c amstrad.c apexc.c apf.c aquarius.c argo.c astrocde.c atarist.c atom.c avigo.c b16.c babbage.c bcs3.c beehive.c beta.c bmjr.c bml3.c bob85.c bullet.c busicom.c bw12.c bw2.c c128.c c64.c c65.c c80.c cat.c cbmb.c cfx9850.c channelf.c chessmst.c chesstrv.c coco12.c coco3.c comx35.c cosmicos.c crvision.c csc.c cvicny.c d6800.c dai.c dectalk.c digel804.c dolphin.c eacc.c einstein.c elf.c elwro800.c enterp.c esq1.c et3400.c eti660.c fidelz80.c fk1.c fm7.c fmtowns.c fp1100.c galeb.c gba.c geneve.c gizmondo.c glasgow.c gmaster.c gp32.c h8.c homelab.c homez80.c hp49gp.c huebler.c intv.c iq151.c jr100.c jr200.c juicebox.c junior.c kim1.c kyocera.c lc80.c lcmate2.c lx800.c m5.c mac.c mc10.c mc1000.c mc80.c megadriv.c mekd2.c mephisto.c micronic.c mikromik.c mini2440.c mirage.c mk1.c mk14.c mk2.c mmd1.c mmodular.c mpf1.c mpz80.c mstation.c multi8.c mycom.c mz2000.c mz2500.c n64.c nakajies.c nanos.c nc.c nes.c newbrain.c ng_aes.c ngp.c okean240.c oric.c osbexec.c osi.c palm.c palmz22.c pasogo.c pb1000.c pc.c pc100.c pc1500.c pc1512.c pc2000.c pc4.c pc6001.c pc8401a.c pc8801.c pc88va.c pc9801.c pce.c pce220.c pcw.c pcw16.c pdp1.c pdp11.c pegasus.c pk8000.c plan80.c pmi80.c pockstat.c poly880.c portfoli.c prestige.c pro80.c prof80.c psion.c psx.c ptcsol.c pv1000.c pv2000.c px4.c px8.c pyl601.c ql.c qx10.c rex6000.c rt1715.c rx78.c samcoupe.c savia84.c sc1.c sc2.c scorpion.c scv.c sdk85.c sdk86.c selz80.c sg1000.c sgi_ip2.c slc1.c smc777.c sms.c snes.c socrates.c sorcerer.c spc1000.c spectrum.c ssem.c ssystem3.c studio2.c supercon.c svision.c tec1.c tek405x.c ti89.c ti99_2.c ti99_4p.c ti99_4x.c ti99_8.c tiki100.c tk80bs.c tm990189.c tmc1800.c tmc2000e.c tmc600.c trs80m2.c tsispch.c tutor.c tvc.c tx0.c unior.c v1050.c vboy.c vc4000.c vcs80.c vic10.c vic20.c vidbrain.c vii.c vip.c vixen.c vt100.c vtech1.c wangpc.c x07.c x1.c x68k.c xerox820.c z100.c z1013.c z88.c zrt80.c
[src/mess/formats]z80bin.c
[src/mess/includes]amstr_pc.h coco.h pc1251.h pc1350.h pc1401.h pc1403.h
[src/mess/machine]a2ssc.c a7800.c abc77.c abc800kb.c abc99.c ac1.c advision.c aim65.c amigakbd.c amstr_pc.c amstrad.c apollo.c apollo_kbd.c apple1.c apple2.c apple2gs.c apricotkb.c ay3600.c b2m.c bbc.c bk.c c128.c c16.c c64.c c64_4cga.c c64_4dxh.c c64_4ksa.c c64_4tba.c c64_easyflash.c c64_ide64.c c64_sfx_sound_expander.c c64_sw8k.c c65.c cbm.c cbmb.c cbmipt.c cgenie.c coco.c coco_fdc.c coco_pak.c coleco.c compis.c comx_joy.c comxpl80.c concept.c cybiko.c dai.c dgn_beta.c ecb_grip.c electron.c galaxy.c gamecom.c gamepock.c gb.c genpc.c hec2hrp.c hp48.c intv.c irisha.c isa_gus.c isa_ide.c isa_ide_cd.c isa_sblaster.c jupiter.c kay_kbd.c kb_keytro.c kc_d002.c kc_keyb.c keyboard.c kr2376.c kramermc.c lisa.c llc.c lux10828.c lux21046.c lux4105.c lviv.c lynx.c mac.c macadb.c mbc55x.c mbee.c mboard.c mface2.c microtan.c mikro80.c msx.c mtx.c mz700.c mz80.c nascom1.c nes.c nes_pcb.c nextkbd.c odyssey2.c ondra.c orao.c oric.c osborne1.c p2000t.c pc.c pc1251.c pc1350.c pc1401.c pc1403.c pc1512kb.c pc_joy.c pc_lpt.c pc_turbo.c pce.c pecom.c pet.c pk8020.c pmd85.c pokemini.c poly88.c pp01.c primo.c radio86.c rmnimbus.c s100_dj2db.c s100_mm65k16s.c s100_wunderbus.c samcoupe.c sapi1.c ser_mouse.c sms.c sorcerer.c special.c super80.c svi318.c sym1.c tandy2kb.c terminal.c tf20.c thomflop.c thomson.c ti85.c trs80.c trs80m2kb.c ut88.c v1050kb.c vector06.c vic1110.c victor9kb.c vtech2.c wangpckb.c wswan.c z80ne.c zx.c
[src/mess/machine/ti99]bwg.c datamux.c evpc.c genboard.c gromport.c handset.c hfdc.c horizon.c hsgpl.c mecmouse.c memex.c myarcmem.c p_code.c ti_rs232.c tn_ide.c tn_usbsm.c
[src/mess/video]733_asr.c 911_vdt.c arcadia.c isa_cga.c isa_ega.c isa_svga_cirrus.c isa_svga_s3.c isa_svga_tseng.c mac.c mbee.c mc6847.h nes.c pc1512.c pc1640.c pc_aga.c ssystem3.c super80.c thomson.c vc4000.c x68k.c
[src/osd/sdl]input.c
[src/osd/windows]debugwin.c input.c windows.mak

src/mame/mame.lst
r15082r15083
206206mooncrsto      // (c) 1980 Nichibutsu
207207mooncrstg      // (c) 1980 Gremlin
208208mooncrstuk      // (c) 1980 Nichibutsu UK
209mooncrstuku      // (c) 1980 Nichibutsu UK
209210smooncrs      // Gremlin
210211sstarcrs      // Taito (Brazil)
211212mooncmw         // bootleg
r15082r15083
603604wcatcher      // (c) 1993
604605jituroku      // (c) 1993 Windom
605606yosimoto      // (c) 1994 Nichibutsu/Yoshimoto Kougyou
607yosimotm      // (c) 1994 Nichibutsu/Yoshimoto Kougyou
606608psailor1      // (c) 1994 SPHINX
607609psailor2      // (c) 1994 SPHINX
608610otatidai      // (c) 1995 SPHINX
r15082r15083
618620mjegolf         // (c) 1994 FUJIC/AV JAPAN
619621
620622mhhonban      // (c) 199?
623zokumahj      // (c) 199?
6216244psimasy      // (c) 1994
622625musobana      // (c) 1995
623626niyanpai      // (c) 1996
r15082r15083
1003610039gtsers9         // (c) 1984 Greyhound Electronics
1003710040gtsers10      // (c) 1984 Greyhound Electronics
1003810041gtsers11      // (c) 1984 Greyhound Electronics
10042gtsers12      // (c) 1984 Greyhound Electronics
10043gtsers14      // (c) 1984 Greyhound Electronics
1003910044gt103a1         // (c) 1984 Greyhound Electronics
10040gt103a2         // (c) 1984 Greyhound Electronics
10041gt103a3         // (c) 1984 Greyhound Electronics
1004210045gt103aa         // (c) 1984 Greyhound Electronics
1004310046gt103asx      // (c) 1984 Greyhound Electronics
1004410047reelfun         // (c) 1986 Grayhound Electronics
r15082r15083
1056710570sb2003a         // (c) 2003 Limenko
1056810571spotty         // (c) 2001 Prince Co.
1056910572carrera         // (c) 19?? BS Electronics
10573chance32      // (c) 19?? PAL Company
1057010574
1057110575// Golden Poker / Potten's Poker / Witch Card hardware
1057210576goldnpkr      // (c) 1981 Bonanza
r15082r15083
1080610810ggconnie      // (c) ???? Capcom
1080710811paranoia      // (c) 1990 Naxat Soft
1080810812tourvis         // (c) ???? Tourvision
10813tvlegaxe      // (c) 1988 Victor Musical Industries, Inc. (Tourvision bootleg)
1080910814tvusapb         // (c) 1989 Aicom (Tourvision bootleg)
1081010815tvdunexp      // (c) 1989 Hudson / Atlus (Tourvision bootleg)
1081110816tvthbld         // (c) 1990 Sega / NEC Avenue (Tourvision bootleg)
1081210817tvrs2         // (c) 1990 Taito (Tourvision bootleg)
1081310818tvpwlg4         // (c) 1991 Hudson (Tourvision bootleg)
1081410819tvsci         // (c) 1991 Taito (Tourvision bootleg)
10820tvsvball      // (c) 1990 Video System (Tourvision bootleg)
1081510821vcombat         // (c) 1993 VR8 Inc.
1081610822shadfgtr      // (c) 1993 DUTECH Inc.
1081710823skimaxx         // (c) 1996 Kyle Hodgetts/ICE
r15082r15083
2007620082   Bally MPU AS-2518-133
2007720083*/
2007820084babypac
20085babypac2
2007920086granny
2008020087
2008120088// by68701.c
src/mame/audio/suna8.c
r15082r15083
5252{
5353   suna8_state *state = device.machine().driver_data<suna8_state>();
5454   running_machine &machine = device.machine();
55   int i, len = machine.root_device().memregion("samples")->bytes();
55   int i, len = state->memregion("samples")->bytes();
5656   UINT8 *ROM = state->memregion("samples")->base();
5757
5858   state->m_samplebuf = auto_alloc_array(machine, INT16, len);
src/mame/audio/micro3d.c
r15082r15083
407407
408408   switch (offset)
409409   {
410      case 0x01:   return (m_sound_port_latch[offset] & 0x7f) | input_port_read(machine(), "SOUND_SW");
410      case 0x01:   return (m_sound_port_latch[offset] & 0x7f) | ioport("SOUND_SW")->read();
411411      case 0x03:   return (m_sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(machine().device("upd7759")) ? 0x08 : 0);
412412      default:   return 0;
413413   }
src/mame/audio/cyberbal.c
r15082r15083
3737
3838READ8_MEMBER(cyberbal_state::cyberbal_special_port3_r)
3939{
40   int temp = input_port_read(machine(), "JSAII");
41   if (!(input_port_read(machine(), "IN0") & 0x8000)) temp ^= 0x80;
40   int temp = ioport("JSAII")->read();
41   if (!(ioport("IN0")->read() & 0x8000)) temp ^= 0x80;
4242   if (m_cpu_to_sound_ready) temp ^= 0x40;
4343   if (m_sound_to_cpu_ready) temp ^= 0x20;
4444   return temp;
src/mame/audio/atarijsa.c
r15082r15083
227227                0x02 = coin 2
228228                0x01 = coin 1
229229            */
230         result = input_port_read(space->machine(), "JSAI");
231         if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x80;
230         result = space->machine().root_device().ioport("JSAI")->read();
231         if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
232232         if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
233233         if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
234234         if ((tms5220 != NULL) && (tms5220_readyq_r(tms5220) == 0))
r15082r15083
360360                0x02 = coin 2
361361                0x01 = coin 1
362362            */
363         result = input_port_read(space->machine(), "JSAII");
364         if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x80;
363         result = space->machine().root_device().ioport("JSAII")->read();
364         if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
365365         if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
366366         if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
367367         break;
r15082r15083
483483                0x02 = coin L (active high)
484484                0x01 = coin R (active high)
485485            */
486         result = input_port_read(space->machine(), "JSAIII");
487         if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x90;
486         result = space->machine().root_device().ioport("JSAIII")->read();
487         if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
488488         if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
489489         if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
490490         break;
r15082r15083
617617                0x02 = coin L (active high)
618618                0x01 = coin R (active high)
619619            */
620         result = input_port_read(space->machine(), "JSAIII");
621         if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x90;
620         result = space->machine().root_device().ioport("JSAIII")->read();
621         if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
622622         if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
623623         if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
624624         break;
src/mame/audio/8080bw.c
r15082r15083
865865   m_schaser_background_disable = (data >> 3) & 0x01;
866866   m_schaser_background_select = (data >> 4) & 0x01;
867867
868   m_c8080bw_flip_screen = (data & 0x20) && (input_port_read(machine(), CABINET_PORT_TAG) & 0x01);
868   m_c8080bw_flip_screen = (data & 0x20) && (ioport(CABINET_PORT_TAG)->read() & 0x01);
869869
870870   m_port_2_last_extra = data;
871871}
r15082r15083
10321032
10331033   m_color_map = data & 0x40;
10341034
1035   m_c8080bw_flip_screen = (data & 0x20) && (input_port_read(machine(), "IN2") & 0x04);
1035   m_c8080bw_flip_screen = (data & 0x20) && (ioport("IN2")->read() & 0x04);
10361036
10371037   m_port_2_last_extra = data;
10381038}
src/mame/audio/cchasm.c
r15082r15083
3232
3333READ8_MEMBER(cchasm_state::cchasm_coin_sound_r)
3434{
35   UINT8 coin = (input_port_read(machine(), "IN3") >> 4) & 0x7;
35   UINT8 coin = (ioport("IN3")->read() >> 4) & 0x7;
3636   return m_sound_flags | (m_coin_flag << 3) | coin;
3737}
3838
r15082r15083
8585      m_sound_flags &= ~0x40;
8686      return soundlatch4_byte_r(space,offset) << 8;
8787   case 0x2:
88      return (m_sound_flags| (input_port_read(machine(), "IN3") & 0x07) | 0x08) << 8;
88      return (m_sound_flags| (ioport("IN3")->read() & 0x07) | 0x08) << 8;
8989   case 0x5:
90      return input_port_read(machine(), "IN2") << 8;
90      return ioport("IN2")->read() << 8;
9191   case 0x8:
92      return input_port_read(machine(), "IN1") << 8;
92      return ioport("IN1")->read() << 8;
9393   default:
9494      return 0xff << 8;
9595   }
src/mame/audio/midway.c
r15082r15083
144144{
145145   static const char *const port[] = { "IP0", "IP1", "IP2", "IP3", "IP4" };
146146   astring tempstr;
147   UINT8 result = input_port_read_safe(machine(), subtag(tempstr, port[offset]), 0xff);
147   UINT8 result = ioport(port[offset])->read_safe(0xff);
148148   if (!m_custom_input[offset].isnull())
149149      result = (result & ~m_custom_input_mask[offset]) |
150150               (m_custom_input[offset](space, offset, 0xff) & m_custom_input_mask[offset]);
src/mame/audio/harddriv.c
r15082r15083
144144//            D13 = Test Switch
145145//            D12 = 5220 Ready Flag (0=Ready)
146146   logerror("%06X:hdsnd68k_status_r(%04X)\n", cpu_get_previouspc(&space.device()), offset);
147   return (m_mainflag << 15) | (m_soundflag << 14) | 0x2000 | 0;//((input_port_read(machine(), "IN0") & 0x0020) << 8) | 0;
147   return (m_mainflag << 15) | (m_soundflag << 14) | 0x2000 | 0;//((ioport("IN0")->read() & 0x0020) << 8) | 0;
148148}
149149
150150
src/mame/audio/mario.c
r15082r15083
416416   mario_state   *state = machine.driver_data<mario_state>();
417417   device_t *audiocpu = machine.device("audiocpu");
418418#if USE_8039
419   UINT8 *SND = machine.root_device().memregion("audiocpu")->base();
419   UINT8 *SND = state->memregion("audiocpu")->base();
420420
421421   SND[0x1001] = 0x01;
422422#endif
r15082r15083
426426   {
427427      state->m_eabank = "bank1";
428428      audiocpu->memory().space(AS_PROGRAM)->install_read_bank(0x000, 0x7ff, "bank1");
429      state->membank("bank1")->configure_entry(0, machine.root_device().memregion("audiocpu")->base());
429      state->membank("bank1")->configure_entry(0, state->memregion("audiocpu")->base());
430430       state->membank("bank1")->configure_entry(1, state->memregion("audiocpu")->base() + 0x1000);
431431   }
432432
src/mame/audio/mw8080bw.c
r15082r15083
575575void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state)
576576{
577577   /* controls need to be active low */
578   int controls = ~input_port_read(device->machine(), "IN0") & 0xff;
578   int controls = ~device->machine().root_device().ioport("IN0")->read() & 0xff;
579579
580580   discrete_sound_w(device, MAZE_TONE_TIMING, maze_tone_timing_state);
581581   discrete_sound_w(device, MAZE_P1_DATA, controls & 0x0f);
r15082r15083
587587   /* A better option might be to update it at vblank or set a timer to do it. */
588588   /* The only noticeable difference doing it here, is that the controls don't */
589589   /* immediately start making tones if pressed right after the coin is inserted. */
590   discrete_sound_w(device, MAZE_COIN, (~input_port_read(device->machine(), "IN1") >> 3) & 0x01);
590   discrete_sound_w(device, MAZE_COIN, (~device->machine().root_device().ioport("IN1")->read() >> 3) & 0x01);
591591}
592592
593593
src/mame/machine/rainbow.c
r15082r15083
761761   coin_counter_w(machine, 1, state->m_CRAM[0][8] & 0x20);
762762   coin_counter_w(machine, 0, state->m_CRAM[0][8] & 0x10);
763763
764   state->m_CRAM[0][3] = input_port_read(machine, "800007");    /* STARTn + SERVICE1 */
765   state->m_CRAM[0][4] = input_port_read(machine, "800009");    /* COINn */
766   state->m_CRAM[0][5] = input_port_read(machine, "80000B");    /* Player controls + TILT */
767   state->m_CRAM[0][6] = input_port_read(machine, "80000D");    /* Player controls (cocktail) */
764   state->m_CRAM[0][3] = machine.root_device().ioport("800007")->read();    /* STARTn + SERVICE1 */
765   state->m_CRAM[0][4] = machine.root_device().ioport("800009")->read();    /* COINn */
766   state->m_CRAM[0][5] = machine.root_device().ioport("80000B")->read();    /* Player controls + TILT */
767   state->m_CRAM[0][6] = machine.root_device().ioport("80000D")->read();    /* Player controls (cocktail) */
768768}
769769
770770/*************************************
src/mame/machine/xevious.c
r15082r15083
174174   switch ( offset )
175175   {
176176      default:
177      case 0: return ~BITSWAP8(input_port_read(space->machine(), "IN0H"),7,6,5,4,2,3,1,0);
178      case 1: return ~input_port_read(space->machine(), "IN1L");
179      case 2: return ~input_port_read(space->machine(), "IN1H");
180      case 3: return ~input_port_read(space->machine(), "IN0L");
177      case 0: return ~BITSWAP8(space->machine().root_device().ioport("IN0H")->read(),7,6,5,4,2,3,1,0);
178      case 1: return ~space->machine().root_device().ioport("IN1L")->read();
179      case 2: return ~space->machine().root_device().ioport("IN1H")->read();
180      case 3: return ~space->machine().root_device().ioport("IN0L")->read();
181181   }
182182}
183183
src/mame/machine/bublbobl.c
r15082r15083
185185{
186186
187187   //logerror("%04x: 6801U4 port 1 read\n", cpu_get_pc(&space.device()));
188   m_port1_in = input_port_read(machine(), "IN0");
188   m_port1_in = ioport("IN0")->read();
189189   return (m_port1_out & m_ddr1) | (m_port1_in & ~m_ddr1);
190190}
191191
r15082r15083
236236      {
237237         // read
238238         if ((address & 0x0800) == 0x0000)
239            m_port3_in = input_port_read(machine(), portnames[address & 3]);
239            m_port3_in = ioport(portnames[address & 3])->read();
240240         else if ((address & 0x0c00) == 0x0c00)
241241            m_port3_in = m_mcu_sharedram[address & 0x03ff];
242242         // logerror("reading %02x from shared RAM %04x\n", m_port3_in, address);
r15082r15083
448448         if ((m_address & 0x0800) == 0x0000)
449449         {
450450            //logerror("%04x: 68705 read input port %02x\n", cpu_get_pc(&space.device()), m_address);
451            m_latch = input_port_read(machine(), portnames[m_address & 3]);
451            m_latch = ioport(portnames[m_address & 3])->read();
452452         }
453453         else if ((m_address & 0x0c00) == 0x0c00)
454454         {
src/mame/machine/tnzs.c
r15082r15083
4343
4444   switch (m_input_select & 0x0f)
4545   {
46      case 0x0a:   data = input_port_read(machine(), "IN2"); break;
47      case 0x0c:   data = input_port_read(machine(), "IN0"); break;
48      case 0x0d:   data = input_port_read(machine(), "IN1"); break;
46      case 0x0a:   data = ioport("IN2")->read(); break;
47      case 0x0c:   data = ioport("IN0")->read(); break;
48      case 0x0d:   data = ioport("IN1")->read(); break;
4949      default:   data = 0xff; break;
5050   }
5151
r15082r15083
5656
5757READ8_MEMBER(tnzs_state::tnzs_port2_r)
5858{
59   int data = input_port_read(machine(), "IN2");
59   int data = ioport("IN2")->read();
6060
6161//  logerror("I8742:%04x  Read %02x from port 2\n", cpu_get_previouspc(&space.device()), data);
6262
r15082r15083
8383
8484//  logerror("PC %04x: read input %04x\n", cpu_get_pc(&space.device()), 0xf000 + offset);
8585
86   val = input_port_read_safe(machine(), (offset / 2) ? "AN2" : "AN1", 0);
86   val = ioport((offset / 2) ? "AN2" : "AN1")->read_safe(0);
8787   if (offset & 1)
8888      return ((val >> 8) & 0xff);
8989   else
r15082r15083
214214               }
215215               else return m_mcu_credits;
216216            }
217            else return input_port_read(machine(), "IN0");   /* buttons */
217            else return ioport("IN0")->read();   /* buttons */
218218
219219         default:
220220            logerror("error, unknown mcu command\n");
r15082r15083
306306      switch (m_mcu_command)
307307      {
308308         case 0x01:
309            return input_port_read(machine(), "IN0") ^ 0xff;   /* player 1 joystick + buttons */
309            return ioport("IN0")->read() ^ 0xff;   /* player 1 joystick + buttons */
310310
311311         case 0x02:
312            return input_port_read(machine(), "IN1") ^ 0xff;   /* player 2 joystick + buttons */
312            return ioport("IN1")->read() ^ 0xff;   /* player 2 joystick + buttons */
313313
314314         case 0x1a:
315            return (input_port_read(machine(), "COIN1") | (input_port_read(machine(), "COIN2") << 1));
315            return (ioport("COIN1")->read() | (ioport("COIN2")->read() << 1));
316316
317317         case 0x21:
318            return input_port_read(machine(), "IN2") & 0x0f;
318            return ioport("IN2")->read() & 0x0f;
319319
320320         case 0x41:
321321            return m_mcu_credits;
r15082r15083
343343               else return m_mcu_credits;
344344            }
345345            /* buttons */
346            else return ((input_port_read(machine(), "IN0") & 0xf0) | (input_port_read(machine(), "IN1") >> 4)) ^ 0xff;
346            else return ((ioport("IN0")->read() & 0xf0) | (ioport("IN1")->read() >> 4)) ^ 0xff;
347347
348348         default:
349349            logerror("error, unknown mcu command\n");
r15082r15083
610610      case MCU_DRTOPPEL:
611611      case MCU_PLUMPOP:
612612         coin  = 0;
613         coin |= ((input_port_read(device->machine(), "COIN1") & 1) << 0);
614         coin |= ((input_port_read(device->machine(), "COIN2") & 1) << 1);
615         coin |= ((input_port_read(device->machine(), "IN2") & 3) << 2);
613         coin |= ((state->ioport("COIN1")->read() & 1) << 0);
614         coin |= ((state->ioport("COIN2")->read() & 1) << 1);
615         coin |= ((state->ioport("IN2")->read() & 3) << 2);
616616         coin ^= 0x0c;
617617         mcu_handle_coins(device->machine(), coin);
618618         break;
r15082r15083
671671MACHINE_START( tnzs )
672672{
673673   tnzs_state *state = machine.driver_data<tnzs_state>();
674   UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
674   UINT8 *ROM = state->memregion("maincpu")->base();
675675   UINT8 *SUB = state->memregion("sub")->base();
676676
677677   state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
r15082r15083
709709MACHINE_START( jpopnics )
710710{
711711   tnzs_state *state = machine.driver_data<tnzs_state>();
712   UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
712   UINT8 *ROM = state->memregion("maincpu")->base();
713713   UINT8 *SUB = state->memregion("sub")->base();
714714
715715   state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
src/mame/machine/midyunit.c
r15082r15083
114114{
115115   static const char *const portnames[] = { "IN0", "IN1", "IN2", "DSW", "UNK0", "UNK1" };
116116
117   return input_port_read(machine(), portnames[offset]);
117   return ioport(portnames[offset])->read();
118118}
119119
120120
r15082r15083
130130   static const char *const portnames[] = { "IN0", "IN1", NULL, "DSW", "UNK0", "UNK1" };
131131
132132   if (offset != 2)
133      return input_port_read(machine(), portnames[offset]);
133      return ioport(portnames[offset])->read();
134134
135135   switch (m_term2_analog_select)
136136   {
137137      default:
138      case 0:  return input_port_read(machine(), "STICK0_X");
139      case 1:  return input_port_read(machine(), "STICK0_Y");
140      case 2:  return input_port_read(machine(), "STICK1_X");
141      case 3:  return input_port_read(machine(), "STICK1_Y");
138      case 0:  return ioport("STICK0_X")->read();
139      case 1:  return ioport("STICK0_Y")->read();
140      case 2:  return ioport("STICK1_X")->read();
141      case 3:  return ioport("STICK1_Y")->read();
142142   }
143143}
144144
src/mame/machine/asteroid.c
r15082r15083
1616INTERRUPT_GEN( asteroid_interrupt )
1717{
1818   /* Turn off interrupts if self-test is enabled */
19   if (!(input_port_read(device->machine(), "IN0") & 0x80))
19   if (!(device->machine().root_device().ioport("IN0")->read() & 0x80))
2020      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
2121}
2222
2323INTERRUPT_GEN( asterock_interrupt )
2424{
2525   /* Turn off interrupts if self-test is enabled */
26   if ((input_port_read(device->machine(), "IN0") & 0x80))
26   if ((device->machine().root_device().ioport("IN0")->read() & 0x80))
2727      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
2828}
2929
3030INTERRUPT_GEN( llander_interrupt )
3131{
3232   /* Turn off interrupts if self-test is enabled */
33   if (input_port_read(device->machine(), "IN0") & 0x02)
33   if (device->machine().root_device().ioport("IN0")->read() & 0x02)
3434      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
3535}
3636
3737READ8_MEMBER(asteroid_state::asteroid_IN0_r)
3838{
39   int res = input_port_read(machine(), "IN0");
39   int res = ioport("IN0")->read();
4040   int bitmask = (1 << offset);
4141
4242   if (res & bitmask)
r15082r15083
5050
5151READ8_MEMBER(asteroid_state::asterock_IN0_r)
5252{
53   int res = input_port_read(machine(), "IN0");
53   int res = ioport("IN0")->read();
5454   int bitmask = (1 << offset);
5555
5656   if (res & bitmask)
r15082r15083
6868
6969READ8_MEMBER(asteroid_state::asteroid_IN1_r)
7070{
71   int res = input_port_read(machine(), "IN1");
71   int res = ioport("IN1")->read();
7272   int bitmask = (1 << (offset & 0x7));
7373
7474   if (res & bitmask)
r15082r15083
8585   int res;
8686   int res1;
8787
88   res1 = input_port_read(machine(), "DSW1");
88   res1 = ioport("DSW1")->read();
8989
9090   res = 0xfc | ((res1 >> (2 * (3 - (offset & 0x3)))) & 0x3);
9191   return res;
src/mame/machine/mhavoc.c
r15082r15083
214214{
215215   const char *tag1 = (const char *)param;
216216   const char *tag2 = tag1 + strlen(tag1) + 1;
217   return input_port_read(machine(), m_player_1 ? tag2 : tag1) & 0x03;
217   return ioport(m_player_1 ? tag2 : tag1)->read() & 0x03;
218218}
219219
220220CUSTOM_INPUT_MEMBER(mhavoc_state::gamma_rcvd_r)
src/mame/machine/gaplus.c
r15082r15083
3535   switch (offset)
3636   {
3737      case 0:
38         return input_port_read(machine(), "IN2");      /* cabinet & test mode */
38         return ioport("IN2")->read();      /* cabinet & test mode */
3939      case 1:
4040         return (mode == 2) ? m_customio_3[offset] : 0x0f;
4141      case 2:
src/mame/machine/midtunit.c
r15082r15083
105105{
106106   static const char *const portnames[] = { "IN0", "IN1", "IN2", "DSW" };
107107
108   return input_port_read(machine(), portnames[offset]);
108   return ioport(portnames[offset])->read();
109109}
110110
111111
src/mame/machine/carpolo.c
r15082r15083
217217
218218
219219   /* check the coins here as well - they drive the clock of the flip-flops */
220   port_value = input_port_read(device->machine(), "IN0");
220   port_value = state->ioport("IN0")->read();
221221
222222   state->m_ttl7474_2s_1->clock_w((port_value & 0x01) >> 0);
223223   state->m_ttl7474_2s_2->clock_w((port_value & 0x02) >> 1);
r15082r15083
240240         case 3:   movement_flip_flop = state->m_ttl7474_1a_1;   dir_flip_flop = state->m_ttl7474_1a_2;   break;
241241      }
242242
243      port_value = input_port_read(device->machine(), portnames[player]);
243      port_value = device->machine().root_device().ioport(portnames[player])->read();
244244
245245      if (port_value != state->m_last_wheel_value[player])
246246      {
r15082r15083
258258
259259
260260   /* finally read the accelerator pedals */
261   port_value = input_port_read(device->machine(), "PEDALS");
261   port_value = device->machine().root_device().ioport("PEDALS")->read();
262262
263263   for (player = 0; player < 4; player++)
264264   {
r15082r15083
422422        (state->m_ttl7474_1c_2->output_r() ? 0x02 : 0x00) |
423423        (state->m_ttl7474_1d_2->output_r() ? 0x04 : 0x00) |
424424        (state->m_ttl7474_1f_2->output_r() ? 0x08 : 0x00) |
425        (input_port_read(device->machine(), "IN2") & 0xf0);
425        (state->ioport("IN2")->read() & 0xf0);
426426
427427   return ret;
428428}
src/mame/machine/namcos1.c
r15082r15083
12821282      int ret;
12831283
12841284      if (!qnum)
1285         ret = (input_port_read(space->machine(), "CONTROL0")&0x90) | qstrobe | (input_port_read(space->machine(), "PADDLE0")&0x0f);
1285         ret = (space->machine().root_device().ioport("CONTROL0")->read()&0x90) | qstrobe | (space->machine().root_device().ioport("PADDLE0")->read()&0x0f);
12861286      else
1287         ret = (input_port_read(space->machine(), "CONTROL0")&0x90) | qstrobe | (input_port_read(space->machine(), "PADDLE1")&0x0f);
1287         ret = (space->machine().root_device().ioport("CONTROL0")->read()&0x90) | qstrobe | (space->machine().root_device().ioport("PADDLE1")->read()&0x0f);
12881288
12891289      qstrobe ^= 0x40;
12901290
r15082r15083
12951295      int ret;
12961296
12971297      if (!qnum)
1298         ret = (input_port_read(space->machine(), "CONTROL1")&0x90) | qnum | (input_port_read(space->machine(), "PADDLE0")>>4);
1298         ret = (space->machine().root_device().ioport("CONTROL1")->read()&0x90) | qnum | (space->machine().root_device().ioport("PADDLE0")->read()>>4);
12991299      else
1300         ret = (input_port_read(space->machine(), "CONTROL1")&0x90) | qnum | (input_port_read(space->machine(), "PADDLE1")>>4);
1300         ret = (space->machine().root_device().ioport("CONTROL1")->read()&0x90) | qnum | (space->machine().root_device().ioport("PADDLE1")->read()>>4);
13011301
13021302      if (!qstrobe) qnum ^= 0x20;
13031303
r15082r15083
13271327   {
13281328      int inp = input_count;
13291329
1330      if (inp == 4) res = input_port_read(space->machine(), "CONTROL0");
1330      if (inp == 4) res = space->machine().root_device().ioport("CONTROL0")->read();
13311331      else
13321332      {
13331333         char portname[40];
r15082r15083
13361336         static int counter[4];
13371337
13381338         sprintf(portname,"IN%d",inp);   /* IN0-IN3 */
1339         res = input_port_read(space->machine(), portname);
1339         res = space->machine().root_device().ioport(portname)->read();
13401340         if (res & 0x80)
13411341         {
13421342            if (counter[inp] >= 0)
r15082r15083
13601360            counter[inp] = -1;
13611361#else
13621362         sprintf(portname,"IN%d",inp);   /* IN0-IN3 */
1363         res = input_port_read(space->machine(), portname);
1363         res = space->machine().root_device().ioport(portname)->read();
13641364         if (res & 1) res = 0x7f;      /* weak */
13651365         else if (res & 2) res = 0x48;   /* medium */
13661366         else if (res & 4) res = 0x40;   /* strong */
r15082r15083
13711371   }
13721372   else
13731373   {
1374      res = input_port_read(space->machine(), "CONTROL1") & 0x8f;
1374      res = space->machine().root_device().ioport("CONTROL1")->read() & 0x8f;
13751375
13761376      /* the strobe cannot happen too often, otherwise the MCU will waste too
13771377           much time reading the inputs and won't have enough cycles to play two
r15082r15083
14131413
14141414   if (offset == 0)
14151415   {
1416      res = (input_port_read(space->machine(), "CONTROL0") & 0x80) | stored_input[0];
1416      res = (space->machine().root_device().ioport("CONTROL0")->read() & 0x80) | stored_input[0];
14171417
14181418      return res;
14191419   }
14201420   else
14211421   {
1422      res = input_port_read(space->machine(), "CONTROL1") & 0x80;
1422      res = space->machine().root_device().ioport("CONTROL1")->read() & 0x80;
14231423
14241424      /* the strobe cannot happen too often, otherwise the MCU will waste too
14251425           much time reading the inputs and won't have enough cycles to play two
r15082r15083
14341434         switch (input_count)
14351435         {
14361436            case 0:
1437               stored_input[0] = input_port_read(space->machine(), "IN0") & 0x1f;
1438               stored_input[1] = (input_port_read(space->machine(), "IN3") & 0x07) << 3;
1437               stored_input[0] = space->machine().root_device().ioport("IN0")->read() & 0x1f;
1438               stored_input[1] = (space->machine().root_device().ioport("IN3")->read() & 0x07) << 3;
14391439               break;
14401440
14411441            case 3:
1442               stored_input[0] = input_port_read(space->machine(), "IN2") & 0x1f;
1442               stored_input[0] = space->machine().root_device().ioport("IN2")->read() & 0x1f;
14431443               break;
14441444
14451445            case 4:
1446               stored_input[0] = input_port_read(space->machine(), "IN1") & 0x1f;
1447               stored_input[1] = input_port_read(space->machine(), "IN3") & 0x18;
1446               stored_input[0] = space->machine().root_device().ioport("IN1")->read() & 0x1f;
1447               stored_input[1] = space->machine().root_device().ioport("IN3")->read() & 0x18;
14481448               break;
14491449
14501450            default:
src/mame/machine/pckeybrd.c
r15082r15083
183183   int scan_code_set;
184184   int last_code;
185185
186   const input_port_config *ports[8];
186   ioport_port *ports[8];
187187} at_keyboard;
188188
189189static at_keyboard keyboard;
r15082r15083
306306
307307static int at_keyboard_queue_size(void);
308308static int at_keyboard_queue_chars(running_machine &machine, const unicode_char *text, size_t text_len);
309static int at_keyboard_accept_char(running_machine &machine, unicode_char ch);
310static int at_keyboard_charqueue_empty(running_machine &machine);
309static bool at_keyboard_accept_char(running_machine &machine, unicode_char ch);
310static bool at_keyboard_charqueue_empty(running_machine &machine);
311311
312312
313313
r15082r15083
339339      keyboard.ports[i] = machine.root_device().ioport(buf);
340340   }
341341
342   inputx_setup_natural_keyboard(machine,
343      at_keyboard_queue_chars,
344      at_keyboard_accept_char,
345      at_keyboard_charqueue_empty);
342   machine.ioport().natkeyboard().configure(
343      ioport_queue_chars_delegate(FUNC(at_keyboard_queue_chars), &machine),
344      ioport_accept_char_delegate(FUNC(at_keyboard_accept_char), &machine),
345      ioport_charqueue_empty_delegate(FUNC(at_keyboard_charqueue_empty), &machine));
346346}
347347
348348
r15082r15083
499499{
500500   UINT32 result = 0;
501501   if (keyboard.ports[port] != NULL)
502      result = input_port_read_direct(keyboard.ports[port]);
502      result = keyboard.ports[port]->read();
503503   return result;
504504}
505505
r15082r15083
12371237  Inputx stuff
12381238***************************************************************************/
12391239
1240static int at_keyboard_accept_char(running_machine &machine, unicode_char ch)
1240static bool at_keyboard_accept_char(running_machine &machine, unicode_char ch)
12411241{
12421242   return unicode_char_to_at_keycode(ch) != 0;
12431243}
12441244
12451245
12461246
1247static int at_keyboard_charqueue_empty(running_machine &machine)
1247static bool at_keyboard_charqueue_empty(running_machine &machine)
12481248{
12491249   return at_keyboard_queue_size() == 0;
12501250}
src/mame/machine/pgmprot1.c
r15082r15083
273273static READ16_HANDLER( kovsh_fake_region_r )
274274{
275275   pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
276   int regionhack = input_port_read(space->machine(), "RegionHack");
276   int regionhack = state->ioport("RegionHack")->read();
277277   if (regionhack != 0xff) return regionhack;
278278
279279   offset = 0x4;
r15082r15083
13881388static READ16_HANDLER( pgm_arm7_type1_sim_protram_r )
13891389{
13901390   if (offset == 4)
1391      return input_port_read(space->machine(), "Region");
1391      return space->machine().root_device().ioport("Region")->read();
13921392
13931393   return 0x0000;
13941394}
r15082r15083
13981398   pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
13991399
14001400   if (offset == 4)      //region
1401      return input_port_read(space->machine(), "Region");
1401      return state->ioport("Region")->read();
14021402   else if (offset >= 0x10)  //timer
14031403   {
14041404      logerror("PSTARS ACCESS COUNTER %6X\n", state->m_extra_ram[offset - 0x10]);
src/mame/machine/volfied.c
r15082r15083
436436   {
437437      switch (offset)
438438      {
439      case 0x03: return input_port_read(machine(), "F00007");    /* STARTn + SERVICE1 */
440      case 0x04: return input_port_read(machine(), "F00009");    /* COINn */
441      case 0x05: return input_port_read(machine(), "F0000B");    /* Player controls + TILT */
442      case 0x06: return input_port_read(machine(), "F0000D");    /* Player controls (cocktail) */
439      case 0x03: return ioport("F00007")->read();    /* STARTn + SERVICE1 */
440      case 0x04: return ioport("F00009")->read();    /* COINn */
441      case 0x05: return ioport("F0000B")->read();    /* Player controls + TILT */
442      case 0x06: return ioport("F0000D")->read();    /* Player controls (cocktail) */
443443      case 0x08: return m_cc_port;
444444      }
445445   }
src/mame/machine/balsente.c
r15082r15083
6262      /* we latch the beam values on the first interrupt after VBLANK */
6363      if (param == 64)
6464      {
65         state->m_shooter_x = input_port_read(timer.machine(), "FAKEX");
66         state->m_shooter_y = input_port_read(timer.machine(), "FAKEY");
65         state->m_shooter_x = timer.machine().root_device().ioport("FAKEX")->read();
66         state->m_shooter_y = timer.machine().root_device().ioport("FAKEY")->read();
6767      }
6868
6969      /* which bits get returned depends on which scanline we're at */
r15082r15083
172172   memset(state->m_noise_position, 0, sizeof(state->m_noise_position));
173173
174174   /* point the banks to bank 0 */
175   numbanks = (machine.root_device().memregion("maincpu")->bytes() > 0x40000) ? 16 : 8;
176   state->membank("bank1")->configure_entries(0, numbanks, &machine.root_device().memregion("maincpu")->base()[0x10000], 0x6000);
175   numbanks = (state->memregion("maincpu")->bytes() > 0x40000) ? 16 : 8;
176   state->membank("bank1")->configure_entries(0, numbanks, &state->memregion("maincpu")->base()[0x10000], 0x6000);
177177   state->membank("bank2")->configure_entries(0, numbanks, &state->memregion("maincpu")->base()[0x12000], 0x6000);
178178   state->membank("bank1")->set_entry(0);
179179   state->membank("bank2")->set_entry(0);
r15082r15083
569569   /* ports are read once a frame, just at varying intervals. To get around this, we */
570570   /* read all the analog inputs at VBLANK time and just return the cached values. */
571571   for (i = 0; i < 4; i++)
572      state->m_analog_input_data[i] = input_port_read(device->machine(), analog[i]);
572      state->m_analog_input_data[i] = device->machine().root_device().ioport(analog[i])->read();
573573}
574574
575575
r15082r15083
11401140   INT8 diff[3];
11411141
11421142   /* read the current steering values */
1143   wheel[0] = input_port_read(machine, "AN0");
1144   wheel[1] = input_port_read(machine, "AN1");
1145   wheel[2] = input_port_read(machine, "AN2");
1143   wheel[0] = state->ioport("AN0")->read();
1144   wheel[1] = state->ioport("AN1")->read();
1145   wheel[2] = state->ioport("AN2")->read();
11461146
11471147   /* diff the values */
11481148   diff[0] = wheel[0] - state->m_grudge_last_steering[0];
src/mame/machine/vsnes.c
r15082r15083
3838   if (data & 1)
3939   {
4040      /* load up the latches */
41      m_input_latch[0] = input_port_read(machine(), "IN0");
42      m_input_latch[1] = input_port_read(machine(), "IN1");
41      m_input_latch[0] = ioport("IN0")->read();
42      m_input_latch[1] = ioport("IN1")->read();
4343   }
4444}
4545
r15082r15083
5050   /* shift */
5151   m_input_latch[0] >>= 1;
5252
53   ret |= input_port_read(machine(), "COINS");            /* merge coins, etc */
54   ret |= (input_port_read(machine(), "DSW0") & 3) << 3;      /* merge 2 dipswitches */
53   ret |= ioport("COINS")->read();            /* merge coins, etc */
54   ret |= (ioport("DSW0")->read() & 3) << 3;      /* merge 2 dipswitches */
5555
5656/* The gun games expect a 1 returned on every 5th read after sound_fix is reset*/
5757/* Info Supplied by Ben Parnell <xodnizel@home.com> of FCE Ultra fame */
r15082r15083
7575   /* shift */
7676   m_input_latch[0] >>= 1;
7777
78   ret |= input_port_read(machine(), "COINS");            /* merge coins, etc */
79   ret |= (input_port_read(machine(), "DSW0") & 3) << 3;      /* merge 2 dipswitches */
78   ret |= ioport("COINS")->read();            /* merge coins, etc */
79   ret |= (ioport("DSW0")->read() & 3) << 3;      /* merge 2 dipswitches */
8080
8181   return ret;
8282
r15082r15083
8686{
8787   int ret = (m_input_latch[1]) & 1;
8888
89   ret |= input_port_read(machine(), "DSW0") & ~3;         /* merge the rest of the dipswitches */
89   ret |= ioport("DSW0")->read() & ~3;         /* merge the rest of the dipswitches */
9090
9191   /* shift */
9292   m_input_latch[1] >>= 1;
r15082r15083
100100   if (data & 1)
101101   {
102102      /* load up the latches */
103      m_input_latch[2] = input_port_read(machine(), "IN2");
104      m_input_latch[3] = input_port_read(machine(), "IN3");
103      m_input_latch[2] = ioport("IN2")->read();
104      m_input_latch[3] = ioport("IN3")->read();
105105   }
106106}
107107
r15082r15083
112112   /* shift */
113113   m_input_latch[2] >>= 1;
114114
115   ret |= input_port_read(machine(), "COINS2");            /* merge coins, etc */
116   ret |= (input_port_read(machine(), "DSW1") & 3) << 3;      /* merge 2 dipswitches */
115   ret |= ioport("COINS2")->read();            /* merge coins, etc */
116   ret |= (ioport("DSW1")->read() & 3) << 3;      /* merge 2 dipswitches */
117117   return ret;
118118}
119119
r15082r15083
121121{
122122   int ret = (m_input_latch[3]) & 1;
123123
124   ret |= input_port_read(machine(), "DSW1") & ~3;         /* merge the rest of the dipswitches */
124   ret |= ioport("DSW1")->read() & ~3;         /* merge the rest of the dipswitches */
125125
126126   /* shift */
127127   m_input_latch[3] >>= 1;
r15082r15083
202202
203203   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));
204204
205   state->m_vrom[0] = machine.root_device().memregion("gfx1")->base();
205   state->m_vrom[0] = state->memregion("gfx1")->base();
206206   state->m_vrom_size[0] = state->memregion("gfx1")->bytes();
207207   state->m_vrom_banks = state->m_vrom_size[0] / 0x400;
208208
r15082r15083
227227MACHINE_START( vsdual )
228228{
229229   vsnes_state *state = machine.driver_data<vsnes_state>();
230   state->m_vrom[0] = machine.root_device().memregion("gfx1")->base();
231   state->m_vrom[1] = machine.root_device().memregion("gfx2")->base();
232   state->m_vrom_size[0] = machine.root_device().memregion("gfx1")->bytes();
230   state->m_vrom[0] = state->memregion("gfx1")->base();
231   state->m_vrom[1] = state->memregion("gfx2")->base();
232   state->m_vrom_size[0] = state->memregion("gfx1")->bytes();
233233   state->m_vrom_size[1] = state->memregion("gfx2")->bytes();
234234
235235   /* establish nametable ram */
r15082r15083
365365   {
366366
367367      /* load up the latches */
368      m_input_latch[0] = input_port_read(machine(), "IN0");
368      m_input_latch[0] = ioport("IN0")->read();
369369
370370      /* do the gun thing */
371      int x = input_port_read(machine(), "GUNX");
372      int y = input_port_read(machine(), "GUNY");
371      int x = ioport("GUNX")->read();
372      int y = ioport("GUNY")->read();
373373      UINT32 pix, color_base;
374374
375375      /* get the pixel at the gun position */
r15082r15083
385385         m_input_latch[0] |= 0x40;
386386      }
387387
388      m_input_latch[1] = input_port_read(machine(), "IN1");
388      m_input_latch[1] = ioport("IN1")->read();
389389   }
390390
391391    if ((m_zapstore & 1) && (!(data & 1)))
r15082r15083
773773DRIVER_INIT( MMC3 )
774774{
775775   vsnes_state *state = machine.driver_data<vsnes_state>();
776   UINT8 *prg = machine.root_device().memregion("maincpu")->base();
776   UINT8 *prg = state->memregion("maincpu")->base();
777777   state->m_IRQ_enable = state->m_IRQ_count = state->m_IRQ_count_latch = 0;
778778   int MMC3_prg_chunks = (state->memregion("maincpu")->bytes() - 0x10000) / 0x4000;
779779
src/mame/machine/megadriv.c
r15082r15083
17881788      {
17891789         /* here we read B, C & the additional buttons */
17901790         retdata = (megadrive_io_data_regs[portnum] & helper) |
1791                  (((input_port_read_safe(machine, pad3names[portnum], 0) & 0x30) |
1792                     (input_port_read_safe(machine, pad6names[portnum], 0) & 0x0f)) & ~helper);
1791                  (((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0x30) |
1792                     (machine.root_device().ioport(pad6names[portnum])->read_safe(0) & 0x0f)) & ~helper);
17931793      }
17941794      else
17951795      {
17961796         /* here we read B, C & the directional buttons */
17971797         retdata = (megadrive_io_data_regs[portnum] & helper) |
1798                  ((input_port_read_safe(machine, pad3names[portnum], 0) & 0x3f) & ~helper);
1798                  ((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0x3f) & ~helper);
17991799      }
18001800   }
18011801   else
r15082r15083
18041804      {
18051805         /* here we read ((Start & A) >> 2) | 0x00 */
18061806         retdata = (megadrive_io_data_regs[portnum] & helper) |
1807                  (((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) & ~helper);
1807                  (((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0xc0) >> 2) & ~helper);
18081808      }
18091809      else if (io_stage[portnum]==2)
18101810      {
18111811         /* here we read ((Start & A) >> 2) | 0x0f */
18121812         retdata = (megadrive_io_data_regs[portnum] & helper) |
1813                  ((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) | 0x0f) & ~helper);
1813                  ((((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0xc0) >> 2) | 0x0f) & ~helper);
18141814      }
18151815      else
18161816      {
18171817         /* here we read ((Start & A) >> 2) | Up and Down */
18181818         retdata = (megadrive_io_data_regs[portnum] & helper) |
1819                  ((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) |
1820                     (input_port_read_safe(machine, pad3names[portnum], 0) & 0x03)) & ~helper);
1819                  ((((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0xc0) >> 2) |
1820                     (machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0x03)) & ~helper);
18211821      }
18221822   }
18231823
r15082r15083
18371837   {
18381838      /* here we read B, C & the directional buttons */
18391839      retdata = (megadrive_io_data_regs[portnum] & helper) |
1840               (((input_port_read_safe(machine, pad3names[portnum], 0) & 0x3f) | 0x40) & ~helper);
1840               (((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0x3f) | 0x40) & ~helper);
18411841   }
18421842   else
18431843   {
18441844      /* here we read ((Start & A) >> 2) | Up and Down */
18451845      retdata = (megadrive_io_data_regs[portnum] & helper) |
1846               ((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) |
1847                  (input_port_read_safe(machine, pad3names[portnum], 0) & 0x03) | 0x40) & ~helper);
1846               ((((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0xc0) >> 2) |
1847                  (machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0x03) | 0x40) & ~helper);
18481848   }
18491849
18501850   return retdata;
r15082r15083
18581858   if (ctrl == 0x55)
18591859   {
18601860         /* A keys */
1861         retdata = ((input_port_read(machine, "PAD1") & 0x40) >> 2) |
1862            ((input_port_read(machine, "PAD2") & 0x40) >> 4) | 0xeb;
1861         retdata = ((machine.root_device().ioport("PAD1")->read() & 0x40) >> 2) |
1862            ((machine.root_device().ioport("PAD2")->read() & 0x40) >> 4) | 0xeb;
18631863   }
18641864   else
18651865   {
18661866      if (offset == 0)
18671867      {
1868         retdata = (input_port_read(machine, "PAD1") & 0x3f) | ((input_port_read(machine, "PAD2") & 0x03) << 6);
1868         retdata = (machine.root_device().ioport("PAD1")->read() & 0x3f) | ((machine.root_device().ioport("PAD2")->read() & 0x03) << 6);
18691869      }
18701870      else
18711871      {
1872         retdata = ((input_port_read(machine, "PAD2") & 0x3c) >> 2) | 0xf0;
1872         retdata = ((machine.root_device().ioport("PAD2")->read() & 0x3c) >> 2) | 0xf0;
18731873      }
18741874
18751875   }
r15082r15083
71337133/* emulate testmode plug */
71347134static UINT8 megadrive_io_read_data_port_svp(running_machine &machine, int portnum)
71357135{
7136   if (portnum == 0 && input_port_read_safe(machine, "MEMORY_TEST", 0x00))
7136   if (portnum == 0 && machine.root_device().ioport("MEMORY_TEST")->read_safe(0x00))
71377137   {
71387138      return (megadrive_io_data_regs[0] & 0xc0);
71397139   }
r15082r15083
92779277   /* default state of z80 = reset, with bus */
92789278   mame_printf_debug("Resetting Megadrive / Genesis\n");
92799279
9280   switch (input_port_read_safe(machine, "REGION", 0xff))
9280   switch (machine.root_device().ioport("REGION")->read_safe(0xff))
92819281   {
92829282
92839283      case 1: // US
r15082r15083
94149414      megadrive_imode_odd_frame^=1;
94159415//      cputag_set_input_line(machine, "genesis_snd_z80", 0, CLEAR_LINE); // if the z80 interrupt hasn't happened by now, clear it..
94169416
9417      if (input_port_read_safe(screen.machine(), "RESET", 0x00) & 0x01)
9417      if (screen.machine().root_device().ioport("RESET")->read_safe(0x00) & 0x01)
94189418         cputag_set_input_line(screen.machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
94199419
94209420/*
src/mame/machine/mexico86.c
r15082r15083
6767      int i;
6868      int coin_curr;
6969
70      coin_curr = ~input_port_read(machine, "IN0") & 1;
70      coin_curr = ~machine.root_device().ioport("IN0")->read() & 1;
7171      if (coin_curr && !state->m_coin_last && state->m_protection_ram[0x01] < 9)
7272      {
7373         state->m_protection_ram[0x01]++;   // increase credits counter
r15082r15083
7777
7878      state->m_protection_ram[0x04] = 0x3c;   // coin inputs
7979
80      state->m_protection_ram[0x02] = BITSWAP8(input_port_read(machine, "IN1"), 7,6,5,4,2,3,1,0);   // player 1
81      state->m_protection_ram[0x03] = BITSWAP8(input_port_read(machine, "IN2"), 7,6,5,4,2,3,1,0);   // player 2
80      state->m_protection_ram[0x02] = BITSWAP8(machine.root_device().ioport("IN1")->read(), 7,6,5,4,2,3,1,0);   // player 1
81      state->m_protection_ram[0x03] = BITSWAP8(machine.root_device().ioport("IN2")->read(), 7,6,5,4,2,3,1,0);   // player 2
8282
8383      if (state->m_protection_ram[0x19] == 0xaa)   // player 2 active
8484         state->m_protection_ram[0x1b] = state->m_protection_ram[0x03];
r15082r15083
293293         else
294294         {
295295            //logerror("%04x: 68705 read input port %04x\n", cpu_get_pc(&space.device()), m_address);
296            m_latch = input_port_read(machine(), (m_address & 1) ? "IN2" : "IN1");
296            m_latch = ioport((m_address & 1) ? "IN2" : "IN1")->read();
297297         }
298298      }
299299      else    /* write */
src/mame/machine/taitosj.c
r15082r15083
1919MACHINE_START( taitosj )
2020{
2121   taitosj_state *state = machine.driver_data<taitosj_state>();
22   state->membank("bank1")->configure_entry(0, machine.root_device().memregion("maincpu")->base() + 0x6000);
22   state->membank("bank1")->configure_entry(0, state->memregion("maincpu")->base() + 0x6000);
2323   state->membank("bank1")->configure_entry(1, state->memregion("maincpu")->base() + 0x10000);
2424
2525   state->save_item(NAME(state->m_fromz80));
r15082r15083
308308
309309READ8_MEMBER(taitosj_state::alpine_port_2_r)
310310{
311   return input_port_read(machine(), "IN2") | m_protection_value;
311   return ioport("IN2")->read() | m_protection_value;
312312}
src/mame/machine/amiga.c
r15082r15083
419419
420420CUSTOM_INPUT_MEMBER( amiga_state::amiga_joystick_convert )
421421{
422   UINT8 bits = input_port_read(machine(), (const char *)param);
422   UINT8 bits = ioport((const char *)param)->read();
423423   int up = (bits >> 0) & 1;
424424   int down = (bits >> 1) & 1;
425425   int left = (bits >> 2) & 1;
r15082r15083
11801180      case REG_JOY0DAT:
11811181         if (state->m_intf->joy0dat_r != NULL)
11821182            return (*state->m_intf->joy0dat_r)(space->machine());
1183         return input_port_read_safe(space->machine(), "JOY0DAT", 0xffff);
1183         return state->ioport("JOY0DAT")->read_safe(0xffff);
11841184
11851185      case REG_JOY1DAT:
11861186         if (state->m_intf->joy1dat_r != NULL)
11871187            return (*state->m_intf->joy1dat_r)(space->machine());
1188         return input_port_read_safe(space->machine(), "JOY1DAT", 0xffff);
1188         return state->ioport("JOY1DAT")->read_safe(0xffff);
11891189
11901190      case REG_POTGOR:
1191         return input_port_read_safe(space->machine(), "POTGO", 0x5500);
1191         return state->ioport("POTGO")->read_safe(0x5500);
11921192
11931193      case REG_POT0DAT:
1194         return input_port_read_safe(space->machine(), "POT0DAT", 0x0000);
1194         return state->ioport("POT0DAT")->read_safe(0x0000);
11951195
11961196      case REG_POT1DAT:
1197         return input_port_read_safe(space->machine(), "POT1DAT", 0x0000);
1197         return state->ioport("POT1DAT")->read_safe(0x0000);
11981198
11991199      case REG_DSKBYTR:
12001200         return space->machine().device<amiga_fdc>("fdc")->dskbytr_r();
src/mame/machine/vertigo.c
r15082r15083
119119   if (offset > 2)
120120      m_adc_result = 0;
121121   else
122      m_adc_result = input_port_read(machine(), adcnames[offset]);
122      m_adc_result = ioport(adcnames[offset])->read();
123123
124124   update_irq_encoder(machine(), INPUT_LINE_IRQ2, ASSERT_LINE);
125125   return 0;
r15082r15083
136136READ16_MEMBER(vertigo_state::vertigo_coin_r)
137137{
138138   update_irq_encoder(machine(), INPUT_LINE_IRQ6, CLEAR_LINE);
139   return (input_port_read(machine(), "COIN"));
139   return (ioport("COIN")->read());
140140}
141141
142142
143143INTERRUPT_GEN( vertigo_interrupt )
144144{
145145   /* Coin inputs cause IRQ6 */
146   if ((input_port_read(device->machine(), "COIN") & 0x7) < 0x7)
146   if ((device->machine().root_device().ioport("COIN")->read() & 0x7) < 0x7)
147147      update_irq_encoder(device->machine(), INPUT_LINE_IRQ6, ASSERT_LINE);
148148}
149149
src/mame/machine/cdislave.c
r15082r15083
7979
8080void cdislave_device::perform_mouse_update()
8181{
82    UINT16 x = input_port_read(machine(), "MOUSEX");
83    UINT16 y = input_port_read(machine(), "MOUSEY");
84    UINT8 buttons = input_port_read(machine(), "MOUSEBTN");
82    UINT16 x = ioport("MOUSEX")->read();
83    UINT16 y = ioport("MOUSEY")->read();
84    UINT8 buttons = ioport("MOUSEBTN")->read();
8585
8686    UINT16 old_mouse_x = m_real_mouse_x;
8787    UINT16 old_mouse_y = m_real_mouse_y;
src/mame/machine/midwunit.c
r15082r15083
126126      case 1:
127127      case 2:
128128      case 3:
129         return input_port_read(machine(), portnames[offset]);
129         return ioport(portnames[offset])->read();
130130
131131      case 4:
132132         return (midway_serial_pic_status_r() << 12) | midwunit_sound_state_r(space,0,0xffff);
r15082r15083
156156   register_state_saving(machine);
157157
158158   /* load the graphics ROMs -- quadruples */
159   midtunit_gfx_rom = base = machine.root_device().memregion("gfx1")->base();
159   midtunit_gfx_rom = base = state->memregion("gfx1")->base();
160160   len = state->memregion("gfx1")->bytes();
161161   for (i = 0; i < len / 0x400000; i++)
162162   {
src/mame/machine/namcos2.c
r15082r15083
736736      switch((data>>2) & 0x07)
737737      {
738738      case 0:
739         namcos2_mcu_analog_data=input_port_read(space->machine(), "AN0");
739         namcos2_mcu_analog_data=space->machine().root_device().ioport("AN0")->read();
740740         break;
741741      case 1:
742         namcos2_mcu_analog_data=input_port_read(space->machine(), "AN1");
742         namcos2_mcu_analog_data=space->machine().root_device().ioport("AN1")->read();
743743         break;
744744      case 2:
745         namcos2_mcu_analog_data=input_port_read(space->machine(), "AN2");
745         namcos2_mcu_analog_data=space->machine().root_device().ioport("AN2")->read();
746746         break;
747747      case 3:
748         namcos2_mcu_analog_data=input_port_read(space->machine(), "AN3");
748         namcos2_mcu_analog_data=space->machine().root_device().ioport("AN3")->read();
749749         break;
750750      case 4:
751         namcos2_mcu_analog_data=input_port_read(space->machine(), "AN4");
751         namcos2_mcu_analog_data=space->machine().root_device().ioport("AN4")->read();
752752         break;
753753      case 5:
754         namcos2_mcu_analog_data=input_port_read(space->machine(), "AN5");
754         namcos2_mcu_analog_data=space->machine().root_device().ioport("AN5")->read();
755755         break;
756756      case 6:
757         namcos2_mcu_analog_data=input_port_read(space->machine(), "AN6");
757         namcos2_mcu_analog_data=space->machine().root_device().ioport("AN6")->read();
758758         break;
759759      case 7:
760         namcos2_mcu_analog_data=input_port_read(space->machine(), "AN7");
760         namcos2_mcu_analog_data=space->machine().root_device().ioport("AN7")->read();
761761         break;
762762      default:
763763         output_set_value("anunk",data);
r15082r15083
815815   int data = 0;
816816
817817   /* Read/convert the bits one at a time */
818   if(input_port_read(space->machine(), "AN0") > threshold) data |= 0x01;
819   if(input_port_read(space->machine(), "AN1") > threshold) data |= 0x02;
820   if(input_port_read(space->machine(), "AN2") > threshold) data |= 0x04;
821   if(input_port_read(space->machine(), "AN3") > threshold) data |= 0x08;
822   if(input_port_read(space->machine(), "AN4") > threshold) data |= 0x10;
823   if(input_port_read(space->machine(), "AN5") > threshold) data |= 0x20;
824   if(input_port_read(space->machine(), "AN6") > threshold) data |= 0x40;
825   if(input_port_read(space->machine(), "AN7") > threshold) data |= 0x80;
818   if(space->machine().root_device().ioport("AN0")->read() > threshold) data |= 0x01;
819   if(space->machine().root_device().ioport("AN1")->read() > threshold) data |= 0x02;
820   if(space->machine().root_device().ioport("AN2")->read() > threshold) data |= 0x04;
821   if(space->machine().root_device().ioport("AN3")->read() > threshold) data |= 0x08;
822   if(space->machine().root_device().ioport("AN4")->read() > threshold) data |= 0x10;
823   if(space->machine().root_device().ioport("AN5")->read() > threshold) data |= 0x20;
824   if(space->machine().root_device().ioport("AN6")->read() > threshold) data |= 0x40;
825   if(space->machine().root_device().ioport("AN7")->read() > threshold) data |= 0x80;
826826
827827   /* Return the result */
828828   return data;
r15082r15083
830830
831831READ8_HANDLER( namcos2_input_port_0_r )
832832{
833   int data = input_port_read(space->machine(), "MCUB");
833   int data = space->machine().root_device().ioport("MCUB")->read();
834834   return data;
835835}
836836
837837READ8_HANDLER( namcos2_input_port_10_r )
838838{
839   int data = input_port_read(space->machine(), "MCUH");
839   int data = space->machine().root_device().ioport("MCUH")->read();
840840   return data;
841841}
842842
843843READ8_HANDLER( namcos2_input_port_12_r )
844844{
845   int data = input_port_read(space->machine(), "MCUDI0");
845   int data = space->machine().root_device().ioport("MCUDI0")->read();
846846   return data;
847847}
src/mame/machine/pgmprot2.c
r15082r15083
182182{
183183   pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
184184   int pc = cpu_get_pc(&space->device());
185   int regionhack = input_port_read(space->machine(), "RegionHack");
185   int regionhack = state->ioport("RegionHack")->read();
186186   if (pc==0x190 && regionhack != 0xff) data = (data & 0xffff0000) | (regionhack << 0);
187187   COMBINE_DATA(&state->m_arm7_shareram[0x138/4]);
188188}
r15082r15083
235235{
236236   pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
237237   int pc = cpu_get_pc(&space->device());
238   int regionhack = input_port_read(space->machine(), "RegionHack");
238   int regionhack = state->ioport("RegionHack")->read();
239239   if (pc==0x170 && regionhack != 0xff) data = (data & 0xffff0000) | (regionhack << 0);
240240   COMBINE_DATA(&state->m_arm7_shareram[0x138/4]);
241241}
r15082r15083
256256{
257257   pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
258258   int pc = cpu_get_pc(&space->device());
259   int regionhack = input_port_read(space->machine(), "RegionHack");
259   int regionhack = state->ioport("RegionHack")->read();
260260   if (pc==0x0174 && regionhack != 0xff) data = (data & 0x0000ffff) | (regionhack << 16);
261261   COMBINE_DATA(&state->m_arm7_shareram[0x0]);
262262}
r15082r15083
312312
313313DRIVER_INIT( dw2001 )
314314{
315   //pgm_arm_type2_state *state = machine.driver_data<pgm_arm_type2_state>();
316   UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
315   pgm_arm_type2_state *state = machine.driver_data<pgm_arm_type2_state>();
316   UINT16 *mem16 = (UINT16 *)state->memregion("maincpu")->base();
317317
318318   pgm_basic_init(machine);
319319   kov2_latch_init(machine);
r15082r15083
330330   mem16[0x11eb04 / 2] = 0x4e71;
331331
332332   /* patch ARM area with fake code */
333   UINT16 *temp16 = (UINT16 *)machine.root_device().memregion("prot")->base();
333   UINT16 *temp16 = (UINT16 *)state->memregion("prot")->base();
334334   temp16[(0x0000)/2] = 0xd088;
335335   temp16[(0x0002)/2] = 0xe59f;
336336   temp16[(0x0004)/2] = 0x0680;
r15082r15083
346346
347347DRIVER_INIT( dwpc )
348348{
349   //pgm_arm_type2_state *state = machine.driver_data<pgm_arm_type2_state>();
350   UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
349   pgm_arm_type2_state *state = machine.driver_data<pgm_arm_type2_state>();
350   UINT16 *mem16 = (UINT16 *)state->memregion("maincpu")->base();
351351
352352   pgm_basic_init(machine);
353353   kov2_latch_init(machine);
r15082r15083
365365
366366
367367   /* patch ARM area with fake code */
368   UINT16 *temp16 = (UINT16 *)machine.root_device().memregion("prot")->base();
368   UINT16 *temp16 = (UINT16 *)state->memregion("prot")->base();
369369   temp16[(0x0000)/2] = 0xd088;
370370   temp16[(0x0002)/2] = 0xe59f;
371371   temp16[(0x0004)/2] = 0x0680;
src/mame/machine/mie.c
r15082r15083
202202READ8_MEMBER(mie_device::gpio_r)
203203{
204204   if(gpiodir & (1 << offset))
205      return gpio_name[offset] ? input_port_read(machine(), gpio_name[offset]) : 0xff;
205      return gpio_name[offset] ? ioport(gpio_name[offset])->read() : 0xff;
206206   else
207207      return gpio_val[offset];
208208}
r15082r15083
211211{
212212   gpio_val[offset] = data;
213213   if(!(gpiodir & (1 << offset)) && gpio_name[offset])
214      input_port_write(machine(), gpio_name[offset], data, 0xff);
214      ioport(gpio_name[offset])->write(data, 0xff);
215215}
216216
217217READ8_MEMBER(mie_device::gpiodir_r)
src/mame/machine/decoprot.c
r15082r15083
130130{
131131   switch (offset<<1) {
132132      case 0x110: /* Player input */
133         return input_port_read(space->machine(), "IN0");
133         return space->machine().root_device().ioport("IN0")->read();
134134
135135      case 0x36c: /* Coins */
136136      case 0x334: /* Probably also, c6, 2c0, 2e0, 4b2, 46a, 4da, rohga is 44c */
137         return input_port_read(space->machine(), "IN1");
137         return space->machine().root_device().ioport("IN1")->read();
138138      case 0x0dc:
139         return input_port_read(space->machine(), "IN1")<<4;
139         return space->machine().root_device().ioport("IN1")->read()<<4;
140140
141141      case 0x494: /* Dips */
142         return input_port_read(space->machine(), "DSW1_2");
142         return space->machine().root_device().ioport("DSW1_2")->read();
143143
144144      case 0x244:
145145         return deco16_prot_ram[0];
r15082r15083
364364
365365      /* Player 1 & 2 controls, read in IRQ then written *back* to protection device */
366366      case 0x50: /* written to 9e byte */
367         return input_port_read(space->machine(), "IN0");
367         return space->machine().root_device().ioport("IN0")->read();
368368      case 0x6f8: /* written to 76 byte */
369         return (input_port_read(space->machine(), "IN0")>>8)|(input_port_read(space->machine(), "IN0")<<8); /* byte swap IN0 */
369         return (space->machine().root_device().ioport("IN0")->read()>>8)|(space->machine().root_device().ioport("IN0")->read()<<8); /* byte swap IN0 */
370370
371371      case 0x5c: /* After coin insert, high 0x8000 bit set starts game */
372372         return deco16_prot_ram[0x3b];
r15082r15083
376376         return ((deco16_prot_ram[0x9e/2]&0xff00)>>8) | ((deco16_prot_ram[0x9e/2]&0x00ff)<<8);
377377
378378      case 0xac: /* Dip switches */
379         return input_port_read(space->machine(), "DSW");
379         return space->machine().root_device().ioport("DSW")->read();
380380      case 0xc2:
381         return input_port_read(space->machine(), "DSW") ^ deco16_prot_ram[0x2c/2];
381         return space->machine().root_device().ioport("DSW")->read() ^ deco16_prot_ram[0x2c/2];
382382
383383      case 0x5d4: /* The state of the dips last frame */
384384         return deco16_prot_ram[0x34/2];
r15082r15083
390390         return (((deco16_prot_ram[0]&0xfff0)>>0) | ((deco16_prot_ram[0]&0x000c)>>2) | ((deco16_prot_ram[0]&0x0003)<<2)) & (~deco16_prot_ram[0x36/2]);
391391
392392      case 0x76a: /* Coins */
393         return input_port_read(space->machine(), "IN1");
393         return space->machine().root_device().ioport("IN1")->read();
394394
395395      case 0x284: /* Bit shifting with inverted mask register */
396396         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]);
r15082r15083
404404         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]);
405405
406406      case 0x7d6: /* XOR IN0 */
407         return input_port_read(space->machine(), "IN0") ^ deco16_prot_ram[0x2c/2];
407         return space->machine().root_device().ioport("IN0")->read() ^ deco16_prot_ram[0x2c/2];
408408      case 0x4b4:
409409         return ((deco16_prot_ram[0x32/2]&0x00f0)<<8) | ((deco16_prot_ram[0x32/2]&0x000e)<<7) | ((deco16_prot_ram[0x32/2]&0x0001)<<11);
410410   }
r15082r15083
467467
468468   switch (offset*2) {
469469      case 0xac: /* Dip switches */
470         return input_port_read(space->machine(), "DSW");
470         return space->machine().root_device().ioport("DSW")->read();
471471      case 0xc2: /* Dip switches */
472         return input_port_read(space->machine(), "DSW") ^ deco16_prot_ram[0x2c/2];
472         return space->machine().root_device().ioport("DSW")->read() ^ deco16_prot_ram[0x2c/2];
473473      case 0x46: /* Coins */
474         return input_port_read(space->machine(), "IN1") ^ deco16_prot_ram[0x2c/2];
474         return space->machine().root_device().ioport("IN1")->read() ^ deco16_prot_ram[0x2c/2];
475475      case 0x50: /* Player 1 & 2 input ports */
476         return input_port_read(space->machine(), "IN0");
476         return space->machine().root_device().ioport("IN0")->read();
477477      case 0x63c: /* Player 1 & 2 input ports */
478         return input_port_read(space->machine(), "IN0") ^ deco16_prot_ram[0x2c/2];
478         return space->machine().root_device().ioport("IN0")->read() ^ deco16_prot_ram[0x2c/2];
479479
480480      case 0x5f4:
481481         return deco16_prot_ram[0x18/2];
r15082r15083
652652         return deco16_prot_ram[15];
653653
654654      case 0x36: /* Dip switches */
655         return input_port_read(space->machine(), "DSW");
655         return space->machine().root_device().ioport("DSW")->read();
656656
657657      case 0x1c8: /* Coins */
658         return input_port_read(space->machine(), "IN1");
658         return space->machine().root_device().ioport("IN1")->read();
659659
660660      case 0x22c: /* Player 1 & 2 input ports */
661         return input_port_read(space->machine(), "IN0");
661         return space->machine().root_device().ioport("IN0")->read();
662662   }
663663
664664   logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(&space->device()),offset);
r15082r15083
750750         return ((deco16_prot_ram[0x78e>>1]>>4)&0xff00) | (deco16_prot_ram[0x78e>>1]&0x000f) | ((deco16_prot_ram[0x78e>>1]<<8)&0xf000);
751751
752752      case 0x00c >> 1: /* Player 1 & Player 2 joysticks & fire buttons */
753         return input_port_read(space->machine(), "INPUTS");
753         return space->machine().root_device().ioport("INPUTS")->read();
754754      case 0x778 >> 1: /* Credits */
755         return input_port_read(space->machine(), "SYSTEM");
755         return space->machine().root_device().ioport("SYSTEM")->read();
756756      case 0x382 >> 1: /* DIPS */
757         return input_port_read(space->machine(), "DSW");
757         return space->machine().root_device().ioport("DSW")->read();
758758   }
759759
760760   if (cpu_get_pc(&space->device())!=0xc0ea)
761      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"));
761      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());
762762
763763   return 0;
764764}
r15082r15083
868868
869869   switch (offset) {
870870      case 0x88/2: /* Player 1 & 2 input ports */
871         return input_port_read(space->machine(), "IN0");
871         return space->machine().root_device().ioport("IN0")->read();
872872      case 0x36c/2:
873         return input_port_read(space->machine(), "IN1");
873         return space->machine().root_device().ioport("IN1")->read();
874874      case 0x44c/2:
875         return ((input_port_read(space->machine(), "IN1") & 0x7)<<13)|((input_port_read(space->machine(), "IN1") & 0x8)<<9);
875         return ((space->machine().root_device().ioport("IN1")->read() & 0x7)<<13)|((space->machine().root_device().ioport("IN1")->read() & 0x8)<<9);
876876      case 0x292/2: /* Dips */
877         return input_port_read(space->machine(), "DSW1_2");
877         return space->machine().root_device().ioport("DSW1_2")->read();
878878
879879      case 0x44/2:
880880         return ((((DECO_PORT(0x2c)&0x000f)<<12)) ^ deco16_xor) & (~deco16_mask);
r15082r15083
12531253   switch (offset)
12541254   {
12551255   case 0x582: /* Player 1 & Player 2 */
1256      return input_port_read(space->machine(), "IN0");
1256      return space->machine().root_device().ioport("IN0")->read();
12571257   case 0x04c: /* Coins/VBL */
1258      return input_port_read(space->machine(), "IN1");
1258      return space->machine().root_device().ioport("IN1")->read();
12591259   case 0x672: /* Dip switches */
1260      return input_port_read(space->machine(), "DSW1_2");
1260      return space->machine().root_device().ioport("DSW1_2")->read();
12611261
12621262   case 0x13a:
12631263      return ((DECO_PORT(0x190)&0x00f0)<<8) | ((DECO_PORT(0x190)&0x0003)<<10) | ((DECO_PORT(0x190)&0x000c)<<6);
r15082r15083
13151315
13161316   /*********************************************************************************/
13171317
1318//  case 0x582: return input_port_read(space->machine(), "IN0"); /* IN0 */
1319//  case 0x672: return input_port_read(space->machine(), "IN1"); /* IN1 */
1318//  case 0x582: return space->machine().root_device().ioport("IN0")->read(); /* IN0 */
1319//  case 0x672: return space->machine().root_device().ioport("IN1")->read(); /* IN1 */
13201320//  case 0x04c: return space->machine().device<eeprom_device>("eeprom")->read_bit();
13211321
13221322   case 0x468:
r15082r15083
16641664   /* Special case inputs, because this is the only game with an eprom */
16651665   switch (addr)
16661666   {
1667   case 0x582: return (input_port_read(space->machine(), "IN0")<<16) | 0xffff; /* IN0 */
1668   case 0x672: return (input_port_read(space->machine(), "IN1")<<16) | 0xffff; /* IN1 */
1667   case 0x582: return (space->machine().root_device().ioport("IN0")->read()<<16) | 0xffff; /* IN0 */
1668   case 0x672: return (space->machine().root_device().ioport("IN1")->read()<<16) | 0xffff; /* IN1 */
16691669   case 0x04c: return (space->machine().device<eeprom_device>("eeprom")->read_bit()<<16) | 0xffff;
16701670   }
16711671
r15082r15083
17401740{
17411741   switch (offset * 2)
17421742   {
1743   case 0x298: return input_port_read(space->machine(), "IN0");
1744   case 0x342: return input_port_read(space->machine(), "IN1");
1745   case 0x506: return input_port_read(space->machine(), "DSW");
1743   case 0x298: return space->machine().root_device().ioport("IN0")->read();
1744   case 0x342: return space->machine().root_device().ioport("IN1")->read();
1745   case 0x506: return space->machine().root_device().ioport("DSW")->read();
17461746   }
17471747
17481748   logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(&space->device()), offset<<1);
r15082r15083
17691769   const UINT16* prot_ram=deco16_prot_ram;
17701770   switch (offset * 2)
17711771   {
1772   case 0x5b2: return input_port_read(space->machine(), "SYSTEM");
1773   case 0x44c: return input_port_read(space->machine(), "DSW");
1774   case 0x042: return input_port_read(space->machine(), "INPUTS");
1772   case 0x5b2: return space->machine().root_device().ioport("SYSTEM")->read();
1773   case 0x44c: return space->machine().root_device().ioport("DSW")->read();
1774   case 0x042: return space->machine().root_device().ioport("INPUTS")->read();
17751775
17761776   case 0x510: return DECO_PORT(0);
17771777   case 0x51a: return DECO_PORT(2);
src/mame/machine/tatsumi.c
r15082r15083
108108{
109109   switch (m_apache3_adc)
110110   {
111      case 0: return input_port_read(machine(), "STICK_X");
112      case 1: return input_port_read(machine(), "STICK_Y");
111      case 0: return ioport("STICK_X")->read();
112      case 1: return ioport("STICK_Y")->read();
113113      case 2: return 0; // VSP1
114114      case 3: return 0;
115      case 4: return (UINT8)((255./100) * (100 - input_port_read(machine(), "VR1")));
116      case 5: return input_port_read(machine(), "THROTTLE");
115      case 4: return (UINT8)((255./100) * (100 - ioport("VR1")->read()));
116      case 5: return ioport("THROTTLE")->read();
117117      case 6: return 0; // RPSNC
118118      case 7: return 0; // LPSNC
119119   }
src/mame/machine/segamsys.c
r15082r15083
11801180      end_of_frame(screen.machine(), md_sms_vdp);
11811181
11821182      // the SMS has a 'RESET' button on the machine, it generates an NMI
1183      if (input_port_read_safe(screen.machine(),"PAUSE",0x00))
1183      if (screen.machine().root_device().ioport("PAUSE")->read_safe(0x00))
11841184         cputag_set_input_line(screen.machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
11851185   }
11861186}
r15082r15083
14641464
14651465static UINT8 ioport_gg00_r(running_machine& machine)
14661466{
1467   UINT8 GG_START_BUTTON = input_port_read_safe(machine,"GGSTART",0x00);
1467   UINT8 GG_START_BUTTON = machine.root_device().ioport("GGSTART")->read_safe(0x00);
14681468
14691469   return (GG_START_BUTTON << 7) |
14701470         (0               << 6) |
r15082r15083
15671567   running_machine &machine = space->machine();
15681568   /* 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) */
15691569   /* bit 4: TL-A; bit 5: TR-A */
1570   return (input_port_read(machine, "PAD1") & 0x3f) | ((input_port_read(machine, "PAD2") & 0x03) << 6);
1570   return (machine.root_device().ioport("PAD1")->read() & 0x3f) | ((machine.root_device().ioport("PAD2")->read() & 0x03) << 6);
15711571}
15721572
15731573READ8_HANDLER (megatech_sms_ioport_dd_r)
r15082r15083
15751575   running_machine &machine = space->machine();
15761576   /* 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) */
15771577   /* bit 2: TL-B; bit 3: TR-B; bit 4: RESET; bit 5: unused; bit 6: TH-A; bit 7: TH-B*/
1578   return ((input_port_read(machine, "PAD2") & 0x3c) >> 2) | 0x10;
1578   return ((machine.root_device().ioport("PAD2")->read() & 0x3c) >> 2) | 0x10;
15791579}
15801580
15811581
src/mame/machine/bsktball.c
r15082r15083
5858   int p2_vert;
5959   int temp;
6060
61   p1_horiz = input_port_read(machine(), "TRACK0_X");
62   p1_vert  = input_port_read(machine(), "TRACK0_Y");
63   p2_horiz = input_port_read(machine(), "TRACK1_X");
64   p2_vert  = input_port_read(machine(), "TRACK1_Y");
61   p1_horiz = ioport("TRACK0_X")->read();
62   p1_vert  = ioport("TRACK0_Y")->read();
63   p2_horiz = ioport("TRACK1_X")->read();
64   p2_vert  = ioport("TRACK1_Y")->read();
6565
6666   /* Set direction bits */
6767
r15082r15083
146146   }
147147   else
148148   {
149      temp = input_port_read(machine(), "IN0") & 0x0f;
149      temp = ioport("IN0")->read() & 0x0f;
150150
151151      return (temp | m_dir0 | m_dir1 | m_dir2 | m_dir3);
152152   }
src/mame/machine/harddriv.c
r15082r15083
5959   atarigen_init(machine);
6060
6161   /* predetermine memory regions */
62   state->m_sim_memory = (UINT16 *)machine.root_device().memregion("user1")->base();
62   state->m_sim_memory = (UINT16 *)state->memregion("user1")->base();
6363   state->m_sim_memory_size = state->memregion("user1")->bytes() / 2;
6464   state->m_adsp_pgm_memory_word = (UINT16 *)(reinterpret_cast<UINT8 *>(state->m_adsp_pgm_memory.target()) + 1);
6565}
r15082r15083
238238            .....
239239        0x8000 = SW1 #1
240240    */
241   int temp = input_port_read(space->machine(), "IN0");
241   int temp = space->machine().root_device().ioport("IN0")->read();
242242   if (atarigen_get_hblank(*space->machine().primary_screen)) temp ^= 0x0002;
243243   temp ^= 0x0018;      /* both EOCs always high for now */
244244   return temp;
r15082r15083
248248READ16_HANDLER( hdc68k_port1_r )
249249{
250250   harddriv_state *state = space->machine().driver_data<harddriv_state>();
251   UINT16 result = input_port_read(space->machine(), "a80000");
251   UINT16 result = state->ioport("a80000")->read();
252252   UINT16 diff = result ^ state->m_hdc68k_last_port1;
253253
254254   /* if a new shifter position is selected, use it */
r15082r15083
277277READ16_HANDLER( hda68k_port1_r )
278278{
279279   harddriv_state *state = space->machine().driver_data<harddriv_state>();
280   UINT16 result = input_port_read(space->machine(), "a80000");
280   UINT16 result = state->ioport("a80000")->read();
281281
282282   /* merge in the wheel edge latch bit */
283283   if (state->m_hdc68k_wheel_edge)
r15082r15083
292292   harddriv_state *state = space->machine().driver_data<harddriv_state>();
293293
294294   /* grab the new wheel value and upconvert to 12 bits */
295   UINT16 new_wheel = input_port_read(space->machine(), "12BADC0") << 4;
295   UINT16 new_wheel = state->ioport("12BADC0")->read() << 4;
296296
297297   /* hack to display the wheel position */
298298   if (space->machine().input().code_pressed(KEYCODE_LSHIFT))
r15082r15083
350350   if (state->m_adc_control & 0x08)
351351   {
352352      state->m_adc8_select = state->m_adc_control & 0x07;
353      state->m_adc8_data = input_port_read(space->machine(), adc8names[state->m_adc8_select]);
353      state->m_adc8_data = state->ioport(adc8names[state->m_adc8_select])->read();
354354   }
355355
356356   /* handle a write to the 12-bit ADC address select */
357357   if (state->m_adc_control & 0x40)
358358   {
359359      state->m_adc12_select = (state->m_adc_control >> 4) & 0x03;
360      state->m_adc12_data = input_port_read(space->machine(), adc12names[state->m_adc12_select]) << 4;
360      state->m_adc12_data = space->machine().root_device().ioport(adc12names[state->m_adc12_select])->read() << 4;
361361   }
362362
363363   /* bit 7 selects which byte of the 12 bit data to read */
src/mame/machine/beezer.c
r15082r15083
111111      switch (data & 0x03)
112112      {
113113      case 0:
114         state->m_pbus = input_port_read(device->machine(), "IN0");
114         state->m_pbus = state->ioport("IN0")->read();
115115         break;
116116      case 1:
117         state->m_pbus = input_port_read(device->machine(), "IN1") | (input_port_read(device->machine(), "IN2") << 4);
117         state->m_pbus = state->ioport("IN1")->read() | (state->ioport("IN2")->read() << 4);
118118         break;
119119      case 2:
120         state->m_pbus = input_port_read(device->machine(), "DSWB");
120         state->m_pbus = state->ioport("DSWB")->read();
121121         break;
122122      case 3:
123         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.
123         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.
124124         break;
125125      }
126126   }
src/mame/machine/kaneko16.c
r15082r15083
20592059
20602060   if ( calc3.mcu_status != (1|2|4|8) )   return;
20612061
2062   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
2062   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
20632063
20642064
20652065   //calc3.mcu_status = 0;
r15082r15083
21002100         printf("Calc 3 Init Command - %04x ROM Checksum Address\n",  calc3.checksumaddress);
21012101         printf("Calc 3 Init Command - %08x Data Write Address\n",  calc3.writeaddress);
21022102#endif
2103   //      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
2103   //      space->write_byte(calc3.dsw_addr+0x200000, ( ~state->ioport("DSW1")->read())&0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame
21042104
21052105         state->m_mcu_ram[calc3.checksumaddress / 2] = calc3.mcu_crc;            // MCU Rom Checksum!
21062106
r15082r15083
24062406
24072407      case 0x03:   // DSW
24082408      {
2409         kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1");
2409         kaneko16_mcu_ram[mcu_offset] = machine.root_device().ioport("DSW1")->read();
24102410         logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine.describe_context(), mcu_command, mcu_offset*2);
24112411      }
24122412      break;
r15082r15083
24642464
24652465      case 0x03:   // DSW
24662466      {
2467         kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1");
2467         kaneko16_mcu_ram[mcu_offset] = machine.root_device().ioport("DSW1")->read();
24682468         logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine.describe_context(), mcu_command, mcu_offset*2);
24692469      }
24702470      break;
r15082r15083
25372537
25382538      case 0x03:   // DSW
25392539      {
2540         kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1");
2540         kaneko16_mcu_ram[mcu_offset] = machine.root_device().ioport("DSW1")->read();
25412541      }
25422542      break;
25432543
src/mame/machine/pgmprot.c
r15082r15083
2121
2222   // The mode is dependent on the region
2323   static const int modes[4] = { 1, 1, 3, 2 };
24   int mode = modes[input_port_read(machine, "Region") & 3];
24   int mode = modes[machine.root_device().ioport("Region")->read() & 3];
2525
2626   switch (mode)
2727   {
r15082r15083
6060
6161   switch (state->m_asic3_reg)
6262   {
63   case 0x00: res = (state->m_asic3_latch[0] & 0xf7) | ((input_port_read(space->machine(), "Region") << 3) & 0x08); break;
63   case 0x00: res = (state->m_asic3_latch[0] & 0xf7) | ((state->ioport("Region")->read() << 3) & 0x08); break;
6464   case 0x01: res = state->m_asic3_latch[1]; break;
65   case 0x02: res = (state->m_asic3_latch[2] & 0x7f) | ((input_port_read(space->machine(), "Region") << 6) & 0x80); break;
65   case 0x02: res = (state->m_asic3_latch[2] & 0x7f) | ((state->ioport("Region")->read() << 6) & 0x80); break;
6666   case 0x03:
6767      res = (BIT(state->m_asic3_hold, 15) << 0)
6868         | (BIT(state->m_asic3_hold, 12) << 1)
src/mame/machine/mcr68.c
r15082r15083
4141
4242static READ8_DEVICE_HANDLER( zwackery_port_1_r )
4343{
44   UINT8 ret = input_port_read(device->machine(), "IN1");
44   UINT8 ret = device->machine().root_device().ioport("IN1")->read();
4545
4646   downcast<pia6821_device *>(device)->set_port_a_z_mask(ret);
4747
r15082r15083
5151
5252static READ8_DEVICE_HANDLER( zwackery_port_3_r )
5353{
54   UINT8 ret = input_port_read(device->machine(), "IN3");
54   UINT8 ret = device->machine().root_device().ioport("IN3")->read();
5555
5656   downcast<pia6821_device *>(device)->set_port_a_z_mask(ret);
5757
src/mame/machine/atarifb.c
r15082r15083
154154           (m_sign_x_2 >> 6) |
155155           (m_sign_y_1 >> 5) |
156156           (m_sign_x_1 >> 4) |
157           input_port_read(machine(), "IN0");
157           ioport("IN0")->read();
158158      return val;
159159   }
160160   else
r15082r15083
162162      int new_x, new_y;
163163
164164      /* Read player 1 trackball */
165      new_x = input_port_read(machine(), "IN3");
165      new_x = ioport("IN3")->read();
166166      if (new_x != m_counter_x_in0)
167167      {
168168         m_sign_x_1 = (new_x - m_counter_x_in0) & 0x80;
169169         m_counter_x_in0 = new_x;
170170      }
171171
172      new_y = input_port_read(machine(), "IN2");
172      new_y = ioport("IN2")->read();
173173      if (new_y != m_counter_y_in0)
174174      {
175175         m_sign_y_1 = (new_y - m_counter_y_in0) & 0x80;
r15082r15083
186186
187187   if ((m_CTRLD & 0x20) == 0x00)
188188   {
189      return input_port_read(machine(), "IN1");
189      return ioport("IN1")->read();
190190   }
191191   else
192192   {
193193      int new_x, new_y;
194194
195195      /* Read player 2 trackball */
196      new_x = input_port_read(machine(), "IN5");
196      new_x = ioport("IN5")->read();
197197      if (new_x != m_counter_x_in2)
198198      {
199199         m_sign_x_2 = (new_x - m_counter_x_in2) & 0x80;
200200         m_counter_x_in2 = new_x;
201201      }
202202
203      new_y = input_port_read(machine(), "IN4");
203      new_y = ioport("IN4")->read();
204204      if (new_y != m_counter_y_in2)
205205      {
206206         m_sign_y_2 = (new_y - m_counter_y_in2) & 0x80;
r15082r15083
235235      int new_x, new_y;
236236
237237      /* Read player 1 trackball */
238      new_x = input_port_read(machine(), "IN3");
238      new_x = ioport("IN3")->read();
239239      if (new_x != m_counter_x_in0)
240240      {
241241         m_sign_x_1 = (new_x - m_counter_x_in0) & 0x80;
242242         m_counter_x_in0 = new_x;
243243      }
244244
245      new_y = input_port_read(machine(), "IN2");
245      new_y = ioport("IN2")->read();
246246      if (new_y != m_counter_y_in0)
247247      {
248248         m_sign_y_1 = (new_y - m_counter_y_in0) & 0x80;
r15082r15083
257257      int new_x, new_y;
258258
259259      /* Read player 2 trackball */
260      new_x = input_port_read(machine(), "IN5");
260      new_x = ioport("IN5")->read();
261261      if (new_x != m_counter_x_in0b)
262262      {
263263         m_sign_x_2 = (new_x - m_counter_x_in0b) & 0x80;
264264         m_counter_x_in0b = new_x;
265265      }
266266
267      new_y = input_port_read(machine(), "IN4");
267      new_y = ioport("IN4")->read();
268268      if (new_y != m_counter_y_in0b)
269269      {
270270         m_sign_y_2 = (new_y - m_counter_y_in0b) & 0x80;
r15082r15083
283283
284284   if ((m_CTRLD & 0x40) == 0x00)
285285   {
286      return input_port_read(machine(), "IN1");
286      return ioport("IN1")->read();
287287   }
288288   else if ((m_CTRLD & 0x60) == 0x60)
289289   /* LD1 and LD2 both high, return Team 2 right player (player 3) */
r15082r15083
291291      int new_x, new_y;
292292
293293      /* Read player 3 trackball */
294      new_x = input_port_read(machine(), "IN7");
294      new_x = ioport("IN7")->read();
295295      if (new_x != m_counter_x_in2)
296296      {
297297         m_sign_x_3 = (new_x - m_counter_x_in2) & 0x80;
298298         m_counter_x_in2 = new_x;
299299      }
300300
301      new_y = input_port_read(machine(), "IN6");
301      new_y = ioport("IN6")->read();
302302      if (new_y != m_counter_y_in2)
303303      {
304304         m_sign_y_3 = (new_y - m_counter_y_in2) & 0x80;
r15082r15083
313313      int new_x, new_y;
314314
315315      /* Read player 4 trackball */
316      new_x = input_port_read(machine(), "IN9");
316      new_x = ioport("IN9")->read();
317317      if (new_x != m_counter_x_in2b)
318318      {
319319         m_sign_x_4 = (new_x - m_counter_x_in2b) & 0x80;
320320         m_counter_x_in2b = new_x;
321321      }
322322
323      new_y = input_port_read(machine(), "IN8");
323      new_y = ioport("IN8")->read();
324324      if (new_y != m_counter_y_in2b)
325325      {
326326         m_sign_y_4 = (new_y - m_counter_y_in2b) & 0x80;
src/mame/machine/simpsons.c
r15082r15083
1717   if (data == 0xff)
1818      return;
1919
20   input_port_write(machine(), "EEPROMOUT", data, 0xff);
20   ioport("EEPROMOUT")->write(data, 0xff);
2121
2222   m_video_bank = data & 0x03;
2323   simpsons_video_banking(machine(), m_video_bank);
src/mame/machine/dc-ctrl.c
r15082r15083
7272{
7373   dest[0] = 0x20000000; // Controller
7474   dest[1] =
75      (input_port_exists(machine(), port_tag[2]) ? 0x010000 : 0) |
76      (input_port_exists(machine(), port_tag[3]) ? 0x020000 : 0) |
77      (input_port_exists(machine(), port_tag[4]) ? 0x040000 : 0) |
78      (input_port_exists(machine(), port_tag[5]) ? 0x080000 : 0) |
79      (input_port_exists(machine(), port_tag[6]) ? 0x100000 : 0) |
80      (input_port_exists(machine(), port_tag[7]) ? 0x200000 : 0) |
81      (input_port_active_safe(machine(), port_tag[0], 0) << 8) |
82      input_port_active_safe(machine(), port_tag[1], 0); // 1st function - controller
75      ((machine().root_device().ioport(port_tag[2]) != NULL) ? 0x010000 : 0) |
76      ((machine().root_device().ioport(port_tag[3]) != NULL) ? 0x020000 : 0) |
77      ((machine().root_device().ioport(port_tag[4]) != NULL) ? 0x040000 : 0) |
78      ((machine().root_device().ioport(port_tag[5]) != NULL) ? 0x080000 : 0) |
79      ((machine().root_device().ioport(port_tag[6]) != NULL) ? 0x100000 : 0) |
80      ((machine().root_device().ioport(port_tag[7]) != NULL) ? 0x200000 : 0) |
81      (machine().root_device().ioport(port_tag[0])->active_safe(0) << 8) |
82      machine().root_device().ioport(port_tag[1])->active_safe(0); // 1st function - controller
8383   dest[2] = 0; // No 2nd function
8484   dest[3] = 0; // No 3rd function
8585   dest[4] = 0x00ff; // Every region, no expansion
r15082r15083
9797{
9898   dest[0] = 0x21000000; // Controller
9999   dest[1] =
100      input_port_read_safe(machine(), port_tag[0], 0xff) |
101      (input_port_read_safe(machine(), port_tag[1], 0xff) << 8) |
102      (input_port_read_safe(machine(), port_tag[2], 0x00) << 16) |
103      (input_port_read_safe(machine(), port_tag[3], 0x00) << 24);
100      ioport(port_tag[0])->read_safe(0xff) |
101      (ioport(port_tag[1])->read_safe(0xff) << 8) |
102      (ioport(port_tag[2])->read_safe(0x00) << 16) |
103      (ioport(port_tag[3])->read_safe(0x00) << 24);
104104   dest[2] =
105      input_port_read_safe(machine(), port_tag[4], 0x80) |
106      (input_port_read_safe(machine(), port_tag[5], 0x80) << 8) |
107      (input_port_read_safe(machine(), port_tag[6], 0x80) << 16) |
108      (input_port_read_safe(machine(), port_tag[7], 0x80) << 24);
105      ioport(port_tag[4])->read_safe(0x80) |
106      (ioport(port_tag[5])->read_safe(0x80) << 8) |
107      (ioport(port_tag[6])->read_safe(0x80) << 16) |
108      (ioport(port_tag[7])->read_safe(0x80) << 24);
109109}
110110
src/mame/machine/micro3d.c
r15082r15083
488488
489489READ16_MEMBER(micro3d_state::micro3d_encoder_h_r)
490490{
491   UINT16 x_encoder = input_port_read_safe(machine(), "JOYSTICK_X", 0);
492   UINT16 y_encoder = input_port_read_safe(machine(), "JOYSTICK_Y", 0);
491   UINT16 x_encoder = ioport("JOYSTICK_X")->read_safe(0);
492   UINT16 y_encoder = ioport("JOYSTICK_Y")->read_safe(0);
493493
494494   return (y_encoder & 0xf00) | ((x_encoder & 0xf00) >> 8);
495495}
496496
497497READ16_MEMBER(micro3d_state::micro3d_encoder_l_r)
498498{
499   UINT16 x_encoder = input_port_read_safe(machine(), "JOYSTICK_X", 0);
500   UINT16 y_encoder = input_port_read_safe(machine(), "JOYSTICK_Y", 0);
499   UINT16 x_encoder = ioport("JOYSTICK_X")->read_safe(0);
500   UINT16 y_encoder = ioport("JOYSTICK_Y")->read_safe(0);
501501
502502   return ((y_encoder & 0xff) << 8) | (x_encoder & 0xff);
503503}
r15082r15083
508508
509509   switch (param)
510510   {
511      case 0: state->m_adc_val = input_port_read_safe(machine, "THROTTLE", 0);
511      case 0: state->m_adc_val = state->ioport("THROTTLE")->read_safe(0);
512512            break;
513      case 1: state->m_adc_val = (UINT8)((255.0/100.0) * input_port_read(machine, "VOLUME") + 0.5);
513      case 1: state->m_adc_val = (UINT8)((255.0/100.0) * state->ioport("VOLUME")->read() + 0.5);
514514            break;
515515      case 2: break;
516516      case 3: break;
src/mame/machine/playch10.c
r15082r15083
4646MACHINE_START( pc10 )
4747{
4848   playch10_state *state = machine.driver_data<playch10_state>();
49   state->m_vrom = machine.root_device().memregion("gfx2")->base();
49   state->m_vrom = state->memregion("gfx2")->base();
5050
5151   /* allocate 4K of nametable ram here */
5252   /* move to individual boards as documentation of actual boards allows */
r15082r15083
214214      return;
215215
216216   /* load up the latches */
217   m_input_latch[0] = input_port_read(machine(), "P1");
218   m_input_latch[1] = input_port_read(machine(), "P2");
217   m_input_latch[0] = ioport("P1")->read();
218   m_input_latch[1] = ioport("P2")->read();
219219
220220   /* apply any masking from the BIOS */
221221   if (m_cntrl_mask)
r15082r15083
250250   if (m_pc10_gun_controller)
251251   {
252252      ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
253      int trigger = input_port_read(machine(), "P1");
254      int x = input_port_read(machine(), "GUNX");
255      int y = input_port_read(machine(), "GUNY");
253      int trigger = ioport("P1")->read();
254      int x = ioport("GUNX")->read();
255      int y = ioport("GUNY")->read();
256256      UINT32 pix, color_base;
257257
258258      /* no sprite hit (yet) */
src/mame/machine/atari.c
r15082r15083
6464
6565READ8_DEVICE_HANDLER(atari_pia_pa_r)
6666{
67   return input_port_read_safe(device->machine(), "djoy_0_1", 0);
67   return device->machine().root_device().ioport("djoy_0_1")->read_safe(0);
6868}
6969
7070READ8_DEVICE_HANDLER(atari_pia_pb_r)
7171{
72   return input_port_read_safe(device->machine(), "djoy_2_3", 0);
72   return device->machine().root_device().ioport("djoy_2_3")->read_safe(0);
7373}
7474
7575WRITE8_DEVICE_HANDLER(a600xl_pia_pb_w) { a600xl_mmu(device->machine(), data); }
r15082r15083
169169   /* check keyboard */
170170   for( i = 0; i < 8; i++ )
171171   {
172      ipt = input_port_read_safe(machine, tag[i], 0);
172      ipt = machine.root_device().ioport(tag[i])->read_safe(0);
173173
174174      if( ipt )
175175      {
r15082r15083
183183         atari_code = i*8 + count;
184184
185185         /* SHIFT */
186         if(input_port_read_safe(machine, "fake", 0) & 0x01)
186         if(machine.root_device().ioport("fake")->read_safe(0) & 0x01)
187187            atari_code |= 0x40;
188188
189189         /* CTRL */
190         if(input_port_read_safe(machine, "fake", 0) & 0x02)
190         if(machine.root_device().ioport("fake")->read_safe(0) & 0x02)
191191            atari_code |= 0x80;
192192
193193         if( atari_code != AKEY_NONE )
r15082r15083
251251   /* check keypad */
252252   for( i = 0; i < 4; i++ )
253253   {
254      ipt = input_port_read_safe(machine, tag[i], 0);
254      ipt = machine.root_device().ioport(tag[i])->read_safe(0);
255255
256256      if( ipt )
257257      {
r15082r15083
281281   }
282282
283283   /* check top button */
284   if ((input_port_read(machine, "djoy_b") & 0x10) == 0)
284   if ((machine.root_device().ioport("djoy_b")->read() & 0x10) == 0)
285285   {
286286      if (atari_last == 0xfe)
287287         return;
r15082r15083
316316
317317static UINT8 console_read(address_space *space)
318318{
319   return input_port_read(space->machine(), "console");
319   return space->machine().root_device().ioport("console")->read();
320320}
321321
322322
src/mame/machine/smpc.c
r15082r15083
345345   static const char *const padnames[] = { "JOY1", "JOY2" };
346346   UINT16 pad_data;
347347
348   pad_data = input_port_read(machine, padnames[pad_num]);
348   pad_data = machine.root_device().ioport(padnames[pad_num])->read();
349349   state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
350350   state->m_smpc.OREG[1+pad_num*offset] = 0x02;
351351   state->m_smpc.OREG[2+pad_num*offset] = pad_data>>8;
r15082r15083
360360                                    { "AN_X2", "AN_Y2", "AN_Z2" }};
361361   UINT16 pad_data;
362362
363   pad_data = input_port_read(machine, padnames[pad_num]);
363   pad_data = machine.root_device().ioport(padnames[pad_num])->read();
364364   state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
365365   state->m_smpc.OREG[1+pad_num*offset] = id;
366366   state->m_smpc.OREG[2+pad_num*offset] = pad_data>>8;
367367   state->m_smpc.OREG[3+pad_num*offset] = pad_data & 0xff;
368   state->m_smpc.OREG[4+pad_num*offset] = input_port_read(machine, annames[pad_num][0]);
368   state->m_smpc.OREG[4+pad_num*offset] = machine.root_device().ioport(annames[pad_num][0])->read();
369369   if(id == 0x15)
370370   {
371      state->m_smpc.OREG[5+pad_num*offset] = input_port_read(machine, annames[pad_num][1]);
372      state->m_smpc.OREG[6+pad_num*offset] = input_port_read(machine, annames[pad_num][2]);
371      state->m_smpc.OREG[5+pad_num*offset] = machine.root_device().ioport(annames[pad_num][1])->read();
372      state->m_smpc.OREG[6+pad_num*offset] = machine.root_device().ioport(annames[pad_num][2])->read();
373373   }
374374}
375375
r15082r15083
380380
381381   game_key = 0xffff;
382382
383   game_key ^= ((input_port_read(machine, "KEYS_1") & 0x80) << 8); // right
384   game_key ^= ((input_port_read(machine, "KEYS_1") & 0x40) << 8); // left
385   game_key ^= ((input_port_read(machine, "KEYS_1") & 0x20) << 8); // down
386   game_key ^= ((input_port_read(machine, "KEYS_1") & 0x10) << 8); // up
387   game_key ^= ((input_port_read(machine, "KEYF") & 0x80) << 4); // ESC -> START
388   game_key ^= ((input_port_read(machine, "KEY3") & 0x04) << 8); // Z / A trigger
389   game_key ^= ((input_port_read(machine, "KEY4") & 0x02) << 8); // C / C trigger
390   game_key ^= ((input_port_read(machine, "KEY6") & 0x04) << 6); // X / B trigger
391   game_key ^= ((input_port_read(machine, "KEY2") & 0x20) << 2); // Q / R trigger
392   game_key ^= ((input_port_read(machine, "KEY3") & 0x10) << 2); // A / X trigger
393   game_key ^= ((input_port_read(machine, "KEY3") & 0x08) << 2); // S / Y trigger
394   game_key ^= ((input_port_read(machine, "KEY4") & 0x08) << 1); // D / Z trigger
395   game_key ^= ((input_port_read(machine, "KEY4") & 0x10) >> 1); // E / L trigger
383   game_key ^= ((state->ioport("KEYS_1")->read() & 0x80) << 8); // right
384   game_key ^= ((state->ioport("KEYS_1")->read() & 0x40) << 8); // left
385   game_key ^= ((state->ioport("KEYS_1")->read() & 0x20) << 8); // down
386   game_key ^= ((state->ioport("KEYS_1")->read() & 0x10) << 8); // up
387   game_key ^= ((state->ioport("KEYF")->read() & 0x80) << 4); // ESC -> START
388   game_key ^= ((state->ioport("KEY3")->read() & 0x04) << 8); // Z / A trigger
389   game_key ^= ((state->ioport("KEY4")->read() & 0x02) << 8); // C / C trigger
390   game_key ^= ((state->ioport("KEY6")->read() & 0x04) << 6); // X / B trigger
391   game_key ^= ((state->ioport("KEY2")->read() & 0x20) << 2); // Q / R trigger
392   game_key ^= ((state->ioport("KEY3")->read() & 0x10) << 2); // A / X trigger
393   game_key ^= ((state->ioport("KEY3")->read() & 0x08) << 2); // S / Y trigger
394   game_key ^= ((state->ioport("KEY4")->read() & 0x08) << 1); // D / Z trigger
395   game_key ^= ((state->ioport("KEY4")->read() & 0x10) >> 1); // E / L trigger
396396
397397   state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
398398   state->m_smpc.OREG[1+pad_num*offset] = 0x34;
r15082r15083
420420   UINT8 mouse_ctrl;
421421   INT16 mouse_x, mouse_y;
422422
423   mouse_ctrl = input_port_read(machine, mousenames[pad_num][0]);
424   mouse_x = input_port_read(machine, mousenames[pad_num][1]);
425   mouse_y = input_port_read(machine, mousenames[pad_num][2]);
423   mouse_ctrl = machine.root_device().ioport(mousenames[pad_num][0])->read();
424   mouse_x = machine.root_device().ioport(mousenames[pad_num][1])->read();
425   mouse_y = machine.root_device().ioport(mousenames[pad_num][2])->read();
426426
427427   if(mouse_x < 0)
428428      mouse_ctrl |= 0x10;
r15082r15083
450450   static const char *const padnames[] = { "MD_JOY1", "MD_JOY2" };
451451   UINT16 pad_data;
452452
453   pad_data = input_port_read(machine, padnames[pad_num]);
453   pad_data = machine.root_device().ioport(padnames[pad_num])->read();
454454   state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
455455   state->m_smpc.OREG[1+pad_num*offset] = id;
456456   state->m_smpc.OREG[2+pad_num*offset] = pad_data>>8;
r15082r15083
475475
476476//  if (LOG_SMPC) logerror("SMPC: providing PAD data for intback, pad %d\n", intback_stage-2);
477477
478   read_id[0] = (input_port_read(machine, "INPUT_TYPE")) & 0x0f;
479   read_id[1] = (input_port_read(machine, "INPUT_TYPE")) >> 4;
478   read_id[0] = (machine.root_device().ioport("INPUT_TYPE")->read()) & 0x0f;
479   read_id[1] = (machine.root_device().ioport("INPUT_TYPE")->read()) >> 4;
480480
481481   /* doesn't work? */
482482   //pad_num = state->m_smpc.intback_stage - 1;
r15082r15083
744744      return_data = state->m_smpc.SF;
745745
746746   if (offset == 0x75)//PDR1 read
747      return_data = input_port_read(space->machine(), "DSW1");
747      return_data = state->ioport("DSW1")->read();
748748
749749   if (offset == 0x77)//PDR2 read
750750      return_data = (0xfe | space->machine().device<eeprom_device>("eeprom")->read_bit());
r15082r15083
866866         const int shift_bit[4] = { 4, 12, 8, 0 };
867867         const char *const padnames[] = { "JOY1", "JOY2" };
868868
869         if(input_port_read(space->machine(), "INPUT_TYPE") && !(space->debugger_access()))
869         if(space->machine().root_device().ioport("INPUT_TYPE")->read() && !(space->debugger_access()))
870870         {
871871            popmessage("Warning: read with SH-2 direct mode with a non-pad device");
872872            return 0;
r15082r15083
879879
880880         if (LOG_SMPC) logerror("SMPC: SH-2 direct mode, returning data for phase %d\n", hshake);
881881
882         return_data = 0x80 | 0x10 | ((input_port_read(space->machine(), padnames[offset == 0x77])>>shift_bit[hshake]) & 0xf);
882         return_data = 0x80 | 0x10 | ((space->machine().root_device().ioport(padnames[offset == 0x77])->read()>>shift_bit[hshake]) & 0xf);
883883      }
884884   }
885885
src/mame/machine/acitya.c
r15082r15083
184184MACHINE_START( acitya )
185185{
186186   pacman_state *state = machine.driver_data<pacman_state>();
187   UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
187   UINT8 *RAM = state->memregion("maincpu")->base();
188188
189189   /* While the PAL supports up to 16 decryption methods, only four
190190        are actually used in the PAL.  Therefore, we'll take a little
src/mame/machine/pgmprot4.c
r15082r15083
334334         }
335335         else
336336         {
337            UINT32 protvalue = 0x89911400 | input_port_read(space->machine(), "Region");
337            UINT32 protvalue = 0x89911400 | space->machine().root_device().ioport("Region")->read();
338338            ret = (protvalue >> (8 * (state->m_kb_ptr - 1))) & 0xff;
339339         }
340340
r15082r15083
514514      else if(state->m_kb_cmd==5)
515515      {
516516         UINT32 protvalue;
517         protvalue = 0x60000|input_port_read(space->machine(), "Region");
517         protvalue = 0x60000|space->machine().root_device().ioport("Region")->read();
518518         res=(protvalue>>(8*(ptr-1)))&0xff;
519519
520520
src/mame/machine/decocass.c
r15082r15083
152152   decocass_state *state = space->machine().driver_data<decocass_state>();
153153
154154   /* just latch the analog controls here */
155   state->m_quadrature_decoder[0] = input_port_read(space->machine(), "AN0");
156   state->m_quadrature_decoder[1] = input_port_read(space->machine(), "AN1");
157   state->m_quadrature_decoder[2] = input_port_read(space->machine(), "AN2");
158   state->m_quadrature_decoder[3] = input_port_read(space->machine(), "AN3");
155   state->m_quadrature_decoder[0] = state->ioport("AN0")->read();
156   state->m_quadrature_decoder[1] = state->ioport("AN1")->read();
157   state->m_quadrature_decoder[2] = state->ioport("AN2")->read();
158   state->m_quadrature_decoder[3] = state->ioport("AN3")->read();
159159}
160160
161161WRITE8_HANDLER( decocass_adc_w )
r15082r15083
181181   switch (offset & 7)
182182   {
183183   case 0: case 1: case 2:
184      data = input_port_read(space->machine(), portnames[offset & 7]);
184      data = space->machine().root_device().ioport(portnames[offset & 7])->read();
185185      break;
186186   case 3: case 4: case 5: case 6:
187187      data = state->m_quadrature_decoder[(offset & 7) - 3];
src/mame/machine/irobot.c
r15082r15083
204204{
205205
206206   if (m_control_num == 0)
207      return input_port_read(machine(), "AN0");
207      return ioport("AN0")->read();
208208   else if (m_control_num == 1)
209      return input_port_read(machine(), "AN1");
209      return ioport("AN1")->read();
210210   return 0;
211211
212212}
src/mame/machine/leland.c
r15082r15083
8383
8484READ8_MEMBER(leland_state::cerberus_dial_1_r)
8585{
86   int original = input_port_read(machine(), "IN0");
87   int modified = dial_compute_value(machine(), input_port_read(machine(), "AN0"), 0);
86   int original = ioport("IN0")->read();
87   int modified = dial_compute_value(machine(), ioport("AN0")->read(), 0);
8888   return (original & 0xc0) | ((modified & 0x80) >> 2) | (modified & 0x1f);
8989}
9090
9191
9292READ8_MEMBER(leland_state::cerberus_dial_2_r)
9393{
94   int original = input_port_read(machine(), "IN0");
95   int modified = dial_compute_value(machine(), input_port_read(machine(), "AN1"), 1);
94   int original = ioport("IN0")->read();
95   int modified = dial_compute_value(machine(), ioport("AN1")->read(), 1);
9696   return (original & 0xc0) | ((modified & 0x80) >> 2) | (modified & 0x1f);
9797}
9898
r15082r15083
136136static void update_dangerz_xy(running_machine &machine)
137137{
138138   leland_state *state = machine.driver_data<leland_state>();
139   UINT8 newy = input_port_read(machine, "AN0");
140   UINT8 newx = input_port_read(machine, "AN1");
139   UINT8 newy = state->ioport("AN0")->read();
140   UINT8 newx = state->ioport("AN1")->read();
141141   int deltay = newy - state->m_dial_last_input[0];
142142   int deltax = newx - state->m_dial_last_input[1];
143143
r15082r15083
190190
191191READ8_MEMBER(leland_state::redline_pedal_1_r)
192192{
193   int pedal = input_port_read(machine(), "IN0");
193   int pedal = ioport("IN0")->read();
194194   return redline_pedal_value[pedal >> 5] | 0x0f;
195195}
196196
197197
198198READ8_MEMBER(leland_state::redline_pedal_2_r)
199199{
200   int pedal = input_port_read(machine(), "IN2");
200   int pedal = ioport("IN2")->read();
201201   return redline_pedal_value[pedal >> 5] | 0x0f;
202202}
203203
204204
205205READ8_MEMBER(leland_state::redline_wheel_1_r)
206206{
207   return dial_compute_value(machine(), input_port_read(machine(), "AN0"), 0);
207   return dial_compute_value(machine(), ioport("AN0")->read(), 0);
208208}
209209
210210
211211READ8_MEMBER(leland_state::redline_wheel_2_r)
212212{
213   return dial_compute_value(machine(), input_port_read(machine(), "AN1"), 1);
213   return dial_compute_value(machine(), ioport("AN1")->read(), 1);
214214}
215215
216216
r15082r15083
223223
224224READ8_MEMBER(leland_state::offroad_wheel_1_r)
225225{
226   return dial_compute_value(machine(), input_port_read(machine(), "AN3"), 0);
226   return dial_compute_value(machine(), ioport("AN3")->read(), 0);
227227}
228228
229229
230230READ8_MEMBER(leland_state::offroad_wheel_2_r)
231231{
232   return dial_compute_value(machine(), input_port_read(machine(), "AN4"), 1);
232   return dial_compute_value(machine(), ioport("AN4")->read(), 1);
233233}
234234
235235
236236READ8_MEMBER(leland_state::offroad_wheel_3_r)
237237{
238   return dial_compute_value(machine(), input_port_read(machine(), "AN5"), 2);
238   return dial_compute_value(machine(), ioport("AN5")->read(), 2);
239239}
240240
241241
r15082r15083
250250{
251251   static const char *const tracknames[] = { "AN0", "AN1", "AN2", "AN3" };
252252
253   return dial_compute_value(machine(), input_port_read(machine(), tracknames[offset]), offset);
253   return dial_compute_value(machine(), ioport(tracknames[offset])->read(), offset);
254254}
255255
256256
r15082r15083
265265{
266266   static const char *const tracknames[] = { "AN0", "AN1", "AN2" };
267267
268   return dial_compute_value(machine(), input_port_read(machine(), tracknames[offset]), offset);
268   return dial_compute_value(machine(), ioport(tracknames[offset])->read(), offset);
269269}
270270
271271
r15082r15083
297297   switch (offset)
298298   {
299299      case 3:
300         m_analog_result = input_port_read(machine(), tracknames[data]);
300         m_analog_result = ioport(tracknames[data])->read();
301301         break;
302302
303303      case 0:
r15082r15083
354354   state->m_alternate_bank = 0;
355355
356356   /* initialize the master banks */
357   state->m_master_length = machine.root_device().memregion("master")->bytes();
358   state->m_master_base = machine.root_device().memregion("master")->base();
357   state->m_master_length = state->memregion("master")->bytes();
358   state->m_master_base = state->memregion("master")->base();
359359   (*state->m_update_master_bank)(machine);
360360
361361   /* initialize the slave banks */
362   state->m_slave_length = machine.root_device().memregion("slave")->bytes();
362   state->m_slave_length = state->memregion("slave")->bytes();
363363   state->m_slave_base = state->memregion("slave")->base();
364364   if (state->m_slave_length > 0x10000)
365365      state->membank("bank3")->set_base(&state->m_slave_base[0x10000]);
r15082r15083
385385   state->m_master_int_timer->adjust(machine.primary_screen->time_until_pos(8), 8);
386386
387387   /* initialize the XROM */
388   state->m_xrom_length = machine.root_device().memregion("user1")->bytes();
389   state->m_xrom_base = machine.root_device().memregion("user1")->base();
388   state->m_xrom_length = state->memregion("user1")->bytes();
389   state->m_xrom_base = state->memregion("user1")->base();
390390   state->m_xrom1_addr = 0;
391391   state->m_xrom2_addr = 0;
392392
r15082r15083
400400   state->m_master_bank = 0;
401401
402402   /* initialize the master banks */
403   state->m_master_length = machine.root_device().memregion("master")->bytes();
404   state->m_master_base = machine.root_device().memregion("master")->base();
403   state->m_master_length = state->memregion("master")->bytes();
404   state->m_master_base = state->memregion("master")->base();
405405   ataxx_bankswitch(machine);
406406
407407   /* initialize the slave banks */
408   state->m_slave_length = machine.root_device().memregion("slave")->bytes();
408   state->m_slave_length = state->memregion("slave")->bytes();
409409   state->m_slave_base = state->memregion("slave")->base();
410410   if (state->m_slave_length > 0x10000)
411411      state->membank("bank3")->set_base(&state->m_slave_base[0x10000]);
r15082r15083
452452INTERRUPT_GEN( leland_master_interrupt )
453453{
454454   /* check for coins here */
455   if ((input_port_read(device->machine(), "IN1") & 0x0e) != 0x0e)
455   if ((device->machine().root_device().ioport("IN1")->read() & 0x0e) != 0x0e)
456456      device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
457457}
458458
r15082r15083
824824
825825READ8_DEVICE_HANDLER( ataxx_eeprom_r )
826826{
827   int port = input_port_read(device->machine(), "IN2");
827   int port = device->machine().root_device().ioport("IN2")->read();
828828   if (LOG_EEPROM) logerror("%s:EE read\n", device->machine().describe_context());
829829   return port;
830830}
r15082r15083
10601060         break;
10611061
10621062      case 0x01:   /* FE = analog port select/bankswitch */
1063         m_analog_result = input_port_read(machine(), portnames[data & 15]);
1063         m_analog_result = ioport(portnames[data & 15])->read();
10641064
10651065         /* update top board banking for some games */
10661066         if (LOG_BANKSWITCHING_M)
r15082r15083
10911091   switch (offset)
10921092   {
10931093      case 0x00:   /* /GIN0 */
1094         result = input_port_read(machine(), "IN0");
1094         result = ioport("IN0")->read();
10951095         break;
10961096
10971097      case 0x01:   /* /GIN1 */
1098         result = input_port_read(machine(), "IN1");
1098         result = ioport("IN1")->read();
10991099         if (cpu_get_reg(machine().device("slave"), Z80_HALT))
11001100            result ^= 0x01;
11011101         break;
r15082r15083
11111111         break;
11121112
11131113      case 0x10:   /* /GIN0 */
1114         result = input_port_read(machine(), "IN2");
1114         result = ioport("IN2")->read();
11151115         break;
11161116
11171117      case 0x11:   /* /GIN1 */
1118         result = input_port_read(machine(), "IN3");
1118         result = ioport("IN3")->read();
11191119         if (LOG_EEPROM) logerror("%04X:EE read\n", cpu_get_pc(&space.device()));
11201120         break;
11211121
r15082r15083
11731173   switch (offset)
11741174   {
11751175      case 0x06:   /* /GIN0 */
1176         result = input_port_read(machine(), "IN0");
1176         result = ioport("IN0")->read();
11771177         break;
11781178
11791179      case 0x07:   /* /SLVBLK */
1180         result = input_port_read(machine(), "IN1");
1180         result = ioport("IN1")->read();
11811181         if (cpu_get_reg(machine().device("slave"), Z80_HALT))
11821182            result ^= 0x01;
11831183         break;
src/mame/machine/midwayic.c
r15082r15083
862862   switch (offset)
863863   {
864864      case IOASIC_PORT0:
865         result = input_port_read(space->machine(), "DIPS");
865         result = space->machine().root_device().ioport("DIPS")->read();
866866         /* bit 0 seems to be a ready flag before shuffling happens */
867867         if (!ioasic.shuffle_active)
868868         {
r15082r15083
874874         break;
875875
876876      case IOASIC_PORT1:
877         result = input_port_read(space->machine(), "SYSTEM");
877         result = space->machine().root_device().ioport("SYSTEM")->read();
878878         break;
879879
880880      case IOASIC_PORT2:
881         result = input_port_read(space->machine(), "IN1");
881         result = space->machine().root_device().ioport("IN1")->read();
882882         break;
883883
884884      case IOASIC_PORT3:
885         result = input_port_read(space->machine(), "IN2");
885         result = space->machine().root_device().ioport("IN2")->read();
886886         break;
887887
888888      case IOASIC_UARTIN:
src/mame/machine/bonzeadv.c
r15082r15083
446446   {
447447      switch (offset)
448448      {
449      case 0x03: return input_port_read(space->machine(), "800007");    /* STARTn + SERVICE1 */
450      case 0x04: return input_port_read(space->machine(), "800009");    /* COINn */
451      case 0x05: return input_port_read(space->machine(), "80000B");    /* Player controls + TILT */
452      case 0x06: return input_port_read(space->machine(), "80000D");    /* Player controls (cocktail) */
449      case 0x03: return state->ioport("800007")->read();    /* STARTn + SERVICE1 */
450      case 0x04: return state->ioport("800009")->read();    /* COINn */
451      case 0x05: return state->ioport("80000B")->read();    /* Player controls + TILT */
452      case 0x06: return state->ioport("80000D")->read();    /* Player controls (cocktail) */
453453      case 0x08: return state->m_cc_port;
454454      }
455455
src/mame/machine/toaplan1.c
r15082r15083
187187{
188188   /* Bit 0x80 is secondary CPU (HD647180) ready signal */
189189   logerror("PC:%04x Warning !!! IO reading from $14000a\n",cpu_get_previouspc(&space.device()));
190   return (0x80 | input_port_read(machine(), "TJUMP")) & 0xff;
190   return (0x80 | ioport("TJUMP")->read()) & 0xff;
191191}
192192
193193READ16_MEMBER(toaplan1_state::vimana_system_port_r)
r15082r15083
203203   int data, p, r, d, slot, reg, dsw;
204204
205205   slot = -1;
206   d = input_port_read(machine(), "DSWA");
207   r = input_port_read(machine(), "TJUMP");
208   p = input_port_read(machine(), "SYSTEM");
206   d = ioport("DSWA")->read();
207   r = ioport("TJUMP")->read();
208   p = ioport("SYSTEM")->read();
209209   m_vimana_latch ^= p;
210210   data = (m_vimana_latch & p);
211211
src/mame/machine/vectrex.c
r15082r15083
125125void vectrex_configuration(running_machine &machine)
126126{
127127   vectrex_state *state = machine.driver_data<vectrex_state>();
128   unsigned char cport = input_port_read(machine, "3DCONF");
128   unsigned char cport = state->ioport("3DCONF")->read();
129129
130130   /* Vectrex 'dipswitch' configuration */
131131
r15082r15083
202202      state->m_beam_color = RGB_WHITE;
203203      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;
204204   }
205   state->m_lightpen_port = input_port_read(machine, "LPENCONF") & 0x03;
205   state->m_lightpen_port = machine.root_device().ioport("LPENCONF")->read() & 0x03;
206206}
207207
208208
r15082r15083
224224   int pot;
225225   static const char *const ctrlnames[] = { "CONTR1X", "CONTR1Y", "CONTR2X", "CONTR2Y" };
226226
227   pot = input_port_read(device->machine(), ctrlnames[(state->m_via_out[PORTB] & 0x6) >> 1]) - 0x80;
227   pot = device->machine().root_device().ioport(ctrlnames[(state->m_via_out[PORTB] & 0x6) >> 1])->read() - 0x80;
228228
229229   if (pot > (signed char)state->m_via_out[PORTA])
230230      state->m_via_out[PORTB] |= 0x20;
r15082r15083
253253READ8_DEVICE_HANDLER(vectrex_s1_via_pb_r)
254254{
255255   vectrex_state *state = device->machine().driver_data<vectrex_state>();
256   return (state->m_via_out[PORTB] & ~0x40) | (input_port_read(device->machine(), "COIN") & 0x40);
256   return (state->m_via_out[PORTB] & ~0x40) | (state->ioport("COIN")->read() & 0x40);
257257}
258258
259259
src/mame/machine/scramble.c
r15082r15083
4343                       0x2b, 0x2a, 0x28, 0x29, 0x09, 0x08, 0x0a, 0x0b,
4444                       0x0f, 0x0e, 0x0c, 0x0d, 0x2d, 0x2c, 0x2e, 0x2f,
4545                       0x27, 0x26, 0x24, 0x25, 0x05, 0x04, 0x06, 0x07 };
46   UINT8 val = input_port_read(machine(), (const char *)param);
46   UINT8 val = ioport((const char *)param)->read();
4747
4848   return remap[val >> 2];
4949}
src/mame/machine/midxunit.c
r15082r15083
126126      case 1:
127127      case 2:
128128      case 3:
129         return input_port_read(machine(), portnames[offset]);
129         return ioport(portnames[offset])->read();
130130
131131      default:
132132         logerror("%08X:Unknown I/O read from %d\n", cpu_get_pc(&space.device()), offset);
r15082r15083
140140{
141141   static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5" };
142142
143   return input_port_read(machine(), portnames[m_analog_port]);
143   return ioport(portnames[m_analog_port])->read();
144144}
145145
146146
r15082r15083
299299   register_state_saving(machine);
300300
301301   /* load the graphics ROMs -- quadruples */
302   midtunit_gfx_rom = base = machine.root_device().memregion("gfx1")->base();
302   midtunit_gfx_rom = base = state->memregion("gfx1")->base();
303303   len = state->memregion("gfx1")->bytes();
304304   for (i = 0; i < len / 0x200000; i++)
305305   {
src/mame/machine/n64.c
r15082r15083
17811781            case 1: //p2 inputs
17821782            {
17831783               //printf("Read p%d inputs\n", channel + 1);
1784                    buttons = input_port_read(machine(), portnames[(channel*3) + 0]);
1785                    x = input_port_read(machine(), portnames[(channel*3) + 1]) - 128;
1786                    y = input_port_read(machine(), portnames[(channel*3) + 2]) - 128;
1784                    buttons = ioport(portnames[(channel*3) + 0])->read();
1785                    x = ioport(portnames[(channel*3) + 1])->read() - 128;
1786                    y = ioport(portnames[(channel*3) + 2])->read() - 128;
17871787
17881788               rdata[0] = (buttons >> 8) & 0xff;
17891789               rdata[1] = (buttons >> 0) & 0xff;
src/mame/machine/stfight.c
r15082r15083
132132// Perhaps define dipswitches as active low?
133133READ8_MEMBER(stfight_state::stfight_dsw_r)
134134{
135    return( ~input_port_read(machine(), offset ? "DSW1" : "DSW0") );
135    return( ~ioport(offset ? "DSW1" : "DSW0")->read() );
136136}
137137
138138READ8_MEMBER(stfight_state::stfight_coin_r)
r15082r15083
154154     *        since it's read by the 30Hz interrupt ISR
155155     */
156156
157    coin_mech_data = input_port_read(machine(), "COIN");
157    coin_mech_data = ioport("COIN")->read();
158158
159159    for( i=0; i<2; i++ )
160160    {
src/mame/machine/tait8741.c
r15082r15083
177177               else
178178               { /* port select */
179179                  st->parallelselect = data & 0x07;
180                  taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,st->parallelselect) : st->portName ? input_port_read(space->machine(), st->portName) : 0);
180                  taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,st->parallelselect) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0);
181181               }
182182            }
183183         }
r15082r15083
188188         case -1: /* no command data */
189189            break;
190190         case 0x00: /* read from parallel port */
191            taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,0) : st->portName ? input_port_read(space->machine(), st->portName) : 0 );
191            taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,0) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0 );
192192            break;
193193         case 0x01: /* read receive buffer 0 */
194194         case 0x02: /* read receive buffer 1 */
r15082r15083
201201            taito8741_hostdata_w(st,st->rxd[data-1]);
202202            break;
203203         case 0x08:   /* latch received serial data */
204            st->txd[0] = st->portHandler ? st->portHandler(space,0) : st->portName ? input_port_read(space->machine(), st->portName) : 0;
204            st->txd[0] = st->portHandler ? st->portHandler(space,0) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0;
205205            if( sst )
206206            {
207207               space->machine().scheduler().synchronize(FUNC(taito8741_serial_tx), num);
r15082r15083
295295   switch( st->mode )
296296   {
297297   case TAITO8741_PORT: /* parallel data */
298      taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space, st->parallelselect) : st->portName ? input_port_read(space->machine(), st->portName) : 0);
298      taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space, st->parallelselect) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0);
299299      break;
300300   }
301301   return ret;
r15082r15083
472472         break;
473473      case 2:
474474#if 1
475         mcu->rxd = input_port_read(space->machine(), "DSW2");
475         mcu->rxd = space->machine().root_device().ioport("DSW2")->read();
476476         mcu->sts |= 0x01; /* RD ready */
477477#endif
478478         break;
r15082r15083
515515   if(offset==1)
516516   {
517517      if(mcu->rst)
518         mcu->rxd = input_port_read(space->machine(), mcu->initReadPort); /* port in */
518         mcu->rxd = space->machine().root_device().ioport(mcu->initReadPort)->read(); /* port in */
519519      ret = mcu->sts;
520520      LOG(("%s:8741[%d]       SR %02X\n",space->machine().describe_context(),num,ret));
521521   }
r15082r15083
579579            cyclemb_mcu.rst = 0;
580580            break;
581581         case 2:
582            cyclemb_mcu.rxd = (input_port_read(space->machine(), "DSW2") & 0x1f) << 2;
582            cyclemb_mcu.rxd = (space->machine().root_device().ioport("DSW2")->read() & 0x1f) << 2;
583583            cyclemb_mcu.rst = 0;
584584            break;
585585         case 3:
586            //cyclemb_mcu.rxd = input_port_read(space->machine(), "DSW2");
586            //cyclemb_mcu.rxd = space->machine().root_device().ioport("DSW2")->read();
587587            cyclemb_mcu.rst = 1;
588588            break;
589589      }
r15082r15083
613613         /* FIXME: remove cpu_get_pc hack */
614614         switch(cpu_get_pc(&space->device()))
615615         {
616            case 0x760: cyclemb_mcu.rxd = ((input_port_read(space->machine(),"DSW1") & 0x1f) << 2); break;
616            case 0x760: cyclemb_mcu.rxd = ((space->machine().root_device().ioport("DSW1")->read() & 0x1f) << 2); break;
617617            case 0x35c:
618618            {
619619               static UINT8 mux_r;
620620               mux_r^=0x20;
621621               if(mux_r & 0x20)
622                  cyclemb_mcu.rxd = ((input_port_read(space->machine(),"DSW3")) & 0x9f) | (mux_r) | (space->machine().rand() & 0x40);
622                  cyclemb_mcu.rxd = ((space->machine().root_device().ioport("DSW3")->read()) & 0x9f) | (mux_r) | (space->machine().rand() & 0x40);
623623               else
624                  cyclemb_mcu.rxd = ((input_port_read(space->machine(),"IN0")) & 0x9f) | (mux_r) | (space->machine().rand() & 0x40);
624                  cyclemb_mcu.rxd = ((space->machine().root_device().ioport("IN0")->read()) & 0x9f) | (mux_r) | (space->machine().rand() & 0x40);
625625            }
626626            break;
627627         }
src/mame/machine/pcecommn.c
r15082r15083
5757   }
5858   else
5959   {
60      data = input_port_read(space->machine(), "JOY");
60      data = space->machine().root_device().ioport("JOY")->read();
6161   }
6262   if(joystick_data_select) data >>= 4;
6363   ret = (data & 0x0F) | pce.io_port_options;
src/mame/machine/qix.c
r15082r15083
410410
411411   UINT8 ddr = m_68705_ddr[1];
412412   UINT8 out = m_68705_port_out[1];
413   UINT8 in = (input_port_read(machine(), "COIN") & 0x0f) | ((input_port_read(machine(), "COIN") & 0x80) >> 3);
413   UINT8 in = (ioport("COIN")->read() & 0x0f) | ((ioport("COIN")->read() & 0x80) >> 3);
414414   return (out & ddr) | (in & ~ddr);
415415}
416416
r15082r15083
420420
421421   UINT8 ddr = m_68705_ddr[2];
422422   UINT8 out = m_68705_port_out[2];
423   UINT8 in = (m_coinctrl & 0x08) | ((input_port_read(machine(), "COIN") & 0x70) >> 4);
423   UINT8 in = (m_coinctrl & 0x08) | ((ioport("COIN")->read() & 0x70) >> 4);
424424   return (out & ddr) | (in & ~ddr);
425425}
426426
r15082r15083
534534{
535535   qix_state *state = device->machine().driver_data<qix_state>();
536536
537   return input_port_read(device->machine(), state->m_flip ? "AN3" : "AN1");
537   return state->ioport(state->m_flip ? "AN3" : "AN1")->read();
538538}
539539
540540
r15082r15083
542542{
543543   qix_state *state = device->machine().driver_data<qix_state>();
544544
545   return input_port_read(device->machine(), state->m_flip ? "AN2" : "AN0");
545   return state->ioport(state->m_flip ? "AN2" : "AN0")->read();
546546}
src/mame/machine/snes.c
r15082r15083
577577
578578      case 0x4100:      /* NSS Dip-Switches */
579579         {
580            const input_port_config *port = state->ioport("DSW");
580            ioport_port *port = state->ioport("DSW");
581581            if (port != NULL)
582               return input_port_read(space->machine(), "DSW");
582               return space->machine().root_device().ioport("DSW")->read();
583583            else
584584               return snes_open_bus_r(space, 0);
585585         }
r15082r15083
16441644
16451645   for (port = 0; port < 2; port++)
16461646   {
1647      state->m_data1[port] = input_port_read(machine, portnames[port][0]) | (input_port_read(machine, portnames[port][1]) << 8);
1648      state->m_data2[port] = input_port_read(machine, portnames[port][2]) | (input_port_read(machine, portnames[port][3]) << 8);
1647      state->m_data1[port] = state->ioport(portnames[port][0])->read() | (state->ioport(portnames[port][1])->read() << 8);
1648      state->m_data2[port] = state->ioport(portnames[port][2])->read() | (state->ioport(portnames[port][3])->read() << 8);
16491649
16501650      // avoid sending signals that could crash games
16511651      // if left, no right
r15082r15083
19981998   UINT16 total_blocks, read_blocks;
19991999   UINT8 *rom;
20002000
2001   rom = machine.root_device().memregion("user3")->base();
2001   rom = state->memregion("user3")->base();
20022002   snes_ram = auto_alloc_array_clear(machine, UINT8, 0x1400000);
20032003
20042004   /* all NSS games seem to use MODE 20 */
r15082r15083
20642064   UINT16 total_blocks, read_blocks;
20652065   UINT8  *rom;
20662066
2067   rom = machine.root_device().memregion("user3")->base();
2067   rom = state->memregion("user3")->base();
20682068   snes_ram = auto_alloc_array(machine, UINT8, 0x1400000);
20692069   memset(snes_ram, 0, 0x1400000);
20702070
src/mame/machine/gaelco2.c
r15082r15083
248248   {
249249      if (!(data & 0xff))
250250      {
251         m_analog_ports[0] = input_port_read_safe(machine(), "ANALOG0", 0);
252         m_analog_ports[1] = input_port_read_safe(machine(), "ANALOG1", 0);
251         m_analog_ports[0] = ioport("ANALOG0")->read_safe(0);
252         m_analog_ports[1] = ioport("ANALOG1")->read_safe(0);
253253      }
254254   }
255255   else
src/mame/machine/pgmprot6.c
r15082r15083
120120         res = state->m_olds_cmd3;
121121      else if (state->m_kb_cmd == 5)
122122      {
123         UINT32 protvalue = 0x900000 | input_port_read(space->machine(), "Region"); // region from protection device.
123         UINT32 protvalue = 0x900000 | state->ioport("Region")->read(); // region from protection device.
124124         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
125125
126126      }
src/mame/machine/arkanoid.c
r15082r15083
116116{
117117   const char *tag1 = (const char *)param;
118118   const char *tag2 = tag1 + strlen(tag1) + 1;
119   return input_port_read(machine(), (m_paddle_select == 0) ? tag1 : tag2);
119   return ioport((m_paddle_select == 0) ? tag1 : tag2)->read();
120120}
121121
122122/*
r15082r15083
575575{
576576   UINT8 arkanoid_bootleg_d008_bit[8];
577577   UINT8 arkanoid_bootleg_d008_val;
578   UINT8 arkanoid_paddle_value = input_port_read(machine(), "MUX");
578   UINT8 arkanoid_paddle_value = ioport("MUX")->read();
579579   int b;
580580
581581   arkanoid_bootleg_d008_bit[4] = arkanoid_bootleg_d008_bit[6] = arkanoid_bootleg_d008_bit[7] = 0;  /* untested bits */
src/mame/machine/galaxold.c
r15082r15083
259259   static const char *const portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" };
260260   int bit_mask = (FPTR)param;
261261
262   return (input_port_read(machine(), portnames[m__4in1_bank]) & bit_mask) ? 0x01 : 0x00;
262   return (ioport(portnames[m__4in1_bank])->read() & bit_mask) ? 0x01 : 0x00;
263263}
264264
265265#ifdef UNUSED_FUNCTION
r15082r15083
399399{
400400   galaxold_state *state = machine.driver_data<galaxold_state>();
401401   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
402   offs_t i, len = machine.root_device().memregion("maincpu")->bytes();
402   offs_t i, len = state->memregion("maincpu")->bytes();
403403   UINT8 *RAM = state->memregion("maincpu")->base();
404404
405405   /* Decrypt Program Roms */
src/mame/machine/slikshot.c
r15082r15083
559559   SCREEN_UPDATE32_CALL(itech8_2page);
560560
561561   /* add the current X,Y positions to the list */
562   state->m_xbuffer[state->m_ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen.machine(), "FAKEX", 0);
563   state->m_ybuffer[state->m_ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen.machine(), "FAKEY", 0);
562   state->m_xbuffer[state->m_ybuffer_next % YBUFFER_COUNT] = state->ioport("FAKEX")->read_safe(0);
563   state->m_ybuffer[state->m_ybuffer_next % YBUFFER_COUNT] = state->ioport("FAKEY")->read_safe(0);
564564   state->m_ybuffer_next++;
565565
566566   /* determine where to draw the starting point */
src/mame/machine/jvs13551.c
r15082r15083
120120   if(count_players > 2 || bytes_per_switch > 2)
121121      return false;
122122
123   *buf++ = input_port_read_safe(machine(), port_tag[0], 0);
123   *buf++ = ioport(port_tag[0])->read_safe(0);
124124   for(int i=0; i<count_players; i++) {
125      UINT32 val = input_port_read_safe(machine(), port_tag[1+i], 0);
125      UINT32 val = ioport(port_tag[1+i])->read_safe(0);
126126      for(int j=0; j<bytes_per_switch; j++)
127127         *buf++ = val >> ((1-j) << 3);
128128   }
r15082r15083
135135   if(count > 8)
136136      return false;
137137   for(int i=0; i<count; i++) {
138      UINT16 val = input_port_read_safe(machine(), port_tag[3+i], 0x8000);
138      UINT16 val = ioport(port_tag[3+i])->read_safe(0x8000);
139139      *buf++ = val >> 8;
140140      *buf++ = val;
141141   }
r15082r15083
148148      return false;
149149   jvs_outputs = vals[0] & 0x3f;
150150   logerror("837-13551: output %02x\n", jvs_outputs);
151   input_port_write_safe(machine(), port_tag[11], jvs_outputs, 0x3f);
151   machine().root_device().ioport(port_tag[11])->write_safe(jvs_outputs, 0x3f);
152152   return true;
153153}
154154
src/mame/machine/dec0.c
r15082r15083
1919   switch (offset<<1)
2020   {
2121      case 0: /* Player 1 & 2 joystick & buttons */
22         return input_port_read(machine(), "INPUTS");
22         return ioport("INPUTS")->read();
2323
2424      case 2: /* Credits, start buttons */
25         return input_port_read(machine(), "SYSTEM");
25         return ioport("SYSTEM")->read();
2626
2727      case 4: /* Byte 4: Dipswitch bank 2, Byte 5: Dipswitch Bank 1 */
28         return input_port_read(machine(), "DSW");
28         return ioport("DSW")->read();
2929
3030      case 8: /* Intel 8751 mc, Bad Dudes & Heavy Barrel only */
3131         //logerror("CPU #0 PC %06x: warning - read i8751 %06x - %04x\n", cpu_get_pc(&space.device()), 0x30c000+offset, m_i8751_return);
r15082r15083
4343   switch (offset<<1)
4444   {
4545      case 0: /* Player 1 rotary */
46         return ~(1 << input_port_read(machine(), "AN0"));
46         return ~(1 << ioport("AN0")->read());
4747
4848      case 8: /* Player 2 rotary */
49         return ~(1 << input_port_read(machine(), "AN1"));
49         return ~(1 << ioport("AN1")->read());
5050
5151      default:
5252         logerror("Unknown rotary read at 300000 %02x\n", offset);
r15082r15083
6262   switch (offset<<1)
6363   {
6464      case 0: /* Player 1 Joystick + start, Player 2 Joystick + start */
65         return input_port_read(machine(), "INPUTS");
65         return ioport("INPUTS")->read();
6666
6767      case 2: /* Dipswitches */
68         return input_port_read(machine(), "DSW");
68         return ioport("DSW")->read();
6969
7070      case 4: /* Player 1 rotary */
71         return ~(1 << input_port_read(machine(), "AN0"));
71         return ~(1 << ioport("AN0")->read());
7272
7373      case 6: /* Player 2 rotary */
74         return ~(1 << input_port_read(machine(), "AN1"));
74         return ~(1 << ioport("AN1")->read());
7575
7676      case 8: /* Credits, start buttons */
77         return input_port_read(machine(), "SYSTEM");
77         return ioport("SYSTEM")->read();
7878
7979      case 12:
8080         return 0;   /* ?? watchdog ?? */
src/mame/machine/lsasquad.c
r15082r15083
181181
182182READ8_MEMBER(lsasquad_state::lsasquad_mcu_status_r)
183183{
184   int res = input_port_read(machine(), "MCU");
184   int res = ioport("MCU")->read();
185185
186186   /* bit 0 = when 1, mcu is ready to receive data from main cpu */
187187   /* bit 1 = when 0, mcu has sent data to the main cpu */
r15082r15083
196196
197197READ8_MEMBER(lsasquad_state::daikaiju_mcu_status_r)
198198{
199   int res = input_port_read(machine(), "MCU");
199   int res = ioport("MCU")->read();
200200
201201   /* bit 0 = when 1, mcu is ready to receive data from main cpu */
202202   /* bit 1 = when 0, mcu has sent data to the main cpu */
src/mame/machine/williams.c
r15082r15083
622622   if (m_port_select != 0)
623623      tag += strlen(tag) + 1;
624624
625   return input_port_read(machine(), tag);
625   return ioport(tag)->read();
626626}
627627
628628/*
r15082r15083
653653READ8_DEVICE_HANDLER( williams_49way_port_0_r )
654654{
655655   static const UINT8 translate49[7] = { 0x0, 0x4, 0x6, 0x7, 0xb, 0x9, 0x8 };
656   return (translate49[input_port_read(device->machine(), "49WAYX") >> 4] << 4) | translate49[input_port_read(device->machine(), "49WAYY") >> 4];
656   return (translate49[device->machine().root_device().ioport("49WAYX")->read() >> 4] << 4) | translate49[device->machine().root_device().ioport("49WAYY")->read() >> 4];
657657}
658658
659659
r15082r15083
663663   if (state->m_port_select)
664664      return williams_49way_port_0_r(device, 0);
665665   else
666      return input_port_read(device->machine(), "IN3");
666      return state->ioport("IN3")->read();
667667}
668668
669669
r15082r15083
879879
880880   /* banking is different for blaster */
881881   state->membank("bank1")->configure_entry(0, state->m_videoram);
882   state->membank("bank1")->configure_entries(1, 16, machine.root_device().memregion("maincpu")->base() + 0x18000, 0x4000);
882   state->membank("bank1")->configure_entries(1, 16, state->memregion("maincpu")->base() + 0x18000, 0x4000);
883883
884884   state->membank("bank2")->configure_entry(0, state->m_videoram + 0x4000);
885885   state->membank("bank2")->configure_entries(1, 16, state->memregion("maincpu")->base() + 0x10000, 0x0000);
r15082r15083
946946static READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r )
947947{
948948   /* merge in the gun inputs with the standard data */
949   int data = input_port_read(device->machine(), "IN0");
949   int data = device->machine().root_device().ioport("IN0")->read();
950950   int gun = (data & 0x3f) ^ ((data & 0x3f) >> 1);
951951   return (data & 0xc0) | gun;
952952
src/mame/machine/cchip.c
r15082r15083
117117   {
118118      switch (offset)
119119      {
120      case 0x00: return input_port_read(space->machine(), "IN0");    /* Player 1 controls + START1 */
121      case 0x01: return input_port_read(space->machine(), "IN1");    /* Player 2 controls + START2 */
122      case 0x02: return input_port_read(space->machine(), "IN2");    /* COINn + SERVICE1 + TILT */
120      case 0x00: return space->machine().root_device().ioport("IN0")->read();    /* Player 1 controls + START1 */
121      case 0x01: return space->machine().root_device().ioport("IN1")->read();    /* Player 2 controls + START2 */
122      case 0x02: return space->machine().root_device().ioport("IN2")->read();    /* COINn + SERVICE1 + TILT */
123123      case 0x03: return cc_port;
124124      }
125125   }
src/mame/machine/opwolf.c
r15082r15083
529529   opwolf_state *state = machine.driver_data<opwolf_state>();
530530
531531   // Update input ports, these are used by both the 68k directly and by the c-chip
532   state->m_cchip_ram[0x4] = input_port_read(machine, "IN0");
533   state->m_cchip_ram[0x5] = input_port_read(machine, "IN1");
532   state->m_cchip_ram[0x4] = state->ioport("IN0")->read();
533   state->m_cchip_ram[0x5] = state->ioport("IN1")->read();
534534
535535   // Coin slots
536536   if (state->m_cchip_ram[0x4] != state->m_cchip_last_04)
src/mame/machine/starwars.c
r15082r15083
125125{
126126   /* pitch */
127127   if (m_control_num == kPitch)
128      return input_port_read(machine(), "STICKY");
128      return ioport("STICKY")->read();
129129
130130   /* yaw */
131131   else if (m_control_num == kYaw)
132      return input_port_read(machine(), "STICKX");
132      return ioport("STICKX")->read();
133133
134134   /* default to unused thrust */
135135   else
src/mame/machine/nb1413m3.c
r15082r15083
363363
364364READ8_HANDLER( nb1413m3_inputport0_r )
365365{
366   return ((input_port_read(space->machine(), "SYSTEM") & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1));
366   return ((space->machine().root_device().ioport("SYSTEM")->read() & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1));
367367}
368368
369369READ8_HANDLER( nb1413m3_inputport1_r )
370370{
371   device_t &root = space->machine().root_device();
371372   switch (nb1413m3_type)
372373   {
373374      case NB1413M3_HYHOO:
374375      case NB1413M3_HYHOO2:
375376         switch ((nb1413m3_inputport ^ 0xff) & 0x07)
376377         {
377            case 0x01:   return input_port_read(space->machine(), "IN0");
378            case 0x02:   return input_port_read(space->machine(), "IN1");
378            case 0x01:   return root.ioport("IN0")->read();
379            case 0x02:   return root.ioport("IN1")->read();
379380            case 0x04:   return 0xff;
380381            default:   return 0xff;
381382         }
382383         break;
383384      case NB1413M3_MSJIKEN:
384385      case NB1413M3_TELMAHJN:
385         if (input_port_read(space->machine(), "DSWA") & 0x80)
386         if (root.ioport("DSWA")->read() & 0x80)
386387         {
387388            switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
388389            {
389               case 0x01:   return input_port_read(space->machine(), "KEY0");
390               case 0x02:   return input_port_read(space->machine(), "KEY1");
391               case 0x04:   return input_port_read(space->machine(), "KEY2");
392               case 0x08:   return input_port_read(space->machine(), "KEY3");
393               case 0x10:   return input_port_read(space->machine(), "KEY4");
394               default:   return (input_port_read(space->machine(), "KEY0") & input_port_read(space->machine(), "KEY1") & input_port_read(space->machine(), "KEY2")
395                              & input_port_read(space->machine(), "KEY3") & input_port_read(space->machine(), "KEY4"));
390               case 0x01:   return root.ioport("KEY0")->read();
391               case 0x02:   return root.ioport("KEY1")->read();
392               case 0x04:   return root.ioport("KEY2")->read();
393               case 0x08:   return root.ioport("KEY3")->read();
394               case 0x10:   return root.ioport("KEY4")->read();
395               default:   return (root.ioport("KEY0")->read() & root.ioport("KEY1")->read() & root.ioport("KEY2")->read()
396                              & root.ioport("KEY3")->read() & root.ioport("KEY4")->read());
396397            }
397398         }
398         else return input_port_read(space->machine(), "JAMMA2");
399         else return root.ioport("JAMMA2")->read();
399400         break;
400401      case NB1413M3_PAIRSNB:
401402      case NB1413M3_PAIRSTEN:
402403      case NB1413M3_OHPAIPEE:
403404      case NB1413M3_TOGENKYO:
404         return input_port_read(space->machine(), "P1");
405         return root.ioport("P1")->read();
405406      default:
406407         switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
407408         {
408            case 0x01:   return input_port_read(space->machine(), "KEY0");
409            case 0x02:   return input_port_read(space->machine(), "KEY1");
410            case 0x04:   return input_port_read(space->machine(), "KEY2");
411            case 0x08:   return input_port_read(space->machine(), "KEY3");
412            case 0x10:   return input_port_read(space->machine(), "KEY4");
413            default:   return (input_port_read(space->machine(), "KEY0") & input_port_read(space->machine(), "KEY1") & input_port_read(space->machine(), "KEY2")
414                           & input_port_read(space->machine(), "KEY3") & input_port_read(space->machine(), "KEY4"));
409            case 0x01:   return root.ioport("KEY0")->read();
410            case 0x02:   return root.ioport("KEY1")->read();
411            case 0x04:   return root.ioport("KEY2")->read();
412            case 0x08:   return root.ioport("KEY3")->read();
413            case 0x10:   return root.ioport("KEY4")->read();
414            default:   return (root.ioport("KEY0")->read() & root.ioport("KEY1")->read() & root.ioport("KEY2")->read()
415                           & root.ioport("KEY3")->read() & root.ioport("KEY4")->read());
415416         }
416417         break;
417418   }
r15082r15083
419420
420421READ8_HANDLER( nb1413m3_inputport2_r )
421422{
423   device_t &root = space->machine().root_device();
422424   switch (nb1413m3_type)
423425   {
424426      case NB1413M3_HYHOO:
r15082r15083
427429         {
428430            case 0x01:   return 0xff;
429431            case 0x02:   return 0xff;
430            case 0x04:   return input_port_read(space->machine(), "IN2");
432            case 0x04:   return root.ioport("IN2")->read();
431433            default:   return 0xff;
432434         }
433435         break;
434436      case NB1413M3_MSJIKEN:
435437      case NB1413M3_TELMAHJN:
436         if (input_port_read(space->machine(), "DSWA") & 0x80)
438         if (root.ioport("DSWA")->read() & 0x80)
437439         {
438440            switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
439441            {
440               case 0x01:   return input_port_read(space->machine(), "KEY5");
441               case 0x02:   return input_port_read(space->machine(), "KEY6");
442               case 0x04:   return input_port_read(space->machine(), "KEY7");
443               case 0x08:   return input_port_read(space->machine(), "KEY8");
444               case 0x10:   return input_port_read(space->machine(), "KEY9");
445               default:   return (input_port_read(space->machine(), "KEY5") & input_port_read(space->machine(), "KEY6") & input_port_read(space->machine(), "KEY7")
446                              & input_port_read(space->machine(), "KEY8") & input_port_read(space->machine(), "KEY9"));
442               case 0x01:   return root.ioport("KEY5")->read();
443               case 0x02:   return root.ioport("KEY6")->read();
444               case 0x04:   return root.ioport("KEY7")->read();
445               case 0x08:   return root.ioport("KEY8")->read();
446               case 0x10:   return root.ioport("KEY9")->read();
447               default:   return (root.ioport("KEY5")->read() & root.ioport("KEY6")->read() & root.ioport("KEY7")->read()
448                              & root.ioport("KEY8")->read() & root.ioport("KEY9")->read());
447449            }
448450         }
449         else return input_port_read(space->machine(), "JAMMA1");
451         else return root.ioport("JAMMA1")->read();
450452         break;
451453      case NB1413M3_PAIRSNB:
452454      case NB1413M3_PAIRSTEN:
453455      case NB1413M3_OHPAIPEE:
454456      case NB1413M3_TOGENKYO:
455         return input_port_read(space->machine(), "P2");
457         return root.ioport("P2")->read();
456458      default:
457459         switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
458460         {
459            case 0x01:   return input_port_read(space->machine(), "KEY5");
460            case 0x02:   return input_port_read(space->machine(), "KEY6");
461            case 0x04:   return input_port_read(space->machine(), "KEY7");
462            case 0x08:   return input_port_read(space->machine(), "KEY8");
463            case 0x10:   return input_port_read(space->machine(), "KEY9");
464            default:   return (input_port_read(space->machine(), "KEY5") & input_port_read(space->machine(), "KEY6") & input_port_read(space->machine(), "KEY7")
465                           & input_port_read(space->machine(), "KEY8") & input_port_read(space->machine(), "KEY9"));
461            case 0x01:   return root.ioport("KEY5")->read();
462            case 0x02:   return root.ioport("KEY6")->read();
463            case 0x04:   return root.ioport("KEY7")->read();
464            case 0x08:   return root.ioport("KEY8")->read();
465            case 0x10:   return root.ioport("KEY9")->read();
466            default:   return (root.ioport("KEY5")->read() & root.ioport("KEY6")->read() & root.ioport("KEY7")->read()
467                           & root.ioport("KEY8")->read() & root.ioport("KEY9")->read());
466468         }
467469         break;
468470   }
r15082r15083
493495
494496READ8_HANDLER( nb1413m3_dipsw1_r )
495497{
498   device_t &root = space->machine().root_device();
496499   switch (nb1413m3_type)
497500   {
498501      case NB1413M3_KANATUEN:
499502      case NB1413M3_KYUHITO:
500         return input_port_read(space->machine(), "DSWB");
503         return root.ioport("DSWB")->read();
501504      case NB1413M3_TAIWANMB:
502         return ((input_port_read(space->machine(), "DSWA") & 0xf0) | ((input_port_read(space->machine(), "DSWB") & 0xf0) >> 4));
505         return ((root.ioport("DSWA")->read() & 0xf0) | ((root.ioport("DSWB")->read() & 0xf0) >> 4));
503506      case NB1413M3_OTONANO:
504507      case NB1413M3_MJCAMERA:
505508      case NB1413M3_IDHIMITU:
506509      case NB1413M3_KAGUYA2:
507         return (((input_port_read(space->machine(), "DSWA") & 0x0f) << 4) | (input_port_read(space->machine(), "DSWB") & 0x0f));
510         return (((root.ioport("DSWA")->read() & 0x0f) << 4) | (root.ioport("DSWB")->read() & 0x0f));
508511      case NB1413M3_SCANDAL:
509512      case NB1413M3_SCANDALM:
510513      case NB1413M3_MJFOCUSM:
r15082r15083
515518      case NB1413M3_UCHUUAI:
516519      case NB1413M3_TOKIMBSJ:
517520      case NB1413M3_TOKYOGAL:
518         return ((input_port_read(space->machine(), "DSWA") & 0x0f) | ((input_port_read(space->machine(), "DSWB") & 0x0f) << 4));
521         return ((root.ioport("DSWA")->read() & 0x0f) | ((root.ioport("DSWB")->read() & 0x0f) << 4));
519522      case NB1413M3_TRIPLEW1:
520523      case NB1413M3_NTOPSTAR:
521524      case NB1413M3_PSTADIUM:
r15082r15083
525528      case NB1413M3_MJLSTORY:
526529      case NB1413M3_QMHAYAKU:
527530      case NB1413M3_MJGOTTUB:
528         return (((input_port_read(space->machine(), "DSWB") & 0x01) >> 0) | ((input_port_read(space->machine(), "DSWB") & 0x04) >> 1) |
529                 ((input_port_read(space->machine(), "DSWB") & 0x10) >> 2) | ((input_port_read(space->machine(), "DSWB") & 0x40) >> 3) |
530                 ((input_port_read(space->machine(), "DSWA") & 0x01) << 4) | ((input_port_read(space->machine(), "DSWA") & 0x04) << 3) |
531                 ((input_port_read(space->machine(), "DSWA") & 0x10) << 2) | ((input_port_read(space->machine(), "DSWA") & 0x40) << 1));
531         return (((root.ioport("DSWB")->read() & 0x01) >> 0) | ((root.ioport("DSWB")->read() & 0x04) >> 1) |
532                 ((root.ioport("DSWB")->read() & 0x10) >> 2) | ((root.ioport("DSWB")->read() & 0x40) >> 3) |
533                 ((root.ioport("DSWA")->read() & 0x01) << 4) | ((root.ioport("DSWA")->read() & 0x04) << 3) |
534                 ((root.ioport("DSWA")->read() & 0x10) << 2) | ((root.ioport("DSWA")->read() & 0x40) << 1));
532535      default:
533         return input_port_read(space->machine(), "DSWA");
536         return space->machine().root_device().ioport("DSWA")->read();
534537   }
535538}
536539
537540READ8_HANDLER( nb1413m3_dipsw2_r )
538541{
542   device_t &root = space->machine().root_device();
539543   switch (nb1413m3_type)
540544   {
541545      case NB1413M3_KANATUEN:
542546      case NB1413M3_KYUHITO:
543         return input_port_read(space->machine(), "DSWA");
547         return root.ioport("DSWA")->read();
544548      case NB1413M3_TAIWANMB:
545         return (((input_port_read(space->machine(), "DSWA") & 0x0f) << 4) | (input_port_read(space->machine(), "DSWB") & 0x0f));
549         return (((root.ioport("DSWA")->read() & 0x0f) << 4) | (root.ioport("DSWB")->read() & 0x0f));
546550      case NB1413M3_OTONANO:
547551      case NB1413M3_MJCAMERA:
548552      case NB1413M3_IDHIMITU:
549553      case NB1413M3_KAGUYA2:
550         return ((input_port_read(space->machine(), "DSWA") & 0xf0) | ((input_port_read(space->machine(), "DSWB") & 0xf0) >> 4));
554         return ((root.ioport("DSWA")->read() & 0xf0) | ((root.ioport("DSWB")->read() & 0xf0) >> 4));
551555      case NB1413M3_SCANDAL:
552556      case NB1413M3_SCANDALM:
553557      case NB1413M3_MJFOCUSM:
r15082r15083
558562      case NB1413M3_UCHUUAI:
559563      case NB1413M3_TOKIMBSJ:
560564      case NB1413M3_TOKYOGAL:
561         return (((input_port_read(space->machine(), "DSWA") & 0xf0) >> 4) | (input_port_read(space->machine(), "DSWB") & 0xf0));
565         return (((root.ioport("DSWA")->read() & 0xf0) >> 4) | (root.ioport("DSWB")->read() & 0xf0));
562566      case NB1413M3_TRIPLEW1:
563567      case NB1413M3_NTOPSTAR:
564568      case NB1413M3_PSTADIUM:
r15082r15083
568572      case NB1413M3_MJLSTORY:
569573      case NB1413M3_QMHAYAKU:
570574      case NB1413M3_MJGOTTUB:
571         return (((input_port_read(space->machine(), "DSWB") & 0x02) >> 1) | ((input_port_read(space->machine(), "DSWB") & 0x08) >> 2) |
572                 ((input_port_read(space->machine(), "DSWB") & 0x20) >> 3) | ((input_port_read(space->machine(), "DSWB") & 0x80) >> 4) |
573                 ((input_port_read(space->machine(), "DSWA") & 0x02) << 3) | ((input_port_read(space->machine(), "DSWA") & 0x08) << 2) |
574                 ((input_port_read(space->machine(), "DSWA") & 0x20) << 1) | ((input_port_read(space->machine(), "DSWA") & 0x80) << 0));
575         return (((root.ioport("DSWB")->read() & 0x02) >> 1) | ((root.ioport("DSWB")->read() & 0x08) >> 2) |
576                 ((root.ioport("DSWB")->read() & 0x20) >> 3) | ((root.ioport("DSWB")->read() & 0x80) >> 4) |
577                 ((root.ioport("DSWA")->read() & 0x02) << 3) | ((root.ioport("DSWA")->read() & 0x08) << 2) |
578                 ((root.ioport("DSWA")->read() & 0x20) << 1) | ((root.ioport("DSWA")->read() & 0x80) << 0));
575579      default:
576         return input_port_read(space->machine(), "DSWB");
580         return space->machine().root_device().ioport("DSWB")->read();
577581   }
578582}
579583
580584READ8_HANDLER( nb1413m3_dipsw3_l_r )
581585{
582   return ((input_port_read(space->machine(), "DSWC") & 0xf0) >> 4);
586   return ((space->machine().root_device().ioport("DSWC")->read() & 0xf0) >> 4);
583587}
584588
585589READ8_HANDLER( nb1413m3_dipsw3_h_r )
586590{
587   return ((input_port_read(space->machine(), "DSWC") & 0x0f) >> 0);
591   return ((space->machine().root_device().ioport("DSWC")->read() & 0x0f) >> 0);
588592}
589593
590594WRITE8_HANDLER( nb1413m3_outcoin_w )
src/mame/machine/subs.c
r15082r15083
2626INTERRUPT_GEN( subs_interrupt )
2727{
2828   /* only do NMI interrupt if not in TEST mode */
29   if ((input_port_read(device->machine(), "IN1") & 0x40)==0x40)
29   if ((device->machine().root_device().ioport("IN1")->read() & 0x40)==0x40)
3030      device_set_input_line(device,INPUT_LINE_NMI,PULSE_LINE);
3131}
3232
r15082r15083
4343   int this_val;
4444   int delta;
4545
46   this_val=input_port_read(machine, "DIAL2");
46   this_val=state->ioport("DIAL2")->read();
4747
4848   delta=this_val-state->m_last_val_1;
4949   state->m_last_val_1=this_val;
r15082r15083
7272   int this_val;
7373   int delta;
7474
75   this_val=input_port_read(machine, "DIAL1");
75   this_val=state->ioport("DIAL1")->read();
7676
7777   delta=this_val-state->m_last_val_2;
7878   state->m_last_val_2=this_val;
r15082r15083
109109***************************************************************************/
110110READ8_MEMBER(subs_state::subs_control_r)
111111{
112   int inport = input_port_read(machine(), "IN0");
112   int inport = ioport("IN0")->read();
113113
114114   switch (offset & 0x07)
115115   {
r15082r15083
131131***************************************************************************/
132132READ8_MEMBER(subs_state::subs_coin_r)
133133{
134   int inport = input_port_read(machine(), "IN1");
134   int inport = ioport("IN1")->read();
135135
136136   switch (offset & 0x07)
137137   {
r15082r15083
153153***************************************************************************/
154154READ8_MEMBER(subs_state::subs_options_r)
155155{
156   int opts = input_port_read(machine(), "DSW");
156   int opts = ioport("DSW")->read();
157157
158158   switch (offset & 0x03)
159159   {
src/mame/machine/seicop.c
r15082r15083
16801680      //case (0x5b4/2):
16811681      //  return cop_mcu_ram[offset];
16821682
1683      case (0x700/2): return input_port_read(space->machine(), "DSW1");
1684      case (0x704/2):   return input_port_read(space->machine(), "PLAYERS12");
1685      case (0x708/2):   return input_port_read(space->machine(), "PLAYERS34");
1686      case (0x70c/2):   return input_port_read(space->machine(), "SYSTEM");
1687      case (0x71c/2): return input_port_read(space->machine(), "DSW2");
1683      case (0x700/2): return space->machine().root_device().ioport("DSW1")->read();
1684      case (0x704/2):   return space->machine().root_device().ioport("PLAYERS12")->read();
1685      case (0x708/2):   return space->machine().root_device().ioport("PLAYERS34")->read();
1686      case (0x70c/2):   return space->machine().root_device().ioport("SYSTEM")->read();
1687      case (0x71c/2): return space->machine().root_device().ioport("DSW2")->read();
16881688   }
16891689}
16901690
r15082r15083
26762676   {
26772677      static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
26782678
2679      return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
2679      return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
26802680   }
26812681
26822682   return generic_cop_r(space, offset, mem_mask);
r15082r15083
27262726   {
27272727      static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
27282728
2729      return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
2729      return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
27302730   }
27312731
27322732   if(offset == 0x35c/2)
27332733   {
2734      return input_port_read(space->machine(), "DSW2");
2734      return space->machine().root_device().ioport("DSW2")->read();
27352735   }
27362736
27372737   return generic_cop_r(space, offset, mem_mask);
r15082r15083
27682768   {
27692769      static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
27702770
2771      return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
2771      return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
27722772   }
27732773
27742774   if(offset == 0x31c/2)
27752775   {
2776      return input_port_read(space->machine(), "DSW2");
2776      return space->machine().root_device().ioport("DSW2")->read();
27772777   }
27782778
27792779   return generic_cop_r(space, offset, mem_mask);
r15082r15083
28202820   {
28212821      static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
28222822
2823      return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
2823      return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
28242824   }
28252825
28262826   return generic_cop_r(space, offset, mem_mask);
r15082r15083
28672867   {
28682868      static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
28692869
2870      return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
2870      return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
28712871   }
28722872
28732873   if(offset == 0x35c/2)
28742874   {
2875      return input_port_read(space->machine(), "DSW2");
2875      return space->machine().root_device().ioport("DSW2")->read();
28762876   }
28772877
28782878   return generic_cop_r(space, offset, mem_mask);
r15082r15083
29192919   {
29202920      static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
29212921
2922      return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
2922      return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
29232923   }
29242924
29252925   if(offset == 0x35c/2)
29262926   {
2927      return input_port_read(space->machine(), "DSW2");
2927      return space->machine().root_device().ioport("DSW2")->read();
29282928   }
29292929
29302930   return generic_cop_r(space, offset, mem_mask);
r15082r15083
29672967   {
29682968      static const char *const portnames[] = { "DSW1", "PLAYERS12", "UNK", "SYSTEM" };
29692969
2970      return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
2970      return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
29712971   }
29722972
29732973   return generic_cop_r(space, offset, mem_mask);
src/mame/machine/ajax.c
r15082r15083
115115         data = machine().rand();
116116         break;
117117      case 0x04:   /* 2P inputs */
118         data = input_port_read(machine(), "P2");
118         data = ioport("P2")->read();
119119         break;
120120      case 0x06:   /* 1P inputs + DIPSW #1 & #2 */
121121         index = offset & 0x01;
122         data = input_port_read(machine(), (offset & 0x02) ? portnames[2 + index] : portnames[index]);
122         data = ioport((offset & 0x02) ? portnames[2 + index] : portnames[index])->read();
123123         break;
124124      case 0x07:   /* DIPSW #3 */
125         data = input_port_read(machine(), "DSW3");
125         data = ioport("DSW3")->read();
126126         break;
127127
128128      default:
r15082r15083
197197MACHINE_START( ajax )
198198{
199199   ajax_state *state = machine.driver_data<ajax_state>();
200   UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
200   UINT8 *MAIN = state->memregion("maincpu")->base();
201201   UINT8 *SUB  = state->memregion("sub")->base();
202202
203203   state->membank("bank1")->configure_entries(0,  9,  &SUB[0x10000], 0x2000);
src/mame/machine/nitedrvr.c
r15082r15083
2121static int nitedrvr_steering( running_machine &machine )
2222{
2323   nitedrvr_state *state = machine.driver_data<nitedrvr_state>();
24   int this_val = input_port_read(machine, "STEER");
24   int this_val = state->ioport("STEER")->read();
2525   int delta = this_val - state->m_last_steering_val;
2626
2727   state->m_last_steering_val = this_val;
r15082r15083
9898
9999READ8_MEMBER(nitedrvr_state::nitedrvr_in0_r)
100100{
101   int gear = input_port_read(machine(), "GEARS");
101   int gear = ioport("GEARS")->read();
102102
103103   if (gear & 0x10)            m_gear = 1;
104104   else if (gear & 0x20)         m_gear = 2;
r15082r15083
108108   switch (offset & 0x03)
109109   {
110110      case 0x00:                  /* No remapping necessary */
111         return input_port_read(machine(), "DSW0");
111         return ioport("DSW0")->read();
112112      case 0x01:                  /* No remapping necessary */
113         return input_port_read(machine(), "DSW1");
113         return ioport("DSW1")->read();
114114      case 0x02:                  /* Remap our gear shift */
115115         if (m_gear == 1)
116116            return 0xe0;
r15082r15083
121121         else
122122            return 0x70;
123123      case 0x03:                  /* Remap our steering */
124         return (input_port_read(machine(), "DSW2") | nitedrvr_steering(machine()));
124         return (ioport("DSW2")->read() | nitedrvr_steering(machine()));
125125      default:
126126         return 0xff;
127127   }
r15082r15083
161161
162162READ8_MEMBER(nitedrvr_state::nitedrvr_in1_r)
163163{
164   int port = input_port_read(machine(), "IN0");
164   int port = ioport("IN0")->read();
165165
166166   m_ac_line = (m_ac_line + 1) % 3;
167167
src/mame/includes/lordgun.h
r15082r15083
5555/*----------- defined in video/lordgun.c -----------*/
5656
5757
58float lordgun_crosshair_mapper(const input_field_config *field, float linear_value);
58float lordgun_crosshair_mapper(const ioport_field *field, float linear_value);
5959void lordgun_update_gun(running_machine &machine, int i);
6060
6161VIDEO_START( lordgun );
src/mame/includes/galpnipt.h
r15082r15083
101101   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5,6")\
102102   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )\
103103   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )\
104   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
105   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
106   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
107   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
104   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
105   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
106   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
107   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
108108   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:7,8")\
109109   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )\
110110   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )\
111   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
112   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
113   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
114   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)
111   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
112   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
113   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
114   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)
115115
116116#define COINAGE_TEST_LOC\
117117   PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0001, "SW1:1" )\
r15082r15083
125125   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5,6")\
126126   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )\
127127   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )\
128   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
129   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
130   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
131   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
128   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
129   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
130   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
131   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
132132   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:7,8")\
133133   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )\
134134   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )\
135   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
136   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
137   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
138   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)
135   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
136   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
137   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
138   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)
139139
140140
141141#define DIFFICULTY_DEMO_SOUNDS\
src/mame/includes/iremipt.h
r15082r15083
9494/* Mode 2 Coinage */
9595
9696#define IREM_COIN_MODE_2_OLD_LOC(DIPBANK) \
97   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6") \
97   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2", 0x04, EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6") \
9898   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) \
9999   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) \
100100   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) \
101101   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) \
102   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":7,8") \
102   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2", 0x04, EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":7,8") \
103103   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) ) \
104104   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) ) \
105105   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) ) \
106106   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
107107
108108#define IREM_COIN_MODE_2_DSW1_LOC(DIPBANK) \
109   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6") \
109   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2", 0x04, EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6") \
110110   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) ) \
111111   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) \
112112   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) \
113113   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) \
114   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":7,8") \
114   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2", 0x04, EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":7,8") \
115115   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) ) \
116116   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) ) \
117117   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) ) \
r15082r15083
122122/* to make the definitions a bit more general. However, these are enough to cover */
123123/* all the currently emulated games */
124124#define IREM_COIN_MODE_2 \
125   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW2:5,6") \
125   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00) PORT_DIPLOCATION("SW2:5,6") \
126126   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) ) \
127127   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) \
128128   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) \
129129   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) \
130   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW2:7,8") \
130   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00) PORT_DIPLOCATION("SW2:7,8") \
131131   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) ) \
132132   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) ) \
133133   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) ) \
134134   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
135135
136136#define IREM_COIN_MODE_2_HIGH \
137   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0800, PORTCOND_EQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6") \
137   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0800, EQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6") \
138138   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) ) \
139139   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) ) \
140140   PORT_DIPSETTING(      0x2000, DEF_STR( 2C_1C ) ) \
141141   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) ) \
142   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0800, PORTCOND_EQUALS, 0x0000) PORT_DIPLOCATION("SW2:7,8") \
142   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0800, EQUALS, 0x0000) PORT_DIPLOCATION("SW2:7,8") \
143143   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_2C ) ) \
144144   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_3C ) ) \
145145   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_5C ) ) \
r15082r15083
150150
151151#define IREM_Z80_COINAGE_TYPE_1_LOC(DIPBANK) \
152152   /* Coin Mode 1 */ \
153   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
153   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
154154/*  PORT_DIPSETTING(    0x80, DEF_STR( 1C_1C ) ) */ \
155155   PORT_DIPSETTING(    0x90, DEF_STR( 7C_1C ) ) \
156156   PORT_DIPSETTING(    0xa0, DEF_STR( 6C_1C ) ) \
r15082r15083
172172
173173#define IREM_Z80_COINAGE_TYPE_2_LOC(DIPBANK) \
174174   /* Coin Mode 1 */ \
175   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
175   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
176176/*  PORT_DIPSETTING(    0x80, DEF_STR( Free_Play ) ) */ \
177177/*  PORT_DIPSETTING(    0x90, DEF_STR( Free_Play ) ) */ \
178178   PORT_DIPSETTING(    0xa0, DEF_STR( 6C_1C ) ) \
r15082r15083
194194
195195#define   IREM_Z80_COINAGE_TYPE_3_LOC(DIPBANK) \
196196   /* Coin Mode 1 */ \
197   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
197   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
198198   PORT_DIPSETTING(    0x90, DEF_STR( 7C_1C ) ) \
199199   PORT_DIPSETTING(    0xa0, DEF_STR( 6C_1C ) ) \
200200   PORT_DIPSETTING(    0xb0, DEF_STR( 5C_1C ) ) \
r15082r15083
216216
217217#define   IREM_Z80_COINAGE_TYPE_4_LOC(DIPBANK) \
218218   /* Coin Mode 1 */ \
219   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
219   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
220220   PORT_DIPSETTING(    0xa0, DEF_STR( 6C_1C ) ) \
221221   PORT_DIPSETTING(    0xb0, DEF_STR( 5C_1C ) ) \
222222   PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) ) \
r15082r15083
238238
239239#define   IREM_Z80_COINAGE_TYPE_5_LOC(DIPBANK) \
240240   /* Coin Mode 1 */ \
241   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
241   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
242242   PORT_DIPSETTING(    0x00, DEF_STR( 8C_1C ) ) \
243243   PORT_DIPSETTING(    0xa0, DEF_STR( 6C_1C ) ) \
244244   PORT_DIPSETTING(    0xb0, DEF_STR( 5C_1C ) ) \
r15082r15083
281281   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
282282
283283#define IREM_COIN_MODE_1_NEW_HIGH \
284   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, PORTCOND_NOTEQUALS, 0x0000)  PORT_DIPLOCATION("SW2:5,6,7,8") \
284   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, NOTEQUALS, 0x0000)  PORT_DIPLOCATION("SW2:5,6,7,8") \
285285   PORT_DIPSETTING(      0xa000, DEF_STR( 6C_1C ) ) \
286286   PORT_DIPSETTING(      0xb000, DEF_STR( 5C_1C ) ) \
287287   PORT_DIPSETTING(      0xc000, DEF_STR( 4C_1C ) ) \
src/mame/includes/bfm_sc45.h
r15082r15083
5151
5252   DECLARE_READ16_MEMBER(sc4_mem_r);
5353   DECLARE_WRITE16_MEMBER(sc4_mem_w);
54
55   DECLARE_READ16_MEMBER(sc4_cs1_r);
5456};
5557
5658class sc4_adder4_state : public sc4_state
r15082r15083
6062      : sc4_state(mconfig, type, tag),
6163        m_adder4cpu(*this, "adder4")
6264   { }
65   
66   UINT32* m_adder4cpuregion;
67   UINT32* m_adder4ram;
6368
69   DECLARE_READ32_MEMBER(adder4_mem_r);
70   DECLARE_WRITE32_MEMBER(adder4_mem_w);
71
72
6473   // devices
6574   required_device<cpu_device> m_adder4cpu;
6675};
src/mame/includes/bombjack.h
r15082r15083
1717   required_shared_ptr<UINT8> m_videoram;
1818   required_shared_ptr<UINT8> m_colorram;
1919   required_shared_ptr<UINT8> m_spriteram;
20//  UINT8 *     m_paletteram;  // currently this uses generic palette handling
21   size_t      m_spriteram_size;
2220
2321   /* video-related */
2422   tilemap_t   *m_fg_tilemap;
src/mame/includes/msisaac.h
r15082r15083
1717   required_shared_ptr<UINT8> m_videoram3;
1818   required_shared_ptr<UINT8> m_videoram2;
1919
20   size_t      m_videoram_size;
21   size_t      m_spriteram_size;
22   size_t      m_spriteram2_size;
23
2420   /* video-related */
2521   bitmap_ind16    *m_tmp_bitmap1;
2622   bitmap_ind16    *m_tmp_bitmap2;
src/mame/includes/lockon.h
r15082r15083
3333   required_shared_ptr<UINT16> m_ground_ram;
3434   required_shared_ptr<UINT16> m_object_ram;
3535
36   size_t   m_hudram_size;
37   size_t   m_objectram_size;
38   size_t   m_groundram_size;
39
4036   /* video-related */
41   tilemap_t   *m_tilemap;
42   UINT8         m_ground_ctrl;
43   UINT16      m_scroll_h;
44   UINT16      m_scroll_v;
37   tilemap_t      *m_tilemap;
38   UINT8         m_ground_ctrl;
39   UINT16         m_scroll_h;
40   UINT16         m_scroll_v;
4541   bitmap_ind16    *m_front_buffer;
4642   bitmap_ind16    *m_back_buffer;
47   emu_timer   *m_bufend_timer;
48   emu_timer   *m_cursor_timer;
43   emu_timer      *m_bufend_timer;
44   emu_timer      *m_cursor_timer;
4945
5046   /* Rotation Control */
5147   UINT16      m_xsal;
r15082r15083
5955
6056   /* Object palette RAM control */
6157   UINT32      m_iden;
62   UINT8   *     m_obj_pal_ram;
58   UINT8      *m_obj_pal_ram;
6359   UINT32      m_obj_pal_latch;
6460   UINT32      m_obj_pal_addr;
6561
src/mame/includes/toaplipt.h
r15082r15083
9191
9292#define TOAPLAN_COINAGE_DUAL_LOC(DIP, MASK, WORLD, DIPBANK) \
9393   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION(#DIPBANK":!5,!6") \
94   PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
95   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
96   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
97   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
94   PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
95   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
96   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
97   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
9898   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) ) \
99   PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
100   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
99   PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
100   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
101101   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION(#DIPBANK":!7,!8") \
102   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
103   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
104   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
105   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
106   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
107   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
108   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
109   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD)
102   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
103   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
104   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
105   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
106   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
107   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
108   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
109   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD)
110110
111111/* without location */
112112#define TOAPLAN_COINAGE_JAPAN_COIN_A \
r15082r15083
147147
148148#define TOAPLAN_COINAGE_DUAL(DIP, MASK, WORLD) \
149149   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) \
150   PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
151   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
152   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
153   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
150   PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
151   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
152   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
153   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
154154   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) ) \
155   PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
156   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
155   PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
156   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
157157   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) \
158   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
159   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
160   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
161   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
162   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
163   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
164   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
165   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD)
158   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
159   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
160   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
161   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
162   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
163   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
164   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
165   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD)
166166
167167
168168/************************** Difficulty Dip Switches ***************************/
src/mame/mame.mak
r15082r15083
16961696   $(DRIVERS)/cb2001.o \
16971697   $(DRIVERS)/cdi.o $(VIDEO)/mcd212.o $(MACHINE)/cdi070.o $(MACHINE)/cdislave.o $(MACHINE)/cdicdic.o \
16981698   $(DRIVERS)/cesclass.o \
1699   $(DRIVERS)/chance32.o \
16991700   $(DRIVERS)/chsuper.o \
17001701   $(DRIVERS)/cidelsa.o $(VIDEO)/cidelsa.o \
17011702   $(DRIVERS)/coinmstr.o \
r15082r15083
20712072         $(LAYOUT)/mdrawpkr.lh \
20722073         $(LAYOUT)/meybjack.lh
20732074
2075$(DRIVERS)/meyc8088.o:   $(LAYOUT)/gldarrow.lh
2076
20742077$(DRIVERS)/midzeus.o:   $(LAYOUT)/crusnexo.lh
20752078
20762079$(DRIVERS)/mil4000.o:   $(LAYOUT)/mil4000.lh
src/mame/video/deco_mlc.c
r15082r15083
216216   UINT32 *index_ptr=0;
217217   int offs,fx=0,fy=0,x,y,color,colorOffset,sprite,indx,h,w,bx,by,fx1,fy1;
218218   int xoffs,yoffs;
219   UINT8 *rom = machine.root_device().memregion("gfx2")->base() + 0x20000, *index_ptr8;
219   UINT8 *rom = state->memregion("gfx2")->base() + 0x20000, *index_ptr8;
220220   UINT8 *rawrom = state->memregion("gfx2")->base();
221221   int blockIsTilemapIndex=0;
222222   int sprite2=0,indx2=0,use8bppMode=0;
src/mame/video/fgoal.c
r15082r15083
4848
4949   /* draw color overlay foreground and background */
5050
51   if (state->m_fgoal_player == 1 && (input_port_read(screen.machine(), "IN1") & 0x40))
51   if (state->m_fgoal_player == 1 && (screen.machine().root_device().ioport("IN1")->read() & 0x40))
5252   {
5353      drawgfxzoom_opaque(state->m_fgbitmap, cliprect, screen.machine().gfx[0],
5454         0, (state->m_fgoal_player << 2) | state->m_current_color,
src/mame/video/mcd212.c
r15082r15083
11151115{
11161116    running_machine &machine = mcd212->machine();
11171117    int x = 0;
1118    UINT8 debug_mode = input_port_read(machine, "DEBUG");
1118    UINT8 debug_mode = machine.root_device().ioport("DEBUG")->read();
11191119    UINT8 global_plane_a_disable = debug_mode & 1;
11201120    UINT8 global_plane_b_disable = debug_mode & 2;
11211121    UINT8 debug_backdrop_enable = debug_mode & 4;
src/mame/video/mystston.c
r15082r15083
257257{
258258   mystston_state *state = screen.machine().driver_data<mystston_state>();
259259
260   int flip = (*state->m_video_control & 0x80) ^ ((input_port_read(screen.machine(), "DSW1") & 0x20) << 2);
260   int flip = (*state->m_video_control & 0x80) ^ ((screen.machine().root_device().ioport("DSW1")->read() & 0x20) << 2);
261261
262262   set_palette(screen.machine(), state);
263263
src/mame/video/artmagic.c
r15082r15083
4141VIDEO_START( artmagic )
4242{
4343   artmagic_state *state = machine.driver_data<artmagic_state>();
44   state->m_blitter_base = (UINT16 *)machine.root_device().memregion("gfx1")->base();
44   state->m_blitter_base = (UINT16 *)state->memregion("gfx1")->base();
4545   state->m_blitter_mask = state->memregion("gfx1")->bytes()/2 - 1;
4646
4747   state_save_register_global_array(machine, state->m_xor);
src/mame/video/bking.c
r15082r15083
194194
195195READ8_MEMBER(bking_state::bking_input_port_5_r)
196196{
197   return input_port_read(machine(), m_controller ? "TRACK1_X" : "TRACK0_X");
197   return ioport(m_controller ? "TRACK1_X" : "TRACK0_X")->read();
198198}
199199
200200READ8_MEMBER(bking_state::bking_input_port_6_r)
201201{
202   return input_port_read(machine(), m_controller ? "TRACK1_Y" : "TRACK0_Y");
202   return ioport(m_controller ? "TRACK1_Y" : "TRACK0_Y")->read();
203203}
204204
205205READ8_MEMBER(bking_state::bking_pos_r)
src/mame/video/orbit.c
r15082r15083
8282{
8383   orbit_state *state = screen.machine().driver_data<orbit_state>();
8484
85   state->m_flip_screen = input_port_read(screen.machine(), "DSW2") & 8;
85   state->m_flip_screen = screen.machine().root_device().ioport("DSW2")->read() & 8;
8686
8787   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
8888
src/mame/video/policetr.c
r15082r15083
2626{
2727   policetr_state *state = machine.driver_data<policetr_state>();
2828   /* the source bitmap is in ROM */
29   state->m_srcbitmap = machine.root_device().memregion("gfx1")->base();
29   state->m_srcbitmap = state->memregion("gfx1")->base();
3030
3131   /* compute the height */
3232   state->m_srcbitmap_height_mask = (state->memregion("gfx1")->bytes() / SRCBITMAP_WIDTH) - 1;
r15082r15083
267267   {
268268      /* latch 0x00 is player 1's gun X coordinate */
269269      case 0x00:
270         inputval = ((input_port_read(machine(), "GUNX1") & 0xff) * width) >> 8;
270         inputval = ((ioport("GUNX1")->read() & 0xff) * width) >> 8;
271271         inputval += 0x50;
272272         return (inputval << 20) | 0x20000000;
273273
274274      /* latch 0x01 is player 1's gun Y coordinate */
275275      case 0x01:
276         inputval = ((input_port_read(machine(), "GUNY1") & 0xff) * height) >> 8;
276         inputval = ((ioport("GUNY1")->read() & 0xff) * height) >> 8;
277277         inputval += 0x17;
278278         return (inputval << 20);
279279
280280      /* latch 0x02 is player 2's gun X coordinate */
281281      case 0x02:
282         inputval = ((input_port_read(machine(), "GUNX2") & 0xff) * width) >> 8;
282         inputval = ((ioport("GUNX2")->read() & 0xff) * width) >> 8;
283283         inputval += 0x50;
284284         return (inputval << 20) | 0x20000000;
285285
286286      /* latch 0x03 is player 2's gun Y coordinate */
287287      case 0x03:
288         inputval = ((input_port_read(machine(), "GUNY2") & 0xff) * height) >> 8;
288         inputval = ((ioport("GUNY2")->read() & 0xff) * height) >> 8;
289289         inputval += 0x17;
290290         return (inputval << 20);
291291
src/mame/video/system1.c
r15082r15083
363363static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset)
364364{
365365   system1_state *state = machine.driver_data<system1_state>();
366   UINT32 gfxbanks = machine.root_device().memregion("sprites")->bytes() / 0x8000;
366   UINT32 gfxbanks = state->memregion("sprites")->bytes() / 0x8000;
367367   const UINT8 *gfxbase = state->memregion("sprites")->base();
368368   UINT8 *spriteram = state->m_spriteram;
369369   int flipscreen = state->flip_screen();
src/mame/video/niyanpai.c
r15082r15083
330330   }
331331
332332   state->m_nb19010_busyflag = 0;
333   machine.scheduler().timer_set(attotime::from_nsec(1650 * state->m_nb19010_busyctr), FUNC(blitter_timer_callback));
333   machine.scheduler().timer_set(attotime::from_nsec(1000 * state->m_nb19010_busyctr), FUNC(blitter_timer_callback));
334334}
335335
336336/******************************************************************************
src/mame/video/dynax.c
r15082r15083
356356{
357357   dynax_state *state = machine.driver_data<dynax_state>();
358358   UINT8 cmd;
359   UINT8 *ROM = machine.root_device().memregion(gfx)->base();
359   UINT8 *ROM = state->memregion(gfx)->base();
360360   size_t ROM_size = state->memregion(gfx)->bytes();
361361
362362   int sx;
r15082r15083
12041204   if (toggle)
12051205   {
12061206      dynax_state *state = machine.driver_data<dynax_state>();
1207      UINT8 *RAM = machine.root_device().memregion( "gfx1" )->base();
1207      UINT8 *RAM = state->memregion( "gfx1" )->base();
12081208      size_t size = state->memregion( "gfx1" )->bytes();
12091209      static int i = 0, c = 0, r = 0;
12101210
src/mame/video/balsente.c
r15082r15083
2222
2323   /* reset the system */
2424   state->m_palettebank_vis = 0;
25   state->m_sprite_bank[0] = machine.root_device().memregion("gfx1")->base();
26   state->m_sprite_bank[1] = machine.root_device().memregion("gfx1")->base() + 0x10000;
25   state->m_sprite_bank[0] = state->memregion("gfx1")->base();
26   state->m_sprite_bank[1] = state->memregion("gfx1")->base() + 0x10000;
2727
2828   /* determine sprite size */
29   state->m_sprite_data = machine.root_device().memregion("gfx1")->base();
29   state->m_sprite_data = state->memregion("gfx1")->base();
3030   state->m_sprite_mask = state->memregion("gfx1")->bytes() - 1;
3131
3232   /* register for saving */
src/mame/video/itech32.c
r15082r15083
184184      state->m_videoplane[0][i] = state->m_videoplane[1][i] = 0xff;
185185
186186   /* fetch the GROM base */
187   state->m_grom_base = machine.root_device().memregion("gfx1")->base();
187   state->m_grom_base = state->memregion("gfx1")->base();
188188   state->m_grom_size = state->memregion("gfx1")->bytes();
189189   state->m_grom_bank = 0;
190190   state->m_grom_bank_mask = state->m_grom_size >> 24;
src/mame/video/undrfire.c
r15082r15083
212212{
213213   undrfire_state *state = machine.driver_data<undrfire_state>();
214214   UINT32 *spriteram32 = state->m_spriteram;
215   UINT16 *spritemap = (UINT16 *)machine.root_device().memregion("user1")->base();
215   UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
216216   UINT8 *spritemapHibit = (UINT8 *)state->memregion("user2")->base();
217217
218218   int offs, data, tilenum, color, flipx, flipy;
r15082r15083
468468   /* See if we should draw artificial gun targets */
469469   /* (not yet implemented...) */
470470
471   if (input_port_read(screen.machine(), "FAKE") & 0x1)   /* Fake DSW */
471   if (screen.machine().root_device().ioport("FAKE")->read() & 0x1)   /* Fake DSW */
472472   {
473473      popmessage("Gunsights on");
474474   }
src/mame/video/amiga.c
r15082r15083
147147{
148148   amiga_state *state = screen.machine().driver_data<amiga_state>();
149149   UINT32 hvpos = (state->m_last_scanline << 8) | (screen.hpos() >> 2);
150   UINT32 latchedpos = input_port_read_safe(screen.machine(), "HVPOS", 0);
150   UINT32 latchedpos = state->ioport("HVPOS")->read_safe(0);
151151
152152   /* if there's no latched position, or if we are in the active display area */
153153   /* but before the latching point, return the live HV position */
src/mame/video/vertigo.c
r15082r15083
159159   int i;
160160   UINT64 *mcode;
161161
162   state->m_vectorrom = (UINT16 *)machine.root_device().memregion("user1")->base();
162   state->m_vectorrom = (UINT16 *)state->memregion("user1")->base();
163163   mcode = (UINT64 *)state->memregion("proms")->base();
164164
165165   /* Decode microcode */
src/mame/video/argus.c
r15082r15083
369369   int voffs;
370370   int offs;
371371
372   UINT8 *VROM1 = machine.root_device().memregion("user1")->base();      /* "ag_15.bin" */
372   UINT8 *VROM1 = state->memregion("user1")->base();      /* "ag_15.bin" */
373373   UINT8 *VROM2 = state->memregion("user2")->base();      /* "ag_16.bin" */
374374
375375   /* offset in pattern data */
src/mame/video/lwings.c
r15082r15083
6363{
6464   lwings_state *state = machine.driver_data<lwings_state>();
6565   int code, color;
66   UINT8 *rom = machine.root_device().memregion("gfx5")->base();
66   UINT8 *rom = state->memregion("gfx5")->base();
6767   int mask = state->memregion("gfx5")->bytes() - 1;
6868
6969   tile_index = (tile_index + state->m_bg2_image * 0x20) & mask;
src/mame/video/dkong.c
r15082r15083
880880static void check_palette(running_machine &machine)
881881{
882882   dkong_state *state = machine.driver_data<dkong_state>();
883   const input_port_config *port;
883   ioport_port *port;
884884   int newset;
885885
886886   port = state->ioport("VIDHW");
887887   if (port != NULL)
888888   {
889      newset = input_port_read_direct(port);
889      newset = port->read();
890890      if (newset != state->m_vidhw)
891891      {
892892         state->m_vidhw = newset;
r15082r15083
937937   {
938938      case HARDWARE_TRS02:
939939         machine.primary_screen->register_screen_bitmap(state->m_bg_bits);
940         state->m_gfx3 = machine.root_device().memregion("gfx3")->base();
941         state->m_gfx3_len = machine.root_device().memregion("gfx3")->bytes();
940         state->m_gfx3 = state->memregion("gfx3")->base();
941         state->m_gfx3_len = state->memregion("gfx3")->bytes();
942942          /* fall through */
943943      case HARDWARE_TKG04:
944944      case HARDWARE_TKG02:
r15082r15083
950950         state->m_bg_tilemap->set_scrolldx(0, 128);
951951
952952         machine.primary_screen->register_screen_bitmap(state->m_bg_bits);
953         state->m_gfx4 = machine.root_device().memregion("gfx4")->base();
954         state->m_gfx3 = machine.root_device().memregion("gfx3")->base();
953         state->m_gfx4 = state->memregion("gfx4")->base();
954         state->m_gfx3 = state->memregion("gfx3")->base();
955955         state->m_gfx3_len = state->memregion("gfx3")->bytes();
956956
957957         break;
src/mame/video/travrusa.c
r15082r15083
276276WRITE8_MEMBER(travrusa_state::travrusa_flipscreen_w)
277277{
278278   /* screen flip is handled both by software and hardware */
279   data ^= ~input_port_read(machine(), "DSW2") & 1;
279   data ^= ~ioport("DSW2")->read() & 1;
280280
281281   flip_screen_set(data & 1);
282282
src/mame/video/prehisle.c
r15082r15083
2929
3030   switch (offset)
3131   {
32   case 0x08: return input_port_read(machine(), "P2");                  // Player 2
33   case 0x10: return input_port_read(machine(), "COIN");                  // Coins, Tilt, Service
34   case 0x20: return input_port_read(machine(), "P1") ^ m_invert_controls;      // Player 1
35   case 0x21: return input_port_read(machine(), "DSW0");                  // DIPs
36   case 0x22: return input_port_read(machine(), "DSW1");                  // DIPs + VBLANK
32   case 0x08: return ioport("P2")->read();                  // Player 2
33   case 0x10: return ioport("COIN")->read();                  // Coins, Tilt, Service
34   case 0x20: return ioport("P1")->read() ^ m_invert_controls;      // Player 1
35   case 0x21: return ioport("DSW0")->read();                  // DIPs
36   case 0x22: return ioport("DSW1")->read();                  // DIPs + VBLANK
3737   default: return 0;
3838   }
3939}
src/mame/video/btime.c
r15082r15083
264264   /* For now we just check 0x40 in DSW1, and ignore the write if we */
265265   /* are in upright controls mode. */
266266
267   if (input_port_read(machine(), "DSW1") & 0x40) /* cocktail mode */
267   if (ioport("DSW1")->read() & 0x40) /* cocktail mode */
268268      btime_video_control_w(space, offset, data);
269269}
270270
r15082r15083
278278
279279   m_btime_palette = (data & 0x30) >> 3;
280280
281   if (input_port_read(machine(), "DSW1") & 0x40) /* cocktail mode */
281   if (ioport("DSW1")->read() & 0x40) /* cocktail mode */
282282      flip_screen_set(data & 0x80);
283283}
284284
r15082r15083
286286{
287287   m_btime_palette = (data >> 2) & 0x03;
288288
289   if (!(input_port_read(machine(), "DSW1") & 0x40)) /* cocktail mode */
289   if (!(ioport("DSW1")->read() & 0x40)) /* cocktail mode */
290290      flip_screen_set(data & 0x01);
291291}
292292
src/mame/video/cps1.c
r15082r15083
16191619            m_cps_b_regs[m_game_config->mult_factor2 / 2]) >> 16;
16201620
16211621   if (offset == m_game_config->in2_addr / 2)   /* Extra input ports (on C-board) */
1622      return input_port_read(machine(), "IN2");
1622      return ioport("IN2")->read();
16231623
16241624   if (offset == m_game_config->in3_addr / 2)   /* Player 4 controls (on C-board) ("Captain Commando") */
1625      return input_port_read(machine(), "IN3");
1625      return ioport("IN3")->read();
16261626
16271627   if (m_cps_version == 2)
16281628   {
src/mame/video/lethalj.c
r15082r15083
2727   int width = visarea.width();
2828   int height = visarea.height();
2929
30   *x = ((input_port_read_safe(machine, gunnames[player * 2], 0x00) & 0xff) * width) / 255;
31   *y = ((input_port_read_safe(machine, gunnames[1 + player * 2], 0x00) & 0xff) * height) / 255;
30   *x = ((machine.root_device().ioport(gunnames[player * 2])->read_safe(0x00) & 0xff) * width) / 255;
31   *y = ((machine.root_device().ioport(gunnames[1 + player * 2])->read_safe(0x00) & 0xff) * height) / 255;
3232}
3333
3434
r15082r15083
8282   state->m_screenram = auto_alloc_array(machine, UINT16, BLITTER_DEST_WIDTH * BLITTER_DEST_HEIGHT);
8383
8484   /* predetermine blitter info */
85   state->m_blitter_base = (UINT16 *)machine.root_device().memregion("gfx1")->base();
85   state->m_blitter_base = (UINT16 *)state->memregion("gfx1")->base();
8686   state->m_blitter_rows = state->memregion("gfx1")->bytes() / (2*BLITTER_SOURCE_WIDTH);
8787}
8888
src/mame/video/itech8.c
r15082r15083
175175   state->m_page_select = 0xc0;
176176
177177   /* fetch the GROM base */
178   state->m_grom_base = machine.root_device().memregion("grom")->base();
178   state->m_grom_base = state->memregion("grom")->base();
179179   state->m_grom_size = state->memregion("grom")->bytes();
180180}
181181
r15082r15083
461461
462462   /* a read from offsets 12-15 return input port values */
463463   if (offset >= 12 && offset <= 15)
464      result = input_port_read_safe(machine(), portnames[offset - 12], 0x00);
464      result = ioport(portnames[offset - 12])->read_safe(0x00);
465465
466466   return result;
467467}
src/mame/video/hyprduel.c
r15082r15083
472472{
473473   hyprduel_state *state = machine.driver_data<hyprduel_state>();
474474   UINT8 *base_gfx4 = state->m_expanded_gfx1;
475   UINT8 *base_gfx8 = machine.root_device().memregion("gfx1")->base();
475   UINT8 *base_gfx8 = state->memregion("gfx1")->base();
476476   UINT32 gfx_size = state->memregion("gfx1")->bytes();
477477
478478   int max_x = machine.primary_screen->width();
src/mame/video/cosmic.c
r15082r15083
373373{
374374   cosmic_state *state = machine.driver_data<cosmic_state>();
375375   UINT8 y;
376   UINT8 *horz_PROM = machine.root_device().memregion("user2")->base();
376   UINT8 *horz_PROM = state->memregion("user2")->base();
377377   UINT8 *vert_PROM = state->memregion("user3")->base();
378378   offs_t horz_addr = 0;
379379
src/mame/video/model2.c
r15082r15083
27132713   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(model2_exit), &machine));
27142714
27152715   /* initialize the hardware rasterizer */
2716   model2_3d_init( machine, (UINT16*)machine.root_device().memregion("user3")->base() );
2716   model2_3d_init( machine, (UINT16*)state->memregion("user3")->base() );
27172717
27182718   /* initialize the geometry engine */
27192719   geo_init( machine, (UINT32*)state->memregion("user2")->base() );
src/mame/video/lazercmd.c
r15082r15083
2929   int xbit, ybit, size;
3030
3131   size = 2;
32   if (input_port_read(machine, "DSW") & 0x40)
32   if (machine.root_device().ioport("DSW")->read() & 0x40)
3333   {
3434      size = 4;
3535   }
r15082r15083
5555   lazercmd_state *state = screen.machine().driver_data<lazercmd_state>();
5656   int i, x, y;
5757
58   int video_inverted = input_port_read(screen.machine(), "DSW") & 0x20;
58   int video_inverted = screen.machine().root_device().ioport("DSW")->read() & 0x20;
5959
6060   /* The first row of characters are invisible */
6161   for (i = 0; i < (VERT_RES - 1) * HORZ_RES; i++)
src/mame/video/blockade.c
r15082r15083
66   m_videoram[offset] = data;
77   m_bg_tilemap->mark_tile_dirty(offset);
88
9   if (input_port_read(machine(), "IN3") & 0x80)
9   if (ioport("IN3")->read() & 0x80)
1010   {
1111      logerror("blockade_videoram_w: scanline %d\n", machine().primary_screen->vpos());
1212      device_spin_until_interrupt(&space.device());
src/mame/video/lordgun.c
r15082r15083
177177
178178static const char *const gunnames[] = { "LIGHT0_X", "LIGHT1_X", "LIGHT0_Y", "LIGHT1_Y" };
179179
180float lordgun_crosshair_mapper(const input_field_config *field, float linear_value)
180float lordgun_crosshair_mapper(ioport_field *field, float linear_value)
181181{
182182   int x = linear_value - 0x3c;
183183
r15082r15083
190190static void lorddgun_calc_gun_scr(running_machine &machine, int i)
191191{
192192   lordgun_state *state = machine.driver_data<lordgun_state>();
193//  popmessage("%03x, %02x", input_port_read(machine, "LIGHT0_X"), input_port_read(machine, "LIGHT0_Y"));
193//  popmessage("%03x, %02x", machine, "LIGHT0_X"), state->ioport("LIGHT0_Y")->read());
194194
195   int x = input_port_read(machine, gunnames[i]) - 0x3c;
195   int x = state->ioport(gunnames[i])->read() - 0x3c;
196196
197197   if ( (x < 0) || (x > sizeof(lordgun_gun_x_table)/sizeof(lordgun_gun_x_table[0])) )
198198      x = 0;
199199
200200   state->m_gun[i].scr_x = lordgun_gun_x_table[x];
201   state->m_gun[i].scr_y = input_port_read(machine, gunnames[i+2]);
201   state->m_gun[i].scr_y = state->ioport(gunnames[i+2])->read();
202202}
203203
204204void lordgun_update_gun(running_machine &machine, int i)
r15082r15083
206206   lordgun_state *state = machine.driver_data<lordgun_state>();
207207   const rectangle &visarea = machine.primary_screen->visible_area();
208208
209   state->m_gun[i].hw_x = input_port_read(machine, gunnames[i]);
210   state->m_gun[i].hw_y = input_port_read(machine, gunnames[i+2]);
209   state->m_gun[i].hw_x = state->ioport(gunnames[i])->read();
210   state->m_gun[i].hw_y = state->ioport(gunnames[i+2])->read();
211211
212212   lorddgun_calc_gun_scr(machine, i);
213213
src/mame/video/tmnt.c
r15082r15083
466466      /* bit 0 is data */
467467      /* bit 1 is cs (active low) */
468468      /* bit 2 is clock (active high) */
469      input_port_write(machine(), "EEPROMOUT", data, 0xff);
469      ioport("EEPROMOUT")->write(data, 0xff);
470470
471471      /* bits 3-4 control palette dimming */
472472      /* 4 = DIMPOL = when set, negate SHAD */
src/mame/video/dc.c
r15082r15083
26792679      pvr_drawframebuffer(screen.machine(),bitmap,cliprect);
26802680
26812681   // update this here so we only do string lookup once per frame
2682   state->debug_dip_status = input_port_read(screen.machine(), "MAMEDEBUG");
2682   state->debug_dip_status = screen.machine().root_device().ioport("MAMEDEBUG")->read();
26832683
26842684   return 0;
26852685}
src/mame/video/psikyo.c
r15082r15083
533533
534534   tilemap_t *tmptilemap0, *tmptilemap1;
535535
536   state->flip_screen_set(~input_port_read(screen.machine(), "DSW") & 0x00010000);      // hardwired to a DSW bit
536   state->flip_screen_set(~screen.machine().root_device().ioport("DSW")->read() & 0x00010000);      // hardwired to a DSW bit
537537
538538   /* Layers enable (not quite right) */
539539
r15082r15083
707707
708708   tilemap_t *tmptilemap0, *tmptilemap1;
709709
710   state->flip_screen_set(~input_port_read(screen.machine(), "DSW") & 0x00010000);      // hardwired to a DSW bit
710   state->flip_screen_set(~screen.machine().root_device().ioport("DSW")->read() & 0x00010000);      // hardwired to a DSW bit
711711
712712   /* Layers enable (not quite right) */
713713
src/mame/video/pgm.c
r15082r15083
620620   pgm_state *state = machine.driver_data<pgm_state>();
621621   int i;
622622
623   state->m_bdata = machine.root_device().memregion("sprmask")->base();
623   state->m_bdata = state->memregion("sprmask")->base();
624624   state->m_bdatasize = state->memregion("sprmask")->bytes() - 1;
625625   state->m_aoffset = 0;
626626   state->m_boffset = 0;
src/mame/video/snes.c
r15082r15083
15051505   struct SCANLINE *scanline1, *scanline2;
15061506   UINT16 c;
15071507   UINT16 prev_colour = 0;
1508   int blurring = input_port_read_safe(machine, "OPTIONS", 0) & 0x01;
1508   int blurring = machine.root_device().ioport("OPTIONS")->read_safe(0) & 0x01;
15091509
15101510   g_profiler.start(PROFILER_VIDEO);
15111511
r15082r15083
26612661static UINT8 snes_dbg_video( running_machine &machine, UINT16 curline )
26622662{
26632663   int i;
2664   UINT8 toggles = input_port_read_safe(machine, "DEBUG1", 0);
2664   UINT8 toggles = machine.root_device().ioport("DEBUG1")->read_safe(0);
26652665   debug_options.select_pri[SNES_BG1] = (toggles & 0x03);
26662666   debug_options.select_pri[SNES_BG2] = (toggles & 0x0c) >> 2;
26672667   debug_options.select_pri[SNES_BG3] = (toggles & 0x30) >> 4;
26682668   debug_options.select_pri[SNES_BG4] = (toggles & 0xc0) >> 6;
26692669
2670   toggles = input_port_read_safe(machine, "DEBUG2", 0);
2670   toggles = machine.root_device().ioport("DEBUG2")->read_safe(0);
26712671   for (i = 0; i < 4; i++)
26722672      DEBUG_TOGGLE(i, debug_options.bg_disabled[i], ("Debug: Disabled BG%d.\n", i + 1), ("Debug: Enabled BG%d.\n", i + 1))
26732673   DEBUG_TOGGLE(4, debug_options.bg_disabled[SNES_OAM], ("Debug: Disabled OAM.\n"), ("Debug: Enabled OAM.\n"))
r15082r15083
26752675   DEBUG_TOGGLE(6, debug_options.colormath_disabled, ("Debug: Disabled Color Math.\n"), ("Debug: Enabled Color Math.\n"))
26762676   DEBUG_TOGGLE(7, debug_options.windows_disabled, ("Debug: Disabled Window Masks.\n"), ("Debug: Enabled Window Masks.\n"))
26772677
2678   toggles = input_port_read_safe(machine, "DEBUG4", 0);
2678   toggles = machine.root_device().ioport("DEBUG4")->read_safe(0);
26792679   for (i = 0; i < 8; i++)
26802680      DEBUG_TOGGLE(i, debug_options.mode_disabled[i], ("Debug: Disabled Mode %d drawing.\n", i), ("Debug: Enabled Mode %d drawing.\n", i))
26812681
2682   toggles = input_port_read_safe(machine, "DEBUG3", 0);
2682   toggles = machine.root_device().ioport("DEBUG3")->read_safe(0);
26832683   DEBUG_TOGGLE(2, debug_options.mosaic_disabled, ("Debug: Disabled Mosaic.\n"), ("Debug: Enabled Mosaic.\n"))
26842684   debug_options.sprite_reversed = BIT(toggles, 7);
26852685   debug_options.select_pri[SNES_OAM] = (toggles & 0x70) >> 4;
src/mame/video/mcatadv.c
r15082r15083
6060
6161   UINT16 *destline;
6262   UINT8 *priline;
63   UINT8 *sprdata = machine.root_device().memregion("gfx1")->base();
63   UINT8 *sprdata = state->memregion("gfx1")->base();
6464   int sprmask = state->memregion("gfx1")->bytes()-1;
6565
6666   int xstart, xend, xinc;
src/mame/video/cinemat.c
r15082r15083
232232
233233SCREEN_UPDATE_RGB32( spacewar )
234234{
235   int sw_option = input_port_read(screen.machine(), "INPUTS");
235   int sw_option = screen.machine().root_device().ioport("INPUTS")->read();
236236
237237   SCREEN_UPDATE32_CALL(cinemat);
238238
src/mame/video/wecleman.c
r15082r15083
7777{
7878   wecleman_state *state = machine.driver_data<wecleman_state>();
7979   const pen_t *base_pal = machine.pens;
80   UINT8 *base_gfx = machine.root_device().memregion("gfx1")->base();
80   UINT8 *base_gfx = state->memregion("gfx1")->base();
8181   int gfx_max     = state->memregion("gfx1")->bytes();
8282
8383   UINT16 *source = state->m_spriteram;
src/mame/video/cischeat.c
r15082r15083
299299{
300300   switch (offset)
301301   {
302      case 0x0000/2 : return input_port_read(machine(), "IN1");   // Coins
303      case 0x0002/2 : return input_port_read(machine(), "IN2");   // Buttons
304      case 0x0004/2 : return input_port_read(machine(), "IN3");   // Motor Limit Switches
305      case 0x0006/2 : return input_port_read(machine(), "IN4");   // DSW 1 & 2
302      case 0x0000/2 : return ioport("IN1")->read();   // Coins
303      case 0x0002/2 : return ioport("IN2")->read();   // Buttons
304      case 0x0004/2 : return ioport("IN3")->read();   // Motor Limit Switches
305      case 0x0006/2 : return ioport("IN4")->read();   // DSW 1 & 2
306306
307307      case 0x0008/2 :   return soundlatch2_word_r(space,0,0xffff);   // From sound cpu
308308
309309      case 0x0010/2 :
310310         switch (m_ip_select & 0x3)
311311         {
312            case 0 : return input_port_read(machine(), "IN6");      // Driving Wheel
312            case 0 : return ioport("IN6")->read();      // Driving Wheel
313313            case 1 : return 0xffff;               // Cockpit: Up / Down Position
314314            case 2 : return 0xffff;               // Cockpit: Left / Right Position?
315            case 3 : return input_port_read(machine(), "PEDAL");   // Accelerator (Pedal)
315            case 3 : return ioport("PEDAL")->read();   // Accelerator (Pedal)
316316            default: return 0xffff;
317317         }
318318
319319
320      case 0x2200/2 : return input_port_read(machine(), "IN5");   // DSW 3 (4 bits)
320      case 0x2200/2 : return ioport("IN5")->read();   // DSW 3 (4 bits)
321321
322322      default:   SHOW_READ_ERROR("vreg %04X read!",offset*2);
323323               return m_vregs[offset];
r15082r15083
395395{
396396   switch (offset)
397397   {
398      case 0x0000/2 : return input_port_read(machine(), "IN1");   // Coins
399      case 0x0002/2 : return input_port_read(machine(), "IN2");   // Buttons
400      case 0x0004/2 : return input_port_read(machine(), "IN3");   // Motor Limit Switches
401      case 0x0006/2 : return input_port_read(machine(), "IN4");   // DSW 1 & 2
398      case 0x0000/2 : return ioport("IN1")->read();   // Coins
399      case 0x0002/2 : return ioport("IN2")->read();   // Buttons
400      case 0x0004/2 : return ioport("IN3")->read();   // Motor Limit Switches
401      case 0x0006/2 : return ioport("IN4")->read();   // DSW 1 & 2
402402
403403      case 0x0010/2 :
404404         switch (m_ip_select & 0x3)
405405         {
406            case 0 : return input_port_read(machine(), "IN6");   // Driving Wheel
406            case 0 : return ioport("IN6")->read();   // Driving Wheel
407407            case 1 : return ~0;               // Cockpit: Up / Down Position?
408408            case 2 : return ~0;               // Cockpit: Left / Right Position?
409409            default: return ~0;
410410         }
411411
412      case 0x2200/2 : return input_port_read(machine(), "IN5");   // DSW 3 (4 bits)
412      case 0x2200/2 : return ioport("IN5")->read();   // DSW 3 (4 bits)
413413      case 0x2300/2 : return soundlatch2_byte_r(space,0);   // From sound cpu
414414
415415      default:   SHOW_READ_ERROR("vreg %04X read!",offset*2);
r15082r15083
488488{
489489   switch (offset)
490490   {
491      case 0x0000/2 :   return input_port_read(machine(), "IN1");   // DSW 1 & 2
491      case 0x0000/2 :   return ioport("IN1")->read();   // DSW 1 & 2
492492
493493//      case 0x0002/2 : return 0xFFFF;
494494
495      case 0x0004/2 :   return input_port_read(machine(), "IN2");   // Buttons
495      case 0x0004/2 :   return ioport("IN2")->read();   // Buttons
496496
497      case 0x0006/2 :   return input_port_read(machine(), "IN3");   // ? Read at boot only
497      case 0x0006/2 :   return ioport("IN3")->read();   // ? Read at boot only
498498
499499      case 0x0008/2 :   return soundlatch2_byte_r(space,0);      // From sound cpu
500500
501      case 0x000c/2 :   return input_port_read(machine(), "IN4");   // DSW 3
501      case 0x000c/2 :   return ioport("IN4")->read();   // DSW 3
502502
503503      case 0x0010/2 :   // Accel + Driving Wheel
504         return (input_port_read(machine(), "PEDAL") & 0xff) + ((input_port_read(machine(), "IN5") & 0xff)<<8);
504         return (ioport("PEDAL")->read() & 0xff) + ((ioport("IN5")->read() & 0xff)<<8);
505505
506506      default:      SHOW_READ_ERROR("vreg %04X read!",offset*2);
507507                  return m_vregs[offset];
r15082r15083
534534
535535   switch (offset)
536536   {
537      case 0x0000/2 :   return input_port_read(machine(), "IN0"); // DSW 1 & 2
537      case 0x0000/2 :   return ioport("IN0")->read(); // DSW 1 & 2
538538
539      case 0x0004/2 :   return input_port_read(machine(), "IN1"); // Buttons
539      case 0x0004/2 :   return ioport("IN1")->read(); // Buttons
540540
541541      case 0x0008/2 :   return soundlatch2_byte_r(space,0); // From sound cpu
542542
543543      case 0x0010/2 :   // X, Y
544         return input_port_read(machine(), "IN2") | (input_port_read(machine(), "IN3")<<8);
544         return ioport("IN2")->read() | (ioport("IN3")->read()<<8);
545545
546546      case 0x0018/2 :
547547         return (m_f1gpstr2_ioready[0]&1) ? 0xff : 0xf0;
src/mame/video/namcos22.c
r15082r15083
27412741   for (code = 0; code < machine.gfx[GFX_TEXTURE_TILE]->total_elements; code++)
27422742      gfx_element_decode(machine.gfx[GFX_TEXTURE_TILE], code);
27432743
2744   Prepare3dTexture(machine, machine.root_device().memregion("textilemap")->base(), machine.gfx[GFX_TEXTURE_TILE]->gfxdata );
2744   Prepare3dTexture(machine, state->memregion("textilemap")->base(), machine.gfx[GFX_TEXTURE_TILE]->gfxdata );
27452745   state->m_dirtypal = auto_alloc_array(machine, UINT8, NAMCOS22_PALETTE_SIZE/4);
2746   state->m_mPtRomSize = machine.root_device().memregion("pointrom")->bytes()/3;
2746   state->m_mPtRomSize = state->memregion("pointrom")->bytes()/3;
27472747   state->m_mpPolyL = state->memregion("pointrom")->base();
27482748   state->m_mpPolyM = state->m_mpPolyL + state->m_mPtRomSize;
27492749   state->m_mpPolyH = state->m_mpPolyM + state->m_mPtRomSize;
src/mame/video/centiped.c
r15082r15083
462462{
463463   centiped_state *state = screen.machine().driver_data<centiped_state>();
464464   UINT8 *spriteram = state->m_spriteram;
465   int upright_mode = input_port_read(screen.machine(), "IN0") & 0x80;
465   int upright_mode = screen.machine().root_device().ioport("IN0")->read() & 0x80;
466466   int offs;
467467
468468   /* if the cocktail/upright switch flipped, force refresh */
src/mame/video/atarisy1.c
r15082r15083
557557static void decode_gfx(running_machine &machine, UINT16 *pflookup, UINT16 *molookup)
558558{
559559   atarisy1_state *state = machine.driver_data<atarisy1_state>();
560   UINT8 *prom1 = &machine.root_device().memregion("proms")->u8(0x000);
560   UINT8 *prom1 = &state->memregion("proms")->u8(0x000);
561561   UINT8 *prom2 = &state->memregion("proms")->u8(0x200);
562562   int obj, i;
563563
src/mame/video/metro.c
r15082r15083
446446{
447447   metro_state *state = machine.driver_data<metro_state>();
448448   UINT8 *base_gfx4 = state->m_expanded_gfx1;
449   UINT8 *base_gfx8 = machine.root_device().memregion("gfx1")->base();
449   UINT8 *base_gfx8 = state->memregion("gfx1")->base();
450450   UINT32 gfx_size = state->memregion("gfx1")->bytes();
451451   const rectangle &visarea = machine.primary_screen->visible_area();
452452
src/mame/video/opwolf.c
r15082r15083
5252
5353   pc090oj_draw_sprites(state->m_pc090oj, bitmap, cliprect, 1);
5454
55//  if (input_port_read(machine, "P1X"))
56//  popmessage("%d %d", input_port_read(machine, "P1X"), input_port_read(machine, "P1Y"));
55//  if (state->ioport("P1X")->read())
56//  popmessage("%d %d", machine, "P1X"), state->ioport("P1Y")->read());
5757
5858   return 0;
5959}
src/mame/video/m52.c
r15082r15083
276276WRITE8_MEMBER(m52_state::m52_flipscreen_w)
277277{
278278   /* screen flip is handled both by software and hardware */
279   flip_screen_set((data & 0x01) ^ (~input_port_read(machine(), "DSW2") & 0x01));
279   flip_screen_set((data & 0x01) ^ (~ioport("DSW2")->read() & 0x01));
280280
281281   coin_counter_w(machine(), 0, data & 0x02);
282282   coin_counter_w(machine(), 1, data & 0x20);
src/mame/video/jaguar.c
r15082r15083
239239   int width = visarea.width();
240240   int height = visarea.height();
241241   /* only 2 lightguns are connected */
242   *x = visarea.min_x + (((input_port_read(machine, player ? "FAKE2_X" : "FAKE1_X") & 0xff) * width) >> 8);
243   *y = visarea.min_y + (((input_port_read(machine, player ? "FAKE2_Y" : "FAKE1_Y") & 0xff) * height) >> 8);
242   *x = visarea.min_x + (((machine.root_device().ioport(player ? "FAKE2_X" : "FAKE1_X")->read() & 0xff) * width) >> 8);
243   *y = visarea.min_y + (((machine.root_device().ioport(player ? "FAKE2_Y" : "FAKE1_Y")->read() & 0xff) * height) >> 8);
244244}
245245
246246
r15082r15083
805805         return (beamy << 16) | (beamx ^ 0x1ff);
806806
807807      case 2:
808         return input_port_read(space->machine(), "IN3");
808         return space->machine().root_device().ioport("IN3")->read();
809809   }
810810   return 0;
811811}
src/mame/video/n8080.c
r15082r15083
254254SCREEN_UPDATE_IND16( helifire )
255255{
256256   n8080_state *state = screen.machine().driver_data<n8080_state>();
257   int SUN_BRIGHTNESS = input_port_read(screen.machine(), "POT0");
258   int SEA_BRIGHTNESS = input_port_read(screen.machine(), "POT1");
257   int SUN_BRIGHTNESS = screen.machine().root_device().ioport("POT0")->read();
258   int SEA_BRIGHTNESS = screen.machine().root_device().ioport("POT1")->read();
259259
260260   static const int wave[8] = { 0, 1, 2, 2, 2, 1, 0, 0 };
261261
src/mame/video/turbo.c
r15082r15083
341341                    VR1 = 310 Ohm
342342                    VR2 = 910 Ohm
343343            */
344         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);
345      }
344         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);
345       }
346346   }
347347}
348348
src/mame/video/bombjack.c
r15082r15083
7777   bombjack_state *state = machine.driver_data<bombjack_state>();
7878   int offs;
7979
80   for (offs = state->m_spriteram_size - 4; offs >= 0; offs -= 4)
80   for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
8181   {
8282
8383/*
src/mame/video/astrocde.c
r15082r15083
481481         break;
482482
483483      case 0x10:   /* player 1 handle */
484         result = input_port_read_safe(machine(), "P1HANDLE", 0xff);
484         result = ioport("P1HANDLE")->read_safe(0xff);
485485         break;
486486
487487      case 0x11:   /* player 2 handle */
488         result = input_port_read_safe(machine(), "P2HANDLE", 0xff);
488         result = ioport("P2HANDLE")->read_safe(0xff);
489489         break;
490490
491491      case 0x12:   /* player 3 handle */
492         result = input_port_read_safe(machine(), "P3HANDLE", 0xff);
492         result = ioport("P3HANDLE")->read_safe(0xff);
493493         break;
494494
495495      case 0x13:   /* player 4 handle */
496         result = input_port_read_safe(machine(), "P4HANDLE", 0xff);
496         result = ioport("P4HANDLE")->read_safe(0xff);
497497         break;
498498
499499      case 0x14:   /* keypad column 0 */
500         result = input_port_read_safe(machine(), "KEYPAD0", 0xff);
500         result = ioport("KEYPAD0")->read_safe(0xff);
501501         break;
502502
503503      case 0x15:   /* keypad column 1 */
504         result = input_port_read_safe(machine(), "KEYPAD1", 0xff);
504         result = ioport("KEYPAD1")->read_safe(0xff);
505505         break;
506506
507507      case 0x16:   /* keypad column 2 */
508         result = input_port_read_safe(machine(), "KEYPAD2", 0xff);
508         result = ioport("KEYPAD2")->read_safe(0xff);
509509         break;
510510
511511      case 0x17:   /* keypad column 3 */
512         result = input_port_read_safe(machine(), "KEYPAD3", 0xff);
512         result = ioport("KEYPAD3")->read_safe(0xff);
513513         break;
514514
515515      case 0x1c:   /* player 1 knob */
516         result = input_port_read_safe(machine(), "P1_KNOB", 0xff);
516         result = ioport("P1_KNOB")->read_safe(0xff);
517517         break;
518518
519519      case 0x1d:   /* player 2 knob */
520         result = input_port_read_safe(machine(), "P2_KNOB", 0xff);
520         result = ioport("P2_KNOB")->read_safe(0xff);
521521         break;
522522
523523      case 0x1e:   /* player 3 knob */
524         result = input_port_read_safe(machine(), "P3_KNOB", 0xff);
524         result = ioport("P3_KNOB")->read_safe(0xff);
525525         break;
526526
527527      case 0x1f:   /* player 4 knob */
528         result = input_port_read_safe(machine(), "P4_KNOB", 0xff);
528         result = ioport("P4_KNOB")->read_safe(0xff);
529529         break;
530530   }
531531
src/mame/video/m62.c
r15082r15083
305305WRITE8_MEMBER(m62_state::m62_flipscreen_w)
306306{
307307   /* screen flip is handled both by software and hardware */
308   data ^= ~input_port_read(machine(), "DSW2") & 1;
308   data ^= ~ioport("DSW2")->read() & 1;
309309
310310   m_flipscreen = data & 0x01;
311311   if (m_flipscreen)
src/mame/video/psychic5.c
r15082r15083
110110   {
111111      switch (offset)
112112      {
113         case 0x00: return input_port_read(machine(), "SYSTEM");
114         case 0x01: return input_port_read(machine(), "P1");
115         case 0x02: return input_port_read(machine(), "P2");
116         case 0x03: return input_port_read(machine(), "DSW1");
117         case 0x04: return input_port_read(machine(), "DSW2");
113         case 0x00: return ioport("SYSTEM")->read();
114         case 0x01: return ioport("P1")->read();
115         case 0x02: return ioport("P2")->read();
116         case 0x03: return ioport("DSW1")->read();
117         case 0x04: return ioport("DSW2")->read();
118118      }
119119   }
120120
src/mame/video/esripsys.c
r15082r15083
225225
226226      if (x_flip)
227227      {
228         rom_l = machine.root_device().memregion("8bpp_r")->base();
228         rom_l = state->memregion("8bpp_r")->base();
229229         rom_r = state->memregion("8bpp_l")->base();
230230      }
231231      else
src/mame/video/canyon.c
r15082r15083
8383   draw_bombs(screen.machine(), bitmap, cliprect);
8484
8585   /* watchdog is disabled during service mode */
86   screen.machine().watchdog_enable(!(input_port_read(screen.machine(), "IN2") & 0x10));
86   screen.machine().watchdog_enable(!(screen.machine().root_device().ioport("IN2")->read() & 0x10));
8787
8888   return 0;
8989}
src/mame/video/f1gp.c
r15082r15083
5252
5353   state->m_fg_tilemap->set_transparent_pen(0xff);
5454
55   state->m_zoomdata = (UINT16 *)machine.root_device().memregion("gfx4")->base();
55   state->m_zoomdata = (UINT16 *)state->memregion("gfx4")->base();
5656   gfx_element_set_source(machine.gfx[3], (UINT8 *)state->m_zoomdata);
5757
5858//  state->save_pointer(NAME(state->m_zoomdata), state->memregion("gfx4")->bytes());
r15082r15083
6868
6969   state->m_fg_tilemap->set_transparent_pen(0xff);
7070
71   state->m_zoomdata = (UINT16 *)machine.root_device().memregion("gfx4")->base();
71   state->m_zoomdata = (UINT16 *)state->memregion("gfx4")->base();
7272   gfx_element_set_source(machine.gfx[3], (UINT8 *)state->m_zoomdata);
7373
7474//  state->save_pointer(NAME(state->m_zoomdata), state->memregion("gfx4")->bytes());
src/mame/video/route16.c
r15082r15083
130130   route16_state *state = machine.driver_data<route16_state>();
131131   offs_t offs;
132132
133   UINT8 *color_prom1 = &machine.root_device().memregion("proms")->base()[0x000];
133   UINT8 *color_prom1 = &state->memregion("proms")->base()[0x000];
134134   UINT8 *color_prom2 = &state->memregion("proms")->base()[0x100];
135135
136136   for (offs = 0; offs < state->m_videoram1.bytes(); offs++)
src/mame/video/exidy440.c
r15082r15083
435435   {
436436      int i;
437437
438      int beamx = ((input_port_read(screen.machine(), "AN0") & 0xff) * (HBSTART - HBEND)) >> 8;
439      int beamy = ((input_port_read(screen.machine(), "AN1") & 0xff) * (VBSTART - VBEND)) >> 8;
438      int beamx = ((screen.machine().root_device().ioport("AN0")->read() & 0xff) * (HBSTART - HBEND)) >> 8;
439      int beamy = ((screen.machine().root_device().ioport("AN1")->read() & 0xff) * (VBSTART - VBEND)) >> 8;
440440
441441      /* The timing of this FIRQ is very important. The games look for an FIRQ
442442            and then wait about 650 cycles, clear the old FIRQ, and wait a
src/mame/video/tx1.c
r15082r15083
416416   UINT8   pix[2][4][3];
417417
418418   /* Road slice map ROMs */
419   const UINT8 *const gfx3 = machine.root_device().memregion("gfx3")->base();
419   const UINT8 *const gfx3 = state->memregion("gfx3")->base();
420420   const UINT8 *const rom_a = gfx3;
421421   const UINT8 *const rom_b = gfx3 + 0x2000;
422422   const UINT8 *const rom_c = gfx3 + 0x4000;
r15082r15083
859859   UINT32 offs;
860860
861861   /* The many lookup table ROMs */
862   const UINT8 *const ic48 = machine.root_device().memregion("user3")->base();
862   const UINT8 *const ic48 = state->memregion("user3")->base();
863863   const UINT8 *const ic281 = ic48 + 0x2000;
864864
865   const UINT8 *const proms = machine.root_device().memregion("proms")->base();
865   const UINT8 *const proms = state->memregion("proms")->base();
866866   const UINT8 *const ic190 = proms + 0xc00;
867867   const UINT8 *const ic162 = proms + 0xe00;
868868   const UINT8 *const ic25  = proms + 0x1000;
869869
870   const UINT8 *const ic106 = machine.root_device().memregion("obj_map")->base();
870   const UINT8 *const ic106 = state->memregion("obj_map")->base();
871871   const UINT8 *const ic73  = ic106 + 0x4000;
872872
873873   const UINT8 *const pixdata_rgn = state->memregion("obj_tiles")->base();
r15082r15083
13001300   UINT32 x_mask;
13011301
13021302   /* 2bpp characters */
1303   chars = machine.root_device().memregion("char_tiles")->base();
1303   chars = state->memregion("char_tiles")->base();
13041304   gfx2 = state->memregion("char_tiles")->base() + 0x4000;
13051305
13061306   /* X/Y scroll values are the last word in char RAM */
r15082r15083
15351535   UINT32 rva20_6;
15361536
15371537   /* ROM/PROM lookup tables */
1538   const UINT8 *rcols = (UINT8*)(machine.root_device().memregion("proms")->base() + 0x1500);
1538   const UINT8 *rcols = (UINT8*)(state->memregion("proms")->base() + 0x1500);
15391539   const UINT8 *rom   = state->memregion("road")->base();
15401540   const UINT8 *prom0 = rom + 0x4000;
15411541   const UINT8 *prom1 = rom + 0x4200;
r15082r15083
21672167   UINT32 rva20_6;
21682168
21692169   /* ROM/PROM lookup tables */
2170   const UINT8 *rcols = (UINT8*)(machine.root_device().memregion("proms")->base() + 0x1500);
2170   const UINT8 *rcols = (UINT8*)(state->memregion("proms")->base() + 0x1500);
21712171   const UINT8 *rom   = state->memregion("road")->base();
21722172   const UINT8 *prom0 = rom + 0x4000;
21732173   const UINT8 *prom1 = rom + 0x4200;
r15082r15083
25802580   UINT32 x_stride;
25812581
25822582   /* The many lookup table ROMs */
2583   const UINT8 *const bug13  = (UINT8*)machine.root_device().memregion("obj_luts")->base();
2583   const UINT8 *const bug13  = (UINT8*)state->memregion("obj_luts")->base();
25842584   const UINT8 *const bug18s = bug13 + 0x2000;
2585   const UINT8 *const bb8    = (UINT8*)machine.root_device().memregion("proms")->base() + 0x1600;
2585   const UINT8 *const bb8    = (UINT8*)state->memregion("proms")->base() + 0x1600;
25862586
2587   const UINT8 *const bug16s = (UINT8*)machine.root_device().memregion("obj_map")->base();
2587   const UINT8 *const bug16s = (UINT8*)state->memregion("obj_map")->base();
25882588   const UINT8 *const bug17s = bug16s + 0x8000;
25892589
2590   const UINT8 *const bb9o = (UINT8*)machine.root_device().memregion("proms")->base() + 0x500;
2590   const UINT8 *const bb9o = (UINT8*)state->memregion("proms")->base() + 0x500;
25912591   const UINT8 *const bb9e = bb9o + 0x800;
25922592
25932593   const UINT8 *const pixdata_rgn = (UINT8*)state->memregion("obj_tiles")->base();
src/mame/video/m72.c
r15082r15083
365365      coin_counter_w(machine(), 1,data & 0x02);
366366
367367      /* bit 2 is flip screen (handled both by software and hardware) */
368      flip_screen_set(((data & 0x04) >> 2) ^ ((~input_port_read(machine(), "DSW") >> 8) & 1));
368      flip_screen_set(((data & 0x04) >> 2) ^ ((~ioport("DSW")->read() >> 8) & 1));
369369
370370      /* bit 3 is display disable */
371371      m_video_off = data & 0x08;
r15082r15083
391391      coin_counter_w(machine(), 1,data & 0x02);
392392
393393      /* bit 2 is flip screen (handled both by software and hardware) */
394      flip_screen_set(((data & 0x04) >> 2) ^ ((~input_port_read(machine(), "DSW") >> 8) & 1));
394      flip_screen_set(((data & 0x04) >> 2) ^ ((~ioport("DSW")->read() >> 8) & 1));
395395
396396      /* bit 3 is display disable */
397397      m_video_off = data & 0x08;
src/mame/video/madalien.c
r15082r15083
253253static SCREEN_UPDATE_IND16( madalien )
254254{
255255   madalien_state *state = screen.machine().driver_data<madalien_state>();
256   int flip = BIT(input_port_read(screen.machine(), "DSW"), 6) && BIT(*state->m_video_control, 0);
256   int flip = BIT(screen.machine().root_device().ioport("DSW")->read(), 6) && BIT(*state->m_video_control, 0);
257257
258258   // bits #0 and #1 define scrolling mode
259259   //
src/mame/video/aeroboto.c
r15082r15083
8181
8282READ8_MEMBER(aeroboto_state::aeroboto_in0_r)
8383{
84   return input_port_read(machine(), flip_screen() ? "P2" : "P1");
84   return ioport(flip_screen() ? "P2" : "P1")->read();
8585}
8686
8787WRITE8_MEMBER(aeroboto_state::aeroboto_3000_w)
src/mame/video/oneshot.c
r15082r15083
6969   //int xpos,ypos;
7070
7171   /* get gun raw coordinates (player 1) */
72   state->m_gun_x_p1 = (input_port_read(machine, "LIGHT0_X") & 0xff) * 320 / 256;
73   state->m_gun_y_p1 = (input_port_read(machine, "LIGHT0_Y") & 0xff) * 240 / 256;
72   state->m_gun_x_p1 = (state->ioport("LIGHT0_X")->read() & 0xff) * 320 / 256;
73   state->m_gun_y_p1 = (state->ioport("LIGHT0_Y")->read() & 0xff) * 240 / 256;
7474
7575   /* compute the coordinates for drawing (from routine at 0x009ab0) */
7676   //xpos = state->m_gun_x_p1;
r15082r15083
8484
8585
8686   /* get gun raw coordinates (player 2) */
87   state->m_gun_x_p2 = (input_port_read(machine, "LIGHT1_X") & 0xff) * 320 / 256;
88   state->m_gun_y_p2 = (input_port_read(machine, "LIGHT1_Y") & 0xff) * 240 / 256;
87   state->m_gun_x_p2 = (state->ioport("LIGHT1_X")->read() & 0xff) * 320 / 256;
88   state->m_gun_y_p2 = (state->ioport("LIGHT1_Y")->read() & 0xff) * 240 / 256;
8989
9090   /* compute the coordinates for drawing (from routine at 0x009b6e) */
9191   //xpos = state->m_gun_x_p2;
src/mame/video/mario.c
r15082r15083
209209   mario_state   *state = screen.machine().driver_data<mario_state>();
210210   int t;
211211
212   t = input_port_read(screen.machine(), "MONITOR");
212   t = screen.machine().root_device().ioport("MONITOR")->read();
213213   if (t != state->m_monitor)
214214   {
215215      state->m_monitor = t;
src/mame/video/naughtyb.c
r15082r15083
117117   pleiads_sound_control_c_w(machine().device("cust"),offset,data);
118118
119119   m_cocktail =
120      ( ( input_port_read(machine(), "DSW0") & 0x80 ) &&   // cabinet == cocktail
120      ( ( ioport("DSW0")->read() & 0x80 ) &&   // cabinet == cocktail
121121        ( data & 0x01 ) );            // handling player 2
122122   m_palreg  = (data >> 1) & 0x03;         // palette sel is bit 1 & 2
123123   m_bankreg = (data >> 2) & 0x01;         // banksel is just bit 2
r15082r15083
129129   pleiads_sound_control_c_w(machine().device("cust"),offset,data);
130130
131131   m_cocktail =
132      ( ( input_port_read(machine(), "DSW0") & 0x80 ) &&   // cabinet == cocktail
132      ( ( ioport("DSW0")->read() & 0x80 ) &&   // cabinet == cocktail
133133        ( data & 0x01 ) );            // handling player 2
134134   m_palreg  = (data >> 1) & 0x03;         // palette sel is bit 1 & 2
135135   m_bankreg = (data >> 3) & 0x01;         // banksel is just bit 3
src/mame/video/momoko.c
r15082r15083
113113   UINT8 *TEXT_COLOR = state->memregion("proms")->base();
114114
115115
116   flip = state->m_flipscreen ^ (input_port_read(screen.machine(), "FAKE") & 0x01);
116   flip = state->m_flipscreen ^ (screen.machine().root_device().ioport("FAKE")->read() & 0x01);
117117
118118   /* draw BG layer */
119119   dx = (7 - state->m_bg_scrollx[0]) & 7;
src/mame/video/phoenix.c
r15082r15083
251251      m_videoram_pg_index = data & 1;
252252      membank("bank1")->set_entry(m_videoram_pg_index);
253253
254      m_cocktail_mode = m_videoram_pg_index && (input_port_read(machine(), "CAB") & 0x01);
254      m_cocktail_mode = m_videoram_pg_index && (ioport("CAB")->read() & 0x01);
255255
256256      machine().tilemap().set_flip_all(m_cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
257257      machine().tilemap().mark_all_dirty();
r15082r15083
274274      m_videoram_pg_index = data & 1;
275275      membank("bank1")->set_entry(m_videoram_pg_index);
276276
277      m_cocktail_mode = m_videoram_pg_index && (input_port_read(machine(), "CAB") & 0x01);
277      m_cocktail_mode = m_videoram_pg_index && (ioport("CAB")->read() & 0x01);
278278
279279      machine().tilemap().set_flip_all(m_cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
280280      machine().tilemap().mark_all_dirty();
r15082r15083
310310CUSTOM_INPUT_MEMBER(phoenix_state::player_input_r)
311311{
312312   if (m_cocktail_mode)
313      return (input_port_read(machine(), "CTRL") & 0xf0) >> 4;
313      return (ioport("CTRL")->read() & 0xf0) >> 4;
314314   else
315      return (input_port_read(machine(), "CTRL") & 0x0f) >> 0;
315      return (ioport("CTRL")->read() & 0x0f) >> 0;
316316}
317317
318318CUSTOM_INPUT_MEMBER(phoenix_state::pleiads_protection_r)
r15082r15083
365365#define REMAP_JS(js) ((ret & 0xf) | ( (js & 0xf)  << 4))
366366READ8_MEMBER(phoenix_state::survival_input_port_0_r)
367367{
368   UINT8 ret = ~input_port_read(machine(), "IN0");
368   UINT8 ret = ~ioport("IN0")->read();
369369
370370   if( m_survival_input_readc++ == 2 )
371371   {
src/mame/video/lockon.c
r15082r15083
440440   const UINT8  *const gfxrom = state->memregion("gfx5")->base();
441441   const UINT8  *const sproms = state->memregion("proms")->base() + 0x800;
442442
443   for (offs = 0; offs < state->m_objectram_size; offs += 4)
443   for (offs = 0; offs < state->m_object_ram.bytes(); offs += 4)
444444   {
445445      UINT32 y;
446446      UINT32 xpos;
r15082r15083
802802   UINT8   *tile_rom = state->memregion("gfx3")->base();
803803   UINT32 offs;
804804
805   for (offs = 0x0; offs <= state->m_hudram_size; offs += 2)
805   for (offs = 0x0; offs <= state->m_hud_ram.bytes(); offs += 2)
806806   {
807807      UINT32 y;
808808      UINT32 y_pos;
src/mame/video/atari.c
r15082r15083
774774
775775   copybitmap(bitmap, *antic.bitmap, 0, 0, 0, 0, cliprect);
776776
777   new_tv_artifacts = input_port_read_safe(screen.machine(), "artifacts", 0);
777   new_tv_artifacts = screen.machine().root_device().ioport("artifacts")->read_safe(0);
778778   if( tv_artifacts != new_tv_artifacts )
779779   {
780780      tv_artifacts = new_tv_artifacts;
r15082r15083
15011501
15021502    if( antic.scanline == VBL_START )
15031503    {
1504      button_port = input_port_read_safe(machine, "djoy_b", 0);
1504      button_port = machine.root_device().ioport("djoy_b")->read_safe(0);
15051505
15061506      /* specify buttons relevant to this Atari variant */
15071507      for (i = 0; i < button_count; i++)
src/mame/video/decocass.c
r15082r15083
526526   int scrollx, scrolly_l, scrolly_r;
527527   rectangle clip;
528528
529   if (0xc0 != (input_port_read(screen.machine(), "IN2") & 0xc0))  /* coin slots assert an NMI */
529   if (0xc0 != (screen.machine().root_device().ioport("IN2")->read() & 0xc0))  /* coin slots assert an NMI */
530530      device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, ASSERT_LINE);
531531
532532   if (0 == (state->m_watchdog_flip & 0x04))
src/mame/video/gomoku.c
r15082r15083
106106VIDEO_START( gomoku )
107107{
108108   gomoku_state *state = machine.driver_data<gomoku_state>();
109   UINT8 *GOMOKU_BG_X = machine.root_device().memregion( "user1" )->base();
110   UINT8 *GOMOKU_BG_Y = machine.root_device().memregion( "user2" )->base();
109   UINT8 *GOMOKU_BG_X = state->memregion( "user1" )->base();
110   UINT8 *GOMOKU_BG_Y = state->memregion( "user2" )->base();
111111   UINT8 *GOMOKU_BG_D = state->memregion( "user3" )->base();
112112   int x, y;
113113   int bgdata;
src/mame/video/m57.c
r15082r15083
162162{
163163
164164   /* screen flip is handled both by software and hardware */
165   m_flipscreen = (data & 0x01) ^ (~input_port_read(machine(), "DSW2") & 0x01);
165   m_flipscreen = (data & 0x01) ^ (~ioport("DSW2")->read() & 0x01);
166166   m_bg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
167167
168168   coin_counter_w(machine(), 0,data & 0x02);
src/mame/video/neogeo.c
r15082r15083
271271   neogeo_state *state = machine.driver_data<neogeo_state>();
272272   int x;
273273
274   UINT8* gfx_base = machine.root_device().memregion(state->m_fixed_layer_source ? "fixed" : "fixedbios")->base();
274   UINT8* gfx_base = state->memregion(state->m_fixed_layer_source ? "fixed" : "fixedbios")->base();
275275   UINT32 addr_mask = state->memregion(state->m_fixed_layer_source ? "fixed" : "fixedbios")->bytes() - 1;
276276   UINT16 *video_data = &state->m_videoram[0x7000 | (scanline >> 3)];
277277   UINT32 *pixel_addr = &bitmap.pix32(scanline, NEOGEO_HBEND);
src/mame/video/vectrex.c
r15082r15083
435435      /* Check lightpen */
436436      if (state->m_lightpen_port != 0)
437437      {
438         state->m_lightpen_down = input_port_read(device->machine(), "LPENCONF") & 0x10;
438         state->m_lightpen_down = state->ioport("LPENCONF")->read() & 0x10;
439439
440440         if (state->m_lightpen_down)
441441         {
442            state->m_pen_x = input_port_read(device->machine(), "LPENX") * (state->m_x_max / 0xff);
443            state->m_pen_y = input_port_read(device->machine(), "LPENY") * (state->m_y_max / 0xff);
442            state->m_pen_x = state->ioport("LPENX")->read() * (state->m_x_max / 0xff);
443            state->m_pen_y = state->ioport("LPENY")->read() * (state->m_y_max / 0xff);
444444
445445            dx = abs(state->m_pen_x - state->m_x_int);
446446            dy = abs(state->m_pen_y - state->m_y_int);
src/mame/video/exidy.c
r15082r15083
6262{
6363   exidy_state *state = machine.driver_data<exidy_state>();
6464   collision ^= state->m_collision_invert;
65   state->m_int_condition = (input_port_read(machine, "INTSOURCE") & ~0x1c) | (collision & state->m_collision_mask);
65   state->m_int_condition = (state->ioport("INTSOURCE")->read() & ~0x1c) | (collision & state->m_collision_mask);
6666}
6767
6868
src/mame/video/kangaroo.c
r15082r15083
101101static void blitter_execute( running_machine &machine )
102102{
103103   kangaroo_state *state = machine.driver_data<kangaroo_state>();
104   UINT32 gfxhalfsize = machine.root_device().memregion("gfx1")->bytes() / 2;
104   UINT32 gfxhalfsize = state->memregion("gfx1")->bytes() / 2;
105105   const UINT8 *gfxbase = state->memregion("gfx1")->base();
106106   UINT16 src = state->m_video_control[0] + 256 * state->m_video_control[1];
107107   UINT16 dst = state->m_video_control[2] + 256 * state->m_video_control[3];
src/mame/video/m92.c
r15082r15083
545545
546546   /* Flipscreen appears hardwired to the dipswitch - strange */
547547   m92_state *state = screen.machine().driver_data<m92_state>();
548   if (input_port_read(screen.machine(), "DSW") & 0x100)
548   if (screen.machine().root_device().ioport("DSW")->read() & 0x100)
549549      state->flip_screen_set(0);
550550   else
551551      state->flip_screen_set(1);
r15082r15083
563563
564564   /* Flipscreen appears hardwired to the dipswitch - strange */
565565   m92_state *state = screen.machine().driver_data<m92_state>();
566   if (input_port_read(screen.machine(), "DSW") & 0x100)
566   if (screen.machine().root_device().ioport("DSW")->read() & 0x100)
567567      state->flip_screen_set(0);
568568   else
569569      state->flip_screen_set(1);
src/mame/video/m58.c
r15082r15083
201201WRITE8_MEMBER(m58_state::yard_flipscreen_w)
202202{
203203   /* screen flip is handled both by software and hardware */
204   flip_screen_set((data & 0x01) ^ (~input_port_read(machine(), "DSW2") & 0x01));
204   flip_screen_set((data & 0x01) ^ (~ioport("DSW2")->read() & 0x01));
205205
206206   coin_counter_w(machine(), 0, data & 0x02);
207207   coin_counter_w(machine(), 1, data & 0x20);
src/mame/video/zac2650.c
r15082r15083
4141
4242READ8_MEMBER(zac2650_state::tinvader_port_0_r)
4343{
44   return input_port_read(machine(), "1E80") - m_CollisionBackground;
44   return ioport("1E80")->read() - m_CollisionBackground;
4545}
4646
4747/*****************************************/
src/mame/video/dcheese.c
r15082r15083
168168   INT32 dxdy = (INT32)(((state->m_blitter_xparam[6] & 0x0fff) | ((state->m_blitter_xparam[7] & 0x0fff) << 12)) << 12) >> 12;
169169   INT32 dydx = (INT32)(((state->m_blitter_yparam[4] & 0x0fff) | ((state->m_blitter_yparam[5] & 0x0fff) << 12)) << 12) >> 12;
170170   INT32 dydy = (INT32)(((state->m_blitter_yparam[6] & 0x0fff) | ((state->m_blitter_yparam[7] & 0x0fff) << 12)) << 12) >> 12;
171   UINT8 *src = machine.root_device().memregion("gfx1")->base();
171   UINT8 *src = state->memregion("gfx1")->base();
172172   UINT32 pagemask = (state->memregion("gfx1")->bytes() - 1) / 0x40000;
173173   int xstart = state->m_blitter_xparam[14];
174174   int xend = state->m_blitter_xparam[15] + 1;
r15082r15083
307307{
308308   /* analog inputs seem to be hooked up here -- might not actually map to blitter */
309309   if (offset == 0x02/2)
310      return input_port_read(machine(), "2a0002");
310      return ioport("2a0002")->read();
311311   if (offset == 0x0e/2)
312      return input_port_read(machine(), "2a000e");
312      return ioport("2a000e")->read();
313313
314314   /* early code polls on this bit, wants it to be 0 */
315315   if (offset == 0x36/2)
src/mame/video/bwing.c
r15082r15083
150150   g = ((g << 5) + (g << 2) + (g >> 1));
151151   b = ((b << 5) + (b << 2) + (b >> 1));
152152
153   if ((i = input_port_read(machine(), "EXTRA")) < 4)
153   if ((i = ioport("EXTRA")->read()) < 4)
154154   {
155155      r = (float)r * rgb[i][0];
156156      g = (float)g * rgb[i][1];
src/mame/video/cave.c
r15082r15083
515515{
516516   cave_state *state = machine.driver_data<cave_state>();
517517   pen_t base_pal = 0;
518   const UINT8 *base_gfx = machine.root_device().memregion("sprites")->base();
518   const UINT8 *base_gfx = state->memregion("sprites")->base();
519519   int code_max = state->memregion("sprites")->bytes() / (16*16);
520520
521521   UINT16 *source;
r15082r15083
644644{
645645   cave_state *state = machine.driver_data<cave_state>();
646646   pen_t base_pal = 0;
647   const UINT8 *base_gfx = machine.root_device().memregion("sprites")->base();
647   const UINT8 *base_gfx = state->memregion("sprites")->base();
648648   int code_max = state->memregion("sprites")->bytes() / (16*16);
649649
650650   UINT16 *source;
src/mame/video/dooyong.c
r15082r15083
629629{
630630   dooyong_state *state = machine.driver_data<dooyong_state>();
631631   /* Configure tilemap callbacks */
632   state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
632   state->m_bg_tilerom = state->memregion("gfx5")->base();
633633   state->m_fg_tilerom = state->memregion("gfx6")->base();
634634   state->m_bg_tilerom2 = NULL;
635635   state->m_fg_tilerom2 = NULL;
r15082r15083
669669{
670670   dooyong_state *state = machine.driver_data<dooyong_state>();
671671   /* Configure tilemap callbacks */
672   state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
672   state->m_bg_tilerom = state->memregion("gfx5")->base();
673673   state->m_fg_tilerom = state->memregion("gfx6")->base();
674674   state->m_bg_tilerom2 = NULL;
675675   state->m_fg_tilerom2 = NULL;
r15082r15083
708708{
709709   dooyong_state *state = machine.driver_data<dooyong_state>();
710710   /* Configure tilemap callbacks */
711   state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
711   state->m_bg_tilerom = state->memregion("gfx5")->base();
712712   state->m_fg_tilerom = state->memregion("gfx6")->base();
713713   state->m_bg_tilerom2 = NULL;
714714   state->m_fg_tilerom2 = NULL;
r15082r15083
744744{
745745   dooyong_state *state = machine.driver_data<dooyong_state>();
746746   /* Configure tilemap callbacks */
747   state->m_bg_tilerom = machine.root_device().memregion("gfx3")->base() + 0x78000;
748   state->m_fg_tilerom = machine.root_device().memregion("gfx4")->base() + 0x78000;
747   state->m_bg_tilerom = state->memregion("gfx3")->base() + 0x78000;
748   state->m_fg_tilerom = state->memregion("gfx4")->base() + 0x78000;
749749   state->m_fg2_tilerom = state->memregion("gfx5")->base() + 0x38000;
750750   state->m_bg_tilerom2 = NULL;
751751   state->m_fg_tilerom2 = NULL;
r15082r15083
785785{
786786   dooyong_state *state = machine.driver_data<dooyong_state>();
787787   /* Configure tilemap callbacks */
788   state->m_bg_tilerom = machine.root_device().memregion("gfx3")->base() + 0x78000;
788   state->m_bg_tilerom = state->memregion("gfx3")->base() + 0x78000;
789789   state->m_fg_tilerom = state->memregion("gfx4")->base() + 0x78000;
790790   state->m_bg_tilerom2 = NULL;
791791   state->m_fg_tilerom2 = NULL;
r15082r15083
821821{
822822   dooyong_state *state = machine.driver_data<dooyong_state>();
823823   /* Configure tilemap callbacks */
824   state->m_bg_tilerom = machine.root_device().memregion("gfx2")->base() + machine.root_device().memregion("gfx2")->bytes() - 0x8000;
825   state->m_fg_tilerom = machine.root_device().memregion("gfx3")->base() + state->memregion("gfx3")->bytes() - 0x8000;
824   state->m_bg_tilerom = state->memregion("gfx2")->base() + state->memregion("gfx2")->bytes() - 0x8000;
825   state->m_fg_tilerom = state->memregion("gfx3")->base() + state->memregion("gfx3")->bytes() - 0x8000;
826826   state->m_bg_tilerom2 = NULL;
827827   state->m_fg_tilerom2 = NULL;
828828   state->m_bg_gfx = 1;
r15082r15083
856856{
857857   dooyong_state *state = machine.driver_data<dooyong_state>();
858858   /* Configure tilemap callbacks */
859   state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
860   state->m_bg2_tilerom = machine.root_device().memregion("gfx4")->base();
861   state->m_fg_tilerom = machine.root_device().memregion("gfx3")->base();
862   state->m_fg2_tilerom = machine.root_device().memregion("gfx2")->base();
863   state->m_bg_tilerom2 = machine.root_device().memregion("gfx6")->base() + 0x60000;
864   state->m_bg2_tilerom2 = machine.root_device().memregion("gfx6")->base() + 0x40000;
865   state->m_fg_tilerom2 = machine.root_device().memregion("gfx6")->base() + 0x20000;
859   state->m_bg_tilerom = state->memregion("gfx5")->base();
860   state->m_bg2_tilerom = state->memregion("gfx4")->base();
861   state->m_fg_tilerom = state->memregion("gfx3")->base();
862   state->m_fg2_tilerom = state->memregion("gfx2")->base();
863   state->m_bg_tilerom2 = state->memregion("gfx6")->base() + 0x60000;
864   state->m_bg2_tilerom2 = state->memregion("gfx6")->base() + 0x40000;
865   state->m_fg_tilerom2 = state->memregion("gfx6")->base() + 0x20000;
866866   state->m_fg2_tilerom2 = state->memregion("gfx6")->base() + 0x00000;
867867   state->m_bg_gfx = 4;
868868   state->m_bg2_gfx = 3;
src/mame/video/thepit.c
r15082r15083
210210       horizontal flip switch. (This is how the real PCB does it) */
211211   if (m_flip_screen_x)
212212   {
213      return input_port_read(machine(), "IN2");
213      return ioport("IN2")->read();
214214   }
215215   else
216216   {
217      return input_port_read(machine(), "IN0");
217      return ioport("IN0")->read();
218218   }
219219}
220220
src/mame/video/changela.c
r15082r15083
175175   changela_state *state = machine.driver_data<changela_state>();
176176   int sx, i, j;
177177
178   UINT8* ROM = machine.root_device().memregion("user2")->base();
178   UINT8* ROM = state->memregion("user2")->base();
179179   UINT8* RAM = state->m_memory_devices + 0x800;
180   UINT8* TILE_ROM = machine.root_device().memregion("gfx1")->base();
180   UINT8* TILE_ROM = state->memregion("gfx1")->base();
181181   UINT8* TILE_RAM = state->m_memory_devices + 0x1000;
182182   UINT8* PROM = state->memregion("proms")->base();
183183
r15082r15083
355355   int sx, i, j;
356356
357357   /* State machine */
358   UINT8* ROM = machine.root_device().memregion("user2")->base();
358   UINT8* ROM = state->memregion("user2")->base();
359359   UINT8* RAM = state->m_memory_devices + 0x840 + 0x40 * tree_num;
360   UINT8* PROM = machine.root_device().memregion("proms")->base();
360   UINT8* PROM = state->memregion("proms")->base();
361361
362362   /* Tree Data */
363363   UINT8* RAM2 = state->m_tree_ram + 0x20 * tree_num;
364   UINT8* TILE_ROM = (tree_num ? (machine.root_device().memregion("user3")->base() + 0x1000) : (machine.root_device().memregion("gfx1")->base() + 0x2000));
364   UINT8* TILE_ROM = (tree_num ? (state->memregion("user3")->base() + 0x1000) : (state->memregion("gfx1")->base() + 0x2000));
365365   UINT8* TILE_RAM = (tree_num ? (state->memregion("user3")->base()) : (state->m_memory_devices + 0x1800));
366366
367367   int preload = ((sy < 32) ? 1 : 0);
src/mame/video/exerion.c
r15082r15083
111111   UINT8 *gfx;
112112
113113   /* get pointers to the mixing and lookup PROMs */
114   state->m_background_mixer = machine.root_device().memregion("proms")->base() + 0x320;
114   state->m_background_mixer = state->memregion("proms")->base() + 0x320;
115115
116116   /* allocate memory for the decoded background graphics */
117117   state->m_background_gfx[0] = auto_alloc_array(machine, UINT16, 256 * 256 * 4);
src/mame/video/shisen.c
r15082r15083
6666   // on Irem boards, screen flip is handled in both hardware and software.
6767   // this game doesn't have cocktail mode so if there's software control we don't
6868   // know where it is mapped.
69   state->flip_screen_set(~input_port_read(screen.machine(), "DSW2") & 1);
69   state->flip_screen_set(~screen.machine().root_device().ioport("DSW2")->read() & 1);
7070
7171
7272   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
src/mame/video/nmk16.c
r15082r15083
979979   if (dsw_flipscreen)
980980   {
981981
982      state->flip_screen_x_set(~input_port_read(machine, "DSW1") & 0x0100);
983      state->flip_screen_y_set(~input_port_read(machine, "DSW1") & 0x0200);
982      state->flip_screen_x_set(~state->ioport("DSW1")->read() & 0x0100);
983      state->flip_screen_y_set(~state->ioport("DSW1")->read() & 0x0200);
984984   }
985985
986986
src/mame/layout/mpu4ext.lay
r15082r15083
1919         <color red="0.0" green="1.0" blue="0.0" />
2020      </rect>
2121   </element>
22   <element name="Steppers" defstate="96">
23      <text string="00" state="0">
24         <color red="1.0" green="1.0" blue="1.0" />
25         <bounds x="0" y="0.1" width="1" height="1" />
26      </text>
27      <text string="01" state="1">
28         <color red="1.0" green="1.0" blue="1.0" />
29         <bounds x="0" y="0.1" width="1" height="1" />
30      </text>
31      <text string="02" state="2">
32         <color red="1.0" green="1.0" blue="1.0" />
33         <bounds x="0" y="0.1" width="1" height="1" />
34      </text>
35      <text string="03" state="3">
36         <color red="1.0" green="1.0" blue="1.0" />
37         <bounds x="0" y="0.1" width="1" height="1" />
38      </text>
39      <text string="04" state="4">
40         <color red="1.0" green="1.0" blue="1.0" />
41         <bounds x="0" y="0.1" width="1" height="1" />
42      </text>
43      <text string="05" state="5">
44         <color red="1.0" green="1.0" blue="1.0" />
45         <bounds x="0" y="0.1" width="1" height="1" />
46      </text>
47      <text string="06" state="6">
48         <color red="1.0" green="1.0" blue="1.0" />
49         <bounds x="0" y="0.1" width="1" height="1" />
50      </text>
51      <text string="07" state="7">
52         <color red="1.0" green="1.0" blue="1.0" />
53         <bounds x="0" y="0.1" width="1" height="1" />
54      </text>
55      <text string="08" state="8">
56         <color red="1.0" green="1.0" blue="1.0" />
57         <bounds x="0" y="0.1" width="1" height="1" />
58      </text>
59      <text string="09" state="9">
60         <color red="1.0" green="1.0" blue="1.0" />
61         <bounds x="0" y="0.1" width="1" height="1" />
62      </text>
63      <text string="10" state="10">
64         <color red="1.0" green="1.0" blue="1.0" />
65         <bounds x="0" y="0.1" width="1" height="1" />
66      </text>
67      <text string="11" state="11">
68         <color red="1.0" green="1.0" blue="1.0" />
69         <bounds x="0" y="0.1" width="1" height="1" />
70      </text>
71      <text string="12" state="12">
72         <color red="1.0" green="1.0" blue="1.0" />
73         <bounds x="0" y="0.1" width="1" height="1" />
74      </text>
75      <text string="13" state="13">
76         <color red="1.0" green="1.0" blue="1.0" />
77         <bounds x="0" y="0.1" width="1" height="1" />
78      </text>
79      <text string="14" state="14">
80         <color red="1.0" green="1.0" blue="1.0" />
81         <bounds x="0" y="0.1" width="1" height="1" />
82      </text>
83      <text string="15" state="15">
84         <color red="1.0" green="1.0" blue="1.0" />
85         <bounds x="0" y="0.1" width="1" height="1" />
86      </text>
87      <text string="16" state="16">
88         <color red="1.0" green="1.0" blue="1.0" />
89         <bounds x="0" y="0.1" width="1" height="1" />
90      </text>
91      <text string="17" state="17">
92         <color red="1.0" green="1.0" blue="1.0" />
93         <bounds x="0" y="0.1" width="1" height="1" />
94      </text>
95      <text string="18" state="18">
96         <color red="1.0" green="1.0" blue="1.0" />
97         <bounds x="0" y="0.1" width="1" height="1" />
98      </text>
99      <text string="19" state="19">
100         <color red="1.0" green="1.0" blue="1.0" />
101         <bounds x="0" y="0.1" width="1" height="1" />
102      </text>
103      <text string="20" state="20">
104         <color red="1.0" green="1.0" blue="1.0" />
105         <bounds x="0" y="0.1" width="1" height="1" />
106      </text>
107      <text string="21" state="21">
108         <color red="1.0" green="1.0" blue="1.0" />
109         <bounds x="0" y="0.1" width="1" height="1" />
110      </text>
111      <text string="22" state="22">
112         <color red="1.0" green="1.0" blue="1.0" />
113         <bounds x="0" y="0.1" width="1" height="1" />
114      </text>
115      <text string="23" state="23">
116         <color red="1.0" green="1.0" blue="1.0" />
117         <bounds x="0" y="0.1" width="1" height="1" />
118      </text>
119      <text string="24" state="24">
120         <color red="1.0" green="1.0" blue="1.0" />
121         <bounds x="0" y="0.1" width="1" height="1" />
122      </text>
123      <text string="25" state="25">
124         <color red="1.0" green="1.0" blue="1.0" />
125         <bounds x="0" y="0.1" width="1" height="1" />
126      </text>
127      <text string="26" state="26">
128         <color red="1.0" green="1.0" blue="1.0" />
129         <bounds x="0" y="0.1" width="1" height="1" />
130      </text>
131      <text string="27" state="27">
132         <color red="1.0" green="1.0" blue="1.0" />
133         <bounds x="0" y="0.1" width="1" height="1" />
134      </text>
135      <text string="28" state="28">
136         <color red="1.0" green="1.0" blue="1.0" />
137         <bounds x="0" y="0.1" width="1" height="1" />
138      </text>
139      <text string="29" state="29">
140         <color red="1.0" green="1.0" blue="1.0" />
141         <bounds x="0" y="0.1" width="1" height="1" />
142      </text>
143      <text string="30" state="30">
144         <color red="1.0" green="1.0" blue="1.0" />
145         <bounds x="0" y="0.1" width="1" height="1" />
146      </text>
147      <text string="31" state="31">
148         <color red="1.0" green="1.0" blue="1.0" />
149         <bounds x="0" y="0.1" width="1" height="1" />
150      </text>
151      <text string="32" state="32">
152         <color red="1.0" green="1.0" blue="1.0" />
153         <bounds x="0" y="0.1" width="1" height="1" />
154      </text>
155      <text string="33" state="33">
156         <color red="1.0" green="1.0" blue="1.0" />
157         <bounds x="0" y="0.1" width="1" height="1" />
158      </text>
159      <text string="34" state="34">
160         <color red="1.0" green="1.0" blue="1.0" />
161         <bounds x="0" y="0.1" width="1" height="1" />
162      </text>
163      <text string="35" state="35">
164         <color red="1.0" green="1.0" blue="1.0" />
165         <bounds x="0" y="0.1" width="1" height="1" />
166      </text>
167      <text string="36" state="36">
168         <color red="1.0" green="1.0" blue="1.0" />
169         <bounds x="0" y="0.1" width="1" height="1" />
170      </text>
171      <text string="37" state="37">
172         <color red="1.0" green="1.0" blue="1.0" />
173         <bounds x="0" y="0.1" width="1" height="1" />
174      </text>
175      <text string="38" state="38">
176         <color red="1.0" green="1.0" blue="1.0" />
177         <bounds x="0" y="0.1" width="1" height="1" />
178      </text>
179      <text string="39" state="39">
180         <color red="1.0" green="1.0" blue="1.0" />
181         <bounds x="0" y="0.1" width="1" height="1" />
182      </text>
183      <text string="40" state="40">
184         <color red="1.0" green="1.0" blue="1.0" />
185         <bounds x="0" y="0.1" width="1" height="1" />
186      </text>
187      <text string="41" state="41">
188         <color red="1.0" green="1.0" blue="1.0" />
189         <bounds x="0" y="0.1" width="1" height="1" />
190      </text>
191      <text string="42" state="42">
192         <color red="1.0" green="1.0" blue="1.0" />
193         <bounds x="0" y="0.1" width="1" height="1" />
194      </text>
195      <text string="43" state="43">
196         <color red="1.0" green="1.0" blue="1.0" />
197         <bounds x="0" y="0.1" width="1" height="1" />
198      </text>
199      <text string="44" state="44">
200         <color red="1.0" green="1.0" blue="1.0" />
201         <bounds x="0" y="0.1" width="1" height="1" />
202      </text>
203      <text string="45" state="45">
204         <color red="1.0" green="1.0" blue="1.0" />
205         <bounds x="0" y="0.1" width="1" height="1" />
206      </text>
207      <text string="46" state="46">
208         <color red="1.0" green="1.0" blue="1.0" />
209         <bounds x="0" y="0.1" width="1" height="1" />
210      </text>
211      <text string="47" state="47">
212         <color red="1.0" green="1.0" blue="1.0" />
213         <bounds x="0" y="0.1" width="1" height="1" />
214      </text>
215      <text string="48" state="48">
216         <color red="1.0" green="1.0" blue="1.0" />
217         <bounds x="0" y="0.1" width="1" height="1" />
218      </text>
219      <text string="49" state="49">
220         <color red="1.0" green="1.0" blue="1.0" />
221         <bounds x="0" y="0.1" width="1" height="1" />
222      </text>
223      <text string="50" state="50">
224         <color red="1.0" green="1.0" blue="1.0" />
225         <bounds x="0" y="0.1" width="1" height="1" />
226      </text>
227      <text string="51" state="51">
228         <color red="1.0" green="1.0" blue="1.0" />
229         <bounds x="0" y="0.1" width="1" height="1" />
230      </text>
231      <text string="52" state="52">
232         <color red="1.0" green="1.0" blue="1.0" />
233         <bounds x="0" y="0.1" width="1" height="1" />
234      </text>
235      <text string="53" state="53">
236         <color red="1.0" green="1.0" blue="1.0" />
237         <bounds x="0" y="0.1" width="1" height="1" />
238      </text>
239      <text string="54" state="54">
240         <color red="1.0" green="1.0" blue="1.0" />
241         <bounds x="0" y="0.1" width="1" height="1" />
242      </text>
243      <text string="55" state="55">
244         <color red="1.0" green="1.0" blue="1.0" />
245         <bounds x="0" y="0.1" width="1" height="1" />
246      </text>
247      <text string="56" state="56">
248         <color red="1.0" green="1.0" blue="1.0" />
249         <bounds x="0" y="0.1" width="1" height="1" />
250      </text>
251      <text string="57" state="57">
252         <color red="1.0" green="1.0" blue="1.0" />
253         <bounds x="0" y="0.1" width="1" height="1" />
254      </text>
255      <text string="58" state="58">
256         <color red="1.0" green="1.0" blue="1.0" />
257         <bounds x="0" y="0.1" width="1" height="1" />
258      </text>
259      <text string="59" state="59">
260         <color red="1.0" green="1.0" blue="1.0" />
261         <bounds x="0" y="0.1" width="1" height="1" />
262      </text>
263      <text string="60" state="60">
264         <color red="1.0" green="1.0" blue="1.0" />
265         <bounds x="0" y="0.1" width="1" height="1" />
266      </text>
267      <text string="61" state="61">
268         <color red="1.0" green="1.0" blue="1.0" />
269         <bounds x="0" y="0.1" width="1" height="1" />
270      </text>
271      <text string="62" state="62">
272         <color red="1.0" green="1.0" blue="1.0" />
273         <bounds x="0" y="0.1" width="1" height="1" />
274      </text>
275      <text string="63" state="63">
276         <color red="1.0" green="1.0" blue="1.0" />
277         <bounds x="0" y="0.1" width="1" height="1" />
278      </text>
279      <text string="64" state="64">
280         <color red="1.0" green="1.0" blue="1.0" />
281         <bounds x="0" y="0.1" width="1" height="1" />
282      </text>
283      <text string="65" state="65">
284         <color red="1.0" green="1.0" blue="1.0" />
285         <bounds x="0" y="0.1" width="1" height="1" />
286      </text>
287      <text string="66" state="66">
288         <color red="1.0" green="1.0" blue="1.0" />
289         <bounds x="0" y="0.1" width="1" height="1" />
290      </text>
291      <text string="67" state="67">
292         <color red="1.0" green="1.0" blue="1.0" />
293         <bounds x="0" y="0.1" width="1" height="1" />
294      </text>
295      <text string="68" state="68">
296         <color red="1.0" green="1.0" blue="1.0" />
297         <bounds x="0" y="0.1" width="1" height="1" />
298      </text>
299      <text string="69" state="69">
300         <color red="1.0" green="1.0" blue="1.0" />
301         <bounds x="0" y="0.1" width="1" height="1" />
302      </text>
303      <text string="70" state="70">
304         <color red="1.0" green="1.0" blue="1.0" />
305         <bounds x="0" y="0.1" width="1" height="1" />
306      </text>
307      <text string="71" state="71">
308         <color red="1.0" green="1.0" blue="1.0" />
309         <bounds x="0" y="0.1" width="1" height="1" />
310      </text>
311      <text string="72" state="72">
312         <color red="1.0" green="1.0" blue="1.0" />
313         <bounds x="0" y="0.1" width="1" height="1" />
314      </text>
315      <text string="73" state="73">
316         <color red="1.0" green="1.0" blue="1.0" />
317         <bounds x="0" y="0.1" width="1" height="1" />
318      </text>
319      <text string="74" state="74">
320         <color red="1.0" green="1.0" blue="1.0" />
321         <bounds x="0" y="0.1" width="1" height="1" />
322      </text>
323      <text string="75" state="75">
324         <color red="1.0" green="1.0" blue="1.0" />
325         <bounds x="0" y="0.1" width="1" height="1" />
326      </text>
327      <text string="76" state="76">
328         <color red="1.0" green="1.0" blue="1.0" />
329         <bounds x="0" y="0.1" width="1" height="1" />
330      </text>
331      <text string="77" state="77">
332         <color red="1.0" green="1.0" blue="1.0" />
333         <bounds x="0" y="0.1" width="1" height="1" />
334      </text>
335      <text string="78" state="78">
336         <color red="1.0" green="1.0" blue="1.0" />
337         <bounds x="0" y="0.1" width="1" height="1" />
338      </text>
339      <text string="79" state="79">
340         <color red="1.0" green="1.0" blue="1.0" />
341         <bounds x="0" y="0.1" width="1" height="1" />
342      </text>
343      <text string="80" state="80">
344         <color red="1.0" green="1.0" blue="1.0" />
345         <bounds x="0" y="0.1" width="1" height="1" />
346      </text>
347      <text string="81" state="81">
348         <color red="1.0" green="1.0" blue="1.0" />
349         <bounds x="0" y="0.1" width="1" height="1" />
350      </text>
351      <text string="82" state="82">
352         <color red="1.0" green="1.0" blue="1.0" />
353         <bounds x="0" y="0.1" width="1" height="1" />
354      </text>
355      <text string="83" state="83">
356         <color red="1.0" green="1.0" blue="1.0" />
357         <bounds x="0" y="0.1" width="1" height="1" />
358      </text>
359      <text string="84" state="84">
360         <color red="1.0" green="1.0" blue="1.0" />
361         <bounds x="0" y="0.1" width="1" height="1" />
362      </text>
363      <text string="85" state="85">
364         <color red="1.0" green="1.0" blue="1.0" />
365         <bounds x="0" y="0.1" width="1" height="1" />
366      </text>
367      <text string="86" state="86">
368         <color red="1.0" green="1.0" blue="1.0" />
369         <bounds x="0" y="0.1" width="1" height="1" />
370      </text>
371      <text string="87" state="87">
372         <color red="1.0" green="1.0" blue="1.0" />
373         <bounds x="0" y="0.1" width="1" height="1" />
374      </text>
375      <text string="88" state="88">
376         <color red="1.0" green="1.0" blue="1.0" />
377         <bounds x="0" y="0.1" width="1" height="1" />
378      </text>
379      <text string="89" state="89">
380         <color red="1.0" green="1.0" blue="1.0" />
381         <bounds x="0" y="0.1" width="1" height="1" />
382      </text>
383      <text string="90" state="90">
384         <color red="1.0" green="1.0" blue="1.0" />
385         <bounds x="0" y="0.1" width="1" height="1" />
386      </text>
387      <text string="91" state="91">
388         <color red="1.0" green="1.0" blue="1.0" />
389         <bounds x="0" y="0.1" width="1" height="1" />
390      </text>
391      <text string="92" state="92">
392         <color red="1.0" green="1.0" blue="1.0" />
393         <bounds x="0" y="0.1" width="1" height="1" />
394      </text>
395      <text string="93" state="93">
396         <color red="1.0" green="1.0" blue="1.0" />
397         <bounds x="0" y="0.1" width="1" height="1" />
398      </text>
399      <text string="94" state="94">
400         <color red="1.0" green="1.0" blue="1.0" />
401         <bounds x="0" y="0.1" width="1" height="1" />
402      </text>
403      <text string="95" state="95">
404         <color red="1.0" green="1.0" blue="1.0" />
405         <bounds x="0" y="0.1" width="1" height="1" />
406      </text>
22   <element name="Steppers" defstate="0">
23       <simplecounter maxstate="999" digits="3">
24      <color red="1.0" green="1.0" blue="1.0" />
25      <bounds x="0" y="0" width="1" height="1" />
26      </simplecounter>
40727   </element>
40828   <element name="vfd0">
40929   <led16segsc>
src/mame/layout/awpvid14.lay
r15082r15083
1414         <color red="0.0" green="1.0" blue="0.0" />
1515      </rect>
1616   </element>
17   <element name="Steppers" defstate="96">
18      <text string="00" state="0">
19         <color red="1.0" green="1.0" blue="1.0" />
20         <bounds x="0" y="0.1" width="1" height="1" />
21      </text>
22      <text string="01" state="1">
23         <color red="1.0" green="1.0" blue="1.0" />
24         <bounds x="0" y="0.1" width="1" height="1" />
25      </text>
26      <text string="02" state="2">
27         <color red="1.0" green="1.0" blue="1.0" />
28         <bounds x="0" y="0.1" width="1" height="1" />
29      </text>
30      <text string="03" state="3">
31         <color red="1.0" green="1.0" blue="1.0" />
32         <bounds x="0" y="0.1" width="1" height="1" />
33      </text>
34      <text string="04" state="4">
35         <color red="1.0" green="1.0" blue="1.0" />
36         <bounds x="0" y="0.1" width="1" height="1" />
37      </text>
38      <text string="05" state="5">
39         <color red="1.0" green="1.0" blue="1.0" />
40         <bounds x="0" y="0.1" width="1" height="1" />
41      </text>
42      <text string="06" state="6">
43         <color red="1.0" green="1.0" blue="1.0" />
44         <bounds x="0" y="0.1" width="1" height="1" />
45      </text>
46      <text string="07" state="7">
47         <color red="1.0" green="1.0" blue="1.0" />
48         <bounds x="0" y="0.1" width="1" height="1" />
49      </text>
50      <text string="08" state="8">
51         <color red="1.0" green="1.0" blue="1.0" />
52         <bounds x="0" y="0.1" width="1" height="1" />
53      </text>
54      <text string="09" state="9">
55         <color red="1.0" green="1.0" blue="1.0" />
56         <bounds x="0" y="0.1" width="1" height="1" />
57      </text>
58      <text string="10" state="10">
59         <color red="1.0" green="1.0" blue="1.0" />
60         <bounds x="0" y="0.1" width="1" height="1" />
61      </text>
62      <text string="11" state="11">
63         <color red="1.0" green="1.0" blue="1.0" />
64         <bounds x="0" y="0.1" width="1" height="1" />
65      </text>
66      <text string="12" state="12">
67         <color red="1.0" green="1.0" blue="1.0" />
68         <bounds x="0" y="0.1" width="1" height="1" />
69      </text>
70      <text string="13" state="13">
71         <color red="1.0" green="1.0" blue="1.0" />
72         <bounds x="0" y="0.1" width="1" height="1" />
73      </text>
74      <text string="14" state="14">
75         <color red="1.0" green="1.0" blue="1.0" />
76         <bounds x="0" y="0.1" width="1" height="1" />
77      </text>
78      <text string="15" state="15">
79         <color red="1.0" green="1.0" blue="1.0" />
80         <bounds x="0" y="0.1" width="1" height="1" />
81      </text>
82      <text string="16" state="16">
83         <color red="1.0" green="1.0" blue="1.0" />
84         <bounds x="0" y="0.1" width="1" height="1" />
85      </text>
86      <text string="17" state="17">
87         <color red="1.0" green="1.0" blue="1.0" />
88         <bounds x="0" y="0.1" width="1" height="1" />
89      </text>
90      <text string="18" state="18">
91         <color red="1.0" green="1.0" blue="1.0" />
92         <bounds x="0" y="0.1" width="1" height="1" />
93      </text>
94      <text string="19" state="19">
95         <color red="1.0" green="1.0" blue="1.0" />
96         <bounds x="0" y="0.1" width="1" height="1" />
97      </text>
98      <text string="20" state="20">
99         <color red="1.0" green="1.0" blue="1.0" />
100         <bounds x="0" y="0.1" width="1" height="1" />
101      </text>
102      <text string="21" state="21">
103         <color red="1.0" green="1.0" blue="1.0" />
104         <bounds x="0" y="0.1" width="1" height="1" />
105      </text>
106      <text string="22" state="22">
107         <color red="1.0" green="1.0" blue="1.0" />
108         <bounds x="0" y="0.1" width="1" height="1" />
109      </text>
110      <text string="23" state="23">
111         <color red="1.0" green="1.0" blue="1.0" />
112         <bounds x="0" y="0.1" width="1" height="1" />
113      </text>
114      <text string="24" state="24">
115         <color red="1.0" green="1.0" blue="1.0" />
116         <bounds x="0" y="0.1" width="1" height="1" />
117      </text>
118      <text string="25" state="25">
119         <color red="1.0" green="1.0" blue="1.0" />
120         <bounds x="0" y="0.1" width="1" height="1" />
121      </text>
122
123      <text string="26" state="26">
124         <color red="1.0" green="1.0" blue="1.0" />
125         <bounds x="0" y="0.1" width="1" height="1" />
126      </text>
127      <text string="27" state="27">
128         <color red="1.0" green="1.0" blue="1.0" />
129         <bounds x="0" y="0.1" width="1" height="1" />
130      </text>
131      <text string="28" state="28">
132         <color red="1.0" green="1.0" blue="1.0" />
133         <bounds x="0" y="0.1" width="1" height="1" />
134      </text>
135      <text string="29" state="29">
136         <color red="1.0" green="1.0" blue="1.0" />
137         <bounds x="0" y="0.1" width="1" height="1" />
138      </text>
139      <text string="30" state="30">
140         <color red="1.0" green="1.0" blue="1.0" />
141         <bounds x="0" y="0.1" width="1" height="1" />
142      </text>
143      <text string="31" state="31">
144         <color red="1.0" green="1.0" blue="1.0" />
145         <bounds x="0" y="0.1" width="1" height="1" />
146      </text>
147      <text string="32" state="32">
148         <color red="1.0" green="1.0" blue="1.0" />
149         <bounds x="0" y="0.1" width="1" height="1" />
150      </text>
151      <text string="33" state="33">
152         <color red="1.0" green="1.0" blue="1.0" />
153         <bounds x="0" y="0.1" width="1" height="1" />
154      </text>
155      <text string="34" state="34">
156         <color red="1.0" green="1.0" blue="1.0" />
157         <bounds x="0" y="0.1" width="1" height="1" />
158      </text>
159      <text string="35" state="35">
160         <color red="1.0" green="1.0" blue="1.0" />
161         <bounds x="0" y="0.1" width="1" height="1" />
162      </text>
163      <text string="36" state="36">
164         <color red="1.0" green="1.0" blue="1.0" />
165         <bounds x="0" y="0.1" width="1" height="1" />
166      </text>
167      <text string="37" state="37">
168         <color red="1.0" green="1.0" blue="1.0" />
169         <bounds x="0" y="0.1" width="1" height="1" />
170      </text>
171      <text string="38" state="38">
172         <color red="1.0" green="1.0" blue="1.0" />
173         <bounds x="0" y="0.1" width="1" height="1" />
174      </text>
175      <text string="39" state="39">
176         <color red="1.0" green="1.0" blue="1.0" />
177         <bounds x="0" y="0.1" width="1" height="1" />
178      </text>
179      <text string="40" state="40">
180         <color red="1.0" green="1.0" blue="1.0" />
181         <bounds x="0" y="0.1" width="1" height="1" />
182      </text>
183      <text string="41" state="41">
184         <color red="1.0" green="1.0" blue="1.0" />
185         <bounds x="0" y="0.1" width="1" height="1" />
186      </text>
187      <text string="42" state="42">
188         <color red="1.0" green="1.0" blue="1.0" />
189         <bounds x="0" y="0.1" width="1" height="1" />
190      </text>
191      <text string="43" state="43">
192         <color red="1.0" green="1.0" blue="1.0" />
193         <bounds x="0" y="0.1" width="1" height="1" />
194      </text>
195      <text string="44" state="44">
196         <color red="1.0" green="1.0" blue="1.0" />
197         <bounds x="0" y="0.1" width="1" height="1" />
198      </text>
199      <text string="45" state="45">
200         <color red="1.0" green="1.0" blue="1.0" />
201         <bounds x="0" y="0.1" width="1" height="1" />
202      </text>
203      <text string="46" state="46">
204         <color red="1.0" green="1.0" blue="1.0" />
205         <bounds x="0" y="0.1" width="1" height="1" />
206      </text>
207      <text string="47" state="47">
208         <color red="1.0" green="1.0" blue="1.0" />
209         <bounds x="0" y="0.1" width="1" height="1" />
210      </text>
211      <text string="48" state="48">
212         <color red="1.0" green="1.0" blue="1.0" />
213         <bounds x="0" y="0.1" width="1" height="1" />
214      </text>
215      <text string="49" state="49">
216         <color red="1.0" green="1.0" blue="1.0" />
217         <bounds x="0" y="0.1" width="1" height="1" />
218      </text>
219      <text string="50" state="50">
220         <color red="1.0" green="1.0" blue="1.0" />
221         <bounds x="0" y="0.1" width="1" height="1" />
222      </text>
223      <text string="51" state="51">
224         <color red="1.0" green="1.0" blue="1.0" />
225         <bounds x="0" y="0.1" width="1" height="1" />
226      </text>
227      <text string="52" state="52">
228         <color red="1.0" green="1.0" blue="1.0" />
229         <bounds x="0" y="0.1" width="1" height="1" />
230      </text>
231      <text string="53" state="53">
232         <color red="1.0" green="1.0" blue="1.0" />
233         <bounds x="0" y="0.1" width="1" height="1" />
234      </text>
235      <text string="54" state="54">
236         <color red="1.0" green="1.0" blue="1.0" />
237         <bounds x="0" y="0.1" width="1" height="1" />
238      </text>
239      <text string="55" state="55">
240         <color red="1.0" green="1.0" blue="1.0" />
241         <bounds x="0" y="0.1" width="1" height="1" />
242      </text>
243      <text string="56" state="56">
244         <color red="1.0" green="1.0" blue="1.0" />
245         <bounds x="0" y="0.1" width="1" height="1" />
246      </text>
247      <text string="57" state="57">
248         <color red="1.0" green="1.0" blue="1.0" />
249         <bounds x="0" y="0.1" width="1" height="1" />
250      </text>
251      <text string="58" state="58">
252         <color red="1.0" green="1.0" blue="1.0" />
253         <bounds x="0" y="0.1" width="1" height="1" />
254      </text>
255      <text string="59" state="59">
256         <color red="1.0" green="1.0" blue="1.0" />
257         <bounds x="0" y="0.1" width="1" height="1" />
258      </text>
259      <text string="60" state="60">
260         <color red="1.0" green="1.0" blue="1.0" />
261         <bounds x="0" y="0.1" width="1" height="1" />
262      </text>
263      <text string="61" state="61">
264         <color red="1.0" green="1.0" blue="1.0" />
265         <bounds x="0" y="0.1" width="1" height="1" />
266      </text>
267      <text string="62" state="62">
268         <color red="1.0" green="1.0" blue="1.0" />
269         <bounds x="0" y="0.1" width="1" height="1" />
270      </text>
271      <text string="63" state="63">
272         <color red="1.0" green="1.0" blue="1.0" />
273         <bounds x="0" y="0.1" width="1" height="1" />
274      </text>
275      <text string="64" state="64">
276         <color red="1.0" green="1.0" blue="1.0" />
277         <bounds x="0" y="0.1" width="1" height="1" />
278      </text>
279      <text string="65" state="65">
280         <color red="1.0" green="1.0" blue="1.0" />
281         <bounds x="0" y="0.1" width="1" height="1" />
282      </text>
283      <text string="66" state="66">
284         <color red="1.0" green="1.0" blue="1.0" />
285         <bounds x="0" y="0.1" width="1" height="1" />
286      </text>
287      <text string="67" state="67">
288         <color red="1.0" green="1.0" blue="1.0" />
289         <bounds x="0" y="0.1" width="1" height="1" />
290      </text>
291      <text string="68" state="68">
292         <color red="1.0" green="1.0" blue="1.0" />
293         <bounds x="0" y="0.1" width="1" height="1" />
294      </text>
295      <text string="69" state="69">
296         <color red="1.0" green="1.0" blue="1.0" />
297         <bounds x="0" y="0.1" width="1" height="1" />
298      </text>
299      <text string="70" state="70">
300         <color red="1.0" green="1.0" blue="1.0" />
301         <bounds x="0" y="0.1" width="1" height="1" />
302      </text>
303      <text string="71" state="71">
304         <color red="1.0" green="1.0" blue="1.0" />
305         <bounds x="0" y="0.1" width="1" height="1" />
306      </text>
307      <text string="72" state="72">
308         <color red="1.0" green="1.0" blue="1.0" />
309         <bounds x="0" y="0.1" width="1" height="1" />
310      </text>
311      <text string="73" state="73">
312         <color red="1.0" green="1.0" blue="1.0" />
313         <bounds x="0" y="0.1" width="1" height="1" />
314      </text>
315      <text string="74" state="74">
316         <color red="1.0" green="1.0" blue="1.0" />
317         <bounds x="0" y="0.1" width="1" height="1" />
318      </text>
319      <text string="75" state="75">
320         <color red="1.0" green="1.0" blue="1.0" />
321         <bounds x="0" y="0.1" width="1" height="1" />
322      </text>
323      <text string="76" state="76">
324         <color red="1.0" green="1.0" blue="1.0" />
325         <bounds x="0" y="0.1" width="1" height="1" />
326      </text>
327      <text string="77" state="77">
328         <color red="1.0" green="1.0" blue="1.0" />
329         <bounds x="0" y="0.1" width="1" height="1" />
330      </text>
331      <text string="78" state="78">
332         <color red="1.0" green="1.0" blue="1.0" />
333         <bounds x="0" y="0.1" width="1" height="1" />
334      </text>
335      <text string="79" state="79">
336         <color red="1.0" green="1.0" blue="1.0" />
337         <bounds x="0" y="0.1" width="1" height="1" />
338      </text>
339      <text string="80" state="80">
340         <color red="1.0" green="1.0" blue="1.0" />
341         <bounds x="0" y="0.1" width="1" height="1" />
342      </text>
343      <text string="81" state="81">
344         <color red="1.0" green="1.0" blue="1.0" />
345         <bounds x="0" y="0.1" width="1" height="1" />
346      </text>
347      <text string="82" state="82">
348         <color red="1.0" green="1.0" blue="1.0" />
349         <bounds x="0" y="0.1" width="1" height="1" />
350      </text>
351      <text string="83" state="83">
352         <color red="1.0" green="1.0" blue="1.0" />
353         <bounds x="0" y="0.1" width="1" height="1" />
354      </text>
355      <text string="84" state="84">
356         <color red="1.0" green="1.0" blue="1.0" />
357         <bounds x="0" y="0.1" width="1" height="1" />
358      </text>
359      <text string="85" state="85">
360         <color red="1.0" green="1.0" blue="1.0" />
361         <bounds x="0" y="0.1" width="1" height="1" />
362      </text>
363      <text string="86" state="86">
364         <color red="1.0" green="1.0" blue="1.0" />
365         <bounds x="0" y="0.1" width="1" height="1" />
366      </text>
367      <text string="87" state="87">
368         <color red="1.0" green="1.0" blue="1.0" />
369         <bounds x="0" y="0.1" width="1" height="1" />
370      </text>
371      <text string="88" state="88">
372         <color red="1.0" green="1.0" blue="1.0" />
373         <bounds x="0" y="0.1" width="1" height="1" />
374      </text>
375      <text string="89" state="89">
376         <color red="1.0" green="1.0" blue="1.0" />
377         <bounds x="0" y="0.1" width="1" height="1" />
378      </text>
379      <text string="90" state="90">
380         <color red="1.0" green="1.0" blue="1.0" />
381         <bounds x="0" y="0.1" width="1" height="1" />
382      </text>
383      <text string="91" state="91">
384         <color red="1.0" green="1.0" blue="1.0" />
385         <bounds x="0" y="0.1" width="1" height="1" />
386      </text>
387      <text string="92" state="92">
388         <color red="1.0" green="1.0" blue="1.0" />
389         <bounds x="0" y="0.1" width="1" height="1" />
390      </text>
391      <text string="93" state="93">
392         <color red="1.0" green="1.0" blue="1.0" />
393         <bounds x="0" y="0.1" width="1" height="1" />
394      </text>
395      <text string="94" state="94">
396         <color red="1.0" green="1.0" blue="1.0" />
397         <bounds x="0" y="0.1" width="1" height="1" />
398      </text>
399      <text string="95" state="95">
400         <color red="1.0" green="1.0" blue="1.0" />
401         <bounds x="0" y="0.1" width="1" height="1" />
402      </text>
17   <element name="Steppers" defstate="0">
18       <simplecounter maxstate="999" digits="3">
19      <color red="1.0" green="1.0" blue="1.0" />
20      <bounds x="0" y="0" width="1" height="1" />
21      </simplecounter>
40322   </element>
23
40424   <element name="vfd0">
40525   <led14segsc>
40626         <color red="0" green="0.6" blue="1.0" />
src/mame/layout/awpvid16.lay
r15082r15083
1414         <color red="0.0" green="1.0" blue="0.0" />
1515      </rect>
1616   </element>
17   <element name="Steppers" defstate="96">
18      <text string="00" state="0">
19         <color red="1.0" green="1.0" blue="1.0" />
20         <bounds x="0" y="0.1" width="1" height="1" />
21      </text>
22      <text string="01" state="1">
23         <color red="1.0" green="1.0" blue="1.0" />
24         <bounds x="0" y="0.1" width="1" height="1" />
25      </text>
26      <text string="02" state="2">
27         <color red="1.0" green="1.0" blue="1.0" />
28         <bounds x="0" y="0.1" width="1" height="1" />
29      </text>
30      <text string="03" state="3">
31         <color red="1.0" green="1.0" blue="1.0" />
32         <bounds x="0" y="0.1" width="1" height="1" />
33      </text>
34      <text string="04" state="4">
35         <color red="1.0" green="1.0" blue="1.0" />
36         <bounds x="0" y="0.1" width="1" height="1" />
37      </text>
38      <text string="05" state="5">
39         <color red="1.0" green="1.0" blue="1.0" />
40         <bounds x="0" y="0.1" width="1" height="1" />
41      </text>
42      <text string="06" state="6">
43         <color red="1.0" green="1.0" blue="1.0" />
44         <bounds x="0" y="0.1" width="1" height="1" />
45      </text>
46      <text string="07" state="7">
47         <color red="1.0" green="1.0" blue="1.0" />
48         <bounds x="0" y="0.1" width="1" height="1" />
49      </text>
50      <text string="08" state="8">
51         <color red="1.0" green="1.0" blue="1.0" />
52         <bounds x="0" y="0.1" width="1" height="1" />
53      </text>
54      <text string="09" state="9">
55         <color red="1.0" green="1.0" blue="1.0" />
56         <bounds x="0" y="0.1" width="1" height="1" />
57      </text>
58      <text string="10" state="10">
59         <color red="1.0" green="1.0" blue="1.0" />
60         <bounds x="0" y="0.1" width="1" height="1" />
61      </text>
62      <text string="11" state="11">
63         <color red="1.0" green="1.0" blue="1.0" />
64         <bounds x="0" y="0.1" width="1" height="1" />
65      </text>
66      <text string="12" state="12">
67         <color red="1.0" green="1.0" blue="1.0" />
68         <bounds x="0" y="0.1" width="1" height="1" />
69      </text>
70      <text string="13" state="13">
71         <color red="1.0" green="1.0" blue="1.0" />
72         <bounds x="0" y="0.1" width="1" height="1" />
73      </text>
74      <text string="14" state="14">
75         <color red="1.0" green="1.0" blue="1.0" />
76         <bounds x="0" y="0.1" width="1" height="1" />
77      </text>
78      <text string="15" state="15">
79         <color red="1.0" green="1.0" blue="1.0" />
80         <bounds x="0" y="0.1" width="1" height="1" />
81      </text>
82      <text string="16" state="16">
83         <color red="1.0" green="1.0" blue="1.0" />
84         <bounds x="0" y="0.1" width="1" height="1" />
85      </text>
86      <text string="17" state="17">
87         <color red="1.0" green="1.0" blue="1.0" />
88         <bounds x="0" y="0.1" width="1" height="1" />
89      </text>
90      <text string="18" state="18">
91         <color red="1.0" green="1.0" blue="1.0" />
92         <bounds x="0" y="0.1" width="1" height="1" />
93      </text>
94      <text string="19" state="19">
95         <color red="1.0" green="1.0" blue="1.0" />
96         <bounds x="0" y="0.1" width="1" height="1" />
97      </text>
98      <text string="20" state="20">
99         <color red="1.0" green="1.0" blue="1.0" />
100         <bounds x="0" y="0.1" width="1" height="1" />
101      </text>
102      <text string="21" state="21">
103         <color red="1.0" green="1.0" blue="1.0" />
104         <bounds x="0" y="0.1" width="1" height="1" />
105      </text>
106      <text string="22" state="22">
107         <color red="1.0" green="1.0" blue="1.0" />
108         <bounds x="0" y="0.1" width="1" height="1" />
109      </text>
110      <text string="23" state="23">
111         <color red="1.0" green="1.0" blue="1.0" />
112         <bounds x="0" y="0.1" width="1" height="1" />
113      </text>
114      <text string="24" state="24">
115         <color red="1.0" green="1.0" blue="1.0" />
116         <bounds x="0" y="0.1" width="1" height="1" />
117      </text>
118      <text string="25" state="25">
119         <color red="1.0" green="1.0" blue="1.0" />
120         <bounds x="0" y="0.1" width="1" height="1" />
121      </text>
122
123      <text string="26" state="26">
124         <color red="1.0" green="1.0" blue="1.0" />
125         <bounds x="0" y="0.1" width="1" height="1" />
126      </text>
127      <text string="27" state="27">
128         <color red="1.0" green="1.0" blue="1.0" />
129         <bounds x="0" y="0.1" width="1" height="1" />
130      </text>
131      <text string="28" state="28">
132         <color red="1.0" green="1.0" blue="1.0" />
133         <bounds x="0" y="0.1" width="1" height="1" />
134      </text>
135      <text string="29" state="29">
136         <color red="1.0" green="1.0" blue="1.0" />
137         <bounds x="0" y="0.1" width="1" height="1" />
138      </text>
139      <text string="30" state="30">
140         <color red="1.0" green="1.0" blue="1.0" />
141         <bounds x="0" y="0.1" width="1" height="1" />
142      </text>
143      <text string="31" state="31">
144         <color red="1.0" green="1.0" blue="1.0" />
145         <bounds x="0" y="0.1" width="1" height="1" />
146      </text>
147      <text string="32" state="32">
148         <color red="1.0" green="1.0" blue="1.0" />
149         <bounds x="0" y="0.1" width="1" height="1" />
150      </text>
151      <text string="33" state="33">
152         <color red="1.0" green="1.0" blue="1.0" />
153         <bounds x="0" y="0.1" width="1" height="1" />
154      </text>
155      <text string="34" state="34">
156         <color red="1.0" green="1.0" blue="1.0" />
157         <bounds x="0" y="0.1" width="1" height="1" />
158      </text>
159      <text string="35" state="35">
160         <color red="1.0" green="1.0" blue="1.0" />
161         <bounds x="0" y="0.1" width="1" height="1" />
162      </text>
163      <text string="36" state="36">
164         <color red="1.0" green="1.0" blue="1.0" />
165         <bounds x="0" y="0.1" width="1" height="1" />
166      </text>
167      <text string="37" state="37">
168         <color red="1.0" green="1.0" blue="1.0" />
169         <bounds x="0" y="0.1" width="1" height="1" />
170      </text>
171      <text string="38" state="38">
172         <color red="1.0" green="1.0" blue="1.0" />
173         <bounds x="0" y="0.1" width="1" height="1" />
174      </text>
175      <text string="39" state="39">
176         <color red="1.0" green="1.0" blue="1.0" />
177         <bounds x="0" y="0.1" width="1" height="1" />
178      </text>
179      <text string="40" state="40">
180         <color red="1.0" green="1.0" blue="1.0" />
181         <bounds x="0" y="0.1" width="1" height="1" />
182      </text>
183      <text string="41" state="41">
184         <color red="1.0" green="1.0" blue="1.0" />
185         <bounds x="0" y="0.1" width="1" height="1" />
186      </text>
187      <text string="42" state="42">
188         <color red="1.0" green="1.0" blue="1.0" />
189         <bounds x="0" y="0.1" width="1" height="1" />
190      </text>
191      <text string="43" state="43">
192         <color red="1.0" green="1.0" blue="1.0" />
193         <bounds x="0" y="0.1" width="1" height="1" />
194      </text>
195      <text string="44" state="44">
196         <color red="1.0" green="1.0" blue="1.0" />
197         <bounds x="0" y="0.1" width="1" height="1" />
198      </text>
199      <text string="45" state="45">
200         <color red="1.0" green="1.0" blue="1.0" />
201         <bounds x="0" y="0.1" width="1" height="1" />
202      </text>
203      <text string="46" state="46">
204         <color red="1.0" green="1.0" blue="1.0" />
205         <bounds x="0" y="0.1" width="1" height="1" />
206      </text>
207      <text string="47" state="47">
208         <color red="1.0" green="1.0" blue="1.0" />
209         <bounds x="0" y="0.1" width="1" height="1" />
210      </text>
211      <text string="48" state="48">
212         <color red="1.0" green="1.0" blue="1.0" />
213         <bounds x="0" y="0.1" width="1" height="1" />
214      </text>
215      <text string="49" state="49">
216         <color red="1.0" green="1.0" blue="1.0" />
217         <bounds x="0" y="0.1" width="1" height="1" />
218      </text>
219      <text string="50" state="50">
220         <color red="1.0" green="1.0" blue="1.0" />
221         <bounds x="0" y="0.1" width="1" height="1" />
222      </text>
223      <text string="51" state="51">
224         <color red="1.0" green="1.0" blue="1.0" />
225         <bounds x="0" y="0.1" width="1" height="1" />
226      </text>
227      <text string="52" state="52">
228         <color red="1.0" green="1.0" blue="1.0" />
229         <bounds x="0" y="0.1" width="1" height="1" />
230      </text>
231      <text string="53" state="53">
232         <color red="1.0" green="1.0" blue="1.0" />
233         <bounds x="0" y="0.1" width="1" height="1" />
234      </text>
235      <text string="54" state="54">
236         <color red="1.0" green="1.0" blue="1.0" />
237         <bounds x="0" y="0.1" width="1" height="1" />
238      </text>
239      <text string="55" state="55">
240         <color red="1.0" green="1.0" blue="1.0" />
241         <bounds x="0" y="0.1" width="1" height="1" />
242      </text>
243      <text string="56" state="56">
244         <color red="1.0" green="1.0" blue="1.0" />
245         <bounds x="0" y="0.1" width="1" height="1" />
246      </text>
247      <text string="57" state="57">
248         <color red="1.0" green="1.0" blue="1.0" />
249         <bounds x="0" y="0.1" width="1" height="1" />
250      </text>
251      <text string="58" state="58">
252         <color red="1.0" green="1.0" blue="1.0" />
253         <bounds x="0" y="0.1" width="1" height="1" />
254      </text>
255      <text string="59" state="59">
256         <color red="1.0" green="1.0" blue="1.0" />
257         <bounds x="0" y="0.1" width="1" height="1" />
258      </text>
259      <text string="60" state="60">
260         <color red="1.0" green="1.0" blue="1.0" />
261         <bounds x="0" y="0.1" width="1" height="1" />
262      </text>
263      <text string="61" state="61">
264         <color red="1.0" green="1.0" blue="1.0" />
265         <bounds x="0" y="0.1" width="1" height="1" />
266      </text>
267      <text string="62" state="62">
268         <color red="1.0" green="1.0" blue="1.0" />
269         <bounds x="0" y="0.1" width="1" height="1" />
270      </text>
271      <text string="63" state="63">
272         <color red="1.0" green="1.0" blue="1.0" />
273         <bounds x="0" y="0.1" width="1" height="1" />
274      </text>
275      <text string="64" state="64">
276         <color red="1.0" green="1.0" blue="1.0" />
277         <bounds x="0" y="0.1" width="1" height="1" />
278      </text>
279      <text string="65" state="65">
280         <color red="1.0" green="1.0" blue="1.0" />
281         <bounds x="0" y="0.1" width="1" height="1" />
282      </text>
283      <text string="66" state="66">
284         <color red="1.0" green="1.0" blue="1.0" />
285         <bounds x="0" y="0.1" width="1" height="1" />
286      </text>
287      <text string="67" state="67">
288         <color red="1.0" green="1.0" blue="1.0" />
289         <bounds x="0" y="0.1" width="1" height="1" />
290      </text>
291      <text string="68" state="68">
292         <color red="1.0" green="1.0" blue="1.0" />
293         <bounds x="0" y="0.1" width="1" height="1" />
294      </text>
295      <text string="69" state="69">
296         <color red="1.0" green="1.0" blue="1.0" />
297         <bounds x="0" y="0.1" width="1" height="1" />
298      </text>
299      <text string="70" state="70">
300         <color red="1.0" green="1.0" blue="1.0" />
301         <bounds x="0" y="0.1" width="1" height="1" />
302      </text>
303      <text string="71" state="71">
304         <color red="1.0" green="1.0" blue="1.0" />
305         <bounds x="0" y="0.1" width="1" height="1" />
306      </text>
307      <text string="72" state="72">
308         <color red="1.0" green="1.0" blue="1.0" />
309         <bounds x="0" y="0.1" width="1" height="1" />
310      </text>
311      <text string="73" state="73">
312         <color red="1.0" green="1.0" blue="1.0" />
313         <bounds x="0" y="0.1" width="1" height="1" />
314      </text>
315      <text string="74" state="74">
316         <color red="1.0" green="1.0" blue="1.0" />
317         <bounds x="0" y="0.1" width="1" height="1" />
318      </text>
319      <text string="75" state="75">
320         <color red="1.0" green="1.0" blue="1.0" />
321         <bounds x="0" y="0.1" width="1" height="1" />
322      </text>
323      <text string="76" state="76">
324         <color red="1.0" green="1.0" blue="1.0" />
325         <bounds x="0" y="0.1" width="1" height="1" />
326      </text>
327      <text string="77" state="77">
328         <color red="1.0" green="1.0" blue="1.0" />
329         <bounds x="0" y="0.1" width="1" height="1" />
330      </text>
331      <text string="78" state="78">
332         <color red="1.0" green="1.0" blue="1.0" />
333         <bounds x="0" y="0.1" width="1" height="1" />
334      </text>
335      <text string="79" state="79">
336         <color red="1.0" green="1.0" blue="1.0" />
337         <bounds x="0" y="0.1" width="1" height="1" />
338      </text>
339      <text string="80" state="80">
340         <color red="1.0" green="1.0" blue="1.0" />
341         <bounds x="0" y="0.1" width="1" height="1" />
342      </text>
343      <text string="81" state="81">
344         <color red="1.0" green="1.0" blue="1.0" />
345         <bounds x="0" y="0.1" width="1" height="1" />
346      </text>
347      <text string="82" state="82">
348         <color red="1.0" green="1.0" blue="1.0" />
349         <bounds x="0" y="0.1" width="1" height="1" />
350      </text>
351      <text string="83" state="83">
352         <color red="1.0" green="1.0" blue="1.0" />
353         <bounds x="0" y="0.1" width="1" height="1" />
354      </text>
355      <text string="84" state="84">
356         <color red="1.0" green="1.0" blue="1.0" />
357         <bounds x="0" y="0.1" width="1" height="1" />
358      </text>
359      <text string="85" state="85">
360         <color red="1.0" green="1.0" blue="1.0" />
361         <bounds x="0" y="0.1" width="1" height="1" />
362      </text>
363      <text string="86" state="86">
364         <color red="1.0" green="1.0" blue="1.0" />
365         <bounds x="0" y="0.1" width="1" height="1" />
366      </text>
367      <text string="87" state="87">
368         <color red="1.0" green="1.0" blue="1.0" />
369         <bounds x="0" y="0.1" width="1" height="1" />
370      </text>
371      <text string="88" state="88">
372         <color red="1.0" green="1.0" blue="1.0" />
373         <bounds x="0" y="0.1" width="1" height="1" />
374      </text>
375      <text string="89" state="89">
376         <color red="1.0" green="1.0" blue="1.0" />
377         <bounds x="0" y="0.1" width="1" height="1" />
378      </text>
379      <text string="90" state="90">
380         <color red="1.0" green="1.0" blue="1.0" />
381         <bounds x="0" y="0.1" width="1" height="1" />
382      </text>
383      <text string="91" state="91">
384         <color red="1.0" green="1.0" blue="1.0" />
385         <bounds x="0" y="0.1" width="1" height="1" />
386      </text>
387      <text string="92" state="92">
388         <color red="1.0" green="1.0" blue="1.0" />
389         <bounds x="0" y="0.1" width="1" height="1" />
390      </text>
391      <text string="93" state="93">
392         <color red="1.0" green="1.0" blue="1.0" />
393         <bounds x="0" y="0.1" width="1" height="1" />
394      </text>
395      <text string="94" state="94">
396         <color red="1.0" green="1.0" blue="1.0" />
397         <bounds x="0" y="0.1" width="1" height="1" />
398      </text>
399      <text string="95" state="95">
400         <color red="1.0" green="1.0" blue="1.0" />
401         <bounds x="0" y="0.1" width="1" height="1" />
402      </text>
17   <element name="Steppers" defstate="0">
18       <simplecounter maxstate="999" digits="3">
19      <color red="1.0" green="1.0" blue="1.0" />
20      <bounds x="0" y="0" width="1" height="1" />
21      </simplecounter>
40322   </element>
23
40424   <element name="vfd0">
40525   <led16segsc>
40626         <color red="0" green="0.6" blue="1.0" />
src/mame/layout/bfm_sc1.lay
r15082r15083
1919         <color red="0" green="0.6" blue="1.0" />
2020   </led14segsc>
2121   </element>
22   <element name="Steppers" defstate="96">
23      <text string="00" state="0">
24         <color red="1.0" green="1.0" blue="1.0" />
25         <bounds x="0" y="0.1" width="1" height="1" />
26      </text>
27      <text string="01" state="1">
28         <color red="1.0" green="1.0" blue="1.0" />
29         <bounds x="0" y="0.1" width="1" height="1" />
30      </text>
31      <text string="02" state="2">
32         <color red="1.0" green="1.0" blue="1.0" />
33         <bounds x="0" y="0.1" width="1" height="1" />
34      </text>
35      <text string="03" state="3">
36         <color red="1.0" green="1.0" blue="1.0" />
37         <bounds x="0" y="0.1" width="1" height="1" />
38      </text>
39      <text string="04" state="4">
40         <color red="1.0" green="1.0" blue="1.0" />
41         <bounds x="0" y="0.1" width="1" height="1" />
42      </text>
43      <text string="05" state="5">
44         <color red="1.0" green="1.0" blue="1.0" />
45         <bounds x="0" y="0.1" width="1" height="1" />
46      </text>
47      <text string="06" state="6">
48         <color red="1.0" green="1.0" blue="1.0" />
49         <bounds x="0" y="0.1" width="1" height="1" />
50      </text>
51      <text string="07" state="7">
52         <color red="1.0" green="1.0" blue="1.0" />
53         <bounds x="0" y="0.1" width="1" height="1" />
54      </text>
55      <text string="08" state="8">
56         <color red="1.0" green="1.0" blue="1.0" />
57         <bounds x="0" y="0.1" width="1" height="1" />
58      </text>
59      <text string="09" state="9">
60         <color red="1.0" green="1.0" blue="1.0" />
61         <bounds x="0" y="0.1" width="1" height="1" />
62      </text>
63      <text string="10" state="10">
64         <color red="1.0" green="1.0" blue="1.0" />
65         <bounds x="0" y="0.1" width="1" height="1" />
66      </text>
67      <text string="11" state="11">
68         <color red="1.0" green="1.0" blue="1.0" />
69         <bounds x="0" y="0.1" width="1" height="1" />
70      </text>
71      <text string="12" state="12">
72         <color red="1.0" green="1.0" blue="1.0" />
73         <bounds x="0" y="0.1" width="1" height="1" />
74      </text>
75      <text string="13" state="13">
76         <color red="1.0" green="1.0" blue="1.0" />
77         <bounds x="0" y="0.1" width="1" height="1" />
78      </text>
79      <text string="14" state="14">
80         <color red="1.0" green="1.0" blue="1.0" />
81         <bounds x="0" y="0.1" width="1" height="1" />
82      </text>
83      <text string="15" state="15">
84         <color red="1.0" green="1.0" blue="1.0" />
85         <bounds x="0" y="0.1" width="1" height="1" />
86      </text>
87      <text string="16" state="16">
88         <color red="1.0" green="1.0" blue="1.0" />
89         <bounds x="0" y="0.1" width="1" height="1" />
90      </text>
91      <text string="17" state="17">
92         <color red="1.0" green="1.0" blue="1.0" />
93         <bounds x="0" y="0.1" width="1" height="1" />
94      </text>
95      <text string="18" state="18">
96         <color red="1.0" green="1.0" blue="1.0" />
97         <bounds x="0" y="0.1" width="1" height="1" />
98      </text>
99      <text string="19" state="19">
100         <color red="1.0" green="1.0" blue="1.0" />
101         <bounds x="0" y="0.1" width="1" height="1" />
102      </text>
103      <text string="20" state="20">
104         <color red="1.0" green="1.0" blue="1.0" />
105         <bounds x="0" y="0.1" width="1" height="1" />
106      </text>
107      <text string="21" state="21">
108         <color red="1.0" green="1.0" blue="1.0" />
109         <bounds x="0" y="0.1" width="1" height="1" />
110      </text>
111      <text string="22" state="22">
112         <color red="1.0" green="1.0" blue="1.0" />
113         <bounds x="0" y="0.1" width="1" height="1" />
114      </text>
115      <text string="23" state="23">
116         <color red="1.0" green="1.0" blue="1.0" />
117         <bounds x="0" y="0.1" width="1" height="1" />
118      </text>
119      <text string="24" state="24">
120         <color red="1.0" green="1.0" blue="1.0" />
121         <bounds x="0" y="0.1" width="1" height="1" />
122      </text>
123      <text string="25" state="25">
124         <color red="1.0" green="1.0" blue="1.0" />
125         <bounds x="0" y="0.1" width="1" height="1" />
126      </text>
127      <text string="26" state="26">
128         <color red="1.0" green="1.0" blue="1.0" />
129         <bounds x="0" y="0.1" width="1" height="1" />
130      </text>
131      <text string="27" state="27">
132         <color red="1.0" green="1.0" blue="1.0" />
133         <bounds x="0" y="0.1" width="1" height="1" />
134      </text>
135      <text string="28" state="28">
136         <color red="1.0" green="1.0" blue="1.0" />
137         <bounds x="0" y="0.1" width="1" height="1" />
138      </text>
139      <text string="29" state="29">
140         <color red="1.0" green="1.0" blue="1.0" />
141         <bounds x="0" y="0.1" width="1" height="1" />
142      </text>
143      <text string="30" state="30">
144         <color red="1.0" green="1.0" blue="1.0" />
145         <bounds x="0" y="0.1" width="1" height="1" />
146      </text>
147      <text string="31" state="31">
148         <color red="1.0" green="1.0" blue="1.0" />
149         <bounds x="0" y="0.1" width="1" height="1" />
150      </text>
151      <text string="32" state="32">
152         <color red="1.0" green="1.0" blue="1.0" />
153         <bounds x="0" y="0.1" width="1" height="1" />
154      </text>
155      <text string="33" state="33">
156         <color red="1.0" green="1.0" blue="1.0" />
157         <bounds x="0" y="0.1" width="1" height="1" />
158      </text>
159      <text string="34" state="34">
160         <color red="1.0" green="1.0" blue="1.0" />
161         <bounds x="0" y="0.1" width="1" height="1" />
162      </text>
163      <text string="35" state="35">
164         <color red="1.0" green="1.0" blue="1.0" />
165         <bounds x="0" y="0.1" width="1" height="1" />
166      </text>
167      <text string="36" state="36">
168         <color red="1.0" green="1.0" blue="1.0" />
169         <bounds x="0" y="0.1" width="1" height="1" />
170      </text>
171      <text string="37" state="37">
172         <color red="1.0" green="1.0" blue="1.0" />
173         <bounds x="0" y="0.1" width="1" height="1" />
174      </text>
175      <text string="38" state="38">
176         <color red="1.0" green="1.0" blue="1.0" />
177         <bounds x="0" y="0.1" width="1" height="1" />
178      </text>
179      <text string="39" state="39">
180         <color red="1.0" green="1.0" blue="1.0" />
181         <bounds x="0" y="0.1" width="1" height="1" />
182      </text>
183      <text string="40" state="40">
184         <color red="1.0" green="1.0" blue="1.0" />
185         <bounds x="0" y="0.1" width="1" height="1" />
186      </text>
187      <text string="41" state="41">
188         <color red="1.0" green="1.0" blue="1.0" />
189         <bounds x="0" y="0.1" width="1" height="1" />
190      </text>
191      <text string="42" state="42">
192         <color red="1.0" green="1.0" blue="1.0" />
193         <bounds x="0" y="0.1" width="1" height="1" />
194      </text>
195      <text string="43" state="43">
196         <color red="1.0" green="1.0" blue="1.0" />
197         <bounds x="0" y="0.1" width="1" height="1" />
198      </text>
199      <text string="44" state="44">
200         <color red="1.0" green="1.0" blue="1.0" />
201         <bounds x="0" y="0.1" width="1" height="1" />
202      </text>
203      <text string="45" state="45">
204         <color red="1.0" green="1.0" blue="1.0" />
205         <bounds x="0" y="0.1" width="1" height="1" />
206      </text>
207      <text string="46" state="46">
208         <color red="1.0" green="1.0" blue="1.0" />
209         <bounds x="0" y="0.1" width="1" height="1" />
210      </text>
211      <text string="47" state="47">
212         <color red="1.0" green="1.0" blue="1.0" />
213         <bounds x="0" y="0.1" width="1" height="1" />
214      </text>
215      <text string="48" state="48">
216         <color red="1.0" green="1.0" blue="1.0" />
217         <bounds x="0" y="0.1" width="1" height="1" />
218      </text>
219      <text string="49" state="49">
220         <color red="1.0" green="1.0" blue="1.0" />
221         <bounds x="0" y="0.1" width="1" height="1" />
222      </text>
223      <text string="50" state="50">
224         <color red="1.0" green="1.0" blue="1.0" />
225         <bounds x="0" y="0.1" width="1" height="1" />
226      </text>
227      <text string="51" state="51">
228         <color red="1.0" green="1.0" blue="1.0" />
229         <bounds x="0" y="0.1" width="1" height="1" />
230      </text>
231      <text string="52" state="52">
232         <color red="1.0" green="1.0" blue="1.0" />
233         <bounds x="0" y="0.1" width="1" height="1" />
234      </text>
235      <text string="53" state="53">
236         <color red="1.0" green="1.0" blue="1.0" />
237         <bounds x="0" y="0.1" width="1" height="1" />
238      </text>
239      <text string="54" state="54">
240         <color red="1.0" green="1.0" blue="1.0" />
241         <bounds x="0" y="0.1" width="1" height="1" />
242      </text>
243      <text string="55" state="55">
244         <color red="1.0" green="1.0" blue="1.0" />
245         <bounds x="0" y="0.1" width="1" height="1" />
246      </text>
247      <text string="56" state="56">
248         <color red="1.0" green="1.0" blue="1.0" />
249         <bounds x="0" y="0.1" width="1" height="1" />
250      </text>
251      <text string="57" state="57">
252         <color red="1.0" green="1.0" blue="1.0" />
253         <bounds x="0" y="0.1" width="1" height="1" />
254      </text>
255      <text string="58" state="58">
256         <color red="1.0" green="1.0" blue="1.0" />
257         <bounds x="0" y="0.1" width="1" height="1" />
258      </text>
259      <text string="59" state="59">
260         <color red="1.0" green="1.0" blue="1.0" />
261         <bounds x="0" y="0.1" width="1" height="1" />
262      </text>
263      <text string="60" state="60">
264         <color red="1.0" green="1.0" blue="1.0" />
265         <bounds x="0" y="0.1" width="1" height="1" />
266      </text>
267      <text string="61" state="61">
268         <color red="1.0" green="1.0" blue="1.0" />
269         <bounds x="0" y="0.1" width="1" height="1" />
270      </text>
271      <text string="62" state="62">
272         <color red="1.0" green="1.0" blue="1.0" />
273         <bounds x="0" y="0.1" width="1" height="1" />
274      </text>
275      <text string="63" state="63">
276         <color red="1.0" green="1.0" blue="1.0" />
277         <bounds x="0" y="0.1" width="1" height="1" />
278      </text>
279      <text string="64" state="64">
280         <color red="1.0" green="1.0" blue="1.0" />
281         <bounds x="0" y="0.1" width="1" height="1" />
282      </text>
283      <text string="65" state="65">
284         <color red="1.0" green="1.0" blue="1.0" />
285         <bounds x="0" y="0.1" width="1" height="1" />
286      </text>
287      <text string="66" state="66">
288         <color red="1.0" green="1.0" blue="1.0" />
289         <bounds x="0" y="0.1" width="1" height="1" />
290      </text>
291      <text string="67" state="67">
292         <color red="1.0" green="1.0" blue="1.0" />
293         <bounds x="0" y="0.1" width="1" height="1" />
294      </text>
295      <text string="68" state="68">
296         <color red="1.0" green="1.0" blue="1.0" />
297         <bounds x="0" y="0.1" width="1" height="1" />
298      </text>
299      <text string="69" state="69">
300         <color red="1.0" green="1.0" blue="1.0" />
301         <bounds x="0" y="0.1" width="1" height="1" />
302      </text>
303      <text string="70" state="70">
304         <color red="1.0" green="1.0" blue="1.0" />
305         <bounds x="0" y="0.1" width="1" height="1" />
306      </text>
307      <text string="71" state="71">
308         <color red="1.0" green="1.0" blue="1.0" />
309         <bounds x="0" y="0.1" width="1" height="1" />
310      </text>
311      <text string="72" state="72">
312         <color red="1.0" green="1.0" blue="1.0" />
313         <bounds x="0" y="0.1" width="1" height="1" />
314      </text>
315      <text string="73" state="73">
316         <color red="1.0" green="1.0" blue="1.0" />
317         <bounds x="0" y="0.1" width="1" height="1" />
318      </text>
319      <text string="74" state="74">
320         <color red="1.0" green="1.0" blue="1.0" />
321         <bounds x="0" y="0.1" width="1" height="1" />
322      </text>
323      <text string="75" state="75">
324         <color red="1.0" green="1.0" blue="1.0" />
325         <bounds x="0" y="0.1" width="1" height="1" />
326      </text>
327      <text string="76" state="76">
328         <color red="1.0" green="1.0" blue="1.0" />
329         <bounds x="0" y="0.1" width="1" height="1" />
330      </text>
331      <text string="77" state="77">
332         <color red="1.0" green="1.0" blue="1.0" />
333         <bounds x="0" y="0.1" width="1" height="1" />
334      </text>
335      <text string="78" state="78">
336         <color red="1.0" green="1.0" blue="1.0" />
337         <bounds x="0" y="0.1" width="1" height="1" />
338      </text>
339      <text string="79" state="79">
340         <color red="1.0" green="1.0" blue="1.0" />
341         <bounds x="0" y="0.1" width="1" height="1" />
342      </text>
343      <text string="80" state="80">
344         <color red="1.0" green="1.0" blue="1.0" />
345         <bounds x="0" y="0.1" width="1" height="1" />
346      </text>
347      <text string="81" state="81">
348         <color red="1.0" green="1.0" blue="1.0" />
349         <bounds x="0" y="0.1" width="1" height="1" />
350      </text>
351      <text string="82" state="82">
352         <color red="1.0" green="1.0" blue="1.0" />
353         <bounds x="0" y="0.1" width="1" height="1" />
354      </text>
355      <text string="83" state="83">
356         <color red="1.0" green="1.0" blue="1.0" />
357         <bounds x="0" y="0.1" width="1" height="1" />
358      </text>
359      <text string="84" state="84">
360         <color red="1.0" green="1.0" blue="1.0" />
361         <bounds x="0" y="0.1" width="1" height="1" />
362      </text>
363      <text string="85" state="85">
364         <color red="1.0" green="1.0" blue="1.0" />
365         <bounds x="0" y="0.1" width="1" height="1" />
366      </text>
367      <text string="86" state="86">
368         <color red="1.0" green="1.0" blue="1.0" />
369         <bounds x="0" y="0.1" width="1" height="1" />
370      </text>
371      <text string="87" state="87">
372         <color red="1.0" green="1.0" blue="1.0" />
373         <bounds x="0" y="0.1" width="1" height="1" />
374      </text>
375      <text string="88" state="88">
376         <color red="1.0" green="1.0" blue="1.0" />
377         <bounds x="0" y="0.1" width="1" height="1" />
378      </text>
379      <text string="89" state="89">
380         <color red="1.0" green="1.0" blue="1.0" />
381         <bounds x="0" y="0.1" width="1" height="1" />
382      </text>
383      <text string="90" state="90">
384         <color red="1.0" green="1.0" blue="1.0" />
385         <bounds x="0" y="0.1" width="1" height="1" />
386      </text>
387      <text string="91" state="91">
388         <color red="1.0" green="1.0" blue="1.0" />
389         <bounds x="0" y="0.1" width="1" height="1" />
390      </text>
391      <text string="92" state="92">
392         <color red="1.0" green="1.0" blue="1.0" />
393         <bounds x="0" y="0.1" width="1" height="1" />
394      </text>
395      <text string="93" state="93">
396         <color red="1.0" green="1.0" blue="1.0" />
397         <bounds x="0" y="0.1" width="1" height="1" />
398      </text>
399      <text string="94" state="94">
400         <color red="1.0" green="1.0" blue="1.0" />
401         <bounds x="0" y="0.1" width="1" height="1" />
402      </text>
403      <text string="95" state="95">
404         <color red="1.0" green="1.0" blue="1.0" />
405         <bounds x="0" y="0.1" width="1" height="1" />
406      </text>
22   
23   <element name="Steppers" defstate="0">
24       <simplecounter maxstate="999" digits="3">
25      <color red="1.0" green="1.0" blue="1.0" />
26      <bounds x="0" y="0" width="1" height="1" />
27      </simplecounter>
40728   </element>
40829
40930   <view name="Full Output">
src/mame/layout/gldarrow.lay
r0r15083
1<?xml version="1.0"?>
2<mamelayout version="2">
3
4   <element name="stop1" defstate="0">
5      <rect state="1">
6         <color red="1.0" green="0.0" blue="0.0" />
7      </rect>
8      <rect state="0">
9         <color red="0.3" green="0.0" blue="0.0" />
10      </rect>
11      <text string="STOP 1">
12         <color red="0.0" green="0.0" blue="0.0" />
13         <bounds x="0.1" y="0.25" width="0.8" height="0.5" />
14      </text>
15   </element>
16
17   <element name="stop2" defstate="0">
18      <rect state="1">
19         <color red="1.0" green="0.0" blue="0.0" />
20      </rect>
21      <rect state="0">
22         <color red="0.3" green="0.0" blue="0.0" />
23      </rect>
24      <text string="STOP 2">
25         <color red="0.0" green="0.0" blue="0.0" />
26         <bounds x="0.1" y="0.25" width="0.8" height="0.5" />
27      </text>
28   </element>
29
30   <element name="stop3" defstate="0">
31      <rect state="1">
32         <color red="1.0" green="0.0" blue="0.0" />
33      </rect>
34      <rect state="0">
35         <color red="0.3" green="0.0" blue="0.0" />
36      </rect>
37      <text string="STOP 3">
38         <color red="0.0" green="0.0" blue="0.0" />
39         <bounds x="0.1" y="0.25" width="0.8" height="0.5" />
40      </text>
41   </element>
42
43   <element name="bet" defstate="0">
44      <rect state="1">
45         <color red="1.0" green="0.6" blue="0.0" />
46      </rect>
47      <rect state="0">
48         <color red="0.3" green="0.1" blue="0.0" />
49      </rect>
50      <text string="BET">
51         <color red="0.0" green="0.0" blue="0.0" />
52         <bounds x="0.1" y="0.25" width="0.8" height="0.5" />
53      </text>
54   </element>
55
56   <element name="start" defstate="0">
57      <rect state="1">
58         <color red="1.0" green="1.0" blue="1.0" />
59      </rect>
60      <rect state="0">
61         <color red="0.3" green="0.3" blue="0.3" />
62      </rect>
63      <text string="START">
64         <color red="0.0" green="0.0" blue="0.0" />
65         <bounds x="0.1" y="0.25" width="0.8" height="0.5" />
66      </text>
67   </element>
68
69
70   <view name="Button Lamps">
71
72      <screen index="0">
73         <bounds left="0" top="0" right="4" bottom="3" />
74      </screen>
75
76      <bezel name="lamp10" element="stop3">
77         <bounds x="1.5" y="3.05" width="0.40" height="0.24" />
78      </bezel>
79      <bezel name="lamp11" element="stop2">
80         <bounds x="1.0" y="3.05" width="0.40" height="0.24" />
81      </bezel>
82      <bezel name="lamp12" element="stop1">
83         <bounds x="0.5" y="3.05" width="0.40" height="0.24" />
84      </bezel>
85      <bezel name="lamp9" element="start">
86         <bounds x="3.1" y="3.05" width="0.40" height="0.24" />
87      </bezel>
88      <bezel name="lamp8" element="bet">
89         <bounds x="2.6" y="3.05" width="0.40" height="0.24" />
90      </bezel>
91
92   </view>
93</mamelayout>
src/mame/layout/drwho.lay
r15082r15083
11<?xml version="1.0"?>
22<mamelayout version="2">
3   <element name="TotalReels" defstate="4"/>
4   <element name="ReelSteps1" defstate="6"/>
5   <element name="ReelSymbols1" defstate="3"/>
6   <element name="ReelSteps4" defstate="4"/>
7   <element name="ReelSymbols4" defstate="1"/>
83   <element name="vfd0">
94   <led14segsc>
105         <color red="0" green="0.6" blue="1.0" />
r15082r15083
2419         <color red="0.0" green="1.0" blue="0.0"/>
2520      </rect>
2621   </element>
27   <element name="Reel1" defstate="96">
28      <text string="Cherry" state="0">
29         <color red="1.0" green="1.0" blue="1.0"/>
30         <bounds x="0" y="0.1" width="1" height="1"/>
31      </text>
32      <text string="Cherry" state="1">
33         <color red="1.0" green="1.0" blue="1.0"/>
34         <bounds x="0" y="0.1" width="1" height="1"/>
35      </text>
36      <text string="Cherry" state="2">
37         <color red="1.0" green="1.0" blue="1.0"/>
38         <bounds x="0" y="0.1" width="1" height="1"/>
39      </text>
40      <text string="Single Bar K9" state="3">
41         <color red="1.0" green="1.0" blue="1.0"/>
42         <bounds x="0" y="0.1" width="1" height="1"/>
43      </text>
44      <text string="Single Bar K9" state="4">
45         <color red="1.0" green="1.0" blue="1.0"/>
46         <bounds x="0" y="0.1" width="1" height="1"/>
47      </text>
48      <text string="Single Bar K9" state="5">
49         <color red="1.0" green="1.0" blue="1.0"/>
50         <bounds x="0" y="0.1" width="1" height="1"/>
51      </text>
52      <text string="Single Bar K9" state="6">
53         <color red="1.0" green="1.0" blue="1.0"/>
54         <bounds x="0" y="0.1" width="1" height="1"/>
55      </text>
56      <text string="Single Bar K9" state="7">
57         <color red="1.0" green="1.0" blue="1.0"/>
58         <bounds x="0" y="0.1" width="1" height="1"/>
59      </text>
60      <text string="Single Bar K9" state="8">
61         <color red="1.0" green="1.0" blue="1.0"/>
62         <bounds x="0" y="0.1" width="1" height="1"/>
63      </text>
64      <text string="Blue 7" state="9">
65         <color red="1.0" green="1.0" blue="1.0"/>
66         <bounds x="0" y="0.1" width="1" height="1"/>
67      </text>
68      <text string="Blue 7" state="10">
69         <color red="1.0" green="1.0" blue="1.0"/>
70         <bounds x="0" y="0.1" width="1" height="1"/>
71      </text>
72      <text string="Blue 7" state="11">
73         <color red="1.0" green="1.0" blue="1.0"/>
74         <bounds x="0" y="0.1" width="1" height="1"/>
75      </text>
76      <text string="Blue 7" state="12">
77         <color red="1.0" green="1.0" blue="1.0"/>
78         <bounds x="0" y="0.1" width="1" height="1"/>
79      </text>
80      <text string="Blue 7" state="13">
81         <color red="1.0" green="1.0" blue="1.0"/>
82         <bounds x="0" y="0.1" width="1" height="1"/>
83      </text>
84      <text string="Blue 7" state="14">
85         <color red="1.0" green="1.0" blue="1.0"/>
86         <bounds x="0" y="0.1" width="1" height="1"/>
87      </text>
88      <text string="Double Bar" state="15">
89         <color red="1.0" green="1.0" blue="1.0"/>
90         <bounds x="0" y="0.1" width="1" height="1"/>
91      </text>
92      <text string="Double Bar" state="16">
93         <color red="1.0" green="1.0" blue="1.0"/>
94         <bounds x="0" y="0.1" width="1" height="1"/>
95      </text>
96      <text string="Double Bar" state="17">
97         <color red="1.0" green="1.0" blue="1.0"/>
98         <bounds x="0" y="0.1" width="1" height="1"/>
99      </text>
100      <text string="Double Bar" state="18">
101         <color red="1.0" green="1.0" blue="1.0"/>
102         <bounds x="0" y="0.1" width="1" height="1"/>
103      </text>
104      <text string="Double Bar" state="19">
105         <color red="1.0" green="1.0" blue="1.0"/>
106         <bounds x="0" y="0.1" width="1" height="1"/>
107      </text>
108      <text string="Double Bar" state="20">
109         <color red="1.0" green="1.0" blue="1.0"/>
110         <bounds x="0" y="0.1" width="1" height="1"/>
111      </text>
112      <text string="Cherry(3)" state="21">
113         <color red="1.0" green="1.0" blue="1.0"/>
114         <bounds x="0" y="0.1" width="1" height="1"/>
115      </text>
116      <text string="Cherry(3)" state="22">
117         <color red="1.0" green="1.0" blue="1.0"/>
118         <bounds x="0" y="0.1" width="1" height="1"/>
119      </text>
120      <text string="Cherry(3)" state="23">
121         <color red="1.0" green="1.0" blue="1.0"/>
122         <bounds x="0" y="0.1" width="1" height="1"/>
123      </text>
124      <text string="Cherry(3)" state="24">
125         <color red="1.0" green="1.0" blue="1.0"/>
126         <bounds x="0" y="0.1" width="1" height="1"/>
127      </text>
128      <text string="Cherry(3)" state="25">
129         <color red="1.0" green="1.0" blue="1.0"/>
130         <bounds x="0" y="0.1" width="1" height="1"/>
131      </text>
132      <text string="Cherry(3)" state="26">
133         <color red="1.0" green="1.0" blue="1.0"/>
134         <bounds x="0" y="0.1" width="1" height="1"/>
135      </text>
136      <text string="Red 7" state="27">
137         <color red="1.0" green="1.0" blue="1.0"/>
138         <bounds x="0" y="0.1" width="1" height="1"/>
139      </text>
140      <text string="Red 7" state="28">
141         <color red="1.0" green="1.0" blue="1.0"/>
142         <bounds x="0" y="0.1" width="1" height="1"/>
143      </text>
144      <text string="Red 7" state="29">
145         <color red="1.0" green="1.0" blue="1.0"/>
146         <bounds x="0" y="0.1" width="1" height="1"/>
147      </text>
148      <text string="Red 7" state="30">
149         <color red="1.0" green="1.0" blue="1.0"/>
150         <bounds x="0" y="0.1" width="1" height="1"/>
151      </text>
152      <text string="Red 7" state="31">
153         <color red="1.0" green="1.0" blue="1.0"/>
154         <bounds x="0" y="0.1" width="1" height="1"/>
155      </text>
156      <text string="Red 7" state="32">
157         <color red="1.0" green="1.0" blue="1.0"/>
158         <bounds x="0" y="0.1" width="1" height="1"/>
159      </text>
160      <text string="Single Bar" state="33">
161         <color red="1.0" green="1.0" blue="1.0"/>
162         <bounds x="0" y="0.1" width="1" height="1"/>
163      </text>
164      <text string="Single Bar" state="34">
165         <color red="1.0" green="1.0" blue="1.0"/>
166         <bounds x="0" y="0.1" width="1" height="1"/>
167      </text>
168      <text string="Single Bar" state="35">
169         <color red="1.0" green="1.0" blue="1.0"/>
170         <bounds x="0" y="0.1" width="1" height="1"/>
171      </text>
172      <text string="Single Bar" state="36">
173         <color red="1.0" green="1.0" blue="1.0"/>
174         <bounds x="0" y="0.1" width="1" height="1"/>
175      </text>
176      <text string="Single Bar" state="37">
177         <color red="1.0" green="1.0" blue="1.0"/>
178         <bounds x="0" y="0.1" width="1" height="1"/>
179      </text>
180      <text string="Single Bar" state="38">
181         <color red="1.0" green="1.0" blue="1.0"/>
182         <bounds x="0" y="0.1" width="1" height="1"/>
183      </text>
184      <text string="Triple Bar(1)" state="39">
185         <color red="1.0" green="1.0" blue="1.0"/>
186         <bounds x="0" y="0.1" width="1" height="1"/>
187      </text>
188      <text string="Triple Bar(1)" state="40">
189         <color red="1.0" green="1.0" blue="1.0"/>
190         <bounds x="0" y="0.1" width="1" height="1"/>
191      </text>
192      <text string="Triple Bar(1)" state="41">
193         <color red="1.0" green="1.0" blue="1.0"/>
194         <bounds x="0" y="0.1" width="1" height="1"/>
195      </text>
196      <text string="Triple Bar(1)" state="42">
197         <color red="1.0" green="1.0" blue="1.0"/>
198         <bounds x="0" y="0.1" width="1" height="1"/>
199      </text>
200      <text string="Triple Bar(1)" state="43">
201         <color red="1.0" green="1.0" blue="1.0"/>
202         <bounds x="0" y="0.1" width="1" height="1"/>
203      </text>
204      <text string="Triple Bar(1)" state="44">
205         <color red="1.0" green="1.0" blue="1.0"/>
206         <bounds x="0" y="0.1" width="1" height="1"/>
207      </text>
208      <text string="Blue 7" state="45">
209         <color red="1.0" green="1.0" blue="1.0"/>
210         <bounds x="0" y="0.1" width="1" height="1"/>
211      </text>
212      <text string="Blue 7" state="46">
213         <color red="1.0" green="1.0" blue="1.0"/>
214         <bounds x="0" y="0.1" width="1" height="1"/>
215      </text>
216      <text string="Blue 7" state="47">
217         <color red="1.0" green="1.0" blue="1.0"/>
218         <bounds x="0" y="0.1" width="1" height="1"/>
219      </text>
220      <text string="Blue 7" state="48">
221         <color red="1.0" green="1.0" blue="1.0"/>
222         <bounds x="0" y="0.1" width="1" height="1"/>
223      </text>
224      <text string="Blue 7" state="49">
225         <color red="1.0" green="1.0" blue="1.0"/>
226         <bounds x="0" y="0.1" width="1" height="1"/>
227      </text>
228      <text string="Blue 7" state="50">
229         <color red="1.0" green="1.0" blue="1.0"/>
230         <bounds x="0" y="0.1" width="1" height="1"/>
231      </text>
232      <text string="Double Bar" state="51">
233         <color red="1.0" green="1.0" blue="1.0"/>
234         <bounds x="0" y="0.1" width="1" height="1"/>
235      </text>
236      <text string="Double Bar" state="52">
237         <color red="1.0" green="1.0" blue="1.0"/>
238         <bounds x="0" y="0.1" width="1" height="1"/>
239      </text>
240      <text string="Double Bar" state="53">
241         <color red="1.0" green="1.0" blue="1.0"/>
242         <bounds x="0" y="0.1" width="1" height="1"/>
243      </text>
244      <text string="Double Bar" state="54">
245         <color red="1.0" green="1.0" blue="1.0"/>
246         <bounds x="0" y="0.1" width="1" height="1"/>
247      </text>
248      <text string="Double Bar" state="55">
249         <color red="1.0" green="1.0" blue="1.0"/>
250         <bounds x="0" y="0.1" width="1" height="1"/>
251      </text>
252      <text string="Double Bar" state="56">
253         <color red="1.0" green="1.0" blue="1.0"/>
254         <bounds x="0" y="0.1" width="1" height="1"/>
255      </text>
256      <text string="Cherry" state="57">
257         <color red="1.0" green="1.0" blue="1.0"/>
258         <bounds x="0" y="0.1" width="1" height="1"/>
259      </text>
260      <text string="Cherry" state="58">
261         <color red="1.0" green="1.0" blue="1.0"/>
262         <bounds x="0" y="0.1" width="1" height="1"/>
263      </text>
264      <text string="Cherry" state="59">
265         <color red="1.0" green="1.0" blue="1.0"/>
266         <bounds x="0" y="0.1" width="1" height="1"/>
267      </text>
268      <text string="Cherry" state="60">
269         <color red="1.0" green="1.0" blue="1.0"/>
270         <bounds x="0" y="0.1" width="1" height="1"/>
271      </text>
272      <text string="Cherry" state="61">
273         <color red="1.0" green="1.0" blue="1.0"/>
274         <bounds x="0" y="0.1" width="1" height="1"/>
275      </text>
276      <text string="Cherry" state="62">
277         <color red="1.0" green="1.0" blue="1.0"/>
278         <bounds x="0" y="0.1" width="1" height="1"/>
279      </text>
280      <text string="Single Bar(2)" state="63">
281         <color red="1.0" green="1.0" blue="1.0"/>
282         <bounds x="0" y="0.1" width="1" height="1"/>
283      </text>
284      <text string="Single Bar(2)" state="64">
285         <color red="1.0" green="1.0" blue="1.0"/>
286         <bounds x="0" y="0.1" width="1" height="1"/>
287      </text>
288      <text string="Single Bar(2)" state="65">
289         <color red="1.0" green="1.0" blue="1.0"/>
290         <bounds x="0" y="0.1" width="1" height="1"/>
291      </text>
292      <text string="Single Bar(2)" state="66">
293         <color red="1.0" green="1.0" blue="1.0"/>
294         <bounds x="0" y="0.1" width="1" height="1"/>
295      </text>
296      <text string="Single Bar(2)" state="67">
297         <color red="1.0" green="1.0" blue="1.0"/>
298         <bounds x="0" y="0.1" width="1" height="1"/>
299      </text>
300      <text string="Single Bar(2)" state="68">
301         <color red="1.0" green="1.0" blue="1.0"/>
302         <bounds x="0" y="0.1" width="1" height="1"/>
303      </text>
304      <text string="Double Bar" state="69">
305         <color red="1.0" green="1.0" blue="1.0"/>
306         <bounds x="0" y="0.1" width="1" height="1"/>
307      </text>
308      <text string="Double Bar" state="70">
309         <color red="1.0" green="1.0" blue="1.0"/>
310         <bounds x="0" y="0.1" width="1" height="1"/>
311      </text>
312      <text string="Double Bar" state="71">
313         <color red="1.0" green="1.0" blue="1.0"/>
314         <bounds x="0" y="0.1" width="1" height="1"/>
315      </text>
316      <text string="Double Bar" state="72">
317         <color red="1.0" green="1.0" blue="1.0"/>
318         <bounds x="0" y="0.1" width="1" height="1"/>
319      </text>
320      <text string="Double Bar" state="73">
321         <color red="1.0" green="1.0" blue="1.0"/>
322         <bounds x="0" y="0.1" width="1" height="1"/>
323      </text>
324      <text string="Double Bar" state="74">
325         <color red="1.0" green="1.0" blue="1.0"/>
326         <bounds x="0" y="0.1" width="1" height="1"/>
327      </text>
328      <text string="Triple Bar" state="75">
329         <color red="1.0" green="1.0" blue="1.0"/>
330         <bounds x="0" y="0.1" width="1" height="1"/>
331      </text>
332      <text string="Triple Bar" state="76">
333         <color red="1.0" green="1.0" blue="1.0"/>
334         <bounds x="0" y="0.1" width="1" height="1"/>
335      </text>
336      <text string="Triple Bar" state="77">
337         <color red="1.0" green="1.0" blue="1.0"/>
338         <bounds x="0" y="0.1" width="1" height="1"/>
339      </text>
340      <text string="Triple Bar" state="78">
341         <color red="1.0" green="1.0" blue="1.0"/>
342         <bounds x="0" y="0.1" width="1" height="1"/>
343      </text>
344      <text string="Triple Bar" state="79">
345         <color red="1.0" green="1.0" blue="1.0"/>
346         <bounds x="0" y="0.1" width="1" height="1"/>
347      </text>
348      <text string="Triple Bar" state="80">
349         <color red="1.0" green="1.0" blue="1.0"/>
350         <bounds x="0" y="0.1" width="1" height="1"/>
351      </text>
352      <text string="Cherry(2)" state="81">
353         <color red="1.0" green="1.0" blue="1.0"/>
354         <bounds x="0" y="0.1" width="1" height="1"/>
355      </text>
356      <text string="Cherry(2)" state="82">
357         <color red="1.0" green="1.0" blue="1.0"/>
358         <bounds x="0" y="0.1" width="1" height="1"/>
359      </text>
360      <text string="Cherry(2)" state="83">
361         <color red="1.0" green="1.0" blue="1.0"/>
362         <bounds x="0" y="0.1" width="1" height="1"/>
363      </text>
364      <text string="Cherry(2)" state="84">
365         <color red="1.0" green="1.0" blue="1.0"/>
366         <bounds x="0" y="0.1" width="1" height="1"/>
367      </text>
368      <text string="Cherry(2)" state="85">
369         <color red="1.0" green="1.0" blue="1.0"/>
370         <bounds x="0" y="0.1" width="1" height="1"/>
371      </text>
372      <text string="Cherry(2)" state="86">
373         <color red="1.0" green="1.0" blue="1.0"/>
374         <bounds x="0" y="0.1" width="1" height="1"/>
375      </text>
376      <text string="Red 7" state="87">
377         <color red="1.0" green="1.0" blue="1.0"/>
378         <bounds x="0" y="0.1" width="1" height="1"/>
379      </text>
380      <text string="Red 7" state="88">
381         <color red="1.0" green="1.0" blue="1.0"/>
382         <bounds x="0" y="0.1" width="1" height="1"/>
383      </text>
384      <text string="Red 7" state="89">
385         <color red="1.0" green="1.0" blue="1.0"/>
386         <bounds x="0" y="0.1" width="1" height="1"/>
387      </text>
388      <text string="Red 7" state="90">
389         <color red="1.0" green="1.0" blue="1.0"/>
390         <bounds x="0" y="0.1" width="1" height="1"/>
391      </text>
392      <text string="Red 7" state="91">
393         <color red="1.0" green="1.0" blue="1.0"/>
394         <bounds x="0" y="0.1" width="1" height="1"/>
395      </text>
396      <text string="Red 7" state="92">
397         <color red="1.0" green="1.0" blue="1.0"/>
398         <bounds x="0" y="0.1" width="1" height="1"/>
399      </text>
400      <text string="Cherry" state="93">
401         <color red="1.0" green="1.0" blue="1.0"/>
402         <bounds x="0" y="0.1" width="1" height="1"/>
403      </text>
404      <text string="Cherry" state="94">
405         <color red="1.0" green="1.0" blue="1.0"/>
406         <bounds x="0" y="0.1" width="1" height="1"/>
407      </text>
408      <text string="Cherry" state="95">
409         <color red="1.0" green="1.0" blue="1.0"/>
410         <bounds x="0" y="0.1" width="1" height="1"/>
411      </text>
22
23
24   <element name="SteppersReel1" defstate="0">
25   <reel stateoffset="-6826" symbollist="Double Bar:DW_DBar.png,Blue 7:DW_Blue7.png,Single Bar (K9):DW_SBar_K9.png,Cherry:DW_Cherry.png,Red 7:DW_Red7.png,Cherry (2):DW_Cherry_2.png,Triple Bar:DW_TBar.png,Double Bar:DW_DBar.png,Single Bar (2):DW_SBar_2.png,Cherry:DW_Cherry.png,Double Bar:DW_DBar.png,Blue 7:DW_Blue7.png,Triple Bar (1):DW_TBar_1.png,Single Bar:DW_SBar.png,Red 7:DW_Red7.png,Cherry (3):DW_Cherry_3.png" reelreversed="1">
26   <color red="1.0" green="1.0" blue="1.0" />
27   <bounds x="0" y="0" width="1" height="1" />
28   </reel>
41229   </element>
41330
414   <element name="Reel2" defstate="96">
415      <text string="Cherry" state="0">
416         <color red="1.0" green="1.0" blue="1.0"/>
417         <bounds x="0" y="0.1" width="1" height="1"/>
418      </text>
419      <text string="Cherry" state="1">
420         <color red="1.0" green="1.0" blue="1.0"/>
421         <bounds x="0" y="0.1" width="1" height="1"/>
422      </text>
423      <text string="Cherry" state="2">
424         <color red="1.0" green="1.0" blue="1.0"/>
425         <bounds x="0" y="0.1" width="1" height="1"/>
426      </text>
427      <text string="Single Bar(1)" state="3">
428         <color red="1.0" green="1.0" blue="1.0"/>
429         <bounds x="0" y="0.1" width="1" height="1"/>
430      </text>
431      <text string="Single Bar(1)" state="4">
432         <color red="1.0" green="1.0" blue="1.0"/>
433         <bounds x="0" y="0.1" width="1" height="1"/>
434      </text>
435      <text string="Single Bar(1)" state="5">
436         <color red="1.0" green="1.0" blue="1.0"/>
437         <bounds x="0" y="0.1" width="1" height="1"/>
438      </text>
439      <text string="Single Bar(1)" state="6">
440         <color red="1.0" green="1.0" blue="1.0"/>
441         <bounds x="0" y="0.1" width="1" height="1"/>
442      </text>
443      <text string="Single Bar(1)" state="7">
444         <color red="1.0" green="1.0" blue="1.0"/>
445         <bounds x="0" y="0.1" width="1" height="1"/>
446      </text>
447      <text string="Single Bar(1)" state="8">
448         <color red="1.0" green="1.0" blue="1.0"/>
449         <bounds x="0" y="0.1" width="1" height="1"/>
450      </text>
451      <text string="Triple Bar" state="9">
452         <color red="1.0" green="1.0" blue="1.0"/>
453         <bounds x="0" y="0.1" width="1" height="1"/>
454      </text>
455      <text string="Triple Bar" state="10">
456         <color red="1.0" green="1.0" blue="1.0"/>
457         <bounds x="0" y="0.1" width="1" height="1"/>
458      </text>
459      <text string="Triple Bar" state="11">
460         <color red="1.0" green="1.0" blue="1.0"/>
461         <bounds x="0" y="0.1" width="1" height="1"/>
462      </text>
463      <text string="Triple Bar" state="12">
464         <color red="1.0" green="1.0" blue="1.0"/>
465         <bounds x="0" y="0.1" width="1" height="1"/>
466      </text>
467      <text string="Triple Bar" state="13">
468         <color red="1.0" green="1.0" blue="1.0"/>
469         <bounds x="0" y="0.1" width="1" height="1"/>
470      </text>
471      <text string="Triple Bar" state="14">
472         <color red="1.0" green="1.0" blue="1.0"/>
473         <bounds x="0" y="0.1" width="1" height="1"/>
474      </text>
475      <text string="Double Bar" state="15">
476         <color red="1.0" green="1.0" blue="1.0"/>
477         <bounds x="0" y="0.1" width="1" height="1"/>
478      </text>
479      <text string="Double Bar" state="16">
480         <color red="1.0" green="1.0" blue="1.0"/>
481         <bounds x="0" y="0.1" width="1" height="1"/>
482      </text>
483      <text string="Double Bar" state="17">
484         <color red="1.0" green="1.0" blue="1.0"/>
485         <bounds x="0" y="0.1" width="1" height="1"/>
486      </text>
487      <text string="Double Bar" state="18">
488         <color red="1.0" green="1.0" blue="1.0"/>
489         <bounds x="0" y="0.1" width="1" height="1"/>
490      </text>
491      <text string="Double Bar" state="19">
492         <color red="1.0" green="1.0" blue="1.0"/>
493         <bounds x="0" y="0.1" width="1" height="1"/>
494      </text>
495      <text string="Double Bar" state="20">
496         <color red="1.0" green="1.0" blue="1.0"/>
497         <bounds x="0" y="0.1" width="1" height="1"/>
498      </text>
499      <text string="Cherry(2)" state="21">
500         <color red="1.0" green="1.0" blue="1.0"/>
501         <bounds x="0" y="0.1" width="1" height="1"/>
502      </text>
503      <text string="Cherry(2)" state="22">
504         <color red="1.0" green="1.0" blue="1.0"/>
505         <bounds x="0" y="0.1" width="1" height="1"/>
506      </text>
507      <text string="Cherry(2)" state="23">
508         <color red="1.0" green="1.0" blue="1.0"/>
509         <bounds x="0" y="0.1" width="1" height="1"/>
510      </text>
511      <text string="Cherry(2)" state="24">
512         <color red="1.0" green="1.0" blue="1.0"/>
513         <bounds x="0" y="0.1" width="1" height="1"/>
514      </text>
515      <text string="Cherry(2)" state="25">
516         <color red="1.0" green="1.0" blue="1.0"/>
517         <bounds x="0" y="0.1" width="1" height="1"/>
518      </text>
519      <text string="Cherry(2)" state="26">
520         <color red="1.0" green="1.0" blue="1.0"/>
521         <bounds x="0" y="0.1" width="1" height="1"/>
522      </text>
523      <text string="Blue 7" state="27">
524         <color red="1.0" green="1.0" blue="1.0"/>
525         <bounds x="0" y="0.1" width="1" height="1"/>
526      </text>
527      <text string="Blue 7" state="28">
528         <color red="1.0" green="1.0" blue="1.0"/>
529         <bounds x="0" y="0.1" width="1" height="1"/>
530      </text>
531      <text string="Blue 7" state="29">
532         <color red="1.0" green="1.0" blue="1.0"/>
533         <bounds x="0" y="0.1" width="1" height="1"/>
534      </text>
535      <text string="Blue 7" state="30">
536         <color red="1.0" green="1.0" blue="1.0"/>
537         <bounds x="0" y="0.1" width="1" height="1"/>
538      </text>
539      <text string="Blue 7" state="31">
540         <color red="1.0" green="1.0" blue="1.0"/>
541         <bounds x="0" y="0.1" width="1" height="1"/>
542      </text>
543      <text string="Blue 7" state="32">
544         <color red="1.0" green="1.0" blue="1.0"/>
545         <bounds x="0" y="0.1" width="1" height="1"/>
546      </text>
547      <text string="Single Bar" state="33">
548         <color red="1.0" green="1.0" blue="1.0"/>
549         <bounds x="0" y="0.1" width="1" height="1"/>
550      </text>
551      <text string="Single Bar" state="34">
552         <color red="1.0" green="1.0" blue="1.0"/>
553         <bounds x="0" y="0.1" width="1" height="1"/>
554      </text>
555      <text string="Single Bar" state="35">
556         <color red="1.0" green="1.0" blue="1.0"/>
557         <bounds x="0" y="0.1" width="1" height="1"/>
558      </text>
559      <text string="Single Bar" state="36">
560         <color red="1.0" green="1.0" blue="1.0"/>
561         <bounds x="0" y="0.1" width="1" height="1"/>
562      </text>
563      <text string="Single Bar" state="37">
564         <color red="1.0" green="1.0" blue="1.0"/>
565         <bounds x="0" y="0.1" width="1" height="1"/>
566      </text>
567      <text string="Single Bar" state="38">
568         <color red="1.0" green="1.0" blue="1.0"/>
569         <bounds x="0" y="0.1" width="1" height="1"/>
570      </text>
571      <text string="Triple Bar(1)" state="39">
572         <color red="1.0" green="1.0" blue="1.0"/>
573         <bounds x="0" y="0.1" width="1" height="1"/>
574      </text>
575      <text string="Triple Bar(1)" state="40">
576         <color red="1.0" green="1.0" blue="1.0"/>
577         <bounds x="0" y="0.1" width="1" height="1"/>
578      </text>
579      <text string="Triple Bar(1)" state="41">
580         <color red="1.0" green="1.0" blue="1.0"/>
581         <bounds x="0" y="0.1" width="1" height="1"/>
582      </text>
583      <text string="Triple Bar(1)" state="42">
584         <color red="1.0" green="1.0" blue="1.0"/>
585         <bounds x="0" y="0.1" width="1" height="1"/>
586      </text>
587      <text string="Triple Bar(1)" state="43">
588         <color red="1.0" green="1.0" blue="1.0"/>
589         <bounds x="0" y="0.1" width="1" height="1"/>
590      </text>
591      <text string="Triple Bar(1)" state="44">
592         <color red="1.0" green="1.0" blue="1.0"/>
593         <bounds x="0" y="0.1" width="1" height="1"/>
594      </text>
595      <text string="Blue 7" state="45">
596         <color red="1.0" green="1.0" blue="1.0"/>
597         <bounds x="0" y="0.1" width="1" height="1"/>
598      </text>
599      <text string="Blue 7" state="46">
600         <color red="1.0" green="1.0" blue="1.0"/>
601         <bounds x="0" y="0.1" width="1" height="1"/>
602      </text>
603      <text string="Blue 7" state="47">
604         <color red="1.0" green="1.0" blue="1.0"/>
605         <bounds x="0" y="0.1" width="1" height="1"/>
606      </text>
607      <text string="Blue 7" state="48">
608         <color red="1.0" green="1.0" blue="1.0"/>
609         <bounds x="0" y="0.1" width="1" height="1"/>
610      </text>
611      <text string="Blue 7" state="49">
612         <color red="1.0" green="1.0" blue="1.0"/>
613         <bounds x="0" y="0.1" width="1" height="1"/>
614      </text>
615      <text string="Blue 7" state="50">
616         <color red="1.0" green="1.0" blue="1.0"/>
617         <bounds x="0" y="0.1" width="1" height="1"/>
618      </text>
619      <text string="Double Bar" state="51">
620         <color red="1.0" green="1.0" blue="1.0"/>
621         <bounds x="0" y="0.1" width="1" height="1"/>
622      </text>
623      <text string="Double Bar" state="52">
624         <color red="1.0" green="1.0" blue="1.0"/>
625         <bounds x="0" y="0.1" width="1" height="1"/>
626      </text>
627      <text string="Double Bar" state="53">
628         <color red="1.0" green="1.0" blue="1.0"/>
629         <bounds x="0" y="0.1" width="1" height="1"/>
630      </text>
631      <text string="Double Bar" state="54">
632         <color red="1.0" green="1.0" blue="1.0"/>
633         <bounds x="0" y="0.1" width="1" height="1"/>
634      </text>
635      <text string="Double Bar" state="55">
636         <color red="1.0" green="1.0" blue="1.0"/>
637         <bounds x="0" y="0.1" width="1" height="1"/>
638      </text>
639      <text string="Double Bar" state="56">
640         <color red="1.0" green="1.0" blue="1.0"/>
641         <bounds x="0" y="0.1" width="1" height="1"/>
642      </text>
643      <text string="Cherry K9" state="57">
644         <color red="1.0" green="1.0" blue="1.0"/>
645         <bounds x="0" y="0.1" width="1" height="1"/>
646      </text>
647      <text string="Cherry K9" state="58">
648         <color red="1.0" green="1.0" blue="1.0"/>
649         <bounds x="0" y="0.1" width="1" height="1"/>
650      </text>
651      <text string="Cherry K9" state="59">
652         <color red="1.0" green="1.0" blue="1.0"/>
653         <bounds x="0" y="0.1" width="1" height="1"/>
654      </text>
655      <text string="Cherry K9" state="60">
656         <color red="1.0" green="1.0" blue="1.0"/>
657         <bounds x="0" y="0.1" width="1" height="1"/>
658      </text>
659      <text string="Cherry K9" state="61">
660         <color red="1.0" green="1.0" blue="1.0"/>
661         <bounds x="0" y="0.1" width="1" height="1"/>
662      </text>
663      <text string="Cherry K9" state="62">
664         <color red="1.0" green="1.0" blue="1.0"/>
665         <bounds x="0" y="0.1" width="1" height="1"/>
666      </text>
667      <text string="Single Bar" state="63">
668         <color red="1.0" green="1.0" blue="1.0"/>
669         <bounds x="0" y="0.1" width="1" height="1"/>
670      </text>
671      <text string="Single Bar" state="64">
672         <color red="1.0" green="1.0" blue="1.0"/>
673         <bounds x="0" y="0.1" width="1" height="1"/>
674      </text>
675      <text string="Single Bar" state="65">
676         <color red="1.0" green="1.0" blue="1.0"/>
677         <bounds x="0" y="0.1" width="1" height="1"/>
678      </text>
679      <text string="Single Bar" state="66">
680         <color red="1.0" green="1.0" blue="1.0"/>
681         <bounds x="0" y="0.1" width="1" height="1"/>
682      </text>
683      <text string="Single Bar" state="67">
684         <color red="1.0" green="1.0" blue="1.0"/>
685         <bounds x="0" y="0.1" width="1" height="1"/>
686      </text>
687      <text string="Single Bar" state="68">
688         <color red="1.0" green="1.0" blue="1.0"/>
689         <bounds x="0" y="0.1" width="1" height="1"/>
690      </text>
691      <text string="Double Bar(3)" state="69">
692         <color red="1.0" green="1.0" blue="1.0"/>
693         <bounds x="0" y="0.1" width="1" height="1"/>
694      </text>
695      <text string="Double Bar(3)" state="70">
696         <color red="1.0" green="1.0" blue="1.0"/>
697         <bounds x="0" y="0.1" width="1" height="1"/>
698      </text>
699      <text string="Double Bar(3)" state="71">
700         <color red="1.0" green="1.0" blue="1.0"/>
701         <bounds x="0" y="0.1" width="1" height="1"/>
702      </text>
703      <text string="Double Bar(3)" state="72">
704         <color red="1.0" green="1.0" blue="1.0"/>
705         <bounds x="0" y="0.1" width="1" height="1"/>
706      </text>
707      <text string="Double Bar(3)" state="73">
708         <color red="1.0" green="1.0" blue="1.0"/>
709         <bounds x="0" y="0.1" width="1" height="1"/>
710      </text>
711      <text string="Double Bar(3)" state="74">
712         <color red="1.0" green="1.0" blue="1.0"/>
713         <bounds x="0" y="0.1" width="1" height="1"/>
714      </text>
715      <text string="Triple Bar" state="75">
716         <color red="1.0" green="1.0" blue="1.0"/>
717         <bounds x="0" y="0.1" width="1" height="1"/>
718      </text>
719      <text string="Triple Bar" state="76">
720         <color red="1.0" green="1.0" blue="1.0"/>
721         <bounds x="0" y="0.1" width="1" height="1"/>
722      </text>
723      <text string="Triple Bar" state="77">
724         <color red="1.0" green="1.0" blue="1.0"/>
725         <bounds x="0" y="0.1" width="1" height="1"/>
726      </text>
727      <text string="Triple Bar" state="78">
728         <color red="1.0" green="1.0" blue="1.0"/>
729         <bounds x="0" y="0.1" width="1" height="1"/>
730      </text>
731      <text string="Triple Bar" state="79">
732         <color red="1.0" green="1.0" blue="1.0"/>
733         <bounds x="0" y="0.1" width="1" height="1"/>
734      </text>
735      <text string="Triple Bar" state="80">
736         <color red="1.0" green="1.0" blue="1.0"/>
737         <bounds x="0" y="0.1" width="1" height="1"/>
738      </text>
739      <text string="Single Bar" state="81">
740         <color red="1.0" green="1.0" blue="1.0"/>
741         <bounds x="0" y="0.1" width="1" height="1"/>
742      </text>
743      <text string="Single Bar" state="82">
744         <color red="1.0" green="1.0" blue="1.0"/>
745         <bounds x="0" y="0.1" width="1" height="1"/>
746      </text>
747      <text string="Single Bar" state="83">
748         <color red="1.0" green="1.0" blue="1.0"/>
749         <bounds x="0" y="0.1" width="1" height="1"/>
750      </text>
751      <text string="Single Bar" state="84">
752         <color red="1.0" green="1.0" blue="1.0"/>
753         <bounds x="0" y="0.1" width="1" height="1"/>
754      </text>
755      <text string="Single Bar" state="85">
756         <color red="1.0" green="1.0" blue="1.0"/>
757         <bounds x="0" y="0.1" width="1" height="1"/>
758      </text>
759      <text string="Single Bar" state="86">
760         <color red="1.0" green="1.0" blue="1.0"/>
761         <bounds x="0" y="0.1" width="1" height="1"/>
762      </text>
763      <text string="Red 7" state="87">
764         <color red="1.0" green="1.0" blue="1.0"/>
765         <bounds x="0" y="0.1" width="1" height="1"/>
766      </text>
767      <text string="Red 7" state="88">
768         <color red="1.0" green="1.0" blue="1.0"/>
769         <bounds x="0" y="0.1" width="1" height="1"/>
770      </text>
771      <text string="Red 7" state="89">
772         <color red="1.0" green="1.0" blue="1.0"/>
773         <bounds x="0" y="0.1" width="1" height="1"/>
774      </text>
775      <text string="Red 7" state="90">
776         <color red="1.0" green="1.0" blue="1.0"/>
777         <bounds x="0" y="0.1" width="1" height="1"/>
778      </text>
779      <text string="Red 7" state="91">
780         <color red="1.0" green="1.0" blue="1.0"/>
781         <bounds x="0" y="0.1" width="1" height="1"/>
782      </text>
783      <text string="Red 7" state="92">
784         <color red="1.0" green="1.0" blue="1.0"/>
785         <bounds x="0" y="0.1" width="1" height="1"/>
786      </text>
787      <text string="Cherry" state="93">
788         <color red="1.0" green="1.0" blue="1.0"/>
789         <bounds x="0" y="0.1" width="1" height="1"/>
790      </text>
791      <text string="Cherry" state="94">
792         <color red="1.0" green="1.0" blue="1.0"/>
793         <bounds x="0" y="0.1" width="1" height="1"/>
794      </text>
795      <text string="Cherry" state="95">
796         <color red="1.0" green="1.0" blue="1.0"/>
797         <bounds x="0" y="0.1" width="1" height="1"/>
798      </text>
31   <element name="SteppersReel2" defstate="0">
32   <reel stateoffset="-6826" symbollist="Double Bar:DW_DBar.png,Triple Bar:DW_TBar.png,Single Bar (1):DW_Sbar_1.png,Cherry:DW_Cherry.png,Red 7:DW_Red7.png,Single Bar:DW_Sbar.png,Triple Bar:DW_TBar.png,Double Bar (3):DW_DBar_3.png,Single Bar:DW_Sbar.png,Cherry (K9):DW_Cherry_K9.png,Double Bar:DW_DBar.png,Blue 7:DW_Blue7.png,Triple Bar (1):DW_TBar_1.png,Single Bar:DW_Sbar.png,Blue 7:DW_Blue7.png,Cherry (2):DW_Cherry_2.png"  reelreversed="1">
33   <color red="1.0" green="1.0" blue="1.0" />
34   <bounds x="0" y="0" width="1" height="1" />
35   </reel>
79936   </element>
80037
801   <element name="Reel3" defstate="96">
802      <text string="Cherry(2)" state="0">
803         <color red="1.0" green="1.0" blue="1.0"/>
804         <bounds x="0" y="0.1" width="1" height="1"/>
805      </text>
806      <text string="Cherry(2)" state="1">
807         <color red="1.0" green="1.0" blue="1.0"/>
808         <bounds x="0" y="0.1" width="1" height="1"/>
809      </text>
810      <text string="Cherry(2)" state="2">
811         <color red="1.0" green="1.0" blue="1.0"/>
812         <bounds x="0" y="0.1" width="1" height="1"/>
813      </text>
814      <text string="Single Bar" state="3">
815         <color red="1.0" green="1.0" blue="1.0"/>
816         <bounds x="0" y="0.1" width="1" height="1"/>
817      </text>
818      <text string="Single Bar" state="4">
819         <color red="1.0" green="1.0" blue="1.0"/>
820         <bounds x="0" y="0.1" width="1" height="1"/>
821      </text>
822      <text string="Single Bar" state="5">
823         <color red="1.0" green="1.0" blue="1.0"/>
824         <bounds x="0" y="0.1" width="1" height="1"/>
825      </text>
826      <text string="Single Bar" state="6">
827         <color red="1.0" green="1.0" blue="1.0"/>
828         <bounds x="0" y="0.1" width="1" height="1"/>
829      </text>
830      <text string="Single Bar" state="7">
831         <color red="1.0" green="1.0" blue="1.0"/>
832         <bounds x="0" y="0.1" width="1" height="1"/>
833      </text>
834      <text string="Single Bar" state="8">
835         <color red="1.0" green="1.0" blue="1.0"/>
836         <bounds x="0" y="0.1" width="1" height="1"/>
837      </text>
838      <text string="Blue 7" state="9">
839         <color red="1.0" green="1.0" blue="1.0"/>
840         <bounds x="0" y="0.1" width="1" height="1"/>
841      </text>
842      <text string="Blue 7" state="10">
843         <color red="1.0" green="1.0" blue="1.0"/>
844         <bounds x="0" y="0.1" width="1" height="1"/>
845      </text>
846      <text string="Blue 7" state="11">
847         <color red="1.0" green="1.0" blue="1.0"/>
848         <bounds x="0" y="0.1" width="1" height="1"/>
849      </text>
850      <text string="Blue 7" state="12">
851         <color red="1.0" green="1.0" blue="1.0"/>
852         <bounds x="0" y="0.1" width="1" height="1"/>
853      </text>
854      <text string="Blue 7" state="13">
855         <color red="1.0" green="1.0" blue="1.0"/>
856         <bounds x="0" y="0.1" width="1" height="1"/>
857      </text>
858      <text string="Blue 7" state="14">
859         <color red="1.0" green="1.0" blue="1.0"/>
860         <bounds x="0" y="0.1" width="1" height="1"/>
861      </text>
862      <text string="Double Bar(3)" state="15">
863         <color red="1.0" green="1.0" blue="1.0"/>
864         <bounds x="0" y="0.1" width="1" height="1"/>
865      </text>
866      <text string="Double Bar(3)" state="16">
867         <color red="1.0" green="1.0" blue="1.0"/>
868         <bounds x="0" y="0.1" width="1" height="1"/>
869      </text>
870      <text string="Double Bar(3)" state="17">
871         <color red="1.0" green="1.0" blue="1.0"/>
872         <bounds x="0" y="0.1" width="1" height="1"/>
873      </text>
874      <text string="Double Bar(3)" state="18">
875         <color red="1.0" green="1.0" blue="1.0"/>
876         <bounds x="0" y="0.1" width="1" height="1"/>
877      </text>
878      <text string="Double Bar(3)" state="19">
879         <color red="1.0" green="1.0" blue="1.0"/>
880         <bounds x="0" y="0.1" width="1" height="1"/>
881      </text>
882      <text string="Double Bar(3)" state="20">
883         <color red="1.0" green="1.0" blue="1.0"/>
884         <bounds x="0" y="0.1" width="1" height="1"/>
885      </text>
886      <text string="Cherry" state="21">
887         <color red="1.0" green="1.0" blue="1.0"/>
888         <bounds x="0" y="0.1" width="1" height="1"/>
889      </text>
890      <text string="Cherry" state="22">
891         <color red="1.0" green="1.0" blue="1.0"/>
892         <bounds x="0" y="0.1" width="1" height="1"/>
893      </text>
894      <text string="Cherry" state="23">
895         <color red="1.0" green="1.0" blue="1.0"/>
896         <bounds x="0" y="0.1" width="1" height="1"/>
897      </text>
898      <text string="Cherry" state="24">
899         <color red="1.0" green="1.0" blue="1.0"/>
900         <bounds x="0" y="0.1" width="1" height="1"/>
901      </text>
902      <text string="Cherry" state="25">
903         <color red="1.0" green="1.0" blue="1.0"/>
904         <bounds x="0" y="0.1" width="1" height="1"/>
905      </text>
906      <text string="Cherry" state="26">
907         <color red="1.0" green="1.0" blue="1.0"/>
908         <bounds x="0" y="0.1" width="1" height="1"/>
909      </text>
910      <text string="Red 7" state="27">
911         <color red="1.0" green="1.0" blue="1.0"/>
912         <bounds x="0" y="0.1" width="1" height="1"/>
913      </text>
914      <text string="Red 7" state="28">
915         <color red="1.0" green="1.0" blue="1.0"/>
916         <bounds x="0" y="0.1" width="1" height="1"/>
917      </text>
918      <text string="Red 7" state="29">
919         <color red="1.0" green="1.0" blue="1.0"/>
920         <bounds x="0" y="0.1" width="1" height="1"/>
921      </text>
922      <text string="Red 7" state="30">
923         <color red="1.0" green="1.0" blue="1.0"/>
924         <bounds x="0" y="0.1" width="1" height="1"/>
925      </text>
926      <text string="Red 7" state="31">
927         <color red="1.0" green="1.0" blue="1.0"/>
928         <bounds x="0" y="0.1" width="1" height="1"/>
929      </text>
930      <text string="Red 7" state="32">
931         <color red="1.0" green="1.0" blue="1.0"/>
932         <bounds x="0" y="0.1" width="1" height="1"/>
933      </text>
934      <text string="Single Bar(1)" state="33">
935         <color red="1.0" green="1.0" blue="1.0"/>
936         <bounds x="0" y="0.1" width="1" height="1"/>
937      </text>
938      <text string="Single Bar(1)" state="34">
939         <color red="1.0" green="1.0" blue="1.0"/>
940         <bounds x="0" y="0.1" width="1" height="1"/>
941      </text>
942      <text string="Single Bar(1)" state="35">
943         <color red="1.0" green="1.0" blue="1.0"/>
944         <bounds x="0" y="0.1" width="1" height="1"/>
945      </text>
946      <text string="Single Bar(1)" state="36">
947         <color red="1.0" green="1.0" blue="1.0"/>
948         <bounds x="0" y="0.1" width="1" height="1"/>
949      </text>
950      <text string="Single Bar(1)" state="37">
951         <color red="1.0" green="1.0" blue="1.0"/>
952         <bounds x="0" y="0.1" width="1" height="1"/>
953      </text>
954      <text string="Single Bar(1)" state="38">
955         <color red="1.0" green="1.0" blue="1.0"/>
956         <bounds x="0" y="0.1" width="1" height="1"/>
957      </text>
958      <text string="Triple Bar" state="39">
959         <color red="1.0" green="1.0" blue="1.0"/>
960         <bounds x="0" y="0.1" width="1" height="1"/>
961      </text>
962      <text string="Triple Bar" state="40">
963         <color red="1.0" green="1.0" blue="1.0"/>
964         <bounds x="0" y="0.1" width="1" height="1"/>
965      </text>
966      <text string="Triple Bar" state="41">
967         <color red="1.0" green="1.0" blue="1.0"/>
968         <bounds x="0" y="0.1" width="1" height="1"/>
969      </text>
970      <text string="Triple Bar" state="42">
971         <color red="1.0" green="1.0" blue="1.0"/>
972         <bounds x="0" y="0.1" width="1" height="1"/>
973      </text>
974      <text string="Triple Bar" state="43">
975         <color red="1.0" green="1.0" blue="1.0"/>
976         <bounds x="0" y="0.1" width="1" height="1"/>
977      </text>
978      <text string="Triple Bar" state="44">
979         <color red="1.0" green="1.0" blue="1.0"/>
980         <bounds x="0" y="0.1" width="1" height="1"/>
981      </text>
982      <text string="Blue 7" state="45">
983         <color red="1.0" green="1.0" blue="1.0"/>
984         <bounds x="0" y="0.1" width="1" height="1"/>
985      </text>
986      <text string="Blue 7" state="46">
987         <color red="1.0" green="1.0" blue="1.0"/>
988         <bounds x="0" y="0.1" width="1" height="1"/>
989      </text>
990      <text string="Blue 7" state="47">
991         <color red="1.0" green="1.0" blue="1.0"/>
992         <bounds x="0" y="0.1" width="1" height="1"/>
993      </text>
994      <text string="Blue 7" state="48">
995         <color red="1.0" green="1.0" blue="1.0"/>
996         <bounds x="0" y="0.1" width="1" height="1"/>
997      </text>
998      <text string="Blue 7" state="49">
999         <color red="1.0" green="1.0" blue="1.0"/>
1000         <bounds x="0" y="0.1" width="1" height="1"/>
1001      </text>
1002      <text string="Blue 7" state="50">
1003         <color red="1.0" green="1.0" blue="1.0"/>
1004         <bounds x="0" y="0.1" width="1" height="1"/>
1005      </text>
1006      <text string="Double Bar(2)" state="51">
1007         <color red="1.0" green="1.0" blue="1.0"/>
1008         <bounds x="0" y="0.1" width="1" height="1"/>
1009      </text>
1010      <text string="Double Bar(2)" state="52">
1011         <color red="1.0" green="1.0" blue="1.0"/>
1012         <bounds x="0" y="0.1" width="1" height="1"/>
1013      </text>
1014      <text string="Double Bar(2)" state="53">
1015         <color red="1.0" green="1.0" blue="1.0"/>
1016         <bounds x="0" y="0.1" width="1" height="1"/>
1017      </text>
1018      <text string="Double Bar(2)" state="54">
1019         <color red="1.0" green="1.0" blue="1.0"/>
1020         <bounds x="0" y="0.1" width="1" height="1"/>
1021      </text>
1022      <text string="Double Bar(2)" state="55">
1023         <color red="1.0" green="1.0" blue="1.0"/>
1024         <bounds x="0" y="0.1" width="1" height="1"/>
1025      </text>
1026      <text string="Double Bar(2)" state="56">
1027         <color red="1.0" green="1.0" blue="1.0"/>
1028         <bounds x="0" y="0.1" width="1" height="1"/>
1029      </text>
1030      <text string="Cherry" state="57">
1031         <color red="1.0" green="1.0" blue="1.0"/>
1032         <bounds x="0" y="0.1" width="1" height="1"/>
1033      </text>
1034      <text string="Cherry" state="58">
1035         <color red="1.0" green="1.0" blue="1.0"/>
1036         <bounds x="0" y="0.1" width="1" height="1"/>
1037      </text>
1038      <text string="Cherry" state="59">
1039         <color red="1.0" green="1.0" blue="1.0"/>
1040         <bounds x="0" y="0.1" width="1" height="1"/>
1041      </text>
1042      <text string="Cherry" state="60">
1043         <color red="1.0" green="1.0" blue="1.0"/>
1044         <bounds x="0" y="0.1" width="1" height="1"/>
1045      </text>
1046      <text string="Cherry" state="61">
1047         <color red="1.0" green="1.0" blue="1.0"/>
1048         <bounds x="0" y="0.1" width="1" height="1"/>
1049      </text>
1050      <text string="Cherry" state="62">
1051         <color red="1.0" green="1.0" blue="1.0"/>
1052         <bounds x="0" y="0.1" width="1" height="1"/>
1053      </text>
1054      <text string="Single Bar" state="63">
1055         <color red="1.0" green="1.0" blue="1.0"/>
1056         <bounds x="0" y="0.1" width="1" height="1"/>
1057      </text>
1058      <text string="Single Bar" state="64">
1059         <color red="1.0" green="1.0" blue="1.0"/>
1060         <bounds x="0" y="0.1" width="1" height="1"/>
1061      </text>
1062      <text string="Single Bar" state="65">
1063         <color red="1.0" green="1.0" blue="1.0"/>
1064         <bounds x="0" y="0.1" width="1" height="1"/>
1065      </text>
1066      <text string="Single Bar" state="66">
1067         <color red="1.0" green="1.0" blue="1.0"/>
1068         <bounds x="0" y="0.1" width="1" height="1"/>
1069      </text>
1070      <text string="Single Bar" state="67">
1071         <color red="1.0" green="1.0" blue="1.0"/>
1072         <bounds x="0" y="0.1" width="1" height="1"/>
1073      </text>
1074      <text string="Single Bar" state="68">
1075         <color red="1.0" green="1.0" blue="1.0"/>
1076         <bounds x="0" y="0.1" width="1" height="1"/>
1077      </text>
1078      <text string="Double Bar(1)" state="69">
1079         <color red="1.0" green="1.0" blue="1.0"/>
1080         <bounds x="0" y="0.1" width="1" height="1"/>
1081      </text>
1082      <text string="Double Bar(1)" state="70">
1083         <color red="1.0" green="1.0" blue="1.0"/>
1084         <bounds x="0" y="0.1" width="1" height="1"/>
1085      </text>
1086      <text string="Double Bar(1)" state="71">
1087         <color red="1.0" green="1.0" blue="1.0"/>
1088         <bounds x="0" y="0.1" width="1" height="1"/>
1089      </text>
1090      <text string="Double Bar(1)" state="72">
1091         <color red="1.0" green="1.0" blue="1.0"/>
1092         <bounds x="0" y="0.1" width="1" height="1"/>
1093      </text>
1094      <text string="Double Bar(1)" state="73">
1095         <color red="1.0" green="1.0" blue="1.0"/>
1096         <bounds x="0" y="0.1" width="1" height="1"/>
1097      </text>
1098      <text string="Double Bar(1)" state="74">
1099         <color red="1.0" green="1.0" blue="1.0"/>
1100         <bounds x="0" y="0.1" width="1" height="1"/>
1101      </text>
1102      <text string="Triple Bar" state="75">
1103         <color red="1.0" green="1.0" blue="1.0"/>
1104         <bounds x="0" y="0.1" width="1" height="1"/>
1105      </text>
1106      <text string="Triple Bar" state="76">
1107         <color red="1.0" green="1.0" blue="1.0"/>
1108         <bounds x="0" y="0.1" width="1" height="1"/>
1109      </text>
1110      <text string="Triple Bar" state="77">
1111         <color red="1.0" green="1.0" blue="1.0"/>
1112         <bounds x="0" y="0.1" width="1" height="1"/>
1113      </text>
1114      <text string="Triple Bar" state="78">
1115         <color red="1.0" green="1.0" blue="1.0"/>
1116         <bounds x="0" y="0.1" width="1" height="1"/>
1117      </text>
1118      <text string="Triple Bar" state="79">
1119         <color red="1.0" green="1.0" blue="1.0"/>
1120         <bounds x="0" y="0.1" width="1" height="1"/>
1121      </text>
1122      <text string="Triple Bar" state="80">
1123         <color red="1.0" green="1.0" blue="1.0"/>
1124         <bounds x="0" y="0.1" width="1" height="1"/>
1125      </text>
1126      <text string="Cherry" state="81">
1127         <color red="1.0" green="1.0" blue="1.0"/>
1128         <bounds x="0" y="0.1" width="1" height="1"/>
1129      </text>
1130      <text string="Cherry" state="82">
1131         <color red="1.0" green="1.0" blue="1.0"/>
1132         <bounds x="0" y="0.1" width="1" height="1"/>
1133      </text>
1134      <text string="Cherry" state="83">
1135         <color red="1.0" green="1.0" blue="1.0"/>
1136         <bounds x="0" y="0.1" width="1" height="1"/>
1137      </text>
1138      <text string="Cherry" state="84">
1139         <color red="1.0" green="1.0" blue="1.0"/>
1140         <bounds x="0" y="0.1" width="1" height="1"/>
1141      </text>
1142      <text string="Cherry" state="85">
1143         <color red="1.0" green="1.0" blue="1.0"/>
1144         <bounds x="0" y="0.1" width="1" height="1"/>
1145      </text>
1146      <text string="Cherry" state="86">
1147         <color red="1.0" green="1.0" blue="1.0"/>
1148         <bounds x="0" y="0.1" width="1" height="1"/>
1149      </text>
1150      <text string="Red 7" state="87">
1151         <color red="1.0" green="1.0" blue="1.0"/>
1152         <bounds x="0" y="0.1" width="1" height="1"/>
1153      </text>
1154      <text string="Red 7" state="88">
1155         <color red="1.0" green="1.0" blue="1.0"/>
1156         <bounds x="0" y="0.1" width="1" height="1"/>
1157      </text>
1158      <text string="Red 7" state="89">
1159         <color red="1.0" green="1.0" blue="1.0"/>
1160         <bounds x="0" y="0.1" width="1" height="1"/>
1161      </text>
1162      <text string="Red 7" state="90">
1163         <color red="1.0" green="1.0" blue="1.0"/>
1164         <bounds x="0" y="0.1" width="1" height="1"/>
1165      </text>
1166      <text string="Red 7" state="91">
1167         <color red="1.0" green="1.0" blue="1.0"/>
1168         <bounds x="0" y="0.1" width="1" height="1"/>
1169      </text>
1170      <text string="Red 7" state="92">
1171         <color red="1.0" green="1.0" blue="1.0"/>
1172         <bounds x="0" y="0.1" width="1" height="1"/>
1173      </text>
1174      <text string="Cherry(2)" state="93">
1175         <color red="1.0" green="1.0" blue="1.0"/>
1176         <bounds x="0" y="0.1" width="1" height="1"/>
1177      </text>
1178      <text string="Cherry(2)" state="94">
1179         <color red="1.0" green="1.0" blue="1.0"/>
1180         <bounds x="0" y="0.1" width="1" height="1"/>
1181      </text>
1182      <text string="Cherry(2)" state="95">
1183         <color red="1.0" green="1.0" blue="1.0"/>
1184         <bounds x="0" y="0.1" width="1" height="1"/>
1185      </text>
38   <element name="SteppersReel3" defstate="0">
39   <reel stateoffset="-6826" symbollist="Double Bar (3):DW_DBar_3.png,Blue 7:DW_Blue7.png,Single Bar:DW_SBar.png,Cherry (2):DW_Cherry_2.png,Red 7:DW_Red7.png,Cherry:DW_Cherry.png,Triple Bar:DW_TBar.png,Double Bar (1):DW_DBar_1.png,Single Bar:DW_SBar.png,Cherry:DW_Cherry.png,Double Bar (2):DW_DBar_2.png,Blue 7:DW_Blue7.png,Triple Bar:DW_TBar.png,Single Bar (1):DW_SBar_1.png,Red 7:DW_Red7.png,Cherry:DW_Cherry.png"  reelreversed="1">
40   <color red="1.0" green="1.0" blue="1.0" />
41   <bounds x="0" y="0" width="1" height="1" />
42   </reel>
118643   </element>
118744
1188   <element name="Reel4" defstate="96">
1189      <text string="4  3" state="0">
1190         <color red="1.0" green="1.0" blue="1.0"/>
1191         <bounds x="0" y="0.1" width="1" height="1"/>
1192      </text>
1193      <text string="4  3" state="1">
1194         <color red="1.0" green="1.0" blue="1.0"/>
1195         <bounds x="0" y="0.1" width="1" height="1"/>
1196      </text>
1197      <text string="4  3" state="2">
1198         <color red="1.0" green="1.0" blue="1.0"/>
1199         <bounds x="0" y="0.1" width="1" height="1"/>
1200      </text>
1201      <text string="4  3" state="3">
1202         <color red="1.0" green="1.0" blue="1.0"/>
1203         <bounds x="0" y="0.1" width="1" height="1"/>
1204      </text>
1205      <text string="4" state="4">
1206         <color red="1.0" green="1.0" blue="1.0"/>
1207         <bounds x="0" y="0.1" width="1" height="1"/>
1208      </text>
1209      <text string="4" state="5">
1210         <color red="1.0" green="1.0" blue="1.0"/>
1211         <bounds x="0" y="0.1" width="1" height="1"/>
1212      </text>
1213      <text string="4" state="6">
1214         <color red="1.0" green="1.0" blue="1.0"/>
1215         <bounds x="0" y="0.1" width="1" height="1"/>
1216      </text>
1217      <text string="4" state="7">
1218         <color red="1.0" green="1.0" blue="1.0"/>
1219         <bounds x="0" y="0.1" width="1" height="1"/>
1220      </text>
1221      <text string="5  4" state="8">
1222         <color red="1.0" green="1.0" blue="1.0"/>
1223         <bounds x="0" y="0.1" width="1" height="1"/>
1224      </text>
1225      <text string="5  4" state="9">
1226         <color red="1.0" green="1.0" blue="1.0"/>
1227         <bounds x="0" y="0.1" width="1" height="1"/>
1228      </text>
1229      <text string="5  4" state="10">
1230         <color red="1.0" green="1.0" blue="1.0"/>
1231         <bounds x="0" y="0.1" width="1" height="1"/>
1232      </text>
1233      <text string="5  4" state="11">
1234         <color red="1.0" green="1.0" blue="1.0"/>
1235         <bounds x="0" y="0.1" width="1" height="1"/>
1236      </text>
1237      <text string="5" state="12">
1238         <color red="1.0" green="1.0" blue="1.0"/>
1239         <bounds x="0" y="0.1" width="1" height="1"/>
1240      </text>
1241      <text string="5" state="13">
1242         <color red="1.0" green="1.0" blue="1.0"/>
1243         <bounds x="0" y="0.1" width="1" height="1"/>
1244      </text>
1245      <text string="5" state="14">
1246         <color red="1.0" green="1.0" blue="1.0"/>
1247         <bounds x="0" y="0.1" width="1" height="1"/>
1248      </text>
1249      <text string="5" state="15">
1250         <color red="1.0" green="1.0" blue="1.0"/>
1251         <bounds x="0" y="0.1" width="1" height="1"/>
1252      </text>
1253      <text string="6  5" state="16">
1254         <color red="1.0" green="1.0" blue="1.0"/>
1255         <bounds x="0" y="0.1" width="1" height="1"/>
1256      </text>
1257      <text string="6  5" state="17">
1258         <color red="1.0" green="1.0" blue="1.0"/>
1259         <bounds x="0" y="0.1" width="1" height="1"/>
1260      </text>
1261      <text string="6  5" state="18">
1262         <color red="1.0" green="1.0" blue="1.0"/>
1263         <bounds x="0" y="0.1" width="1" height="1"/>
1264      </text>
1265      <text string="6  5" state="19">
1266         <color red="1.0" green="1.0" blue="1.0"/>
1267         <bounds x="0" y="0.1" width="1" height="1"/>
1268      </text>
1269      <text string="6" state="20">
1270         <color red="1.0" green="1.0" blue="1.0"/>
1271         <bounds x="0" y="0.1" width="1" height="1"/>
1272      </text>
1273      <text string="6" state="21">
1274         <color red="1.0" green="1.0" blue="1.0"/>
1275         <bounds x="0" y="0.1" width="1" height="1"/>
1276      </text>
1277      <text string="6" state="22">
1278         <color red="1.0" green="1.0" blue="1.0"/>
1279         <bounds x="0" y="0.1" width="1" height="1"/>
1280      </text>
1281      <text string="6" state="23">
1282         <color red="1.0" green="1.0" blue="1.0"/>
1283         <bounds x="0" y="0.1" width="1" height="1"/>
1284      </text>
1285      <text string="1  6" state="24">
1286         <color red="1.0" green="1.0" blue="1.0"/>
1287         <bounds x="0" y="0.1" width="1" height="1"/>
1288      </text>
1289      <text string="1  6" state="25">
1290         <color red="1.0" green="1.0" blue="1.0"/>
1291         <bounds x="0" y="0.1" width="1" height="1"/>
1292      </text>
1293      <text string="1  6" state="26">
1294         <color red="1.0" green="1.0" blue="1.0"/>
1295         <bounds x="0" y="0.1" width="1" height="1"/>
1296      </text>
1297      <text string="1  6" state="27">
1298         <color red="1.0" green="1.0" blue="1.0"/>
1299         <bounds x="0" y="0.1" width="1" height="1"/>
1300      </text>
1301      <text string="1" state="28">
1302         <color red="1.0" green="1.0" blue="1.0"/>
1303         <bounds x="0" y="0.1" width="1" height="1"/>
1304      </text>
1305      <text string="1" state="29">
1306         <color red="1.0" green="1.0" blue="1.0"/>
1307         <bounds x="0" y="0.1" width="1" height="1"/>
1308      </text>
1309      <text string="1" state="30">
1310         <color red="1.0" green="1.0" blue="1.0"/>
1311         <bounds x="0" y="0.1" width="1" height="1"/>
1312      </text>
1313      <text string="1" state="31">
1314         <color red="1.0" green="1.0" blue="1.0"/>
1315         <bounds x="0" y="0.1" width="1" height="1"/>
1316      </text>
1317      <text string="2  1" state="32">
1318         <color red="1.0" green="1.0" blue="1.0"/>
1319         <bounds x="0" y="0.1" width="1" height="1"/>
1320      </text>
1321      <text string="2  1" state="33">
1322         <color red="1.0" green="1.0" blue="1.0"/>
1323         <bounds x="0" y="0.1" width="1" height="1"/>
1324      </text>
1325      <text string="2  1" state="34">
1326         <color red="1.0" green="1.0" blue="1.0"/>
1327         <bounds x="0" y="0.1" width="1" height="1"/>
1328      </text>
1329      <text string="2  1" state="35">
1330         <color red="1.0" green="1.0" blue="1.0"/>
1331         <bounds x="0" y="0.1" width="1" height="1"/>
1332      </text>
1333      <text string="2" state="36">
1334         <color red="1.0" green="1.0" blue="1.0"/>
1335         <bounds x="0" y="0.1" width="1" height="1"/>
1336      </text>
1337      <text string="2" state="37">
1338         <color red="1.0" green="1.0" blue="1.0"/>
1339         <bounds x="0" y="0.1" width="1" height="1"/>
1340      </text>
1341      <text string="2" state="38">
1342         <color red="1.0" green="1.0" blue="1.0"/>
1343         <bounds x="0" y="0.1" width="1" height="1"/>
1344      </text>
1345      <text string="2" state="39">
1346         <color red="1.0" green="1.0" blue="1.0"/>
1347         <bounds x="0" y="0.1" width="1" height="1"/>
1348      </text>
1349      <text string="3  1" state="40">
1350         <color red="1.0" green="1.0" blue="1.0"/>
1351         <bounds x="0" y="0.1" width="1" height="1"/>
1352      </text>
1353      <text string="3  1" state="41">
1354         <color red="1.0" green="1.0" blue="1.0"/>
1355         <bounds x="0" y="0.1" width="1" height="1"/>
1356      </text>
1357      <text string="3  1" state="42">
1358         <color red="1.0" green="1.0" blue="1.0"/>
1359         <bounds x="0" y="0.1" width="1" height="1"/>
1360      </text>
1361      <text string="3  1" state="43">
1362         <color red="1.0" green="1.0" blue="1.0"/>
1363         <bounds x="0" y="0.1" width="1" height="1"/>
1364      </text>
1365      <text string="3" state="44">
1366         <color red="1.0" green="1.0" blue="1.0"/>
1367         <bounds x="0" y="0.1" width="1" height="1"/>
1368      </text>
1369      <text string="3" state="45">
1370         <color red="1.0" green="1.0" blue="1.0"/>
1371         <bounds x="0" y="0.1" width="1" height="1"/>
1372      </text>
1373      <text string="3" state="46">
1374         <color red="1.0" green="1.0" blue="1.0"/>
1375         <bounds x="0" y="0.1" width="1" height="1"/>
1376      </text>
1377      <text string="3" state="47">
1378         <color red="1.0" green="1.0" blue="1.0"/>
1379         <bounds x="0" y="0.1" width="1" height="1"/>
1380      </text>
1381      <text string="4  3" state="48">
1382         <color red="1.0" green="1.0" blue="1.0"/>
1383         <bounds x="0" y="0.1" width="1" height="1"/>
1384      </text>
1385      <text string="4  3" state="49">
1386         <color red="1.0" green="1.0" blue="1.0"/>
1387         <bounds x="0" y="0.1" width="1" height="1"/>
1388      </text>
1389      <text string="4  3" state="50">
1390         <color red="1.0" green="1.0" blue="1.0"/>
1391         <bounds x="0" y="0.1" width="1" height="1"/>
1392      </text>
1393      <text string="4  3" state="51">
1394         <color red="1.0" green="1.0" blue="1.0"/>
1395         <bounds x="0" y="0.1" width="1" height="1"/>
1396      </text>
1397      <text string="4" state="52">
1398         <color red="1.0" green="1.0" blue="1.0"/>
1399         <bounds x="0" y="0.1" width="1" height="1"/>
1400      </text>
1401      <text string="4" state="53">
1402         <color red="1.0" green="1.0" blue="1.0"/>
1403         <bounds x="0" y="0.1" width="1" height="1"/>
1404      </text>
1405      <text string="4" state="54">
1406         <color red="1.0" green="1.0" blue="1.0"/>
1407         <bounds x="0" y="0.1" width="1" height="1"/>
1408      </text>
1409      <text string="4" state="55">
1410         <color red="1.0" green="1.0" blue="1.0"/>
1411         <bounds x="0" y="0.1" width="1" height="1"/>
1412      </text>
1413      <text string="5  4" state="56">
1414         <color red="1.0" green="1.0" blue="1.0"/>
1415         <bounds x="0" y="0.1" width="1" height="1"/>
1416      </text>
1417      <text string="5  4" state="57">
1418         <color red="1.0" green="1.0" blue="1.0"/>
1419         <bounds x="0" y="0.1" width="1" height="1"/>
1420      </text>
1421      <text string="5  4" state="58">
1422         <color red="1.0" green="1.0" blue="1.0"/>
1423         <bounds x="0" y="0.1" width="1" height="1"/>
1424      </text>
1425      <text string="5  4" state="59">
1426         <color red="1.0" green="1.0" blue="1.0"/>
1427         <bounds x="0" y="0.1" width="1" height="1"/>
1428      </text>
1429      <text string="5" state="60">
1430         <color red="1.0" green="1.0" blue="1.0"/>
1431         <bounds x="0" y="0.1" width="1" height="1"/>
1432      </text>
1433      <text string="5" state="61">
1434         <color red="1.0" green="1.0" blue="1.0"/>
1435         <bounds x="0" y="0.1" width="1" height="1"/>
1436      </text>
1437      <text string="5" state="62">
1438         <color red="1.0" green="1.0" blue="1.0"/>
1439         <bounds x="0" y="0.1" width="1" height="1"/>
1440      </text>
1441      <text string="5" state="63">
1442         <color red="1.0" green="1.0" blue="1.0"/>
1443         <bounds x="0" y="0.1" width="1" height="1"/>
1444      </text>
1445      <text string="6  5" state="64">
1446         <color red="1.0" green="1.0" blue="1.0"/>
1447         <bounds x="0" y="0.1" width="1" height="1"/>
1448      </text>
1449      <text string="6  5" state="65">
1450         <color red="1.0" green="1.0" blue="1.0"/>
1451         <bounds x="0" y="0.1" width="1" height="1"/>
1452      </text>
1453      <text string="6  5" state="66">
1454         <color red="1.0" green="1.0" blue="1.0"/>
1455         <bounds x="0" y="0.1" width="1" height="1"/>
1456      </text>
1457      <text string="6  5" state="67">
1458         <color red="1.0" green="1.0" blue="1.0"/>
1459         <bounds x="0" y="0.1" width="1" height="1"/>
1460      </text>
1461      <text string="6" state="68">
1462         <color red="1.0" green="1.0" blue="1.0"/>
1463         <bounds x="0" y="0.1" width="1" height="1"/>
1464      </text>
1465      <text string="6" state="69">
1466         <color red="1.0" green="1.0" blue="1.0"/>
1467         <bounds x="0" y="0.1" width="1" height="1"/>
1468      </text>
1469      <text string="6" state="70">
1470         <color red="1.0" green="1.0" blue="1.0"/>
1471         <bounds x="0" y="0.1" width="1" height="1"/>
1472      </text>
1473      <text string="6" state="71">
1474         <color red="1.0" green="1.0" blue="1.0"/>
1475         <bounds x="0" y="0.1" width="1" height="1"/>
1476      </text>
1477      <text string="1  6" state="72">
1478         <color red="1.0" green="1.0" blue="1.0"/>
1479         <bounds x="0" y="0.1" width="1" height="1"/>
1480      </text>
1481      <text string="1  6" state="73">
1482         <color red="1.0" green="1.0" blue="1.0"/>
1483         <bounds x="0" y="0.1" width="1" height="1"/>
1484      </text>
1485      <text string="1  6" state="74">
1486         <color red="1.0" green="1.0" blue="1.0"/>
1487         <bounds x="0" y="0.1" width="1" height="1"/>
1488      </text>
1489      <text string="1  6" state="75">
1490         <color red="1.0" green="1.0" blue="1.0"/>
1491         <bounds x="0" y="0.1" width="1" height="1"/>
1492      </text>
1493      <text string="1" state="76">
1494         <color red="1.0" green="1.0" blue="1.0"/>
1495         <bounds x="0" y="0.1" width="1" height="1"/>
1496      </text>
1497      <text string="1" state="77">
1498         <color red="1.0" green="1.0" blue="1.0"/>
1499         <bounds x="0" y="0.1" width="1" height="1"/>
1500      </text>
1501      <text string="1" state="78">
1502         <color red="1.0" green="1.0" blue="1.0"/>
1503         <bounds x="0" y="0.1" width="1" height="1"/>
1504      </text>
1505      <text string="1" state="79">
1506         <color red="1.0" green="1.0" blue="1.0"/>
1507         <bounds x="0" y="0.1" width="1" height="1"/>
1508      </text>
1509      <text string="2  1" state="80">
1510         <color red="1.0" green="1.0" blue="1.0"/>
1511         <bounds x="0" y="0.1" width="1" height="1"/>
1512      </text>
1513      <text string="2  1" state="81">
1514         <color red="1.0" green="1.0" blue="1.0"/>
1515         <bounds x="0" y="0.1" width="1" height="1"/>
1516      </text>
1517      <text string="2  1" state="82">
1518         <color red="1.0" green="1.0" blue="1.0"/>
1519         <bounds x="0" y="0.1" width="1" height="1"/>
1520      </text>
1521      <text string="2  1" state="83">
1522         <color red="1.0" green="1.0" blue="1.0"/>
1523         <bounds x="0" y="0.1" width="1" height="1"/>
1524      </text>
1525      <text string="2" state="84">
1526         <color red="1.0" green="1.0" blue="1.0"/>
1527         <bounds x="0" y="0.1" width="1" height="1"/>
1528      </text>
1529      <text string="2" state="85">
1530         <color red="1.0" green="1.0" blue="1.0"/>
1531         <bounds x="0" y="0.1" width="1" height="1"/>
1532      </text>
1533      <text string="2" state="86">
1534         <color red="1.0" green="1.0" blue="1.0"/>
1535         <bounds x="0" y="0.1" width="1" height="1"/>
1536      </text>
1537      <text string="2" state="87">
1538         <color red="1.0" green="1.0" blue="1.0"/>
1539         <bounds x="0" y="0.1" width="1" height="1"/>
1540      </text>
1541      <text string="3  2" state="88">
1542         <color red="1.0" green="1.0" blue="1.0"/>
1543         <bounds x="0" y="0.1" width="1" height="1"/>
1544      </text>
1545      <text string="3  2" state="89">
1546         <color red="1.0" green="1.0" blue="1.0"/>
1547         <bounds x="0" y="0.1" width="1" height="1"/>
1548      </text>
1549      <text string="3  2" state="90">
1550         <color red="1.0" green="1.0" blue="1.0"/>
1551         <bounds x="0" y="0.1" width="1" height="1"/>
1552      </text>
1553      <text string="3  2" state="91">
1554         <color red="1.0" green="1.0" blue="1.0"/>
1555         <bounds x="0" y="0.1" width="1" height="1"/>
1556      </text>
1557      <text string="3" state="92">
1558         <color red="1.0" green="1.0" blue="1.0"/>
1559         <bounds x="0" y="0.1" width="1" height="1"/>
1560      </text>
1561      <text string="3" state="93">
1562         <color red="1.0" green="1.0" blue="1.0"/>
1563         <bounds x="0" y="0.1" width="1" height="1"/>
1564      </text>
1565      <text string="3" state="94">
1566         <color red="1.0" green="1.0" blue="1.0"/>
1567         <bounds x="0" y="0.1" width="1" height="1"/>
1568      </text>
1569      <text string="3" state="95">
1570         <color red="1.0" green="1.0" blue="1.0"/>
1571         <bounds x="0" y="0.1" width="1" height="1"/>
1572      </text>
45   <element name="SteppersReel4" defstate="0">
46   <reel stateoffset="-8192" symbollist="5:dice5.png,4:dice4.png,3:dice3.png,2:dice2.png,1:dice1.png,6:dice6.png,5:dice5.png,4:dice4.png,3:dice3.png,2:dice2.png,1:dice1.png,6:dice6.png" reelreversed="1" numsymbolsvisible="1">
47   <color red="1.0" green="1.0" blue="1.0" />
48   <bounds x="0" y="0" width="1" height="1" />
49   </reel>
157350   </element>
157451
157552   <view name="AWP Simulated Video (Lamp Matrix and Reels)">
r15082r15083
162198      <backdrop name="vfd15" element="vfd0" state="0">
162299         <bounds x="145" y="200" width="9" height="17"/>
1623100      </backdrop>
1624      <backdrop name="TotalReels" element="TotalReels"/>
1625      <backdrop name="ReelSteps2" element="ReelSteps1"/>
1626      <backdrop name="ReelSteps3" element="ReelSteps1"/>
1627      <backdrop name="ReelSteps1" element="ReelSteps1"/>
1628      <backdrop name="ReelSteps4" element="ReelSteps4"/>
1629      <backdrop name="ReelSymbols1" element="ReelSymbols1"/>
1630      <backdrop name="ReelSymbols2" element="ReelSymbols1"/>
1631      <backdrop name="ReelSymbols3" element="ReelSymbols1"/>
1632      <backdrop name="ReelSymbols4" element="ReelSymbols4"/>
1633      <backdrop name="reel1a1" element="Reel1" state="96">
1634         <bounds x="85" y="463" width="49" height="29.3333"/>
101
102      <backdrop name="sreel1" element="SteppersReel1" state="0">
103         <bounds x="85" y="491.3333" width="50" height="90"/>
1635104      </backdrop>
1636      <backdrop name="reel1" element="Reel1" state="96">
1637         <bounds x="85" y="491.3333" width="49" height="29.3333"/>
105      <backdrop name="sreel2" element="SteppersReel2" state="0">
106         <bounds x="161" y="491.3333" width="50" height="90"/>
1638107      </backdrop>
1639      <backdrop name="reel1b1" element="Reel1" state="96">
1640         <bounds x="85" y="520.6666" width="49" height="29.3333"/>
108      <backdrop name="sreel3" element="SteppersReel3" state="0">
109         <bounds x="236" y="491.3333" width="50" height="90"/>
1641110      </backdrop>
1642      <backdrop name="reel2a1" element="Reel2" state="96">
1643         <bounds x="161" y="463" width="49" height="29.3333"/>
111      <backdrop name="sreel4" element="SteppersReel4" state="0">
112         <bounds x="277" y="214" width="40" height="80"/>
1644113      </backdrop>
1645      <backdrop name="reel2" element="Reel2" state="96">
1646         <bounds x="161" y="491.3333" width="49" height="29.3333"/>
1647      </backdrop>
1648      <backdrop name="reel2b1" element="Reel2" state="96">
1649         <bounds x="161" y="520.6666" width="49" height="29.3333"/>
1650      </backdrop>
1651      <backdrop name="reel3a1" element="Reel3" state="96">
1652         <bounds x="236" y="463" width="49" height="29.3333"/>
1653      </backdrop>
1654      <backdrop name="reel3" element="Reel3" state="96">
1655         <bounds x="236" y="491.3333" width="49" height="29.3333"/>
1656      </backdrop>
1657      <backdrop name="reel3b1" element="Reel3" state="96">
1658         <bounds x="236" y="520.6666" width="49" height="29.3333"/>
1659      </backdrop>
1660      <backdrop name="reel4" element="Reel4" state="0">
1661         <bounds x="277" y="214" width="39" height="40"/>
1662      </backdrop>
1663114      <backdrop name="lamp0" element="matrixlamp" state="0">
1664115         <bounds x="0" y="0" width="7" height="7"/>
1665116      </backdrop>
src/mame/layout/gamball.lay
r15082r15083
11<?xml version="1.0"?>
22<mamelayout version="2">
3   <element name="TotalReels" defstate="4"/>
4   <element name="ReelSteps1" defstate="8"/>
5   <element name="ReelSymbols1" defstate="3"/>
6   <element name="ReelSteps2" defstate="6"/>
73   <element name="digit">
84   <led7seg>
95         <color red="1.0" green="0.0" blue="0.0" />
r15082r15083
257253         <bounds x="0" y="0.1" width="1" height="1" />
258254      </text>
259255   </element>
260   <element name="Reel1" defstate="96">
261      <text string="3.00 RPT" state="0">
262         <color red="1.0" green="1.0" blue="1.0" />
263         <bounds x="0" y="0.1" width="1" height="1" />
264      </text>
265      <text string="3.00 RPT" state="1">
266         <color red="1.0" green="1.0" blue="1.0" />
267         <bounds x="0" y="0.1" width="1" height="1" />
268      </text>
269      <text string="3.00 RPT" state="2">
270         <color red="1.0" green="1.0" blue="1.0" />
271         <bounds x="0" y="0.1" width="1" height="1" />
272      </text>
273      <text string="3.00 RPT" state="3">
274         <color red="1.0" green="1.0" blue="1.0" />
275         <bounds x="0" y="0.1" width="1" height="1" />
276      </text>
277      <text string="3.00 RPT" state="4">
278         <color red="1.0" green="1.0" blue="1.0" />
279         <bounds x="0" y="0.1" width="1" height="1" />
280      </text>
281      <text string="3.00 RPT" state="5">
282         <color red="1.0" green="1.0" blue="1.0" />
283         <bounds x="0" y="0.1" width="1" height="1" />
284      </text>
285      <text string="3.00 RPT" state="6">
286         <color red="1.0" green="1.0" blue="1.0" />
287         <bounds x="0" y="0.1" width="1" height="1" />
288      </text>
289      <text string="3.00 RPT" state="7">
290         <color red="1.0" green="1.0" blue="1.0" />
291         <bounds x="0" y="0.1" width="1" height="1" />
292      </text>
293      <text string="POT" state="8">
294         <color red="1.0" green="1.0" blue="1.0" />
295         <bounds x="0" y="0.1" width="1" height="1" />
296      </text>
297      <text string="POT" state="9">
298         <color red="1.0" green="1.0" blue="1.0" />
299         <bounds x="0" y="0.1" width="1" height="1" />
300      </text>
301      <text string="POT" state="10">
302         <color red="1.0" green="1.0" blue="1.0" />
303         <bounds x="0" y="0.1" width="1" height="1" />
304      </text>
305      <text string="POT" state="11">
306         <color red="1.0" green="1.0" blue="1.0" />
307         <bounds x="0" y="0.1" width="1" height="1" />
308      </text>
309      <text string="POT" state="12">
310         <color red="1.0" green="1.0" blue="1.0" />
311         <bounds x="0" y="0.1" width="1" height="1" />
312      </text>
313      <text string="POT" state="13">
314         <color red="1.0" green="1.0" blue="1.0" />
315         <bounds x="0" y="0.1" width="1" height="1" />
316      </text>
317      <text string="POT" state="14">
318         <color red="1.0" green="1.0" blue="1.0" />
319         <bounds x="0" y="0.1" width="1" height="1" />
320      </text>
321      <text string="POT" state="15">
322         <color red="1.0" green="1.0" blue="1.0" />
323         <bounds x="0" y="0.1" width="1" height="1" />
324      </text>
325      <text string="JACK" state="16">
326         <color red="1.0" green="1.0" blue="1.0" />
327         <bounds x="0" y="0.1" width="1" height="1" />
328      </text>
329      <text string="JACK" state="17">
330         <color red="1.0" green="1.0" blue="1.0" />
331         <bounds x="0" y="0.1" width="1" height="1" />
332      </text>
333      <text string="JACK" state="18">
334         <color red="1.0" green="1.0" blue="1.0" />
335         <bounds x="0" y="0.1" width="1" height="1" />
336      </text>
337      <text string="JACK" state="19">
338         <color red="1.0" green="1.0" blue="1.0" />
339         <bounds x="0" y="0.1" width="1" height="1" />
340      </text>
341      <text string="JACK" state="20">
342         <color red="1.0" green="1.0" blue="1.0" />
343         <bounds x="0" y="0.1" width="1" height="1" />
344      </text>
345      <text string="JACK" state="21">
346         <color red="1.0" green="1.0" blue="1.0" />
347         <bounds x="0" y="0.1" width="1" height="1" />
348      </text>
349      <text string="JACK" state="22">
350         <color red="1.0" green="1.0" blue="1.0" />
351         <bounds x="0" y="0.1" width="1" height="1" />
352      </text>
353      <text string="JACK" state="23">
354         <color red="1.0" green="1.0" blue="1.0" />
355         <bounds x="0" y="0.1" width="1" height="1" />
356      </text>
357      <text string="LOSE" state="24">
358         <color red="1.0" green="1.0" blue="1.0" />
359         <bounds x="0" y="0.1" width="1" height="1" />
360      </text>
361      <text string="LOSE" state="25">
362         <color red="1.0" green="1.0" blue="1.0" />
363         <bounds x="0" y="0.1" width="1" height="1" />
364      </text>
365      <text string="LOSE" state="26">
366         <color red="1.0" green="1.0" blue="1.0" />
367         <bounds x="0" y="0.1" width="1" height="1" />
368      </text>
369      <text string="LOSE" state="27">
370         <color red="1.0" green="1.0" blue="1.0" />
371         <bounds x="0" y="0.1" width="1" height="1" />
372      </text>
373      <text string="LOSE" state="28">
374         <color red="1.0" green="1.0" blue="1.0" />
375         <bounds x="0" y="0.1" width="1" height="1" />
376      </text>
377      <text string="LOSE" state="29">
378         <color red="1.0" green="1.0" blue="1.0" />
379         <bounds x="0" y="0.1" width="1" height="1" />
380      </text>
381      <text string="LOSE" state="30">
382         <color red="1.0" green="1.0" blue="1.0" />
383         <bounds x="0" y="0.1" width="1" height="1" />
384      </text>
385      <text string="LOSE" state="31">
386         <color red="1.0" green="1.0" blue="1.0" />
387         <bounds x="0" y="0.1" width="1" height="1" />
388      </text>
389      <text string="60p" state="32">
390         <color red="1.0" green="1.0" blue="1.0" />
391         <bounds x="0" y="0.1" width="1" height="1" />
392      </text>
393      <text string="60p" state="33">
394         <color red="1.0" green="1.0" blue="1.0" />
395         <bounds x="0" y="0.1" width="1" height="1" />
396      </text>
397      <text string="60p" state="34">
398         <color red="1.0" green="1.0" blue="1.0" />
399         <bounds x="0" y="0.1" width="1" height="1" />
400      </text>
401      <text string="60p" state="35">
402         <color red="1.0" green="1.0" blue="1.0" />
403         <bounds x="0" y="0.1" width="1" height="1" />
404      </text>
405      <text string="60p" state="36">
406         <color red="1.0" green="1.0" blue="1.0" />
407         <bounds x="0" y="0.1" width="1" height="1" />
408      </text>
409      <text string="60p" state="37">
410         <color red="1.0" green="1.0" blue="1.0" />
411         <bounds x="0" y="0.1" width="1" height="1" />
412      </text>
413      <text string="60p" state="38">
414         <color red="1.0" green="1.0" blue="1.0" />
415         <bounds x="0" y="0.1" width="1" height="1" />
416      </text>
417      <text string="60p" state="39">
418         <color red="1.0" green="1.0" blue="1.0" />
419         <bounds x="0" y="0.1" width="1" height="1" />
420      </text>
421      <text string="80p" state="40">
422         <color red="1.0" green="1.0" blue="1.0" />
423         <bounds x="0" y="0.1" width="1" height="1" />
424      </text>
425      <text string="80p" state="41">
426         <color red="1.0" green="1.0" blue="1.0" />
427         <bounds x="0" y="0.1" width="1" height="1" />
428      </text>
429      <text string="80p" state="42">
430         <color red="1.0" green="1.0" blue="1.0" />
431         <bounds x="0" y="0.1" width="1" height="1" />
432      </text>
433      <text string="80p" state="43">
434         <color red="1.0" green="1.0" blue="1.0" />
435         <bounds x="0" y="0.1" width="1" height="1" />
436      </text>
437      <text string="80p" state="44">
438         <color red="1.0" green="1.0" blue="1.0" />
439         <bounds x="0" y="0.1" width="1" height="1" />
440      </text>
441      <text string="80p" state="45">
442         <color red="1.0" green="1.0" blue="1.0" />
443         <bounds x="0" y="0.1" width="1" height="1" />
444      </text>
445      <text string="80p" state="46">
446         <color red="1.0" green="1.0" blue="1.0" />
447         <bounds x="0" y="0.1" width="1" height="1" />
448      </text>
449      <text string="80p" state="47">
450         <color red="1.0" green="1.0" blue="1.0" />
451         <bounds x="0" y="0.1" width="1" height="1" />
452      </text>
453      <text string="1.00" state="48">
454         <color red="1.0" green="1.0" blue="1.0" />
455         <bounds x="0" y="0.1" width="1" height="1" />
456      </text>
457      <text string="1.00" state="49">
458         <color red="1.0" green="1.0" blue="1.0" />
459         <bounds x="0" y="0.1" width="1" height="1" />
460      </text>
461      <text string="1.00" state="50">
462         <color red="1.0" green="1.0" blue="1.0" />
463         <bounds x="0" y="0.1" width="1" height="1" />
464      </text>
465      <text string="1.00" state="51">
466         <color red="1.0" green="1.0" blue="1.0" />
467         <bounds x="0" y="0.1" width="1" height="1" />
468      </text>
469      <text string="1.00" state="52">
470         <color red="1.0" green="1.0" blue="1.0" />
471         <bounds x="0" y="0.1" width="1" height="1" />
472      </text>
473      <text string="1.00" state="53">
474         <color red="1.0" green="1.0" blue="1.0" />
475         <bounds x="0" y="0.1" width="1" height="1" />
476      </text>
477      <text string="1.00" state="54">
478         <color red="1.0" green="1.0" blue="1.0" />
479         <bounds x="0" y="0.1" width="1" height="1" />
480      </text>
481      <text string="1.00" state="55">
482         <color red="1.0" green="1.0" blue="1.0" />
483         <bounds x="0" y="0.1" width="1" height="1" />
484      </text>
485      <text string="1.20" state="56">
486         <color red="1.0" green="1.0" blue="1.0" />
487         <bounds x="0" y="0.1" width="1" height="1" />
488      </text>
489      <text string="1.20" state="57">
490         <color red="1.0" green="1.0" blue="1.0" />
491         <bounds x="0" y="0.1" width="1" height="1" />
492      </text>
493      <text string="1.20" state="58">
494         <color red="1.0" green="1.0" blue="1.0" />
495         <bounds x="0" y="0.1" width="1" height="1" />
496      </text>
497      <text string="1.20" state="59">
498         <color red="1.0" green="1.0" blue="1.0" />
499         <bounds x="0" y="0.1" width="1" height="1" />
500      </text>
501      <text string="1.20" state="60">
502         <color red="1.0" green="1.0" blue="1.0" />
503         <bounds x="0" y="0.1" width="1" height="1" />
504      </text>
505      <text string="1.20" state="61">
506         <color red="1.0" green="1.0" blue="1.0" />
507         <bounds x="0" y="0.1" width="1" height="1" />
508      </text>
509      <text string="1.20" state="62">
510         <color red="1.0" green="1.0" blue="1.0" />
511         <bounds x="0" y="0.1" width="1" height="1" />
512      </text>
513      <text string="1.20" state="63">
514         <color red="1.0" green="1.0" blue="1.0" />
515         <bounds x="0" y="0.1" width="1" height="1" />
516      </text>
517      <text string="1.60" state="64">
518         <color red="1.0" green="1.0" blue="1.0" />
519         <bounds x="0" y="0.1" width="1" height="1" />
520      </text>
521      <text string="1.60" state="65">
522         <color red="1.0" green="1.0" blue="1.0" />
523         <bounds x="0" y="0.1" width="1" height="1" />
524      </text>
525      <text string="1.60" state="66">
526         <color red="1.0" green="1.0" blue="1.0" />
527         <bounds x="0" y="0.1" width="1" height="1" />
528      </text>
529      <text string="1.60" state="67">
530         <color red="1.0" green="1.0" blue="1.0" />
531         <bounds x="0" y="0.1" width="1" height="1" />
532      </text>
533      <text string="1.60" state="68">
534         <color red="1.0" green="1.0" blue="1.0" />
535         <bounds x="0" y="0.1" width="1" height="1" />
536      </text>
537      <text string="1.60" state="69">
538         <color red="1.0" green="1.0" blue="1.0" />
539         <bounds x="0" y="0.1" width="1" height="1" />
540      </text>
541      <text string="1.60" state="70">
542         <color red="1.0" green="1.0" blue="1.0" />
543         <bounds x="0" y="0.1" width="1" height="1" />
544      </text>
545      <text string="1.60" state="71">
546         <color red="1.0" green="1.0" blue="1.0" />
547         <bounds x="0" y="0.1" width="1" height="1" />
548      </text>
549      <text string="2.00" state="72">
550         <color red="1.0" green="1.0" blue="1.0" />
551         <bounds x="0" y="0.1" width="1" height="1" />
552      </text>
553      <text string="2.00" state="73">
554         <color red="1.0" green="1.0" blue="1.0" />
555         <bounds x="0" y="0.1" width="1" height="1" />
556      </text>
557      <text string="2.00" state="74">
558         <color red="1.0" green="1.0" blue="1.0" />
559         <bounds x="0" y="0.1" width="1" height="1" />
560      </text>
561      <text string="2.00" state="75">
562         <color red="1.0" green="1.0" blue="1.0" />
563         <bounds x="0" y="0.1" width="1" height="1" />
564      </text>
565      <text string="2.00" state="76">
566         <color red="1.0" green="1.0" blue="1.0" />
567         <bounds x="0" y="0.1" width="1" height="1" />
568      </text>
569      <text string="2.00" state="77">
570         <color red="1.0" green="1.0" blue="1.0" />
571         <bounds x="0" y="0.1" width="1" height="1" />
572      </text>
573      <text string="2.00" state="78">
574         <color red="1.0" green="1.0" blue="1.0" />
575         <bounds x="0" y="0.1" width="1" height="1" />
576      </text>
577      <text string="2.00" state="79">
578         <color red="1.0" green="1.0" blue="1.0" />
579         <bounds x="0" y="0.1" width="1" height="1" />
580      </text>
581      <text string="2.20" state="80">
582         <color red="1.0" green="1.0" blue="1.0" />
583         <bounds x="0" y="0.1" width="1" height="1" />
584      </text>
585      <text string="2.20" state="81">
586         <color red="1.0" green="1.0" blue="1.0" />
587         <bounds x="0" y="0.1" width="1" height="1" />
588      </text>
589      <text string="2.20" state="82">
590         <color red="1.0" green="1.0" blue="1.0" />
591         <bounds x="0" y="0.1" width="1" height="1" />
592      </text>
593      <text string="2.20" state="83">
594         <color red="1.0" green="1.0" blue="1.0" />
595         <bounds x="0" y="0.1" width="1" height="1" />
596      </text>
597      <text string="2.20" state="84">
598         <color red="1.0" green="1.0" blue="1.0" />
599         <bounds x="0" y="0.1" width="1" height="1" />
600      </text>
601      <text string="2.20" state="85">
602         <color red="1.0" green="1.0" blue="1.0" />
603         <bounds x="0" y="0.1" width="1" height="1" />
604      </text>
605      <text string="2.20" state="86">
606         <color red="1.0" green="1.0" blue="1.0" />
607         <bounds x="0" y="0.1" width="1" height="1" />
608      </text>
609      <text string="2.20" state="87">
610         <color red="1.0" green="1.0" blue="1.0" />
611         <bounds x="0" y="0.1" width="1" height="1" />
612      </text>
613      <text string="2.40" state="88">
614         <color red="1.0" green="1.0" blue="1.0" />
615         <bounds x="0" y="0.1" width="1" height="1" />
616      </text>
617      <text string="2.40" state="89">
618         <color red="1.0" green="1.0" blue="1.0" />
619         <bounds x="0" y="0.1" width="1" height="1" />
620      </text>
621      <text string="2.40" state="90">
622         <color red="1.0" green="1.0" blue="1.0" />
623         <bounds x="0" y="0.1" width="1" height="1" />
624      </text>
625      <text string="2.40" state="91">
626         <color red="1.0" green="1.0" blue="1.0" />
627         <bounds x="0" y="0.1" width="1" height="1" />
628      </text>
629      <text string="2.40" state="92">
630         <color red="1.0" green="1.0" blue="1.0" />
631         <bounds x="0" y="0.1" width="1" height="1" />
632      </text>
633      <text string="2.40" state="93">
634         <color red="1.0" green="1.0" blue="1.0" />
635         <bounds x="0" y="0.1" width="1" height="1" />
636      </text>
637      <text string="2.40" state="94">
638         <color red="1.0" green="1.0" blue="1.0" />
639         <bounds x="0" y="0.1" width="1" height="1" />
640      </text>
641      <text string="2.40" state="95">
642         <color red="1.0" green="1.0" blue="1.0" />
643         <bounds x="0" y="0.1" width="1" height="1" />
644      </text>
256
257   <element name="SteppersReel1" defstate="0">
258   <reel stateoffset="0" symbollist="3.00 RPT:300p.png,2.40:240.png,2.20:220.png,2.00:200.png,1.60:160.png,1.20:120.png,1.00:100p.png,80p:80p.png,60p:60p.png,LOSE:lose.png,JACK:jack.png,POT:pot.png" reelreversed="1" numsymbolsvisible="2">
259   <color red="1.0" green="1.0" blue="1.0" />
260   <bounds x="0" y="0" width="1" height="1" />
261   </reel>
645262   </element>
646263
647   <element name="Reel2" defstate="96">
648      <text string="7" state="0">
649         <color red="1.0" green="1.0" blue="1.0" />
650         <bounds x="0" y="0.1" width="1" height="1" />
651      </text>
652      <text string="7" state="1">
653         <color red="1.0" green="1.0" blue="1.0" />
654         <bounds x="0" y="0.1" width="1" height="1" />
655      </text>
656      <text string="7" state="2">
657         <color red="1.0" green="1.0" blue="1.0" />
658         <bounds x="0" y="0.1" width="1" height="1" />
659      </text>
660      <text string="7" state="3">
661         <color red="1.0" green="1.0" blue="1.0" />
662         <bounds x="0" y="0.1" width="1" height="1" />
663      </text>
664      <text string="7" state="4">
665         <color red="1.0" green="1.0" blue="1.0" />
666         <bounds x="0" y="0.1" width="1" height="1" />
667      </text>
668      <text string="7" state="5">
669         <color red="1.0" green="1.0" blue="1.0" />
670         <bounds x="0" y="0.1" width="1" height="1" />
671      </text>
672      <text string="Melon" state="6">
673         <color red="1.0" green="1.0" blue="1.0" />
674         <bounds x="0" y="0.1" width="1" height="1" />
675      </text>
676      <text string="Melon" state="7">
677         <color red="1.0" green="1.0" blue="1.0" />
678         <bounds x="0" y="0.1" width="1" height="1" />
679      </text>
680      <text string="Melon" state="8">
681         <color red="1.0" green="1.0" blue="1.0" />
682         <bounds x="0" y="0.1" width="1" height="1" />
683      </text>
684      <text string="Melon" state="9">
685         <color red="1.0" green="1.0" blue="1.0" />
686         <bounds x="0" y="0.1" width="1" height="1" />
687      </text>
688      <text string="Melon" state="10">
689         <color red="1.0" green="1.0" blue="1.0" />
690         <bounds x="0" y="0.1" width="1" height="1" />
691      </text>
692      <text string="Melon" state="11">
693         <color red="1.0" green="1.0" blue="1.0" />
694         <bounds x="0" y="0.1" width="1" height="1" />
695      </text>
696      <text string="Bar" state="12">
697         <color red="1.0" green="1.0" blue="1.0" />
698         <bounds x="0" y="0.1" width="1" height="1" />
699      </text>
700      <text string="Bar" state="13">
701         <color red="1.0" green="1.0" blue="1.0" />
702         <bounds x="0" y="0.1" width="1" height="1" />
703      </text>
704      <text string="Bar" state="14">
705         <color red="1.0" green="1.0" blue="1.0" />
706         <bounds x="0" y="0.1" width="1" height="1" />
707      </text>
708      <text string="Bar" state="15">
709         <color red="1.0" green="1.0" blue="1.0" />
710         <bounds x="0" y="0.1" width="1" height="1" />
711      </text>
712      <text string="Bar" state="16">
713         <color red="1.0" green="1.0" blue="1.0" />
714         <bounds x="0" y="0.1" width="1" height="1" />
715      </text>
716      <text string="Bar" state="17">
717         <color red="1.0" green="1.0" blue="1.0" />
718         <bounds x="0" y="0.1" width="1" height="1" />
719      </text>
720      <text string="Bell" state="18">
721         <color red="1.0" green="1.0" blue="1.0" />
722         <bounds x="0" y="0.1" width="1" height="1" />
723      </text>
724      <text string="Bell" state="19">
725         <color red="1.0" green="1.0" blue="1.0" />
726         <bounds x="0" y="0.1" width="1" height="1" />
727      </text>
728      <text string="Bell" state="20">
729         <color red="1.0" green="1.0" blue="1.0" />
730         <bounds x="0" y="0.1" width="1" height="1" />
731      </text>
732      <text string="Bell" state="21">
733         <color red="1.0" green="1.0" blue="1.0" />
734         <bounds x="0" y="0.1" width="1" height="1" />
735      </text>
736      <text string="Bell" state="22">
737         <color red="1.0" green="1.0" blue="1.0" />
738         <bounds x="0" y="0.1" width="1" height="1" />
739      </text>
740      <text string="Bell" state="23">
741         <color red="1.0" green="1.0" blue="1.0" />
742         <bounds x="0" y="0.1" width="1" height="1" />
743      </text>
744      <text string="Cherry" state="24">
745         <color red="1.0" green="1.0" blue="1.0" />
746         <bounds x="0" y="0.1" width="1" height="1" />
747      </text>
748      <text string="Cherry" state="25">
749         <color red="1.0" green="1.0" blue="1.0" />
750         <bounds x="0" y="0.1" width="1" height="1" />
751      </text>
752      <text string="Cherry" state="26">
753         <color red="1.0" green="1.0" blue="1.0" />
754         <bounds x="0" y="0.1" width="1" height="1" />
755      </text>
756      <text string="Cherry" state="27">
757         <color red="1.0" green="1.0" blue="1.0" />
758         <bounds x="0" y="0.1" width="1" height="1" />
759      </text>
760      <text string="Cherry" state="28">
761         <color red="1.0" green="1.0" blue="1.0" />
762         <bounds x="0" y="0.1" width="1" height="1" />
763      </text>
764      <text string="Cherry" state="29">
765         <color red="1.0" green="1.0" blue="1.0" />
766         <bounds x="0" y="0.1" width="1" height="1" />
767      </text>
768      <text string="Bar" state="30">
769         <color red="1.0" green="1.0" blue="1.0" />
770         <bounds x="0" y="0.1" width="1" height="1" />
771      </text>
772      <text string="Bar" state="31">
773         <color red="1.0" green="1.0" blue="1.0" />
774         <bounds x="0" y="0.1" width="1" height="1" />
775      </text>
776      <text string="Bar" state="32">
777         <color red="1.0" green="1.0" blue="1.0" />
778         <bounds x="0" y="0.1" width="1" height="1" />
779      </text>
780      <text string="Bar" state="33">
781         <color red="1.0" green="1.0" blue="1.0" />
782         <bounds x="0" y="0.1" width="1" height="1" />
783      </text>
784      <text string="Bar" state="34">
785         <color red="1.0" green="1.0" blue="1.0" />
786         <bounds x="0" y="0.1" width="1" height="1" />
787      </text>
788      <text string="Bar" state="35">
789         <color red="1.0" green="1.0" blue="1.0" />
790         <bounds x="0" y="0.1" width="1" height="1" />
791      </text>
792      <text string="7" state="36">
793         <color red="1.0" green="1.0" blue="1.0" />
794         <bounds x="0" y="0.1" width="1" height="1" />
795      </text>
796      <text string="7" state="37">
797         <color red="1.0" green="1.0" blue="1.0" />
798         <bounds x="0" y="0.1" width="1" height="1" />
799      </text>
800      <text string="7" state="38">
801         <color red="1.0" green="1.0" blue="1.0" />
802         <bounds x="0" y="0.1" width="1" height="1" />
803      </text>
804      <text string="7" state="39">
805         <color red="1.0" green="1.0" blue="1.0" />
806         <bounds x="0" y="0.1" width="1" height="1" />
807      </text>
808      <text string="7" state="40">
809         <color red="1.0" green="1.0" blue="1.0" />
810         <bounds x="0" y="0.1" width="1" height="1" />
811      </text>
812      <text string="7" state="41">
813         <color red="1.0" green="1.0" blue="1.0" />
814         <bounds x="0" y="0.1" width="1" height="1" />
815      </text>
816      <text string="Bell" state="42">
817         <color red="1.0" green="1.0" blue="1.0" />
818         <bounds x="0" y="0.1" width="1" height="1" />
819      </text>
820      <text string="Bell" state="43">
821         <color red="1.0" green="1.0" blue="1.0" />
822         <bounds x="0" y="0.1" width="1" height="1" />
823      </text>
824      <text string="Bell" state="44">
825         <color red="1.0" green="1.0" blue="1.0" />
826         <bounds x="0" y="0.1" width="1" height="1" />
827      </text>
828      <text string="Bell" state="45">
829         <color red="1.0" green="1.0" blue="1.0" />
830         <bounds x="0" y="0.1" width="1" height="1" />
831      </text>
832      <text string="Bell" state="46">
833         <color red="1.0" green="1.0" blue="1.0" />
834         <bounds x="0" y="0.1" width="1" height="1" />
835      </text>
836      <text string="Bell" state="47">
837         <color red="1.0" green="1.0" blue="1.0" />
838         <bounds x="0" y="0.1" width="1" height="1" />
839      </text>
840      <text string="Melon" state="48">
841         <color red="1.0" green="1.0" blue="1.0" />
842         <bounds x="0" y="0.1" width="1" height="1" />
843      </text>
844      <text string="Melon" state="49">
845         <color red="1.0" green="1.0" blue="1.0" />
846         <bounds x="0" y="0.1" width="1" height="1" />
847      </text>
848      <text string="Melon" state="50">
849         <color red="1.0" green="1.0" blue="1.0" />
850         <bounds x="0" y="0.1" width="1" height="1" />
851      </text>
852      <text string="Melon" state="51">
853         <color red="1.0" green="1.0" blue="1.0" />
854         <bounds x="0" y="0.1" width="1" height="1" />
855      </text>
856      <text string="Melon" state="52">
857         <color red="1.0" green="1.0" blue="1.0" />
858         <bounds x="0" y="0.1" width="1" height="1" />
859      </text>
860      <text string="Melon" state="53">
861         <color red="1.0" green="1.0" blue="1.0" />
862         <bounds x="0" y="0.1" width="1" height="1" />
863      </text>
864      <text string="Cherry" state="54">
865         <color red="1.0" green="1.0" blue="1.0" />
866         <bounds x="0" y="0.1" width="1" height="1" />
867      </text>
868      <text string="Cherry" state="55">
869         <color red="1.0" green="1.0" blue="1.0" />
870         <bounds x="0" y="0.1" width="1" height="1" />
871      </text>
872      <text string="Cherry" state="56">
873         <color red="1.0" green="1.0" blue="1.0" />
874         <bounds x="0" y="0.1" width="1" height="1" />
875      </text>
876      <text string="Cherry" state="57">
877         <color red="1.0" green="1.0" blue="1.0" />
878         <bounds x="0" y="0.1" width="1" height="1" />
879      </text>
880      <text string="Cherry" state="58">
881         <color red="1.0" green="1.0" blue="1.0" />
882         <bounds x="0" y="0.1" width="1" height="1" />
883      </text>
884      <text string="Cherry" state="59">
885         <color red="1.0" green="1.0" blue="1.0" />
886         <bounds x="0" y="0.1" width="1" height="1" />
887      </text>
888      <text string="Bell" state="60">
889         <color red="1.0" green="1.0" blue="1.0" />
890         <bounds x="0" y="0.1" width="1" height="1" />
891      </text>
892      <text string="Bell" state="61">
893         <color red="1.0" green="1.0" blue="1.0" />
894         <bounds x="0" y="0.1" width="1" height="1" />
895      </text>
896      <text string="Bell" state="62">
897         <color red="1.0" green="1.0" blue="1.0" />
898         <bounds x="0" y="0.1" width="1" height="1" />
899      </text>
900      <text string="Bell" state="63">
901         <color red="1.0" green="1.0" blue="1.0" />
902         <bounds x="0" y="0.1" width="1" height="1" />
903      </text>
904      <text string="Bell" state="64">
905         <color red="1.0" green="1.0" blue="1.0" />
906         <bounds x="0" y="0.1" width="1" height="1" />
907      </text>
908      <text string="Bell" state="65">
909         <color red="1.0" green="1.0" blue="1.0" />
910         <bounds x="0" y="0.1" width="1" height="1" />
911      </text>
912      <text string="Bar" state="66">
913         <color red="1.0" green="1.0" blue="1.0" />
914         <bounds x="0" y="0.1" width="1" height="1" />
915      </text>
916      <text string="Bar" state="67">
917         <color red="1.0" green="1.0" blue="1.0" />
918         <bounds x="0" y="0.1" width="1" height="1" />
919      </text>
920      <text string="Bar" state="68">
921         <color red="1.0" green="1.0" blue="1.0" />
922         <bounds x="0" y="0.1" width="1" height="1" />
923      </text>
924      <text string="Bar" state="69">
925         <color red="1.0" green="1.0" blue="1.0" />
926         <bounds x="0" y="0.1" width="1" height="1" />
927      </text>
928      <text string="Bar" state="70">
929         <color red="1.0" green="1.0" blue="1.0" />
930         <bounds x="0" y="0.1" width="1" height="1" />
931      </text>
932      <text string="Bar" state="71">
933         <color red="1.0" green="1.0" blue="1.0" />
934         <bounds x="0" y="0.1" width="1" height="1" />
935      </text>
936      <text string="7" state="72">
937         <color red="1.0" green="1.0" blue="1.0" />
938         <bounds x="0" y="0.1" width="1" height="1" />
939      </text>
940      <text string="7" state="73">
941         <color red="1.0" green="1.0" blue="1.0" />
942         <bounds x="0" y="0.1" width="1" height="1" />
943      </text>
944      <text string="7" state="74">
945         <color red="1.0" green="1.0" blue="1.0" />
946         <bounds x="0" y="0.1" width="1" height="1" />
947      </text>
948      <text string="7" state="75">
949         <color red="1.0" green="1.0" blue="1.0" />
950         <bounds x="0" y="0.1" width="1" height="1" />
951      </text>
952      <text string="7" state="76">
953         <color red="1.0" green="1.0" blue="1.0" />
954         <bounds x="0" y="0.1" width="1" height="1" />
955      </text>
956      <text string="7" state="77">
957         <color red="1.0" green="1.0" blue="1.0" />
958         <bounds x="0" y="0.1" width="1" height="1" />
959      </text>
960      <text string="Melon" state="78">
961         <color red="1.0" green="1.0" blue="1.0" />
962         <bounds x="0" y="0.1" width="1" height="1" />
963      </text>
964      <text string="Melon" state="79">
965         <color red="1.0" green="1.0" blue="1.0" />
966         <bounds x="0" y="0.1" width="1" height="1" />
967      </text>
968      <text string="Melon" state="80">
969         <color red="1.0" green="1.0" blue="1.0" />
970         <bounds x="0" y="0.1" width="1" height="1" />
971      </text>
972      <text string="Melon" state="81">
973         <color red="1.0" green="1.0" blue="1.0" />
974         <bounds x="0" y="0.1" width="1" height="1" />
975      </text>
976      <text string="Melon" state="82">
977         <color red="1.0" green="1.0" blue="1.0" />
978         <bounds x="0" y="0.1" width="1" height="1" />
979      </text>
980      <text string="Melon" state="83">
981         <color red="1.0" green="1.0" blue="1.0" />
982         <bounds x="0" y="0.1" width="1" height="1" />
983      </text>
984      <text string="Bar" state="84">
985         <color red="1.0" green="1.0" blue="1.0" />
986         <bounds x="0" y="0.1" width="1" height="1" />
987      </text>
988      <text string="Bar" state="85">
989         <color red="1.0" green="1.0" blue="1.0" />
990         <bounds x="0" y="0.1" width="1" height="1" />
991      </text>
992      <text string="Bar" state="86">
993         <color red="1.0" green="1.0" blue="1.0" />
994         <bounds x="0" y="0.1" width="1" height="1" />
995      </text>
996      <text string="Bar" state="87">
997         <color red="1.0" green="1.0" blue="1.0" />
998         <bounds x="0" y="0.1" width="1" height="1" />
999      </text>
1000      <text string="Bar" state="88">
1001         <color red="1.0" green="1.0" blue="1.0" />
1002         <bounds x="0" y="0.1" width="1" height="1" />
1003      </text>
1004      <text string="Bar" state="89">
1005         <color red="1.0" green="1.0" blue="1.0" />
1006         <bounds x="0" y="0.1" width="1" height="1" />
1007      </text>
1008      <text string="Cherry" state="90">
1009         <color red="1.0" green="1.0" blue="1.0" />
1010         <bounds x="0" y="0.1" width="1" height="1" />
1011      </text>
1012      <text string="Cherry" state="91">
1013         <color red="1.0" green="1.0" blue="1.0" />
1014         <bounds x="0" y="0.1" width="1" height="1" />
1015      </text>
1016      <text string="Cherry" state="92">
1017         <color red="1.0" green="1.0" blue="1.0" />
1018         <bounds x="0" y="0.1" width="1" height="1" />
1019      </text>
1020      <text string="Cherry" state="93">
1021         <color red="1.0" green="1.0" blue="1.0" />
1022         <bounds x="0" y="0.1" width="1" height="1" />
1023      </text>
1024      <text string="Cherry" state="94">
1025         <color red="1.0" green="1.0" blue="1.0" />
1026         <bounds x="0" y="0.1" width="1" height="1" />
1027      </text>
1028      <text string="Cherry" state="95">
1029         <color red="1.0" green="1.0" blue="1.0" />
1030         <bounds x="0" y="0.1" width="1" height="1" />
1031      </text>
264   <element name="SteppersReel2" defstate="0">
265   <reel stateoffset="0" symbollist="Melon:melon.png,7:7.png,Cherry:cherry.png,Bar:bar.png,Melon:melon.png,7:7.png,Bar:bar.png,Bell:bell.png,Cherry:cherry.png,Melon:melon.png,Bell:bell.png,7:7.png,Bar:bar.png,Cherry:cherry.png,Bell:bell.png,Bar:bar.png" reelreversed="1" numsymbolsvisible="3">
266   <color red="1.0" green="1.0" blue="1.0" />
267   <bounds x="0" y="0" width="1" height="1" />
268   </reel>
1032269   </element>
1033270
1034   <element name="Reel3" defstate="96">
1035      <text string="7" state="0">
1036         <color red="1.0" green="1.0" blue="1.0" />
1037         <bounds x="0" y="0.1" width="1" height="1" />
1038      </text>
1039      <text string="7" state="1">
1040         <color red="1.0" green="1.0" blue="1.0" />
1041         <bounds x="0" y="0.1" width="1" height="1" />
1042      </text>
1043      <text string="7" state="2">
1044         <color red="1.0" green="1.0" blue="1.0" />
1045         <bounds x="0" y="0.1" width="1" height="1" />
1046      </text>
1047      <text string="7" state="3">
1048         <color red="1.0" green="1.0" blue="1.0" />
1049         <bounds x="0" y="0.1" width="1" height="1" />
1050      </text>
1051      <text string="7" state="4">
1052         <color red="1.0" green="1.0" blue="1.0" />
1053         <bounds x="0" y="0.1" width="1" height="1" />
1054      </text>
1055      <text string="7" state="5">
1056         <color red="1.0" green="1.0" blue="1.0" />
1057         <bounds x="0" y="0.1" width="1" height="1" />
1058      </text>
1059      <text string="Bell" state="6">
1060         <color red="1.0" green="1.0" blue="1.0" />
1061         <bounds x="0" y="0.1" width="1" height="1" />
1062      </text>
1063      <text string="Bell" state="7">
1064         <color red="1.0" green="1.0" blue="1.0" />
1065         <bounds x="0" y="0.1" width="1" height="1" />
1066      </text>
1067      <text string="Bell" state="8">
1068         <color red="1.0" green="1.0" blue="1.0" />
1069         <bounds x="0" y="0.1" width="1" height="1" />
1070      </text>
1071      <text string="Bell" state="9">
1072         <color red="1.0" green="1.0" blue="1.0" />
1073         <bounds x="0" y="0.1" width="1" height="1" />
1074      </text>
1075      <text string="Bell" state="10">
1076         <color red="1.0" green="1.0" blue="1.0" />
1077         <bounds x="0" y="0.1" width="1" height="1" />
1078      </text>
1079      <text string="Bell" state="11">
1080         <color red="1.0" green="1.0" blue="1.0" />
1081         <bounds x="0" y="0.1" width="1" height="1" />
1082      </text>
1083      <text string="Cherry" state="12">
1084         <color red="1.0" green="1.0" blue="1.0" />
1085         <bounds x="0" y="0.1" width="1" height="1" />
1086      </text>
1087      <text string="Cherry" state="13">
1088         <color red="1.0" green="1.0" blue="1.0" />
1089         <bounds x="0" y="0.1" width="1" height="1" />
1090      </text>
1091      <text string="Cherry" state="14">
1092         <color red="1.0" green="1.0" blue="1.0" />
1093         <bounds x="0" y="0.1" width="1" height="1" />
1094      </text>
1095      <text string="Cherry" state="15">
1096         <color red="1.0" green="1.0" blue="1.0" />
1097         <bounds x="0" y="0.1" width="1" height="1" />
1098      </text>
1099      <text string="Cherry" state="16">
1100         <color red="1.0" green="1.0" blue="1.0" />
1101         <bounds x="0" y="0.1" width="1" height="1" />
1102      </text>
1103      <text string="Cherry" state="17">
1104         <color red="1.0" green="1.0" blue="1.0" />
1105         <bounds x="0" y="0.1" width="1" height="1" />
1106      </text>
1107      <text string="Melon" state="18">
1108         <color red="1.0" green="1.0" blue="1.0" />
1109         <bounds x="0" y="0.1" width="1" height="1" />
1110      </text>
1111      <text string="Melon" state="19">
1112         <color red="1.0" green="1.0" blue="1.0" />
1113         <bounds x="0" y="0.1" width="1" height="1" />
1114      </text>
1115      <text string="Melon" state="20">
1116         <color red="1.0" green="1.0" blue="1.0" />
1117         <bounds x="0" y="0.1" width="1" height="1" />
1118      </text>
1119      <text string="Melon" state="21">
1120         <color red="1.0" green="1.0" blue="1.0" />
1121         <bounds x="0" y="0.1" width="1" height="1" />
1122      </text>
1123      <text string="Melon" state="22">
1124         <color red="1.0" green="1.0" blue="1.0" />
1125         <bounds x="0" y="0.1" width="1" height="1" />
1126      </text>
1127      <text string="Melon" state="23">
1128         <color red="1.0" green="1.0" blue="1.0" />
1129         <bounds x="0" y="0.1" width="1" height="1" />
1130      </text>
1131      <text string="Cherry" state="24">
1132         <color red="1.0" green="1.0" blue="1.0" />
1133         <bounds x="0" y="0.1" width="1" height="1" />
1134      </text>
1135      <text string="Cherry" state="25">
1136         <color red="1.0" green="1.0" blue="1.0" />
1137         <bounds x="0" y="0.1" width="1" height="1" />
1138      </text>
1139      <text string="Cherry" state="26">
1140         <color red="1.0" green="1.0" blue="1.0" />
1141         <bounds x="0" y="0.1" width="1" height="1" />
1142      </text>
1143      <text string="Cherry" state="27">
1144         <color red="1.0" green="1.0" blue="1.0" />
1145         <bounds x="0" y="0.1" width="1" height="1" />
1146      </text>
1147      <text string="Cherry" state="28">
1148         <color red="1.0" green="1.0" blue="1.0" />
1149         <bounds x="0" y="0.1" width="1" height="1" />
1150      </text>
1151      <text string="Cherry" state="29">
1152         <color red="1.0" green="1.0" blue="1.0" />
1153         <bounds x="0" y="0.1" width="1" height="1" />
1154      </text>
1155      <text string="Bar" state="30">
1156         <color red="1.0" green="1.0" blue="1.0" />
1157         <bounds x="0" y="0.1" width="1" height="1" />
1158      </text>
1159      <text string="Bar" state="31">
1160         <color red="1.0" green="1.0" blue="1.0" />
1161         <bounds x="0" y="0.1" width="1" height="1" />
1162      </text>
1163      <text string="Bar" state="32">
1164         <color red="1.0" green="1.0" blue="1.0" />
1165         <bounds x="0" y="0.1" width="1" height="1" />
1166      </text>
1167      <text string="Bar" state="33">
1168         <color red="1.0" green="1.0" blue="1.0" />
1169         <bounds x="0" y="0.1" width="1" height="1" />
1170      </text>
1171      <text string="Bar" state="34">
1172         <color red="1.0" green="1.0" blue="1.0" />
1173         <bounds x="0" y="0.1" width="1" height="1" />
1174      </text>
1175      <text string="Bar" state="35">
1176         <color red="1.0" green="1.0" blue="1.0" />
1177         <bounds x="0" y="0.1" width="1" height="1" />
1178      </text>
1179      <text string="Melon" state="36">
1180         <color red="1.0" green="1.0" blue="1.0" />
1181         <bounds x="0" y="0.1" width="1" height="1" />
1182      </text>
1183      <text string="Melon" state="37">
1184         <color red="1.0" green="1.0" blue="1.0" />
1185         <bounds x="0" y="0.1" width="1" height="1" />
1186      </text>
1187      <text string="Melon" state="38">
1188         <color red="1.0" green="1.0" blue="1.0" />
1189         <bounds x="0" y="0.1" width="1" height="1" />
1190      </text>
1191      <text string="Melon" state="39">
1192         <color red="1.0" green="1.0" blue="1.0" />
1193         <bounds x="0" y="0.1" width="1" height="1" />
1194      </text>
1195      <text string="Melon" state="40">
1196         <color red="1.0" green="1.0" blue="1.0" />
1197         <bounds x="0" y="0.1" width="1" height="1" />
1198      </text>
1199      <text string="Melon" state="41">
1200         <color red="1.0" green="1.0" blue="1.0" />
1201         <bounds x="0" y="0.1" width="1" height="1" />
1202      </text>
1203      <text string="7" state="42">
1204         <color red="1.0" green="1.0" blue="1.0" />
1205         <bounds x="0" y="0.1" width="1" height="1" />
1206      </text>
1207      <text string="7" state="43">
1208         <color red="1.0" green="1.0" blue="1.0" />
1209         <bounds x="0" y="0.1" width="1" height="1" />
1210      </text>
1211      <text string="7" state="44">
1212         <color red="1.0" green="1.0" blue="1.0" />
1213         <bounds x="0" y="0.1" width="1" height="1" />
1214      </text>
1215      <text string="7" state="45">
1216         <color red="1.0" green="1.0" blue="1.0" />
1217         <bounds x="0" y="0.1" width="1" height="1" />
1218      </text>
1219      <text string="7" state="46">
1220         <color red="1.0" green="1.0" blue="1.0" />
1221         <bounds x="0" y="0.1" width="1" height="1" />
1222      </text>
1223      <text string="7" state="47">
1224         <color red="1.0" green="1.0" blue="1.0" />
1225         <bounds x="0" y="0.1" width="1" height="1" />
1226      </text>
1227      <text string="Cherry" state="48">
1228         <color red="1.0" green="1.0" blue="1.0" />
1229         <bounds x="0" y="0.1" width="1" height="1" />
1230      </text>
1231      <text string="Cherry" state="49">
1232         <color red="1.0" green="1.0" blue="1.0" />
1233         <bounds x="0" y="0.1" width="1" height="1" />
1234      </text>
1235      <text string="Cherry" state="50">
1236         <color red="1.0" green="1.0" blue="1.0" />
1237         <bounds x="0" y="0.1" width="1" height="1" />
1238      </text>
1239      <text string="Cherry" state="51">
1240         <color red="1.0" green="1.0" blue="1.0" />
1241         <bounds x="0" y="0.1" width="1" height="1" />
1242      </text>
1243      <text string="Cherry" state="52">
1244         <color red="1.0" green="1.0" blue="1.0" />
1245         <bounds x="0" y="0.1" width="1" height="1" />
1246      </text>
1247      <text string="Cherry" state="53">
1248         <color red="1.0" green="1.0" blue="1.0" />
1249         <bounds x="0" y="0.1" width="1" height="1" />
1250      </text>
1251      <text string="Bar" state="54">
1252         <color red="1.0" green="1.0" blue="1.0" />
1253         <bounds x="0" y="0.1" width="1" height="1" />
1254      </text>
1255      <text string="Bar" state="55">
1256         <color red="1.0" green="1.0" blue="1.0" />
1257         <bounds x="0" y="0.1" width="1" height="1" />
1258      </text>
1259      <text string="Bar" state="56">
1260         <color red="1.0" green="1.0" blue="1.0" />
1261         <bounds x="0" y="0.1" width="1" height="1" />
1262      </text>
1263      <text string="Bar" state="57">
1264         <color red="1.0" green="1.0" blue="1.0" />
1265         <bounds x="0" y="0.1" width="1" height="1" />
1266      </text>
1267      <text string="Bar" state="58">
1268         <color red="1.0" green="1.0" blue="1.0" />
1269         <bounds x="0" y="0.1" width="1" height="1" />
1270      </text>
1271      <text string="Bar" state="59">
1272         <color red="1.0" green="1.0" blue="1.0" />
1273         <bounds x="0" y="0.1" width="1" height="1" />
1274      </text>
1275      <text string="Melon" state="60">
1276         <color red="1.0" green="1.0" blue="1.0" />
1277         <bounds x="0" y="0.1" width="1" height="1" />
1278      </text>
1279      <text string="Melon" state="61">
1280         <color red="1.0" green="1.0" blue="1.0" />
1281         <bounds x="0" y="0.1" width="1" height="1" />
1282      </text>
1283      <text string="Melon" state="62">
1284         <color red="1.0" green="1.0" blue="1.0" />
1285         <bounds x="0" y="0.1" width="1" height="1" />
1286      </text>
1287      <text string="Melon" state="63">
1288         <color red="1.0" green="1.0" blue="1.0" />
1289         <bounds x="0" y="0.1" width="1" height="1" />
1290      </text>
1291      <text string="Melon" state="64">
1292         <color red="1.0" green="1.0" blue="1.0" />
1293         <bounds x="0" y="0.1" width="1" height="1" />
1294      </text>
1295      <text string="Melon" state="65">
1296         <color red="1.0" green="1.0" blue="1.0" />
1297         <bounds x="0" y="0.1" width="1" height="1" />
1298      </text>
1299      <text string="Bell" state="66">
1300         <color red="1.0" green="1.0" blue="1.0" />
1301         <bounds x="0" y="0.1" width="1" height="1" />
1302      </text>
1303      <text string="Bell" state="67">
1304         <color red="1.0" green="1.0" blue="1.0" />
1305         <bounds x="0" y="0.1" width="1" height="1" />
1306      </text>
1307      <text string="Bell" state="68">
1308         <color red="1.0" green="1.0" blue="1.0" />
1309         <bounds x="0" y="0.1" width="1" height="1" />
1310      </text>
1311      <text string="Bell" state="69">
1312         <color red="1.0" green="1.0" blue="1.0" />
1313         <bounds x="0" y="0.1" width="1" height="1" />
1314      </text>
1315      <text string="Bell" state="70">
1316         <color red="1.0" green="1.0" blue="1.0" />
1317         <bounds x="0" y="0.1" width="1" height="1" />
1318      </text>
1319      <text string="Bell" state="71">
1320         <color red="1.0" green="1.0" blue="1.0" />
1321         <bounds x="0" y="0.1" width="1" height="1" />
1322      </text>
1323      <text string="Bar" state="72">
1324         <color red="1.0" green="1.0" blue="1.0" />
1325         <bounds x="0" y="0.1" width="1" height="1" />
1326      </text>
1327      <text string="Bar" state="73">
1328         <color red="1.0" green="1.0" blue="1.0" />
1329         <bounds x="0" y="0.1" width="1" height="1" />
1330      </text>
1331      <text string="Bar" state="74">
1332         <color red="1.0" green="1.0" blue="1.0" />
1333         <bounds x="0" y="0.1" width="1" height="1" />
1334      </text>
1335      <text string="Bar" state="75">
1336         <color red="1.0" green="1.0" blue="1.0" />
1337         <bounds x="0" y="0.1" width="1" height="1" />
1338      </text>
1339      <text string="Bar" state="76">
1340         <color red="1.0" green="1.0" blue="1.0" />
1341         <bounds x="0" y="0.1" width="1" height="1" />
1342      </text>
1343      <text string="Bar" state="77">
1344         <color red="1.0" green="1.0" blue="1.0" />
1345         <bounds x="0" y="0.1" width="1" height="1" />
1346      </text>
1347      <text string="Cherry" state="78">
1348         <color red="1.0" green="1.0" blue="1.0" />
1349         <bounds x="0" y="0.1" width="1" height="1" />
1350      </text>
1351      <text string="Cherry" state="79">
1352         <color red="1.0" green="1.0" blue="1.0" />
1353         <bounds x="0" y="0.1" width="1" height="1" />
1354      </text>
1355      <text string="Cherry" state="80">
1356         <color red="1.0" green="1.0" blue="1.0" />
1357         <bounds x="0" y="0.1" width="1" height="1" />
1358      </text>
1359      <text string="Cherry" state="81">
1360         <color red="1.0" green="1.0" blue="1.0" />
1361         <bounds x="0" y="0.1" width="1" height="1" />
1362      </text>
1363      <text string="Cherry" state="82">
1364         <color red="1.0" green="1.0" blue="1.0" />
1365         <bounds x="0" y="0.1" width="1" height="1" />
1366      </text>
1367      <text string="Cherry" state="83">
1368         <color red="1.0" green="1.0" blue="1.0" />
1369         <bounds x="0" y="0.1" width="1" height="1" />
1370      </text>
1371      <text string="Bell" state="84">
1372         <color red="1.0" green="1.0" blue="1.0" />
1373         <bounds x="0" y="0.1" width="1" height="1" />
1374      </text>
1375      <text string="Bell" state="85">
1376         <color red="1.0" green="1.0" blue="1.0" />
1377         <bounds x="0" y="0.1" width="1" height="1" />
1378      </text>
1379      <text string="Bell" state="86">
1380         <color red="1.0" green="1.0" blue="1.0" />
1381         <bounds x="0" y="0.1" width="1" height="1" />
1382      </text>
1383      <text string="Bell" state="87">
1384         <color red="1.0" green="1.0" blue="1.0" />
1385         <bounds x="0" y="0.1" width="1" height="1" />
1386      </text>
1387      <text string="Bell" state="88">
1388         <color red="1.0" green="1.0" blue="1.0" />
1389         <bounds x="0" y="0.1" width="1" height="1" />
1390      </text>
1391      <text string="Bell" state="89">
1392         <color red="1.0" green="1.0" blue="1.0" />
1393         <bounds x="0" y="0.1" width="1" height="1" />
1394      </text>
1395      <text string="Melon" state="90">
1396         <color red="1.0" green="1.0" blue="1.0" />
1397         <bounds x="0" y="0.1" width="1" height="1" />
1398      </text>
1399      <text string="Melon" state="91">
1400         <color red="1.0" green="1.0" blue="1.0" />
1401         <bounds x="0" y="0.1" width="1" height="1" />
1402      </text>
1403      <text string="Melon" state="92">
1404         <color red="1.0" green="1.0" blue="1.0" />
1405         <bounds x="0" y="0.1" width="1" height="1" />
1406      </text>
1407      <text string="Melon" state="93">
1408         <color red="1.0" green="1.0" blue="1.0" />
1409         <bounds x="0" y="0.1" width="1" height="1" />
1410      </text>
1411      <text string="Melon" state="94">
1412         <color red="1.0" green="1.0" blue="1.0" />
1413         <bounds x="0" y="0.1" width="1" height="1" />
1414      </text>
1415      <text string="Melon" state="95">
1416         <color red="1.0" green="1.0" blue="1.0" />
1417         <bounds x="0" y="0.1" width="1" height="1" />
1418      </text>
271   <element name="SteppersReel3" defstate="0">
272   <reel stateoffset="0" symbollist="Bell:bell.png,7:7.png,Melon:melon.png,Bell:bell.png,Cherry:cherry.png,Bar:bar.png,Bell:bell.png,Melon:melon.png,Bar:bar.png,Cherry:cherry.png,7:7.png,Melon:melon.png,Bar:bar.png,Cherry:cherry.png,Melon:melon.png,Cherry:cherry.png" reelreversed="1" numsymbolsvisible="3">
273   <color red="1.0" green="1.0" blue="1.0" />
274   <bounds x="0" y="0" width="1" height="1" />
275   </reel>
1419276   </element>
1420277
1421   <element name="Reel4" defstate="96">
1422      <text string="Bell" state="0">
1423         <color red="1.0" green="1.0" blue="1.0" />
1424         <bounds x="0" y="0.1" width="1" height="1" />
1425      </text>
1426      <text string="Bell" state="1">
1427         <color red="1.0" green="1.0" blue="1.0" />
1428         <bounds x="0" y="0.1" width="1" height="1" />
1429      </text>
1430      <text string="Bell" state="2">
1431         <color red="1.0" green="1.0" blue="1.0" />
1432         <bounds x="0" y="0.1" width="1" height="1" />
1433      </text>
1434      <text string="Bell" state="3">
1435         <color red="1.0" green="1.0" blue="1.0" />
1436         <bounds x="0" y="0.1" width="1" height="1" />
1437      </text>
1438      <text string="Bell" state="4">
1439         <color red="1.0" green="1.0" blue="1.0" />
1440         <bounds x="0" y="0.1" width="1" height="1" />
1441      </text>
1442      <text string="Bell" state="5">
1443         <color red="1.0" green="1.0" blue="1.0" />
1444         <bounds x="0" y="0.1" width="1" height="1" />
1445      </text>
1446      <text string="Melon" state="6">
1447         <color red="1.0" green="1.0" blue="1.0" />
1448         <bounds x="0" y="0.1" width="1" height="1" />
1449      </text>
1450      <text string="Melon" state="7">
1451         <color red="1.0" green="1.0" blue="1.0" />
1452         <bounds x="0" y="0.1" width="1" height="1" />
1453      </text>
1454      <text string="Melon" state="8">
1455         <color red="1.0" green="1.0" blue="1.0" />
1456         <bounds x="0" y="0.1" width="1" height="1" />
1457      </text>
1458      <text string="Melon" state="9">
1459         <color red="1.0" green="1.0" blue="1.0" />
1460         <bounds x="0" y="0.1" width="1" height="1" />
1461      </text>
1462      <text string="Melon" state="10">
1463         <color red="1.0" green="1.0" blue="1.0" />
1464         <bounds x="0" y="0.1" width="1" height="1" />
1465      </text>
1466      <text string="Melon" state="11">
1467         <color red="1.0" green="1.0" blue="1.0" />
1468         <bounds x="0" y="0.1" width="1" height="1" />
1469      </text>
1470      <text string="Bar" state="12">
1471         <color red="1.0" green="1.0" blue="1.0" />
1472         <bounds x="0" y="0.1" width="1" height="1" />
1473      </text>
1474      <text string="Bar" state="13">
1475         <color red="1.0" green="1.0" blue="1.0" />
1476         <bounds x="0" y="0.1" width="1" height="1" />
1477      </text>
1478      <text string="Bar" state="14">
1479         <color red="1.0" green="1.0" blue="1.0" />
1480         <bounds x="0" y="0.1" width="1" height="1" />
1481      </text>
1482      <text string="Bar" state="15">
1483         <color red="1.0" green="1.0" blue="1.0" />
1484         <bounds x="0" y="0.1" width="1" height="1" />
1485      </text>
1486      <text string="Bar" state="16">
1487         <color red="1.0" green="1.0" blue="1.0" />
1488         <bounds x="0" y="0.1" width="1" height="1" />
1489      </text>
1490      <text string="Bar" state="17">
1491         <color red="1.0" green="1.0" blue="1.0" />
1492         <bounds x="0" y="0.1" width="1" height="1" />
1493      </text>
1494      <text string="Bell" state="18">
1495         <color red="1.0" green="1.0" blue="1.0" />
1496         <bounds x="0" y="0.1" width="1" height="1" />
1497      </text>
1498      <text string="Bell" state="19">
1499         <color red="1.0" green="1.0" blue="1.0" />
1500         <bounds x="0" y="0.1" width="1" height="1" />
1501      </text>
1502      <text string="Bell" state="20">
1503         <color red="1.0" green="1.0" blue="1.0" />
1504         <bounds x="0" y="0.1" width="1" height="1" />
1505      </text>
1506      <text string="Bell" state="21">
1507         <color red="1.0" green="1.0" blue="1.0" />
1508         <bounds x="0" y="0.1" width="1" height="1" />
1509      </text>
1510      <text string="Bell" state="22">
1511         <color red="1.0" green="1.0" blue="1.0" />
1512         <bounds x="0" y="0.1" width="1" height="1" />
1513      </text>
1514      <text string="Bell" state="23">
1515         <color red="1.0" green="1.0" blue="1.0" />
1516         <bounds x="0" y="0.1" width="1" height="1" />
1517      </text>
1518      <text string="Cherry" state="24">
1519         <color red="1.0" green="1.0" blue="1.0" />
1520         <bounds x="0" y="0.1" width="1" height="1" />
1521      </text>
1522      <text string="Cherry" state="25">
1523         <color red="1.0" green="1.0" blue="1.0" />
1524         <bounds x="0" y="0.1" width="1" height="1" />
1525      </text>
1526      <text string="Cherry" state="26">
1527         <color red="1.0" green="1.0" blue="1.0" />
1528         <bounds x="0" y="0.1" width="1" height="1" />
1529      </text>
1530      <text string="Cherry" state="27">
1531         <color red="1.0" green="1.0" blue="1.0" />
1532         <bounds x="0" y="0.1" width="1" height="1" />
1533      </text>
1534      <text string="Cherry" state="28">
1535         <color red="1.0" green="1.0" blue="1.0" />
1536         <bounds x="0" y="0.1" width="1" height="1" />
1537      </text>
1538      <text string="Cherry" state="29">
1539         <color red="1.0" green="1.0" blue="1.0" />
1540         <bounds x="0" y="0.1" width="1" height="1" />
1541      </text>
1542      <text string="Melon" state="30">
1543         <color red="1.0" green="1.0" blue="1.0" />
1544         <bounds x="0" y="0.1" width="1" height="1" />
1545      </text>
1546      <text string="Melon" state="31">
1547         <color red="1.0" green="1.0" blue="1.0" />
1548         <bounds x="0" y="0.1" width="1" height="1" />
1549      </text>
1550      <text string="Melon" state="32">
1551         <color red="1.0" green="1.0" blue="1.0" />
1552         <bounds x="0" y="0.1" width="1" height="1" />
1553      </text>
1554      <text string="Melon" state="33">
1555         <color red="1.0" green="1.0" blue="1.0" />
1556         <bounds x="0" y="0.1" width="1" height="1" />
1557      </text>
1558      <text string="Melon" state="34">
1559         <color red="1.0" green="1.0" blue="1.0" />
1560         <bounds x="0" y="0.1" width="1" height="1" />
1561      </text>
1562      <text string="Melon" state="35">
1563         <color red="1.0" green="1.0" blue="1.0" />
1564         <bounds x="0" y="0.1" width="1" height="1" />
1565      </text>
1566      <text string="7" state="36">
1567         <color red="1.0" green="1.0" blue="1.0" />
1568         <bounds x="0" y="0.1" width="1" height="1" />
1569      </text>
1570      <text string="7" state="37">
1571         <color red="1.0" green="1.0" blue="1.0" />
1572         <bounds x="0" y="0.1" width="1" height="1" />
1573      </text>
1574      <text string="7" state="38">
1575         <color red="1.0" green="1.0" blue="1.0" />
1576         <bounds x="0" y="0.1" width="1" height="1" />
1577      </text>
1578      <text string="7" state="39">
1579         <color red="1.0" green="1.0" blue="1.0" />
1580         <bounds x="0" y="0.1" width="1" height="1" />
1581      </text>
1582      <text string="7" state="40">
1583         <color red="1.0" green="1.0" blue="1.0" />
1584         <bounds x="0" y="0.1" width="1" height="1" />
1585      </text>
1586      <text string="7" state="41">
1587         <color red="1.0" green="1.0" blue="1.0" />
1588         <bounds x="0" y="0.1" width="1" height="1" />
1589      </text>
1590      <text string="Bar" state="42">
1591         <color red="1.0" green="1.0" blue="1.0" />
1592         <bounds x="0" y="0.1" width="1" height="1" />
1593      </text>
1594      <text string="Bar" state="43">
1595         <color red="1.0" green="1.0" blue="1.0" />
1596         <bounds x="0" y="0.1" width="1" height="1" />
1597      </text>
1598      <text string="Bar" state="44">
1599         <color red="1.0" green="1.0" blue="1.0" />
1600         <bounds x="0" y="0.1" width="1" height="1" />
1601      </text>
1602      <text string="Bar" state="45">
1603         <color red="1.0" green="1.0" blue="1.0" />
1604         <bounds x="0" y="0.1" width="1" height="1" />
1605      </text>
1606      <text string="Bar" state="46">
1607         <color red="1.0" green="1.0" blue="1.0" />
1608         <bounds x="0" y="0.1" width="1" height="1" />
1609      </text>
1610      <text string="Bar" state="47">
1611         <color red="1.0" green="1.0" blue="1.0" />
1612         <bounds x="0" y="0.1" width="1" height="1" />
1613      </text>
1614      <text string="Cherry" state="48">
1615         <color red="1.0" green="1.0" blue="1.0" />
1616         <bounds x="0" y="0.1" width="1" height="1" />
1617      </text>
1618      <text string="Cherry" state="49">
1619         <color red="1.0" green="1.0" blue="1.0" />
1620         <bounds x="0" y="0.1" width="1" height="1" />
1621      </text>
1622      <text string="Cherry" state="50">
1623         <color red="1.0" green="1.0" blue="1.0" />
1624         <bounds x="0" y="0.1" width="1" height="1" />
1625      </text>
1626      <text string="Cherry" state="51">
1627         <color red="1.0" green="1.0" blue="1.0" />
1628         <bounds x="0" y="0.1" width="1" height="1" />
1629      </text>
1630      <text string="Cherry" state="52">
1631         <color red="1.0" green="1.0" blue="1.0" />
1632         <bounds x="0" y="0.1" width="1" height="1" />
1633      </text>
1634      <text string="Cherry" state="53">
1635         <color red="1.0" green="1.0" blue="1.0" />
1636         <bounds x="0" y="0.1" width="1" height="1" />
1637      </text>
1638      <text string="Bell" state="54">
1639         <color red="1.0" green="1.0" blue="1.0" />
1640         <bounds x="0" y="0.1" width="1" height="1" />
1641      </text>
1642      <text string="Bell" state="55">
1643         <color red="1.0" green="1.0" blue="1.0" />
1644         <bounds x="0" y="0.1" width="1" height="1" />
1645      </text>
1646      <text string="Bell" state="56">
1647         <color red="1.0" green="1.0" blue="1.0" />
1648         <bounds x="0" y="0.1" width="1" height="1" />
1649      </text>
1650      <text string="Bell" state="57">
1651         <color red="1.0" green="1.0" blue="1.0" />
1652         <bounds x="0" y="0.1" width="1" height="1" />
1653      </text>
1654      <text string="Bell" state="58">
1655         <color red="1.0" green="1.0" blue="1.0" />
1656         <bounds x="0" y="0.1" width="1" height="1" />
1657      </text>
1658      <text string="Bell" state="59">
1659         <color red="1.0" green="1.0" blue="1.0" />
1660         <bounds x="0" y="0.1" width="1" height="1" />
1661      </text>
1662      <text string="Melon" state="60">
1663         <color red="1.0" green="1.0" blue="1.0" />
1664         <bounds x="0" y="0.1" width="1" height="1" />
1665      </text>
1666      <text string="Melon" state="61">
1667         <color red="1.0" green="1.0" blue="1.0" />
1668         <bounds x="0" y="0.1" width="1" height="1" />
1669      </text>
1670      <text string="Melon" state="62">
1671         <color red="1.0" green="1.0" blue="1.0" />
1672         <bounds x="0" y="0.1" width="1" height="1" />
1673      </text>
1674      <text string="Melon" state="63">
1675         <color red="1.0" green="1.0" blue="1.0" />
1676         <bounds x="0" y="0.1" width="1" height="1" />
1677      </text>
1678      <text string="Melon" state="64">
1679         <color red="1.0" green="1.0" blue="1.0" />
1680         <bounds x="0" y="0.1" width="1" height="1" />
1681      </text>
1682      <text string="Melon" state="65">
1683         <color red="1.0" green="1.0" blue="1.0" />
1684         <bounds x="0" y="0.1" width="1" height="1" />
1685      </text>
1686      <text string="Cherry" state="66">
1687         <color red="1.0" green="1.0" blue="1.0" />
1688         <bounds x="0" y="0.1" width="1" height="1" />
1689      </text>
1690      <text string="Cherry" state="67">
1691         <color red="1.0" green="1.0" blue="1.0" />
1692         <bounds x="0" y="0.1" width="1" height="1" />
1693      </text>
1694      <text string="Cherry" state="68">
1695         <color red="1.0" green="1.0" blue="1.0" />
1696         <bounds x="0" y="0.1" width="1" height="1" />
1697      </text>
1698      <text string="Cherry" state="69">
1699         <color red="1.0" green="1.0" blue="1.0" />
1700         <bounds x="0" y="0.1" width="1" height="1" />
1701      </text>
1702      <text string="Cherry" state="70">
1703         <color red="1.0" green="1.0" blue="1.0" />
1704         <bounds x="0" y="0.1" width="1" height="1" />
1705      </text>
1706      <text string="Cherry" state="71">
1707         <color red="1.0" green="1.0" blue="1.0" />
1708         <bounds x="0" y="0.1" width="1" height="1" />
1709      </text>
1710      <text string="7" state="72">
1711         <color red="1.0" green="1.0" blue="1.0" />
1712         <bounds x="0" y="0.1" width="1" height="1" />
1713      </text>
1714      <text string="7" state="73">
1715         <color red="1.0" green="1.0" blue="1.0" />
1716         <bounds x="0" y="0.1" width="1" height="1" />
1717      </text>
1718      <text string="7" state="74">
1719         <color red="1.0" green="1.0" blue="1.0" />
1720         <bounds x="0" y="0.1" width="1" height="1" />
1721      </text>
1722      <text string="7" state="75">
1723         <color red="1.0" green="1.0" blue="1.0" />
1724         <bounds x="0" y="0.1" width="1" height="1" />
1725      </text>
1726      <text string="7" state="76">
1727         <color red="1.0" green="1.0" blue="1.0" />
1728         <bounds x="0" y="0.1" width="1" height="1" />
1729      </text>
1730      <text string="7" state="77">
1731         <color red="1.0" green="1.0" blue="1.0" />
1732         <bounds x="0" y="0.1" width="1" height="1" />
1733      </text>
1734      <text string="Bar" state="78">
1735         <color red="1.0" green="1.0" blue="1.0" />
1736         <bounds x="0" y="0.1" width="1" height="1" />
1737      </text>
1738      <text string="Bar" state="79">
1739         <color red="1.0" green="1.0" blue="1.0" />
1740         <bounds x="0" y="0.1" width="1" height="1" />
1741      </text>
1742      <text string="Bar" state="80">
1743         <color red="1.0" green="1.0" blue="1.0" />
1744         <bounds x="0" y="0.1" width="1" height="1" />
1745      </text>
1746      <text string="Bar" state="81">
1747         <color red="1.0" green="1.0" blue="1.0" />
1748         <bounds x="0" y="0.1" width="1" height="1" />
1749      </text>
1750      <text string="Bar" state="82">
1751         <color red="1.0" green="1.0" blue="1.0" />
1752         <bounds x="0" y="0.1" width="1" height="1" />
1753      </text>
1754      <text string="Bar" state="83">
1755         <color red="1.0" green="1.0" blue="1.0" />
1756         <bounds x="0" y="0.1" width="1" height="1" />
1757      </text>
1758      <text string="Bell" state="84">
1759         <color red="1.0" green="1.0" blue="1.0" />
1760         <bounds x="0" y="0.1" width="1" height="1" />
1761      </text>
1762      <text string="Bell" state="85">
1763         <color red="1.0" green="1.0" blue="1.0" />
1764         <bounds x="0" y="0.1" width="1" height="1" />
1765      </text>
1766      <text string="Bell" state="86">
1767         <color red="1.0" green="1.0" blue="1.0" />
1768         <bounds x="0" y="0.1" width="1" height="1" />
1769      </text>
1770      <text string="Bell" state="87">
1771         <color red="1.0" green="1.0" blue="1.0" />
1772         <bounds x="0" y="0.1" width="1" height="1" />
1773      </text>
1774      <text string="Bell" state="88">
1775         <color red="1.0" green="1.0" blue="1.0" />
1776         <bounds x="0" y="0.1" width="1" height="1" />
1777      </text>
1778      <text string="Bell" state="89">
1779         <color red="1.0" green="1.0" blue="1.0" />
1780         <bounds x="0" y="0.1" width="1" height="1" />
1781      </text>
1782      <text string="7" state="90">
1783         <color red="1.0" green="1.0" blue="1.0" />
1784         <bounds x="0" y="0.1" width="1" height="1" />
1785      </text>
1786      <text string="7" state="91">
1787         <color red="1.0" green="1.0" blue="1.0" />
1788         <bounds x="0" y="0.1" width="1" height="1" />
1789      </text>
1790      <text string="7" state="92">
1791         <color red="1.0" green="1.0" blue="1.0" />
1792         <bounds x="0" y="0.1" width="1" height="1" />
1793      </text>
1794      <text string="7" state="93">
1795         <color red="1.0" green="1.0" blue="1.0" />
1796         <bounds x="0" y="0.1" width="1" height="1" />
1797      </text>
1798      <text string="7" state="94">
1799         <color red="1.0" green="1.0" blue="1.0" />
1800         <bounds x="0" y="0.1" width="1" height="1" />
1801      </text>
1802      <text string="7" state="95">
1803         <color red="1.0" green="1.0" blue="1.0" />
1804         <bounds x="0" y="0.1" width="1" height="1" />
1805      </text>
278   <element name="SteppersReel4" defstate="0">
279   <reel stateoffset="0" symbollist="Melon:melon.png,Bell:bell.png,7:7.png,Bell:bell.png,Bar:bar.png,7:7.png,Cherry:cherry.png,Melon:melon.png,Bell:bell.png,Cherry:cherry.png,Bar:bar.png,7:7.png,Melon:melon.png,Cherry:cherry.png,Bell:bell.png,Bar:bar.png" reelreversed="1" numsymbolsvisible="3">
280   <color red="1.0" green="1.0" blue="1.0" />
281   <bounds x="0" y="0" width="1" height="1" />
282   </reel>
1806283   </element>
1807284   <element name="vfd0">
1808285   <led16segsc>
r15082r15083
1811288   </element>
1812289
1813290   <view name="Gamball AWP Simulated Video (No Artwork)">
1814      <backdrop name="TotalReels" element="TotalReels"/>
1815      <backdrop name="ReelSteps1" element="ReelSteps1"/>
1816      <backdrop name="ReelSteps2" element="ReelSteps2"/>
1817      <backdrop name="ReelSteps3" element="ReelSteps2"/>
1818      <backdrop name="ReelSteps4" element="ReelSteps2"/>
1819      <backdrop name="ReelSymbols1" element="ReelSymbols1"/>
1820      <backdrop name="ReelSymbols2" element="ReelSymbols1"/>
1821      <backdrop name="ReelSymbols3" element="ReelSymbols1"/>
1822      <backdrop name="ReelSymbols4" element="ReelSymbols1"/>
1823291      <backdrop name="lamp8" element="reellamp" state="0">
1824292         <bounds x="85" y="491.3333" width="49" height="29.3333"/>
1825293      </backdrop>
1826      <backdrop name="reel1" element="Reel1" state="96">
1827         <bounds x="85" y="491.3333" width="49" height="29.3333"/>
1828      </backdrop>
1829294      <backdrop name="lamp16" element="reellamp" state="0">
1830295         <bounds x="85" y="520.6666" width="49" height="29.3333"/>
1831296      </backdrop>
1832      <backdrop name="reel1b1" element="Reel1" state="96">
1833         <bounds x="85" y="520.6666" width="49" height="29.3333"/>
297
298      <backdrop name="sreel1" element="SteppersReel1" state="0">
299         <bounds x="85" y="491.3333" width="50" height="58.6666"/>
1834300      </backdrop>
301
1835302      <backdrop name="lamp26" element="cancol" state="0" inputtag="BLACK2" inputmask="0x04">
1836303         <bounds x="10" y="560" width="50" height="30"/>
1837304      </backdrop>
r15082r15083
1879346      <backdrop name="lamp1" element="reellamp" state="0">
1880347         <bounds x="161" y="463" width="49" height="29.3333"/>
1881348      </backdrop>
1882      <backdrop name="reel2a1" element="Reel2" state="96">
1883         <bounds x="161" y="463" width="49" height="29.3333"/>
1884      </backdrop>
1885349      <backdrop name="lamp9" element="reellamp" state="0">
1886350         <bounds x="161" y="491.3333" width="49" height="29.3333"/>
1887351      </backdrop>
1888      <backdrop name="reel2" element="Reel2" state="96">
1889         <bounds x="161" y="491.3333" width="49" height="29.3333"/>
1890      </backdrop>
1891352      <backdrop name="lamp17" element="reellamp" state="0">
1892353         <bounds x="161" y="520.6666" width="49" height="29.3333"/>
1893354      </backdrop>
1894      <backdrop name="reel2b1" element="Reel2" state="96">
1895         <bounds x="161" y="520.6666" width="49" height="29.3333"/>
355      <backdrop name="sreel2" element="SteppersReel2" state="96">
356         <bounds x="161" y="463" width="49" height="87.9999"/>
1896357      </backdrop>
1897358      <backdrop name="lamp2" element="reellamp" state="0">
1898359         <bounds x="236" y="463" width="49" height="29.3333"/>
1899360      </backdrop>
1900      <backdrop name="reel3a1" element="Reel3" state="96">
1901         <bounds x="236" y="463" width="49" height="29.3333"/>
1902      </backdrop>
1903361      <backdrop name="lamp10" element="reellamp" state="0">
1904362         <bounds x="236" y="491.333" width="49" height="29.3333"/>
1905363      </backdrop>
1906      <backdrop name="reel3" element="Reel3" state="96">
1907         <bounds x="236" y="491.3333" width="49" height="29.3333"/>
1908      </backdrop>
1909364      <backdrop name="lamp18" element="reellamp" state="0">
1910365         <bounds x="236" y="520.6666" width="49" height="29.3333"/>
1911366      </backdrop>
1912      <backdrop name="reel3b1" element="Reel3" state="96">
1913         <bounds x="236" y="520.6666" width="49" height="29.3333"/>
367      <backdrop name="sreel3" element="SteppersReel3" state="96">
368         <bounds x="236" y="463" width="49" height="87.9999"/>
1914369      </backdrop>
1915370      <backdrop name="lamp3" element="reellamp" state="0">
1916371         <bounds x="311" y="463" width="49" height="29.3333"/>
1917372      </backdrop>
1918      <backdrop name="reel4a1" element="Reel4" state="96">
1919         <bounds x="311" y="463" width="49" height="29.3333"/>
1920      </backdrop>
1921373      <backdrop name="lamp11" element="reellamp" state="0">
1922374         <bounds x="311" y="491.3333" width="49" height="29.3333"/>
1923375      </backdrop>
1924      <backdrop name="reel4" element="Reel4" state="96">
1925         <bounds x="311" y="491.3333" width="49" height="29.3333"/>
1926      </backdrop>
1927376      <backdrop name="lamp19" element="reellamp" state="0">
1928377         <bounds x="311" y="520.6666" width="49" height="29.3333"/>
1929378      </backdrop>
1930      <backdrop name="reel4b1" element="Reel4" state="96">
1931         <bounds x="311" y="520.6666" width="49" height="29.3333"/>
379      <backdrop name="sreel4" element="SteppersReel4" state="96">
380         <bounds x="311" y="463" width="49" height="87.9999"/>
1932381      </backdrop>
1933
1934382      <backdrop name="lamp68" element="1" state="0">
1935383         <bounds x="64" y="310" width="30" height="20"/>
1936384      </backdrop>
src/mame/layout/awpdmd.lay
r15082r15083
2020   </dotmatrix>
2121   </element>
2222
23   <element name="Steppers" defstate="96">
24      <text string="00" state="0">
25         <color red="1.0" green="1.0" blue="1.0" />
26         <bounds x="0" y="0.1" width="1" height="1" />
27      </text>
28      <text string="01" state="1">
29         <color red="1.0" green="1.0" blue="1.0" />
30         <bounds x="0" y="0.1" width="1" height="1" />
31      </text>
32      <text string="02" state="2">
33         <color red="1.0" green="1.0" blue="1.0" />
34         <bounds x="0" y="0.1" width="1" height="1" />
35      </text>
36      <text string="03" state="3">
37         <color red="1.0" green="1.0" blue="1.0" />
38         <bounds x="0" y="0.1" width="1" height="1" />
39      </text>
40      <text string="04" state="4">
41         <color red="1.0" green="1.0" blue="1.0" />
42         <bounds x="0" y="0.1" width="1" height="1" />
43      </text>
44      <text string="05" state="5">
45         <color red="1.0" green="1.0" blue="1.0" />
46         <bounds x="0" y="0.1" width="1" height="1" />
47      </text>
48      <text string="06" state="6">
49         <color red="1.0" green="1.0" blue="1.0" />
50         <bounds x="0" y="0.1" width="1" height="1" />
51      </text>
52      <text string="07" state="7">
53         <color red="1.0" green="1.0" blue="1.0" />
54         <bounds x="0" y="0.1" width="1" height="1" />
55      </text>
56      <text string="08" state="8">
57         <color red="1.0" green="1.0" blue="1.0" />
58         <bounds x="0" y="0.1" width="1" height="1" />
59      </text>
60      <text string="09" state="9">
61         <color red="1.0" green="1.0" blue="1.0" />
62         <bounds x="0" y="0.1" width="1" height="1" />
63      </text>
64      <text string="10" state="10">
65         <color red="1.0" green="1.0" blue="1.0" />
66         <bounds x="0" y="0.1" width="1" height="1" />
67      </text>
68      <text string="11" state="11">
69         <color red="1.0" green="1.0" blue="1.0" />
70         <bounds x="0" y="0.1" width="1" height="1" />
71      </text>
72      <text string="12" state="12">
73         <color red="1.0" green="1.0" blue="1.0" />
74         <bounds x="0" y="0.1" width="1" height="1" />
75      </text>
76      <text string="13" state="13">
77         <color red="1.0" green="1.0" blue="1.0" />
78         <bounds x="0" y="0.1" width="1" height="1" />
79      </text>
80      <text string="14" state="14">
81         <color red="1.0" green="1.0" blue="1.0" />
82         <bounds x="0" y="0.1" width="1" height="1" />
83      </text>
84      <text string="15" state="15">
85         <color red="1.0" green="1.0" blue="1.0" />
86         <bounds x="0" y="0.1" width="1" height="1" />
87      </text>
88      <text string="16" state="16">
89         <color red="1.0" green="1.0" blue="1.0" />
90         <bounds x="0" y="0.1" width="1" height="1" />
91      </text>
92      <text string="17" state="17">
93         <color red="1.0" green="1.0" blue="1.0" />
94         <bounds x="0" y="0.1" width="1" height="1" />
95      </text>
96      <text string="18" state="18">
97         <color red="1.0" green="1.0" blue="1.0" />
98         <bounds x="0" y="0.1" width="1" height="1" />
99      </text>
100      <text string="19" state="19">
101         <color red="1.0" green="1.0" blue="1.0" />
102         <bounds x="0" y="0.1" width="1" height="1" />
103      </text>
104      <text string="20" state="20">
105         <color red="1.0" green="1.0" blue="1.0" />
106         <bounds x="0" y="0.1" width="1" height="1" />
107      </text>
108      <text string="21" state="21">
109         <color red="1.0" green="1.0" blue="1.0" />
110         <bounds x="0" y="0.1" width="1" height="1" />
111      </text>
112      <text string="22" state="22">
113         <color red="1.0" green="1.0" blue="1.0" />
114         <bounds x="0" y="0.1" width="1" height="1" />
115      </text>
116      <text string="23" state="23">
117         <color red="1.0" green="1.0" blue="1.0" />
118         <bounds x="0" y="0.1" width="1" height="1" />
119      </text>
120      <text string="24" state="24">
121         <color red="1.0" green="1.0" blue="1.0" />
122         <bounds x="0" y="0.1" width="1" height="1" />
123      </text>
124      <text string="25" state="25">
125         <color red="1.0" green="1.0" blue="1.0" />
126         <bounds x="0" y="0.1" width="1" height="1" />
127      </text>
128
129      <text string="26" state="26">
130         <color red="1.0" green="1.0" blue="1.0" />
131         <bounds x="0" y="0.1" width="1" height="1" />
132      </text>
133      <text string="27" state="27">
134         <color red="1.0" green="1.0" blue="1.0" />
135         <bounds x="0" y="0.1" width="1" height="1" />
136      </text>
137      <text string="28" state="28">
138         <color red="1.0" green="1.0" blue="1.0" />
139         <bounds x="0" y="0.1" width="1" height="1" />
140      </text>
141      <text string="29" state="29">
142         <color red="1.0" green="1.0" blue="1.0" />
143         <bounds x="0" y="0.1" width="1" height="1" />
144      </text>
145      <text string="30" state="30">
146         <color red="1.0" green="1.0" blue="1.0" />
147         <bounds x="0" y="0.1" width="1" height="1" />
148      </text>
149      <text string="31" state="31">
150         <color red="1.0" green="1.0" blue="1.0" />
151         <bounds x="0" y="0.1" width="1" height="1" />
152      </text>
153      <text string="32" state="32">
154         <color red="1.0" green="1.0" blue="1.0" />
155         <bounds x="0" y="0.1" width="1" height="1" />
156      </text>
157      <text string="33" state="33">
158         <color red="1.0" green="1.0" blue="1.0" />
159         <bounds x="0" y="0.1" width="1" height="1" />
160      </text>
161      <text string="34" state="34">
162         <color red="1.0" green="1.0" blue="1.0" />
163         <bounds x="0" y="0.1" width="1" height="1" />
164      </text>
165      <text string="35" state="35">
166         <color red="1.0" green="1.0" blue="1.0" />
167         <bounds x="0" y="0.1" width="1" height="1" />
168      </text>
169      <text string="36" state="36">
170         <color red="1.0" green="1.0" blue="1.0" />
171         <bounds x="0" y="0.1" width="1" height="1" />
172      </text>
173      <text string="37" state="37">
174         <color red="1.0" green="1.0" blue="1.0" />
175         <bounds x="0" y="0.1" width="1" height="1" />
176      </text>
177      <text string="38" state="38">
178         <color red="1.0" green="1.0" blue="1.0" />
179         <bounds x="0" y="0.1" width="1" height="1" />
180      </text>
181      <text string="39" state="39">
182         <color red="1.0" green="1.0" blue="1.0" />
183         <bounds x="0" y="0.1" width="1" height="1" />
184      </text>
185      <text string="40" state="40">
186         <color red="1.0" green="1.0" blue="1.0" />
187         <bounds x="0" y="0.1" width="1" height="1" />
188      </text>
189      <text string="41" state="41">
190         <color red="1.0" green="1.0" blue="1.0" />
191         <bounds x="0" y="0.1" width="1" height="1" />
192      </text>
193      <text string="42" state="42">
194         <color red="1.0" green="1.0" blue="1.0" />
195         <bounds x="0" y="0.1" width="1" height="1" />
196      </text>
197      <text string="43" state="43">
198         <color red="1.0" green="1.0" blue="1.0" />
199         <bounds x="0" y="0.1" width="1" height="1" />
200      </text>
201      <text string="44" state="44">
202         <color red="1.0" green="1.0" blue="1.0" />
203         <bounds x="0" y="0.1" width="1" height="1" />
204      </text>
205      <text string="45" state="45">
206         <color red="1.0" green="1.0" blue="1.0" />
207         <bounds x="0" y="0.1" width="1" height="1" />
208      </text>
209      <text string="46" state="46">
210         <color red="1.0" green="1.0" blue="1.0" />
211         <bounds x="0" y="0.1" width="1" height="1" />
212      </text>
213      <text string="47" state="47">
214         <color red="1.0" green="1.0" blue="1.0" />
215         <bounds x="0" y="0.1" width="1" height="1" />
216      </text>
217      <text string="48" state="48">
218         <color red="1.0" green="1.0" blue="1.0" />
219         <bounds x="0" y="0.1" width="1" height="1" />
220      </text>
221      <text string="49" state="49">
222         <color red="1.0" green="1.0" blue="1.0" />
223         <bounds x="0" y="0.1" width="1" height="1" />
224      </text>
225      <text string="50" state="50">
226         <color red="1.0" green="1.0" blue="1.0" />
227         <bounds x="0" y="0.1" width="1" height="1" />
228      </text>
229      <text string="51" state="51">
230         <color red="1.0" green="1.0" blue="1.0" />
231         <bounds x="0" y="0.1" width="1" height="1" />
232      </text>
233      <text string="52" state="52">
234         <color red="1.0" green="1.0" blue="1.0" />
235         <bounds x="0" y="0.1" width="1" height="1" />
236      </text>
237      <text string="53" state="53">
238         <color red="1.0" green="1.0" blue="1.0" />
239         <bounds x="0" y="0.1" width="1" height="1" />
240      </text>
241      <text string="54" state="54">
242         <color red="1.0" green="1.0" blue="1.0" />
243         <bounds x="0" y="0.1" width="1" height="1" />
244      </text>
245      <text string="55" state="55">
246         <color red="1.0" green="1.0" blue="1.0" />
247         <bounds x="0" y="0.1" width="1" height="1" />
248      </text>
249      <text string="56" state="56">
250         <color red="1.0" green="1.0" blue="1.0" />
251         <bounds x="0" y="0.1" width="1" height="1" />
252      </text>
253      <text string="57" state="57">
254         <color red="1.0" green="1.0" blue="1.0" />
255         <bounds x="0" y="0.1" width="1" height="1" />
256      </text>
257      <text string="58" state="58">
258         <color red="1.0" green="1.0" blue="1.0" />
259         <bounds x="0" y="0.1" width="1" height="1" />
260      </text>
261      <text string="59" state="59">
262         <color red="1.0" green="1.0" blue="1.0" />
263         <bounds x="0" y="0.1" width="1" height="1" />
264      </text>
265      <text string="60" state="60">
266         <color red="1.0" green="1.0" blue="1.0" />
267         <bounds x="0" y="0.1" width="1" height="1" />
268      </text>
269      <text string="61" state="61">
270         <color red="1.0" green="1.0" blue="1.0" />
271         <bounds x="0" y="0.1" width="1" height="1" />
272      </text>
273      <text string="62" state="62">
274         <color red="1.0" green="1.0" blue="1.0" />
275         <bounds x="0" y="0.1" width="1" height="1" />
276      </text>
277      <text string="63" state="63">
278         <color red="1.0" green="1.0" blue="1.0" />
279         <bounds x="0" y="0.1" width="1" height="1" />
280      </text>
281      <text string="64" state="64">
282         <color red="1.0" green="1.0" blue="1.0" />
283         <bounds x="0" y="0.1" width="1" height="1" />
284      </text>
285      <text string="65" state="65">
286         <color red="1.0" green="1.0" blue="1.0" />
287         <bounds x="0" y="0.1" width="1" height="1" />
288      </text>
289      <text string="66" state="66">
290         <color red="1.0" green="1.0" blue="1.0" />
291         <bounds x="0" y="0.1" width="1" height="1" />
292      </text>
293      <text string="67" state="67">
294         <color red="1.0" green="1.0" blue="1.0" />
295         <bounds x="0" y="0.1" width="1" height="1" />
296      </text>
297      <text string="68" state="68">
298         <color red="1.0" green="1.0" blue="1.0" />
299         <bounds x="0" y="0.1" width="1" height="1" />
300      </text>
301      <text string="69" state="69">
302         <color red="1.0" green="1.0" blue="1.0" />
303         <bounds x="0" y="0.1" width="1" height="1" />
304      </text>
305      <text string="70" state="70">
306         <color red="1.0" green="1.0" blue="1.0" />
307         <bounds x="0" y="0.1" width="1" height="1" />
308      </text>
309      <text string="71" state="71">
310         <color red="1.0" green="1.0" blue="1.0" />
311         <bounds x="0" y="0.1" width="1" height="1" />
312      </text>
313      <text string="72" state="72">
314         <color red="1.0" green="1.0" blue="1.0" />
315         <bounds x="0" y="0.1" width="1" height="1" />
316      </text>
317      <text string="73" state="73">
318         <color red="1.0" green="1.0" blue="1.0" />
319         <bounds x="0" y="0.1" width="1" height="1" />
320      </text>
321      <text string="74" state="74">
322         <color red="1.0" green="1.0" blue="1.0" />
323         <bounds x="0" y="0.1" width="1" height="1" />
324      </text>
325      <text string="75" state="75">
326         <color red="1.0" green="1.0" blue="1.0" />
327         <bounds x="0" y="0.1" width="1" height="1" />
328      </text>
329      <text string="76" state="76">
330         <color red="1.0" green="1.0" blue="1.0" />
331         <bounds x="0" y="0.1" width="1" height="1" />
332      </text>
333      <text string="77" state="77">
334         <color red="1.0" green="1.0" blue="1.0" />
335         <bounds x="0" y="0.1" width="1" height="1" />
336      </text>
337      <text string="78" state="78">
338         <color red="1.0" green="1.0" blue="1.0" />
339         <bounds x="0" y="0.1" width="1" height="1" />
340      </text>
341      <text string="79" state="79">
342         <color red="1.0" green="1.0" blue="1.0" />
343         <bounds x="0" y="0.1" width="1" height="1" />
344      </text>
345      <text string="80" state="80">
346         <color red="1.0" green="1.0" blue="1.0" />
347         <bounds x="0" y="0.1" width="1" height="1" />
348      </text>
349      <text string="81" state="81">
350         <color red="1.0" green="1.0" blue="1.0" />
351         <bounds x="0" y="0.1" width="1" height="1" />
352      </text>
353      <text string="82" state="82">
354         <color red="1.0" green="1.0" blue="1.0" />
355         <bounds x="0" y="0.1" width="1" height="1" />
356      </text>
357      <text string="83" state="83">
358         <color red="1.0" green="1.0" blue="1.0" />
359         <bounds x="0" y="0.1" width="1" height="1" />
360      </text>
361      <text string="84" state="84">
362         <color red="1.0" green="1.0" blue="1.0" />
363         <bounds x="0" y="0.1" width="1" height="1" />
364      </text>
365      <text string="85" state="85">
366         <color red="1.0" green="1.0" blue="1.0" />
367         <bounds x="0" y="0.1" width="1" height="1" />
368      </text>
369      <text string="86" state="86">
370         <color red="1.0" green="1.0" blue="1.0" />
371         <bounds x="0" y="0.1" width="1" height="1" />
372      </text>
373      <text string="87" state="87">
374         <color red="1.0" green="1.0" blue="1.0" />
375         <bounds x="0" y="0.1" width="1" height="1" />
376      </text>
377      <text string="88" state="88">
378         <color red="1.0" green="1.0" blue="1.0" />
379         <bounds x="0" y="0.1" width="1" height="1" />
380      </text>
381      <text string="89" state="89">
382         <color red="1.0" green="1.0" blue="1.0" />
383         <bounds x="0" y="0.1" width="1" height="1" />
384      </text>
385      <text string="90" state="90">
386         <color red="1.0" green="1.0" blue="1.0" />
387         <bounds x="0" y="0.1" width="1" height="1" />
388      </text>
389      <text string="91" state="91">
390         <color red="1.0" green="1.0" blue="1.0" />
391         <bounds x="0" y="0.1" width="1" height="1" />
392      </text>
393      <text string="92" state="92">
394         <color red="1.0" green="1.0" blue="1.0" />
395         <bounds x="0" y="0.1" width="1" height="1" />
396      </text>
397      <text string="93" state="93">
398         <color red="1.0" green="1.0" blue="1.0" />
399         <bounds x="0" y="0.1" width="1" height="1" />
400      </text>
401      <text string="94" state="94">
402         <color red="1.0" green="1.0" blue="1.0" />
403         <bounds x="0" y="0.1" width="1" height="1" />
404      </text>
405      <text string="95" state="95">
406         <color red="1.0" green="1.0" blue="1.0" />
407         <bounds x="0" y="0.1" width="1" height="1" />
408      </text>
23   <element name="Steppers" defstate="0">
24       <simplecounter maxstate="999" digits="3">
25      <color red="1.0" green="1.0" blue="1.0" />
26      <bounds x="0" y="0" width="1" height="1" />
27      </simplecounter>
40928   </element>
41029
30
41131   <view name="AWP Simulated Video (Reels and Lamp Matrix)">
41232      <backdrop name="matrix0" element="matrix" state="0">
41333         <bounds x="150" y="60" width="8" height="1"/>
src/mame/layout/mpu4.lay
r15082r15083
1919         <color red="0.0" green="1.0" blue="0.0" />
2020      </rect>
2121   </element>
22   <element name="Steppers" defstate="96">
23      <text string="00" state="0">
24         <color red="1.0" green="1.0" blue="1.0" />
25         <bounds x="0" y="0.1" width="1" height="1" />
26      </text>
27      <text string="01" state="1">
28         <color red="1.0" green="1.0" blue="1.0" />
29         <bounds x="0" y="0.1" width="1" height="1" />
30      </text>
31      <text string="02" state="2">
32         <color red="1.0" green="1.0" blue="1.0" />
33         <bounds x="0" y="0.1" width="1" height="1" />
34      </text>
35      <text string="03" state="3">
36         <color red="1.0" green="1.0" blue="1.0" />
37         <bounds x="0" y="0.1" width="1" height="1" />
38      </text>
39      <text string="04" state="4">
40         <color red="1.0" green="1.0" blue="1.0" />
41         <bounds x="0" y="0.1" width="1" height="1" />
42      </text>
43      <text string="05" state="5">
44         <color red="1.0" green="1.0" blue="1.0" />
45         <bounds x="0" y="0.1" width="1" height="1" />
46      </text>
47      <text string="06" state="6">
48         <color red="1.0" green="1.0" blue="1.0" />
49         <bounds x="0" y="0.1" width="1" height="1" />
50      </text>
51      <text string="07" state="7">
52         <color red="1.0" green="1.0" blue="1.0" />
53         <bounds x="0" y="0.1" width="1" height="1" />
54      </text>
55      <text string="08" state="8">
56         <color red="1.0" green="1.0" blue="1.0" />
57         <bounds x="0" y="0.1" width="1" height="1" />
58      </text>
59      <text string="09" state="9">
60         <color red="1.0" green="1.0" blue="1.0" />
61         <bounds x="0" y="0.1" width="1" height="1" />
62      </text>
63      <text string="10" state="10">
64         <color red="1.0" green="1.0" blue="1.0" />
65         <bounds x="0" y="0.1" width="1" height="1" />
66      </text>
67      <text string="11" state="11">
68         <color red="1.0" green="1.0" blue="1.0" />
69         <bounds x="0" y="0.1" width="1" height="1" />
70      </text>
71      <text string="12" state="12">
72         <color red="1.0" green="1.0" blue="1.0" />
73         <bounds x="0" y="0.1" width="1" height="1" />
74      </text>
75      <text string="13" state="13">
76         <color red="1.0" green="1.0" blue="1.0" />
77         <bounds x="0" y="0.1" width="1" height="1" />
78      </text>
79      <text string="14" state="14">
80         <color red="1.0" green="1.0" blue="1.0" />
81         <bounds x="0" y="0.1" width="1" height="1" />
82      </text>
83      <text string="15" state="15">
84         <color red="1.0" green="1.0" blue="1.0" />
85         <bounds x="0" y="0.1" width="1" height="1" />
86      </text>
87      <text string="16" state="16">
88         <color red="1.0" green="1.0" blue="1.0" />
89         <bounds x="0" y="0.1" width="1" height="1" />
90      </text>
91      <text string="17" state="17">
92         <color red="1.0" green="1.0" blue="1.0" />
93         <bounds x="0" y="0.1" width="1" height="1" />
94      </text>
95      <text string="18" state="18">
96         <color red="1.0" green="1.0" blue="1.0" />
97         <bounds x="0" y="0.1" width="1" height="1" />
98      </text>
99      <text string="19" state="19">
100         <color red="1.0" green="1.0" blue="1.0" />
101         <bounds x="0" y="0.1" width="1" height="1" />
102      </text>
103      <text string="20" state="20">
104         <color red="1.0" green="1.0" blue="1.0" />
105         <bounds x="0" y="0.1" width="1" height="1" />
106      </text>
107      <text string="21" state="21">
108         <color red="1.0" green="1.0" blue="1.0" />
109         <bounds x="0" y="0.1" width="1" height="1" />
110      </text>
111      <text string="22" state="22">
112         <color red="1.0" green="1.0" blue="1.0" />
113         <bounds x="0" y="0.1" width="1" height="1" />
114      </text>
115      <text string="23" state="23">
116         <color red="1.0" green="1.0" blue="1.0" />
117         <bounds x="0" y="0.1" width="1" height="1" />
118      </text>
119      <text string="24" state="24">
120         <color red="1.0" green="1.0" blue="1.0" />
121         <bounds x="0" y="0.1" width="1" height="1" />
122      </text>
123      <text string="25" state="25">
124         <color red="1.0" green="1.0" blue="1.0" />
125         <bounds x="0" y="0.1" width="1" height="1" />
126      </text>
127      <text string="26" state="26">
128         <color red="1.0" green="1.0" blue="1.0" />
129         <bounds x="0" y="0.1" width="1" height="1" />
130      </text>
131      <text string="27" state="27">
132         <color red="1.0" green="1.0" blue="1.0" />
133         <bounds x="0" y="0.1" width="1" height="1" />
134      </text>
135      <text string="28" state="28">
136         <color red="1.0" green="1.0" blue="1.0" />
137         <bounds x="0" y="0.1" width="1" height="1" />
138      </text>
139      <text string="29" state="29">
140         <color red="1.0" green="1.0" blue="1.0" />
141         <bounds x="0" y="0.1" width="1" height="1" />
142      </text>
143      <text string="30" state="30">
144         <color red="1.0" green="1.0" blue="1.0" />
145         <bounds x="0" y="0.1" width="1" height="1" />
146      </text>
147      <text string="31" state="31">
148         <color red="1.0" green="1.0" blue="1.0" />
149         <bounds x="0" y="0.1" width="1" height="1" />
150      </text>
151      <text string="32" state="32">
152         <color red="1.0" green="1.0" blue="1.0" />
153         <bounds x="0" y="0.1" width="1" height="1" />
154      </text>
155      <text string="33" state="33">
156         <color red="1.0" green="1.0" blue="1.0" />
157         <bounds x="0" y="0.1" width="1" height="1" />
158      </text>
159      <text string="34" state="34">
160         <color red="1.0" green="1.0" blue="1.0" />
161         <bounds x="0" y="0.1" width="1" height="1" />
162      </text>
163      <text string="35" state="35">
164         <color red="1.0" green="1.0" blue="1.0" />
165         <bounds x="0" y="0.1" width="1" height="1" />
166      </text>
167      <text string="36" state="36">
168         <color red="1.0" green="1.0" blue="1.0" />
169         <bounds x="0" y="0.1" width="1" height="1" />
170      </text>
171      <text string="37" state="37">
172         <color red="1.0" green="1.0" blue="1.0" />
173         <bounds x="0" y="0.1" width="1" height="1" />
174      </text>
175      <text string="38" state="38">
176         <color red="1.0" green="1.0" blue="1.0" />
177         <bounds x="0" y="0.1" width="1" height="1" />
178      </text>
179      <text string="39" state="39">
180         <color red="1.0" green="1.0" blue="1.0" />
181         <bounds x="0" y="0.1" width="1" height="1" />
182      </text>
183      <text string="40" state="40">
184         <color red="1.0" green="1.0" blue="1.0" />
185         <bounds x="0" y="0.1" width="1" height="1" />
186      </text>
187      <text string="41" state="41">
188         <color red="1.0" green="1.0" blue="1.0" />
189         <bounds x="0" y="0.1" width="1" height="1" />
190      </text>
191      <text string="42" state="42">
192         <color red="1.0" green="1.0" blue="1.0" />
193         <bounds x="0" y="0.1" width="1" height="1" />
194      </text>
195      <text string="43" state="43">
196         <color red="1.0" green="1.0" blue="1.0" />
197         <bounds x="0" y="0.1" width="1" height="1" />
198      </text>
199      <text string="44" state="44">
200         <color red="1.0" green="1.0" blue="1.0" />
201         <bounds x="0" y="0.1" width="1" height="1" />
202      </text>
203      <text string="45" state="45">
204         <color red="1.0" green="1.0" blue="1.0" />
205         <bounds x="0" y="0.1" width="1" height="1" />
206      </text>
207      <text string="46" state="46">
208         <color red="1.0" green="1.0" blue="1.0" />
209         <bounds x="0" y="0.1" width="1" height="1" />
210      </text>
211      <text string="47" state="47">
212         <color red="1.0" green="1.0" blue="1.0" />
213         <bounds x="0" y="0.1" width="1" height="1" />
214      </text>
215      <text string="48" state="48">
216         <color red="1.0" green="1.0" blue="1.0" />
217         <bounds x="0" y="0.1" width="1" height="1" />
218      </text>
219      <text string="49" state="49">
220         <color red="1.0" green="1.0" blue="1.0" />
221         <bounds x="0" y="0.1" width="1" height="1" />
222      </text>
223      <text string="50" state="50">
224         <color red="1.0" green="1.0" blue="1.0" />
225         <bounds x="0" y="0.1" width="1" height="1" />
226      </text>
227      <text string="51" state="51">
228         <color red="1.0" green="1.0" blue="1.0" />
229         <bounds x="0" y="0.1" width="1" height="1" />
230      </text>
231      <text string="52" state="52">
232         <color red="1.0" green="1.0" blue="1.0" />
233         <bounds x="0" y="0.1" width="1" height="1" />
234      </text>
235      <text string="53" state="53">
236         <color red="1.0" green="1.0" blue="1.0" />
237         <bounds x="0" y="0.1" width="1" height="1" />
238      </text>
239      <text string="54" state="54">
240         <color red="1.0" green="1.0" blue="1.0" />
241         <bounds x="0" y="0.1" width="1" height="1" />
242      </text>
243      <text string="55" state="55">
244         <color red="1.0" green="1.0" blue="1.0" />
245         <bounds x="0" y="0.1" width="1" height="1" />
246      </text>
247      <text string="56" state="56">
248         <color red="1.0" green="1.0" blue="1.0" />
249         <bounds x="0" y="0.1" width="1" height="1" />
250      </text>
251      <text string="57" state="57">
252         <color red="1.0" green="1.0" blue="1.0" />
253         <bounds x="0" y="0.1" width="1" height="1" />
254      </text>
255      <text string="58" state="58">
256         <color red="1.0" green="1.0" blue="1.0" />
257         <bounds x="0" y="0.1" width="1" height="1" />
258      </text>
259      <text string="59" state="59">
260         <color red="1.0" green="1.0" blue="1.0" />
261         <bounds x="0" y="0.1" width="1" height="1" />
262      </text>
263      <text string="60" state="60">
264         <color red="1.0" green="1.0" blue="1.0" />
265         <bounds x="0" y="0.1" width="1" height="1" />
266      </text>
267      <text string="61" state="61">
268         <color red="1.0" green="1.0" blue="1.0" />
269         <bounds x="0" y="0.1" width="1" height="1" />
270      </text>
271      <text string="62" state="62">
272         <color red="1.0" green="1.0" blue="1.0" />
273         <bounds x="0" y="0.1" width="1" height="1" />
274      </text>
275      <text string="63" state="63">
276         <color red="1.0" green="1.0" blue="1.0" />
277         <bounds x="0" y="0.1" width="1" height="1" />
278      </text>
279      <text string="64" state="64">
280         <color red="1.0" green="1.0" blue="1.0" />
281         <bounds x="0" y="0.1" width="1" height="1" />
282      </text>
283      <text string="65" state="65">
284         <color red="1.0" green="1.0" blue="1.0" />
285         <bounds x="0" y="0.1" width="1" height="1" />
286      </text>
287      <text string="66" state="66">
288         <color red="1.0" green="1.0" blue="1.0" />
289         <bounds x="0" y="0.1" width="1" height="1" />
290      </text>
291      <text string="67" state="67">
292         <color red="1.0" green="1.0" blue="1.0" />
293         <bounds x="0" y="0.1" width="1" height="1" />
294      </text>
295      <text string="68" state="68">
296         <color red="1.0" green="1.0" blue="1.0" />
297         <bounds x="0" y="0.1" width="1" height="1" />
298      </text>
299      <text string="69" state="69">
300         <color red="1.0" green="1.0" blue="1.0" />
301         <bounds x="0" y="0.1" width="1" height="1" />
302      </text>
303      <text string="70" state="70">
304         <color red="1.0" green="1.0" blue="1.0" />
305         <bounds x="0" y="0.1" width="1" height="1" />
306      </text>
307      <text string="71" state="71">
308         <color red="1.0" green="1.0" blue="1.0" />
309         <bounds x="0" y="0.1" width="1" height="1" />
310      </text>
311      <text string="72" state="72">
312         <color red="1.0" green="1.0" blue="1.0" />
313         <bounds x="0" y="0.1" width="1" height="1" />
314      </text>
315      <text string="73" state="73">
316         <color red="1.0" green="1.0" blue="1.0" />
317         <bounds x="0" y="0.1" width="1" height="1" />
318      </text>
319      <text string="74" state="74">
320         <color red="1.0" green="1.0" blue="1.0" />
321         <bounds x="0" y="0.1" width="1" height="1" />
322      </text>
323      <text string="75" state="75">
324         <color red="1.0" green="1.0" blue="1.0" />
325         <bounds x="0" y="0.1" width="1" height="1" />
326      </text>
327      <text string="76" state="76">
328         <color red="1.0" green="1.0" blue="1.0" />
329         <bounds x="0" y="0.1" width="1" height="1" />
330      </text>
331      <text string="77" state="77">
332         <color red="1.0" green="1.0" blue="1.0" />
333         <bounds x="0" y="0.1" width="1" height="1" />
334      </text>
335      <text string="78" state="78">
336         <color red="1.0" green="1.0" blue="1.0" />
337         <bounds x="0" y="0.1" width="1" height="1" />
338      </text>
339      <text string="79" state="79">
340         <color red="1.0" green="1.0" blue="1.0" />
341         <bounds x="0" y="0.1" width="1" height="1" />
342      </text>
343      <text string="80" state="80">
344         <color red="1.0" green="1.0" blue="1.0" />
345         <bounds x="0" y="0.1" width="1" height="1" />
346      </text>
347      <text string="81" state="81">
348         <color red="1.0" green="1.0" blue="1.0" />
349         <bounds x="0" y="0.1" width="1" height="1" />
350      </text>
351      <text string="82" state="82">
352         <color red="1.0" green="1.0" blue="1.0" />
353         <bounds x="0" y="0.1" width="1" height="1" />
354      </text>
355      <text string="83" state="83">
356         <color red="1.0" green="1.0" blue="1.0" />
357         <bounds x="0" y="0.1" width="1" height="1" />
358      </text>
359      <text string="84" state="84">
360         <color red="1.0" green="1.0" blue="1.0" />
361         <bounds x="0" y="0.1" width="1" height="1" />
362      </text>
363      <text string="85" state="85">
364         <color red="1.0" green="1.0" blue="1.0" />
365         <bounds x="0" y="0.1" width="1" height="1" />
366      </text>
367      <text string="86" state="86">
368         <color red="1.0" green="1.0" blue="1.0" />
369         <bounds x="0" y="0.1" width="1" height="1" />
370      </text>
371      <text string="87" state="87">
372         <color red="1.0" green="1.0" blue="1.0" />
373         <bounds x="0" y="0.1" width="1" height="1" />
374      </text>
375      <text string="88" state="88">
376         <color red="1.0" green="1.0" blue="1.0" />
377         <bounds x="0" y="0.1" width="1" height="1" />
378      </text>
379      <text string="89" state="89">
380         <color red="1.0" green="1.0" blue="1.0" />
381         <bounds x="0" y="0.1" width="1" height="1" />
382      </text>
383      <text string="90" state="90">
384         <color red="1.0" green="1.0" blue="1.0" />
385         <bounds x="0" y="0.1" width="1" height="1" />
386      </text>
387      <text string="91" state="91">
388         <color red="1.0" green="1.0" blue="1.0" />
389         <bounds x="0" y="0.1" width="1" height="1" />
390      </text>
391      <text string="92" state="92">
392         <color red="1.0" green="1.0" blue="1.0" />
393         <bounds x="0" y="0.1" width="1" height="1" />
394      </text>
395      <text string="93" state="93">
396         <color red="1.0" green="1.0" blue="1.0" />
397         <bounds x="0" y="0.1" width="1" height="1" />
398      </text>
399      <text string="94" state="94">
400         <color red="1.0" green="1.0" blue="1.0" />
401         <bounds x="0" y="0.1" width="1" height="1" />
402      </text>
403      <text string="95" state="95">
404         <color red="1.0" green="1.0" blue="1.0" />
405         <bounds x="0" y="0.1" width="1" height="1" />
406      </text>
22   <element name="Steppers" defstate="0">
23       <simplecounter maxstate="999" digits="3">
24      <color red="1.0" green="1.0" blue="1.0" />
25      <bounds x="0" y="0" width="1" height="1" />
26      </simplecounter>
40727   </element>
40828   <element name="vfd0">
40929   <led16segsc>
src/mame/drivers/bfcobra.c
r15082r15083
914914      }
915915      case 0x22:
916916      {
917         val = 0x40 | input_port_read(machine(), "JOYSTICK");
917         val = 0x40 | ioport("JOYSTICK")->read();
918918         break;
919919      }
920920      default:
r15082r15083
14331433
14341434            /* Clock is low */
14351435            if (!(data & 0x08))
1436               m_mux_input = input_port_read(machine(), port[input_strobe]);
1436               m_mux_input = ioport(port[input_strobe])->read();
14371437         }
14381438         break;
14391439      }
src/mame/drivers/nycaptor.c
r15082r15083
233233
234234READ8_MEMBER(nycaptor_state::nycaptor_by_r)
235235{
236   int port = input_port_read(machine(), "LIGHTY");
236   int port = ioport("LIGHTY")->read();
237237
238238   if (m_gametype == 1)
239239      port = 255 - port;
r15082r15083
243243
244244READ8_MEMBER(nycaptor_state::nycaptor_bx_r)
245245{
246   return (input_port_read(machine(), "LIGHTX") + 0x27) | 1;
246   return (ioport("LIGHTX")->read() + 0x27) | 1;
247247}
248248
249249
src/mame/drivers/mitchell.c
r15082r15083
120120        otherwise music doesn't work.
121121    */
122122
123   return (input_port_read(machine(), "SYS0") & 0xfe) | (m_irq_source & 1);
123   return (ioport("SYS0")->read() & 0xfe) | (m_irq_source & 1);
124124}
125125
126126static WRITE8_DEVICE_HANDLER( eeprom_cs_w )
r15082r15083
166166
167167   if (m_dial_selected)
168168   {
169      int delta = (input_port_read(machine(), dialnames[offset]) - m_dial[offset]) & 0xff;
169      int delta = (ioport(dialnames[offset])->read() - m_dial[offset]) & 0xff;
170170
171171      if (delta & 0x80)
172172      {
r15082r15083
194194   }
195195   else
196196   {
197      int res = input_port_read(machine(), portnames[offset]) & 0xf7;
197      int res = ioport(portnames[offset])->read() & 0xf7;
198198
199199      if (m_dir[offset])
200200         res |= 0x08;
r15082r15083
209209   if (data == 0x08)
210210   {
211211      /* reset the dial counters */
212      m_dial[0] = input_port_read(machine(), "DIAL1");
213      m_dial[1] = input_port_read(machine(), "DIAL2");
212      m_dial[0] = ioport("DIAL1")->read();
213      m_dial[1] = ioport("DIAL2")->read();
214214   }
215215   else if (data == 0x80)
216216      m_dial_selected = 0;
r15082r15083
231231   for (i = 0; i < 5; i++)
232232   {
233233      if (m_keymatrix & (0x80 >> i))
234         return input_port_read(machine(), keynames[offset][i]);
234         return ioport(keynames[offset][i])->read();
235235   }
236236
237237   return 0xff;
r15082r15083
251251   {
252252      case 0:
253253      default:
254         return input_port_read(machine(), portnames[offset]);
254         return ioport(portnames[offset])->read();
255255      case 1:      /* Mahjong games */
256256         if (offset)
257257            return mahjong_input_r(space, offset - 1);
258258         else
259            return input_port_read(machine(), "IN0");
259            return ioport("IN0")->read();
260260         break;
261261      case 2:      /* Block Block - dial control */
262262         if (offset)
263263            return block_input_r(space, offset - 1);
264264         else
265            return input_port_read(machine(), "IN0");
265            return ioport("IN0")->read();
266266         break;
267267      case 3:      /* Super Pang - simulate START 1 press to initialize EEPROM */
268         return input_port_read(machine(), portnames[offset]);
268         return ioport(portnames[offset])->read();
269269   }
270270}
271271
r15082r15083
420420   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
421421   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
422422   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
423   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
423   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
424424   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
425425   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
426426
r15082r15083
670670   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
671671   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
672672   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
673   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
673   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
674674   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
675675   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
676676
r15082r15083
721721   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
722722   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
723723   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
724   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
724   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
725725   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
726726   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
727727
r15082r15083
837837   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
838838   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
839839   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
840   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
840   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
841841   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
842842   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
843843
r15082r15083
877877   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
878878   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
879879   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
880   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
880   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
881881   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
882882   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
883883
r15082r15083
919919   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
920920   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
921921   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
922   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
922   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
923923   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
924924   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
925925
src/mame/drivers/dynduke.c
r15082r15083
139139   PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" ) PORT_DIPLOCATION("SW1:1")
140140   PORT_DIPSETTING(      0x0001, "Mode 1" )
141141   PORT_DIPSETTING(      0x0000, "Mode 2" )
142   PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3") PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0000)
142   PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3") PORT_CONDITION("DSW", 0x0001, EQUALS, 0x0000)
143143   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
144144   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
145145   PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
146146   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_1C ) )
147   PORT_DIPNAME( 0x0018, 0x0008, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5") PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0000)
147   PORT_DIPNAME( 0x0018, 0x0008, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5") PORT_CONDITION("DSW", 0x0001, EQUALS, 0x0000)
148148   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
149149   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
150150   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_5C ) )
151151   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
152152   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
153   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4,5") PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0001)
153   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4,5") PORT_CONDITION("DSW", 0x0001, EQUALS, 0x0001)
154154   PORT_DIPSETTING(      0x0018, DEF_STR( 4C_1C ) )
155155   PORT_DIPSETTING(      0x001a, DEF_STR( 3C_1C ) )
156156   PORT_DIPSETTING(      0x001c, DEF_STR( 2C_1C ) )
src/mame/drivers/blktiger.c
r15082r15083
5959
6060WRITE8_MEMBER(blktiger_state::blktiger_coinlockout_w)
6161{
62   if (input_port_read(machine(), "COIN_LOCKOUT") & 0x01)
62   if (ioport("COIN_LOCKOUT")->read() & 0x01)
6363   {
6464      coin_lockout_w(machine(), 0,~data & 0x01);
6565      coin_lockout_w(machine(), 1,~data & 0x02);
src/mame/drivers/mgolf.c
r15082r15083
9191static void update_plunger( running_machine &machine )
9292{
9393   mgolf_state *state = machine.driver_data<mgolf_state>();
94   UINT8 val = input_port_read(machine, "BUTTON");
94   UINT8 val = state->ioport("BUTTON")->read();
9595
9696   if (state->m_prev != val)
9797   {
r15082r15083
143143
144144READ8_MEMBER(mgolf_state::mgolf_dial_r)
145145{
146   UINT8 val = input_port_read(machine(), "41");
146   UINT8 val = ioport("41")->read();
147147
148   if ((input_port_read(machine(), "DIAL") + 0x00) & 0x20)
148   if ((ioport("DIAL")->read() + 0x00) & 0x20)
149149   {
150150      val |= 0x01;
151151   }
152   if ((input_port_read(machine(), "DIAL") + 0x10) & 0x20)
152   if ((ioport("DIAL")->read() + 0x10) & 0x20)
153153   {
154154      val |= 0x02;
155155   }
r15082r15083
162162{
163163   double plunger = calc_plunger_pos(machine()); /* see Video Pinball */
164164
165   UINT8 val = input_port_read(machine(), "61");
165   UINT8 val = ioport("61")->read();
166166
167167   if (plunger >= 0.000 && plunger <= 0.001)
168168   {
r15082r15083
232232   PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* DIAL A */
233233   PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* DIAL B */
234234   PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
235   PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
235   PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
236236
237237   PORT_START("60")
238238   PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
src/mame/drivers/deco_mlc.c
r15082r15083
110110READ32_MEMBER(deco_mlc_state::test2_r)
111111{
112112//  if (offset==0)
113//      return input_port_read(machine(), "IN0"); //0xffffffff;
113//      return ioport("IN0")->read(); //0xffffffff;
114114//   logerror("%08x:  Test2_r %d\n",cpu_get_pc(&space.device()),offset);
115115   return machine().rand(); //0xffffffff;
116116}
src/mame/drivers/skyfox.c
r15082r15083
124124   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
125125
126126   PORT_START("DSW1")   // Coins, DSW + Vblank
127   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK  )
127   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM  ) PORT_VBLANK("screen")
128128   PORT_DIPNAME( 0x0e, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:1,2,3")
129129   PORT_DIPSETTING(    0x0e, DEF_STR( 5C_1C ) )
130130   PORT_DIPSETTING(    0x0a, DEF_STR( 4C_1C ) )
src/mame/drivers/fgoal.c
r15082r15083
7373{
7474   fgoal_state *state = machine.driver_data<fgoal_state>();
7575   int scanline;
76   int coin = (input_port_read(machine, "IN1") & 2);
76   int coin = (state->ioport("IN1")->read() & 2);
7777
7878   device_set_input_line(state->m_maincpu, 0, ASSERT_LINE);
7979
r15082r15083
100100
101101READ8_MEMBER(fgoal_state::fgoal_analog_r)
102102{
103   return input_port_read(machine(), m_fgoal_player ? "PADDLE1" : "PADDLE0"); /* PCB can be jumpered to use a single dial */
103   return ioport(m_fgoal_player ? "PADDLE1" : "PADDLE0")->read(); /* PCB can be jumpered to use a single dial */
104104}
105105
106106
src/mame/drivers/mystston.c
r15082r15083
177177   PORT_DIPNAME(0x40, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW1:7")
178178   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
179179   PORT_DIPSETTING(   0x40, DEF_STR( Cocktail ) )
180   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
180   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
181181INPUT_PORTS_END
182182
183183
src/mame/drivers/rampart.c
r15082r15083
177177   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
178178   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
179179   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
180   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK )
180   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
181181   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
182182
183183   PORT_START("IN1")
r15082r15083
221221   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
222222   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
223223   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
224   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK )
224   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
225225   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
226226
227227   PORT_START("IN1")
r15082r15083
271271   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
272272   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
273273   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
274   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK )
274   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
275275   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
276276
277277   PORT_START("IN1")
src/mame/drivers/bfm_sc1.c
r15082r15083
205205   {
206206      state->m_irq_status = 0x01 |0x02; //0xff;
207207
208       state->m_sc1_Inputs[2] = input_port_read(device->machine(),"STROBE0");
208       state->m_sc1_Inputs[2] = state->ioport("STROBE0")->read();
209209
210210      generic_pulse_irq_line(device->machine().device("maincpu"), M6809_IRQ_LINE, 1);
211211   }
r15082r15083
320320
321321READ8_MEMBER(bfm_sc1_state::dipcoin_r)
322322{
323   return input_port_read(machine(),"STROBE0") & 0x1F;
323   return ioport("STROBE0")->read() & 0x1F;
324324}
325325
326326///////////////////////////////////////////////////////////////////////////
r15082r15083
444444
445445      if ( !(data & 0x08) )
446446      {
447         m_sc1_Inputs[ input_strobe ] = input_port_read(machine(),portnames[input_strobe]);
447         m_sc1_Inputs[ input_strobe ] = ioport(portnames[input_strobe])->read();
448448
449449         m_mux1_input = m_sc1_Inputs[ input_strobe ];
450450      }
src/mame/drivers/snowbros.c
r15082r15083
418418   {
419419      case 0x23:
420420      case 0x26:
421      snd = machine.root_device().memregion("oki")->base();
421      snd = state->memregion("oki")->base();
422422      memcpy(snd+0x20000, snd+0x80000+0x00000, 0x20000);
423423      state->m_sb3_music_is_playing = 1;
424424      break;
425425
426426      case 0x24:
427      snd = machine.root_device().memregion("oki")->base();
427      snd = state->memregion("oki")->base();
428428      memcpy(snd+0x20000, snd+0x80000+0x20000, 0x20000);
429429      state->m_sb3_music_is_playing = 1;
430430      break;
r15082r15083
558558   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
559559   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
560560   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5,6")
561   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
562   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
563   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
564   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
561   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
562   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
563   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
564   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
565565   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
566   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
567   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
566   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
567   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
568568   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:7,8")
569   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
570   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
571   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
572   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
573   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
574   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
575   PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
576   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
569   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
570   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
571   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
572   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
573   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
574   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
575   PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
576   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
577577   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
578578   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
579579   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
r15082r15083
667667   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 )
668668   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 )
669669   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 )
670   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK )   /* Must be low or game stops! */
670   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")   /* Must be low or game stops! */
671671
672672   PORT_START("DSW2")
673673   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
r15082r15083
743743   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 )
744744   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 )
745745   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 )
746   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK )   /* Must be low or game stops! */
746   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")   /* Must be low or game stops! */
747747
748748   PORT_START("DSW2")
749749   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
r15082r15083
23522352static DRIVER_INIT( cookbib2 )
23532353{
23542354   //snowbros_state *state = machine.driver_data<snowbros_state>();
2355//  UINT16 *HCROM = (UINT16*)machine.root_device().memregion("maincpu")->base();
2355//  UINT16 *HCROM = (UINT16*)state->memregion("maincpu")->base();
23562356//  UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
23572357//  int i;
23582358//  state->m_hyperpac_ram[0xf000/2] = 0x46fc;
src/mame/drivers/segaxbd.c
r15082r15083
451451   int which = (state->m_iochip_regs[0][2] >> 2) & 7;
452452
453453   /* on the write, latch the selected input port and stash the value */
454   int value = input_port_read_safe(space->machine(), ports[which], 0x0010);
454   int value = state->ioport(ports[which])->read_safe(0x0010);
455455
456456   /* reverse some port values */
457457   if (state->m_adc_reverse[which])
r15082r15083
512512                D6: /INTR of ADC0804
513513                D5-D0: CN C pin 24-19 (switch state 0= open, 1= closed)
514514            */
515         return iochip_r(space->machine(), 0, 0, input_port_read(space->machine(), "IO0PORTA"));
515         return iochip_r(space->machine(), 0, 0, space->machine().root_device().ioport("IO0PORTA")->read());
516516
517517      case 1:
518518         /* I/O port: CN C pins 17,15,13,11,9,7,5,3 */
519         return iochip_r(space->machine(), 0, 1, input_port_read(space->machine(), "IO0PORTB"));
519         return iochip_r(space->machine(), 0, 1, space->machine().root_device().ioport("IO0PORTB")->read());
520520
521521      case 2:
522522         /* Output port */
r15082r15083
588588   {
589589      case 0:
590590         /* Input port: switches, CN D pin A1-8 (switch state 1= open, 0= closed) */
591         return iochip_r(space->machine(), 1, 0, input_port_read(space->machine(), "IO1PORTA"));
591         return iochip_r(space->machine(), 1, 0, space->machine().root_device().ioport("IO1PORTA")->read());
592592
593593      case 1:
594594         /* Input port: switches, CN D pin A9-16 (switch state 1= open, 0= closed) */
595         return iochip_r(space->machine(), 1, 1, input_port_read(space->machine(), "IO1PORTB"));
595         return iochip_r(space->machine(), 1, 1, space->machine().root_device().ioport("IO1PORTB")->read());
596596
597597      case 2:
598598         /* Input port: DIP switches (1= off, 0= on) */
599         return iochip_r(space->machine(), 1, 2, input_port_read(space->machine(), "IO1PORTC"));
599         return iochip_r(space->machine(), 1, 2, space->machine().root_device().ioport("IO1PORTC")->read());
600600
601601      case 3:
602602         /* Input port: DIP switches (1= off, 0= on) */
603         return iochip_r(space->machine(), 1, 3, input_port_read(space->machine(), "IO1PORTD"));
603         return iochip_r(space->machine(), 1, 3, space->machine().root_device().ioport("IO1PORTD")->read());
604604
605605      case 4:
606606         /* Unused */
src/mame/drivers/nbmj9195.c
r15082r15083
3030#include "includes/nbmj9195.h"
3131
3232
33#define SIGNED_DAC   0      // 0:unsigned DAC, 1:signed DAC
34#if SIGNED_DAC
35#define DAC_WRITE   dac_signed_w
36#else
37#define DAC_WRITE   dac_w
38#endif
39
40
4133WRITE8_MEMBER(nbmj9195_state::nbmj9195_soundbank_w)
4234{
4335   UINT8 *SNDROM = memregion("audiocpu")->base();
r15082r15083
8072static int nbmj9195_dipsw_r(running_machine &machine)
8173{
8274   nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
83   return ((((input_port_read(machine, "DSWA") & 0xff) | ((input_port_read(machine, "DSWB") & 0xff) << 8)) >> state->m_dipswbitsel) & 0x01);
75   return (((state->ioport("DSWA")->read() & 0xff) | ((state->ioport("DSWB")->read() & 0xff) << 8)) >> state->m_dipswbitsel) & 0x01;
8476}
8577
8678static void nbmj9195_dipswbitsel_w(address_space *space, int data)
r15082r15083
112104READ8_MEMBER(nbmj9195_state::mscoutm_dipsw_0_r)
113105{
114106   // DIPSW A
115   return (((input_port_read(machine(), "DSWA") & 0x01) << 7) | ((input_port_read(machine(), "DSWA") & 0x02) << 5) |
116           ((input_port_read(machine(), "DSWA") & 0x04) << 3) | ((input_port_read(machine(), "DSWA") & 0x08) << 1) |
117           ((input_port_read(machine(), "DSWA") & 0x10) >> 1) | ((input_port_read(machine(), "DSWA") & 0x20) >> 3) |
118           ((input_port_read(machine(), "DSWA") & 0x40) >> 5) | ((input_port_read(machine(), "DSWA") & 0x80) >> 7));
107   return (((ioport("DSWA")->read() & 0x01) << 7) | ((ioport("DSWA")->read() & 0x02) << 5) |
108           ((ioport("DSWA")->read() & 0x04) << 3) | ((ioport("DSWA")->read() & 0x08) << 1) |
109           ((ioport("DSWA")->read() & 0x10) >> 1) | ((ioport("DSWA")->read() & 0x20) >> 3) |
110           ((ioport("DSWA")->read() & 0x40) >> 5) | ((ioport("DSWA")->read() & 0x80) >> 7));
119111}
120112
121113READ8_MEMBER(nbmj9195_state::mscoutm_dipsw_1_r)
122114{
123115   // DIPSW B
124   return (((input_port_read(machine(), "DSWB") & 0x01) << 7) | ((input_port_read(machine(), "DSWB") & 0x02) << 5) |
125           ((input_port_read(machine(), "DSWB") & 0x04) << 3) | ((input_port_read(machine(), "DSWB") & 0x08) << 1) |
126           ((input_port_read(machine(), "DSWB") & 0x10) >> 1) | ((input_port_read(machine(), "DSWB") & 0x20) >> 3) |
127           ((input_port_read(machine(), "DSWB") & 0x40) >> 5) | ((input_port_read(machine(), "DSWB") & 0x80) >> 7));
116   return (((ioport("DSWB")->read() & 0x01) << 7) | ((ioport("DSWB")->read() & 0x02) << 5) |
117           ((ioport("DSWB")->read() & 0x04) << 3) | ((ioport("DSWB")->read() & 0x08) << 1) |
118           ((ioport("DSWB")->read() & 0x10) >> 1) | ((ioport("DSWB")->read() & 0x20) >> 3) |
119           ((ioport("DSWB")->read() & 0x40) >> 5) | ((ioport("DSWB")->read() & 0x80) >> 7));
128120}
129121
130122
r15082r15083
144136      {
145137         case 0:         /* PA_0 */
146138            // COIN IN, ETC...
147            portdata = input_port_read(machine(), "SYSTEM");
139            portdata = ioport("SYSTEM")->read();
148140            break;
149141         case 1:         /* PB_0 */
150142            // PLAYER1 KEY, DIPSW A/B
151143            switch (m_mscoutm_inputport)
152144            {
153145               case 0x01:
154                  portdata = input_port_read(machine(), "KEY0");
146                  portdata = ioport("KEY0")->read();
155147                  break;
156148               case 0x02:
157                  portdata = input_port_read(machine(), "KEY1");
149                  portdata = ioport("KEY1")->read();
158150                  break;
159151               case 0x04:
160                  portdata = input_port_read(machine(), "KEY2");
152                  portdata = ioport("KEY2")->read();
161153                  break;
162154               case 0x08:
163                  portdata = input_port_read(machine(), "KEY3");
155                  portdata = ioport("KEY3")->read();
164156                  break;
165157               case 0x10:
166                  portdata = input_port_read(machine(), "KEY4");
158                  portdata = ioport("KEY4")->read();
167159                  break;
168160               default:
169                  portdata = (input_port_read(machine(), "KEY0") & input_port_read(machine(), "KEY1") & input_port_read(machine(), "KEY2")
170                           & input_port_read(machine(), "KEY3") & input_port_read(machine(), "KEY4"));
161                  portdata = (ioport("KEY0")->read() & ioport("KEY1")->read() & ioport("KEY2")->read()
162                           & ioport("KEY3")->read() & ioport("KEY4")->read());
171163                  break;
172164            }
173165            break;
r15082r15083
176168            switch (m_mscoutm_inputport)
177169            {
178170               case 0x01:
179                  portdata = input_port_read(machine(), "KEY5");
171                  portdata = ioport("KEY5")->read();
180172                  break;
181173               case 0x02:
182                  portdata = input_port_read(machine(), "KEY6");
174                  portdata = ioport("KEY6")->read();
183175                  break;
184176               case 0x04:
185                  portdata = input_port_read(machine(), "KEY7");
177                  portdata = ioport("KEY7")->read();
186178                  break;
187179               case 0x08:
188                  portdata = input_port_read(machine(), "KEY8");
180                  portdata = ioport("KEY8")->read();
189181                  break;
190182               case 0x10:
191                  portdata = input_port_read(machine(), "KEY9");
183                  portdata = ioport("KEY9")->read();
192184                  break;
193185               default:
194                  portdata = (input_port_read(machine(), "KEY5") & input_port_read(machine(), "KEY6") & input_port_read(machine(), "KEY7")
195                           & input_port_read(machine(), "KEY8") & input_port_read(machine(), "KEY9"));
186                  portdata = (ioport("KEY5")->read() & ioport("KEY6")->read() & ioport("KEY7")->read()
187                           & ioport("KEY8")->read() & ioport("KEY9")->read());
196188                  break;
197189            }
198190            break;
r15082r15083
231223      {
232224         case 0:         /* PA_0 */
233225            // COIN IN, ETC...
234            portdata = ((input_port_read(machine(), "SYSTEM") & 0xfe) | m_outcoin_flag);
226            portdata = ((ioport("SYSTEM")->read() & 0xfe) | m_outcoin_flag);
235227            break;
236228         case 1:         /* PB_0 */
237229            // PLAYER1 KEY, DIPSW A/B
238230            switch (m_inputport)
239231            {
240232               case 0x01:
241                  portdata = input_port_read(machine(), "KEY0");
233                  portdata = ioport("KEY0")->read();
242234                  break;
243235               case 0x02:
244                  portdata = input_port_read(machine(), "KEY1");
236                  portdata = ioport("KEY1")->read();
245237                  break;
246238               case 0x04:
247                  portdata = input_port_read(machine(), "KEY2");
239                  portdata = ioport("KEY2")->read();
248240                  break;
249241               case 0x08:
250                  portdata = input_port_read(machine(), "KEY3");
242                  portdata = ioport("KEY3")->read();
251243                  break;
252244               case 0x10:
253                  portdata = ((input_port_read(machine(), "KEY4") & 0x7f) | (nbmj9195_dipsw_r(machine()) << 7));
245                  portdata = ((ioport("KEY4")->read() & 0x7f) | (nbmj9195_dipsw_r(machine()) << 7));
254246                  break;
255247               default:
256                  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));
248                  portdata = (ioport("KEY0")->read() & ioport("KEY1")->read() & ioport("KEY2")->read() & ioport("KEY3")->read() & (ioport("KEY4")->read() & 0x7f));
257249                  break;
258250            }
259251            break;
r15082r15083
262254            switch (m_inputport)
263255            {
264256               case 0x01:
265                  portdata = input_port_read(machine(), "KEY5");
257                  portdata = ioport("KEY5")->read();
266258                  break;
267259               case 0x02:
268                  portdata = input_port_read(machine(), "KEY6");
260                  portdata = ioport("KEY6")->read();
269261                  break;
270262               case 0x04:
271                  portdata = input_port_read(machine(), "KEY7");
263                  portdata = ioport("KEY7")->read();
272264                  break;
273265               case 0x08:
274                  portdata = input_port_read(machine(), "KEY8");
266                  portdata = ioport("KEY8")->read();
275267                  break;
276268               case 0x10:
277                  portdata = input_port_read(machine(), "KEY9") & 0x7f;
269                  portdata = ioport("KEY9")->read() & 0x7f;
278270                  break;
279271               default:
280                  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));
272                  portdata = (ioport("KEY5")->read() & ioport("KEY6")->read() & ioport("KEY7")->read() & ioport("KEY8")->read() & (ioport("KEY9")->read() & 0x7f));
281273                  break;
282274            }
283275            break;
r15082r15083
341333            nbmj9195_soundbank_w(space, 0, data);
342334            break;
343335         case 6:         /* PB_1 */
344            DAC_WRITE(machine().device("dac2"), 0, data);
336            dac_w(machine().device("dac2"), 0, data);
345337            break;
346338         case 7:         /* PC_1 */
347            DAC_WRITE(machine().device("dac1"), 0, data);
339            dac_w(machine().device("dac1"), 0, data);
348340            break;
349341         case 8:         /* PD_1 */
350342            break;
r15082r15083
379371            nbmj9195_soundbank_w(space, 0, data);
380372            break;
381373         case 6:         /* PB_1 */
382            DAC_WRITE(machine().device("dac2"), 0, data);
374            dac_w(machine().device("dac1"), 0, data);
383375            break;
384376         case 7:         /* PC_1 */
385            DAC_WRITE(machine().device("dac1"), 0, data);
377            dac_w(machine().device("dac2"), 0, data);
386378            break;
387379         case 8:         /* PD_1 */
388380            break;
r15082r15083
669661
670662   // initialize sound rom bank
671663   state->nbmj9195_soundbank_w(*space, 0, 0);
664   logerror("DRIVER_INIT( nbmj9195 )\n");
672665}
673666
674667static ADDRESS_MAP_START( tmpz84c011_regs, AS_IO, 8, nbmj9195_state )
r15082r15083
739732   AM_RANGE(0xb6, 0xb6) AM_WRITE(nbmj9195_inputportsel_w)
740733ADDRESS_MAP_END
741734
742
743735static ADDRESS_MAP_START( koinomp_io_map, AS_IO, 8, nbmj9195_state )
744736   ADDRESS_MAP_GLOBAL_MASK(0xff)
745737   AM_IMPORT_FROM( tmpz84c011_regs )
r15082r15083
759751   AM_RANGE(0xcf, 0xcf) AM_WRITENOP
760752ADDRESS_MAP_END
761753
762
763754static ADDRESS_MAP_START( patimono_io_map, AS_IO, 8, nbmj9195_state )
764755   ADDRESS_MAP_GLOBAL_MASK(0xff)
765756   AM_IMPORT_FROM( tmpz84c011_regs )
r15082r15083
846837   AM_RANGE(0xf0, 0xff) AM_WRITE(nbmj9195_clut_1_w)
847838ADDRESS_MAP_END
848839
849
850840static ADDRESS_MAP_START( mkeibaou_io_map, AS_IO, 8, nbmj9195_state )
851841   ADDRESS_MAP_GLOBAL_MASK(0xff)
852842   AM_IMPORT_FROM( tmpz84c011_regs )
r15082r15083
865855   AM_RANGE(0xde, 0xde) AM_WRITE(nbmj9195_inputportsel_w)
866856ADDRESS_MAP_END
867857
868
869858static ADDRESS_MAP_START( pachiten_io_map, AS_IO, 8, nbmj9195_state )
870859   ADDRESS_MAP_GLOBAL_MASK(0xff)
871860   AM_IMPORT_FROM( tmpz84c011_regs )
r15082r15083
920909   AM_RANGE(0xfe, 0xfe) AM_WRITE(nbmj9195_inputportsel_w)
921910ADDRESS_MAP_END
922911
923
924912static ADDRESS_MAP_START( psailor1_io_map, AS_IO, 8, nbmj9195_state )
925913   ADDRESS_MAP_GLOBAL_MASK(0xff)
926914   AM_IMPORT_FROM( tmpz84c011_regs )
r15082r15083
993981   AM_RANGE(0xd0, 0xdf) AM_WRITE(nbmj9195_clut_1_w)
994982ADDRESS_MAP_END
995983
984static ADDRESS_MAP_START( yosimotm_io_map, AS_IO, 8, nbmj9195_state )
985   ADDRESS_MAP_GLOBAL_MASK(0xff)
986   AM_IMPORT_FROM( tmpz84c011_regs )
987
988   AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
989   AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
990   AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
991
992   AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_1_r)
993   AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_1_w)
994   AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_1_w)
995
996   AM_RANGE(0xf0, 0xf0) AM_WRITE(nbmj9195_inputportsel_w)
997   AM_RANGE(0xfc, 0xfc) AM_WRITE(nbmj9195_sound_w)
998   AM_RANGE(0xf4, 0xf4) AM_NOP
999   AM_RANGE(0xf8, 0xf8) AM_NOP
1000ADDRESS_MAP_END
1001
9961002static ADDRESS_MAP_START( jituroku_io_map, AS_IO, 8, nbmj9195_state )
9971003   ADDRESS_MAP_GLOBAL_MASK(0xff)
9981004   AM_IMPORT_FROM( tmpz84c011_regs )
r15082r15083
24152421   PORT_DIPNAME( 0x40, 0x00, "Voices" )
24162422   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
24172423   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2418   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
2424   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Flip_Screen ) )
24192425   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
24202426   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24212427
r15082r15083
24572463   PORT_INCLUDE( nbmjcontrols )
24582464INPUT_PORTS_END
24592465
2466static INPUT_PORTS_START( yosimotm )
2467
2468   // I don't have manual for this game.
2469
2470   PORT_START("DSWA")
2471   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
2472   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2473   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2474   PORT_DIPNAME( 0x02, 0x02, "DIPSW 1-2" )
2475   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2476   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2477   PORT_DIPNAME( 0x04, 0x04, "DIPSW 1-3" )
2478   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2479   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2480   PORT_DIPNAME( 0x08, 0x08, "DIPSW 1-4" )
2481   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2482   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2483   PORT_DIPNAME( 0x10, 0x10, "DIPSW 1-5" )
2484   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2485   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2486   PORT_DIPNAME( 0x20, 0x20, "DIPSW 1-6" )
2487   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2488   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2489   PORT_DIPNAME( 0x40, 0x40, "Character Display Test" )
2490   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2491   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2492   PORT_DIPNAME( 0x80, 0x80, "Graphic ROM Test" )
2493   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2494   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2495
2496   PORT_START("DSWB")
2497   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Flip_Screen ) )
2498   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2499   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2500   PORT_DIPNAME( 0x02, 0x02, "Character Display Test" )
2501   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2502   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2503   PORT_DIPNAME( 0x04, 0x04, "Score Pool" )
2504   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2505   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
2506   PORT_DIPNAME( 0x08, 0x08, "DIPSW 2-4" )
2507   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2508   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2509   PORT_DIPNAME( 0x10, 0x10, "DIPSW 2-5" )
2510   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2511   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2512   PORT_DIPNAME( 0x20, 0x20, "DIPSW 2-6" )
2513   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2514   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2515   PORT_DIPNAME( 0x40, 0x40, "DIPSW 2-7" )
2516   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2517   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2518   PORT_DIPNAME( 0x80, 0x80, "DIPSW 2-8" )
2519   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2520   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2521
2522   PORT_START("SYSTEM")
2523   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // COIN OUT
2524   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
2525   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
2526   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
2527   PORT_SERVICE( 0x10, IP_ACTIVE_LOW )               // TEST
2528   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
2529   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
2530   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )      // SERVICE
2531
2532   PORT_INCLUDE( nbmjcontrols )
2533INPUT_PORTS_END
2534
24602535static INPUT_PORTS_START( jituroku )
24612536
24622537   // I don't have manual for this game.
r15082r15083
24742549   PORT_DIPNAME( 0x08, 0x08, "DIPSW 1-4" )
24752550   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
24762551   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2477   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) )
2552   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Flip_Screen ) )
24782553   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
24792554   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24802555   PORT_DIPNAME( 0x20, 0x20, "DIPSW 1-6" )
r15082r15083
31023177   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
31033178
31043179   MCFG_SOUND_ADD("dac1", DAC, 0)
3105   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
3180   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
31063181
31073182   MCFG_SOUND_ADD("dac2", DAC, 0)
3108   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3183   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
31093184MACHINE_CONFIG_END
31103185
31113186
r15082r15083
32813356MACHINE_CONFIG_END
32823357
32833358
3359static MACHINE_CONFIG_DERIVED( yosimotm, NBMJDRV1 )
3360
3361   /* basic machine hardware */
3362   MCFG_CPU_MODIFY("maincpu")
3363   MCFG_CPU_IO_MAP(yosimotm_io_map)
3364
3365   MCFG_NVRAM_ADD_0FILL("nvram")
3366MACHINE_CONFIG_END
3367
3368
32843369static MACHINE_CONFIG_DERIVED( jituroku, NBMJDRV1 )
32853370
32863371   /* basic machine hardware */
r15082r15083
37063791   ROM_LOAD( "8.9h",  0x280000, 0x80000, CRC(dbad97fc) SHA1(ead04086ffec53ede90e3ebcf150018a91bb8457) )
37073792ROM_END
37083793
3794ROM_START( yosimotm )
3795   ROM_REGION( 0x10000, "maincpu", 0 ) /* main program */
3796   ROM_LOAD( "1.7c",  0x00000,  0x10000, CRC(d156b07d) SHA1(8dcf2d8ac60920dc7ea286d4b91399ed2db05a3b) )
3797
3798   ROM_REGION( 0x20000, "audiocpu", 0 ) /* sound program */
3799   ROM_LOAD( "2.12e", 0x00000,  0x20000, CRC(e2d84085) SHA1(890b4d4a02030253837b67e8232293dce30d7ca2) )
3800
3801   ROM_REGION( 0x300000, "gfx1", 0 ) /* gfx */
3802   ROM_LOAD( "3.3h",  0x000000, 0x80000, CRC(f421c6c8) SHA1(f9d68f542cbf379a7c41b47704b19e1aec69f237) )
3803   ROM_LOAD( "4.5h",  0x080000, 0x80000, CRC(a9b17359) SHA1(84cb71ab32e069c8ff8cffff7badb3a823d3abfd) )
3804   ROM_LOAD( "5.5h",  0x100000, 0x80000, CRC(927517b7) SHA1(de4fcc4e87bc1a31834ffb2312b8cee167ec16b5) )
3805   ROM_LOAD( "6.6h",  0x180000, 0x80000, CRC(31b0b9de) SHA1(b68c2028859b6804fe66a500f6afc375c1634bcd) )
3806   ROM_LOAD( "7.7h",  0x200000, 0x80000, CRC(a7249937) SHA1(81d4adfb4bebe1e94fbbe70b7346c97f582f07a8) )
3807   ROM_LOAD( "8.8h",  0x280000, 0x80000, CRC(a3cd2458) SHA1(a82b011a880f0d47362d2e70b9d77db85d83e6ed) )
3808ROM_END
3809
37093810ROM_START( ngpgal )
37103811   ROM_REGION( 0x10000, "maincpu", 0 ) /* main program */
37113812   ROM_LOAD( "ngpg_01.bin", 0x00000,  0x10000, CRC(c766378b) SHA1(b221908eb14ebf5c87ae896c3c27d261b26b5146) )
r15082r15083
39434044GAME( 1993, sailorwa, sailorws, sailorws, sailorws, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Sailor Wars (Japan set 2)", 0 )
39444045GAME( 1993, sailorwr, sailorws, sailorwr, sailorwr, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Sailor Wars-R [BET] (Japan)", 0 )
39454046GAME( 1993, wcatcher, 0,        otatidai, wcatcher, nbmj9195, ROT0,   "Nichibutsu", "Mahjong Wakuwaku Catcher (Japan)", 0 )
3946GAME( 1993, jituroku, 0,        jituroku, jituroku, nbmj9195, ROT180, "Windom", "Jitsuroku Maru-chi Mahjong (Japan)", 0 )
3947GAME( 1994, yosimoto, 0,        yosimoto, yosimoto, nbmj9195, ROT180, "Nichibutsu / Yoshimoto Kougyou", "Mahjong Yoshimoto Gekijou (Japan)", 0 )
4047GAME( 1993, jituroku, 0,        jituroku, jituroku, nbmj9195, ROT0,   "Windom", "Jitsuroku Maru-chi Mahjong (Japan)", 0 )
4048GAME( 1994, yosimoto, 0,        yosimoto, yosimoto, nbmj9195, ROT0,   "Nichibutsu / Yoshimoto Kougyou", "Mahjong Yoshimoto Gekijou (Japan)", 0 )
4049GAME( 1994, yosimotm, yosimoto, yosimotm, yosimotm, nbmj9195, ROT0,   "Nichibutsu / Yoshimoto Kougyou", "Mahjong Yoshimoto Gekijou [BET] (Japan)", 0 )
39484050GAME( 1994, psailor1, 0,        psailor1, psailor1, nbmj9195, ROT0,   "Sphinx", "Bishoujo Janshi Pretty Sailor 18-kin (Japan)", 0 )
39494051GAME( 1994, psailor2, 0,        psailor2, psailor2, nbmj9195, ROT0,   "Sphinx", "Bishoujo Janshi Pretty Sailor 2 (Japan)", 0 )
39504052GAME( 1995, otatidai, 0,        otatidai, otatidai, nbmj9195, ROT0,   "Sphinx", "Disco Mahjong Otachidai no Okite (Japan)", 0 )
src/mame/drivers/copsnrob.c
r15082r15083
8181
8282READ8_MEMBER(copsnrob_state::copsnrob_misc_r)
8383{
84   return input_port_read(machine(), "IN0") & 0x80;
84   return ioport("IN0")->read() & 0x80;
8585}
8686
8787WRITE8_MEMBER(copsnrob_state::copsnrob_misc2_w)
r15082r15083
133133 *
134134 *************************************/
135135
136static const input_port_value gun_table[] = {0x3f, 0x5f, 0x6f, 0x77, 0x7b, 0x7d, 0x7e};
136static const ioport_value gun_table[] = {0x3f, 0x5f, 0x6f, 0x77, 0x7b, 0x7d, 0x7e};
137137
138138static INPUT_PORTS_START( copsnrob )
139139   PORT_START("IN0")
140   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_VBLANK )
140   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
141141
142142   PORT_START("IN1")
143143   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
src/mame/drivers/cntsteer.c
r15082r15083
501501READ8_MEMBER(cntsteer_state::cntsteer_adx_r)
502502{
503503   UINT8 res = 0, adx_val;
504   adx_val = input_port_read(machine(), "AN_STEERING");
504   adx_val = ioport("AN_STEERING")->read();
505505
506506   if (adx_val >= 0x70 && adx_val <= 0x90)
507507      res = 0xff;
r15082r15083
643643   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
644644   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
645645   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNUSED )
646   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
646   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
647647
648648   PORT_START("P1")
649649   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
r15082r15083
716716   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
717717   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
718718   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
719   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
719   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
720720
721721   PORT_START("DSW0")
722722   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
src/mame/drivers/csplayh5.c
r15082r15083
9292{
9393   switch(m_mux_data)
9494   {
95      case 0x01: return input_port_read(machine(), "KEY0");
96      case 0x02: return input_port_read(machine(), "KEY1");
97      case 0x04: return input_port_read(machine(), "KEY2");
98      case 0x08: return input_port_read(machine(), "KEY3");
99      case 0x10: return input_port_read(machine(), "KEY4");
95      case 0x01: return ioport("KEY0")->read();
96      case 0x02: return ioport("KEY1")->read();
97      case 0x04: return ioport("KEY2")->read();
98      case 0x08: return ioport("KEY3")->read();
99      case 0x10: return ioport("KEY4")->read();
100100   }
101101
102102   return 0xffff;
src/mame/drivers/nexus3d.c
r15082r15083
263263{
264264   nexus3d_state *state = machine.driver_data<nexus3d_state>();
265265   // the first part of the flash ROM automatically gets copied to RAM
266   memcpy( state->m_mainram, machine.root_device().memregion("user1")->base(), 4 * 1024);
266   memcpy( state->m_mainram, state->memregion("user1")->base(), 4 * 1024);
267267   state->m_flash_region = state->memregion("user1")->base();
268268}
269269
src/mame/drivers/dblewing.c
r15082r15083
145145      case 0x330: return 0; // controls bonuses such as shoot type,bombs etc.
146146      case 0x1d4: return m_70c_data;  //controls restart points
147147
148      case 0x0ac: return (input_port_read(machine(), "DSW") & 0x40) << 4;//flip screen
148      case 0x0ac: return (ioport("DSW")->read() & 0x40) << 4;//flip screen
149149      case 0x4b0: return m_608_data;//coinage
150150      case 0x068:
151151      {
152         switch (input_port_read(machine(), "DSW") & 0x0300) //I don't know how to relationate this...
152         switch (ioport("DSW")->read() & 0x0300) //I don't know how to relationate this...
153153         {
154154            case 0x0000: return 0x000;//0
155155            case 0x0100: return 0x060;//3
r15082r15083
159159      }
160160      case 0x094: return m_104_data;// p1 inputs select screen  OK
161161      case 0x24c: return m_008_data;//read DSW (mirror for coinage/territory)
162      case 0x298: return input_port_read(machine(), "SYSTEM");//vblank
163      case 0x476: return input_port_read(machine(), "SYSTEM");//mirror for coins
164      case 0x506: return input_port_read(machine(), "DSW");
162      case 0x298: return ioport("SYSTEM")->read();//vblank
163      case 0x476: return ioport("SYSTEM")->read();//mirror for coins
164      case 0x506: return ioport("DSW")->read();
165165      case 0x5d8: return m_406_data;
166      case 0x2b4: return input_port_read(machine(), "P1_P2");
167      case 0x1a8: return (input_port_read(machine(), "DSW") & 0x4000) >> 12;//allow continue
166      case 0x2b4: return ioport("P1_P2")->read();
167      case 0x1a8: return (ioport("DSW")->read() & 0x4000) >> 12;//allow continue
168168      case 0x3ec: return m_70c_data; //score entry
169169      case 0x246: return m_580_data; // these three controls "perfect bonus" I suppose...
170170      case 0x52e: return m_580_data;
r15082r15083
424424   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
425425   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
426426   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
427   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
427   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
428428
429429   PORT_START("DSW")
430430    /* 16bit - These values are for Dip Switch #1 */
src/mame/drivers/arabian.c
r15082r15083
145145      {
146146         if (~sel & (1 << i))
147147         {
148            val = input_port_read(machine(), comnames[i]);
148            val = ioport(comnames[i])->read();
149149            break;
150150         }
151151      }
src/mame/drivers/taito_o.c
r15082r15083
5353
5454   switch(offset)
5555   {
56      case 0: retval = input_port_read(machine(), "IN0") & (clear_hack ? 0xf7ff : 0xffff); break;
57      case 1: retval = input_port_read(machine(), "IN1") & (clear_hack ? 0xfff7 : 0xffff); break;
56      case 0: retval = ioport("IN0")->read() & (clear_hack ? 0xf7ff : 0xffff); break;
57      case 1: retval = ioport("IN1")->read() & (clear_hack ? 0xfff7 : 0xffff); break;
5858      default: logerror("IO R %x %x = %x @ %x\n", offset, mem_mask, retval, cpu_get_pc(&space.device()));
5959   }
6060   return retval;
src/mame/drivers/thief.c
r15082r15083
3636static INTERRUPT_GEN( thief_interrupt )
3737{
3838   /* SLAM switch causes an NMI if it's pressed */
39   if( (input_port_read(device->machine(), "P2") & 0x10) == 0 )
39   if( (device->machine().root_device().ioport("P2")->read() & 0x10) == 0 )
4040      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
4141   else
4242      device_set_input_line(device, 0, HOLD_LINE);
r15082r15083
141141{
142142   switch( m_input_select )
143143   {
144      case 0x01: return input_port_read(machine(), "DSW1");
145      case 0x02: return input_port_read(machine(), "DSW2");
146      case 0x04: return input_port_read(machine(), "P1");
147      case 0x08: return input_port_read(machine(), "P2");
144      case 0x01: return ioport("DSW1")->read();
145      case 0x02: return ioport("DSW2")->read();
146      case 0x04: return ioport("P1")->read();
147      case 0x08: return ioport("P2")->read();
148148   }
149149   return 0x00;
150150}
src/mame/drivers/hornet.c
r15082r15083
471471      case 0:   /* I/O port 0 */
472472      case 1:   /* I/O port 1 */
473473      case 2:   /* I/O port 2 */
474         r = input_port_read(machine(), portnames[offset]);
474         r = ioport(portnames[offset])->read();
475475         break;
476476
477477      case 3:   /* I/O port 3 */
r15082r15083
489489         break;
490490
491491      case 4:   /* I/O port 4 - DIP switches */
492         r = input_port_read(machine(), "DSW");
492         r = ioport("DSW")->read();
493493         break;
494494   }
495495   return r;
r15082r15083
524524                0x02 = LAMP1
525525                0x01 = LAMP0
526526            */
527         input_port_write(machine(), "EEPROMOUT", data, 0xff);
527         ioport("EEPROMOUT")->write(data, 0xff);
528528         mame_printf_debug("System register 0 = %02X\n", data);
529529         break;
530530
r15082r15083
12551255{
12561256   hornet_state *state = machine.driver_data<hornet_state>();
12571257   init_konami_cgboard(machine, 2, CGBOARD_TYPE_HORNET);
1258   set_cgboard_texture_bank(machine, 0, "bank5", machine.root_device().memregion("user5")->base());
1258   set_cgboard_texture_bank(machine, 0, "bank5", state->memregion("user5")->base());
12591259   set_cgboard_texture_bank(machine, 1, "bank6", state->memregion("user5")->base());
12601260
12611261   state->m_led_reg0 = state->m_led_reg1 = 0x7f;
src/mame/drivers/pipedrm.c
r15082r15083
595595   state->m_subcpu = machine.device("sub");
596596
597597   /* initialize main Z80 bank */
598   state->membank("bank1")->configure_entries(0, 8, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
598   state->membank("bank1")->configure_entries(0, 8, state->memregion("maincpu")->base() + 0x10000, 0x2000);
599599   state->membank("bank1")->set_entry(0);
600600
601601   /* initialize sound bank */
src/mame/drivers/ddragon3.c
r15082r15083
365365   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
366366   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )
367367   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SERVICE1 )
368   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK )
368   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
369369   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW1:7")
370370   PORT_DIPSETTING(     0x1000, DEF_STR( Off ) )
371371   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
r15082r15083
420420   PORT_DIPSETTING(     0x0800, DEF_STR( On ) )
421421   PORT_SERVICE_DIPLOC( 0x1000, IP_ACTIVE_LOW, "SW2:5" )
422422   PORT_DIPNAME( 0x2000, 0x2000, "Stage Clear Energy" ) PORT_DIPLOCATION("SW2:6")
423   PORT_DIPSETTING(     0x2000, "0" )         PORT_CONDITION("IN3", 0x0100, PORTCOND_EQUALS, 0x0100)
424   PORT_DIPSETTING(     0x0000, "50" )      PORT_CONDITION("IN3", 0x0100, PORTCOND_EQUALS, 0x0100)
425   PORT_DIPSETTING(     0x2000, "100" )      PORT_CONDITION("IN3", 0x0100, PORTCOND_EQUALS, 0x0000)
426   PORT_DIPSETTING(     0x0000, "150" )      PORT_CONDITION("IN3", 0x0100, PORTCOND_EQUALS, 0x0000)
423   PORT_DIPSETTING(     0x2000, "0" )         PORT_CONDITION("IN3", 0x0100, EQUALS, 0x0100)
424   PORT_DIPSETTING(     0x0000, "50" )      PORT_CONDITION("IN3", 0x0100, EQUALS, 0x0100)
425   PORT_DIPSETTING(     0x2000, "100" )      PORT_CONDITION("IN3", 0x0100, EQUALS, 0x0000)
426   PORT_DIPSETTING(     0x0000, "150" )      PORT_CONDITION("IN3", 0x0100, EQUALS, 0x0000)
427427   PORT_BIT( 0xc000, IP_ACTIVE_LOW, IPT_UNUSED )
428428
429429   PORT_START("IN3")
src/mame/drivers/ccastles.c
r15082r15083
191191   rectangle visarea;
192192
193193   /* initialize globals */
194   state->m_syncprom = machine.root_device().memregion("proms")->base() + 0x000;
194   state->m_syncprom = state->memregion("proms")->base() + 0x000;
195195
196196   /* find the start of VBLANK in the SYNC PROM */
197197   for (state->m_vblank_start = 0; state->m_vblank_start < 256; state->m_vblank_start++)
r15082r15083
273273{
274274   static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
275275
276   return input_port_read(machine(), letanames[offset]);
276   return ioport(letanames[offset])->read();
277277}
278278
279279
src/mame/drivers/discoboy.c
r15082r15083
560560static DRIVER_INIT( discoboy )
561561{
562562   discoboy_state *state = machine.driver_data<discoboy_state>();
563   UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
563   UINT8 *ROM = state->memregion("maincpu")->base();
564564   UINT8 *AUDIO = state->memregion("audiocpu")->base();
565565
566566   memset(state->m_ram_1, 0, sizeof(state->m_ram_1));
src/mame/drivers/mediagx.c
r15082r15083
572572
573573   if (ACCESSING_BITS_8_15)
574574   {
575      UINT8 nibble = m_parallel_latched;//(input_port_read_safe(machine(), m_portnames[m_parallel_pointer / 3], 0) >> (4 * (m_parallel_pointer % 3))) & 15;
575      UINT8 nibble = m_parallel_latched;//(ioport(m_portnames[m_parallel_pointer / 3])->read_safe(0) >> (4 * (m_parallel_pointer % 3))) & 15;
576576      r |= ((~nibble & 0x08) << 12) | ((nibble & 0x07) << 11);
577577      logerror("%08X:parallel_port_r()\n", cpu_get_pc(&space.device()));
578578#if 0
579579      if (m_controls_data == 0x18)
580580      {
581         r |= input_port_read(machine(), "IN0") << 8;
581         r |= ioport("IN0")->read() << 8;
582582      }
583583      else if (m_controls_data == 0x60)
584584      {
585         r |= input_port_read(machine(), "IN1") << 8;
585         r |= ioport("IN1")->read() << 8;
586586      }
587587      else if (m_controls_data == 0xff || m_controls_data == 0x50)
588588      {
589         r |= input_port_read(machine(), "IN2") << 8;
589         r |= ioport("IN2")->read() << 8;
590590      }
591591
592592      //r |= m_control_read << 8;
r15082r15083
625625
626626      logerror("%08X:", cpu_get_pc(&space.device()));
627627
628      m_parallel_latched = (input_port_read_safe(machine(), portnames[m_parallel_pointer / 3], 0) >> (4 * (m_parallel_pointer % 3))) & 15;
628      m_parallel_latched = (ioport(portnames[m_parallel_pointer / 3])->read_safe(0) >> (4 * (m_parallel_pointer % 3))) & 15;
629629      //parallel_pointer++;
630630      //logerror("[%02X] Advance pointer to %d\n", data, parallel_pointer);
631631      switch (data & 0xfc)
src/mame/drivers/orbit.c
r15082r15083
187187   PORT_DIPNAME( 0x40, 0x40, "DIAG TEST" ) /* should be off */
188188   PORT_DIPSETTING( 0x40, DEF_STR( Off ))
189189   PORT_DIPSETTING( 0x00, DEF_STR( On ))
190   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
190   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
191191
192192   PORT_START("BUTTONS")   /* 2800 */
193193   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Game 7 / Strong Gravity") PORT_CODE(KEYCODE_7_PAD)
src/mame/drivers/skimaxx.c
r15082r15083
138138static VIDEO_START( skimaxx )
139139{
140140   skimaxx_state *state = machine.driver_data<skimaxx_state>();
141   state->m_blitter_gfx = (UINT16 *) machine.root_device().memregion( "blitter" )->base();
141   state->m_blitter_gfx = (UINT16 *) state->memregion( "blitter" )->base();
142142   state->m_blitter_gfx_len = state->memregion( "blitter" )->bytes() / 2;
143143
144144   state->m_bg_buffer = auto_alloc_array(machine, UINT32, 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 2);   // 2 buffers
r15082r15083
150150
151151static SCREEN_UPDATE_IND16( skimaxx )
152152{
153//  popmessage("%02x %02x", input_port_read(screen.machine(), "X"), input_port_read(screen.machine(), "Y") );
153//  popmessage("%02x %02x", state->ioport("X")->read(), state->ioport("Y")->read() );
154154
155155   SCREEN_UPDATE16_CALL(tms340x0_ind16);
156156
r15082r15083
308308*/
309309READ32_MEMBER(skimaxx_state::skimaxx_analog_r)
310310{
311   return BITSWAP8(input_port_read(machine(), offset ? "Y" : "X"), 0,1,2,3,4,5,6,7);
311   return BITSWAP8(ioport(offset ? "Y" : "X")->read(), 0,1,2,3,4,5,6,7);
312312}
313313
314314/*************************************
src/mame/drivers/megadrvb.c
r15082r15083
281281   md_boot_state *state = space->machine().driver_data<md_boot_state>();
282282   if (cpu_get_pc(&space->device())==0x1b2a56)
283283   {
284      state->m_aladmdb_mcu_port = input_port_read(space->machine(), "MCU");
284      state->m_aladmdb_mcu_port = state->ioport("MCU")->read();
285285
286286      if (state->m_aladmdb_mcu_port & 0x100)
287287         return ((state->m_aladmdb_mcu_port & 0x0f) | 0x100); // coin inserted, calculate the number of coins
r15082r15083
289289         return (0x100); //MCU status, needed if you fall into a pitfall
290290   }
291291   if (cpu_get_pc(&space->device())==0x1b2a72) return 0x0000;
292   if (cpu_get_pc(&space->device())==0x1b2d24) return (input_port_read(space->machine(), "MCU") & 0x00f0) | 0x1200;    // difficulty
292   if (cpu_get_pc(&space->device())==0x1b2d24) return (space->machine().root_device().ioport("MCU")->read() & 0x00f0) | 0x1200;    // difficulty
293293   if (cpu_get_pc(&space->device())==0x1b2d4e) return 0x0000;
294294
295295   logerror("aladbl_r : %06x\n",cpu_get_pc(&space->device()));
r15082r15083
300300static READ16_HANDLER( mk3mdb_dsw_r )
301301{
302302   static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
303   return input_port_read(space->machine(), dswname[offset]);
303   return space->machine().root_device().ioport(dswname[offset])->read();
304304}
305305
306306static READ16_HANDLER( ssf2mdb_dsw_r )
307307{
308308   static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
309   return input_port_read(space->machine(), dswname[offset]);
309   return space->machine().root_device().ioport(dswname[offset])->read();
310310}
311311
312312static READ16_HANDLER( srmdb_dsw_r )
313313{
314314   static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
315   return input_port_read(space->machine(), dswname[offset]);
315   return space->machine().root_device().ioport(dswname[offset])->read();
316316}
317317
318318static READ16_HANDLER( topshoot_200051_r )
src/mame/drivers/mwarr.c
r15082r15083
243243   PORT_START("SYSTEM")
244244   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
245245   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
246   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
246   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
247247   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SPECIAL ) // otherwise it doesn't boot
248248   PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
249249
src/mame/drivers/speedatk.c
r15082r15083
9494
9595      for (t = 0 ; t < 8 ; t ++)
9696      {
97         if (!(input_port_read(machine, keynames[j+p_side]) & ( 1 << t )))
97         if (!(machine.root_device().ioport(keynames[j+p_side])->read() & ( 1 << t )))
9898         {
9999            return (i + t) | (p_side ? 0x20 : 0x00);
100100         }
r15082r15083
113113      return 0x80;
114114   }
115115
116   if((input_port_read(machine(),"COINS") & 1) || (input_port_read(machine(),"COINS") & 2))
116   if((ioport("COINS")->read() & 1) || (ioport("COINS")->read() & 2))
117117   {
118118      m_coin_impulse = m_coin_settings;
119119      m_coin_impulse--;
src/mame/drivers/5clown.c
r15082r15083
591591   _5clown_state *state = device->machine().driver_data<_5clown_state>();
592592   switch( state->m_mux_data & 0xf0 )      /* bits 4-7 */
593593   {
594      case 0x10: return input_port_read(device->machine(), "IN0-0");
595      case 0x20: return input_port_read(device->machine(), "IN0-1");
596      case 0x40: return input_port_read(device->machine(), "IN0-2");
597      case 0x80: return input_port_read(device->machine(), "IN0-3");
594      case 0x10: return state->ioport("IN0-0")->read();
595      case 0x20: return state->ioport("IN0-1")->read();
596      case 0x40: return state->ioport("IN0-2")->read();
597      case 0x80: return state->ioport("IN0-3")->read();
598598   }
599599
600600   return 0xff;
src/mame/drivers/jedi.c
r15082r15083
214214
215215   switch (m_a2d_select)
216216   {
217      case 0: ret = input_port_read(machine(), "STICKY"); break;
218      case 2: ret = input_port_read(machine(), "STICKX"); break;
217      case 0: ret = ioport("STICKY")->read(); break;
218      case 2: ret = ioport("STICKX")->read(); break;
219219   }
220220
221221   return ret;
r15082r15083
321321   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
322322   PORT_BIT( 0x18, IP_ACTIVE_LOW,  IPT_UNUSED )
323323   PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,jedi_state,jedi_audio_comm_stat_r, NULL)
324   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
324   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
325325
326326   PORT_START("STICKY")   /* analog Y */
327327   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
src/mame/drivers/seta2.c
r15082r15083
220220
221221   switch (m_keyboard_row)
222222   {
223      case 0x01: return input_port_read(machine(), "P1_KEY0");
224      case 0x02: return input_port_read(machine(), "P1_KEY1");
225      case 0x04: return input_port_read(machine(), "P1_KEY2");
226      case 0x08: return input_port_read(machine(), "P1_KEY3");
227      case 0x10: return input_port_read(machine(), "P1_KEY4");
223      case 0x01: return ioport("P1_KEY0")->read();
224      case 0x02: return ioport("P1_KEY1")->read();
225      case 0x04: return ioport("P1_KEY2")->read();
226      case 0x08: return ioport("P1_KEY3")->read();
227      case 0x10: return ioport("P1_KEY4")->read();
228228      default:   logerror("p1_r with keyboard_row = %02x\n", m_keyboard_row); return 0xffff;
229229   }
230230}
r15082r15083
234234
235235   switch (m_keyboard_row)
236236   {
237      case 0x01: return input_port_read(machine(), "P2_KEY0");
238      case 0x02: return input_port_read(machine(), "P2_KEY1");
239      case 0x04: return input_port_read(machine(), "P2_KEY2");
240      case 0x08: return input_port_read(machine(), "P2_KEY3");
241      case 0x10: return input_port_read(machine(), "P2_KEY4");
237      case 0x01: return ioport("P2_KEY0")->read();
238      case 0x02: return ioport("P2_KEY1")->read();
239      case 0x04: return ioport("P2_KEY2")->read();
240      case 0x08: return ioport("P2_KEY3")->read();
241      case 0x10: return ioport("P2_KEY4")->read();
242242      default:   logerror("p2_r with keyboard_row = %02x\n", m_keyboard_row); return 0xffff;
243243   }
244244}
r15082r15083
330330
331331READ16_MEMBER(seta2_state::pzlbowl_coins_r)
332332{
333   return input_port_read(machine(), "SYSTEM") | (machine().rand() & 0x80 );
333   return ioport("SYSTEM")->read() | (machine().rand() & 0x80 );
334334}
335335
336336WRITE16_MEMBER(seta2_state::pzlbowl_coin_counter_w)
r15082r15083
567567         return machine().rand();
568568
569569      case CF_PPDAT:
570         return input_port_read(machine(), "BATTERY") << 16;
570         return ioport("BATTERY")->read() << 16;
571571   }
572572
573573   return m_coldfire_regs[offset];
r15082r15083
575575
576576READ32_MEMBER(seta2_state::funcube_debug_r)
577577{
578   UINT32 ret = input_port_read(machine(),"DEBUG");
578   UINT32 ret = ioport("DEBUG")->read();
579579
580580   // This bits let you move the crosshair in the inputs / touch panel test with a joystick
581581   if (!(machine().primary_screen->frame_number() % 3))
r15082r15083
638638
639639READ8_MEMBER(seta2_state::funcube_coins_r)
640640{
641   UINT8 ret = input_port_read(machine(),"SWITCH");
641   UINT8 ret = ioport("SWITCH")->read();
642642   UINT8 coin_bit0 = 1;   // active low
643643   UINT8 coin_bit1 = 1;
644644
r15082r15083
21532153   }
21542154   else
21552155   {
2156      UINT8 press   = input_port_read(device->machine(),"TOUCH_PRESS");
2156      UINT8 press   = device->machine().root_device().ioport("TOUCH_PRESS")->read();
21572157      UINT8 release = state->m_funcube_press && !press;
21582158
21592159      if ( press || release )
21602160      {
21612161         state->m_funcube_serial_fifo[0] = press ? 0xfe : 0xfd;
2162         state->m_funcube_serial_fifo[1] = input_port_read(device->machine(),"TOUCH_X");
2163         state->m_funcube_serial_fifo[2] = input_port_read(device->machine(),"TOUCH_Y");
2162         state->m_funcube_serial_fifo[1] = device->machine().root_device().ioport("TOUCH_X")->read();
2163         state->m_funcube_serial_fifo[2] = device->machine().root_device().ioport("TOUCH_Y")->read();
21642164         state->m_funcube_serial_fifo[3] = 0xff;
21652165         state->m_funcube_serial_count = 4;
21662166      }
src/mame/drivers/flkatck.c
r15082r15083
4747   {
4848      case 0x00:
4949         if (offset & 0x02)
50            data = input_port_read(machine(), (offset & 0x01) ? "COIN" : "DSW3");
50            data = ioport((offset & 0x01) ? "COIN" : "DSW3")->read();
5151         else
52            data = input_port_read(machine(), (offset & 0x01) ? "P2" : "P1");
52            data = ioport((offset & 0x01) ? "P2" : "P1")->read();
5353         break;
5454      case 0x01:
5555         if (offset & 0x02)
56            data = input_port_read(machine(), (offset & 0x01) ? "DSW1" : "DSW2");
56            data = ioport((offset & 0x01) ? "DSW1" : "DSW2")->read();
5757         break;
5858   }
5959
src/mame/drivers/zn.c
r15082r15083
342342   {
343343      if( state->m_b_lastclock )
344344      {
345         int bit = ( ( input_port_read(machine, "DSW") >> state->m_n_dip_bit ) & 1 );
345         int bit = ( ( state->ioport("DSW")->read() >> state->m_n_dip_bit ) & 1 );
346346         verboselog( machine, 2, "read dip %02x -> %02x\n", n_data, bit * PSX_SIO_IN_DATA );
347347         psx_sio_input( machine, 0, PSX_SIO_IN_DATA, bit * PSX_SIO_IN_DATA );
348348         state->m_n_dip_bit++;
r15082r15083
20942094
20952095      if( state->m_jdredd_gun_mux == 0 )
20962096      {
2097         x = input_port_read(state->machine(), "GUN1X");
2098         y = input_port_read(state->machine(), "GUN1Y");
2097         x = state->machine().root_device().ioport("GUN1X")->read();
2098         y = state->machine().root_device().ioport("GUN1Y")->read();
20992099      }
21002100      else
21012101      {
2102         x = input_port_read(state->machine(), "GUN2X");
2103         y = input_port_read(state->machine(), "GUN2Y");
2102         x = state->machine().root_device().ioport("GUN2X")->read();
2103         y = state->machine().root_device().ioport("GUN2Y")->read();
21042104      }
21052105
21062106      if( x > 0x393 && x < 0xcb2 &&
src/mame/drivers/paradise.c
r15082r15083
260260   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
261261   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
262262   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
263   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
263   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
264264   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
265265INPUT_PORTS_END
266266
r15082r15083
345345   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
346346   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5)
347347   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
348   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
348   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
349349   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
350350   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
351351   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
424424   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
425425   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
426426   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
427   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
427   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
428428   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
429429INPUT_PORTS_END
430430
r15082r15083
506506   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
507507   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
508508   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
509   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
509   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
510510   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
511511INPUT_PORTS_END
512512
r15082r15083
588588   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
589589   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
590590   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
591   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
591   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
592592   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
593593INPUT_PORTS_END
594594
r15082r15083
672672static MACHINE_START( paradise )
673673{
674674   paradise_state *state = machine.driver_data<paradise_state>();
675   int bank_n = machine.root_device().memregion("maincpu")->bytes() / 0x4000 - 1;
675   int bank_n = state->memregion("maincpu")->bytes() / 0x4000 - 1;
676676   UINT8 *ROM = state->memregion("maincpu")->base();
677677
678678   state->membank("bank1")->configure_entries(0, 3, &ROM[0x00000], 0x4000);
src/mame/drivers/balsente.c
r15082r15083
385385   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
386386   PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
387387   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
388   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
388   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
389389
390390   /* Analog ports */
391391   PORT_START("AN0")
src/mame/drivers/galpani3.c
r15082r15083
529529   {
530530      case 0x03:   // DSW
531531      {
532         state->m_mcu_ram[mcu_offset] = input_port_read(machine, "DSW");
532         state->m_mcu_ram[mcu_offset] = state->ioport("DSW")->read();
533533         logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine.describe_context(), mcu_command, mcu_offset*2);
534534      }
535535      break;
src/mame/drivers/terracre.c
r15082r15083
133133
134134READ16_MEMBER(terracre_state::horekid_IN2_r)
135135{
136   int data = input_port_read(machine(), "IN2");
136   int data = ioport("IN2")->read();
137137
138138   if (!(data & 0x40))      // FAKE button 3 for "Debug Mode"
139139   {
src/mame/drivers/meyc8080.c
r15082r15083
4444
4545***********************************************************
4646
47  To initialize battery RAM, go into testmode (F1 -> F2),
48  and then press the Reset Counters button.
47  To initialize battery RAM, go into Meter Read mode (F1 -> 9),
48  and then press the Meter Read + Reset buttons (9 + 0).
4949
5050  If a game is not turned off properly, eg. exiting MAME
5151  in mid-game, it may run faulty on the next boot.
r15082r15083
8383};
8484
8585
86#define NUM_PENS   (8)
87
88
8986/*************************************
9087 *
9188 *  Video system
9289 *
9390 *************************************/
9491
95static void get_pens(pen_t *pens)
96{
97   offs_t i;
98
99   for (i = 0; i < NUM_PENS; i++)
100   {
101      pens[i] = MAKE_RGB(pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0));
102   }
103}
104
105
10692static SCREEN_UPDATE_RGB32( meyc8080 )
10793{
10894   meyc8080_state *state = screen.machine().driver_data<meyc8080_state>();
109   pen_t pens[NUM_PENS];
11095   offs_t offs;
11196
112   get_pens(pens);
113
11497   for (offs = 0; offs < state->m_videoram_0.bytes(); offs++)
11598   {
11699      int i;
r15082r15083
130113
131114      for (i = 0; i < 8; i++)
132115      {
133         UINT8 color = ((data_r >> 5) & 0x04) |
134                    ((data_g >> 6) & 0x02) |
135                    ((data_b >> 7) & 0x01);
116         bitmap.pix32(y, x) = MAKE_RGB(pal1bit(data_r >> 7), pal1bit(data_g >> 7), pal1bit(data_b >> 7));
136117
137         bitmap.pix32(y, x) = pens[color];
138
139118         data_r = data_r << 1;
140119         data_g = data_g << 1;
141120         data_b = data_b << 1;
r15082r15083
344323
345324static INPUT_PORTS_START( wldarrow )
346325   PORT_START("IN0")
347   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
326   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
348327   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
349328   PORT_DIPNAME( 0x04, 0x00, "Monitor" )
350329   PORT_DIPSETTING(    0x00, "Color" )
r15082r15083
377356   PORT_DIPNAME( 0x40, 0x00, "Bit Switch 7" )      PORT_DIPLOCATION("BSW:7")
378357   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
379358   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
380   PORT_DIPNAME( 0x80, 0x00, "Bit Switch 8" )      PORT_DIPLOCATION("BSW:8")
381   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
382   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
359   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "BSW:8" )
383360
384361   PORT_START("IN1")
385   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_C) PORT_NAME("Stop Reel 3")   /* Skill Stop only? */
386   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_X) PORT_NAME("Stop Reel 2")   /* Skill Stop only? */
387   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_Z) PORT_NAME("Stop Reel 1")   /* Skill Stop only? */
388   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_M) PORT_NAME("Start")
389   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_N) PORT_NAME("Bet")
390   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Reset Counters")
391   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
362   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP3 )
363   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP2 )
364   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP1 )
365   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
366   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BET )
367   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Meter Reset")
368   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Meter Read")
392369   PORT_DIPNAME( 0x80, 0x80, "Night Switch" ) PORT_CODE(KEYCODE_F1) PORT_TOGGLE
393370   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
394371   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r15082r15083
407384
408385static INPUT_PORTS_START( mdrawpkr )
409386   PORT_START("IN0")
410   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
387   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
411388   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
412389   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
413390   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
429406   PORT_DIPNAME( 0x08, 0x00, "Bit Switch 4" )      PORT_DIPLOCATION("BSW:4")
430407   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
431408   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
432   PORT_DIPNAME( 0x10, 0x00, "Bit Switch 5" )      PORT_DIPLOCATION("BSW:5")
409   PORT_DIPNAME( 0x10, 0x00, "Bit Switch 5" )      PORT_DIPLOCATION("BSW:5") // no coinage sw
433410   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
434411   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
435412   PORT_DIPNAME( 0x20, 0x00, "Bit Switch 6" )      PORT_DIPLOCATION("BSW:6")
r15082r15083
438415   PORT_DIPNAME( 0x40, 0x00, "Bit Switch 7" )      PORT_DIPLOCATION("BSW:7")
439416   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
440417   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
441   PORT_DIPNAME( 0x80, 0x00, "Bit Switch 8" )      PORT_DIPLOCATION("BSW:8")
442   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
443   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
418   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "BSW:8" )
444419
445420   PORT_START("IN1")
446421   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_CANCEL )
r15082r15083
448423   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BET )
449424   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL )
450425   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
451   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 )   PORT_NAME("Reset Counters")
452   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
426   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Meter Reset")
427   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Meter Read")
453428   PORT_DIPNAME( 0x80, 0x80, "Night Switch" ) PORT_CODE(KEYCODE_F1) PORT_TOGGLE
454429   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
455430   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r15082r15083
468443
469444static INPUT_PORTS_START( mdrawpkra )
470445   PORT_START("IN0")
471   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
446   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
472447   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
473448   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
474449   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
490465   PORT_DIPNAME( 0x08, 0x00, "Bit Switch 4" )      PORT_DIPLOCATION("BSW:4")
491466   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
492467   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
493   PORT_DIPNAME( 0x10, 0x00, "Bit Switch 5" )      PORT_DIPLOCATION("BSW:5")
494   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
495   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
468   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) )   PORT_DIPLOCATION("BSW:5")
469   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
470   PORT_DIPSETTING(    0x10, DEF_STR( 1C_5C ) )
496471   PORT_DIPNAME( 0x20, 0x00, "Bit Switch 6" )      PORT_DIPLOCATION("BSW:6")
497472   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
498473   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
499474   PORT_DIPNAME( 0x40, 0x00, "Bit Switch 7" )      PORT_DIPLOCATION("BSW:7")
500475   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
501476   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
502   PORT_DIPNAME( 0x80, 0x00, "Bit Switch 8" )      PORT_DIPLOCATION("BSW:8")
503   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
504   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
477   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "BSW:8" )
505478
506479   PORT_START("IN1")
507480   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_CANCEL )
r15082r15083
509482   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BET )
510483   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL )
511484   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
512   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 )   PORT_NAME("Reset Counters")
513   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
485   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Meter Reset")
486   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Meter Read")
514487   PORT_DIPNAME( 0x80, 0x80, "Night Switch" ) PORT_CODE(KEYCODE_F1) PORT_TOGGLE
515488   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
516489   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r15082r15083
529502
530503static INPUT_PORTS_START( casbjack )
531504   PORT_START("IN0")
532   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
505   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
533506   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
534507   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
535508   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
551524   PORT_DIPNAME( 0x08, 0x00, "Bit Switch 4" )      PORT_DIPLOCATION("BSW:4")
552525   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
553526   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
554   PORT_DIPNAME( 0x10, 0x00, "Bit Switch 5" )      PORT_DIPLOCATION("BSW:5")
555   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
556   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
527   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) )   PORT_DIPLOCATION("BSW:5")
528   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
529   PORT_DIPSETTING(    0x10, DEF_STR( 1C_5C ) )
557530   PORT_DIPNAME( 0x20, 0x00, "Bit Switch 6" )      PORT_DIPLOCATION("BSW:6")
558531   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
559532   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
560533   PORT_DIPNAME( 0x40, 0x00, "Bit Switch 7" )      PORT_DIPLOCATION("BSW:7")
561534   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
562535   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
563   PORT_DIPNAME( 0x80, 0x00, "Bit Switch 8" )      PORT_DIPLOCATION("BSW:8")
564   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
565   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
536   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "BSW:8" )
566537
567538   PORT_START("IN1")
568539   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_B) PORT_NAME("Split")
r15082r15083
570541   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("Bet")
571542   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_X) PORT_NAME("Hit")
572543   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
573   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Reset Counters")
574   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
544   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Meter Reset")
545   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Meter Read")
575546   PORT_DIPNAME( 0x80, 0x80, "Night Switch" ) PORT_CODE(KEYCODE_F1) PORT_TOGGLE
576547   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
577548   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r15082r15083
637608
638609/*
639610
640  Meyco Games, unknown PCB, 1981
611  Meyco Games, 1981
641612
642  NOTE TO WHOEVER IS MAME DEVELOPER FOR THIS DRIVER:  This is obviously part of a multiple board set.
643  The other PCB board(s) were unfound.  If/when the game is identified,
644  could you please let me know what it is?
645
646613  Dumper notes:
647614
648615  - Board is approximately 16.5"x14.25", with no daughterboards or satellite add-on boards.
r15082r15083
675642    |------------------------------------------------------------------------------|
676643
677644  * = 8 pin connector
678  & = 50 pin connector (assuming to other half of PCB)
645  & = 50 pin connector (meant for edge connector or to another pcb?)
679646
680647*/
681648
r15082r15083
689656   ROM_LOAD( "tms2516.k3", 0x2800, 0x0800, CRC(30904dc8) SHA1(c82276aa0eb8f48d136ad8c15dd309c9b880c294) )
690657ROM_END
691658
659
692660/*
693661
694662  Board silkscreened:
r15082r15083
750718 *
751719 *************************************/
752720
753/*     YEAR  NAME       PARENT    MACHINE   INPUT      INIT  ROT    COMPANY              FULLNAME                                    FLAGS                                      LAYOUT  */
754GAMEL( 1982, wldarrow,  0,        meyc8080, wldarrow,  0,    ROT0, "Meyco Games, Inc.", "Wild Arrow (color, Standard V4.8)",         GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_wldarrow  ) // B&W version not dumped yet
755GAMEL( 1984, mdrawpkr,  0,        meyc8080, mdrawpkr,  0,    ROT0, "Meyco Games, Inc.", "Draw Poker - Joker's Wild (Standard)",      GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_mdrawpkr  ) // year not shown, but it is in mdrawpkra
756GAMEL( 1984, mdrawpkra, mdrawpkr, meyc8080, mdrawpkra, 0,    ROT0, "Meyco Games, Inc.", "Draw Poker - Joker's Wild (02-11)",         GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_mdrawpkr  )
757GAMEL( 1983, casbjack,  0,        meyc8080, casbjack,  0,    ROT0, "Meyco Games, Inc.", "Casino Black Jack (color, Standard 00-05)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_meybjack  ) // B&W version not dumped yet
721/*    YEAR  NAME       PARENT    MACHINE   INPUT      INIT  ROT    COMPANY              FULLNAME                                    FLAGS                                      LAYOUT  */
722GAMEL(1982, wldarrow,  0,        meyc8080, wldarrow,  0,    ROT0, "Meyco Games, Inc.", "Wild Arrow (color, Standard V4.8)",         GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_wldarrow ) // B&W version not dumped yet
723GAMEL(1984, mdrawpkr,  0,        meyc8080, mdrawpkr,  0,    ROT0, "Meyco Games, Inc.", "Draw Poker - Joker's Wild (Standard)",      GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_mdrawpkr ) // year not shown, but it is in mdrawpkra
724GAMEL(1984, mdrawpkra, mdrawpkr, meyc8080, mdrawpkra, 0,    ROT0, "Meyco Games, Inc.", "Draw Poker - Joker's Wild (02-11)",         GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_mdrawpkr )
725GAMEL(1983, casbjack,  0,        meyc8080, casbjack,  0,    ROT0, "Meyco Games, Inc.", "Casino Black Jack (color, Standard 00-05)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_meybjack ) // B&W version not dumped yet
src/mame/drivers/malzak.c
r15082r15083
8282   // POT switch position, read from port A of the first S2636
8383   // Not sure of the correct values to return, but these should
8484   // do based on the game code.
85   switch (input_port_read(machine(), "POT"))
85   switch (ioport("POT")->read())
8686   {
8787      case 0:  // Normal play
8888         return 0xf0;
r15082r15083
210210   /* No POT switch on Malzak as far as I know */
211211
212212   PORT_START("SENSE")
213   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
213   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
214214
215215INPUT_PORTS_END
216216
r15082r15083
237237   PORT_DIPSETTING( 0x03, "4" )  // Change settings
238238
239239   PORT_START("SENSE")
240   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
240   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
241241
242242INPUT_PORTS_END
243243
src/mame/drivers/deco32.c
r15082r15083
358358{
359359   /* Protection/IO chip 75, same as Lemmings & Robocop 2 */
360360   switch (offset<<2) {
361   case 0x0a0: return input_port_read(machine(), "IN0"); /* Player 1 & 2 controls */
362   case 0x158: return input_port_read(machine(), "IN1"); /* Player 3 & 4 controls */
363   case 0xed4: return input_port_read(machine(), "IN2"); /* Misc */
361   case 0x0a0: return ioport("IN0")->read(); /* Player 1 & 2 controls */
362   case 0x158: return ioport("IN1")->read(); /* Player 3 & 4 controls */
363   case 0xed4: return ioport("IN2")->read(); /* Misc */
364364   }
365365
366366   logerror("%08x: Unmapped protection read %04x\n",cpu_get_pc(&space.device()),offset<<2);
r15082r15083
370370READ32_MEMBER(deco32_state::captaven_soundcpu_r)
371371{
372372   /* Top byte - top bit low == sound cpu busy, bottom word is dips */
373   return 0xffff0000 | input_port_read(machine(), "DSW");
373   return 0xffff0000 | ioport("DSW")->read();
374374}
375375
376376READ32_MEMBER(deco32_state::fghthist_control_r)
377377{
378378   switch (offset) {
379   case 0: return 0xffff0000 | input_port_read(machine(), "IN0");
380   case 1: return 0xffff0000 | input_port_read(machine(), "IN1"); //check top bits??
379   case 0: return 0xffff0000 | ioport("IN0")->read();
380   case 1: return 0xffff0000 | ioport("IN1")->read(); //check top bits??
381381   case 2: return 0xfffffffe | machine().device<eeprom_device>("eeprom")->read_bit();
382382   }
383383
r15082r15083
405405READ32_MEMBER(deco32_state::dragngun_service_r)
406406{
407407//  logerror("%08x:Read service\n",cpu_get_pc(&space.device()));
408   return input_port_read(machine(), "IN2");
408   return ioport("IN2")->read();
409409}
410410
411411READ32_MEMBER(deco32_state::lockload_gun_mirror_r)
r15082r15083
413413//logerror("%08x:Read gun %d\n",cpu_get_pc(&space.device()),offset);
414414//return ((machine().rand()%0xffff)<<16) | machine().rand()%0xffff;
415415   if (offset) /* Mirror of player 1 and player 2 fire buttons */
416      return input_port_read(machine(), "IN4") | ((machine().rand()%0xff)<<16);
417   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);
416      return ioport("IN4")->read() | ((machine().rand()%0xff)<<16);
417   return ioport("IN3")->read() | ioport("LIGHT0_X")->read() | (ioport("LIGHT0_X")->read()<<16) | (ioport("LIGHT0_X")->read()<<24); //((machine().rand()%0xff)<<16);
418418}
419419
420420READ32_MEMBER(deco32_state::dragngun_prot_r)
r15082r15083
427427//definitely vblank in locked load
428428
429429   switch (offset<<1) {
430   case 0x140/2: return 0xffff0000 | input_port_read(machine(), "IN0"); /* IN0 */
431   case 0xadc/2: return 0xffff0000 | input_port_read(machine(), "IN1") | m_strobe; /* IN1 */
432   case 0x6a0/2: return 0xffff0000 | input_port_read(machine(), "DSW"); /* IN2 (Dip switch) */
430   case 0x140/2: return 0xffff0000 | ioport("IN0")->read(); /* IN0 */
431   case 0xadc/2: return 0xffff0000 | ioport("IN1")->read() | m_strobe; /* IN1 */
432   case 0x6a0/2: return 0xffff0000 | ioport("DSW")->read(); /* IN2 (Dip switch) */
433433   }
434434   return 0xffffffff;
435435}
r15082r15083
439439{
440440   /* Ports 0-3 are read, but seem unused */
441441   switch (m_dragngun_lightgun_port) {
442   case 4: return input_port_read(machine(), "LIGHT0_X");
443   case 5: return input_port_read(machine(), "LIGHT1_X");
444   case 6: return input_port_read(machine(), "LIGHT0_Y");
445   case 7: return input_port_read(machine(), "LIGHT1_Y");
442   case 4: return ioport("LIGHT0_X")->read();
443   case 5: return ioport("LIGHT1_X")->read();
444   case 6: return ioport("LIGHT0_Y")->read();
445   case 7: return ioport("LIGHT1_Y")->read();
446446   }
447447
448448//  logerror("Illegal lightgun port %d read \n",m_dragngun_lightgun_port);
r15082r15083
479479READ32_MEMBER(deco32_state::tattass_prot_r)
480480{
481481   switch (offset<<1) {
482   case 0x280: return input_port_read(machine(), "IN0") << 16;
483   case 0x4c4: return input_port_read(machine(), "IN1") << 16;
482   case 0x280: return ioport("IN0")->read() << 16;
483   case 0x4c4: return ioport("IN1")->read() << 16;
484484   case 0x35a: return m_tattass_eprom_bit << 16;
485485   }
486486
r15082r15083
637637{
638638
639639   switch (offset<<1) {
640   case 0x280: return input_port_read(machine(), "IN0") << 16| 0xffff; /* IN0 */
641   case 0x4c4: return input_port_read(machine(), "IN1") << 16| 0xffff; /* IN1 */
640   case 0x280: return ioport("IN0")->read() << 16| 0xffff; /* IN0 */
641   case 0x4c4: return ioport("IN1")->read() << 16| 0xffff; /* IN1 */
642642   case 0x35a: return (machine().device<eeprom_device>("eeprom")->read_bit()<< 16) | 0xffff; // Debug switch in low word??
643643   }
644644
r15082r15083
12081208   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
12091209   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
12101210   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
1211   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
1211   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
12121212   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
12131213   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
12141214   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
12871287   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
12881288
12891289   PORT_START("IN2")
1290   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
1290   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
12911291   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
12921292   PORT_SERVICE( 0x0004, IP_ACTIVE_LOW )
12931293   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) //check  //test BUTTON F2
r15082r15083
13631363   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
13641364
13651365   PORT_START("IN2")
1366   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK ) //IPT_VBLANK )
1366   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") //IPT_CUSTOM ) PORT_VBLANK("screen")
13671367   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED )
13681368   PORT_SERVICE( 0x0004, IP_ACTIVE_LOW )
13691369   PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNUSED ) //check  //test BUTTON F2
r15082r15083
14131413   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
14141414   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
14151415   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
1416   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
1416   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
14171417   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
14181418   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
14191419   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
14511451   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
14521452   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
14531453   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
1454   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
1454   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
14551455   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
14561456   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
14571457   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/midzeus.c
r15082r15083
425425   static const UINT8 translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x0 };
426426   const char *namex = (const char *)param;
427427   const char *namey = namex + strlen(namex) + 1;
428   return (translate49[input_port_read(machine(), namey) >> 4] << 4) | translate49[input_port_read(machine(), namex) >> 4];
428   return (translate49[ioport(namey)->read() >> 4] << 4) | translate49[ioport(namex)->read() >> 4];
429429}
430430
431431
r15082r15083
438438
439439CUSTOM_INPUT_MEMBER(midzeus_state::keypad_r)
440440{
441   UINT32 bits = input_port_read(machine(), (const char *)param);
441   UINT32 bits = ioport((const char *)param)->read();
442442   UINT8 select = keypad_select;
443443   while ((select & 1) != 0)
444444   {
r15082r15083
461461   static const char * const tags[] = { "ANALOG0", "ANALOG1", "ANALOG2", "ANALOG3" };
462462   if (offset < 8 || offset > 11)
463463      logerror("%06X:analog_r(%X)\n", cpu_get_pc(&space.device()), offset);
464   return input_port_read(machine(), tags[offset & 3]);
464   return ioport(tags[offset & 3])->read();
465465}
466466
467467
r15082r15083
527527            { "GUNX1", "GUNY1" },
528528            { "GUNX2", "GUNY2" }
529529         };
530         gun_x[player] = input_port_read(machine(), names[player][0]) * visarea.width() / 255 + visarea.min_x + BEAM_XOFFS;
531         gun_y[player] = input_port_read(machine(), names[player][1]) * visarea.height() / 255 + visarea.min_y;
530         gun_x[player] = ioport(names[player][0])->read() * visarea.width() / 255 + visarea.min_x + BEAM_XOFFS;
531         gun_y[player] = ioport(names[player][1])->read() * visarea.height() / 255 + visarea.min_y;
532532         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);
533533      }
534534   }
src/mame/drivers/drw80pkr.c
r15082r15083
284284      {
285285
286286         // TODO: Get Input Port Values
287         kbdin = ((input_port_read(machine(), "IN1") & 0xaf ) << 8) + input_port_read(machine(), "IN0");
287         kbdin = ((ioport("IN1")->read() & 0xaf ) << 8) + ioport("IN0")->read();
288288
289289         switch (kbdin)
290290         {
src/mame/drivers/tomcat.c
r15082r15083
8989{
9090   switch( m_control_num )
9191   {
92   case 0: return input_port_read(machine(), "STICKY");
93   case 1: return input_port_read(machine(), "STICKX");
92   case 0: return ioport("STICKY")->read();
93   case 1: return ioport("STICKX")->read();
9494   default: return 0x7f7f;
9595   }
9696}
r15082r15083
9999{
100100   UINT16 result = 0;
101101   if (ACCESSING_BITS_8_15)
102      result |= input_port_read(machine(), "IN0") << 8;
102      result |= ioport("IN0")->read() << 8;
103103
104104   return result;
105105}
src/mame/drivers/zaxxon.c
r15082r15083
356356   int num = (FPTR)param;
357357   int delta, res;
358358
359   delta = input_port_read(machine(), dialname[num]);
359   delta = ioport(dialname[num])->read();
360360
361361   if (delta < 0x80)
362362   {
src/mame/drivers/shangkid.c
r15082r15083
134134   state->m_gfx_type = 1;
135135
136136   /* set up banking */
137   state->membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x8000, 0x8000);
137   state->membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x8000, 0x8000);
138138   state->membank("bank2")->configure_entries(0, 2, state->memregion("audiocpu")->base() + 0x0000, 0x10000);
139139}
140140
src/mame/drivers/karnov.c
r15082r15083
407407   switch (offset << 1)
408408   {
409409      case 0:
410         return input_port_read(machine(), "P1_P2");
410         return ioport("P1_P2")->read();
411411      case 2: /* Start buttons & VBL */
412         return input_port_read(machine(), "SYSTEM");
412         return ioport("SYSTEM")->read();
413413      case 4:
414         return input_port_read(machine(), "DSW");
414         return ioport("DSW")->read();
415415      case 6: /* i8751 return values */
416416         return m_i8751_return;
417417   }
r15082r15083
481481   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
482482   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
483483   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
484   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
484   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
485485INPUT_PORTS_END
486486
487487
r15082r15083
728728static INTERRUPT_GEN( karnov_interrupt )
729729{
730730   karnov_state *state = device->machine().driver_data<karnov_state>();
731   UINT8 port = input_port_read(device->machine(), "FAKE");
731   UINT8 port = state->ioport("FAKE")->read();
732732
733733   /* Coin input to the i8751 generates an interrupt to the main cpu */
734734   if (port == state->m_coin_mask)
src/mame/drivers/xtheball.c
r15082r15083
191191
192192READ16_MEMBER(xtheball_state::analogx_r)
193193{
194   return (input_port_read(machine(), "ANALOGX") << 8) | 0x00ff;
194   return (ioport("ANALOGX")->read() << 8) | 0x00ff;
195195}
196196
197197
r15082r15083
199199{
200200   /* doubles as a watchdog address */
201201   watchdog_reset_w(space,0,0);
202   return (input_port_read(machine(), "ANALOGY") << 8) | 0x00ff;
202   return (ioport("ANALOGY")->read() << 8) | 0x00ff;
203203}
204204
205205
src/mame/drivers/maxaflex.c
r15082r15083
7575
7676READ8_MEMBER(maxaflex_state::mcu_portA_r)
7777{
78   m_portA_in = input_port_read(machine(), "dsw") | (input_port_read(machine(), "coin") << 4) | (input_port_read(machine(), "console") << 5);
78   m_portA_in = ioport("dsw")->read() | (ioport("coin")->read() << 4) | (ioport("console")->read() << 5);
7979   return (m_portA_in & ~m_ddrA) | (m_portA_out & m_ddrA);
8080}
8181
r15082r15083
371371
372372READ8_DEVICE_HANDLER(maxaflex_atari_pia_pa_r)
373373{
374   return atari_input_disabled(device->machine()) ? 0xFF : input_port_read_safe(device->machine(), "djoy_0_1", 0);
374   return atari_input_disabled(device->machine()) ? 0xFF : device->machine().root_device().ioport("djoy_0_1")->read_safe(0);
375375}
376376
377377READ8_DEVICE_HANDLER(maxaflex_atari_pia_pb_r)
378378{
379   return atari_input_disabled(device->machine()) ? 0xFF : input_port_read_safe(device->machine(), "djoy_2_3", 0);
379   return atari_input_disabled(device->machine()) ? 0xFF : device->machine().root_device().ioport("djoy_2_3")->read_safe(0);
380380}
381381
382382
src/mame/drivers/kopunch.c
r15082r15083
2020   if (offset == 0)
2121      return machine().rand();
2222   else
23      return (machine().rand() & 0x07) | input_port_read(machine(), "SYSTEM");
23      return (machine().rand() & 0x07) | ioport("SYSTEM")->read();
2424}
2525
2626WRITE8_MEMBER(kopunch_state::kopunch_lamp_w)
src/mame/drivers/segaybd.c
r15082r15083
287287            return state->m_misc_io_data[offset];
288288
289289         /* otherwise, return an input port */
290         return input_port_read(space->machine(), portnames[offset]);
290         return space->machine().root_device().ioport(portnames[offset])->read();
291291
292292      /* 'SEGA' protection */
293293      case 0x10/2:
r15082r15083
403403   segas1x_state *state = space->machine().driver_data<segas1x_state>();
404404   static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6" };
405405   int selected = ((offset & 3) == 3) ? (3 + (state->m_misc_io_data[0x08/2] & 3)) : (offset & 3);
406   int value = input_port_read_safe(space->machine(), ports[selected], 0xff);
406   int value = state->ioport(ports[selected])->read_safe(0xff);
407407
408408   state->m_analog_data[offset & 3] = value;
409409}
src/mame/drivers/cloak.c
r15082r15083
228228   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )      // player 2 controls, not used
229229
230230   PORT_START("SYSTEM")
231   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK )
231   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
232232   PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
233233   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
234234   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
src/mame/drivers/foodf.c
r15082r15083
189189{
190190   static const char *const portnames[] = { "STICK0_X", "STICK1_X", "STICK0_Y", "STICK1_Y" };
191191
192   return input_port_read(machine(), portnames[m_whichport]);
192   return ioport(portnames[m_whichport])->read();
193193}
194194
195195
r15082r15083
326326
327327static READ8_DEVICE_HANDLER( pot_r )
328328{
329   return (input_port_read(device->machine(), "DSW") >> offset) << 7;
329   return (device->machine().root_device().ioport("DSW")->read() >> offset) << 7;
330330}
331331
332332static const pokey_interface pokey_config =
src/mame/drivers/cesclass.c
r15082r15083
229229   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
230230
231231   PORT_START("VBLANK")
232   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
232   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
233233INPUT_PORTS_END
234234
235235static PALETTE_INIT( cesclassic )
src/mame/drivers/forte2.c
r15082r15083
7272static READ8_DEVICE_HANDLER(forte2_ay8910_read_input)
7373{
7474   forte2_state *state = device->machine().driver_data<forte2_state>();
75   return input_port_read(device->machine(), "IN0") | (state->m_input_mask&0x3f);
75   return state->ioport("IN0")->read() | (state->m_input_mask&0x3f);
7676}
7777
7878static WRITE8_DEVICE_HANDLER( forte2_ay8910_set_input_mask )
src/mame/drivers/skyraid.c
r15082r15083
3636
3737READ8_MEMBER(skyraid_state::skyraid_port_0_r)
3838{
39   UINT8 val = input_port_read(machine(), "LANGUAGE");
39   UINT8 val = ioport("LANGUAGE")->read();
4040
41   if (input_port_read(machine(), "STICKY") > m_analog_range)
41   if (ioport("STICKY")->read() > m_analog_range)
4242      val |= 0x40;
43   if (input_port_read(machine(), "STICKX") > m_analog_range)
43   if (ioport("STICKX")->read() > m_analog_range)
4444      val |= 0x80;
4545
4646   return val;
src/mame/drivers/ddenlovr.c
r15082r15083
430430static int blit_draw( running_machine &machine, int src, int sx )
431431{
432432   dynax_state *state = machine.driver_data<dynax_state>();
433   UINT8 *src_data = machine.root_device().memregion("blitter")->base();
433   UINT8 *src_data = state->memregion("blitter")->base();
434434   int src_len = state->memregion("blitter")->bytes();
435435   int bit_addr = (src & 0xffffff) * state->m_ddenlovr_blit_rom_bits;   /* convert to bit address */
436436   int pen_size, arg_size, cmd;
r15082r15083
15971597   /* 0 and 1 are read from offset 1, 2 from offset 0... */
15981598   switch (m_input_sel)
15991599   {
1600      case 0x00:   return input_port_read(machine(), "P1");
1601      case 0x01:   return input_port_read(machine(), "P2");
1602      case 0x02:   return input_port_read(machine(), "SYSTEM");
1600      case 0x00:   return ioport("P1")->read();
1601      case 0x01:   return ioport("P2")->read();
1602      case 0x02:   return ioport("SYSTEM")->read();
16031603   }
16041604   return 0xff;
16051605}
r15082r15083
16091609{
16101610   dynax_state *state = device->machine().driver_data<dynax_state>();
16111611
1612   if (!BIT(state->m_dsw_sel, 0))   return input_port_read(device->machine(), "DSW1");
1613   if (!BIT(state->m_dsw_sel, 1))   return input_port_read(device->machine(), "DSW2");
1614   if (!BIT(state->m_dsw_sel, 2))   return input_port_read(device->machine(), "DSW3");
1612   if (!BIT(state->m_dsw_sel, 0))   return state->ioport("DSW1")->read();
1613   if (!BIT(state->m_dsw_sel, 1))   return state->ioport("DSW2")->read();
1614   if (!BIT(state->m_dsw_sel, 2))   return state->ioport("DSW3")->read();
16151615   if (!BIT(state->m_dsw_sel, 3))   return 0xff;//device->machine().rand();
16161616   if (!BIT(state->m_dsw_sel, 4))   return 0xff;//device->machine().rand();
16171617   return 0xff;
r15082r15083
16241624   /* 0 and 1 are read from offset 1, 2 from offset 0... */
16251625   switch (m_input_sel)
16261626   {
1627      case 0x10:   return input_port_read(machine(), "P1");
1628      case 0x11:   return input_port_read(machine(), "P2");
1629      case 0x12:   return input_port_read(machine(), "SYSTEM");
1627      case 0x10:   return ioport("P1")->read();
1628      case 0x11:   return ioport("P2")->read();
1629      case 0x12:   return ioport("SYSTEM")->read();
16301630   }
16311631   return 0xff;
16321632}
r15082r15083
17281728READ16_MEMBER(dynax_state::ddenlovj_dsw_r)
17291729{
17301730   UINT16 dsw = 0;
1731   if ((~*m_dsw_sel16) & 0x01)   dsw |= input_port_read(machine(), "DSW1");
1732   if ((~*m_dsw_sel16) & 0x02)   dsw |= input_port_read(machine(), "DSW2");
1733   if ((~*m_dsw_sel16) & 0x04)   dsw |= input_port_read(machine(), "DSW3");
1731   if ((~*m_dsw_sel16) & 0x01)   dsw |= ioport("DSW1")->read();
1732   if ((~*m_dsw_sel16) & 0x02)   dsw |= ioport("DSW2")->read();
1733   if ((~*m_dsw_sel16) & 0x04)   dsw |= ioport("DSW3")->read();
17341734   return dsw;
17351735}
17361736
r15082r15083
18881888READ16_MEMBER(dynax_state::nettoqc_input_r)
18891889{
18901890
1891   if (!BIT(m_dsw_sel, 0))   return input_port_read(machine(), "DSW1");
1892   if (!BIT(m_dsw_sel, 1))   return input_port_read(machine(), "DSW2");
1893   if (!BIT(m_dsw_sel, 2))   return input_port_read(machine(), "DSW3");
1891   if (!BIT(m_dsw_sel, 0))   return ioport("DSW1")->read();
1892   if (!BIT(m_dsw_sel, 1))   return ioport("DSW2")->read();
1893   if (!BIT(m_dsw_sel, 2))   return ioport("DSW3")->read();
18941894   return 0xffff;
18951895}
18961896
r15082r15083
19711971READ8_MEMBER(dynax_state::rongrong_input_r)
19721972{
19731973
1974   if (!BIT(m_dsw_sel, 0))   return input_port_read(machine(), "DSW1");
1975   if (!BIT(m_dsw_sel, 1))   return input_port_read(machine(), "DSW2");
1974   if (!BIT(m_dsw_sel, 0))   return ioport("DSW1")->read();
1975   if (!BIT(m_dsw_sel, 1))   return ioport("DSW2")->read();
19761976   if (!BIT(m_dsw_sel, 2))   return 0xff;//machine().rand();
19771977   if (!BIT(m_dsw_sel, 3))   return 0xff;//machine().rand();
1978   if (!BIT(m_dsw_sel, 4))   return input_port_read(machine(), "DSW3");
1978   if (!BIT(m_dsw_sel, 4))   return ioport("DSW3")->read();
19791979   return 0xff;
19801980}
19811981
r15082r15083
22522252READ8_MEMBER(dynax_state::funkyfig_dsw_r)
22532253{
22542254
2255   if (!BIT(m_dsw_sel, 0))  return input_port_read(machine(), "DSW1");
2256   if (!BIT(m_dsw_sel, 1))  return input_port_read(machine(), "DSW2");
2257   if (!BIT(m_dsw_sel, 2))  return input_port_read(machine(), "DSW3");
2255   if (!BIT(m_dsw_sel, 0))  return ioport("DSW1")->read();
2256   if (!BIT(m_dsw_sel, 1))  return ioport("DSW2")->read();
2257   if (!BIT(m_dsw_sel, 2))  return ioport("DSW3")->read();
22582258   logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(&space.device()), m_dsw_sel);
22592259   return 0xff;
22602260}
r15082r15083
22642264
22652265   switch (m_input_sel)
22662266   {
2267      case 0x22:   return input_port_read(machine(), "IN2");
2267      case 0x22:   return ioport("IN2")->read();
22682268      case 0x23:   return m_funkyfig_lockout;
22692269   }
22702270   logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
r15082r15083
22762276
22772277   switch (m_input_sel)
22782278   {
2279      case 0x20:   return input_port_read(machine(), "IN0");
2280      case 0x21:   return input_port_read(machine(), "IN1");
2279      case 0x20:   return ioport("IN0")->read();
2280      case 0x21:   return ioport("IN1")->read();
22812281   }
22822282   logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
22832283   return 0xff;
r15082r15083
23792379
23802380   UINT8 val = 0xff;
23812381
2382   if      (!BIT(m_keyb, 0))   val = input_port_read(machine(), offset ? "KEY5" : "KEY0");
2383   else if (!BIT(m_keyb, 1))   val = input_port_read(machine(), offset ? "KEY6" : "KEY1");
2384   else if (!BIT(m_keyb, 2))   val = input_port_read(machine(), offset ? "KEY7" : "KEY2");
2385   else if (!BIT(m_keyb, 3))   val = input_port_read(machine(), offset ? "KEY8" : "KEY3");
2386   else if (!BIT(m_keyb, 4))   val = input_port_read(machine(), offset ? "KEY9" : "KEY4");
2382   if      (!BIT(m_keyb, 0))   val = ioport(offset ? "KEY5" : "KEY0")->read();
2383   else if (!BIT(m_keyb, 1))   val = ioport(offset ? "KEY6" : "KEY1")->read();
2384   else if (!BIT(m_keyb, 2))   val = ioport(offset ? "KEY7" : "KEY2")->read();
2385   else if (!BIT(m_keyb, 3))   val = ioport(offset ? "KEY8" : "KEY3")->read();
2386   else if (!BIT(m_keyb, 4))   val = ioport(offset ? "KEY9" : "KEY4")->read();
23872387
2388   val |= input_port_read(machine(), offset ? "HOPPER" : "BET");
2388   val |= ioport(offset ? "HOPPER" : "BET")->read();
23892389   return val;
23902390}
23912391
23922392READ8_MEMBER(dynax_state::hanakanz_dsw_r)
23932393{
23942394
2395   if (!BIT(m_dsw_sel, 0))   return input_port_read(machine(), "DSW1");
2396   if (!BIT(m_dsw_sel, 1))   return input_port_read(machine(), "DSW2");
2397   if (!BIT(m_dsw_sel, 2))   return input_port_read(machine(), "DSW3");
2398   if (!BIT(m_dsw_sel, 3))   return input_port_read(machine(), "DSW4");
2399   if (!BIT(m_dsw_sel, 4))   return input_port_read(machine(), "DSW5");
2395   if (!BIT(m_dsw_sel, 0))   return ioport("DSW1")->read();
2396   if (!BIT(m_dsw_sel, 1))   return ioport("DSW2")->read();
2397   if (!BIT(m_dsw_sel, 2))   return ioport("DSW3")->read();
2398   if (!BIT(m_dsw_sel, 3))   return ioport("DSW4")->read();
2399   if (!BIT(m_dsw_sel, 4))   return ioport("DSW5")->read();
24002400   return 0xff;
24012401}
24022402
r15082r15083
25622562{
25632563   UINT8 val = 0xff;
25642564
2565   if      (!BIT(m_keyb, 0))   val = input_port_read(machine(), offset ? "KEY5" : "KEY0");
2566   else if (!BIT(m_keyb, 1))   val = input_port_read(machine(), offset ? "KEY6" : "KEY1");
2567   else if (!BIT(m_keyb, 2))   val = input_port_read(machine(), offset ? "KEY7" : "KEY2");
2568   else if (!BIT(m_keyb, 3))   val = input_port_read(machine(), offset ? "KEY8" : "KEY3");
2569   else if (!BIT(m_keyb, 4))   val = input_port_read(machine(), offset ? "KEY9" : "KEY4");
2565   if      (!BIT(m_keyb, 0))   val = ioport(offset ? "KEY5" : "KEY0")->read();
2566   else if (!BIT(m_keyb, 1))   val = ioport(offset ? "KEY6" : "KEY1")->read();
2567   else if (!BIT(m_keyb, 2))   val = ioport(offset ? "KEY7" : "KEY2")->read();
2568   else if (!BIT(m_keyb, 3))   val = ioport(offset ? "KEY8" : "KEY3")->read();
2569   else if (!BIT(m_keyb, 4))   val = ioport(offset ? "KEY9" : "KEY4")->read();
25702570
2571   val |= input_port_read(machine(), offset ? "HOPPER" : "BET");
2571   val |= ioport(offset ? "HOPPER" : "BET")->read();
25722572
25732573   if (offset)
25742574      val |= 0x80;   // blitter busy
r15082r15083
25852585static void mjchuuka_get_romdata(running_machine &machine)
25862586{
25872587   dynax_state *state = machine.driver_data<dynax_state>();
2588   UINT8 *rom = machine.root_device().memregion("blitter")->base();
2588   UINT8 *rom = state->memregion("blitter")->base();
25892589   size_t size = state->memregion("blitter")->bytes();
25902590   int address = (state->m_ddenlovr_blit_address & 0xffffff) * 2;
25912591
r15082r15083
27162716
27172717   switch (m_input_sel)
27182718   {
2719      case 0x00:   return input_port_read(machine(), "SYSTEM");
2719      case 0x00:   return ioport("SYSTEM")->read();
27202720      case 0x01:   return 0xff;
27212721      case 0x02:   return 0xff;   // bit 7 = 0 -> blitter busy, + hopper switch
27222722      case 0x03:   return 0xff;
r15082r15083
27312731{
27322732   UINT8 ret = 0xff;
27332733
2734   if      (BIT(m_keyb, 0))   ret = input_port_read(machine(), "KEY0");
2735   else if (BIT(m_keyb, 1))   ret = input_port_read(machine(), "KEY1");
2736   else if (BIT(m_keyb, 2))   ret = input_port_read(machine(), "KEY2");
2737   else if (BIT(m_keyb, 3))   ret = input_port_read(machine(), "KEY3");
2738   else if (BIT(m_keyb, 4))   ret = input_port_read(machine(), "KEY4");
2734   if      (BIT(m_keyb, 0))   ret = ioport("KEY0")->read();
2735   else if (BIT(m_keyb, 1))   ret = ioport("KEY1")->read();
2736   else if (BIT(m_keyb, 2))   ret = ioport("KEY2")->read();
2737   else if (BIT(m_keyb, 3))   ret = ioport("KEY3")->read();
2738   else if (BIT(m_keyb, 4))   ret = ioport("KEY4")->read();
27392739   else   logerror("%06x: warning, unknown bits read, keyb = %02x\n", cpu_get_pc(&space.device()), m_keyb);
27402740
27412741   m_keyb <<= 1;
r15082r15083
27462746READ8_MEMBER(dynax_state::mjmyster_dsw_r)
27472747{
27482748
2749   if (!BIT(m_dsw_sel, 0))   return input_port_read(machine(), "DSW4");
2750   if (!BIT(m_dsw_sel, 1))   return input_port_read(machine(), "DSW3");
2751   if (!BIT(m_dsw_sel, 2))   return input_port_read(machine(), "DSW2");
2752   if (!BIT(m_dsw_sel, 3))   return input_port_read(machine(), "DSW1");
2753   if (!BIT(m_dsw_sel, 4))   return input_port_read(machine(), "DSW5");
2749   if (!BIT(m_dsw_sel, 0))   return ioport("DSW4")->read();
2750   if (!BIT(m_dsw_sel, 1))   return ioport("DSW3")->read();
2751   if (!BIT(m_dsw_sel, 2))   return ioport("DSW2")->read();
2752   if (!BIT(m_dsw_sel, 3))   return ioport("DSW1")->read();
2753   if (!BIT(m_dsw_sel, 4))   return ioport("DSW5")->read();
27542754   logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(&space.device()), m_dsw_sel);
27552755   return 0xff;
27562756}
r15082r15083
28412841{
28422842   dynax_state *state = device->machine().driver_data<dynax_state>();
28432843
2844   if (!BIT(state->m_dsw_sel, 0))   return input_port_read(device->machine(), "DSW4");
2845   if (!BIT(state->m_dsw_sel, 1))   return input_port_read(device->machine(), "DSW3");
2846   if (!BIT(state->m_dsw_sel, 2))   return input_port_read(device->machine(), "DSW2");
2847   if (!BIT(state->m_dsw_sel, 3))   return input_port_read(device->machine(), "DSW1");
2848   if (!BIT(state->m_dsw_sel, 4))   return input_port_read(device->machine(), "DSW5");
2844   if (!BIT(state->m_dsw_sel, 0))   return state->ioport("DSW4")->read();
2845   if (!BIT(state->m_dsw_sel, 1))   return state->ioport("DSW3")->read();
2846   if (!BIT(state->m_dsw_sel, 2))   return state->ioport("DSW2")->read();
2847   if (!BIT(state->m_dsw_sel, 3))   return state->ioport("DSW1")->read();
2848   if (!BIT(state->m_dsw_sel, 4))   return state->ioport("DSW5")->read();
28492849
28502850   logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", device->machine().describe_context(), state->m_dsw_sel);
28512851   return 0xff;
r15082r15083
28622862
28632863   switch (m_input_sel)
28642864   {
2865      case 0x20:   return input_port_read(machine(), "SYSTEM");
2866      case 0x21:   return input_port_read(machine(), "BET");
2865      case 0x20:   return ioport("SYSTEM")->read();
2866      case 0x21:   return ioport("BET")->read();
28672867      case 0x22:   return 0x7f;   // bit 7 = blitter busy, bit 6 = hopper
28682868      case 0x23:   return m_coins;
28692869   }
r15082r15083
29122912
29132913      // player 1
29142914      case 0xa1:
2915         return input_port_read(machine(), keynames0[m_keyb++]);
2915         return ioport(keynames0[m_keyb++])->read();
29162916
29172917      // player 2
29182918      case 0xa2:
2919         return input_port_read(machine(), keynames1[m_keyb++]);
2919         return ioport(keynames1[m_keyb++])->read();
29202920   }
29212921   logerror("%04x: input_r with select = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
29222922   return 0xff;
r15082r15083
29882988   dynax_state *state = space->machine().driver_data<dynax_state>();
29892989   UINT8 hopper_bit = ((state->m_hopper && !(space->machine().primary_screen->frame_number() % 10)) ? 0 : (1 << 6));
29902990
2991   if (!BIT(state->m_input_sel, 0))   return input_port_read(space->machine(), player ? "KEY5" : "KEY0") | hopper_bit;
2992   if (!BIT(state->m_input_sel, 1))   return input_port_read(space->machine(), player ? "KEY6" : "KEY1") | hopper_bit;
2993   if (!BIT(state->m_input_sel, 2))   return input_port_read(space->machine(), player ? "KEY7" : "KEY2") | hopper_bit;
2994   if (!BIT(state->m_input_sel, 3))   return input_port_read(space->machine(), player ? "KEY8" : "KEY3") | hopper_bit;
2995   if (!BIT(state->m_input_sel, 4))   return input_port_read(space->machine(), player ? "KEY9" : "KEY4") | hopper_bit;
2991   if (!BIT(state->m_input_sel, 0))   return state->ioport(player ? "KEY5" : "KEY0")->read() | hopper_bit;
2992   if (!BIT(state->m_input_sel, 1))   return state->ioport(player ? "KEY6" : "KEY1")->read() | hopper_bit;
2993   if (!BIT(state->m_input_sel, 2))   return state->ioport(player ? "KEY7" : "KEY2")->read() | hopper_bit;
2994   if (!BIT(state->m_input_sel, 3))   return state->ioport(player ? "KEY8" : "KEY3")->read() | hopper_bit;
2995   if (!BIT(state->m_input_sel, 4))   return state->ioport(player ? "KEY9" : "KEY4")->read() | hopper_bit;
29962996
29972997   return 0x7f;   // bit 7 = blitter busy, bit 6 = hopper
29982998}
r15082r15083
30073007
30083008   switch (m_dsw_sel)
30093009   {
3010      case 0x20:   return input_port_read(machine(), "SYSTEM");
3010      case 0x20:   return ioport("SYSTEM")->read();
30113011      case 0x21:   return hgokou_player_r(&space, 1);
30123012      case 0x22:   return hgokou_player_r(&space, 0);
30133013      case 0x23:   return m_coins;
r15082r15083
31703170
31713171   switch (m_input_sel)
31723172   {
3173      case 0x00:   return input_port_read(machine(), "P1");
3174      case 0x01:   return input_port_read(machine(), "P2");
3175      case 0x02:   return input_port_read(machine(), "SYSTEM");
3173      case 0x00:   return ioport("P1")->read();
3174      case 0x01:   return ioport("P2")->read();
3175      case 0x02:   return ioport("SYSTEM")->read();
31763176      case 0x0d:   return 0x00;
3177      case 0x80:   return input_port_read(machine(), keynames0[m_keyb++]);   // P1 (Keys)
3178      case 0x81:   return input_port_read(machine(), keynames1[m_keyb++]);   // P2 (Keys)
3177      case 0x80:   return ioport(keynames0[m_keyb++])->read();   // P1 (Keys)
3178      case 0x81:   return ioport(keynames1[m_keyb++])->read();   // P2 (Keys)
31793179   }
31803180   logerror("%06x: warning, unknown bits read, input_sel = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
31813181   return 0xff;
r15082r15083
31843184READ8_MEMBER(dynax_state::hparadis_dsw_r)
31853185{
31863186
3187   if (!BIT(m_dsw_sel, 0))   return input_port_read(machine(), "DSW1");
3188   if (!BIT(m_dsw_sel, 1))   return input_port_read(machine(), "DSW2");
3187   if (!BIT(m_dsw_sel, 0))   return ioport("DSW1")->read();
3188   if (!BIT(m_dsw_sel, 1))   return ioport("DSW2")->read();
31893189   if (!BIT(m_dsw_sel, 2))   return 0xff;
31903190   if (!BIT(m_dsw_sel, 3))   return 0xff;
3191   if (!BIT(m_dsw_sel, 4))   return input_port_read(machine(), "DSW3");
3191   if (!BIT(m_dsw_sel, 4))   return ioport("DSW3")->read();
31923192   return 0xff;
31933193}
31943194
r15082r15083
32463246
32473247   switch (m_input_sel)
32483248   {
3249      case 0x80:   return input_port_read(machine(), "SYSTEM");
3249      case 0x80:   return ioport("SYSTEM")->read();
32503250      case 0x81:   return 0x00;
32513251      case 0x82:   return 0xff;   // bit 7 = 0 -> blitter busy, + hopper switch
32523252      case 0x83:   return 0x00;
r15082r15083
33163316{
33173317   UINT16 dsw = 0;
33183318
3319   if (m_dsw_sel16[1] == 0xff)   dsw |= input_port_read(machine(), "DSW1");
3320   if (m_dsw_sel16[0] == 0xff)   dsw |= input_port_read(machine(), "DSW2");
3319   if (m_dsw_sel16[1] == 0xff)   dsw |= ioport("DSW1")->read();
3320   if (m_dsw_sel16[0] == 0xff)   dsw |= ioport("DSW2")->read();
33213321   return dsw;
33223322}
33233323
r15082r15083
34023402{
34033403   UINT8 val = 0xff;
34043404
3405   if      (!BIT(m_keyb, 0))   val = input_port_read(machine(), offset ? "KEY5" : "KEY0");
3406   else if (!BIT(m_keyb, 1))   val = input_port_read(machine(), offset ? "KEY6" : "KEY1");
3407   else if (!BIT(m_keyb, 2))   val = input_port_read(machine(), offset ? "KEY7" : "KEY2");
3408   else if (!BIT(m_keyb, 3))   val = input_port_read(machine(), offset ? "KEY8" : "KEY3");
3409   else if (!BIT(m_keyb, 4))   val = input_port_read(machine(), offset ? "KEY9" : "KEY4");
3405   if      (!BIT(m_keyb, 0))   val = ioport(offset ? "KEY5" : "KEY0")->read();
3406   else if (!BIT(m_keyb, 1))   val = ioport(offset ? "KEY6" : "KEY1")->read();
3407   else if (!BIT(m_keyb, 2))   val = ioport(offset ? "KEY7" : "KEY2")->read();
3408   else if (!BIT(m_keyb, 3))   val = ioport(offset ? "KEY8" : "KEY3")->read();
3409   else if (!BIT(m_keyb, 4))   val = ioport(offset ? "KEY9" : "KEY4")->read();
34103410
34113411   return val;
34123412}
r15082r15083
35243524{
35253525   UINT8 val = 0x3f;
35263526
3527   if      (!BIT(m_keyb, 0))   val = input_port_read(machine(), offset ? "KEY5" : "KEY0");
3528   else if (!BIT(m_keyb, 1))   val = input_port_read(machine(), offset ? "KEY6" : "KEY1");
3529   else if (!BIT(m_keyb, 2))   val = input_port_read(machine(), offset ? "KEY7" : "KEY2");
3530   else if (!BIT(m_keyb, 3))   val = input_port_read(machine(), offset ? "KEY8" : "KEY3");
3531   else if (!BIT(m_keyb, 4))   val = input_port_read(machine(), offset ? "KEY9" : "KEY4");
3527   if      (!BIT(m_keyb, 0))   val = ioport(offset ? "KEY5" : "KEY0")->read();
3528   else if (!BIT(m_keyb, 1))   val = ioport(offset ? "KEY6" : "KEY1")->read();
3529   else if (!BIT(m_keyb, 2))   val = ioport(offset ? "KEY7" : "KEY2")->read();
3530   else if (!BIT(m_keyb, 3))   val = ioport(offset ? "KEY8" : "KEY3")->read();
3531   else if (!BIT(m_keyb, 4))   val = ioport(offset ? "KEY9" : "KEY4")->read();
35323532
3533   val |= input_port_read(machine(), offset ? "HOPPER" : "BET");
3533   val |= ioport(offset ? "HOPPER" : "BET")->read();
35343534   if (offset)
35353535      val &= 0x7f;   // bit 7 = blitter busy
35363536   return val;
r15082r15083
36003600{
36013601   UINT8 val = 0x3f;
36023602
3603   if      (!BIT(m_keyb, 0))  val = input_port_read(machine(), "KEY0");
3604   else if (!BIT(m_keyb, 1))  val = input_port_read(machine(), "KEY1");
3605   else if (!BIT(m_keyb, 2))  val = input_port_read(machine(), "KEY2");
3606   else if (!BIT(m_keyb, 3))  val = input_port_read(machine(), "KEY3");
3607   else if (!BIT(m_keyb, 4))  val = input_port_read(machine(), "KEY4");
3603   if      (!BIT(m_keyb, 0))  val = ioport("KEY0")->read();
3604   else if (!BIT(m_keyb, 1))  val = ioport("KEY1")->read();
3605   else if (!BIT(m_keyb, 2))  val = ioport("KEY2")->read();
3606   else if (!BIT(m_keyb, 3))  val = ioport("KEY3")->read();
3607   else if (!BIT(m_keyb, 4))  val = ioport("KEY4")->read();
36083608
3609   val |= input_port_read(machine(), "BET");
3609   val |= ioport("BET")->read();
36103610   return val;
36113611}
36123612
r15082r15083
36143614{
36153615   UINT8 val = 0x3f;
36163616
3617   if      (!BIT(m_keyb, 0))  val = input_port_read(machine(), "KEY5");
3618   else if (!BIT(m_keyb, 1))  val = input_port_read(machine(), "KEY6");
3619   else if (!BIT(m_keyb, 2))  val = input_port_read(machine(), "KEY7");
3620   else if (!BIT(m_keyb, 3))  val = input_port_read(machine(), "KEY8");
3621   else if (!BIT(m_keyb, 4))  val = input_port_read(machine(), "KEY9");
3617   if      (!BIT(m_keyb, 0))  val = ioport("KEY5")->read();
3618   else if (!BIT(m_keyb, 1))  val = ioport("KEY6")->read();
3619   else if (!BIT(m_keyb, 2))  val = ioport("KEY7")->read();
3620   else if (!BIT(m_keyb, 3))  val = ioport("KEY8")->read();
3621   else if (!BIT(m_keyb, 4))  val = ioport("KEY9")->read();
36223622
3623   val |= input_port_read(machine(), "HOPPER");
3623   val |= ioport("HOPPER")->read();
36243624   return val;
36253625}
36263626
src/mame/drivers/chinagat.c
r15082r15083
387387
388388static INPUT_PORTS_START( chinagat )
389389   PORT_START("SYSTEM")
390   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
390   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
391391   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
392392   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
393393   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
r15082r15083
912912static DRIVER_INIT( chinagat )
913913{
914914   ddragon_state *state = machine.driver_data<ddragon_state>();
915   UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
915   UINT8 *MAIN = state->memregion("maincpu")->base();
916916   UINT8 *SUB = state->memregion("sub")->base();
917917
918918   state->m_technos_video_hw = 1;
src/mame/drivers/kaneko16.c
r15082r15083
343343{
344344   if (ACCESSING_BITS_0_7)
345345   {
346      input_port_write(machine(), "EEPROMOUT", data, 0xff);
346      ioport("EEPROMOUT")->write(data, 0xff);
347347   }
348348
349349   if (ACCESSING_BITS_8_15)
r15082r15083
612612READ16_MEMBER(kaneko16_state::gtmr_wheel_r)
613613{
614614   // check 'Controls' dip switch
615   switch (input_port_read(machine(), "DSW1") & 0x1000)
615   switch (ioport("DSW1")->read() & 0x1000)
616616   {
617617      case 0x0000:   // 'Both Sides' = 270deg Wheel
618         return   (input_port_read(machine(), "WHEEL0"));
618         return   (ioport("WHEEL0")->read());
619619      case 0x1000:   // '1P Side' = 360' Wheel
620         return   (input_port_read(machine(), "WHEEL1"));
620         return   (ioport("WHEEL1")->read());
621621      default:
622622         return   (0);
623623   }
r15082r15083
700700
701701READ16_MEMBER(kaneko16_state::gtmr2_wheel_r)
702702{
703   switch (input_port_read(machine(), "DSW1") & 0x1800)
703   switch (ioport("DSW1")->read() & 0x1800)
704704   {
705705      case 0x0000:   // 270' A. Wheel
706         return   (input_port_read(machine(), "WHEEL0"));
706         return   (ioport("WHEEL0")->read());
707707      case 0x1000:   // 270' D. Wheel
708         return   (input_port_read(machine(), "WHEEL1") << 8);
708         return   (ioport("WHEEL1")->read() << 8);
709709      case 0x0800:   // 360' Wheel
710         return   (input_port_read(machine(), "WHEEL2") << 8);
710         return   (ioport("WHEEL2")->read() << 8);
711711      default:
712712         logerror("gtmr2_wheel_r : read at %06x with joystick\n", cpu_get_pc(&space.device()));
713713         return   (~0);
r15082r15083
716716
717717READ16_MEMBER(kaneko16_state::gtmr2_IN1_r)
718718{
719   return   (input_port_read(machine(), "P2") & (input_port_read(machine(), "FAKE") | ~0x7100));
719   return  (ioport("P2")->read() & (ioport("FAKE")->read() | ~0x7100));
720720}
721721
722722static ADDRESS_MAP_START( gtmr2_map, AS_PROGRAM, 16, kaneko16_state )
r15082r15083
13621362   PORT_DIPSETTING(      0x0800, DEF_STR( Joystick ) )
13631363   PORT_DIPSETTING(      0x0000, "Wheel" )
13641364   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW1:5")
1365   PORT_DIPSETTING(      0x1000, "1P Side" )         PORT_CONDITION("DSW1",0x0800,PORTCOND_NOTEQUALS,0x00)
1366   PORT_DIPSETTING(      0x0000, "Both Sides" )      PORT_CONDITION("DSW1",0x0800,PORTCOND_NOTEQUALS,0x00)
1367   PORT_DIPSETTING(      0x1000, "360 degree wheel" )   PORT_CONDITION("DSW1",0x0800,PORTCOND_EQUALS,0x00)
1368   PORT_DIPSETTING(      0x0000, "270 degree wheel" )   PORT_CONDITION("DSW1",0x0800,PORTCOND_EQUALS,0x00)
1365   PORT_DIPSETTING(      0x1000, "1P Side" )         PORT_CONDITION("DSW1",0x0800,NOTEQUALS,0x00)
1366   PORT_DIPSETTING(      0x0000, "Both Sides" )      PORT_CONDITION("DSW1",0x0800,NOTEQUALS,0x00)
1367   PORT_DIPSETTING(      0x1000, "360 degree wheel" )   PORT_CONDITION("DSW1",0x0800,EQUALS,0x00)
1368   PORT_DIPSETTING(      0x0000, "270 degree wheel" )   PORT_CONDITION("DSW1",0x0800,EQUALS,0x00)
13691369   PORT_DIPNAME( 0x2000, 0x2000, "Use Brake" ) PORT_DIPLOCATION("SW1:6") /* Valid only when joystick is used */
13701370   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
13711371   PORT_DIPSETTING(      0x2000, DEF_STR( On ) )
src/mame/drivers/cybertnk.c
r15082r15083
531531   switch( offset )
532532   {
533533      case 2/2:
534         return input_port_read(machine(), "DSW1");
534         return ioport("DSW1")->read();
535535
536536      // 0x00110007 is controller device select
537537      // 0x001100D5 is controller data
r15082r15083
540540         switch( (m_io_ram[6/2]) & 0xff )
541541         {
542542            case 0:
543               m_io_ram[0xd4/2] = input_port_read(machine(), "TRAVERSE");
543               m_io_ram[0xd4/2] = ioport("TRAVERSE")->read();
544544               break;
545545
546546            case 0x20:
547               m_io_ram[0xd4/2] = input_port_read(machine(), "ELEVATE");
547               m_io_ram[0xd4/2] = ioport("ELEVATE")->read();
548548               break;
549549
550550            case 0x40:
551               m_io_ram[0xd4/2] = input_port_read(machine(), "ACCEL");
551               m_io_ram[0xd4/2] = ioport("ACCEL")->read();
552552               break;
553553
554554            case 0x42:
r15082r15083
560560               break;
561561
562562            case 0x60:
563               m_io_ram[0xd4/2] = input_port_read(machine(), "HANDLE");
563               m_io_ram[0xd4/2] = ioport("HANDLE")->read();
564564               break;
565565
566566            //default:
r15082r15083
569569         return 0;
570570
571571      case 6/2:
572         return input_port_read(machine(), "IN0"); // high half
572         return ioport("IN0")->read(); // high half
573573
574574      case 8/2:
575         return input_port_read(machine(), "IN0"); // low half
575         return ioport("IN0")->read(); // low half
576576
577577      case 0xa/2:
578         return input_port_read(machine(), "DSW2");
578         return ioport("DSW2")->read();
579579
580580      case 0xd4/2:
581581         return m_io_ram[offset]; // controller data
src/mame/drivers/namcos10.c
r15082r15083
352352    */
353353
354354   UINT16 dd16 = d16 ^ key;
355   
356   key = d16;
355357
356358   key =
357      ((    BIT(d16,  3) ^ (BIT(cnt, 0) & !BIT(cnt, 2))) << 15) |
359      //((    BIT(d16,  3) ^ (BIT(cnt, 0) & !BIT(cnt, 2))) << 15) |
360      ((1 ^ BIT(key,  3) ^  BIT(d16, 0))                 << 15) |
358361      ((1 ^ BIT(key, 13) ^  BIT(cnt, 0))                 << 14) |
359362      ((1 ^ BIT(key, 11) ^  BIT(d16, 5) ^  BIT(d16, 2))  << 13) |
360363      ((    BIT(key,  9) ^  BIT(cnt, 3))                 << 12) |
r15082r15083
369372      ((1 ^ BIT(key,  8) ^ (BIT(cnt, 7) |  BIT(d16, 3))) <<  3) |
370373      ((    BIT(key, 14) ^ (BIT(cnt, 1) |  BIT(d16, 7))) <<  2) |
371374      ((1 ^ BIT(key, 12) ^ (BIT(cnt, 7) &  BIT(d16, 7))) <<  1) |
372      ((                   (BIT(cnt, 0) |  BIT(cnt, 2))) <<  0);
375      //((                   (BIT(cnt, 0) |  BIT(cnt, 2))) <<  0);
376      ((1 ^ BIT(key,  0) ^ BIT(cnt, 2))                  <<  0);
373377
374378   cnt++;
375379
r15082r15083
491495static void memn_driver_init( running_machine &machine )
492496{
493497   namcos10_state *state = machine.driver_data<namcos10_state>();
494   UINT8 *BIOS = (UINT8 *)machine.root_device().memregion( "user1" )->base();
498   UINT8 *BIOS = (UINT8 *)state->memregion( "user1" )->base();
495499   state->nand_base = (UINT8 *)state->memregion( "user2" )->base();
496500
497501   state->nand_copy( (UINT32 *)( BIOS + 0x0000000 ), 0x08000, 0x001c000 );
src/mame/drivers/gauntlet.c
r15082r15083
187187
188188READ16_MEMBER(gauntlet_state::port4_r)
189189{
190   int temp = input_port_read(machine(), "803008");
190   int temp = ioport("803008")->read();
191191   if (m_cpu_to_sound_ready) temp ^= 0x0020;
192192   if (m_sound_to_cpu_ready) temp ^= 0x0010;
193193   return temp;
r15082r15083
240240   if (m_cpu_to_sound_ready) temp ^= 0x80;
241241   if (m_sound_to_cpu_ready) temp ^= 0x40;
242242   if (!tms5220_readyq_r(machine().device("tms"))) temp ^= 0x20;
243   if (!(input_port_read(machine(), "803008") & 0x0008)) temp ^= 0x10;
243   if (!(ioport("803008")->read() & 0x0008)) temp ^= 0x10;
244244
245245   return temp;
246246}
r15082r15083
408408   PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED )
409409   PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
410410   PORT_BIT( 0x0030, IP_ACTIVE_HIGH, IPT_SPECIAL )
411   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_VBLANK )
411   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_CUSTOM ) PORT_VBLANK("screen")
412412   PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNUSED )
413413
414414   PORT_START("COIN")   /* 1020 (sound) */
r15082r15083
455455   PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED )
456456   PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
457457   PORT_BIT( 0x0030, IP_ACTIVE_HIGH, IPT_SPECIAL )
458   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_VBLANK )
458   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_CUSTOM ) PORT_VBLANK("screen")
459459   PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNUSED )
460460
461461   PORT_START("COIN")   /* 1020 (sound) */
src/mame/drivers/ms32.c
r15082r15083
183183   switch (m_mahjong_input_select[0])
184184   {
185185      case 0x01:
186         mj_input = input_port_read(machine(), "MJ0");
186         mj_input = ioport("MJ0")->read();
187187         break;
188188      case 0x02:
189         mj_input = input_port_read(machine(), "MJ1");
189         mj_input = ioport("MJ1")->read();
190190         break;
191191      case 0x04:
192         mj_input = input_port_read(machine(), "MJ2");
192         mj_input = ioport("MJ2")->read();
193193         break;
194194      case 0x08:
195         mj_input = input_port_read(machine(), "MJ3");
195         mj_input = ioport("MJ3")->read();
196196         break;
197197      case 0x10:
198         mj_input = input_port_read(machine(), "MJ4");
198         mj_input = ioport("MJ4")->read();
199199         break;
200200      default:
201201         mj_input = 0;
r15082r15083
209209READ32_MEMBER(ms32_state::ms32_read_inputs3)
210210{
211211   int a,b,c,d;
212   a = input_port_read(machine(), "AN2?"); // unused?
213   b = input_port_read(machine(), "AN2?"); // unused?
214   c = input_port_read(machine(), "AN1");
215   d = (input_port_read(machine(), "AN0") - 0xb0) & 0xff;
212   a = ioport("AN2?")->read(); // unused?
213   b = ioport("AN2?")->read(); // unused?
214   c = ioport("AN1")->read();
215   d = (ioport("AN0")->read() - 0xb0) & 0xff;
216216   return a << 24 | b << 16 | c << 8 | d << 0;
217217}
218218
r15082r15083
22022202{
22032203   ms32_state *state = machine.driver_data<ms32_state>();
22042204   state_save_register_global(machine, state->m_to_main);
2205   state->membank("bank4")->configure_entries(0, 16, machine.root_device().memregion("audiocpu")->base() + 0x14000, 0x4000);
2205   state->membank("bank4")->configure_entries(0, 16, state->memregion("audiocpu")->base() + 0x14000, 0x4000);
22062206   state->membank("bank5")->configure_entries(0, 16, state->memregion("audiocpu")->base() + 0x14000, 0x4000);
22072207}
22082208
src/mame/drivers/mpu4.c
r15082r15083
910910   }
911911   LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine().describe_context()));
912912
913   return input_port_read(device->machine(), "AUX1")|state->m_aux1_input;
913   return device->machine().root_device().ioport("AUX1")->read()|state->m_aux1_input;
914914}
915915
916916static WRITE8_DEVICE_HANDLER( pia_ic5_porta_w )
r15082r15083
10991099   coin_lockout_w(device->machine(), 1, (pia_ic5->b_output() & 0x02) );
11001100   coin_lockout_w(device->machine(), 2, (pia_ic5->b_output() & 0x04) );
11011101   coin_lockout_w(device->machine(), 3, (pia_ic5->b_output() & 0x08) );
1102   return input_port_read(device->machine(), "AUX2") | state->m_aux2_input;
1102   return device->machine().root_device().ioport("AUX2")->read() | state->m_aux2_input;
11031103}
11041104
11051105
r15082r15083
14151415/* The orange inputs are polled twice as often as the black ones, for reasons of efficiency.
14161416   This is achieved via connecting every input line to an AND gate, thus allowing two strobes
14171417   to represent each orange input bank (strobes are active low). */
1418   pia_ic5->cb1_w(input_port_read(device->machine(), "AUX2") & 0x80);
1419   return input_port_read(device->machine(), portnames[state->m_input_strobe]);
1418   pia_ic5->cb1_w(device->machine().root_device().ioport("AUX2")->read() & 0x80);
1419   return device->machine().root_device().ioport(portnames[state->m_input_strobe])->read();
14201420}
14211421
14221422
src/mame/drivers/darkseal.c
r15082r15083
4545   switch (offset<<1)
4646   {
4747      case 0:
48         return input_port_read(machine(), "DSW");
48         return ioport("DSW")->read();
4949
5050      case 2:
51         return input_port_read(machine(), "P1_P2");
51         return ioport("P1_P2")->read();
5252
5353      case 4:
54         return input_port_read(machine(), "SYSTEM");
54         return ioport("SYSTEM")->read();
5555   }
5656
5757   return ~0;
r15082r15083
120120   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
121121   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
122122   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
123   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
123   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
124124   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
125125   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
126126   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/big10.c
r15082r15083
119119{
120120   switch(m_mux_data)
121121   {
122      case 1: return input_port_read(machine(), "IN1");
123      case 2: return input_port_read(machine(), "IN2");
124      case 4: return input_port_read(machine(), "IN3");
122      case 1: return ioport("IN1")->read();
123      case 2: return ioport("IN2")->read();
124      case 4: return ioport("IN3")->read();
125125   }
126126
127127   return m_mux_data;
src/mame/drivers/redalert.c
r15082r15083
109109
110110static INTERRUPT_GEN( redalert_vblank_interrupt )
111111{
112   if( input_port_read(device->machine(), "COIN") )
112   if( device->machine().root_device().ioport("COIN")->read() )
113113      /* the service coin as conntected to the CPU's RDY pin as well */
114114      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
115115
r15082r15083
136136{
137137   cputag_set_input_line(machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
138138
139   return input_port_read(machine(), "STICK0");
139   return ioport("STICK0")->read();
140140}
141141
142142READ8_MEMBER(redalert_state::panther_unk_r)
143143{
144   return ((machine().rand() & 0x01) | (input_port_read(machine(), "C020") & 0xfe));
144   return ((machine().rand() & 0x01) | (ioport("C020")->read() & 0xfe));
145145}
146146
147147/*************************************
src/mame/drivers/mcr3.c
r15082r15083
143143
144144READ8_MEMBER(mcr3_state::demoderm_ip1_r)
145145{
146   return input_port_read(machine(), "MONO.IP1") |
147      (input_port_read(machine(), m_input_mux ? "MONO.IP1.ALT2" : "MONO.IP1.ALT1") << 2);
146   return ioport("MONO.IP1")->read() |
147      (ioport(m_input_mux ? "MONO.IP1.ALT2" : "MONO.IP1.ALT1")->read() << 2);
148148}
149149
150150
151151READ8_MEMBER(mcr3_state::demoderm_ip2_r)
152152{
153   return input_port_read(machine(), "MONO.IP2") |
154      (input_port_read(machine(), m_input_mux ? "MONO.IP2.ALT2" : "MONO.IP2.ALT1") << 2);
153   return ioport("MONO.IP2")->read() |
154      (ioport(m_input_mux ? "MONO.IP2.ALT2" : "MONO.IP2.ALT1")->read() << 2);
155155}
156156
157157
r15082r15083
182182READ8_MEMBER(mcr3_state::maxrpm_ip2_r)
183183{
184184   static const UINT8 shift_bits[5] = { 0x00, 0x05, 0x06, 0x01, 0x02 };
185   UINT8 start = input_port_read(machine(), "MONO.IP0");
186   UINT8 shift = input_port_read(machine(), "SHIFT");
185   UINT8 start = ioport("MONO.IP0")->read();
186   UINT8 shift = ioport("SHIFT")->read();
187187
188188   /* reset on a start */
189189   if (!(start & 0x08))
r15082r15083
256256
257257   /* when the read is toggled is when the ADC value is latched */
258258   if (!(data & 0x80))
259      m_latched_input = input_port_read(machine(), inputs[m_maxrpm_adc_select]);
259      m_latched_input = ioport(inputs[m_maxrpm_adc_select])->read();
260260
261261   /* when both the write and the enable are low, it's a write to the ADC0844 */
262262   /* unfortunately the behavior below doesn't match up with the inputs on the */
r15082r15083
278278
279279READ8_MEMBER(mcr3_state::rampage_ip4_r)
280280{
281   return input_port_read(machine(), "MONO.IP4") | (m_sounds_good->read(space,0) << 7);
281   return ioport("MONO.IP4")->read() | (m_sounds_good->read(space,0) << 7);
282282}
283283
284284
r15082r15083
301301
302302READ8_MEMBER(mcr3_state::powerdrv_ip2_r)
303303{
304   return input_port_read(machine(), "MONO.IP2") | (m_sounds_good->read(space, 0) << 7);
304   return ioport("MONO.IP2")->read() | (m_sounds_good->read(space, 0) << 7);
305305}
306306
307307
r15082r15083
345345
346346READ8_MEMBER(mcr3_state::stargrds_ip0_r)
347347{
348   UINT8 result = input_port_read(machine(), "MONO.IP0");
348   UINT8 result = ioport("MONO.IP0")->read();
349349   if (m_input_mux)
350      result = (result & ~0x0a) | (input_port_read(machine(), "MONO.IP0.ALT") & 0x0a);
350      result = (result & ~0x0a) | (ioport("MONO.IP0.ALT")->read() & 0x0a);
351351   return (result & ~0x10) | ((m_sounds_good->read(space, 0) << 4) & 0x10);
352352}
353353
r15082r15083
388388
389389READ8_MEMBER(mcr3_state::spyhunt_ip1_r)
390390{
391   return input_port_read(machine(), "ssio:IP1") | (m_chip_squeak_deluxe->read(space, 0) << 5);
391   return ioport("ssio:IP1")->read() | (m_chip_squeak_deluxe->read(space, 0) << 5);
392392}
393393
394394
395395READ8_MEMBER(mcr3_state::spyhunt_ip2_r)
396396{
397397   /* multiplexed steering wheel/gas pedal */
398   return input_port_read(machine(), m_input_mux ? "ssio:IP2.ALT" : "ssio:IP2");
398   return ioport(m_input_mux ? "ssio:IP2.ALT" : "ssio:IP2")->read();
399399}
400400
401401
r15082r15083
447447{
448448   /* multiplexed steering wheel/gas pedal */
449449   if (m_input_mux)
450      return input_port_read(machine(), "ssio:IP2.ALT");
450      return ioport("ssio:IP2.ALT")->read();
451451
452   return input_port_read(machine(), "ssio:IP2") + 5 * (machine().primary_screen->frame_number() & 1);
452   return ioport("ssio:IP2")->read() + 5 * (machine().primary_screen->frame_number() & 1);
453453}
454454
455455
src/mame/drivers/stadhero.c
r15082r15083
2525   switch (offset<<1)
2626   {
2727      case 0:
28         return input_port_read(machine(), "INPUTS");
28         return ioport("INPUTS")->read();
2929
3030      case 2:
31         return input_port_read(machine(), "COIN");
31         return ioport("COIN")->read();
3232
3333      case 4:
34         return input_port_read(machine(), "DSW");
34         return ioport("DSW")->read();
3535   }
3636
3737   logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",cpu_get_pc(&space.device()),0x30c000+offset);
r15082r15083
150150   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
151151   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
152152   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
153   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
153   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
154154INPUT_PORTS_END
155155
156156/******************************************************************************/
src/mame/drivers/taito_b.c
r15082r15083
336336
337337READ16_MEMBER(taitob_state::tracky1_hi_r)
338338{
339   return input_port_read(machine(), "TRACKX1");
339   return ioport("TRACKX1")->read();
340340}
341341
342342READ16_MEMBER(taitob_state::tracky1_lo_r)
343343{
344   return (input_port_read(machine(), "TRACKX1") & 0xff) << 8;
344   return (ioport("TRACKX1")->read() & 0xff) << 8;
345345}
346346
347347READ16_MEMBER(taitob_state::trackx1_hi_r)
348348{
349   return input_port_read(machine(), "TRACKY1");
349   return ioport("TRACKY1")->read();
350350}
351351
352352READ16_MEMBER(taitob_state::trackx1_lo_r)
353353{
354   return (input_port_read(machine(), "TRACKY1") & 0xff) << 8;
354   return (ioport("TRACKY1")->read() & 0xff) << 8;
355355}
356356
357357READ16_MEMBER(taitob_state::tracky2_hi_r)
358358{
359   return input_port_read(machine(), "TRACKX2");
359   return ioport("TRACKX2")->read();
360360}
361361
362362READ16_MEMBER(taitob_state::tracky2_lo_r)
363363{
364   return (input_port_read(machine(), "TRACKX2") & 0xff) << 8;
364   return (ioport("TRACKX2")->read() & 0xff) << 8;
365365}
366366
367367READ16_MEMBER(taitob_state::trackx2_hi_r)
368368{
369   return input_port_read(machine(), "TRACKY2");
369   return ioport("TRACKY2")->read();
370370}
371371
372372READ16_MEMBER(taitob_state::trackx2_lo_r)
373373{
374   return (input_port_read(machine(), "TRACKY2") & 0xff) << 8;
374   return (ioport("TRACKY2")->read() & 0xff) << 8;
375375}
376376
377377
r15082r15083
438438      /* bit 7 - set all the time (Chip Select?) */
439439
440440      /* EEPROM */
441      input_port_write(machine(), "EEPROMOUT", data, 0xff);
441      ioport("EEPROMOUT")->write(data, 0xff);
442442   }
443443}
444444
r15082r15083
475475   switch (offset)
476476   {
477477      case 0x01:
478         return input_port_read(machine(), "COIN") << 8;
478         return ioport("COIN")->read() << 8;
479479
480480      default:
481481         return tc0640fio_r(m_tc0640fio, offset) << 8;
src/mame/drivers/viper.c
r15082r15083
16041604   }
16051605   if (ACCESSING_BITS_32_39)
16061606   {
1607      UINT64 reg = input_port_read(machine(), "IN0");
1607      UINT64 reg = ioport("IN0")->read();
16081608      r |= reg << 32;
16091609   }
16101610   if (ACCESSING_BITS_24_31)
16111611   {
1612      UINT64 reg = input_port_read(machine(), "IN1");
1612      UINT64 reg = ioport("IN1")->read();
16131613      r |= reg << 24;
16141614   }
16151615   if (ACCESSING_BITS_16_23)
src/mame/drivers/jackal.c
r15082r15083
8585
8686READ8_MEMBER(jackal_state::topgunbl_rotary_r)
8787{
88   return (1 << input_port_read_safe(machine(), offset ? "DIAL1" : "DIAL0", 0x00)) ^ 0xff;
88   return (1 << ioport(offset ? "DIAL1" : "DIAL0")->read_safe(0x00)) ^ 0xff;
8989}
9090
9191WRITE8_MEMBER(jackal_state::jackal_flipscreen_w)
src/mame/drivers/mw8080bw.c
r15082r15083
315315
316316CUSTOM_INPUT_MEMBER(mw8080bw_state::seawolf_erase_input_r)
317317{
318   return input_port_read(machine(), SEAWOLF_ERASE_SW_PORT_TAG) &
319         input_port_read(machine(), SEAWOLF_ERASE_DIP_PORT_TAG);
318   return ioport(SEAWOLF_ERASE_SW_PORT_TAG)->read() &
319         ioport(SEAWOLF_ERASE_DIP_PORT_TAG)->read();
320320}
321321
322322
r15082r15083
353353   /* The actual commutator pcb (encoder) has 30 positions and works like the table says. */
354354   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)
355355   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
356   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0xe0) PORT_DIPLOCATION("G4:1,2")
357   PORT_DIPSETTING(    0x00, "60 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0x00)
358   PORT_DIPSETTING(    0x40, "70 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0x00)
359   PORT_DIPSETTING(    0x80, "80 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0x00)
360   PORT_DIPSETTING(    0xc0, "90 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0x00)
361   PORT_DIPSETTING(    0x00, "60 seconds" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_EQUALS, 0x00)
362   PORT_DIPSETTING(    0x40, "70 seconds" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_EQUALS, 0x00)
363   PORT_DIPSETTING(    0x80, "80 seconds" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_EQUALS, 0x00)
364   PORT_DIPSETTING(    0xc0, "90 seconds" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_EQUALS, 0x00)
356   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0xe0) PORT_DIPLOCATION("G4:1,2")
357   PORT_DIPSETTING(    0x00, "60 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0x00)
358   PORT_DIPSETTING(    0x40, "70 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0x00)
359   PORT_DIPSETTING(    0x80, "80 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0x00)
360   PORT_DIPSETTING(    0xc0, "90 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0x00)
361   PORT_DIPSETTING(    0x00, "60 seconds" ) PORT_CONDITION("IN1", 0xe0, EQUALS, 0x00)
362   PORT_DIPSETTING(    0x40, "70 seconds" ) PORT_CONDITION("IN1", 0xe0, EQUALS, 0x00)
363   PORT_DIPSETTING(    0x80, "80 seconds" ) PORT_CONDITION("IN1", 0xe0, EQUALS, 0x00)
364   PORT_DIPSETTING(    0xc0, "90 seconds" ) PORT_CONDITION("IN1", 0xe0, EQUALS, 0x00)
365365
366366   PORT_START("IN1")
367367   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
368368   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
369   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0xe0) PORT_DIPLOCATION("G4:3,4")
369   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0xe0) PORT_DIPLOCATION("G4:3,4")
370370   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
371371   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
372372   PORT_DIPSETTING(    0x0c, DEF_STR( 2C_3C ) )
r15082r15083
548548
549549UINT8 tornbase_get_cabinet_type(running_machine &machine)
550550{
551   return input_port_read(machine, TORNBASE_CAB_TYPE_PORT_TAG);
551   return machine.root_device().ioport(TORNBASE_CAB_TYPE_PORT_TAG)->read();
552552}
553553
554554
555555CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_hit_left_input_r)
556556{
557   return input_port_read(machine(), TORNBASE_L_HIT_PORT_TAG);
557   return ioport(TORNBASE_L_HIT_PORT_TAG)->read();
558558}
559559
560560
r15082r15083
565565   switch (tornbase_get_cabinet_type(machine()))
566566   {
567567   case TORNBASE_CAB_TYPE_UPRIGHT_OLD:
568      ret = input_port_read(machine(), TORNBASE_L_HIT_PORT_TAG);
568      ret = ioport(TORNBASE_L_HIT_PORT_TAG)->read();
569569      break;
570570
571571   case TORNBASE_CAB_TYPE_UPRIGHT_NEW:
572572   case TORNBASE_CAB_TYPE_COCKTAIL:
573573   default:
574      ret = input_port_read(machine(), TORNBASE_R_HIT_PORT_TAG);
574      ret = ioport(TORNBASE_R_HIT_PORT_TAG)->read();
575575      break;
576576   }
577577
r15082r15083
587587   {
588588   case TORNBASE_CAB_TYPE_UPRIGHT_OLD:
589589   case TORNBASE_CAB_TYPE_UPRIGHT_NEW:
590      ret = input_port_read(machine(), TORNBASE_L_PITCH_PORT_TAG);
590      ret = ioport(TORNBASE_L_PITCH_PORT_TAG)->read();
591591      break;
592592
593593   case TORNBASE_CAB_TYPE_COCKTAIL:
594594   default:
595      ret = input_port_read(machine(), TORNBASE_R_PITCH_PORT_TAG);
595      ret = ioport(TORNBASE_R_PITCH_PORT_TAG)->read();
596596      break;
597597   }
598598
r15082r15083
602602
603603CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_pitch_right_input_r)
604604{
605   return input_port_read(machine(), TORNBASE_L_PITCH_PORT_TAG);
605   return ioport(TORNBASE_L_PITCH_PORT_TAG)->read();
606606}
607607
608608
609609CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_score_input_r)
610610{
611   return input_port_read(machine(), TORNBASE_SCORE_SW_PORT_TAG) &
612         input_port_read(machine(), TORNBASE_SCORE_DIP_PORT_TAG);
611   return ioport(TORNBASE_SCORE_SW_PORT_TAG)->read() &
612         ioport(TORNBASE_SCORE_DIP_PORT_TAG)->read();
613613}
614614
615615
r15082r15083
643643   PORT_START("IN0")
644644   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,tornbase_hit_left_input_r, NULL)
645645   PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,tornbase_pitch_left_input_r, NULL)
646   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B1:7")
646   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B1:7")
647647   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
648648   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
649649
r15082r15083
656656   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
657657   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )  /* schematics shows it as "START", but not used by the software */
658658   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,tornbase_score_input_r, NULL)
659   PORT_DIPNAME( 0x78, 0x40, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B1:2,3,4,5")
659   PORT_DIPNAME( 0x78, 0x40, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B1:2,3,4,5")
660660   PORT_DIPSETTING(    0x18, "4 Coins/1 Inning" )
661661   PORT_DIPSETTING(    0x10, "3 Coins/1 Inning" )
662662   PORT_DIPSETTING(    0x38, "4 Coins/2 Innings" )
r15082r15083
774774   PORT_BIT( 0xff, 0x7f, IPT_PADDLE ) PORT_MINMAX(0x01,0xfe) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1)
775775
776776   PORT_START("IN2")
777   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x0c, PORTCOND_NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:1,2")
777   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x0c, NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:1,2")
778778   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
779779   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
780780   PORT_DIPSETTING(    0x03, DEF_STR( 2C_3C ) )
781781   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
782782   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("E3:3,4")
783   PORT_DIPSETTING(    0x0c, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x20)
784   PORT_DIPSETTING(    0x00, "80 seconds + 40 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x20)
785   PORT_DIPSETTING(    0x08, "99 seconds + 50 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x20)
786   PORT_DIPSETTING(    0x0c, "60 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x20)
787   PORT_DIPSETTING(    0x00, "80 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x20)
788   PORT_DIPSETTING(    0x08, "99 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x20)
783   PORT_DIPSETTING(    0x0c, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x20)
784   PORT_DIPSETTING(    0x00, "80 seconds + 40 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x20)
785   PORT_DIPSETTING(    0x08, "99 seconds + 50 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x20)
786   PORT_DIPSETTING(    0x0c, "60 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x20)
787   PORT_DIPSETTING(    0x00, "80 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x20)
788   PORT_DIPSETTING(    0x08, "99 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x20)
789789   PORT_DIPSETTING(    0x04, "Test Mode" )
790   PORT_DIPNAME( 0x30, 0x00, "Extended Time At" ) PORT_CONDITION("IN2", 0x0c, PORTCOND_NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:5,6")
790   PORT_DIPNAME( 0x30, 0x00, "Extended Time At" ) PORT_CONDITION("IN2", 0x0c, NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:5,6")
791791   PORT_DIPSETTING(    0x10, "2.00" )
792792   PORT_DIPSETTING(    0x00, "2.50" )
793793   PORT_DIPSETTING(    0x20, DEF_STR( None ) )
794794   /* PORT_DIPSETTING( 0x30, DEF_STR( None ) ) */
795   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Language )) PORT_CONDITION("IN2", 0x0c, PORTCOND_NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:7,8")
795   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Language )) PORT_CONDITION("IN2", 0x0c, NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:7,8")
796796   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
797797   PORT_DIPSETTING(    0x40, DEF_STR( German ) )
798798   PORT_DIPSETTING(    0x80, DEF_STR( French ) )
r15082r15083
817817   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
818818   PORT_DIPSETTING(    0x03, DEF_STR( 2C_3C ) )
819819   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
820   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:3,4")
821   PORT_DIPSETTING(    0x00, "45 seconds + 22 extended" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0xc0)
822   PORT_DIPSETTING(    0x04, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0xc0)
823   PORT_DIPSETTING(    0x08, "75 seconds + 37 extended" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0xc0)
824   PORT_DIPSETTING(    0x0c, "90 seconds + 45 extended" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0xc0)
825   PORT_DIPSETTING(    0x00, "45 seconds" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_EQUALS, 0xc0)
826   PORT_DIPSETTING(    0x04, "60 seconds" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_EQUALS, 0xc0)
827   PORT_DIPSETTING(    0x08, "75 seconds" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_EQUALS, 0xc0)
828   PORT_DIPSETTING(    0x0c, "90 seconds" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_EQUALS, 0xc0)
829   PORT_DIPNAME( 0x30, 0x20, "Extended Time At" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0xc0) PORT_DIPLOCATION("E3:5,6")
820   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:3,4")
821   PORT_DIPSETTING(    0x00, "45 seconds + 22 extended" ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0xc0)
822   PORT_DIPSETTING(    0x04, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0xc0)
823   PORT_DIPSETTING(    0x08, "75 seconds + 37 extended" ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0xc0)
824   PORT_DIPSETTING(    0x0c, "90 seconds + 45 extended" ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0xc0)
825   PORT_DIPSETTING(    0x00, "45 seconds" ) PORT_CONDITION("IN2", 0xc0, EQUALS, 0xc0)
826   PORT_DIPSETTING(    0x04, "60 seconds" ) PORT_CONDITION("IN2", 0xc0, EQUALS, 0xc0)
827   PORT_DIPSETTING(    0x08, "75 seconds" ) PORT_CONDITION("IN2", 0xc0, EQUALS, 0xc0)
828   PORT_DIPSETTING(    0x0c, "90 seconds" ) PORT_CONDITION("IN2", 0xc0, EQUALS, 0xc0)
829   PORT_DIPNAME( 0x30, 0x20, "Extended Time At" ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0xc0) PORT_DIPLOCATION("E3:5,6")
830830   PORT_DIPSETTING(    0x00, "350" )
831831   PORT_DIPSETTING(    0x10, "400" )
832832   PORT_DIPSETTING(    0x20, "450" )
r15082r15083
940940   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
941941   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )   /* labeled 'Not Used' */
942942   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1  )
943   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
943   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
944944   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
945945   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
946946   PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) )
947947   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
948   PORT_DIPNAME( 0x40, 0x40, "2 Player Game Time" ) PORT_CONDITION("IN1", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:3")
948   PORT_DIPNAME( 0x40, 0x40, "2 Player Game Time" ) PORT_CONDITION("IN1", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:3")
949949   PORT_DIPSETTING(    0x40, "4 minutes" )
950950   PORT_DIPSETTING(    0x00, "6 minutes" )
951951   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "SW:4" )
r15082r15083
10241024   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
10251025
10261026   PORT_START("IN2")
1027   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x10, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
1027   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x10, EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
10281028   PORT_DIPSETTING(    0x02, "2 Coins per Player" )
10291029   PORT_DIPSETTING(    0x03, "2 Coins/1 or 2 Players" )
10301030   PORT_DIPSETTING(    0x00, "1 Coin per Player" )
10311031   PORT_DIPSETTING(    0x01, "1 Coin/1 or 2 Players" )
1032   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x10, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
1032   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x10, EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
10331033   PORT_DIPSETTING(    0x00, "60 seconds" )
10341034   PORT_DIPSETTING(    0x04, "70 seconds" )
10351035   PORT_DIPSETTING(    0x08, "80 seconds" )
r15082r15083
11111111   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
11121112
11131113   PORT_START("IN2")
1114   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("A4:1")
1114   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("A4:1")
11151115   PORT_DIPSETTING(    0x00, "1 Coin/1 or 2 Players" )
11161116   PORT_DIPSETTING(    0x01, "1 Coin/1 or 2 Players, 2 Coins/3 or 4 Players" )
1117   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("A4:2")
1117   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("A4:2")
11181118   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
11191119   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1120   PORT_DIPNAME( 0x0c, 0x04, "Rounds" ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("A4:3,4")
1120   PORT_DIPNAME( 0x0c, 0x04, "Rounds" ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("A4:3,4")
11211121   PORT_DIPSETTING(    0x00, "2" )
11221122   PORT_DIPSETTING(    0x04, "3" )
11231123   PORT_DIPSETTING(    0x08, "4" )
11241124   PORT_DIPSETTING(    0x0c, "5" )
1125   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("A4:5")
1125   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("A4:5")
11261126   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
11271127   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1128   PORT_DIPNAME( 0x60, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("A4:6,7")
1128   PORT_DIPNAME( 0x60, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("A4:6,7")
11291129   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
11301130   PORT_DIPSETTING(    0x20, "Language 2" )
11311131   PORT_DIPSETTING(    0x40, "Language 3" )
r15082r15083
11901190   UINT32 ret;
11911191
11921192   if (m_desertgun_controller_select)
1193      ret = input_port_read(machine(), DESERTGU_GUN_X_PORT_TAG);
1193      ret = ioport(DESERTGU_GUN_X_PORT_TAG)->read();
11941194   else
1195      ret = input_port_read(machine(), DESERTGU_GUN_Y_PORT_TAG);
1195      ret = ioport(DESERTGU_GUN_Y_PORT_TAG)->read();
11961196
11971197   return ret;
11981198}
r15082r15083
12031203   UINT32 ret;
12041204
12051205   if (m_desertgun_controller_select)
1206      ret = input_port_read(machine(), DESERTGU_DIP_SW_0_1_SET_2_TAG);
1206      ret = ioport(DESERTGU_DIP_SW_0_1_SET_2_TAG)->read();
12071207   else
1208      ret = input_port_read(machine(), DESERTGU_DIP_SW_0_1_SET_1_TAG);
1208      ret = ioport(DESERTGU_DIP_SW_0_1_SET_1_TAG)->read();
12091209
12101210   return ret;
12111211}
r15082r15083
12341234
12351235   PORT_START("IN1")
12361236   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,desertgu_dip_sw_0_1_r, NULL)
1237   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN1", 0x30, PORTCOND_NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:5,6")
1237   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN1", 0x30, NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:5,6")
12381238   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
12391239   PORT_DIPSETTING(    0x04, DEF_STR( German ) )
12401240   PORT_DIPSETTING(    0x08, DEF_STR( French ) )
r15082r15083
12571257   /* D0 and D1 in the DIP SW input port can reflect two sets of switches depending on the controller
12581258       select bit.  These two ports are fakes to handle this case */
12591259   PORT_START(DESERTGU_DIP_SW_0_1_SET_1_TAG)
1260   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x30, PORTCOND_NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:1,2")
1260   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x30, NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:1,2")
12611261   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
12621262   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
12631263   PORT_DIPSETTING(    0x03, DEF_STR( 2C_3C ) )
r15082r15083
12651265   PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
12661266
12671267   PORT_START(DESERTGU_DIP_SW_0_1_SET_2_TAG)
1268   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0x30, PORTCOND_NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:3,4")
1268   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0x30, NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:3,4")
12691269   PORT_DIPSETTING(    0x00, "40 seconds + 30 extended" )
12701270   PORT_DIPSETTING(    0x01, "50 seconds + 30 extended" )
12711271   PORT_DIPSETTING(    0x02, "60 seconds + 30 extended" )
r15082r15083
13181318{
13191319   UINT32 ret;
13201320
1321   if (input_port_read(machine(), DPLAY_CAB_TYPE_PORT_TAG) == DPLAY_CAB_TYPE_UPRIGHT)
1322      ret = input_port_read(machine(), DPLAY_L_PITCH_PORT_TAG);
1321   if (ioport(DPLAY_CAB_TYPE_PORT_TAG)->read() == DPLAY_CAB_TYPE_UPRIGHT)
1322      ret = ioport(DPLAY_L_PITCH_PORT_TAG)->read();
13231323   else
1324      ret = input_port_read(machine(), DPLAY_R_PITCH_PORT_TAG);
1324      ret = ioport(DPLAY_R_PITCH_PORT_TAG)->read();
13251325
13261326   return ret;
13271327}
r15082r15083
13291329
13301330CUSTOM_INPUT_MEMBER(mw8080bw_state::dplay_pitch_right_input_r)
13311331{
1332   return input_port_read(machine(), DPLAY_L_PITCH_PORT_TAG);
1332   return ioport(DPLAY_L_PITCH_PORT_TAG)->read();
13331333}
13341334
13351335
r15082r15083
13611361   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
13621362
13631363   PORT_START("IN2")
1364   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage )) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:1,2,3")
1364   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage )) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:1,2,3")
13651365   PORT_DIPSETTING(    0x05, "2 Coins/1 Inning/1 Player, 4 Coins/1 Inning/2 Players, 8 Coins/3 Innings/2 Players" )
13661366   PORT_DIPSETTING(    0x04, "1 Coin/1 Inning/1 Player, 2 Coins/1 Inning/2 Players, 4 Coins/3 Innings/2 Players" )
13671367   PORT_DIPSETTING(    0x02, "2 Coins per Inning" )
r15082r15083
13701370   /* PORT_DIPSETTING( 0x06, "1 Coin per Inning" ) */
13711371   /* PORT_DIPSETTING( 0x07, "1 Coin per Inning" ) */
13721372   PORT_DIPSETTING(    0x01, "1 Coin/1 Inning, 2 Coins/3 Innings" )
1373   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:4")
1373   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:4")
13741374   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
13751375   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1376   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:5")
1376   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:5")
13771377   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
13781378   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1379   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:6")
1379   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:6")
13801380   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
13811381   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
13821382   PORT_SERVICE_DIPLOC( 0x40, IP_ACTIVE_LOW, "C1:7" )
r15082r15083
14251425   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
14261426
14271427   PORT_START("IN2")
1428   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage )) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:1,2,3")
1428   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage )) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:1,2,3")
14291429   PORT_DIPSETTING(    0x05, "2 Coins/1 Inning/1 Player, 4 Coins/1 Inning/2 Players, 8 Coins/3 Innings/2 Players" )
14301430   PORT_DIPSETTING(    0x04, "1 Coin/1 Inning/1 Player, 2 Coins/1 Inning/2 Players, 4 Coins/3 Innings/2 Players" )
14311431   PORT_DIPSETTING(    0x02, "2 Coins per Inning" )
r15082r15083
14341434   /* PORT_DIPSETTING( 0x06, "1 Coin per Inning" ) */
14351435   /* PORT_DIPSETTING( 0x07, "1 Coin per Inning" ) */
14361436   PORT_DIPSETTING(    0x01, "1 Coin/1 Inning, 2 Coins/3 Innings" )
1437   PORT_DIPNAME( 0x08, 0x00, "Wall Knock Out Behavior" ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:4")
1437   PORT_DIPNAME( 0x08, 0x00, "Wall Knock Out Behavior" ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:4")
14381438   PORT_DIPSETTING(    0x00, "Individually" )
14391439   PORT_DIPSETTING(    0x08, "In Pairs" )
1440   PORT_DIPNAME( 0x10, 0x00, "Double Score when Special Lit" ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:5")
1440   PORT_DIPNAME( 0x10, 0x00, "Double Score when Special Lit" ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:5")
14411441   PORT_DIPSETTING(    0x00, "Home Run Only" )
14421442   PORT_DIPSETTING(    0x10, "Any Hit" )
1443   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:6")
1443   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:6")
14441444   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
14451445   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
14461446   PORT_SERVICE_DIPLOC( 0x40, IP_ACTIVE_LOW, "C1:7" )
r15082r15083
15501550   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
15511551
15521552   PORT_START("IN2")
1553   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("D1:1,2")
1553   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("D1:1,2")
15541554   PORT_DIPSETTING(    0x01, "2 Coins per Player" )
15551555   PORT_DIPSETTING(    0x00, "2 Coins/1 or 2 Players" )
15561556   PORT_DIPSETTING(    0x03, "1 Coin per Player" )
15571557   PORT_DIPSETTING(    0x02, "1 Coin/1 or 2 Players" )
1558   PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("D1:3,4")
1558   PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("D1:3,4")
15591559   PORT_DIPSETTING(    0x00, "60 seconds + 30 extended" )
15601560   PORT_DIPSETTING(    0x08, "70 seconds + 35 extended" )
15611561   PORT_DIPSETTING(    0x04, "80 seconds + 40 extended" )
15621562   PORT_DIPSETTING(    0x0c, "90 seconds + 45 extended" )
1563   PORT_DIPNAME( 0x30, 0x10, "Extended Time At" ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("D1:5,6")
1563   PORT_DIPNAME( 0x30, 0x10, "Extended Time At" ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("D1:5,6")
15641564   PORT_DIPSETTING(    0x00, "500" )
15651565   PORT_DIPSETTING(    0x20, "700" )
15661566   PORT_DIPSETTING(    0x10, "1000" )
15671567   PORT_DIPSETTING(    0x30, "1300" )
1568   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("D1:7")
1568   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("D1:7")
15691569   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
15701570   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
15711571   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "D1:8" )
r15082r15083
16441644   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )  /* not connected */
16451645
16461646   PORT_START("IN2")
1647   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x10, PORTCOND_EQUALS, 0x10) PORT_DIPLOCATION("C1:1,2")
1647   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x10, EQUALS, 0x10) PORT_DIPLOCATION("C1:1,2")
16481648   PORT_DIPSETTING(    0x02, "2 Coins per Player" )
16491649   PORT_DIPSETTING(    0x03, "2 Coins/1 or 2 Players" )
16501650   PORT_DIPSETTING(    0x00, "1 Coin per Player" )
16511651   PORT_DIPSETTING(    0x01, "1 Coin/1 or 2 Players" )
1652   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x10, PORTCOND_EQUALS, 0x10) PORT_DIPLOCATION("C1:3,4")
1652   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x10, EQUALS, 0x10) PORT_DIPLOCATION("C1:3,4")
16531653   PORT_DIPSETTING(    0x00, "60 seconds" )
16541654   PORT_DIPSETTING(    0x04, "70 seconds" )
16551655   PORT_DIPSETTING(    0x08, "80 seconds" )
r15082r15083
17111711
17121712   if (m_clowns_controller_select)
17131713   {
1714      ret = input_port_read(machine(), CLOWNS_CONTROLLER_P2_TAG);
1714      ret = ioport(CLOWNS_CONTROLLER_P2_TAG)->read();
17151715   }
17161716   else
17171717   {
1718      ret = input_port_read(machine(), CLOWNS_CONTROLLER_P1_TAG);
1718      ret = ioport(CLOWNS_CONTROLLER_P1_TAG)->read();
17191719   }
17201720
17211721   return ret;
r15082r15083
17541754   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )  /* not connected */
17551755
17561756   PORT_START("IN2")
1757   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
1757   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
17581758   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
17591759   PORT_DIPSETTING(    0x02, DEF_STR( 2C_2C ) )
17601760   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
17611761   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
1762   PORT_DIPNAME( 0x0c, 0x00, "Bonus Game" ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
1762   PORT_DIPNAME( 0x0c, 0x00, "Bonus Game" ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
17631763   PORT_DIPSETTING(    0x00, "No Bonus" )
17641764   PORT_DIPSETTING(    0x04, "9000" )
17651765   PORT_DIPSETTING(    0x08, "11000" )
17661766   PORT_DIPSETTING(    0x0c, "13000" )
1767   PORT_DIPNAME( 0x10, 0x00, "Balloon Resets" ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:5")
1767   PORT_DIPNAME( 0x10, 0x00, "Balloon Resets" ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:5")
17681768   PORT_DIPSETTING(    0x00, "Each Row" )
17691769   PORT_DIPSETTING(    0x10, "All Rows" )
1770   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:6")
1770   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:6")
17711771   PORT_DIPSETTING(    0x00, "3000" )
17721772   PORT_DIPSETTING(    0x20, "4000" )
1773   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Lives ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:7")
1773   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Lives ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:7")
17741774   PORT_DIPSETTING(    0x00, "3" )
17751775   PORT_DIPSETTING(    0x40, "4" )
17761776   /* test mode - press coin button for input test */
r15082r15083
18031803   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
18041804
18051805   PORT_START("IN2")
1806   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
1806   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
18071807   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
18081808   PORT_DIPSETTING(    0x02, DEF_STR( 2C_2C ) )
18091809   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
18101810   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
1811   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
1811   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
18121812   PORT_DIPSETTING(    0x00, "2" )
18131813   PORT_DIPSETTING(    0x04, "3" )
18141814   PORT_DIPSETTING(    0x08, "4" )
18151815   PORT_DIPSETTING(    0x0c, "5" )
1816   PORT_DIPNAME( 0x10, 0x00, "Balloon Resets" ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:5")
1816   PORT_DIPNAME( 0x10, 0x00, "Balloon Resets" ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:5")
18171817   PORT_DIPSETTING(    0x00, "Each Row" )
18181818   PORT_DIPSETTING(    0x10, "All Rows" )
1819   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:6")
1819   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:6")
18201820   PORT_DIPSETTING(    0x00, "3000" )
18211821   PORT_DIPSETTING(    0x20, "4000" )
18221822   PORT_DIPNAME( 0x40, 0x00, "Input Test"  ) PORT_DIPLOCATION("SW:7")
r15082r15083
18951895    but ROM contents suggests it's not connected (no different languages or unmapped reads) */
18961896   PORT_START("IN2")
18971897   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("C2:1,2")
1898   PORT_DIPSETTING(    0x03, "40 seconds + 20 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x00) // 45 + 20 for 2 players
1899   PORT_DIPSETTING(    0x02, "50 seconds + 25 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x00) // 60 + 30 for 2 players
1900   PORT_DIPSETTING(    0x01, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x00) // 75 + 35 for 2 players
1901   PORT_DIPSETTING(    0x00, "70 seconds + 35 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x00) // 90 + 45 for 2 players
1902   PORT_DIPSETTING(    0x03, "40 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x00)
1903   PORT_DIPSETTING(    0x02, "50 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x00)
1904   PORT_DIPSETTING(    0x01, "60 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x00)
1905   PORT_DIPSETTING(    0x00, "70 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x00)
1898   PORT_DIPSETTING(    0x03, "40 seconds + 20 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x00) // 45 + 20 for 2 players
1899   PORT_DIPSETTING(    0x02, "50 seconds + 25 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x00) // 60 + 30 for 2 players
1900   PORT_DIPSETTING(    0x01, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x00) // 75 + 35 for 2 players
1901   PORT_DIPSETTING(    0x00, "70 seconds + 35 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x00) // 90 + 45 for 2 players
1902   PORT_DIPSETTING(    0x03, "40 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x00)
1903   PORT_DIPSETTING(    0x02, "50 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x00)
1904   PORT_DIPSETTING(    0x01, "60 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x00)
1905   PORT_DIPSETTING(    0x00, "70 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x00)
19061906   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("C2:3,4")
19071907   PORT_DIPSETTING(    0x00, "1 Coin per Player" )
19081908   PORT_DIPSETTING(    0x04, "1 Coin/1 or 2 Players" )
r15082r15083
19721972
19731973static INPUT_PORTS_START( shuffle )
19741974   PORT_START("IN0")
1975   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("B3:1,2")
1975   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("B3:1,2")
19761976   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
19771977   PORT_DIPSETTING(    0x01, DEF_STR( French ) )
19781978   PORT_DIPSETTING(    0x02, DEF_STR( German ) )
19791979   /* PORT_DIPSETTING( 0x03, DEF_STR( German ) ) */
1980   PORT_DIPNAME( 0x0c, 0x04, "Points to Win" ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("B3:3,4")
1980   PORT_DIPNAME( 0x0c, 0x04, "Points to Win" ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("B3:3,4")
19811981   PORT_DIPSETTING(    0x00, "Game 1 = 25, Game 2 = 11" )
19821982   PORT_DIPSETTING(    0x04, "Game 1 = 35, Game 2 = 15" )
19831983   PORT_DIPSETTING(    0x08, "Game 1 = 40, Game 2 = 18" )
19841984   PORT_DIPSETTING(    0x0c, "Game 1 = 50, Game 2 = 21" )
1985   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("B3:5,6")
1985   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("B3:5,6")
19861986   PORT_DIPSETTING(    0x30, "2 Coins per Player" )
19871987   PORT_DIPSETTING(    0x20, "2 Coins/1 or 2 Players" )
19881988   PORT_DIPSETTING(    0x10, "1 Coin per Player" )
19891989   PORT_DIPSETTING(    0x00, "1 Coin/1 or 2 Players" )
1990   PORT_DIPNAME( 0x40, 0x40, "Time Limit" ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("B3:7")
1990   PORT_DIPNAME( 0x40, 0x40, "Time Limit" ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("B3:7")
19911991   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
19921992   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
19931993   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "B3:8" )
r15082r15083
20732073   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
20742074
20752075   PORT_START("IN2")
2076   PORT_DIPNAME( 0x03, 0x02, "Number of Cans" ) PORT_CONDITION("IN2", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:1,2")
2076   PORT_DIPNAME( 0x03, 0x02, "Number of Cans" ) PORT_CONDITION("IN2", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:1,2")
20772077   PORT_DIPSETTING(    0x03, "10" )
20782078   PORT_DIPSETTING(    0x02, "15" )
20792079   PORT_DIPSETTING(    0x01, "20" )
20802080   PORT_DIPSETTING(    0x00, "25" )
2081   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:3,4")
2081   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:3,4")
20822082   PORT_DIPSETTING(    0x08, "2 Coins per Player" )
20832083   PORT_DIPSETTING(    0x0c, "2 Coins/1 or 2 Players" )
20842084   PORT_DIPSETTING(    0x00, "1 Coin per Player" )
20852085   PORT_DIPSETTING(    0x04, "1 Coin/1 or 2 Players" )
2086   PORT_DIPNAME( 0x10, 0x10, "Extended Time Reward" ) PORT_CONDITION("IN2", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:5")
2086   PORT_DIPNAME( 0x10, 0x10, "Extended Time Reward" ) PORT_CONDITION("IN2", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:5")
20872087   PORT_DIPSETTING(    0x10, "3 extra cans" )
20882088   PORT_DIPSETTING(    0x00, "5 extra cans" )
20892089   PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW:6" )
2090   PORT_DIPNAME( 0xc0, 0x40, "Extended Time At" ) PORT_CONDITION("IN2", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:7,8")
2090   PORT_DIPNAME( 0xc0, 0x40, "Extended Time At" ) PORT_CONDITION("IN2", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:7,8")
20912091   PORT_DIPSETTING(    0xc0, "150" )
20922092   PORT_DIPSETTING(    0x80, "175" )
20932093   PORT_DIPSETTING(    0x40, "225" )
r15082r15083
22342234   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )  /* marked as COIN #2, but the software never reads it */
22352235
22362236   PORT_START("IN2")
2237   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("F3:1,2")
2237   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x00) PORT_DIPLOCATION("F3:1,2")
22382238   PORT_DIPSETTING(    0x00, "2000 4000 8000" )
22392239   PORT_DIPSETTING(    0x01, "3000 6000 12000" )
22402240   PORT_DIPSETTING(    0x02, "4000 8000 16000" )
22412241   PORT_DIPSETTING(    0x03, "5000 10000 20000" )
2242   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x10) PORT_DIPLOCATION("F3:3,4")
2242   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x10) PORT_DIPLOCATION("F3:3,4")
22432243   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
22442244   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
22452245   PORT_DIPSETTING(    0x0c, DEF_STR( 2C_3C ) )
r15082r15083
22492249   PORT_DIPSETTING(    0x30, "Bonus Off" )
22502250   PORT_DIPSETTING(    0x20, "Cross Hatch" )
22512251   PORT_DIPSETTING(    0x10, "Test Mode" )
2252   PORT_DIPNAME( 0xc0, 0x40, "Time" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x10) PORT_DIPLOCATION("F3:7,8")
2252   PORT_DIPNAME( 0xc0, 0x40, "Time" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x10) PORT_DIPLOCATION("F3:7,8")
22532253   PORT_DIPSETTING(    0x00, "45" )
22542254   PORT_DIPSETTING(    0x40, "60" )
22552255   PORT_DIPSETTING(    0x80, "75" )
r15082r15083
23292329   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )  /* not connected */
23302330
23312331   PORT_START("IN1")
2332   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:1")
2332   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:1")
23332333   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
23342334   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2335   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:2,3")
2335   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:2,3")
23362336   PORT_DIPSETTING(    0x00, "45 seconds + 20 extended (at 20 points)" )
23372337   PORT_DIPSETTING(    0x02, "60 seconds + 25 extended (at 25 points)" )
23382338   PORT_DIPSETTING(    0x04, "75 seconds + 30 extended (at 30 points)" )
23392339   PORT_DIPSETTING(    0x06, "90 seconds + 35 extended (at 35 points)" )
2340   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:4")
2340   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:4")
23412341   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
23422342   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
2343   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:5")
2343   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:5")
23442344   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
23452345   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
23462346   PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW:6" )
2347   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:7")
2347   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:7")
23482348   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
23492349   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
2350   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:8")
2350   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:8")
23512351   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
23522352   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
23532353INPUT_PORTS_END
r15082r15083
24522452
24532453static INPUT_PORTS_START( bowler )
24542454   PORT_START("IN0")
2455   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:1,2")
2455   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:1,2")
24562456   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
24572457   PORT_DIPSETTING(    0x01, DEF_STR( French ) )
24582458   PORT_DIPSETTING(    0x02, DEF_STR( German ) )
24592459   /*PORT_DIPSETTING(  0x03, DEF_STR( German ) ) */
2460   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:3")
2460   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:3")
24612461   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
24622462   PORT_DIPSETTING(    0x04, DEF_STR( On ) )  /* every 17 minutes */
2463   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Game_Time ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:4")
2463   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Game_Time ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:4")
24642464   PORT_DIPSETTING(    0x00, "No Limit" )
24652465   PORT_DIPSETTING(    0x08, "5 Minutes" )
2466   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:5")
2466   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:5")
24672467   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
24682468   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2469   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:6")
2469   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:6")
24702470   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
24712471   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
2472   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:7")
2472   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:7")
24732473   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
24742474   PORT_DIPSETTING(    0x40, "Cocktail (not functional)" )
24752475   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "B3:8" )
r15082r15083
25342534
25352535CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_coin_input_r)
25362536{
2537   UINT32 ret = input_port_read(machine(), INVADERS_COIN_INPUT_PORT_TAG);
2537   UINT32 ret = ioport(INVADERS_COIN_INPUT_PORT_TAG)->read();
25382538
25392539   coin_counter_w(machine(), 0, !ret);
25402540
r15082r15083
25522552   if (invaders_is_cabinet_cocktail(machine()))
25532553      ret = 0x03;
25542554   else
2555      ret = input_port_read(machine(), INVADERS_SW6_SW7_PORT_TAG);
2555      ret = ioport(INVADERS_SW6_SW7_PORT_TAG)->read();
25562556
25572557   return ret;
25582558}
r15082r15083
25682568   if (invaders_is_cabinet_cocktail(machine()))
25692569      ret = 0x01;
25702570   else
2571      ret = input_port_read(machine(), INVADERS_SW5_PORT_TAG);
2571      ret = ioport(INVADERS_SW5_PORT_TAG)->read();
25722572
25732573   return ret;
25742574}
r15082r15083
25842584   if (invaders_is_cabinet_cocktail(machine()))
25852585      ret = 0x07;
25862586   else
2587      ret = input_port_read(machine(), INVADERS_P1_CONTROL_PORT_TAG);
2587      ret = ioport(INVADERS_P1_CONTROL_PORT_TAG)->read();
25882588
25892589   return ret;
25902590}
r15082r15083
25922592
25932593CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_in1_control_r)
25942594{
2595   return input_port_read(machine(), INVADERS_P1_CONTROL_PORT_TAG);
2595   return ioport(INVADERS_P1_CONTROL_PORT_TAG)->read();
25962596}
25972597
25982598
r15082r15083
26042604       cocktail PCB: P2 controls */
26052605
26062606   if (invaders_is_cabinet_cocktail(machine()))
2607      ret = input_port_read(machine(), INVADERS_P2_CONTROL_PORT_TAG);
2607      ret = ioport(INVADERS_P2_CONTROL_PORT_TAG)->read();
26082608   else
2609      ret = input_port_read(machine(), INVADERS_P1_CONTROL_PORT_TAG);
2609      ret = ioport(INVADERS_P1_CONTROL_PORT_TAG)->read();
26102610
26112611   return ret;
26122612}
r15082r15083
26142614
26152615int invaders_is_cabinet_cocktail(running_machine &machine)
26162616{
2617   return input_port_read(machine, INVADERS_CAB_TYPE_PORT_TAG);
2617   return machine.root_device().ioport(INVADERS_CAB_TYPE_PORT_TAG)->read();
26182618}
26192619
26202620
r15082r15083
27412741
27422742CUSTOM_INPUT_MEMBER(mw8080bw_state::blueshrk_coin_input_r)
27432743{
2744   UINT32 ret = input_port_read(machine(), BLUESHRK_COIN_INPUT_PORT_TAG);
2744   UINT32 ret = ioport(BLUESHRK_COIN_INPUT_PORT_TAG)->read();
27452745
27462746   coin_counter_w(machine(), 0, !ret);
27472747
r15082r15083
27702770   PORT_START("IN1")
27712771   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
27722772   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,blueshrk_coin_input_r, NULL)
2773   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW:3")
2773   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW:3")
27742774   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
27752775   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
27762776   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )  /* not shown on the schematics, instead DIP SW4 is connected here */
2777   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW:5")
2777   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW:5")
27782778   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
27792779   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2780   PORT_DIPNAME( 0x60, 0x40, "Replay" ) PORT_CONDITION("IN1", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW:6,7")
2780   PORT_DIPNAME( 0x60, 0x40, "Replay" ) PORT_CONDITION("IN1", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW:6,7")
27812781   PORT_DIPSETTING(    0x20, "14000" )
27822782   PORT_DIPSETTING(    0x40, "18000" )
27832783   PORT_DIPSETTING(    0x60, "22000" )
r15082r15083
28202820#ifdef UNUSED_FUNCTION
28212821static UINT32 invad2ct_coin_input_r(void *param)
28222822{
2823   UINT32 ret = input_port_read(machine, INVAD2CT_COIN_INPUT_PORT_TAG);
2823   UINT32 ret = machine.root_device().ioport(INVAD2CT_COIN_INPUT_PORT_TAG)->read();
28242824
28252825   coin_counter_w(machine, 0, !ret);
28262826
src/mame/drivers/pinkiri8.c
r15082r15083
450450{
451451   switch(m_mux_data)
452452   {
453      case 0x01: return input_port_read(machine(), "PL2_01");
454      case 0x02: return input_port_read(machine(), "PL2_02");
455      case 0x04: return input_port_read(machine(), "PL2_03");
456      case 0x08: return input_port_read(machine(), "PL2_04");
457      case 0x10: return input_port_read(machine(), "PL2_05");
453      case 0x01: return ioport("PL2_01")->read();
454      case 0x02: return ioport("PL2_02")->read();
455      case 0x04: return ioport("PL2_03")->read();
456      case 0x08: return ioport("PL2_04")->read();
457      case 0x10: return ioport("PL2_05")->read();
458458   }
459459
460460   return 0xff;
r15082r15083
464464{
465465   switch(m_mux_data)
466466   {
467      case 0x01: return input_port_read(machine(), "PL1_01");
468      case 0x02: return input_port_read(machine(), "PL1_02");
469      case 0x04: return input_port_read(machine(), "PL1_03");
470      case 0x08: return input_port_read(machine(), "PL1_04");
471      case 0x10: return input_port_read(machine(), "PL1_05");
467      case 0x01: return ioport("PL1_01")->read();
468      case 0x02: return ioport("PL1_02")->read();
469      case 0x04: return ioport("PL1_03")->read();
470      case 0x08: return ioport("PL1_04")->read();
471      case 0x10: return ioport("PL1_05")->read();
472472   }
473473
474474   return 0xff;
src/mame/drivers/vaportra.c
r15082r15083
3434   switch (offset << 1)
3535   {
3636      case 4:
37         return input_port_read(machine(), "DSW");
37         return ioport("DSW")->read();
3838      case 2:
39         return input_port_read(machine(), "COINS");
39         return ioport("COINS")->read();
4040      case 0:
41         return input_port_read(machine(), "PLAYERS");
41         return ioport("PLAYERS")->read();
4242   }
4343
4444   logerror("Unknown control read at %d\n",offset);
r15082r15083
112112   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
113113   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
114114   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
115   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
115   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
116116   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
117117   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
118118   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/namcos86.c
r15082r15083
214214{
215215   int rhi, rlo;
216216
217   rhi  = ( input_port_read(machine(), "DSWA") & 0x01 ) << 4;
218   rhi |= ( input_port_read(machine(), "DSWA") & 0x04 ) << 3;
219   rhi |= ( input_port_read(machine(), "DSWA") & 0x10 ) << 2;
220   rhi |= ( input_port_read(machine(), "DSWA") & 0x40 ) << 1;
217   rhi  = ( ioport("DSWA")->read() & 0x01 ) << 4;
218   rhi |= ( ioport("DSWA")->read() & 0x04 ) << 3;
219   rhi |= ( ioport("DSWA")->read() & 0x10 ) << 2;
220   rhi |= ( ioport("DSWA")->read() & 0x40 ) << 1;
221221
222   rlo  = ( input_port_read(machine(), "DSWB") & 0x01 );
223   rlo |= ( input_port_read(machine(), "DSWB") & 0x04 ) >> 1;
224   rlo |= ( input_port_read(machine(), "DSWB") & 0x10 ) >> 2;
225   rlo |= ( input_port_read(machine(), "DSWB") & 0x40 ) >> 3;
222   rlo  = ( ioport("DSWB")->read() & 0x01 );
223   rlo |= ( ioport("DSWB")->read() & 0x04 ) >> 1;
224   rlo |= ( ioport("DSWB")->read() & 0x10 ) >> 2;
225   rlo |= ( ioport("DSWB")->read() & 0x40 ) >> 3;
226226
227227   return rhi | rlo;
228228}
r15082r15083
231231{
232232   int rhi, rlo;
233233
234   rhi  = ( input_port_read(machine(), "DSWA") & 0x02 ) << 3;
235   rhi |= ( input_port_read(machine(), "DSWA") & 0x08 ) << 2;
236   rhi |= ( input_port_read(machine(), "DSWA") & 0x20 ) << 1;
237   rhi |= ( input_port_read(machine(), "DSWA") & 0x80 );
234   rhi  = ( ioport("DSWA")->read() & 0x02 ) << 3;
235   rhi |= ( ioport("DSWA")->read() & 0x08 ) << 2;
236   rhi |= ( ioport("DSWA")->read() & 0x20 ) << 1;
237   rhi |= ( ioport("DSWA")->read() & 0x80 );
238238
239   rlo  = ( input_port_read(machine(), "DSWB") & 0x02 ) >> 1;
240   rlo |= ( input_port_read(machine(), "DSWB") & 0x08 ) >> 2;
241   rlo |= ( input_port_read(machine(), "DSWB") & 0x20 ) >> 3;
242   rlo |= ( input_port_read(machine(), "DSWB") & 0x80 ) >> 4;
239   rlo  = ( ioport("DSWB")->read() & 0x02 ) >> 1;
240   rlo |= ( ioport("DSWB")->read() & 0x08 ) >> 2;
241   rlo |= ( ioport("DSWB")->read() & 0x20 ) >> 3;
242   rlo |= ( ioport("DSWB")->read() & 0x80 ) >> 4;
243243
244244   return rhi | rlo;
245245}
src/mame/drivers/suna8.c
r15082r15083
470470
471471   switch (*m_hardhead_ip)
472472   {
473      case 0:   return input_port_read(machine(), "P1");
474      case 1:   return input_port_read(machine(), "P2");
475      case 2:   return input_port_read(machine(), "DSW1");
476      case 3:   return input_port_read(machine(), "DSW2");
473      case 0:   return ioport("P1")->read();
474      case 1:   return ioport("P2")->read();
475      case 2:   return ioport("DSW1")->read();
476      case 3:   return ioport("DSW2")->read();
477477      default:
478478         logerror("CPU #0 - PC %04X: Unknown IP read: %02X\n", cpu_get_pc(&space.device()), *m_hardhead_ip);
479479         return 0xff;
r15082r15083
13291329   PORT_BIT(  0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
13301330   PORT_BIT(  0x10, IP_ACTIVE_LOW,  IPT_UNKNOWN )
13311331   PORT_BIT(  0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1332   PORT_BIT(  0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
1332   PORT_BIT(  0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
13331333   PORT_BIT(  0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
13341334
13351335INPUT_PORTS_END
src/mame/drivers/chanbara.c
r15082r15083
265265   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
266266   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
267267   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* same coinage as COIN1 */
268   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
268   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
269269
270270   PORT_START ("P1")
271271   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN )
src/mame/drivers/btime.c
r15082r15083
223223   /* however if the previous instruction was JSR (which caused a write to */
224224   /* the stack), fetch the address of the next instruction. */
225225   addr1 = cpu_get_previouspc(&space->device());
226   src1 = (addr1 < 0x9000) ? state->m_rambase : space->machine().root_device().memregion("maincpu")->base();
226   src1 = (addr1 < 0x9000) ? state->m_rambase : state->memregion("maincpu")->base();
227227   if (decrypted[addr1] == 0x20)   /* JSR $xxxx */
228228      addr = src1[addr1 + 1] + 256 * src1[addr1 + 2];
229229
r15082r15083
550550
551551READ8_MEMBER(btime_state::zoar_dsw1_read)
552552{
553   return (!machine().primary_screen->vblank() << 7) | (input_port_read(machine(), "DSW1") & 0x7f);
553   return (!machine().primary_screen->vblank() << 7) | (ioport("DSW1")->read() & 0x7f);
554554}
555555
556556static INPUT_PORTS_START( btime )
r15082r15083
611611//  PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("15D:8")
612612//  PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
613613//  PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
614   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
614   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM  ) PORT_VBLANK("screen")
615615
616616   PORT_START("DSW2")
617617   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("14D:1")
r15082r15083
684684   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
685685   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
686686   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
687   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
687   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM  ) PORT_VBLANK("screen")
688688
689689   PORT_START("DSW2")
690690   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
r15082r15083
833833//  PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8")
834834//  PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
835835//  PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
836   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
836   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM  ) PORT_VBLANK("screen")
837837
838838   PORT_START("DSW2")
839839   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1")
r15082r15083
896896   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
897897   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
898898   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
899   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
899   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM  ) PORT_VBLANK("screen")
900900
901901   PORT_START("DSW2")
902902   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
r15082r15083
972972//  PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
973973//  PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
974974//  PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
975   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
975   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM  ) PORT_VBLANK("screen")
976976
977977   PORT_START("DSW2")
978978   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
r15082r15083
10501050//  PORT_DIPNAME( 0x80, 0x00, "Control Panel" ) PORT_DIPLOCATION("8D:8")
10511051//  PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
10521052//  PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
1053   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
1053   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM  ) PORT_VBLANK("screen")
10541054
10551055   PORT_START("DSW2")
10561056   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("7D:1")
r15082r15083
11411141
11421142   PORT_START("VBLANK")
11431143   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
1144   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1144   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
11451145INPUT_PORTS_END
11461146
11471147static INPUT_PORTS_START( sdtennis )
r15082r15083
11931193   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
11941194   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
11951195   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
1196   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
1196   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM  ) PORT_VBLANK("screen")
11971197
11981198   PORT_START("DSW2")
11991199   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
src/mame/drivers/m14.c
r15082r15083
162162READ8_MEMBER(m14_state::m14_rng_r)
163163{
164164   /* graphic artifacts happens if this doesn't return random values. */
165   return (machine().rand() & 0x0f) | 0xf0; /* | (input_port_read(machine(), "IN1") & 0x80)*/;
165   return (machine().rand() & 0x0f) | 0xf0; /* | (ioport("IN1")->read() & 0x80)*/;
166166}
167167
168168/* Here routes the hopper & the inputs */
r15082r15083
175175      return 0; //0x43 status bits
176176   }
177177   else
178      return input_port_read(machine(), "IN0");
178      return ioport("IN0")->read();
179179}
180180
181181#if 0
src/mame/drivers/nova2001.c
r15082r15083
315315   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
316316   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
317317   PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNUSED )
318   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
318   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
319319
320320   PORT_START("DSW1")
321321   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1")
r15082r15083
381381   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
382382
383383   PORT_START("IN2")   /* 0xa002 */
384   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
384   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
385385   PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nova2001_state,ninjakun_io_A002_ctrl_r, NULL)
386386
387387   PORT_START("DSW1") // printed "SW 2"
r15082r15083
442442   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
443443   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
444444   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
445   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
445   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
446446
447447   PORT_START("IN1")
448448   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
r15082r15083
491491
492492static INPUT_PORTS_START( raiders5 )
493493   PORT_START("IN0")
494   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
494   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
495495   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
496496   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
497497   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
src/mame/drivers/jantotsu.c
r15082r15083
238238   UINT8 i,res;
239239
240240   //  printf("%02x\n", m_mux_data);
241   res = input_port_read(machine(), "COINS");
241   res = ioport("COINS")->read();
242242
243243   for(i=0;i<8;i++)
244244   {
245245      if((~m_mux_data) & (1 << i))
246         res |= input_port_read(machine(), portnames[i]);
246         res |= ioport(portnames[i])->read();
247247   }
248248
249249   return res;
r15082r15083
260260  a side-by-side test (to know if the background colors really works) to be sure. */
261261READ8_MEMBER(jantotsu_state::jantotsu_dsw2_r)
262262{
263   return (input_port_read(machine(), "DSW2") & 0x3f) | 0x80;
263   return (ioport("DSW2")->read() & 0x3f) | 0x80;
264264}
265265
266266static WRITE8_DEVICE_HANDLER( jan_adpcm_w )
r15082r15083
490490   jantotsu_state *state = machine.driver_data<jantotsu_state>();
491491
492492   /*Load hard-wired background color.*/
493   state->m_col_bank = (input_port_read(machine, "DSW2") & 0xc0) >> 3;
493   state->m_col_bank = (state->ioport("DSW2")->read() & 0xc0) >> 3;
494494
495495   state->m_vram_bank = 0;
496496   state->m_mux_data = 0;
src/mame/drivers/gaelco3d.c
r15082r15083
449449   {
450450      if (!(data & 0xff))
451451      {
452         m_analog_ports[0] = input_port_read_safe(machine(), "ANALOG0", 0);
453         m_analog_ports[1] = input_port_read_safe(machine(), "ANALOG1", 0);
454         m_analog_ports[2] = input_port_read_safe(machine(), "ANALOG2", 0);
455         m_analog_ports[3] = input_port_read_safe(machine(), "ANALOG3", 0);
452         m_analog_ports[0] = ioport("ANALOG0")->read_safe(0);
453         m_analog_ports[1] = ioport("ANALOG1")->read_safe(0);
454         m_analog_ports[2] = ioport("ANALOG2")->read_safe(0);
455         m_analog_ports[3] = ioport("ANALOG3")->read_safe(0);
456456      }
457457   }
458458   else
src/mame/drivers/avalnche.c
r15082r15083
181181   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )      /* SLAM */
182182   PORT_SERVICE( 0x20, IP_ACTIVE_HIGH)
183183   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )      /* Serve */
184   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )         /* VBLANK */
184   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")         /* VBLANK */
185185
186186   PORT_START("PADDLE")
187187   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x40, 0xb7) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_CENTERDELTA(0)
src/mame/drivers/snk.c
r15082r15083
741741{
742742   static const char *const ports[] = { "P1ROT", "P2ROT" };
743743   int which = (int)(FPTR)param;
744   int value = input_port_read(machine(), ports[which]);
744   int value = ioport(ports[which])->read();
745745
746746   if ((m_last_value[which] == 0x5 && value == 0x6) || (m_last_value[which] == 0x6 && value == 0x5))
747747   {
r15082r15083
756756
757757CUSTOM_INPUT_MEMBER(snk_state::gwarb_rotary)
758758{
759   if (input_port_read(machine(), "JOYSTICK_MODE") == 1)
759   if (ioport("JOYSTICK_MODE")->read() == 1)
760760   {
761761      return gwar_rotary(field, param);
762762   }
r15082r15083
805805CUSTOM_INPUT_MEMBER(snk_state::countryc_trackball_x)
806806{
807807
808   return input_port_read(machine(), m_countryc_trackball ? "TRACKBALLX2" : "TRACKBALLX1");
808   return ioport(m_countryc_trackball ? "TRACKBALLX2" : "TRACKBALLX1")->read();
809809}
810810
811811CUSTOM_INPUT_MEMBER(snk_state::countryc_trackball_y)
812812{
813813
814   return input_port_read(machine(), m_countryc_trackball ? "TRACKBALLY2" : "TRACKBALLY1");
814   return ioport(m_countryc_trackball ? "TRACKBALLY2" : "TRACKBALLY1")->read();
815815}
816816
817817
r15082r15083
824824   switch (bit_mask)
825825   {
826826      case 0x01:  /* older games : "Occurrence" Dip Switch (DSW2:1) */
827         return ((input_port_read(machine(), "BONUS") & bit_mask) >> 0);
827         return ((ioport("BONUS")->read() & bit_mask) >> 0);
828828      case 0xc0:  /* older games : "Bonus Life" Dip Switches (DSW1:7,8) */
829         return ((input_port_read(machine(), "BONUS") & bit_mask) >> 6);
829         return ((ioport("BONUS")->read() & bit_mask) >> 6);
830830
831831      case 0x04:  /* later games : "Occurrence" Dip Switch (DSW1:3) */
832         return ((input_port_read(machine(), "BONUS") & bit_mask) >> 2);
832         return ((ioport("BONUS")->read() & bit_mask) >> 2);
833833      case 0x30:  /* later games : "Bonus Life" Dip Switches (DSW2:5,6) */
834         return ((input_port_read(machine(), "BONUS") & bit_mask) >> 4);
834         return ((ioport("BONUS")->read() & bit_mask) >> 4);
835835
836836      default:
837837         logerror("snk_bonus_r : invalid %02X bit_mask\n",bit_mask);
r15082r15083
23882388   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) )          PORT_DIPLOCATION("DSW1:3")
23892389   PORT_DIPSETTING(    0x04, DEF_STR( Upright ) )          /* Dual Controls */
23902390   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
2391   PORT_DIPNAME( 0x08, 0x00, "Gameplay" )        PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01) PORT_DIPLOCATION("DSW1:4")    /* code at 0x011e */
2392   PORT_DIPSETTING(    0x00, "Basic Player" )    PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
2393   PORT_DIPSETTING(    0x08, "Avid Golfer" )     PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
2394   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("DSW1:4")
2395   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )    PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
2396   PORT_DIPSETTING(    0x00, DEF_STR( On ) )     PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
2391   PORT_DIPNAME( 0x08, 0x00, "Gameplay" )        PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_DIPLOCATION("DSW1:4")    /* code at 0x011e */
2392   PORT_DIPSETTING(    0x00, "Basic Player" )    PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
2393   PORT_DIPSETTING(    0x08, "Avid Golfer" )     PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
2394   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_DIPLOCATION("DSW1:4")
2395   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )    PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
2396   PORT_DIPSETTING(    0x00, DEF_STR( On ) )     PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
23972397   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )           PORT_DIPLOCATION("DSW1:5,6")
23982398   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
23992399   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
src/mame/drivers/highvdeo.c
r15082r15083
194194
195195READ16_MEMBER(highvdeo_state::read1_r)
196196{
197   return input_port_read(machine(), "IN0");
197   return ioport("IN0")->read();
198198}
199199
200200READ16_MEMBER(highvdeo_state::read2_r)
201201{
202   return input_port_read(machine(), "IN1");
202   return ioport("IN1")->read();
203203}
204204
205205READ16_MEMBER(highvdeo_state::read3_r)
206206{
207   return input_port_read(machine(), "IN2");
207   return ioport("IN2")->read();
208208}
209209
210210WRITE16_MEMBER(highvdeo_state::tv_vcf_paletteram_w)
r15082r15083
322322   // machine resets itself.
323323   resetpulse ^= 0x40;
324324
325   return (input_port_read(machine(), "IN1") & 0xbf) | resetpulse;
325   return (ioport("IN1")->read() & 0xbf) | resetpulse;
326326}
327327
328328static WRITE16_DEVICE_HANDLER( tv_ncf_oki6376_w )
src/mame/drivers/namconb1.c
r15082r15083
813813
814814   switch( offset )
815815   {
816   case 0: case 1: result = (UINT8)(0x0f + input_port_read(machine(), "LIGHT1_Y") * 224/255); break; /* Y (p2) */
817   case 2: case 3: result = (UINT8)(0x26 + input_port_read(machine(), "LIGHT1_X") * 288/314); break; /* X (p2) */
818   case 4: case 5: result = (UINT8)(0x0f + input_port_read(machine(), "LIGHT0_Y") * 224/255); break; /* Y (p1) */
819   case 6: case 7: result = (UINT8)(0x26 + input_port_read(machine(), "LIGHT0_X") * 288/314); break; /* X (p1) */
816   case 0: case 1: result = (UINT8)(0x0f + ioport("LIGHT1_Y")->read() * 224/255); break; /* Y (p2) */
817   case 2: case 3: result = (UINT8)(0x26 + ioport("LIGHT1_X")->read() * 288/314); break; /* X (p2) */
818   case 4: case 5: result = (UINT8)(0x0f + ioport("LIGHT0_Y")->read() * 224/255); break; /* Y (p1) */
819   case 6: case 7: result = (UINT8)(0x26 + ioport("LIGHT0_X")->read() * 288/314); break; /* X (p1) */
820820   }
821821   return result<<24;
822822} /* gunbulet_gun_r */
r15082r15083
932932   switch (m_nbx_port6 & 0xf0)
933933   {
934934      case 0x00:
935         return input_port_read_safe(machine(), "P4", 0xff);
935         return ioport("P4")->read_safe(0xff);
936936
937937      case 0x20:
938         return input_port_read(machine(), "MISC");
938         return ioport("MISC")->read();
939939
940940      case 0x40:
941         return input_port_read(machine(), "P1");
941         return ioport("P1")->read();
942942
943943      case 0x60:
944         return input_port_read(machine(), "P2");
944         return ioport("P2")->read();
945945
946946      default:
947947         break;
r15082r15083
955955// register full scale, so it works...
956956READ8_MEMBER(namconb1_state::dac7_r)// bit 7
957957{
958   return input_port_read_safe(machine(), "P3", 0xff)&0x80;
958   return ioport("P3")->read_safe(0xff)&0x80;
959959}
960960
961961READ8_MEMBER(namconb1_state::dac6_r)// bit 3
962962{
963   return (input_port_read_safe(machine(), "P3", 0xff)<<1)&0x80;
963   return (ioport("P3")->read_safe(0xff)<<1)&0x80;
964964}
965965
966966READ8_MEMBER(namconb1_state::dac5_r)// bit 2
967967{
968   return (input_port_read_safe(machine(), "P3", 0xff)<<2)&0x80;
968   return (ioport("P3")->read_safe(0xff)<<2)&0x80;
969969}
970970
971971READ8_MEMBER(namconb1_state::dac4_r)// bit 1
972972{
973   return (input_port_read_safe(machine(), "P3", 0xff)<<3)&0x80;
973   return (ioport("P3")->read_safe(0xff)<<3)&0x80;
974974}
975975
976976READ8_MEMBER(namconb1_state::dac3_r)// bit 0
977977{
978   return (input_port_read_safe(machine(), "P3", 0xff)<<4)&0x80;
978   return (ioport("P3")->read_safe(0xff)<<4)&0x80;
979979}
980980
981981READ8_MEMBER(namconb1_state::dac2_r)// bit 4
982982{
983   return (input_port_read_safe(machine(), "P3", 0xff)<<5)&0x80;
983   return (ioport("P3")->read_safe(0xff)<<5)&0x80;
984984}
985985
986986READ8_MEMBER(namconb1_state::dac1_r)// bit 5
987987{
988   return (input_port_read_safe(machine(), "P3", 0xff)<<6)&0x80;
988   return (ioport("P3")->read_safe(0xff)<<6)&0x80;
989989}
990990
991991READ8_MEMBER(namconb1_state::dac0_r)// bit 6
992992{
993   return (input_port_read_safe(machine(), "P3", 0xff)<<7)&0x80;
993   return (ioport("P3")->read_safe(0xff)<<7)&0x80;
994994}
995995
996996static ADDRESS_MAP_START( namcoc75_io, AS_IO, 8, namconb1_state )
src/mame/drivers/f-32.c
r15082r15083
6969   if ((pc == 0x000379de) || (pc == 0x000379cc) )
7070      m_maincpu->eat_cycles(100);
7171   //else printf("PC %08x\n", pc );
72   return input_port_read(machine(), "SYSTEM_P2");
72   return ioport("SYSTEM_P2")->read();
7373}
7474
7575
r15082r15083
107107   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_COIN2 )
108108   PORT_SERVICE_NO_TOGGLE( 0x00000400, IP_ACTIVE_LOW )
109109   PORT_BIT( 0x00007800, IP_ACTIVE_LOW, IPT_UNUSED )
110   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_VBLANK )
110   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
111111   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
112112   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
113113   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
src/mame/drivers/cosmic.c
r15082r15083
315315READ8_MEMBER(cosmic_state::cosmicg_port_0_r)
316316{
317317   /* The top four address lines from the CRTC are bits 0-3 */
318   return (input_port_read(machine(), "IN0") & 0xf0) | ((machine().primary_screen->vpos() & 0xf0) >> 4);
318   return (ioport("IN0")->read() & 0xf0) | ((machine().primary_screen->vpos() & 0xf0) >> 4);
319319}
320320
321321READ8_MEMBER(cosmic_state::magspot_coinage_dip_r)
322322{
323   return (input_port_read_safe(machine(), "DSW", 0) & (1 << (7 - offset))) ? 0 : 1;
323   return (ioport("DSW")->read_safe(0) & (1 << (7 - offset))) ? 0 : 1;
324324}
325325
326326
r15082r15083
328328
329329READ8_MEMBER(cosmic_state::nomnlnd_port_0_1_r)
330330{
331   int control = input_port_read(machine(), offset ? "IN1" : "IN0");
332   int fire = input_port_read(machine(), "IN3");
331   int control = ioport(offset ? "IN1" : "IN0")->read();
332   int fire = ioport("IN3")->read();
333333
334334   /* If firing - stop tank */
335335   if ((fire & 0xc0) == 0) return 0xff;
r15082r15083
630630   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
631631
632632   PORT_START("IN3")
633   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
633   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
634634   PORT_BIT( 0x1e, IP_ACTIVE_LOW, IPT_UNUSED )      /* always HI */
635635   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL )   /* reads what was written to 4808.  Probably not used?? */
636636   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
r15082r15083
715715   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
716716
717717   PORT_START("IN3")
718   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK )
718   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
719719   PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNUSED )
720720   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
721721   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
r15082r15083
811811   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
812812
813813   PORT_START("IN3")
814   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
814   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
815815   PORT_BIT( 0x1e, IP_ACTIVE_LOW, IPT_UNUSED )      /* always HI */
816816   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL )   /* reads what was written to 4808.  Probably not used?? */
817817   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
r15082r15083
15121512   cosmic_state *state = machine.driver_data<cosmic_state>();
15131513   offs_t offs, len;
15141514   UINT8 *rom;
1515   len = machine.root_device().memregion("maincpu")->bytes();
1515   len = state->memregion("maincpu")->bytes();
15161516   rom = state->memregion("maincpu")->base();
15171517   for (offs = 0; offs < len; offs++)
15181518   {
src/mame/drivers/model2.c
r15082r15083
356356static MACHINE_RESET(model2_scsp)
357357{
358358   model2_state *state = machine.driver_data<model2_state>();
359   state->membank("bank4")->set_base(machine.root_device().memregion("scsp")->base() + 0x200000);
360   state->membank("bank5")->set_base(machine.root_device().memregion("scsp")->base() + 0x600000);
359   state->membank("bank4")->set_base(state->memregion("scsp")->base() + 0x200000);
360   state->membank("bank5")->set_base(state->memregion("scsp")->base() + 0x600000);
361361
362362   // copy the 68k vector table into RAM
363363   memcpy(state->m_soundram, state->memregion("audiocpu")->base() + 0x80000, 16);
r15082r15083
454454
455455CUSTOM_INPUT_MEMBER(model2_state::_1c00000_r)
456456{
457   UINT32 ret = input_port_read(machine(), "IN0");
457   UINT32 ret = ioport("IN0")->read();
458458
459459   if(m_ctrlmode == 0)
460460   {
r15082r15083
473473   if(m_analog_channel < 4)
474474   {
475475      static const char *const ports[] = { "ANA0", "ANA1", "ANA2", "ANA3" };
476      iptval = input_port_read_safe(machine(), ports[m_analog_channel], 0);
476      iptval = ioport(ports[m_analog_channel])->read_safe(0);
477477      ++m_analog_channel;
478478   }
479479   return iptval;
src/mame/drivers/ataxx.c
r15082r15083
115115
116116   PORT_START("IN1")      /* 0xF7 */
117117   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
118   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
118   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
119119   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
120120
121121   PORT_START("IN2")      /* 0x20 */
r15082r15083
146146
147147   PORT_START("IN1")      /* 0xF7 */
148148   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
149   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
149   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
150150   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
151151
152152   PORT_START("IN2")      /* 0x20 */
r15082r15083
198198
199199   PORT_START("IN1")      /* 0xF7 */
200200   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
201   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
201   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
202202   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
203203
204204   PORT_START("IN2")      /* 0x20 */
r15082r15083
244244
245245   PORT_START("IN1")      /* 0xF7 */
246246   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
247   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
247   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
248248   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
249249
250250   PORT_START("IN2")      /* 0x20 */
src/mame/drivers/majorpkr.c
r15082r15083
655655
656656   switch( (m_mux_data & 0xf0) )      /* 00-10-20-30-0F-1F-2F-3F */
657657   {
658      case 0x00: return input_port_read(machine(), "DSW1");   /* confirmed */
659      case 0x10: return input_port_read(machine(), "DSW2");   /* confirmed */
660      case 0x20: return input_port_read(machine(), "DSW3");   /* confirmed */
661      case 0x30: return input_port_read(machine(), "DSW4");   /* confirmed */
658      case 0x00: return ioport("DSW1")->read();   /* confirmed */
659      case 0x10: return ioport("DSW2")->read();   /* confirmed */
660      case 0x20: return ioport("DSW3")->read();   /* confirmed */
661      case 0x30: return ioport("DSW4")->read();   /* confirmed */
662662   }
663663
664664   return 0xff;
r15082r15083
669669
670670   if ((m_mux_data & 0x0f) == 4)
671671   {
672      return input_port_read(machine(), "IN0-1");
672      return ioport("IN0-1")->read();
673673   }
674674   else
675675   {
676      return input_port_read(machine(), "IN0-0");
676      return ioport("IN0-0")->read();
677677   }
678678}
679679
src/mame/drivers/sshangha.c
r15082r15083
7373   switch (offset)
7474   {
7575      case 0x050 >> 1:
76         return input_port_read(machine(), "INPUTS");
76         return ioport("INPUTS")->read();
7777      case 0x76a >> 1:
78         return input_port_read(machine(), "SYSTEM");
78         return ioport("SYSTEM")->read();
7979      case 0x0ac >> 1:
80         return input_port_read(machine(), "DSW");
80         return ioport("DSW")->read();
8181
8282      // Protection TODO
8383   }
r15082r15083
9191   switch (offset)
9292   {
9393      case 0x050 >> 1:
94         return input_port_read(machine(), "INPUTS");
94         return ioport("INPUTS")->read();
9595      case 0x76a >> 1:
96         return input_port_read(machine(), "SYSTEM");
96         return ioport("SYSTEM")->read();
9797      case 0x0ac >> 1:
98         return input_port_read(machine(), "DSW");
98         return ioport("DSW")->read();
9999   }
100100
101101   return m_prot_data[offset];
r15082r15083
259259   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
260260   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
261261   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
262   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
262   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
263263   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
264264   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
265265   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
278278   PORT_DIPSETTING(      0x0010, "Mode 1" )
279279   PORT_DIPSETTING(      0x0000, "Mode 2" )
280280   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5,6")
281   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
282   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
283   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
284   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
285   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
286   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
287   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
288   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
281   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
282   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
283   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
284   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
285   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
286   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
287   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
288   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
289289   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:7,8")
290   PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
291   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
292   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
293   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
294   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
295   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
296   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
297   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
290   PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
291   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
292   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
293   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
294   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
295   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
296   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
297   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
298298   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:1,2")
299299   PORT_DIPSETTING(      0x4000, DEF_STR( Easy ) )
300300   PORT_DIPSETTING(      0xc000, DEF_STR( Normal ) )
src/mame/drivers/wiping.c
r15082r15083
4747
4848   res = 0;
4949   for (i = 0; i < 8; i++)
50      res |= ((input_port_read(machine(), portnames[i]) >> offset) & 1) << i;
50      res |= ((ioport(portnames[i])->read() >> offset) & 1) << i;
5151
5252   return res;
5353}
src/mame/drivers/popeye.c
r15082r15083
407407   int res;
408408
409409
410   res = input_port_read(device->machine(), "DSW0");
411   res |= (input_port_read(device->machine(), "DSW1") << (7-state->m_dswbit)) & 0x80;
410   res = state->ioport("DSW0")->read();
411   res |= (state->ioport("DSW1")->read() << (7-state->m_dswbit)) & 0x80;
412412
413413   return res;
414414}
src/mame/drivers/gstream.c
r15082r15083
185185   int result;
186186
187187   /* PORT_SERVICE_NO_TOGGLE */
188   result = (input_port_read(machine(), "IN0") & 0x8000) >> 15;
188   result = (ioport("IN0")->read() & 0x8000) >> 15;
189189
190190   return ~result;
191191}
r15082r15083
195195   int result;
196196
197197   /* IPT_COIN1 */
198   result  = ((input_port_read(machine(), "IN0") & 0x200) >>  9) << 0;
198   result  = ((ioport("IN0")->read() & 0x200) >>  9) << 0;
199199   /* IPT_COIN2 */
200   result |= ((input_port_read(machine(), "IN1") & 0x200) >>  9) << 1;
200   result |= ((ioport("IN1")->read() & 0x200) >>  9) << 1;
201201   /* IPT_START1 */
202   result |= ((input_port_read(machine(), "IN0") & 0x400) >> 10) << 2;
202   result |= ((ioport("IN0")->read() & 0x400) >> 10) << 2;
203203   /* IPT_START2 */
204   result |= ((input_port_read(machine(), "IN1") & 0x400) >> 10) << 3;
204   result |= ((ioport("IN1")->read() & 0x400) >> 10) << 3;
205205   /* PORT_SERVICE_NO_TOGGLE */
206   result |= ((input_port_read(machine(), "IN0") & 0x8000) >> 15) << 6;
206   result |= ((ioport("IN0")->read() & 0x8000) >> 15) << 6;
207207
208208   return ~result;
209209}
src/mame/drivers/compgolf.c
r15082r15083
9999   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
100100   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
101101   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
102   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
102   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
103103
104104   PORT_START("DSW1")
105105   PORT_DIPNAME( 0x03,   0x03, DEF_STR( Coin_A ) )
src/mame/drivers/cps2.c
r15082r15083
706706      /* bit 7 - */
707707
708708      /* EEPROM */
709      input_port_write(space->machine(), "EEPROMOUT", data, 0xffff);
709      state->ioport("EEPROMOUT")->write(data, 0xffff);
710710   }
711711
712712   if (ACCESSING_BITS_0_7)
r15082r15083
798798   cps_state *state = space->machine().driver_data<cps_state>();
799799
800800   if (state->m_readpaddle != 0)
801      return (input_port_read(space->machine(), "IN0"));
801      return (state->ioport("IN0")->read());
802802   else
803      return (input_port_read(space->machine(), "PADDLE1") & 0xff) | (input_port_read(space->machine(), "PADDLE2") << 8);
803      return (state->ioport("PADDLE1")->read() & 0xff) | (state->ioport("PADDLE2")->read() << 8);
804804}
805805
806806
r15082r15083
81818181{
81828182   cps_state *state = machine.driver_data<cps_state>();
81838183   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
8184   UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
8184   UINT16 *rom = (UINT16 *)state->memregion("maincpu")->base();
81858185   int length = state->memregion("maincpu")->bytes();
81868186
81878187   gigaman2_gfx_reorder(machine);
r15082r15083
94989498   ROM_LOAD16_WORD_SWAP( "vh2j_d.04a", 0x080000, 0x80000, CRC(ced9bba3) SHA1(ef7be9d39ae93ffde7d940736de9711a24585ef4) )
94999499   ROM_LOAD16_WORD_SWAP( "vh2j.05",    0x100000, 0x80000, CRC(de34f624) SHA1(60bbbd1765e76839b01c38765da2368c5188ec61) )
95009500   ROM_LOAD16_WORD_SWAP( "vh2j.06",    0x180000, 0x80000, CRC(6a3b9897) SHA1(4f3b37004db8a3d3dde709b51c94c392615134b5) )
9501   ROM_LOAD16_WORD_SWAP( "vh2j_d.06",  0x200000, 0x80000, CRC(f320ea30) SHA1(c7853b83892a49917e7a0aa68bc66875a9263589) ) // fails rom test, bad? I don't see why this should change
9501   ROM_LOAD16_WORD_SWAP( "vh2j.07",    0x200000, 0x80000, CRC(b021c029) SHA1(de4299197600608e83fe50775e3f352f5add844d) )
95029502   ROM_LOAD16_WORD_SWAP( "vh2j.08",    0x280000, 0x80000, CRC(ac873dff) SHA1(ad9a085b8403801035683b6f63eee33daf4e97ae) )
95039503   ROM_LOAD16_WORD_SWAP( "vh2j.09",    0x300000, 0x80000, CRC(eaefce9c) SHA1(d842a824f0d0adc13a86f780084164c1273c45a4) )
95049504   ROM_LOAD16_WORD_SWAP( "vh2j.10",    0x380000, 0x80000, CRC(11730952) SHA1(2966b80b99ab065614a6ddb546110f482b998e32) )
r15082r15083
95249524ROM_END
95259525
95269526
9527ROM_START( vsav2d ) // all modified roms fail rom check
9527ROM_START( vsav2d )
95289528   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
9529   ROM_LOAD16_WORD_SWAP( "vs2j_d.03", 0x000000, 0x80000, CRC(5ee19aee) SHA1(da16d64c4de0b14a39c4a19a00c59f59579d0bd8) )
9530   ROM_LOAD16_WORD_SWAP( "vs2j_d.04", 0x080000, 0x80000, CRC(80116c47) SHA1(e73c2d1fc006a74e3bb4c7a0e1b888b24b3f4c33) )
9531   ROM_LOAD16_WORD_SWAP( "vs2j_d.05", 0x100000, 0x80000, CRC(dc74a062) SHA1(723e806f70a1cfcfcb37d59fae30bfd27a581f3a) )
9529   ROM_LOAD16_WORD_SWAP( "vs2j_d.03", 0x000000, 0x80000, CRC(50865f7b) SHA1(30914bde1caec55847f28167bfb48bc4473a376c) )
9530   ROM_LOAD16_WORD_SWAP( "vs2j_d.04", 0x080000, 0x80000, CRC(c3bff0e3) SHA1(5b81dfdc3bf4e78a9d023cd8c753ce0839c0e175) )
9531   ROM_LOAD16_WORD_SWAP( "vs2j.05",   0x100000, 0x80000, CRC(61979638) SHA1(4d5625a9a06926c1a42c8f6e3a4c943f17750ec2) )
95329532   ROM_LOAD16_WORD_SWAP( "vs2j.06",   0x180000, 0x80000, CRC(f37c5bc2) SHA1(d8c1040a6ee6b9fc677a6a32b99bf02b6a707812) )
95339533   ROM_LOAD16_WORD_SWAP( "vs2j.07",   0x200000, 0x80000, CRC(8f885809) SHA1(69dac07e1f483b6478f792d20a137d6a081fbea3) )
9534   ROM_LOAD16_WORD_SWAP( "vs2j_d.08", 0x280000, 0x80000, CRC(97554918) SHA1(da6a8f6ba160696b141117c7c0da6f459637a729) ) // should this really be different?
9534   ROM_LOAD16_WORD_SWAP( "vs2j.08",   0x280000, 0x80000, CRC(2018c120) SHA1(de1184ab771c6f075cdefa744a28b09f78d91643) )
95359535   ROM_LOAD16_WORD_SWAP( "vs2j.09",   0x300000, 0x80000, CRC(fac3c217) SHA1(0e9dd54e401e6d7c4fe81107ffd27e42ca810fcb) )
95369536   ROM_LOAD16_WORD_SWAP( "vs2j.10",   0x380000, 0x80000, CRC(eb490213) SHA1(bf0416df66a33c7a4678ab4a047de334dfd3b31e) )
95379537
r15082r15083
97889788GAME( 1997, sgemfd,   sgemf,    dead_cps2, cps2_2p3b, cps2,    ROT0,   "bootleg", "Super Gem Fighter Mini Mix (USA 970904 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE )
97899789GAME( 2000, mmatrixd, mmatrix,  dead_cps2, cps2_2p1b, cps2,    ROT0,   "bootleg", "Mars Matrix: Hyper Solid Shooting (Japan 000412 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE )
97909790GAME( 2000, dimahoud, dimahoo,  dead_cps2, cps2_2p3b, cps2,    ROT270, "bootleg", "Dimahoo (USA 000121 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE )
9791GAME( 1997, vhunt2d,  vhunt2,   dead_cps2, cps2_2p6b, cps2,    ROT0,   "bootleg", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970929 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE )
9791GAME( 1997, vhunt2d,  vhunt2,   dead_cps2, cps2_2p6b, cps2,    ROT0,   "bootleg", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970913 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE )
97929792GAME( 1997, vsav2d,   vsav2,    dead_cps2, cps2_2p6b, cps2,    ROT0,   "bootleg", "Vampire Savior 2: The Lord of Vampire (Japan 970913 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE )
97939793GAME( 1997, csclub1d, csclub,   dead_cps2, cps2_2p3b, cps2,    ROT0,   "bootleg", "Capcom Sports Club (Euro 970722 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE )
97949794GAME( 1995, cybotsud, cybots,   dead_cps2, cybots,    cps2,    ROT0,   "bootleg", "Cyberbots: Fullmetal Madness (USA 950424 Phoenix Edition) (bootleg)", GAME_SUPPORTS_SAVE )
src/mame/drivers/igs017.c
r15082r15083
219219static void expand_sprites(running_machine &machine)
220220{
221221   igs017_state *state = machine.driver_data<igs017_state>();
222   UINT8 *rom   =   machine.root_device().memregion("sprites")->base();
222   UINT8 *rom   =   state->memregion("sprites")->base();
223223   int size   =   state->memregion("sprites")->bytes();
224224   int i;
225225
r15082r15083
12591259{
12601260   switch (m_input_select)
12611261   {
1262      case 0x00:   return input_port_read(machine(), "PLAYER1");
1263      case 0x01:   return input_port_read(machine(), "PLAYER2");
1264      case 0x02:   return input_port_read(machine(), "COINS");
1262      case 0x00:   return ioport("PLAYER1")->read();
1263      case 0x01:   return ioport("PLAYER2")->read();
1264      case 0x02:   return ioport("COINS")->read();
12651265
12661266      case 0x03:   return 01;
12671267
r15082r15083
13771377static READ8_DEVICE_HANDLER( mgcs_keys_r )
13781378{
13791379   igs017_state *state = device->machine().driver_data<igs017_state>();
1380   if (~state->m_input_select & 0x08)   return input_port_read(device->machine(), "KEY0");
1381   if (~state->m_input_select & 0x10)   return input_port_read(device->machine(), "KEY1");
1382   if (~state->m_input_select & 0x20)   return input_port_read(device->machine(), "KEY2");
1383   if (~state->m_input_select & 0x40)   return input_port_read(device->machine(), "KEY3");
1384   if (~state->m_input_select & 0x80)   return input_port_read(device->machine(), "KEY4");
1380   if (~state->m_input_select & 0x08)   return state->ioport("KEY0")->read();
1381   if (~state->m_input_select & 0x10)   return state->ioport("KEY1")->read();
1382   if (~state->m_input_select & 0x20)   return state->ioport("KEY2")->read();
1383   if (~state->m_input_select & 0x40)   return state->ioport("KEY3")->read();
1384   if (~state->m_input_select & 0x80)   return state->ioport("KEY4")->read();
13851385
13861386   logerror("%s: warning, reading key with input_select = %02x\n", device->machine().describe_context(), state->m_input_select);
13871387   return 0xff;
r15082r15083
14491449
14501450READ8_MEMBER(igs017_state::sdmg2_keys_r)
14511451{
1452   if (~m_input_select & 0x01)   return input_port_read(machine(), "KEY0");
1453   if (~m_input_select & 0x02)   return input_port_read(machine(), "KEY1");
1454   if (~m_input_select & 0x04)   return input_port_read(machine(), "KEY2");
1455   if (~m_input_select & 0x08)   return input_port_read(machine(), "KEY3");
1456   if (~m_input_select & 0x10)   return input_port_read(machine(), "KEY4");
1452   if (~m_input_select & 0x01)   return ioport("KEY0")->read();
1453   if (~m_input_select & 0x02)   return ioport("KEY1")->read();
1454   if (~m_input_select & 0x04)   return ioport("KEY2")->read();
1455   if (~m_input_select & 0x08)   return ioport("KEY3")->read();
1456   if (~m_input_select & 0x10)   return ioport("KEY4")->read();
14571457
1458   if (m_input_select == 0x1f)   return input_port_read(machine(), "KEY0");   // in joystick mode
1458   if (m_input_select == 0x1f)   return ioport("KEY0")->read();   // in joystick mode
14591459
14601460   logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select);
14611461   return 0xff;
r15082r15083
15021502      case 0x00:
15031503      {
15041504         UINT16 hopper_bit = (m_hopper && ((machine().primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
1505         return input_port_read(machine(), "COINS") | hopper_bit;
1505         return ioport("COINS")->read() | hopper_bit;
15061506      }
15071507
15081508      case 0x02:
r15082r15083
15381538
15391539READ8_MEMBER(igs017_state::mgdh_keys_r)
15401540{
1541   if (~m_input_select & 0x04)   return input_port_read(machine(), "KEY0");
1542   if (~m_input_select & 0x08)   return input_port_read(machine(), "KEY1");
1543   if (~m_input_select & 0x10)   return input_port_read(machine(), "KEY2");
1544   if (~m_input_select & 0x20)   return input_port_read(machine(), "KEY3");
1545   if (~m_input_select & 0x40)   return input_port_read(machine(), "KEY4");
1541   if (~m_input_select & 0x04)   return ioport("KEY0")->read();
1542   if (~m_input_select & 0x08)   return ioport("KEY1")->read();
1543   if (~m_input_select & 0x10)   return ioport("KEY2")->read();
1544   if (~m_input_select & 0x20)   return ioport("KEY3")->read();
1545   if (~m_input_select & 0x40)   return ioport("KEY4")->read();
15461546
1547   if ((m_input_select & 0xfc) == 0xfc)   return input_port_read(machine(), "DSW1");
1547   if ((m_input_select & 0xfc) == 0xfc)   return ioport("DSW1")->read();
15481548
15491549   logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select);
15501550   return 0xff;
r15082r15083
16161616         return mgdh_keys_r(space, 0);
16171617
16181618      case 0x01:
1619         return input_port_read(machine(), "BUTTONS");
1619         return ioport("BUTTONS")->read();
16201620
16211621      case 0x02:
1622         return BITSWAP8(input_port_read(machine(), "DSW2"), 0,1,2,3,4,5,6,7);
1622         return BITSWAP8(ioport("DSW2")->read(), 0,1,2,3,4,5,6,7);
16231623
16241624      case 0x03:
16251625      {
16261626         UINT16 hopper_bit = (m_hopper && ((machine().primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
1627         return input_port_read(machine(), "COINS") | hopper_bit;
1627         return ioport("COINS")->read() | hopper_bit;
16281628      }
16291629
16301630      default:
r15082r15083
17021702{
17031703   switch (m_input_select)
17041704   {
1705      case 0x00:   return input_port_read(machine(), "PLAYER1");
1706      case 0x01:   return input_port_read(machine(), "PLAYER2");
1707      case 0x02:   return input_port_read(machine(), "COINS");
1705      case 0x00:   return ioport("PLAYER1")->read();
1706      case 0x01:   return ioport("PLAYER2")->read();
1707      case 0x02:   return ioport("COINS")->read();
17081708      case 0x03:
17091709      {
17101710         UINT8 hopper_bit = (m_hopper && ((machine().primary_screen->frame_number()/10)&1)) ? 0x00 : 0x20;
1711         return input_port_read(machine(), "HOPPER") | hopper_bit;
1711         return ioport("HOPPER")->read() | hopper_bit;
17121712      }
17131713
17141714      default:
r15082r15083
17941794   {
17951795      case 0x01:
17961796      {
1797         if (~m_input_select & 0x01)   return input_port_read(machine(), "KEY0");
1798         if (~m_input_select & 0x02)   return input_port_read(machine(), "KEY1");
1799         if (~m_input_select & 0x04)   return input_port_read(machine(), "KEY2");
1800         if (~m_input_select & 0x08)   return input_port_read(machine(), "KEY3");
1801         if (~m_input_select & 0x10)   return input_port_read(machine(), "KEY4");
1797         if (~m_input_select & 0x01)   return ioport("KEY0")->read();
1798         if (~m_input_select & 0x02)   return ioport("KEY1")->read();
1799         if (~m_input_select & 0x04)   return ioport("KEY2")->read();
1800         if (~m_input_select & 0x08)   return ioport("KEY3")->read();
1801         if (~m_input_select & 0x10)   return ioport("KEY4")->read();
18021802
18031803         logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select);
18041804         return 0xffff;
r15082r15083
18851885   {
18861886      case 0x00:   // Keys
18871887      {
1888         if (~m_input_select & 0x01)   return input_port_read(machine(), "KEY0") << 8;
1889         if (~m_input_select & 0x02)   return input_port_read(machine(), "KEY1") << 8;
1890         if (~m_input_select & 0x04)   return input_port_read(machine(), "KEY2") << 8;
1891         if (~m_input_select & 0x08)   return input_port_read(machine(), "KEY3") << 8;
1892         if (~m_input_select & 0x10)   return input_port_read(machine(), "KEY4") << 8;
1888         if (~m_input_select & 0x01)   return ioport("KEY0")->read() << 8;
1889         if (~m_input_select & 0x02)   return ioport("KEY1")->read() << 8;
1890         if (~m_input_select & 0x04)   return ioport("KEY2")->read() << 8;
1891         if (~m_input_select & 0x08)   return ioport("KEY3")->read() << 8;
1892         if (~m_input_select & 0x10)   return ioport("KEY4")->read() << 8;
18931893
18941894         logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select);
18951895         return 0xffff;
r15082r15083
18981898      case 0x02:
18991899      {
19001900         UINT16 hopper_bit = (m_hopper && ((machine().primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0002;
1901         return (input_port_read(machine(), "DSW1") << 8) | input_port_read(machine(), "COINS") | hopper_bit;
1901         return (ioport("DSW1")->read() << 8) | ioport("COINS")->read() | hopper_bit;
19021902      }
19031903
19041904      case 0x04:
1905         return input_port_read(machine(), "DSW2");
1905         return ioport("DSW2")->read();
19061906   }
19071907
19081908   return 0xffff;
r15082r15083
20112011   switch(m_igs_magic[0])
20122012   {
20132013      case 0x00:
2014         return input_port_read(machine(), "PLAYER2");
2014         return ioport("PLAYER2")->read();
20152015      case 0x01:
2016         return input_port_read(machine(), "PLAYER1");
2016         return ioport("PLAYER1")->read();
20172017      case 0x02:
2018         return input_port_read(machine(), "BUTTONS");
2018         return ioport("BUTTONS")->read();
20192019
20202020      default:
20212021         logerror("%s: warning, reading with igs_magic = %02x\n", machine().describe_context(), m_igs_magic[0]);
r15082r15083
25592559   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_OTHER     ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O)
25602560
25612561   // Keyboard mode:
2562   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_SERVICE3  )   PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)   // shown in test mode
2562   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_SERVICE3  )   PORT_CONDITION("DSW2",0x40,EQUALS,0x40)   // shown in test mode
25632563   // Joystick mode:
2564   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_BUTTON3   )   PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2564   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_BUTTON3   )   PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
25652565
25662566   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
25672567
25682568   PORT_START("KEY0")
25692569   // Keyboard mode:
2570   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A         ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2571   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E         ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2572   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I         ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2573   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M         ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2574   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN       ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2575   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1            ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2576   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2577   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2570   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A         ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
2571   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E         ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
2572   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I         ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
2573   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M         ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
2574   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN       ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
2575   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1            ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
2576   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
2577   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
25782578   // Joystick mode:
2579   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1            ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2580   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP       ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2581   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN     ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2582   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT     ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2583   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT    ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2584   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1           ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2585   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2           ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2586   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2579   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1            ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2580   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP       ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2581   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN     ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2582   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT     ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2583   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT    ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2584   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1           ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2585   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2           ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2586   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
25872587
25882588   PORT_START("KEY1")
25892589   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
r15082r15083
26902690
26912691   PORT_START("KEY0")
26922692   // Keyboard mode:
2693   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A         ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
2694   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E         ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
2695   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I         ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
2696   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M         ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
2697   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN       ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
2698   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1            ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
2699   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
2700   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
2693   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A         ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
2694   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E         ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
2695   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I         ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
2696   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M         ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
2697   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN       ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
2698   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1            ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
2699   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
2700   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
27012701   // Joystick mode:
2702   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1            ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
2703   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP       ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
2704   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN     ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
2705   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT     ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
2706   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT    ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
2707   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1           ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
2708   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
2709   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
2702   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1            ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
2703   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP       ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
2704   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN     ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
2705   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT     ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
2706   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT    ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
2707   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1           ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
2708   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
2709   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN           ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
27102710
27112711   PORT_START("KEY1")
27122712   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
src/mame/drivers/pushman.c
r15082r15083
215215   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
216216   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
217217   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
218   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_VBLANK ) /* not sure, probably wrong */
218   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* not sure, probably wrong */
219219   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
220220   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
221221   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_SERVICE1 )
r15082r15083
282282   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
283283   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
284284   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
285   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_VBLANK ) /* not sure, probably wrong */
285   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* not sure, probably wrong */
286286   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
287287   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
288288   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_SERVICE1 )
src/mame/drivers/hnayayoi.c
r15082r15083
4949   for (i = 0; i < 5; i++)
5050   {
5151      if (~m_keyb & (1 << i))
52         res &= input_port_read(machine(), keynames[i]);
52         res &= ioport(keynames[i])->read();
5353   }
5454
5555   return res;
src/mame/drivers/jpmimpct.c
r15082r15083
250250      }
251251      case 0xd:
252252      {
253         val = input_port_read(machine(), "TEST/DEMO");
253         val = ioport("TEST/DEMO")->read();
254254         break;
255255      }
256256      case 0xe:
r15082r15083
366366      {
367367         if (m_touch_cnt == 0)
368368         {
369            if ( input_port_read(machine(), "TOUCH") & 0x1 )
369            if ( ioport("TOUCH")->read() & 0x1 )
370370            {
371371               m_touch_data[0] = 0x2a;
372               m_touch_data[1] = 0x7 - (input_port_read(machine(), "TOUCH_Y") >> 5) + 0x30;
373               m_touch_data[2] = (input_port_read(machine(), "TOUCH_X") >> 5) + 0x30;
372               m_touch_data[1] = 0x7 - (ioport("TOUCH_Y")->read() >> 5) + 0x30;
373               m_touch_data[2] = (ioport("TOUCH_X")->read() >> 5) + 0x30;
374374
375375               /* Return RXRDY */
376376               return 0x1;
r15082r15083
434434   {
435435      case 0:
436436      {
437         val = input_port_read(machine(), "DSW");
437         val = ioport("DSW")->read();
438438         break;
439439      }
440440      case 2:
441441      {
442         val = input_port_read(machine(), "SW2");
442         val = ioport("SW2")->read();
443443         break;
444444      }
445445      case 4:
446446      {
447         val = input_port_read(machine(), "SW1");
447         val = ioport("SW1")->read();
448448         break;
449449      }
450450      case 9:
451451      {
452         val = input_port_read(machine(), "COINS");
452         val = ioport("COINS")->read();
453453         break;
454454      }
455455   }
r15082r15083
10381038      {
10391039         case 0:
10401040         {
1041            val = input_port_read(machine(), "DSW");
1041            val = ioport("DSW")->read();
10421042            break;
10431043         }
10441044         case 1:
10451045         {
1046            val = input_port_read(machine(), "PERCENT");
1046            val = ioport("PERCENT")->read();
10471047            break;
10481048         }
10491049         case 2:
10501050         {
1051            val = input_port_read(machine(), "KEYS");
1051            val = ioport("KEYS")->read();
10521052            break;
10531053         }
10541054         case 3:
10551055         {
1056            val = input_port_read(machine(), "SW2");
1056            val = ioport("SW2")->read();
10571057            break;
10581058         }
10591059         case 4:
10601060         {
1061            val = input_port_read(machine(), "SW1");
1061            val = ioport("SW1")->read();
10621062            break;
10631063         }
10641064         case 5:
10651065         {
1066            val = (input_port_read(machine(), "SW3") );
1066            val = (ioport("SW3")->read() );
10671067            break;
10681068         }
10691069         case 6:
10701070         {
1071            val = (input_port_read(machine(), "SW4") );
1071            val = (ioport("SW4")->read() );
10721072            break;
10731073         }
10741074         case 7://5
10751075         {
1076            val = (input_port_read(machine(), "SW5") );
1076            val = (ioport("SW5")->read() );
10771077            break;
10781078         }
10791079         case 9:
10801080         {
1081            val = input_port_read(machine(), "COINS");
1081            val = ioport("COINS")->read();
10821082            break;
10831083         }
10841084      }
src/mame/drivers/namcos12.c
r15082r15083
12961296   switch( offset )
12971297   {
12981298   case 0:
1299      data = input_port_read(machine(), "LIGHT0_X");
1299      data = ioport("LIGHT0_X")->read();
13001300      break;
13011301   case 1:
1302      data = ( input_port_read(machine(), "LIGHT0_Y") ) | ( ( input_port_read(machine(), "LIGHT0_Y") + 1 ) << 16 );
1302      data = ( ioport("LIGHT0_Y")->read() ) | ( ( ioport("LIGHT0_Y")->read() + 1 ) << 16 );
13031303      break;
13041304   case 2:
1305      data = input_port_read(machine(), "LIGHT1_X");
1305      data = ioport("LIGHT1_X")->read();
13061306      break;
13071307   case 3:
1308      data = ( input_port_read(machine(), "LIGHT1_Y") ) | ( ( input_port_read(machine(), "LIGHT1_Y") + 1 ) << 16 );
1308      data = ( ioport("LIGHT1_Y")->read() ) | ( ( ioport("LIGHT1_Y")->read() + 1 ) << 16 );
13091309      break;
13101310   }
13111311   verboselog( machine(), 2, "system11gun_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
r15082r15083
15731573
15741574READ8_MEMBER(namcos12_state::s12_mcu_gun_h_r)
15751575{
1576   const input_port_config *port = ioport("LIGHT0_X");
1576   ioport_port *port = ioport("LIGHT0_X");
15771577   if( port != NULL )
15781578   {
1579      int rv = input_port_read_direct( port ) << 6;
1579      int rv = port->read() << 6;
15801580
15811581      if( ( offset & 1 ) != 0 )
15821582      {
r15082r15083
15921592
15931593READ8_MEMBER(namcos12_state::s12_mcu_gun_v_r)
15941594{
1595   const input_port_config *port = ioport("LIGHT0_Y");
1595   ioport_port *port = ioport("LIGHT0_Y");
15961596   if( port != NULL )
15971597   {
1598      int rv = input_port_read_direct( port ) << 6;
1598      int rv = port->read() << 6;
15991599
16001600      if( ( offset & 1 ) != 0 )
16011601      {
r15082r15083
16271627
16281628   psx_driver_init(machine);
16291629
1630   state->membank("bank1")->configure_entries(0, machine.root_device().memregion( "user2" )->bytes() / 0x200000, state->memregion( "user2" )->base(), 0x200000 );
1630   state->membank("bank1")->configure_entries(0, state->memregion( "user2" )->bytes() / 0x200000, state->memregion( "user2" )->base(), 0x200000 );
16311631
16321632   state->m_s12_porta = 0;
16331633   state->m_s12_rtcstate = 0;
src/mame/drivers/scramble.c
r15082r15083
475475CUSTOM_INPUT_MEMBER(scramble_state::ckongs_coinage_r)
476476{
477477   int bit_mask = (FPTR)param;
478   return (input_port_read(machine(), "FAKE") & bit_mask) ? 0x01 : 0x00;
478   return (ioport("FAKE")->read() & bit_mask) ? 0x01 : 0x00;
479479}
480480
481481
r15082r15083
816816   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* protection check? */
817817
818818    PORT_START("SENSE")
819   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
819   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
820820INPUT_PORTS_END
821821
822822static INPUT_PORTS_START( hncholms )
r15082r15083
860860   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* protection check? */
861861
862862    PORT_START("SENSE")
863   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
863   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
864864INPUT_PORTS_END
865865
866866static INPUT_PORTS_START( cavelon )
src/mame/drivers/taxidriv.c
r15082r15083
6969static READ8_DEVICE_HANDLER( p1c_r )
7070{
7171   taxidriv_state *state = device->machine().driver_data<taxidriv_state>();
72   return (state->m_s2 << 7) | (state->m_s4 << 6) | ((input_port_read(device->machine(), "SERVCOIN") & 1) << 4);
72   return (state->m_s2 << 7) | (state->m_s4 << 6) | ((state->ioport("SERVCOIN")->read() & 1) << 4);
7373}
7474
7575static WRITE8_DEVICE_HANDLER( p1a_w )
src/mame/drivers/tehkanwc.c
r15082r15083
108108{
109109   int joy;
110110
111   joy = input_port_read(machine(), "FAKE") >> (2 * offset);
111   joy = ioport("FAKE")->read() >> (2 * offset);
112112   if (joy & 1) return -63;
113113   if (joy & 2) return 63;
114   return input_port_read(machine(), offset ? "P1Y" : "P1X") - m_track0[offset];
114   return ioport(offset ? "P1Y" : "P1X")->read() - m_track0[offset];
115115}
116116
117117READ8_MEMBER(tehkanwc_state::tehkanwc_track_1_r)
118118{
119119   int joy;
120120
121   joy = input_port_read(machine(), "FAKE") >> (4 + 2 * offset);
121   joy = ioport("FAKE")->read() >> (4 + 2 * offset);
122122   if (joy & 1) return -63;
123123   if (joy & 2) return 63;
124   return input_port_read(machine(), offset ? "P2Y" : "P2X") - m_track1[offset];
124   return ioport(offset ? "P2Y" : "P2X")->read() - m_track1[offset];
125125}
126126
127127WRITE8_MEMBER(tehkanwc_state::tehkanwc_track_0_reset_w)
128128{
129129   /* reset the trackball counters */
130   m_track0[offset] = input_port_read(machine(), offset ? "P1Y" : "P1X") + data;
130   m_track0[offset] = ioport(offset ? "P1Y" : "P1X")->read() + data;
131131}
132132
133133WRITE8_MEMBER(tehkanwc_state::tehkanwc_track_1_reset_w)
134134{
135135   /* reset the trackball counters */
136   m_track1[offset] = input_port_read(machine(), offset ? "P2Y" : "P2X") + data;
136   m_track1[offset] = ioport(offset ? "P2Y" : "P2X")->read() + data;
137137}
138138
139139
src/mame/drivers/liberatr.c
r15082r15083
182182   /* input becomes the starting point for the trackball counters */
183183   if (((data ^ m_ctrld) & 0x10) && (data & 0x10))
184184   {
185      UINT8 trackball = input_port_read(machine(), "FAKE");
186      UINT8 switches = input_port_read(machine(), "IN0");
185      UINT8 trackball = ioport("FAKE")->read();
186      UINT8 switches = ioport("IN0")->read();
187187      m_trackball_offset = ((trackball & 0xf0) - (switches & 0xf0)) | ((trackball - switches) & 0x0f);
188188   }
189189   m_ctrld = data & 0x10;
r15082r15083
195195   /* if ctrld is high, the /ld signal on the LS191 is NOT set, meaning that the trackball is counting */
196196   if (m_ctrld)
197197   {
198      UINT8 trackball = input_port_read(machine(), "FAKE");
198      UINT8 trackball = ioport("FAKE")->read();
199199      return ((trackball & 0xf0) - (m_trackball_offset & 0xf0)) | ((trackball - m_trackball_offset) & 0x0f);
200200   }
201201
202202   /* otherwise, the LS191 is simply passing through the raw switch inputs */
203203   else
204      return input_port_read(machine(), "IN0");
204      return ioport("IN0")->read();
205205}
206206
207207
r15082r15083
300300   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
301301   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
302302   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
303   PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_VBLANK )
303   PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_VBLANK("screen")
304304
305305   PORT_START("DSW1")         /* IN2  -  Game Option switches DSW @ D4 on PCB */
306306   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
src/mame/drivers/bionicc.c
r15082r15083
8787WRITE16_MEMBER(bionicc_state::bionicc_mpu_trigger_w)
8888{
8989
90   data = input_port_read(machine(), "SYSTEM") >> 12;
90   data = ioport("SYSTEM")->read() >> 12;
9191   m_inp[0] = data ^ 0x0f;
9292
93   data = input_port_read(machine(), "P2");
93   data = ioport("P2")->read();
9494   m_inp[1] = data ^ 0xff;
9595
96   data = input_port_read(machine(), "P1");
96   data = ioport("P1")->read();
9797   m_inp[2] = data ^ 0xff;
9898}
9999
src/mame/drivers/citycon.c
r15082r15083
1616
1717READ8_MEMBER(citycon_state::citycon_in_r)
1818{
19   return input_port_read(machine(), flip_screen() ? "P2" : "P1");
19   return ioport(flip_screen() ? "P2" : "P1")->read();
2020}
2121
2222READ8_MEMBER(citycon_state::citycon_irq_ack_r)
src/mame/drivers/ampoker2.c
r15082r15083
703703   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G)
704704   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
705705   PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
706   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x08)
707   PORT_DIPSETTING(    0x00, "Cred x  50" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x08)
708   PORT_DIPSETTING(    0x08, "Cred x  20" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */
709   PORT_DIPSETTING(    0x00, "Remote Off" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x00)
706   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x08)
707   PORT_DIPSETTING(    0x00, "Cred x  50" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x08)
708   PORT_DIPSETTING(    0x08, "Cred x  20" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x00) /* x100 in ampkr95 */
709   PORT_DIPSETTING(    0x00, "Remote Off" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x00)
710710   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Black Card")
711711
712712   PORT_START("IN4")
r15082r15083
788788   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G)
789789   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
790790   PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
791   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
792   PORT_DIPSETTING(    0x00, "Cred x  50" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
793   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */
794   PORT_DIPSETTING(    0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00)
791   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
792   PORT_DIPSETTING(    0x00, "Cred x  50" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
793   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00) /* x100 in ampkr95 */
794   PORT_DIPSETTING(    0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00)
795795   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Black Card")
796796
797797   PORT_START("IN4")
r15082r15083
873873   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G)
874874   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
875875   PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
876   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
877   PORT_DIPSETTING(    0x00, "Cred x  50" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
878   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */
879   PORT_DIPSETTING(    0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00)
876   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
877   PORT_DIPSETTING(    0x00, "Cred x  50" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
878   PORT_DIPSETTING(    0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00) /* x100 in ampkr95 */
879   PORT_DIPSETTING(    0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00)
880880   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double") PORT_CODE(KEYCODE_S)
881881
882882   PORT_START("IN4")
src/mame/drivers/playmark.c
r15082r15083
414414   PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
415415   PORT_DIPSETTING(    0x01, "Mode 1" )
416416   PORT_DIPSETTING(    0x00, "Mode 2" )
417   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
417   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
418418   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) )
419419   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) )
420420   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
r15082r15083
431431   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) )
432432   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
433433   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
434   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
434   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
435435   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
436436   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
437437   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
438438   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
439   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
439   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
440440   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
441441   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
442442   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
r15082r15083
513513   PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
514514   PORT_DIPSETTING(    0x01, "Mode 1" )
515515   PORT_DIPSETTING(    0x00, "Mode 2" )
516   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
516   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
517517   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) )
518518   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) )
519519   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
r15082r15083
530530   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) )
531531   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
532532   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
533   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
533   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
534534   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
535535   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
536536   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
537537   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
538   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
538   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
539539   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
540540   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
541541   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
r15082r15083
661661   PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
662662   PORT_DIPSETTING(    0x01, "Mode 1" )
663663   PORT_DIPSETTING(    0x00, "Mode 2" )
664   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
664   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
665665   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) )
666666   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) )
667667   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
r15082r15083
678678   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) )
679679   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
680680   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
681   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
681   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
682682   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
683683   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
684684   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
685685   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
686   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
686   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
687687   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
688688   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
689689   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
r15082r15083
725725   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
726726   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
727727   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
728   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
728   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
729729   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)   /* EEPROM data */
730730
731731   PORT_START("DSW1")
r15082r15083
756756   PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
757757   PORT_DIPSETTING(    0x01, "Mode 1" )
758758   PORT_DIPSETTING(    0x00, "Mode 2" )
759   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
759   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
760760   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) )
761761   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) )
762762   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
r15082r15083
773773   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) )
774774   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
775775   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
776   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
776   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
777777   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
778778   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
779779   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
780780   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
781   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
781   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
782782   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
783783   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
784784   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
r15082r15083
852852   PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
853853   PORT_DIPSETTING(    0x01, "Mode 1" )
854854   PORT_DIPSETTING(    0x00, "Mode 2" )
855   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
855   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
856856   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) )
857857   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) )
858858   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
r15082r15083
869869   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) )
870870   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
871871   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
872   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
872   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
873873   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
874874   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
875875   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
876876   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
877   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
877   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
878878   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
879879   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
880880   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
r15082r15083
16781678static DRIVER_INIT( bigtwin )
16791679{
16801680   playmark_state *state = machine.driver_data<playmark_state>();
1681   UINT8 *playmark_PICROM_HEX = machine.root_device().memregion("user1")->base();
1681   UINT8 *playmark_PICROM_HEX = state->memregion("user1")->base();
16821682   UINT16 *playmark_PICROM = (UINT16 *)state->memregion("audiocpu")->base();
16831683   INT32 offs, data;
16841684   UINT16 src_pos = 0;
src/mame/drivers/jangou.c
r15082r15083
277277   jangou_state *state = device->machine().driver_data<jangou_state>();
278278   switch(state->m_mux_data)
279279   {
280      case 0x01: return input_port_read(device->machine(), "PL1_1");
281      case 0x02: return input_port_read(device->machine(), "PL1_2");
282      case 0x04: return input_port_read(device->machine(), "PL2_1");
283      case 0x08: return input_port_read(device->machine(), "PL2_2");
284      case 0x10: return input_port_read(device->machine(), "PL1_3");
285      case 0x20: return input_port_read(device->machine(), "PL2_3");
280      case 0x01: return state->ioport("PL1_1")->read();
281      case 0x02: return state->ioport("PL1_2")->read();
282      case 0x04: return state->ioport("PL2_1")->read();
283      case 0x08: return state->ioport("PL2_2")->read();
284      case 0x10: return state->ioport("PL1_3")->read();
285      case 0x20: return state->ioport("PL2_3")->read();
286286   }
287287
288   return input_port_read(device->machine(), "IN_NOMUX");
288   return device->machine().root_device().ioport("IN_NOMUX")->read();
289289}
290290
291291static READ8_DEVICE_HANDLER( input_system_r )
292292{
293   return input_port_read(device->machine(), "SYSTEM");
293   return device->machine().root_device().ioport("SYSTEM")->read();
294294}
295295
296296
r15082r15083
595595   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
596596   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
597597   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
598   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK ) // guess
598   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // guess
599599   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // blitter busy flag
600600INPUT_PORTS_END
601601
r15082r15083
656656   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
657657   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
658658   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
659   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK ) // guess
659   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // guess
660660   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // blitter busy flag
661661INPUT_PORTS_END
662662
r15082r15083
782782   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
783783   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
784784   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
785   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
785   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
786786   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //blitter busy flag
787787INPUT_PORTS_END
788788
src/mame/drivers/namcos21.c
r15082r15083
22572257static DRIVER_INIT( winrun )
22582258{
22592259   namcos21_state *state = machine.driver_data<namcos21_state>();
2260   UINT16 *pMem = (UINT16 *)machine.root_device().memregion("dsp")->base();
2260   UINT16 *pMem = (UINT16 *)state->memregion("dsp")->base();
22612261   int pc = 0;
22622262   pMem[pc++] = 0xff80; /* b */
22632263   pMem[pc++] = 0;
r15082r15083
23012301static DRIVER_INIT( driveyes )
23022302{
23032303   namcos21_state *state = machine.driver_data<namcos21_state>();
2304   UINT16 *pMem = (UINT16 *)machine.root_device().memregion("dsp")->base();
2304   UINT16 *pMem = (UINT16 *)state->memregion("dsp")->base();
23052305   int pc = 0;
23062306   pMem[pc++] = 0xff80; /* b */
23072307   pMem[pc++] = 0;
src/mame/drivers/pgm.c
r15082r15083
36133613static void expand_colourdata( running_machine &machine )
36143614{
36153615   pgm_state *state = machine.driver_data<pgm_state>();
3616   UINT8 *src = machine.root_device().memregion( "sprcol" )->base();
3616   UINT8 *src = state->memregion( "sprcol" )->base();
36173617   size_t srcsize = state->memregion( "sprcol" )->bytes();
36183618   int cnt;
36193619   size_t needed = srcsize / 2 * 3;
src/mame/drivers/gameplan.c
r15082r15083
110110   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "DSW0", "DSW1" };
111111   gameplan_state *state = device->machine().driver_data<gameplan_state>();
112112
113   return input_port_read(device->machine(), portnames[state->m_current_port]);
113   return state->ioport(portnames[state->m_current_port])->read();
114114}
115115
116116
src/mame/drivers/pengadvb.c
r15082r15083
178178
179179static READ8_DEVICE_HANDLER( pengadvb_psg_port_a_r )
180180{
181   return input_port_read(device->machine(), "IN0");
181   return device->machine().root_device().ioport("IN0")->read();
182182}
183183
184184static const ay8910_interface pengadvb_ay8910_interface =
r15082r15083
212212   i8255_device *ppi = device->machine().device<i8255_device>("ppi8255");
213213   address_space *space = device->machine().firstcpu->memory().space(AS_PROGRAM);
214214   if ((ppi->read(*space, 2) & 0x0f) == 0)
215      return input_port_read(device->machine(), "IN1");
215      return device->machine().root_device().ioport("IN1")->read();
216216
217217   return 0xff;
218218}
src/mame/drivers/capbowl.c
r15082r15083
107107
108108static INTERRUPT_GEN( capbowl_interrupt )
109109{
110   if (input_port_read(device->machine(), "SERVICE") & 1)                  /* get status of the F2 key */
110   if (device->machine().root_device().ioport("SERVICE")->read() & 1)                  /* get status of the F2 key */
111111      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);   /* trigger self test */
112112}
113113
r15082r15083
152152
153153READ8_MEMBER(capbowl_state::track_0_r)
154154{
155   return (input_port_read(machine(), "IN0") & 0xf0) | ((input_port_read(machine(), "TRACKY") - m_last_trackball_val[0]) & 0x0f);
155   return (ioport("IN0")->read() & 0xf0) | ((ioport("TRACKY")->read() - m_last_trackball_val[0]) & 0x0f);
156156}
157157
158158
159159READ8_MEMBER(capbowl_state::track_1_r)
160160{
161   return (input_port_read(machine(), "IN1") & 0xf0) | ((input_port_read(machine(), "TRACKX") - m_last_trackball_val[1]) & 0x0f);
161   return (ioport("IN1")->read() & 0xf0) | ((ioport("TRACKX")->read() - m_last_trackball_val[1]) & 0x0f);
162162}
163163
164164
r15082r15083
166166{
167167
168168   /* reset the trackball counters */
169   m_last_trackball_val[0] = input_port_read(machine(), "TRACKY");
170   m_last_trackball_val[1] = input_port_read(machine(), "TRACKX");
169   m_last_trackball_val[0] = ioport("TRACKY")->read();
170   m_last_trackball_val[1] = ioport("TRACKX")->read();
171171
172172   watchdog_reset_w(space, offset, data);
173173}
src/mame/drivers/darius.c
r15082r15083
180180         return (tc0140syt_comm_r(m_tc0140syt, 0) & 0xff);   /* sound interface read */
181181
182182      case 0x04:
183         return input_port_read(machine(), "P1");
183         return ioport("P1")->read();
184184
185185      case 0x05:
186         return input_port_read(machine(), "P2");
186         return ioport("P2")->read();
187187
188188      case 0x06:
189         return input_port_read(machine(), "SYSTEM");
189         return ioport("SYSTEM")->read();
190190
191191      case 0x07:
192192         return m_coin_word;   /* bits 3&4 coin lockouts, must return zero */
193193
194194      case 0x08:
195         return input_port_read(machine(), "DSW");
195         return ioport("DSW")->read();
196196   }
197197
198198logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",cpu_get_pc(&space.device()),offset);
r15082r15083
842842{
843843   darius_state *state = machine.driver_data<darius_state>();
844844
845   state->membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x8000);
845   state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000, 0x8000);
846846   state->membank("bank1")->configure_entry(4, state->memregion("audiocpu")->base());
847847   state->membank("bank1")->set_entry(4);
848848
src/mame/drivers/ssingles.c
r15082r15083
342342CUSTOM_INPUT_MEMBER(ssingles_state::controls_r)
343343{
344344   int data = 7;
345   switch(input_port_read(machine(), "EXTRA"))      //multiplexed
345   switch(ioport("EXTRA")->read())      //multiplexed
346346   {
347347      case 0x01: data = 1; break;
348348      case 0x02: data = 2; break;
src/mame/drivers/kinst.c
r15082r15083
338338   switch (offset)
339339   {
340340      case 2:      /* $90 -- sound return */
341         result = input_port_read(machine(), portnames[offset]);
341         result = ioport(portnames[offset])->read();
342342         result &= ~0x0002;
343343         if (dcs_control_r(machine()) & 0x800)
344344            result |= 0x0002;
r15082r15083
347347      case 0:      /* $80 */
348348      case 1:      /* $88 */
349349      case 3:      /* $98 */
350         result = input_port_read(machine(), portnames[offset]);
350         result = ioport(portnames[offset])->read();
351351         break;
352352
353353      case 4:      /* $a0 */
354         result = input_port_read(machine(), portnames[offset]);
354         result = ioport(portnames[offset])->read();
355355         if (cpu_get_pc(&space.device()) == 0x802d428)
356356            device_spin_until_interrupt(&space.device());
357357         break;
src/mame/drivers/cbasebal.c
r15082r15083
168168   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
169169   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
170170   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
171   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )      /* ? */
171   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")      /* ? */
172172   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
173173
174174   PORT_START( "IO_01" )
src/mame/drivers/beathead.c
r15082r15083
256256
257257READ32_MEMBER( beathead_state::input_2_r )
258258{
259   int result = input_port_read(machine(), "IN2");
259   int result = ioport("IN2")->read();
260260   if (m_sound_to_cpu_ready) result ^= 0x10;
261261   if (m_cpu_to_sound_ready) result ^= 0x20;
262262   return result;
src/mame/drivers/mpoker.c
r15082r15083
258258    If you change the status *every* read, the HW stucks.
259259*/
260260
261   m_mixdata = (input_port_read(machine(), "SW2") & 0xfd) | (machine().rand() & 0x02);
261   m_mixdata = (ioport("SW2")->read() & 0xfd) | (machine().rand() & 0x02);
262262
263263   return m_mixdata;
264264}
src/mame/drivers/st0016.c
r15082r15083
4545        xxxx - input port #2
4646    xxxx     - dip switches (2x8 bits) (multiplexed)
4747*/
48   int retval = input_port_read(machine(), "SYSTEM") & 0x0f;
48   int retval = ioport("SYSTEM")->read() & 0x0f;
4949
5050   switch(mux_port & 0x30)
5151   {
52      case 0x00: retval |= ((input_port_read(machine(), "DSW1") & 1) << 4) | ((input_port_read(machine(), "DSW1") & 0x10) << 1)
53                        | ((input_port_read(machine(), "DSW2") & 1) << 6) | ((input_port_read(machine(), "DSW2") & 0x10) <<3); break;
54      case 0x10: retval |= ((input_port_read(machine(), "DSW1") & 2) << 3) | ((input_port_read(machine(), "DSW1") & 0x20)   )
55                        | ((input_port_read(machine(), "DSW2") & 2) << 5) | ((input_port_read(machine(), "DSW2") & 0x20) <<2); break;
56      case 0x20: retval |= ((input_port_read(machine(), "DSW1") & 4) << 2) | ((input_port_read(machine(), "DSW1") & 0x40) >> 1)
57                        | ((input_port_read(machine(), "DSW2") & 4) << 4) | ((input_port_read(machine(), "DSW2") & 0x40) <<1); break;
58      case 0x30: retval |= ((input_port_read(machine(), "DSW1") & 8) << 1) | ((input_port_read(machine(), "DSW1") & 0x80) >> 2)
59                        | ((input_port_read(machine(), "DSW2") & 8) << 3) | ((input_port_read(machine(), "DSW2") & 0x80)    ); break;
52      case 0x00: retval |= ((ioport("DSW1")->read() & 1) << 4) | ((ioport("DSW1")->read() & 0x10) << 1)
53                        | ((ioport("DSW2")->read() & 1) << 6) | ((ioport("DSW2")->read() & 0x10) <<3); break;
54      case 0x10: retval |= ((ioport("DSW1")->read() & 2) << 3) | ((ioport("DSW1")->read() & 0x20)   )
55                        | ((ioport("DSW2")->read() & 2) << 5) | ((ioport("DSW2")->read() & 0x20) <<2); break;
56      case 0x20: retval |= ((ioport("DSW1")->read() & 4) << 2) | ((ioport("DSW1")->read() & 0x40) >> 1)
57                        | ((ioport("DSW2")->read() & 4) << 4) | ((ioport("DSW2")->read() & 0x40) <<1); break;
58      case 0x30: retval |= ((ioport("DSW1")->read() & 8) << 1) | ((ioport("DSW1")->read() & 0x80) >> 2)
59                        | ((ioport("DSW2")->read() & 8) << 3) | ((ioport("DSW2")->read() & 0x80)    ); break;
6060   }
6161
6262   return retval;
src/mame/drivers/suprgolf.c
r15082r15083
285285{
286286   UINT8 p1_sht_sw,p2_sht_sw;
287287
288   p1_sht_sw = (input_port_read(device->machine(), "P1_RELEASE") & 0x80)>>7;
289   p2_sht_sw = (input_port_read(device->machine(), "P2_RELEASE") & 0x80)>>6;
288   p1_sht_sw = (device->machine().root_device().ioport("P1_RELEASE")->read() & 0x80)>>7;
289   p2_sht_sw = (device->machine().root_device().ioport("P2_RELEASE")->read() & 0x80)>>6;
290290
291291   return p1_sht_sw | p2_sht_sw;
292292}
293293
294294static READ8_DEVICE_HANDLER( p1_r )
295295{
296   return (input_port_read(device->machine(), "P1") & 0xf0) | ((input_port_read(device->machine(), "P1_ANALOG") & 0xf));
296   return (device->machine().root_device().ioport("P1")->read() & 0xf0) | ((device->machine().root_device().ioport("P1_ANALOG")->read() & 0xf));
297297}
298298
299299static READ8_DEVICE_HANDLER( p2_r )
300300{
301   return (input_port_read(device->machine(), "P2") & 0xf0) | ((input_port_read(device->machine(), "P2_ANALOG") & 0xf));
301   return (device->machine().root_device().ioport("P2")->read() & 0xf0) | ((device->machine().root_device().ioport("P2_ANALOG")->read() & 0xf));
302302}
303303
304304static ADDRESS_MAP_START( suprgolf_map, AS_PROGRAM, 8, suprgolf_state )
src/mame/drivers/adp.c
r15082r15083
287287
288288static UINT8 duart_input( device_t *device )
289289{
290   return input_port_read(device->machine(), "DSW1");
290   return device->machine().root_device().ioport("DSW1")->read();
291291}
292292
293293static const microtouch_interface adb_microtouch_config =
r15082r15083
386386
387387   switch (m_mux_data)
388388   {
389      case 0x00: value = input_port_read(machine(), "x0"); break;
390      case 0x01: value = input_port_read(machine(), "x1"); break;
391      case 0x02: value = input_port_read(machine(), "x2"); break;
392      case 0x03: value = input_port_read(machine(), "1P_UP"); break;
393      case 0x04: value = input_port_read(machine(), "1P_B1"); break;
394      case 0x05: value = input_port_read(machine(), "x5"); break;
395      case 0x06: value = input_port_read(machine(), "1P_RIGHT"); break;
396      case 0x07: value = input_port_read(machine(), "1P_DOWN"); break;
397      case 0x08: value = input_port_read(machine(), "1P_LEFT"); break;
398      case 0x09: value = input_port_read(machine(), "x9"); break;
399      case 0x0a: value = input_port_read(machine(), "x10"); break;
400      case 0x0b: value = input_port_read(machine(), "x11"); break;
401      case 0x0c: value = input_port_read(machine(), "x12"); break;
402      case 0x0d: value = input_port_read(machine(), "x13"); break;
403      case 0x0e: value = input_port_read(machine(), "1P_START"); break;
404      case 0x0f: value = input_port_read(machine(), "1P_COIN"); break;
389      case 0x00: value = ioport("x0")->read(); break;
390      case 0x01: value = ioport("x1")->read(); break;
391      case 0x02: value = ioport("x2")->read(); break;
392      case 0x03: value = ioport("1P_UP")->read(); break;
393      case 0x04: value = ioport("1P_B1")->read(); break;
394      case 0x05: value = ioport("x5")->read(); break;
395      case 0x06: value = ioport("1P_RIGHT")->read(); break;
396      case 0x07: value = ioport("1P_DOWN")->read(); break;
397      case 0x08: value = ioport("1P_LEFT")->read(); break;
398      case 0x09: value = ioport("x9")->read(); break;
399      case 0x0a: value = ioport("x10")->read(); break;
400      case 0x0b: value = ioport("x11")->read(); break;
401      case 0x0c: value = ioport("x12")->read(); break;
402      case 0x0d: value = ioport("x13")->read(); break;
403      case 0x0e: value = ioport("1P_START")->read(); break;
404      case 0x0f: value = ioport("1P_COIN")->read(); break;
405405   }
406406
407407   m_mux_data++;
src/mame/drivers/konamigq.c
r15082r15083
144144
145145WRITE32_MEMBER(konamigq_state::eeprom_w)
146146{
147   input_port_write(machine(), "EEPROMOUT", data & 0x07, 0xff);
147   ioport("EEPROMOUT")->write(data & 0x07, 0xff);
148148   cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_RESET, ( data & 0x40 ) ? CLEAR_LINE : ASSERT_LINE );
149149}
150150
src/mame/drivers/snesb.c
r15082r15083
212212/* Generic read handlers for Dip Switches and coins inputs */
213213READ8_MEMBER(snesb_state::snesb_dsw1_r)
214214{
215   return input_port_read(machine(), "DSW1");
215   return ioport("DSW1")->read();
216216}
217217
218218READ8_MEMBER(snesb_state::snesb_dsw2_r)
219219{
220   return input_port_read(machine(), "DSW2");
220   return ioport("DSW2")->read();
221221}
222222
223223READ8_MEMBER(snesb_state::snesb_coin_r)
224224{
225   return input_port_read(machine(), "COIN");
225   return ioport("COIN")->read();
226226}
227227
228228
src/mame/drivers/pcxt.c
r15082r15083
146146READ8_MEMBER(pcxt_state::disk_iobank_r)
147147{
148148   //printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,cpu_get_pc(&space.device()));
149   //if(offset == 0) return input_port_read(machine(), "DSW");
150   if(offset == 1) return input_port_read(machine(), "IN1");
149   //if(offset == 0) return ioport("DSW")->read();
150   if(offset == 1) return ioport("IN1")->read();
151151
152152   return m_disk_data[offset];
153153}
src/mame/drivers/mcatadv.c
r15082r15083
279279   PORT_DIPSETTING(      0x0800, "Mode 1" )
280280   PORT_DIPSETTING(      0x0000, "Mode 2" )
281281   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:5,6")
282   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
283   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
284   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
282   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
283   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
284   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
285285   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )
286   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
287   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
288   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
286   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
287   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
288   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
289289   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:7,8")
290   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
291   PORT_DIPSETTING(      0x4000, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
292   PORT_DIPSETTING(      0x4000, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
290   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
291   PORT_DIPSETTING(      0x4000, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
292   PORT_DIPSETTING(      0x4000, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
293293   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_1C ) )
294   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
295   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
296   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
294   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
295   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
296   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
297297
298298   PORT_START("DSW2")
299299   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/toaplan2.c
r15082r15083
662662{
663663   INT8 value, new_value;
664664
665   new_value = input_port_read(machine(), "PAD1");
665   new_value = ioport("PAD1")->read();
666666   if (new_value == m_old_p1_paddle_h) return 0;
667667   value = new_value - m_old_p1_paddle_h;
668668   m_old_p1_paddle_h = new_value;
r15082r15083
674674{
675675   INT8 value, new_value;
676676
677   new_value = input_port_read(machine(), "PAD2");
677   new_value = ioport("PAD2")->read();
678678   if (new_value == m_old_p2_paddle_h) return 0;
679679   value = new_value - m_old_p2_paddle_h;
680680   m_old_p2_paddle_h = new_value;
r15082r15083
788788
789789READ8_MEMBER(toaplan2_state::v25_dswa_r)
790790{
791   return input_port_read(machine(), "DSWA") ^ 0xff;
791   return ioport("DSWA")->read() ^ 0xff;
792792}
793793
794794
795795READ8_MEMBER(toaplan2_state::v25_dswb_r)
796796{
797   return input_port_read(machine(), "DSWB") ^ 0xff;
797   return ioport("DSWB")->read() ^ 0xff;
798798}
799799
800800
801801READ8_MEMBER(toaplan2_state::v25_jmpr_r)
802802{
803   return input_port_read(machine(), "JMPR") ^ 0xff;
803   return ioport("JMPR")->read() ^ 0xff;
804804}
805805
806806
r15082r15083
10101010      logerror("CPU #0 PC:%06X - Unknown EEPROM data being written %04X\n",cpu_get_pc(&space.device()),data);
10111011
10121012   if ( ACCESSING_BITS_0_7 )
1013      input_port_write(machine(), "EEPROMOUT", data, 0xff);
1013      ioport("EEPROMOUT")->write(data, 0xff);
10141014
10151015   m_z80_busreq = data & 0x10;   // see bbakraid_eeprom_r above
10161016}
r15082r15083
25212521   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_3C ) )
25222522   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_4C ) )
25232523   PORT_DIPSETTING(      0x001c, DEF_STR( Free_Play ) )
2524   PORT_DIPNAME( 0x00e0,   0x0000, DEF_STR( Coin_B ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6,!7,!8")
2525   PORT_DIPSETTING(      0x00c0, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2526   PORT_DIPSETTING(      0x00a0, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2527   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2528   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2529//  PORT_DIPSETTING(        0x00e0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2530   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2531   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2532   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2524   PORT_DIPNAME( 0x00e0,   0x0000, DEF_STR( Coin_B ) )      PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6,!7,!8")
2525   PORT_DIPSETTING(      0x00c0, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
2526   PORT_DIPSETTING(      0x00a0, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
2527   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
2528   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
2529//  PORT_DIPSETTING(        0x00e0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
2530   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
2531   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
2532   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
25332533   // When Coin_A is set to Free_Play, Coin_A becomes Coin_A and Coin_B, and the following dips occur
2534   PORT_DIPNAME( 0x0020,   0x0000, "Joystick Mode" )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6")
2535   PORT_DIPSETTING(      0x0000, "90 degrees ACW" )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
2536   PORT_DIPSETTING(      0x0020, DEF_STR( Normal ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
2537   PORT_DIPNAME( 0x0040,   0x0000, "Effect" )            PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!7")
2538   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
2539   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )         PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
2540   PORT_DIPNAME( 0x0080,   0x0000, "Music" )            PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!8")
2541   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
2542   PORT_DIPSETTING(      0x0080, DEF_STR( On ) )         PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
2534   PORT_DIPNAME( 0x0020,   0x0000, "Joystick Mode" )      PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6")
2535   PORT_DIPSETTING(      0x0000, "90 degrees ACW" )      PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
2536   PORT_DIPSETTING(      0x0020, DEF_STR( Normal ) )      PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
2537   PORT_DIPNAME( 0x0040,   0x0000, "Effect" )            PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!7")
2538   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
2539   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )         PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
2540   PORT_DIPNAME( 0x0080,   0x0000, "Music" )            PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!8")
2541   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
2542   PORT_DIPSETTING(      0x0080, DEF_STR( On ) )         PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
25432543
25442544   PORT_START("DSWB")
25452545   PORT_DIPNAME( 0x0003,   0x0000, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW2:!1,!2")
r15082r15083
25632563   PORT_DIPSETTING(      0x0060, DEF_STR( Infinite ) )
25642564   PORT_DIPSETTING(      0x0070, "Invulnerability (Cheat)" )
25652565   PORT_DIPNAME( 0x0080,   0x0000, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:!8")
2566   PORT_DIPSETTING(      0x0000, DEF_STR( None ) )      PORT_CONDITION("JMPR",0x0003,PORTCOND_NOTEQUALS,0x0000)   // Non-Japan
2567   PORT_DIPSETTING(      0x0080, "Every 2000k" )         PORT_CONDITION("JMPR",0x0003,PORTCOND_NOTEQUALS,0x0000)   // Non-Japan
2568   PORT_DIPSETTING(      0x0080, "1000k and 2000k" )      PORT_CONDITION("JMPR",0x0003,PORTCOND_EQUALS,0x0000)   // Japan
2569   PORT_DIPSETTING(      0x0000, "Every 1000k" )         PORT_CONDITION("JMPR",0x0003,PORTCOND_EQUALS,0x0000)   // Japan
2566   PORT_DIPSETTING(      0x0000, DEF_STR( None ) )      PORT_CONDITION("JMPR",0x0003,NOTEQUALS,0x0000)   // Non-Japan
2567   PORT_DIPSETTING(      0x0080, "Every 2000k" )         PORT_CONDITION("JMPR",0x0003,NOTEQUALS,0x0000)   // Non-Japan
2568   PORT_DIPSETTING(      0x0080, "1000k and 2000k" )      PORT_CONDITION("JMPR",0x0003,EQUALS,0x0000)   // Japan
2569   PORT_DIPSETTING(      0x0000, "Every 1000k" )         PORT_CONDITION("JMPR",0x0003,EQUALS,0x0000)   // Japan
25702570
25712571   PORT_START("JMPR")
25722572   PORT_DIPNAME( 0x0008,   0x0000, "Stage Edit" )   PORT_DIPLOCATION("SW3:!1")
r15082r15083
26422642
26432643   PORT_START("DSW")      // DSWA and DSWB
26442644   PORT_SERVICE_DIPLOC(0x0001, IP_ACTIVE_HIGH, "SW1:!1")
2645   PORT_DIPNAME( 0x0002,   0x0000, "Credits to Start" )   PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!2")
2646   PORT_DIPSETTING(      0x0000, "1" )               PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2647   PORT_DIPSETTING(      0x0002, "2" )               PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2648   PORT_DIPNAME( 0x0002,   0x0000, "Joystick Mode" )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)      PORT_DIPLOCATION("SW1:!2")
2649   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2650   PORT_DIPSETTING(      0x0002, "90 degrees ACW" )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2645   PORT_DIPNAME( 0x0002,   0x0000, "Credits to Start" )   PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!2")
2646   PORT_DIPSETTING(      0x0000, "1" )               PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2647   PORT_DIPSETTING(      0x0002, "2" )               PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2648   PORT_DIPNAME( 0x0002,   0x0000, "Joystick Mode" )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)      PORT_DIPLOCATION("SW1:!2")
2649   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2650   PORT_DIPSETTING(      0x0002, "90 degrees ACW" )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
26512651   PORT_DIPNAME( 0x001c,   0x0000, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:!3,!4,!5")
26522652   PORT_DIPSETTING(      0x0018, DEF_STR( 4C_1C ) )
26532653   PORT_DIPSETTING(      0x0014, DEF_STR( 3C_1C ) )
r15082r15083
26572657   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_3C ) )
26582658   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_4C ) )
26592659   PORT_DIPSETTING(      0x001c, DEF_STR( Free_Play ) )
2660   PORT_DIPNAME( 0x00e0,   0x0000, DEF_STR( Coin_B ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6,!7,!8")
2661   PORT_DIPSETTING(      0x00c0, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2662   PORT_DIPSETTING(      0x00a0, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2663   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2664   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2665//  PORT_DIPSETTING(        0x00e0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2666   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2667   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2668   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2660   PORT_DIPNAME( 0x00e0,   0x0000, DEF_STR( Coin_B ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6,!7,!8")
2661   PORT_DIPSETTING(      0x00c0, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2662   PORT_DIPSETTING(      0x00a0, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2663   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2664   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2665//  PORT_DIPSETTING(        0x00e0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2666   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2667   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2668   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
26692669   // When Coin_A is set to Free_Play, Coin_A becomes Coin_A and Coin_B, and the following dips occur
2670   PORT_DIPNAME( 0x0020,   0x0000, "Hit Score" )         PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6")
2671   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2672   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2673   PORT_DIPNAME( 0x0040,   0x0000, "Sound Effect" )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!7")
2674   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2675   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2676   PORT_DIPNAME( 0x0080,   0x0000, "Music" )            PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!8")
2677   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2678   PORT_DIPSETTING(      0x0080, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2670   PORT_DIPNAME( 0x0020,   0x0000, "Hit Score" )         PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6")
2671   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2672   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2673   PORT_DIPNAME( 0x0040,   0x0000, "Sound Effect" )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!7")
2674   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2675   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2676   PORT_DIPNAME( 0x0080,   0x0000, "Music" )            PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!8")
2677   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2678   PORT_DIPSETTING(      0x0080, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
26792679   PORT_DIPNAME( 0x0300,   0x0000, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:!1,!2")
26802680   PORT_DIPSETTING(      0x0100, DEF_STR( Easy ) )
26812681   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )
r15082r15083
27712771
27722772   PORT_START("DSW")      // DSWA and DSWB
27732773   PORT_SERVICE_DIPLOC(0x0001, IP_ACTIVE_HIGH, "SW1:!1")
2774   PORT_DIPNAME( 0x0002,   0x0000, "Credits to Start" )   PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!2")
2775   PORT_DIPSETTING(      0x0000, "1" )               PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2776   PORT_DIPSETTING(      0x0002, "2" )               PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2777   PORT_DIPNAME( 0x0002,   0x0000, "Joystick Mode" )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)      PORT_DIPLOCATION("SW1:!2")
2778   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2779   PORT_DIPSETTING(      0x0002, "90 degrees ACW" )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2774   PORT_DIPNAME( 0x0002,   0x0000, "Credits to Start" )   PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!2")
2775   PORT_DIPSETTING(      0x0000, "1" )               PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2776   PORT_DIPSETTING(      0x0002, "2" )               PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2777   PORT_DIPNAME( 0x0002,   0x0000, "Joystick Mode" )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)      PORT_DIPLOCATION("SW1:!2")
2778   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2779   PORT_DIPSETTING(      0x0002, "90 degrees ACW" )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
27802780   PORT_DIPNAME( 0x001c,   0x0000, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:!3,!4,!5")
27812781   PORT_DIPSETTING(      0x0018, DEF_STR( 4C_1C ) )
27822782   PORT_DIPSETTING(      0x0014, DEF_STR( 3C_1C ) )
r15082r15083
27862786   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_3C ) )
27872787   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_4C ) )
27882788   PORT_DIPSETTING(      0x001c, DEF_STR( Free_Play ) )
2789   PORT_DIPNAME( 0x00e0,   0x0000, DEF_STR( Coin_B ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6,!7,!8")
2790   PORT_DIPSETTING(      0x00c0, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2791   PORT_DIPSETTING(      0x00a0, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2792   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2793   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2794//  PORT_DIPSETTING(        0x00e0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2795   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2796   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2797   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
2789   PORT_DIPNAME( 0x00e0,   0x0000, DEF_STR( Coin_B ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6,!7,!8")
2790   PORT_DIPSETTING(      0x00c0, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2791   PORT_DIPSETTING(      0x00a0, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2792   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2793   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2794//  PORT_DIPSETTING(        0x00e0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2795   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2796   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
2797   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
27982798   // When Coin_A is set to Free_Play, Coin_A becomes Coin_A and Coin_B, and the following dips occur
2799   PORT_DIPNAME( 0x0020,   0x0000, "Hit Score" )         PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6")
2800   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2801   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2802   PORT_DIPNAME( 0x0040,   0x0000, "Sound Effect" )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!7")
2803   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2804   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2805   PORT_DIPNAME( 0x0080,   0x0000, "Music" )            PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!8")
2806   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2807   PORT_DIPSETTING(      0x0080, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
2799   PORT_DIPNAME( 0x0020,   0x0000, "Hit Score" )         PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!6")
2800   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2801   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2802   PORT_DIPNAME( 0x0040,   0x0000, "Sound Effect" )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!7")
2803   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2804   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2805   PORT_DIPNAME( 0x0080,   0x0000, "Music" )            PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)   PORT_DIPLOCATION("SW1:!8")
2806   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
2807   PORT_DIPSETTING(      0x0080, DEF_STR( On ) )         PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
28082808   PORT_DIPNAME( 0x0300,   0x0000, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:!1,!2")
28092809   PORT_DIPSETTING(      0x0100, DEF_STR( Easy ) )
28102810   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )
src/mame/drivers/cinemat.c
r15082r15083
7979
8080READ8_MEMBER(cinemat_state::inputs_r)
8181{
82   return (input_port_read(machine(), "INPUTS") >> offset) & 1;
82   return (ioport("INPUTS")->read() >> offset) & 1;
8383}
8484
8585
8686READ8_MEMBER(cinemat_state::switches_r)
8787{
8888   static const UINT8 switch_shuffle[8] = { 2,5,4,3,0,1,6,7 };
89   return (input_port_read(machine(), "SWITCHES") >> switch_shuffle[offset]) & 1;
89   return (ioport("SWITCHES")->read() >> switch_shuffle[offset]) & 1;
9090}
9191
9292
r15082r15083
149149   else
150150   {
151151      int xval = (INT16)(cpu_get_reg(device, CCPU_X) << 4) >> 4;
152      return (input_port_read_safe(device->machine(), state->m_mux_select ? "ANALOGX" : "ANALOGY", 0) - xval) < 0x800;
152      return (state->ioport(state->m_mux_select ? "ANALOGX" : "ANALOGY")->read_safe(0) - xval) < 0x800;
153153   }
154154}
155155
r15082r15083
167167   int delta_wheel;
168168
169169    /* the shift register is cleared once per 'frame' */
170    delta_wheel = (INT8)input_port_read(machine(), "WHEEL") / 8;
170    delta_wheel = (INT8)ioport("WHEEL")->read() / 8;
171171    if (delta_wheel > 3)
172172        delta_wheel = 3;
173173    else if (delta_wheel < -3)
r15082r15083
179179
180180READ8_MEMBER(cinemat_state::speedfrk_gear_r)
181181{
182   int gearval = input_port_read(machine(), "GEAR");
182   int gearval = ioport("GEAR")->read();
183183
184184   /* check the fake gear input port and determine the bit settings for the gear */
185185   if ((gearval & 0x0f) != 0x0f)
186186        m_gear = gearval & 0x0f;
187187
188188   /* add the start key into the mix -- note that it overlaps 4th gear */
189   if (!(input_port_read(machine(), "INPUTS") & 0x80))
189   if (!(ioport("INPUTS")->read() & 0x80))
190190        m_gear &= ~0x08;
191191
192192   return (m_gear >> offset) & 1;
r15082r15083
232232{
233233   /* handle special keys first */
234234   if (sundance_port_map[offset].portname)
235      return (input_port_read(machine(), sundance_port_map[offset].portname) & sundance_port_map[offset].bitmask) ? 0 : 1;
235      return (ioport(sundance_port_map[offset].portname)->read() & sundance_port_map[offset].bitmask) ? 0 : 1;
236236   else
237      return (input_port_read(machine(), "INPUTS") >> offset) & 1;
237      return (ioport("INPUTS")->read() >> offset) & 1;
238238}
239239
240240
r15082r15083
247247
248248READ8_MEMBER(cinemat_state::boxingb_dial_r)
249249{
250   int value = input_port_read(machine(), "DIAL");
250   int value = ioport("DIAL")->read();
251251   if (!m_mux_select) offset += 4;
252252   return (value >> offset) & 1;
253253}
src/mame/drivers/mjkjidai.c
r15082r15083
124124   {
125125      if (~m_keyb & (1 << i))
126126      {
127         res = input_port_read(machine(), keynames[i]) & 0x3f;
127         res = ioport(keynames[i])->read() & 0x3f;
128128         break;
129129      }
130130   }
131131
132   res |= (input_port_read(machine(), "IN3") & 0xc0);
132   res |= (ioport("IN3")->read() & 0xc0);
133133
134134   if (m_nvram_init_count)
135135   {
src/mame/drivers/wecleman.c
r15082r15083
371371{
372372   switch ( (m_selected_ip >> 5) & 3 )
373373   {                                                   // From WEC Le Mans Schems:
374      case 0:  return input_port_read(machine(), "ACCEL");      // Accel - Schems: Accelevr
374      case 0:  return ioport("ACCEL")->read();      // Accel - Schems: Accelevr
375375      case 1:  return ~0;                                    // ????? - Schems: Not Used
376      case 2:  return input_port_read(machine(), "STEER");      // Wheel - Schems: Handlevr
376      case 2:  return ioport("STEER")->read();      // Wheel - Schems: Handlevr
377377      case 3:  return ~0;                                    // Table - Schems: Turnvr
378378
379379      default: return ~0;
r15082r15083
12511251   wecleman_state *state = machine.driver_data<wecleman_state>();
12521252   int i, len;
12531253   UINT8 *RAM;
1254//  UINT16 *RAM1 = (UINT16 *) machine.root_device().memregion("maincpu")->base();   /* Main CPU patches */
1254//  UINT16 *RAM1 = (UINT16 *) state->memregion("maincpu")->base();   /* Main CPU patches */
12551255//  RAM1[0x08c2/2] = 0x601e;    // faster self test
12561256
12571257   /* Decode GFX Roms - Compensate for the address lines scrambling */
r15082r15083
12611261        I hope you'll appreciate this effort!  */
12621262
12631263   /* let's swap even and odd *pixels* of the sprites */
1264   RAM = machine.root_device().memregion("gfx1")->base();
1264   RAM = state->memregion("gfx1")->base();
12651265   len = state->memregion("gfx1")->bytes();
12661266   for (i = 0; i < len; i ++)
12671267   {
r15082r15083
13931393static DRIVER_INIT( hotchase )
13941394{
13951395   wecleman_state *state = machine.driver_data<wecleman_state>();
1396//  UINT16 *RAM1 = (UINT16) machine.root_device().memregion("maincpu")->base(); /* Main CPU patches */
1396//  UINT16 *RAM1 = (UINT16) state->memregion("maincpu")->base(); /* Main CPU patches */
13971397//  RAM[0x1140/2] = 0x0015; RAM[0x195c/2] = 0x601A; // faster self test
13981398
13991399   UINT8 *RAM;
r15082r15083
14011401   /* Decode GFX Roms */
14021402
14031403   /* Let's swap even and odd bytes of the sprites gfx roms */
1404   RAM = machine.root_device().memregion("gfx1")->base();
1404   RAM = state->memregion("gfx1")->base();
14051405
14061406   /* Now we can unpack each nibble of the sprites into a pixel (one byte) */
14071407   hotchase_sprite_decode(machine,3,0x80000*2);   // num banks, bank len
src/mame/drivers/kas89.c
r15082r15083
290290{
291291   switch(m_mux_data)
292292   {
293      case 0x01: return input_port_read(machine(), "PL1");
294      case 0x02: return input_port_read(machine(), "PL2");
295      case 0x04: return input_port_read(machine(), "PL3");
296      case 0x08: return input_port_read(machine(), "PL4");
297      case 0x10: return input_port_read(machine(), "PL5");
298      case 0x20: return input_port_read(machine(), "PL6");
293      case 0x01: return ioport("PL1")->read();
294      case 0x02: return ioport("PL2")->read();
295      case 0x04: return ioport("PL3")->read();
296      case 0x08: return ioport("PL4")->read();
297      case 0x10: return ioport("PL5")->read();
298      case 0x20: return ioport("PL6")->read();
299299      case 0x40:
300300      {
301         output_set_lamp_value(37, 1 - ((input_port_read(machine(), "SVC") >> 5) & 1));   /* Operator Key LAMP */
302         return input_port_read(machine(), "SVC");
301         output_set_lamp_value(37, 1 - ((ioport("SVC")->read() >> 5) & 1));   /* Operator Key LAMP */
302         return ioport("SVC")->read();
303303      }
304      case 0x80: return input_port_read(machine(), "DSW");   /* Polled at $162a through NMI routine */
305      case 0x3f: return input_port_read(machine(), "UNK");
304      case 0x80: return ioport("DSW")->read();   /* Polled at $162a through NMI routine */
305      case 0x3f: return ioport("UNK")->read();
306306   }
307307
308308   logerror("Mux_data %02X\n", m_mux_data);
src/mame/drivers/crbaloon.c
r15082r15083
7373
7474   /* enable coin & start input? Wild guess!!! */
7575   if (m_pc3092_data[1] & 0x02)
76      ret = input_port_read(machine(), "PC3092");
76      ret = ioport("PC3092")->read();
7777   else
7878      ret = 0x00;
7979
r15082r15083
143143
144144   if (LOG_PC3259) logerror("%04X:  read PC3259 #%d = 0x%02x\n", cpu_get_pc(&space.device()), reg, ret);
145145
146   return ret | (input_port_read(machine(), "DSW1") & 0xf0);
146   return ret | (ioport("DSW1")->read() & 0xf0);
147147}
148148
149149
src/mame/drivers/dmndrby.c
r15082r15083
9191{
9292   switch(offset & 7)
9393   {
94      case 0: return input_port_read(machine(), "IN0");
95      case 1: return input_port_read(machine(), "IN1");
96      case 2: return input_port_read(machine(), "IN2");
97      case 3: return input_port_read(machine(), "IN3");
98      case 4: return input_port_read(machine(), "IN4");
99      case 5: return input_port_read(machine(), "IN5");
100      case 6: return input_port_read(machine(), "IN6");
101      case 7: return input_port_read(machine(), "IN7");
94      case 0: return ioport("IN0")->read();
95      case 1: return ioport("IN1")->read();
96      case 2: return ioport("IN2")->read();
97      case 3: return ioport("IN3")->read();
98      case 4: return ioport("IN4")->read();
99      case 5: return ioport("IN5")->read();
100      case 6: return ioport("IN6")->read();
101      case 7: return ioport("IN7")->read();
102102   }
103103
104104   return 0xff;
r15082r15083
209209   PORT_DIPSETTING(    0x04, "480p (cash + tokens)" )
210210   PORT_DIPSETTING(    0x00, "600p (cash + tokens)" )
211211   PORT_DIPNAME( 0x30, 0x00, "Percentage Payout" )
212   PORT_DIPSETTING(    0x00, "76%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
213   PORT_DIPSETTING(    0x10, "80%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
214   PORT_DIPSETTING(    0x20, "86%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
215   PORT_DIPSETTING(    0x30, "88%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
216   PORT_DIPSETTING(    0x00, "78%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
217   PORT_DIPSETTING(    0x10, "82%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
218   PORT_DIPSETTING(    0x20, "86%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
219   PORT_DIPSETTING(    0x30, "90%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
212   PORT_DIPSETTING(    0x00, "76%" )   PORT_CONDITION("DSW1", 0xc0, LESSTHAN, 0x80)
213   PORT_DIPSETTING(    0x10, "80%" )   PORT_CONDITION("DSW1", 0xc0, LESSTHAN, 0x80)
214   PORT_DIPSETTING(    0x20, "86%" )   PORT_CONDITION("DSW1", 0xc0, LESSTHAN, 0x80)
215   PORT_DIPSETTING(    0x30, "88%" )   PORT_CONDITION("DSW1", 0xc0, LESSTHAN, 0x80)
216   PORT_DIPSETTING(    0x00, "78%" )   PORT_CONDITION("DSW1", 0xc0, NOTLESSTHAN, 0x80)
217   PORT_DIPSETTING(    0x10, "82%" )   PORT_CONDITION("DSW1", 0xc0, NOTLESSTHAN, 0x80)
218   PORT_DIPSETTING(    0x20, "86%" )   PORT_CONDITION("DSW1", 0xc0, NOTLESSTHAN, 0x80)
219   PORT_DIPSETTING(    0x30, "90%" )   PORT_CONDITION("DSW1", 0xc0, NOTLESSTHAN, 0x80)
220220   PORT_DIPNAME( 0xc0, 0x80, "Price Per Game" )
221221   PORT_DIPSETTING(    0x00, "2p" )
222222   PORT_DIPSETTING(    0x40, "5p" )
src/mame/drivers/funkybee.c
r15082r15083
8080READ8_MEMBER(funkybee_state::funkybee_input_port_0_r)
8181{
8282   watchdog_reset_r(space, 0);
83   return input_port_read(machine(), "IN0");
83   return ioport("IN0")->read();
8484}
8585
8686WRITE8_MEMBER(funkybee_state::funkybee_coin_counter_w)
src/mame/drivers/voyager.c
r15082r15083
532532   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)
533533   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
534534   PORT_START("IOCARD3")
535   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_VBLANK )
535   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
536536   PORT_BIT( 0xdfff, IP_ACTIVE_LOW, IPT_UNUSED )
537537
538538   PORT_START("IOCARD4")
src/mame/drivers/cmmb.c
r15082r15083
125125   //printf("%02x R\n",offset);
126126   switch(offset)
127127   {
128      case 0x00: return input_port_read(machine(), "IN2");
128      case 0x00: return ioport("IN2")->read();
129129      case 0x03: return 4; //eeprom?
130      case 0x0e: return input_port_read(machine(), "IN0");
131      case 0x0f: return input_port_read(machine(), "IN1");
130      case 0x0e: return ioport("IN0")->read();
131      case 0x0f: return ioport("IN1")->read();
132132   }
133133
134134   return 0xff;
src/mame/drivers/starfire.c
r15082r15083
102102{
103103   switch (offset & 15)
104104   {
105      case 0:   return input_port_read(machine(), "DSW");
106      case 1:   return input_port_read(machine(), "SYSTEM");   /* Note: need to loopback sounds lengths on that one */
107      case 5: return input_port_read(machine(), "STICKZ");
108      case 6:   return input_port_read(machine(), "STICKX");
109      case 7:   return input_port_read(machine(), "STICKY");
105      case 0:   return ioport("DSW")->read();
106      case 1:   return ioport("SYSTEM")->read();   /* Note: need to loopback sounds lengths on that one */
107      case 5: return ioport("STICKZ")->read();
108      case 6:   return ioport("STICKX")->read();
109      case 7:   return ioport("STICKY")->read();
110110      default: return 0xff;
111111   }
112112}
r15082r15083
130130
131131   switch (offset & 15)
132132   {
133      case 0:   return input_port_read(machine(), "DSW");
134      case 1:   return input_port_read(machine(), "SYSTEM");
133      case 0:   return ioport("DSW")->read();
134      case 1:   return ioport("SYSTEM")->read();
135135      case 2:
136         temp = m_fireone_select ? input_port_read(machine(), "P1") : input_port_read(machine(), "P2");
136         temp = m_fireone_select ? ioport("P1")->read() : ioport("P2")->read();
137137         temp = (temp & 0xc0) | fireone_paddle_map[temp & 0x3f];
138138         return temp;
139139      default: return 0xff;
src/mame/drivers/boxer.c
r15082r15083
8181
8282      memset(mask, 0, sizeof mask);
8383
84      mask[input_port_read(machine, "STICK0_X")] |= 0x01;
85      mask[input_port_read(machine, "STICK0_Y")] |= 0x02;
86      mask[input_port_read(machine, "PADDLE0")]  |= 0x04;
87      mask[input_port_read(machine, "STICK1_X")] |= 0x08;
88      mask[input_port_read(machine, "STICK1_Y")] |= 0x10;
89      mask[input_port_read(machine, "PADDLE1")]  |= 0x20;
84      mask[state->ioport("STICK0_X")->read()] |= 0x01;
85      mask[state->ioport("STICK0_Y")->read()] |= 0x02;
86      mask[state->ioport("PADDLE0")->read()]  |= 0x04;
87      mask[state->ioport("STICK1_X")->read()] |= 0x08;
88      mask[state->ioport("STICK1_Y")->read()] |= 0x10;
89      mask[state->ioport("PADDLE1")->read()]  |= 0x20;
9090
9191      for (i = 1; i < 256; i++)
9292         if (mask[i] != 0)
r15082r15083
203203
204204READ8_MEMBER(boxer_state::boxer_input_r)
205205{
206   UINT8 val = input_port_read(machine(), "IN0");
206   UINT8 val = ioport("IN0")->read();
207207
208   if (input_port_read(machine(), "IN3") < machine().primary_screen->vpos())
208   if (ioport("IN3")->read() < machine().primary_screen->vpos())
209209      val |= 0x02;
210210
211211   return (val << ((offset & 7) ^ 7)) & 0x80;
r15082r15083
227227      break;
228228
229229   case 2:
230      val = input_port_read(machine(), "IN1");
230      val = ioport("IN1")->read();
231231      break;
232232
233233   case 3:
234      val = input_port_read(machine(), "IN2");
234      val = ioport("IN2")->read();
235235      break;
236236   }
237237
src/mame/drivers/cischeat.c
r15082r15083
429429
430430READ16_MEMBER(cischeat_state::scudhamm_analog_r)
431431{
432   int i=input_port_read(machine(), "IN1"),j;
432   int i=ioport("IN1")->read(),j;
433433
434434   if ((i^m_prev)&0x4000) {
435435      if (i<m_prev) m_prev-=0x8000;
r15082r15083
527527{
528528   int armdelta;
529529
530   armdelta = input_port_read(machine(), "IN1") - m_armold;
531   m_armold = input_port_read(machine(), "IN1");
530   armdelta = ioport("IN1")->read() - m_armold;
531   m_armold = ioport("IN1")->read();
532532
533533   return ~( m_scudhamm_motor_command + armdelta );   // + x : x<=0 and player loses, x>0 and player wins
534534}
535535
536536READ16_MEMBER(cischeat_state::armchmp2_buttons_r)
537537{
538   int arm_x = input_port_read(machine(), "IN1");
538   int arm_x = ioport("IN1")->read();
539539
540   UINT16 ret = input_port_read(machine(), "IN0");
540   UINT16 ret = ioport("IN0")->read();
541541
542542   if (arm_x < 0x40)      ret &= ~1;
543543   else if (arm_x > 0xc0)   ret &= ~2;
r15082r15083
844844   // DSW 3
845845   PORT_DIPNAME( 0x0003, 0x0003, "Extra Setting For Coin B" ) PORT_DIPLOCATION("SW302:8,7")   /* 'Not used' (and must be OFF) according to the manual */
846846   PORT_DIPSETTING(      0x0003, DEF_STR( Unused ) )
847   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_5C ) )   PORT_CONDITION("IN4", 0x1c00, PORTCOND_NOTEQUALS, 0x0000)
848   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_6C ) )   PORT_CONDITION("IN4", 0x1c00, PORTCOND_NOTEQUALS, 0x0000)
849   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_7C ) )   PORT_CONDITION("IN4", 0x1c00, PORTCOND_NOTEQUALS, 0x0000)
850   PORT_DIPSETTING(      0x0001, DEF_STR( Unused ) )   PORT_CONDITION("IN4", 0x1c00, PORTCOND_EQUALS, 0x0000)
851   PORT_DIPSETTING(      0x0002, DEF_STR( Unused ) )   PORT_CONDITION("IN4", 0x1c00, PORTCOND_EQUALS, 0x0000)
852   PORT_DIPSETTING(      0x0000, DEF_STR( Unused ) )   PORT_CONDITION("IN4", 0x1c00, PORTCOND_EQUALS, 0x0000)
847   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_5C ) )   PORT_CONDITION("IN4", 0x1c00, NOTEQUALS, 0x0000)
848   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_6C ) )   PORT_CONDITION("IN4", 0x1c00, NOTEQUALS, 0x0000)
849   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_7C ) )   PORT_CONDITION("IN4", 0x1c00, NOTEQUALS, 0x0000)
850   PORT_DIPSETTING(      0x0001, DEF_STR( Unused ) )   PORT_CONDITION("IN4", 0x1c00, EQUALS, 0x0000)
851   PORT_DIPSETTING(      0x0002, DEF_STR( Unused ) )   PORT_CONDITION("IN4", 0x1c00, EQUALS, 0x0000)
852   PORT_DIPSETTING(      0x0000, DEF_STR( Unused ) )   PORT_CONDITION("IN4", 0x1c00, EQUALS, 0x0000)
853853   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW302:6")
854854   PORT_DIPSETTING(      0x0004, DEF_STR( No )  )
855855   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
r15082r15083
875875   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW301:7")
876876   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
877877   PORT_DIPSETTING(      0x0200, DEF_STR( On ) )
878   PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW301:6,5,4") PORT_CONDITION("IN4", 0x0003, PORTCOND_EQUALS, 0x0003)
878   PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW301:6,5,4") PORT_CONDITION("IN4", 0x0003, EQUALS, 0x0003)
879879   PORT_DIPSETTING(      0x1000, DEF_STR( 4C_1C ) )
880880   PORT_DIPSETTING(      0x0800, DEF_STR( 3C_1C ) )
881881   PORT_DIPSETTING(      0x1800, DEF_STR( 2C_1C ) )
r15082r15083
884884   PORT_DIPSETTING(      0x1400, DEF_STR( 1C_3C ) )
885885   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
886886   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
887   PORT_DIPNAME( 0x1c00, 0x1c00, "Set Coin B" ) PORT_DIPLOCATION("SW301:6,5,4") PORT_CONDITION("IN4", 0x0003, PORTCOND_NOTEQUALS, 0x0003)
887   PORT_DIPNAME( 0x1c00, 0x1c00, "Set Coin B" ) PORT_DIPLOCATION("SW301:6,5,4") PORT_CONDITION("IN4", 0x0003, NOTEQUALS, 0x0003)
888888   PORT_DIPSETTING(      0x1c00, DEF_STR( Unused ) )
889889   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
890890   PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW301:3,2,1")
r15082r15083
10511051   PORT_START("IN1")   // DSW 1 & 2 - $80000.w -> !f9012
10521052   // DSW 1
10531053   // Coinage Japan & USA (it changes with Country)
1054   PORT_DIPNAME( 0x0007, 0x0007, "Coin A (JP US)" ) PORT_DIPLOCATION("SW01:1,2,3") PORT_CONDITION("IN1", 0x0300, PORTCOND_GREATERTHAN, 0x0100)
1054   PORT_DIPNAME( 0x0007, 0x0007, "Coin A (JP US)" ) PORT_DIPLOCATION("SW01:1,2,3") PORT_CONDITION("IN1", 0x0300, GREATERTHAN, 0x0100)
10551055   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
10561056   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
10571057   PORT_DIPSETTING(      0x0003, DEF_STR( 2C_1C ) )
r15082r15083
10601060   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
10611061   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
10621062   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
1063   PORT_DIPNAME( 0x0038, 0x0038, "Coin B (JP US)" ) PORT_DIPLOCATION("SW01:4,5,6") PORT_CONDITION("IN1", 0x0300, PORTCOND_GREATERTHAN, 0x0100)
1063   PORT_DIPNAME( 0x0038, 0x0038, "Coin B (JP US)" ) PORT_DIPLOCATION("SW01:4,5,6") PORT_CONDITION("IN1", 0x0300, GREATERTHAN, 0x0100)
10641064   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_1C ) )
10651065   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
10661066   PORT_DIPSETTING(      0x0018, DEF_STR( 2C_1C ) )
r15082r15083
10681068   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
10691069   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
10701070   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
1071   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW01:7") PORT_CONDITION("IN1", 0x0300, PORTCOND_GREATERTHAN, 0x0100)   // unused?
1071   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW01:7") PORT_CONDITION("IN1", 0x0300, GREATERTHAN, 0x0100)   // unused?
10721072   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
10731073   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
10741074   // Coinage Europe & France (it changes with Country)
1075   PORT_DIPNAME( 0x0007, 0x0007, "Coin A (EU FR)" ) PORT_DIPLOCATION("SW01:1,2,3") PORT_CONDITION("IN1", 0x0300, PORTCOND_NOTGREATERTHAN, 0x0100)
1075   PORT_DIPNAME( 0x0007, 0x0007, "Coin A (EU FR)" ) PORT_DIPLOCATION("SW01:1,2,3") PORT_CONDITION("IN1", 0x0300, NOTGREATERTHAN, 0x0100)
10761076   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
10771077   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
10781078   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
r15082r15083
10811081   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_5C ) )
10821082   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_6C ) )
10831083   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_7C ) )
1084   PORT_DIPNAME( 0x0038, 0x0038, "Coin B (EU FR)" ) PORT_DIPLOCATION("SW01:4,5,6") PORT_CONDITION("IN1", 0x0300, PORTCOND_NOTGREATERTHAN, 0x0100)
1084   PORT_DIPNAME( 0x0038, 0x0038, "Coin B (EU FR)" ) PORT_DIPLOCATION("SW01:4,5,6") PORT_CONDITION("IN1", 0x0300, NOTGREATERTHAN, 0x0100)
10851085   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
10861086   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_1C ) )
10871087   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
r15082r15083
10901090   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
10911091   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
10921092   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
1093   PORT_DIPNAME( 0x0040, 0x0040, "Free Play (EU & FR)" ) PORT_DIPLOCATION("SW01:7") PORT_CONDITION("IN1", 0x0300, PORTCOND_NOTGREATERTHAN, 0x0100)
1093   PORT_DIPNAME( 0x0040, 0x0040, "Free Play (EU & FR)" ) PORT_DIPLOCATION("SW01:7") PORT_CONDITION("IN1", 0x0300, NOTGREATERTHAN, 0x0100)
10941094   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
10951095   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
10961096
r15082r15083
11131113   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW02:6")
11141114   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
11151115   PORT_DIPSETTING(      0x2000, DEF_STR( On ) )
1116   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW02:7") PORT_CONDITION("IN1", 0x0300, PORTCOND_EQUALS, 0x0300)   // unused?
1116   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW02:7") PORT_CONDITION("IN1", 0x0300, EQUALS, 0x0300)   // unused?
11171117   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
11181118   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1119   PORT_DIPNAME( 0x4000, 0x4000, "Choose Race (US EU FR)" ) PORT_DIPLOCATION("SW02:7") PORT_CONDITION("IN1", 0x0300, PORTCOND_NOTEQUALS, 0x0300)   // -> f0020
1119   PORT_DIPNAME( 0x4000, 0x4000, "Choose Race (US EU FR)" ) PORT_DIPLOCATION("SW02:7") PORT_CONDITION("IN1", 0x0300, NOTEQUALS, 0x0300)   // -> f0020
11201120   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
11211121   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
11221122   PORT_DIPNAME( 0x8000, 0x8000, "Vibrations" ) PORT_DIPLOCATION("SW02:8")
src/mame/drivers/freekick.c
r15082r15083
6363
6464READ8_MEMBER(freekick_state::spinner_r)
6565{
66   return input_port_read(machine(), m_spinner ? "IN3" : "IN2");
66   return ioport(m_spinner ? "IN3" : "IN2")->read();
6767}
6868
6969WRITE8_MEMBER(freekick_state::pbillrd_bankswitch_w)
src/mame/drivers/redclash.c
r15082r15083
109109   /* Note that there are TWO VBlank inputs, one is active low, the other active */
110110   /* high. There are probably other differencies in the hardware, but emulating */
111111   /* them this way is enough to get the game running. */
112   PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
112   PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
113113
114114   PORT_START("DSW1")
115115   PORT_DIPNAME( 0x03, 0x03, "Difficulty?" )
r15082r15083
202202   /* Note that there are TWO VBlank inputs, one is active low, the other active */
203203   /* high. There are probably other differencies in the hardware, but emulating */
204204   /* them this way is enough to get the game running. */
205   PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
205   PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
206206
207207   PORT_START("DSW1")
208208   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW1:8" )   /* Switches 6-8 are not used */
src/mame/drivers/vicdual.c
r15082r15083
170170
171171int vicdual_is_cabinet_color(running_machine &machine)
172172{
173   return (input_port_read(machine, COLOR_BW_PORT_TAG) == 0);
173   return (machine.root_device().ioport(COLOR_BW_PORT_TAG)->read() == 0);
174174}
175175
176176
r15082r15083
233233{
234234   UINT8 ret = 0;
235235
236   if (offset & 0x01)  ret = input_port_read(machine(), "IN0");
237   if (offset & 0x08)  ret = input_port_read(machine(), "IN1");
236   if (offset & 0x01)  ret = ioport("IN0")->read();
237   if (offset & 0x08)  ret = ioport("IN1")->read();
238238
239239   return ret;
240240}
r15082r15083
315315{
316316   UINT8 ret = 0;
317317
318   if (offset & 0x01)  ret = input_port_read(machine(), "IN0");
319   if (offset & 0x08)  ret = input_port_read(machine(), "IN1");
318   if (offset & 0x01)  ret = ioport("IN0")->read();
319   if (offset & 0x08)  ret = ioport("IN1")->read();
320320
321321   return ret;
322322}
r15082r15083
399399{
400400   UINT8 ret = 0;
401401
402   if (offset & 0x01)  ret = input_port_read(machine(), "IN0");
403   if (offset & 0x08)  ret = input_port_read(machine(), "IN1");
402   if (offset & 0x01)  ret = ioport("IN0")->read();
403   if (offset & 0x08)  ret = ioport("IN1")->read();
404404
405405   return ret;
406406}
r15082r15083
507507{
508508   UINT8 ret = 0;
509509
510   if (offset & 0x01)  ret = input_port_read(machine(), "IN0");
511   if (offset & 0x08)  ret = input_port_read(machine(), "IN1");
510   if (offset & 0x01)  ret = ioport("IN0")->read();
511   if (offset & 0x08)  ret = ioport("IN1")->read();
512512
513513   return ret;
514514}
r15082r15083
518518{
519519   UINT8 ret = 0;
520520
521   if (offset & 0x01)  ret = input_port_read(machine(), "IN0");
522   if (offset & 0x04)  ret = input_port_read(machine(), "IN1");
523   if (offset & 0x08)  ret = input_port_read(machine(), "IN2");
521   if (offset & 0x01)  ret = ioport("IN0")->read();
522   if (offset & 0x04)  ret = ioport("IN1")->read();
523   if (offset & 0x08)  ret = ioport("IN2")->read();
524524
525525   return ret;
526526}
r15082r15083
717717{
718718   UINT8 ret = 0;
719719
720   if (offset & 0x01)  ret = input_port_read(machine(), "IN0");
720   if (offset & 0x01)  ret = ioport("IN0")->read();
721721   if (offset & 0x02)  /* schematics show this as in input port, but never read from */
722   if (offset & 0x04)  ret = input_port_read(machine(), "IN1");
723   if (offset & 0x08)  ret = input_port_read(machine(), "IN2");
722   if (offset & 0x04)  ret = ioport("IN1")->read();
723   if (offset & 0x08)  ret = ioport("IN2")->read();
724724   if (offset & 0x12)  logerror("********* Read from port %x\n", offset);
725725
726726   return ret;
r15082r15083
16281628CUSTOM_INPUT_MEMBER(vicdual_state::brdrline_lives)
16291629{
16301630   int bit_mask = (FPTR)param;
1631   return (input_port_read(machine(), "FAKE_LIVES") & bit_mask) ? 0x00 : 0x01;
1631   return (ioport("FAKE_LIVES")->read() & bit_mask) ? 0x00 : 0x01;
16321632}
16331633
16341634static INPUT_PORTS_START( brdrline )
r15082r15083
21672167{
21682168   UINT8 ret = 0;
21692169
2170   if (offset & 0x01)  ret = input_port_read(machine(), "IN0");
2171   if (offset & 0x08)  ret = input_port_read(machine(), "IN1");
2170   if (offset & 0x01)  ret = ioport("IN0")->read();
2171   if (offset & 0x08)  ret = ioport("IN1")->read();
21722172
21732173   return ret;
21742174}
r15082r15083
22622262{
22632263   UINT8 ret = 0;
22642264
2265   if (offset & 0x01)  ret = input_port_read(machine(), "IN0");
2266   if (offset & 0x02)  ret = input_port_read(machine(), "IN1");
2267   if (offset & 0x08)  ret = input_port_read(machine(), "IN2");
2265   if (offset & 0x01)  ret = ioport("IN0")->read();
2266   if (offset & 0x02)  ret = ioport("IN1")->read();
2267   if (offset & 0x08)  ret = ioport("IN2")->read();
22682268
22692269   return ret;
22702270}
src/mame/drivers/xybots.c
r15082r15083
6666
6767READ16_MEMBER(xybots_state::special_port1_r)
6868{
69   int result = input_port_read(machine(), "FFE200");
69   int result = ioport("FFE200")->read();
7070
7171   if (m_cpu_to_sound_ready) result ^= 0x0200;
7272   result ^= m_h256 ^= 0x0400;
r15082r15083
135135   PORT_SERVICE( 0x0100, IP_ACTIVE_LOW )
136136   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED )   /* /AUDBUSY */
137137   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )   /* 256H */
138   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK )   /* VBLANK */
138   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")   /* VBLANK */
139139   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
140140
141141   PORT_INCLUDE( atarijsa_i )      /* audio port */
src/mame/drivers/magicfly.c
r15082r15083
561561{
562562   switch( m_input_selector )
563563   {
564      case 0x01: return input_port_read(machine(), "IN0-0");
565      case 0x02: return input_port_read(machine(), "IN0-1");
566      case 0x04: return input_port_read(machine(), "IN0-2");
567      case 0x08: return input_port_read(machine(), "IN0-3");
568      case 0x00: return input_port_read(machine(), "DSW0");
564      case 0x01: return ioport("IN0-0")->read();
565      case 0x02: return ioport("IN0-1")->read();
566      case 0x04: return ioport("IN0-2")->read();
567      case 0x08: return ioport("IN0-3")->read();
568      case 0x00: return ioport("DSW0")->read();
569569   }
570570   return 0xff;
571571}
src/mame/drivers/centiped.c
r15082r15083
528528
529529   /* if we're to read the dipswitches behind the trackball data, do it now */
530530   if (state->m_dsw_select)
531      return (input_port_read(machine, portnames[switch_port]) & 0x7f) | state->m_sign[idx];
531      return (machine.root_device().ioport(portnames[switch_port])->read() & 0x7f) | state->m_sign[idx];
532532
533533   /* get the new position and adjust the result */
534   newpos = input_port_read(machine, tracknames[idx]);
534   newpos = machine.root_device().ioport(tracknames[idx])->read();
535535   if (newpos != state->m_oldpos[idx])
536536   {
537537      state->m_sign[idx] = (newpos - state->m_oldpos[idx]) & 0x80;
r15082r15083
539539   }
540540
541541   /* blend with the bits from the switch port */
542   return (input_port_read(machine, portnames[switch_port]) & 0x70) | (state->m_oldpos[idx] & 0x0f) | state->m_sign[idx];
542   return (machine.root_device().ioport(portnames[switch_port])->read() & 0x70) | (state->m_oldpos[idx] & 0x0f) | state->m_sign[idx];
543543}
544544
545545
r15082r15083
562562
563563READ8_MEMBER(centiped_state::milliped_IN2_r)
564564{
565   UINT8 data = input_port_read(machine(), "IN2");
565   UINT8 data = ioport("IN2")->read();
566566
567567   /* MSH - 15 Feb, 2007
568568     * The P2 X Joystick inputs are not properly handled in
r15082r15083
573573     */
574574   if (0 != m_control_select) {
575575      /* Bottom 4 bits is our joystick inputs */
576      UINT8 joy2data = input_port_read(machine(), "IN3") & 0x0f;
576      UINT8 joy2data = ioport("IN3")->read() & 0x0f;
577577      data = data & 0xf0; /* Keep the top 4 bits */
578578      data |= (joy2data & 0x0a) >> 1; /* flip left and up */
579579      data |= (joy2data & 0x05) << 1; /* flip right and down */
r15082r15083
599599{
600600   static const char *const sticknames[] = { "STICK0", "STICK1", "STICK2", "STICK3" };
601601
602   return input_port_read(machine(), sticknames[m_control_select]);
602   return ioport(sticknames[m_control_select])->read();
603603}
604604
605605
r15082r15083
879879   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
880880   PORT_DIPSETTING(    0x10, DEF_STR( Cocktail ) )
881881   PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
882   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
882   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
883883   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* trackball sign bit */
884884
885885   PORT_START("IN1")
r15082r15083
11151115   PORT_DIPSETTING(   0x0c, "0 1x 2x 3x" )
11161116   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
11171117   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
1118   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
1118   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
11191119   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )      /* trackball sign bit */
11201120
11211121   PORT_START("IN1")   /* $2001 */ /* see port 7 for y trackball */
r15082r15083
12241224   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
12251225   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
12261226   PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
1227   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
1227   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
12281228   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
12291229   PORT_DIPSETTING(    0x80, "Upright (overlay)" )
12301230   PORT_DIPSETTING(    0x00, "Cocktail (no overlay)" )
r15082r15083
13071307   PORT_DIPNAME( 0x40, 0x00, "Minimum credits" )      PORT_DIPLOCATION("SW0:!7")
13081308   PORT_DIPSETTING(    0x00, "1" )
13091309   PORT_DIPSETTING(    0x40, "2" )
1310   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1310   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
13111311
13121312   PORT_START("IN1")
13131313   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
13961396   PORT_START("IN0")
13971397   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* trackball data */
13981398   PORT_BIT( 0x30, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1399   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
1399   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
14001400   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* trackball sign bit */
14011401
14021402   PORT_START("IN1")
src/mame/drivers/wgp.c
r15082r15083
533533READ16_MEMBER(wgp_state::wgp_adinput_r)
534534{
535535   int steer = 0x40;
536   int fake = input_port_read_safe(machine(), FAKE_PORT_TAG, 0x00);
536   int fake = ioport(FAKE_PORT_TAG)->read_safe(0x00);
537537
538538   if (!(fake & 0x10))   /* Analogue steer (the real control method) */
539539   {
540540      /* Reduce span to 0x80 */
541      steer = (input_port_read_safe(machine(), STEER_PORT_TAG, 0x00) * 0x80) / 0x100;
541      steer = (ioport(STEER_PORT_TAG)->read_safe(0x00) * 0x80) / 0x100;
542542   }
543543   else   /* Digital steer */
544544   {
r15082r15083
583583      }
584584
585585      case 0x05:
586         return input_port_read_safe(machine(), UNKNOWN_PORT_TAG, 0x00);   /* unknown */
586         return ioport(UNKNOWN_PORT_TAG)->read_safe(0x00);   /* unknown */
587587   }
588588
589589logerror("CPU #0 PC %06x: warning - read unmapped a/d input offset %06x\n",cpu_get_pc(&space.device()),offset);
src/mame/drivers/scregg.c
r15082r15083
142142   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
143143   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
144144   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
145   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
145   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM  ) PORT_VBLANK("screen")
146146
147147   PORT_START("DSW2")
148148   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
src/mame/drivers/taitoair.c
r15082r15083
341341   switch( offset )
342342   {
343343      case 0x00:   /* "counter 1" lo */
344         return input_port_read(machine(), STICK1_PORT_TAG);
344         return ioport(STICK1_PORT_TAG)->read();
345345
346346      case 0x01:   /* "counter 2" lo */
347         return input_port_read(machine(), STICK2_PORT_TAG);
347         return ioport(STICK2_PORT_TAG)->read();
348348
349349      case 0x02:   /* "counter 1" hi */
350         if(input_port_read(machine(), STICK1_PORT_TAG) & 0x80)
350         if(ioport(STICK1_PORT_TAG)->read() & 0x80)
351351            return 0xff;
352352
353353         return 0;
354354
355355      case 0x03:   /* "counter 2" hi */
356         return (input_port_read(machine(), STICK2_PORT_TAG) & 0xff00) >> 8;
356         return (ioport(STICK2_PORT_TAG)->read() & 0xff00) >> 8;
357357   }
358358
359359   return 0;
r15082r15083
364364   switch( offset )
365365   {
366366      case 0x00:   /* "counter 3" lo */
367         return input_port_read(machine(), STICK3_PORT_TAG);
367         return ioport(STICK3_PORT_TAG)->read();
368368
369369      case 0x02:   /* "counter 3" hi */
370         return (input_port_read(machine(), STICK3_PORT_TAG) & 0xff00) >> 8;
370         return (ioport(STICK3_PORT_TAG)->read() & 0xff00) >> 8;
371371   }
372372
373373   return 0;
src/mame/drivers/tceptor.c
r15082r15083
131131
132132READ8_MEMBER(tceptor_state::dsw0_r)
133133{
134   return fix_input0(input_port_read(machine(), "DSW1"), input_port_read(machine(), "DSW2"));
134   return fix_input0(ioport("DSW1")->read(), ioport("DSW2")->read());
135135}
136136
137137READ8_MEMBER(tceptor_state::dsw1_r)
138138{
139   return fix_input1(input_port_read(machine(), "DSW1"), input_port_read(machine(), "DSW2"));
139   return fix_input1(ioport("DSW1")->read(), ioport("DSW2")->read());
140140}
141141
142142READ8_MEMBER(tceptor_state::input0_r)
143143{
144   return fix_input0(input_port_read(machine(), "BUTTONS"), input_port_read(machine(), "SERVICE"));
144   return fix_input0(ioport("BUTTONS")->read(), ioport("SERVICE")->read());
145145}
146146
147147READ8_MEMBER(tceptor_state::input1_r)
148148{
149   return fix_input1(input_port_read(machine(), "BUTTONS"), input_port_read(machine(), "SERVICE"));
149   return fix_input1(ioport("BUTTONS")->read(), ioport("SERVICE")->read());
150150}
151151
152152READ8_MEMBER(tceptor_state::readFF)
src/mame/drivers/aquarium.c
r15082r15083
4646{
4747
4848   int data;
49   data = (input_port_read(machine(), "SYSTEM") & 0x7fff);
49   data = (ioport("SYSTEM")->read() & 0x7fff);
5050   data |= m_aquarium_snd_ack;
5151   m_aquarium_snd_ack = 0;
5252
src/mame/drivers/metro.c
r15082r15083
839839/* Really weird way of mapping 3 DSWs */
840840READ16_MEMBER(metro_state::balcube_dsw_r)
841841{
842   UINT16 dsw1 = input_port_read(machine(), "DSW0") >> 0;
843   UINT16 dsw2 = input_port_read(machine(), "DSW0") >> 8;
844   UINT16 dsw3 = input_port_read(machine(), "IN2");
842   UINT16 dsw1 = ioport("DSW0")->read() >> 0;
843   UINT16 dsw2 = ioport("DSW0")->read() >> 8;
844   UINT16 dsw3 = ioport("IN2")->read();
845845
846846   switch (offset * 2)
847847   {
r15082r15083
12931293{
12941294   UINT16 input_sel = (*m_input_sel) ^ 0x3e;
12951295   // Bit 0 ??
1296   if (input_sel & 0x0002)   return input_port_read(machine(), "KEY0");
1297   if (input_sel & 0x0004)   return input_port_read(machine(), "KEY1");
1298   if (input_sel & 0x0008)   return input_port_read(machine(), "KEY2");
1299   if (input_sel & 0x0010)   return input_port_read(machine(), "KEY3");
1300   if (input_sel & 0x0020)   return input_port_read(machine(), "KEY4");
1296   if (input_sel & 0x0002)   return ioport("KEY0")->read();
1297   if (input_sel & 0x0004)   return ioport("KEY1")->read();
1298   if (input_sel & 0x0008)   return ioport("KEY2")->read();
1299   if (input_sel & 0x0010)   return ioport("KEY3")->read();
1300   if (input_sel & 0x0020)   return ioport("KEY4")->read();
13011301   return 0xffff;
13021302}
13031303
r15082r15083
59955995{
59965996   metro_state *state = machine.driver_data<metro_state>();
59975997
5998   const size_t len = machine.root_device().memregion("gfx1")->bytes();
5998   const size_t len = state->memregion("gfx1")->bytes();
59995999   UINT8 *src       = state->memregion("gfx1")->base();
60006000   UINT8 *end       = src + len;
60016001
src/mame/drivers/angelkds.c
r15082r15083
160160   static const char *const portnames[] = { "I81", "I82" };
161161   static const char *const fakenames[] = { "FAKE1", "FAKE2" };
162162
163   fake = input_port_read(machine(), fakenames[offset]);
163   fake = ioport(fakenames[offset])->read();
164164
165   return ((fake & 0x01) ? fake  : input_port_read(machine(), portnames[offset]));
165   return ((fake & 0x01) ? fake  : ioport(portnames[offset])->read());
166166}
167167
168168#else
r15082r15083
171171{
172172   static const char *const portnames[] = { "I81", "I82" };
173173
174   return input_port_read(machine(), portnames[offset]);
174   return ioport(portnames[offset])->read();
175175}
176176
177177#endif
src/mame/drivers/nightgal.c
r15082r15083
420420static READ8_DEVICE_HANDLER( input_1p_r )
421421{
422422   nightgal_state *state = device->machine().driver_data<nightgal_state>();
423   UINT8 cr_clear = input_port_read(device->machine(), "CR_CLEAR");
423   UINT8 cr_clear = state->ioport("CR_CLEAR")->read();
424424
425425   switch (state->m_mux_data)
426426   {
427      case 0x01: return input_port_read(device->machine(), "PL1_1") | cr_clear;
428      case 0x02: return input_port_read(device->machine(), "PL1_2") | cr_clear;
429      case 0x04: return input_port_read(device->machine(), "PL1_3") | cr_clear;
430      case 0x08: return input_port_read(device->machine(), "PL1_4") | cr_clear;
431      case 0x10: return input_port_read(device->machine(), "PL1_5") | cr_clear;
432      case 0x20: return input_port_read(device->machine(), "PL1_6") | cr_clear;
427      case 0x01: return state->ioport("PL1_1")->read() | cr_clear;
428      case 0x02: return state->ioport("PL1_2")->read() | cr_clear;
429      case 0x04: return state->ioport("PL1_3")->read() | cr_clear;
430      case 0x08: return state->ioport("PL1_4")->read() | cr_clear;
431      case 0x10: return state->ioport("PL1_5")->read() | cr_clear;
432      case 0x20: return state->ioport("PL1_6")->read() | cr_clear;
433433   }
434434   //printf("%04x\n", state->m_mux_data);
435435
436   return (input_port_read(device->machine(), "PL1_1") & input_port_read(device->machine(), "PL1_2") & input_port_read(device->machine(), "PL1_3") &
437          input_port_read(device->machine(), "PL1_4") & input_port_read(device->machine(), "PL1_5") & input_port_read(device->machine(), "PL1_6")) | cr_clear;
436   return (state->ioport("PL1_1")->read() & state->ioport("PL1_2")->read() & state->ioport("PL1_3")->read() &
437          state->ioport("PL1_4")->read() & state->ioport("PL1_5")->read() & state->ioport("PL1_6")->read()) | cr_clear;
438438}
439439
440440static READ8_DEVICE_HANDLER( input_2p_r )
441441{
442442   nightgal_state *state = device->machine().driver_data<nightgal_state>();
443   UINT8 coin_port = input_port_read(device->machine(), "COINS");
443   UINT8 coin_port = state->ioport("COINS")->read();
444444
445445   switch (state->m_mux_data)
446446   {
447      case 0x01: return input_port_read(device->machine(), "PL2_1") | coin_port;
448      case 0x02: return input_port_read(device->machine(), "PL2_2") | coin_port;
449      case 0x04: return input_port_read(device->machine(), "PL2_3") | coin_port;
450      case 0x08: return input_port_read(device->machine(), "PL2_4") | coin_port;
451      case 0x10: return input_port_read(device->machine(), "PL2_5") | coin_port;
452      case 0x20: return input_port_read(device->machine(), "PL2_6") | coin_port;
447      case 0x01: return state->ioport("PL2_1")->read() | coin_port;
448      case 0x02: return state->ioport("PL2_2")->read() | coin_port;
449      case 0x04: return state->ioport("PL2_3")->read() | coin_port;
450      case 0x08: return state->ioport("PL2_4")->read() | coin_port;
451      case 0x10: return state->ioport("PL2_5")->read() | coin_port;
452      case 0x20: return state->ioport("PL2_6")->read() | coin_port;
453453   }
454454   //printf("%04x\n", state->m_mux_data);
455455
456   return (input_port_read(device->machine(), "PL2_1") & input_port_read(device->machine(), "PL2_2") & input_port_read(device->machine(), "PL2_3") &
457          input_port_read(device->machine(), "PL2_4") & input_port_read(device->machine(), "PL2_5") & input_port_read(device->machine(), "PL2_6")) | coin_port;
456   return (state->ioport("PL2_1")->read() & state->ioport("PL2_2")->read() & state->ioport("PL2_3")->read() &
457          state->ioport("PL2_4")->read() & state->ioport("PL2_5")->read() & state->ioport("PL2_6")->read()) | coin_port;
458458}
459459
460460/********************************************
src/mame/drivers/maygayv1.c
r15082r15083
532532         case 0x40:
533533            addr = i8279.command & 0x07;
534534
535            result = input_port_read(machine(), portnames[addr]);
535            result = ioport(portnames[addr])->read();
536536
537537            /* handle autoincrement */
538538            if (i8279.command & 0x10)
r15082r15083
730730      case 1:
731731      {
732732         if ( !BIT(m_p3, 4) )
733            return (input_port_read(machine(), "REEL"));   // Reels???
733            return (ioport("REEL")->read());   // Reels???
734734         else
735735            return 0;
736736      }
src/mame/drivers/zaccaria.c
r15082r15083
7575{
7676   static const char *const dswnames[] = { "IN0", "DSW0", "DSW1" };
7777
78   return input_port_read(machine(), dswnames[m_dsw]);
78   return ioport(dswnames[m_dsw])->read();
7979}
8080
8181
r15082r15083
228228   switch (offset)
229229   {
230230      case 0:
231         return input_port_read(machine(), "COINS");   /* bits 4 and 5 must be 0 in Jack Rabbit */
231         return ioport("COINS")->read();   /* bits 4 and 5 must be 0 in Jack Rabbit */
232232
233233      case 2:
234234         return 0x10;    /* Jack Rabbit */
src/mame/drivers/attckufo.c
r15082r15083
104104{
105105   switch(offset)
106106   {
107      case 0: return input_port_read(machine(), "DSW");
108      case 2: return input_port_read(machine(), "INPUT");
107      case 0: return ioport("DSW")->read();
108      case 2: return ioport("INPUT")->read();
109109   }
110110   return 0xff;
111111}
src/mame/drivers/jongkyo.c
r15082r15083
144144static READ8_DEVICE_HANDLER( input_1p_r )
145145{
146146   jongkyo_state *state = device->machine().driver_data<jongkyo_state>();
147   UINT8 cr_clear = input_port_read(device->machine(), "CR_CLEAR");
147   UINT8 cr_clear = state->ioport("CR_CLEAR")->read();
148148
149149   switch (state->m_mux_data)
150150   {
151      case 0x01: return input_port_read(device->machine(), "PL1_1") | cr_clear;
152      case 0x02: return input_port_read(device->machine(), "PL1_2") | cr_clear;
153      case 0x04: return input_port_read(device->machine(), "PL1_3") | cr_clear;
154      case 0x08: return input_port_read(device->machine(), "PL1_4") | cr_clear;
155      case 0x10: return input_port_read(device->machine(), "PL1_5") | cr_clear;
156      case 0x20: return input_port_read(device->machine(), "PL1_6") | cr_clear;
151      case 0x01: return state->ioport("PL1_1")->read() | cr_clear;
152      case 0x02: return state->ioport("PL1_2")->read() | cr_clear;
153      case 0x04: return state->ioport("PL1_3")->read() | cr_clear;
154      case 0x08: return state->ioport("PL1_4")->read() | cr_clear;
155      case 0x10: return state->ioport("PL1_5")->read() | cr_clear;
156      case 0x20: return state->ioport("PL1_6")->read() | cr_clear;
157157   }
158158   //  printf("%04x\n", state->m_mux_data);
159159
160   return (input_port_read(device->machine(), "PL1_1") & input_port_read(device->machine(), "PL1_2") & input_port_read(device->machine(), "PL1_3") &
161          input_port_read(device->machine(), "PL1_4") & input_port_read(device->machine(), "PL1_5") & input_port_read(device->machine(), "PL1_6")) | cr_clear;
160   return (state->ioport("PL1_1")->read() & state->ioport("PL1_2")->read() & state->ioport("PL1_3")->read() &
161          state->ioport("PL1_4")->read() & state->ioport("PL1_5")->read() & state->ioport("PL1_6")->read()) | cr_clear;
162162}
163163
164164static READ8_DEVICE_HANDLER( input_2p_r )
165165{
166166   jongkyo_state *state = device->machine().driver_data<jongkyo_state>();
167   UINT8 coin_port = input_port_read(device->machine(), "COINS");
167   UINT8 coin_port = state->ioport("COINS")->read();
168168
169169   switch (state->m_mux_data)
170170   {
171      case 0x01: return input_port_read(device->machine(), "PL2_1") | coin_port;
172      case 0x02: return input_port_read(device->machine(), "PL2_2") | coin_port;
173      case 0x04: return input_port_read(device->machine(), "PL2_3") | coin_port;
174      case 0x08: return input_port_read(device->machine(), "PL2_4") | coin_port;
175      case 0x10: return input_port_read(device->machine(), "PL2_5") | coin_port;
176      case 0x20: return input_port_read(device->machine(), "PL2_6") | coin_port;
171      case 0x01: return state->ioport("PL2_1")->read() | coin_port;
172      case 0x02: return state->ioport("PL2_2")->read() | coin_port;
173      case 0x04: return state->ioport("PL2_3")->read() | coin_port;
174      case 0x08: return state->ioport("PL2_4")->read() | coin_port;
175      case 0x10: return state->ioport("PL2_5")->read() | coin_port;
176      case 0x20: return state->ioport("PL2_6")->read() | coin_port;
177177   }
178178   //  printf("%04x\n", state->m_mux_data);
179179
180   return (input_port_read(device->machine(), "PL2_1") & input_port_read(device->machine(), "PL2_2") & input_port_read(device->machine(), "PL2_3") &
181          input_port_read(device->machine(), "PL2_4") & input_port_read(device->machine(), "PL2_5") & input_port_read(device->machine(), "PL2_6")) | coin_port;
180   return (state->ioport("PL2_1")->read() & state->ioport("PL2_2")->read() & state->ioport("PL2_3")->read() &
181          state->ioport("PL2_4")->read() & state->ioport("PL2_5")->read() & state->ioport("PL2_6")->read()) | coin_port;
182182}
183183
184184WRITE8_MEMBER(jongkyo_state::videoram2_w)
src/mame/drivers/tagteam.c
r15082r15083
118118   PORT_DIPSETTING(    0x40, "Upright, Dual Controls" )
119119//  PORT_DIPSETTING(    0x20, "Cocktail, Single Controls" ) // IMPOSSIBLE !
120120   PORT_DIPSETTING(    0x60, DEF_STR( Cocktail ) )      // "Cocktail, Dual Controls"
121   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
121   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM  ) PORT_VBLANK("screen")
122122
123123   PORT_START("DSW2")
124124   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:1")
r15082r15083
144144   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
145145   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
146146   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
147   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW2", 0xe0, PORTCOND_NOTEQUALS, 0x80)   //Mode 1
148   PORT_DIPSETTING(    0x01, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW2", 0xe0, PORTCOND_EQUALS, 0x80)   //Mode 2
147   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW2", 0xe0, NOTEQUALS, 0x80)   //Mode 1
148   PORT_DIPSETTING(    0x01, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW2", 0xe0, EQUALS, 0x80)   //Mode 2
149149   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:3,4")
150150   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
151151   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
152152   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
153   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW2", 0xe0, PORTCOND_NOTEQUALS, 0x80)   //Mode 1
154   PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW2", 0xe0, PORTCOND_EQUALS, 0x80)   //Mode 2
153   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW2", 0xe0, NOTEQUALS, 0x80)   //Mode 1
154   PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW2", 0xe0, EQUALS, 0x80)   //Mode 2
155155
156156   PORT_MODIFY("DSW2")
157157   PORT_DIPNAME( 0xe0, 0x00, "Coin Mode" )         PORT_DIPLOCATION("SW2:6,7,8")
src/mame/drivers/eolith.c
r15082r15083
112112    */
113113   eolith_speedup_read(&space);
114114
115   return (input_port_read(machine(), "IN0") & ~0x300) | (machine().rand() & 0x300);
115   return (ioport("IN0")->read() & ~0x300) | (machine().rand() & 0x300);
116116}
117117
118118WRITE32_MEMBER(eolith_state::systemcontrol_w)
r15082r15083
121121   coin_counter_w(machine(), 0, data & m_coin_counter_bit);
122122   set_led_status(machine(), 0, data & 1);
123123
124   input_port_write(machine(), "EEPROMOUT", data, 0xff);
124   ioport("EEPROMOUT")->write(data, 0xff);
125125
126126   // bit 0x100 and 0x040 ?
127127}
r15082r15083
129129READ32_MEMBER(eolith_state::hidctch3_pen1_r)
130130{
131131   //320 x 240
132   int xpos = input_port_read(machine(), "PEN_X_P1");
133   int ypos = input_port_read(machine(), "PEN_Y_P1");
132   int xpos = ioport("PEN_X_P1")->read();
133   int ypos = ioport("PEN_Y_P1")->read();
134134
135135   return xpos + (ypos*168*2);
136136}
r15082r15083
138138READ32_MEMBER(eolith_state::hidctch3_pen2_r)
139139{
140140   //320 x 240
141   int xpos = input_port_read(machine(), "PEN_X_P2");
142   int ypos = input_port_read(machine(), "PEN_Y_P2");
141   int xpos = ioport("PEN_X_P2")->read();
142   int ypos = ioport("PEN_Y_P2")->read();
143143
144144   return xpos + (ypos*168*2);
145145}
src/mame/drivers/namcos23.c
r15082r15083
17051705
17061706   case 2: case 3:
17071707      // These may be coming from another CPU, in particular the I/O one
1708      m_ctl_inp_buffer[offset-2] = input_port_read(machine(), offset == 2 ? "P1" : "P2");
1708      m_ctl_inp_buffer[offset-2] = ioport(offset == 2 ? "P1" : "P2")->read();
17091709      break;
17101710   case 5:
17111711      if(m_ctl_vbl_active) {
r15082r15083
17281728{
17291729   switch(offset) {
17301730      // 0100 set freezes gorgon (polygon fifo flag)
1731   case 1: return 0x0000 | input_port_read(machine(), "DSW");
1731   case 1: return 0x0000 | ioport("DSW")->read();
17321732   case 2: case 3: {
17331733      UINT16 res = m_ctl_inp_buffer[offset-2] & 0x800 ? 0xffff : 0x0000;
17341734      m_ctl_inp_buffer[offset-2] = (m_ctl_inp_buffer[offset-2] << 1) | 1;
r15082r15083
29922992
29932993READ8_MEMBER(namcos23_state::s23_gun_r)
29942994{
2995   UINT16 xpos = input_port_read_safe(machine(), "LIGHTX", 0) * 640 / 0xff + 0x80;
2996   UINT16 ypos = input_port_read_safe(machine(), "LIGHTY", 0) * 240 / 0xff + 0x20;
2995   UINT16 xpos = ioport("LIGHTX")->read_safe(0) * 640 / 0xff + 0x80;
2996   UINT16 ypos = ioport("LIGHTY")->read_safe(0) * 240 / 0xff + 0x20;
29972997
29982998   // note: will need angle adjustments for accurate aiming at screen sides
29992999   switch(offset)
r15082r15083
30703070{
30713071   namcos23_state *state = machine.driver_data<namcos23_state>();
30723072   render_t &render = state->m_render;
3073   state->m_ptrom  = (const UINT32 *)machine.root_device().memregion("pointrom")->base();
3074   state->m_tmlrom = (const UINT16 *)machine.root_device().memregion("textilemapl")->base();
3075   state->m_tmhrom = machine.root_device().memregion("textilemaph")->base();
3076   state->m_texrom = machine.root_device().memregion("textile")->base();
3073   state->m_ptrom  = (const UINT32 *)state->memregion("pointrom")->base();
3074   state->m_tmlrom = (const UINT16 *)state->memregion("textilemapl")->base();
3075   state->m_tmhrom = state->memregion("textilemaph")->base();
3076   state->m_texrom = state->memregion("textile")->base();
30773077
3078   state->m_tileid_mask = (machine.root_device().memregion("textilemapl")->bytes()/2 - 1) & ~0xff; // Used for y masking
3079   state->m_tile_mask = machine.root_device().memregion("textile")->bytes()/256 - 1;
3078   state->m_tileid_mask = (state->memregion("textilemapl")->bytes()/2 - 1) & ~0xff; // Used for y masking
3079   state->m_tile_mask = state->memregion("textile")->bytes()/256 - 1;
30803080   state->m_ptrom_limit = state->memregion("pointrom")->bytes()/4;
30813081
30823082   state->m_mi_rd = state->m_mi_wr = state->m_im_rd = state->m_im_wr = 0;
src/mame/drivers/atarisy2.c
r15082r15083
360360
361361READ16_MEMBER(atarisy2_state::switch_r)
362362{
363   int result = input_port_read(machine(), "1800") | (input_port_read(machine(), "1801") << 8);
363   int result = ioport("1800")->read() | (ioport("1801")->read() << 8);
364364
365365   if (m_cpu_to_sound_ready) result ^= 0x20;
366366   if (m_sound_to_cpu_ready) result ^= 0x10;
r15082r15083
371371
372372READ8_MEMBER(atarisy2_state::switch_6502_r)
373373{
374   int result = input_port_read(machine(), "1840");
374   int result = ioport("1840")->read();
375375
376376   if (m_cpu_to_sound_ready) result |= 0x01;
377377   if (m_sound_to_cpu_ready) result |= 0x02;
378378   if ((m_has_tms5220) && (tms5220_readyq_r(machine().device("tms")) == 0))
379379      result &= ~0x04;
380   if (!(input_port_read(machine(), "1801") & 0x80)) result |= 0x10;
380   if (!(ioport("1801")->read() & 0x80)) result |= 0x10;
381381
382382   return result;
383383}
r15082r15083
412412   static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
413413
414414   if (m_which_adc < m_pedal_count)
415      return ~input_port_read(machine(), adcnames[m_which_adc]);
415      return ~ioport(adcnames[m_which_adc])->read();
416416
417   return input_port_read(machine(), adcnames[m_which_adc]) | 0xff00;
417   return ioport(adcnames[m_which_adc])->read() | 0xff00;
418418}
419419
420420
r15082r15083
424424
425425    if (offset <= 1 && m_pedal_count == -1)   /* 720 */
426426   {
427      switch (input_port_read(machine(), "SELECT"))
427      switch (ioport("SELECT")->read())
428428      {
429429         case 0:   /* Real */
430430            break;
r15082r15083
432432         case 1:   /* Fake Joystick */
433433         /* special thanks to MAME Analog+ for the mapping code */
434434         {
435            int analogx = input_port_read(machine(), "FAKE_JOY_X") - 128;
436            int analogy = input_port_read(machine(), "FAKE_JOY_Y") - 128;
435            int analogx = ioport("FAKE_JOY_X")->read() - 128;
436            int analogy = ioport("FAKE_JOY_Y")->read() - 128;
437437            double angle;
438438
439439            /* if the joystick is centered, leave the rest of this alone */
r15082r15083
472472         {
473473            INT32  diff;
474474            UINT32 temp;
475            UINT32 rotate_count = input_port_read(machine(), "FAKE_SPINNER") & 0xffff;
475            UINT32 rotate_count = ioport("FAKE_SPINNER")->read() & 0xffff;
476476            /* rotate_count behaves the same as the real LEAT1 Rotate encoder
477477                 * we use it to generate the LETA0 Center encoder count
478478                 */
r15082r15083
550550            return 0xff;
551551      }
552552   }
553   return input_port_read(machine(), letanames[offset]);
553   return ioport(letanames[offset])->read();
554554}
555555
556556
r15082r15083
962962   /* Center disc */
963963   /* X1, X2 LETA inputs */
964964   PORT_MODIFY("LETA0")   /* not direct mapped */
965   PORT_BIT( 0xff, 0x00, IPT_DIAL_V ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("Center") PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
965   PORT_BIT( 0xff, 0x00, IPT_DIAL_V ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("Center") PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
966966
967967   /* Rotate disc */
968968   /* Y1, Y2 LETA inputs */
969969   /* The disc has 72 teeth which are read by the hardware at 2x */
970970   /* Computer hardware reads at 4x, so we set the sensitivity to 50% */
971971   PORT_MODIFY("LETA1")   /* not direct mapped */
972   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)
972   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)
973973
974974   PORT_START("FAKE_JOY_X")   /* not direct mapped */
975   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
975   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
976976
977977   PORT_START("FAKE_JOY_Y")   /* not direct mapped */
978   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
978   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
979979
980980   /* Let's assume we are using a 1200 count spinner.  We scale to get a 144 count.
981981     * 144/1200 = 0.12 = 12% */
982982   PORT_START("FAKE_SPINNER")   /* not direct mapped */
983   PORT_BIT( 0xffff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
983   PORT_BIT( 0xffff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
984984
985985   PORT_START("SELECT")
986986    PORT_CONFNAME( 0x03, 0x02, "Controller Type" )
src/mame/drivers/skydiver.c
r15082r15083
309309   PORT_START("IN12")
310310   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
311311   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
312   PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_VBLANK )
312   PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
313313
314314   PORT_START("IN13")
315315   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/ninjakd2.c
r15082r15083
228228{
229229   ninjakd2_state *state = device.machine().driver_data<ninjakd2_state>();
230230   running_machine &machine = device.machine();
231   const UINT8* const rom = machine.root_device().memregion("pcm")->base();
231   const UINT8* const rom = state->memregion("pcm")->base();
232232   const int length = state->memregion("pcm")->bytes();
233233   INT16* sampledata = auto_alloc_array(machine, INT16, length);
234234
r15082r15083
350350      case 1:   // dip switches
351351         switch (offset)
352352         {
353            case 0: result = input_port_read(machine(), "DIPSW1"); break;
354            case 1: result = input_port_read(machine(), "DIPSW2"); break;
353            case 0: result = ioport("DIPSW1")->read(); break;
354            case 1: result = ioport("DIPSW2")->read(); break;
355355            case 2: result = 0x02;                         break;
356356         }
357357         break;
r15082r15083
359359      case 2:   // player inputs
360360         switch (offset)
361361         {
362            case 0: result = input_port_read(machine(), "PAD1"); break;
363            case 1: result = input_port_read(machine(), "PAD2"); break;
362            case 0: result = ioport("PAD1")->read(); break;
363            case 1: result = ioport("PAD2")->read(); break;
364364            case 2: result = 0x01;                       break;
365365         }
366366         break;
r15082r15083
615615   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
616616   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
617617   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:5,4")
618   PORT_DIPSETTING(    0x00, "2 Coins/1 Credit, 6/4" )       PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
619   PORT_DIPSETTING(    0x18, "1 Coin/1 Credit, 3/4" )        PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
620   PORT_DIPSETTING(    0x10, "1 Coin/2 Credits, 2/6, 3/10" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
621   PORT_DIPSETTING(    0x08, "1 Coin/3 Credits, 3/12" )      PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
622   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
623   PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
624   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
625   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
618   PORT_DIPSETTING(    0x00, "2 Coins/1 Credit, 6/4" )       PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
619   PORT_DIPSETTING(    0x18, "1 Coin/1 Credit, 3/4" )        PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
620   PORT_DIPSETTING(    0x10, "1 Coin/2 Credits, 2/6, 3/10" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
621   PORT_DIPSETTING(    0x08, "1 Coin/3 Credits, 3/12" )      PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
622   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
623   PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
624   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
625   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
626626   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1")
627   PORT_DIPSETTING(    0x00, "5 Coins/1 Credit, 15/4" )      PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
628   PORT_DIPSETTING(    0x20, "4 Coins/1 Credit, 12/4" )      PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
629   PORT_DIPSETTING(    0x40, "3 Coins/1 Credit, 9/4" )       PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
630   PORT_DIPSETTING(    0x60, "2 Coins/1 Credit, 6/4" )       PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
631   PORT_DIPSETTING(    0xe0, "1 Coin/1 Credit, 3/4" )        PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
632   PORT_DIPSETTING(    0xc0, "1 Coin/2 Credits, 2/6, 3/10" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
633   PORT_DIPSETTING(    0xa0, "1 Coin/3 Credits, 3/12" )      PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
634   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
635   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
636   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
637   PORT_DIPSETTING(    0x40, DEF_STR( 3C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
638   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
639   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
640   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
641   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
642   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )              PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
627   PORT_DIPSETTING(    0x00, "5 Coins/1 Credit, 15/4" )      PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
628   PORT_DIPSETTING(    0x20, "4 Coins/1 Credit, 12/4" )      PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
629   PORT_DIPSETTING(    0x40, "3 Coins/1 Credit, 9/4" )       PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
630   PORT_DIPSETTING(    0x60, "2 Coins/1 Credit, 6/4" )       PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
631   PORT_DIPSETTING(    0xe0, "1 Coin/1 Credit, 3/4" )        PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
632   PORT_DIPSETTING(    0xc0, "1 Coin/2 Credits, 2/6, 3/10" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
633   PORT_DIPSETTING(    0xa0, "1 Coin/3 Credits, 3/12" )      PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
634   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )              PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
635   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
636   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
637   PORT_DIPSETTING(    0x40, DEF_STR( 3C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
638   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
639   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
640   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
641   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
642   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )              PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
643643INPUT_PORTS_END
644644
645645static INPUT_PORTS_START( rdaction )
src/mame/drivers/mjsister.c
r15082r15083
266266   for (i = 0; i < 6; i++)
267267   {
268268      if (BIT(p, i))
269         ret |= input_port_read(machine(), keynames[i]);
269         ret |= ioport(keynames[i])->read();
270270   }
271271
272272   return ret;
r15082r15083
449449static MACHINE_START( mjsister )
450450{
451451   mjsister_state *state = machine.driver_data<mjsister_state>();
452   UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
452   UINT8 *ROM = state->memregion("maincpu")->base();
453453
454454   state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x8000);
455455
src/mame/drivers/yunsung8.c
r15082r15083
466466static MACHINE_START( yunsung8 )
467467{
468468   yunsung8_state *state = machine.driver_data<yunsung8_state>();
469   UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
470   UINT8 *AUDIO = machine.root_device().memregion("audiocpu")->base();
469   UINT8 *MAIN = state->memregion("maincpu")->base();
470   UINT8 *AUDIO = state->memregion("audiocpu")->base();
471471
472472   state->m_videoram_0 = state->m_videoram + 0x0000;   // Ram is banked
473473   state->m_videoram_1 = state->m_videoram + 0x2000;
src/mame/drivers/spacefb.c
r15082r15083
461461   ROM_LOAD( "tst-c-a.5n",      0x3800, 0x0800, CRC(1a798fbf) SHA1(65ff2fe91c2037378314c4a68b2bd21fd167c64a) )
462462
463463   ROM_REGION( 0x1000, "audiocpu", 0 )
464    ROM_LOAD( "ic20.snd",    0x0000, 0x0400, BAD_DUMP CRC(1c8670b3) SHA1(609124caa11498fc6a6bdf6cdbb8003bbc249dd8) ) // not dumped from this board yet, rom taken from parent
464    ROM_LOAD( "tst-e-20.bin",    0x0000, 0x0400, CRC(f7a59492) SHA1(22bdc02c72086c38acd9d9675da54ce6ba3f80a3) )
465465
466466   ROM_REGION( 0x1000, "gfx1", 0 )  /* sprites */
467467   ROM_LOAD( "tst-v-a.5k",      0x0000, 0x0800, CRC(236e1ff7) SHA1(575b8ed9ab054a864207e0fde3ae93cdcafbebf2) )
468468   ROM_LOAD( "tst-v-a.6k",      0x0800, 0x0800, CRC(bf901a4e) SHA1(71207ad1ca60aa617dbbc3cd2e4e42520b7c8513) )
469469
470470   ROM_REGION( 0x0100, "gfx2", 0 )  /* bullets */
471   ROM_LOAD( "4i.vid",      0x0000, 0x0100, BAD_DUMP CRC(528e8533) SHA1(8e41eee1016c98a4f08acbd902daf8e32aa9d9ab) ) // not dumped from this board yet, rom taken from parent
471   ROM_LOAD( "mb7052-a.4i",     0x0000, 0x0100, CRC(528e8533) SHA1(8e41eee1016c98a4f08acbd902daf8e32aa9d9ab) )
472472
473473   ROM_REGION( 0x0020, "proms", 0 )
474   ROM_LOAD( "mb7051.3n",   0x0000, 0x0020, BAD_DUMP CRC(465d07af) SHA1(25e246f7674c25d05e5f6e68db88c15aaa10cee1) ) // not dumped from this board yet, rom taken from parent
474   ROM_LOAD( "mb7051-a.3n",     0x0000, 0x0020, CRC(465d07af) SHA1(25e246f7674c25d05e5f6e68db88c15aaa10cee1) )
475475ROM_END
476476
477477
src/mame/drivers/warpwarp.c
r15082r15083
155155   static const char *const portnames[] = { "SW0", "SW1", "DSW2", "PLACEHOLDER" };   // "IN1" & "IN2" are read separately when offset==3
156156
157157   offset &= 3;
158   res = input_port_read_safe(machine(), portnames[offset], 0);
158   res = ioport(portnames[offset])->read_safe(0);
159159   if (offset == 3)
160160   {
161      res = input_port_read(machine(), (flip_screen() & 1) ? "IN2" : "IN1");   // read player 2 input in cocktail mode
161      res = ioport((flip_screen() & 1) ? "IN2" : "IN1")->read();   // read player 2 input in cocktail mode
162162      if (m_handle_joystick)
163163      {
164164         /* map digital two-way joystick to two fixed VOLIN values */
r15082r15083
231231/* Read Switch Inputs */
232232READ8_MEMBER(warpwarp_state::warpwarp_sw_r)
233233{
234   return (input_port_read(machine(), "IN0") >> (offset & 7)) & 1;
234   return (ioport("IN0")->read() >> (offset & 7)) & 1;
235235}
236236
237237/* Read Dipswitches */
238238static READ8_DEVICE_HANDLER( warpwarp_dsw1_r )
239239{
240   return (input_port_read(device->machine(), "DSW1") >> (offset & 7)) & 1;
240   return (device->machine().root_device().ioport("DSW1")->read() >> (offset & 7)) & 1;
241241}
242242
243243/* Read mux Controller Inputs */
r15082r15083
246246   warpwarp_state *state = device->machine().driver_data<warpwarp_state>();
247247   int res;
248248
249   res = input_port_read(device->machine(), (state->flip_screen() & 1) ? "VOLIN2" : "VOLIN1");
249   res = state->ioport((state->flip_screen() & 1) ? "VOLIN2" : "VOLIN1")->read();
250250   if (state->m_handle_joystick)
251251   {
252252      if (res & 1) return 0x0f;
r15082r15083
379379   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
380380   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
381381   PORT_DIPNAME( 0x30, 0x10, "Replay" )      PORT_DIPLOCATION("DSW2:5,6")   // awards 1 credit
382   PORT_DIPSETTING(    0x10, "40k 80k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
383   PORT_DIPSETTING(    0x20, "70k 140k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
384   PORT_DIPSETTING(    0x30, "100k 200k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
385   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
386   PORT_DIPSETTING(    0x10, "60k 120k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
387   PORT_DIPSETTING(    0x20, "100k 200k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
388   PORT_DIPSETTING(    0x30, "150k 300k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
389   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
382   PORT_DIPSETTING(    0x10, "40k 80k" )      PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
383   PORT_DIPSETTING(    0x20, "70k 140k" )      PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
384   PORT_DIPSETTING(    0x30, "100k 200k" )      PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
385   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
386   PORT_DIPSETTING(    0x10, "60k 120k" )      PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
387   PORT_DIPSETTING(    0x20, "100k 200k" )      PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
388   PORT_DIPSETTING(    0x30, "150k 300k" )      PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
389   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
390390   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
391391
392392   PORT_START("IN1")
r15082r15083
401401
402402   PORT_MODIFY("DSW2")
403403   PORT_DIPNAME( 0x30, 0x10, "Replay" )      // awards 1 credit
404   PORT_DIPSETTING(    0x10, "40k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
405   PORT_DIPSETTING(    0x20, "70k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
406   PORT_DIPSETTING(    0x30, "100k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
407   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
408   PORT_DIPSETTING(    0x10, "60k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
409   PORT_DIPSETTING(    0x20, "100k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
410   PORT_DIPSETTING(    0x30, "150k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
411   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
404   PORT_DIPSETTING(    0x10, "40k" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
405   PORT_DIPSETTING(    0x20, "70k" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
406   PORT_DIPSETTING(    0x30, "100k" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
407   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
408   PORT_DIPSETTING(    0x10, "60k" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
409   PORT_DIPSETTING(    0x20, "100k" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
410   PORT_DIPSETTING(    0x30, "150k" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
411   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
412412INPUT_PORTS_END
413413
414414static INPUT_PORTS_START( navarone )
r15082r15083
432432   PORT_DIPSETTING(    0x00, "2" )
433433   PORT_DIPSETTING(    0x02, "3" )
434434   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("DSW2:3,4")
435   PORT_DIPSETTING(    0x04, "5000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
436   PORT_DIPSETTING(    0x08, "6000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
437   PORT_DIPSETTING(    0x0c, "7000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
438   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
439   PORT_DIPSETTING(    0x04, "6000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
440   PORT_DIPSETTING(    0x08, "7000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
441   PORT_DIPSETTING(    0x0c, "8000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
442   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
435   PORT_DIPSETTING(    0x04, "5000" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
436   PORT_DIPSETTING(    0x08, "6000" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
437   PORT_DIPSETTING(    0x0c, "7000" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
438   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
439   PORT_DIPSETTING(    0x04, "6000" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
440   PORT_DIPSETTING(    0x08, "7000" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
441   PORT_DIPSETTING(    0x0c, "8000" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
442   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
443443   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) )      PORT_DIPLOCATION("DSW2:5,6")
444444   PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
445445   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )
r15082r15083
661661   PORT_DIPSETTING(    0x08, "4" )
662662   PORT_DIPSETTING(    0x0c, "5" )
663663   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("DSW1:5,6")
664   PORT_DIPSETTING(    0x00, "8k 30k 30k+" )   PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
665   PORT_DIPSETTING(    0x10, "10k 40k 40k+" )   PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
666   PORT_DIPSETTING(    0x20, "15k 60k 60k+" )   PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
667   PORT_DIPSETTING(0x30, DEF_STR( None ) )   PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
668   PORT_DIPSETTING(    0x00, "30k" )         PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
669   PORT_DIPSETTING(    0x10, "40k" )         PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
670   PORT_DIPSETTING(    0x20, "60k" )         PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
671   PORT_DIPSETTING(    0x30, DEF_STR( None ) )   PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
664   PORT_DIPSETTING(    0x00, "8k 30k 30k+" )   PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
665   PORT_DIPSETTING(    0x10, "10k 40k 40k+" )   PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
666   PORT_DIPSETTING(    0x20, "15k 60k 60k+" )   PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
667   PORT_DIPSETTING(0x30, DEF_STR( None ) )   PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
668   PORT_DIPSETTING(    0x00, "30k" )         PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
669   PORT_DIPSETTING(    0x10, "40k" )         PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
670   PORT_DIPSETTING(    0x20, "60k" )         PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
671   PORT_DIPSETTING(    0x30, DEF_STR( None ) )   PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
672672   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("DSW1:7")
673673   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
674674   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/jaguar.c
r15082r15083
555555   joystick_data = 0xffffffff;
556556   eeprom_bit_count = 0;
557557   blitter_status = 1;
558   if ((using_cart) && (input_port_read(machine, "CONFIG") & 2))
558   if ((using_cart) && (machine.root_device().ioport("CONFIG")->read() & 2))
559559   {
560560      cart_base[0x102] = 1;
561561      using_cart = 0;
r15082r15083
825825   {
826826      if ((joystick_data & (0x10000 << i)) == 0)
827827      {
828         joystick_result &= input_port_read(machine(), keynames[0][i]);
829         joybuts_result &= input_port_read(machine(), keynames[1][i]);
828         joystick_result &= ioport(keynames[0][i])->read();
829         joybuts_result &= ioport(keynames[1][i])->read();
830830      }
831831   }
832832
833833   joystick_result |= machine().device<eeprom_device>("eeprom")->read_bit();
834   joybuts_result |= (input_port_read(machine(), "CONFIG") & 0x10);
834   joybuts_result |= (ioport("CONFIG")->read() & 0x10);
835835
836836   return (joystick_result << 16) | joybuts_result;
837837}
src/mame/drivers/onetwo.c
r15082r15083
215215   PORT_DIPSETTING(    0x08, DEF_STR( Normal ) )
216216   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
217217   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
218   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_EQUALS,0x04) PORT_DIPLOCATION("SW1:5,6,7,8")
218   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2",0x04,EQUALS,0x04) PORT_DIPLOCATION("SW1:5,6,7,8")
219219   PORT_DIPSETTING(    0xa0, DEF_STR( 6C_1C ) )
220220   PORT_DIPSETTING(    0xb0, DEF_STR( 5C_1C ) )
221221   PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
r15082r15083
232232   PORT_DIPSETTING(    0x60, DEF_STR( 1C_5C ) )
233233   PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ) )
234234   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
235   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:5,6")
235   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2",0x04,NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:5,6")
236236   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
237237   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
238238   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
239239   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
240   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:7,8")
240   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2",0x04,NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:7,8")
241241   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )
242242   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
243243   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
src/mame/drivers/nbmj8891.c
r15082r15083
5151#include "machine/nvram.h"
5252
5353
54#define SIGNED_DAC   0      // 0:unsigned DAC, 1:signed DAC
55#if SIGNED_DAC
56#define DAC_WRITE   dac_signed_w
57#else
58#define DAC_WRITE   dac_w
59#endif
60
61
6254static DRIVER_INIT( gionbana )
6355{
6456   UINT8 *prot = machine.root_device().memregion("protection")->base();
r15082r15083
451443   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
452444   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
453445   AM_RANGE(0xc0, 0xc0) AM_READ_LEGACY(nb1413m3_inputport3_r) //AM_WRITENOP
454   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
446   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
455447   AM_RANGE(0xe0, 0xe0) AM_WRITE(nbmj8891_vramsel_w)
456448   AM_RANGE(0xf0, 0xf0) AM_READWRITE_LEGACY(nb1413m3_dipsw1_r,nb1413m3_outcoin_w)
457449   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
470462   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
471463   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
472464   AM_RANGE(0xc0, 0xc0) AM_READ_LEGACY(nb1413m3_inputport3_r) //AM_WRITENOP
473   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
465   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
474466   AM_RANGE(0xe0, 0xe0) AM_WRITE(nbmj8891_vramsel_w)
475467   AM_RANGE(0xf0, 0xf0) AM_READWRITE_LEGACY(nb1413m3_dipsw1_r,nb1413m3_outcoin_w)
476468   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
493485   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
494486   AM_RANGE(0xc0, 0xc0) AM_READ_LEGACY(nb1413m3_inputport3_r) AM_WRITENOP
495487   AM_RANGE(0xd0, 0xdf) AM_READ(nbmj8891_clut_r)
496   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
488   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
497489   AM_RANGE(0xf0, 0xf0) AM_READWRITE_LEGACY(nb1413m3_dipsw1_r,nb1413m3_outcoin_w)
498490   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
499491ADDRESS_MAP_END
r15082r15083
511503   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
512504   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
513505   AM_RANGE(0xc0, 0xc0) AM_READ_LEGACY(nb1413m3_inputport3_r) //AM_WRITENOP
514   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
506   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
515507//  AM_RANGE(0xe0, 0xe0) AM_WRITENOP
516508   AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r) //AM_WRITENOP
517509   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
530522   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
531523   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
532524   AM_RANGE(0xc0, 0xc0) AM_READ_LEGACY(nb1413m3_inputport3_r) //AM_WRITENOP
533   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
525   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
534526//  AM_RANGE(0xe0, 0xe0) AM_WRITENOP
535527   AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r) //AM_WRITENOP
536528   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
549541   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
550542   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
551543   AM_RANGE(0xc0, 0xc0) AM_READWRITE_LEGACY(nb1413m3_inputport3_r,nb1413m3_nmi_clock_w)
552   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
544   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
553545//  AM_RANGE(0xe0, 0xe0) AM_WRITENOP
554546   AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r) //AM_WRITENOP
555547   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
569561   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
570562   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
571563   AM_RANGE(0xc0, 0xc0) AM_READWRITE_LEGACY(nb1413m3_inputport3_r,nb1413m3_nmi_clock_w)
572   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
564   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
573565//  AM_RANGE(0xe0, 0xe0) AM_WRITENOP
574566   AM_RANGE(0xf0, 0xf0) AM_READWRITE_LEGACY(nb1413m3_dipsw1_r,nb1413m3_outcoin_w)
575567   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
589581   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
590582   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
591583   AM_RANGE(0xc0, 0xc0) AM_READWRITE_LEGACY(nb1413m3_inputport3_r,nb1413m3_nmi_clock_w)
592   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
584   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
593585//  AM_RANGE(0xe0, 0xe0) AM_WRITENOP
594586   AM_RANGE(0xf0, 0xf0) AM_READWRITE_LEGACY(nb1413m3_dipsw1_r,nb1413m3_outcoin_w)
595587   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
608600   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
609601   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
610602   AM_RANGE(0xc0, 0xc0) AM_READ_PORT("PORT0-2")
611   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
603   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
612604   AM_RANGE(0xe0, 0xe0) AM_WRITE(nbmj8891_vramsel_w)
613605   AM_RANGE(0xf0, 0xf0) AM_READWRITE_LEGACY(nb1413m3_dipsw1_r,nb1413m3_outcoin_w)
614606   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
627619   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
628620   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
629621   AM_RANGE(0xc0, 0xc0) AM_READ_PORT("PORT0-2") //AM_WRITENOP
630   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
622   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
631623   AM_RANGE(0xe0, 0xe0) AM_WRITE(nbmj8891_vramsel_w)
632624   AM_RANGE(0xf0, 0xf0) AM_READWRITE_LEGACY(nb1413m3_dipsw1_r,nb1413m3_outcoin_w)
633625   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
643635   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
644636//  AM_RANGE(0xc0, 0xc0) AM_WRITENOP                    // ?
645637//  AM_RANGE(0xd0, 0xd0) AM_READ_LEGACY(ff_r)  // irq ack? watchdog?
646   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
638   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
647639   AM_RANGE(0xe0, 0xe0) AM_READ_LEGACY(nb1413m3_dipsw3_h_r) AM_WRITE(nbmj8891_taiwanmb_gfxdraw_w)   // blitter draw start
648640   AM_RANGE(0xe1, 0xe1) AM_READ_LEGACY(nb1413m3_dipsw3_l_r)
649641   AM_RANGE(0xf0, 0xf0) AM_READWRITE_LEGACY(nb1413m3_dipsw2_r,nb1413m3_outcoin_w)
r15082r15083
26042596};
26052597
26062598
2607
2608
26092599static MACHINE_CONFIG_START( gionbana, nbmj8891_state )
26102600
26112601   /* basic machine hardware */
r15082r15083
26382628   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
26392629MACHINE_CONFIG_END
26402630
2641
26422631static MACHINE_CONFIG_DERIVED( mgion, gionbana )
26432632
26442633   /* basic machine hardware */
r15082r15083
26492638   MCFG_NVRAM_ADD_0FILL("nvram")
26502639MACHINE_CONFIG_END
26512640
2652
26532641static MACHINE_CONFIG_DERIVED( omotesnd, gionbana )
26542642
26552643   /* basic machine hardware */
r15082r15083
26652653   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
26662654MACHINE_CONFIG_END
26672655
2668
26692656/* NBMJDRV2 */
26702657static MACHINE_CONFIG_DERIVED( mjcamerb, gionbana )
26712658
r15082r15083
27082695   MCFG_VIDEO_START(nbmj8891_1layer)
27092696MACHINE_CONFIG_END
27102697
2711
27122698static MACHINE_CONFIG_DERIVED( msjiken, hanamomo )
27132699
27142700   /* basic machine hardware */
r15082r15083
27172703   MCFG_CPU_IO_MAP(msjiken_io_map)
27182704MACHINE_CONFIG_END
27192705
2720
2721
27222706/* NBMJDRV3 */
27232707static MACHINE_CONFIG_DERIVED( telmahjn, gionbana )
27242708
r15082r15083
27352719   MCFG_VIDEO_START(nbmj8891_1layer)
27362720MACHINE_CONFIG_END
27372721
2738
27392722/* NBMJDRV5 */
27402723static MACHINE_CONFIG_DERIVED( mjnanpas, gionbana )
27412724
r15082r15083
27442727   MCFG_CPU_PROGRAM_MAP(club90s_map)
27452728MACHINE_CONFIG_END
27462729
2747
27482730static MACHINE_CONFIG_DERIVED( maiko, mjnanpas )
27492731
27502732   /* basic machine hardware */
r15082r15083
27532735   MCFG_CPU_IO_MAP(maiko_io_map)
27542736MACHINE_CONFIG_END
27552737
2756
27572738static MACHINE_CONFIG_DERIVED( mmaiko, maiko )
27582739
27592740   /* basic machine hardware */
r15082r15083
27632744   MCFG_NVRAM_ADD_0FILL("nvram")
27642745MACHINE_CONFIG_END
27652746
2766
27672747static MACHINE_CONFIG_DERIVED( lovehous, mjnanpas )
27682748
27692749   /* basic machine hardware */
r15082r15083
27742754   MCFG_NVRAM_ADD_0FILL("nvram")
27752755MACHINE_CONFIG_END
27762756
2777
27782757static MACHINE_CONFIG_DERIVED( hanaoji, maiko )
27792758
27802759   /* basic machine hardware */
r15082r15083
28082787   MCFG_CPU_IO_MAP(scandal_io_map)
28092788MACHINE_CONFIG_END
28102789
2811
28122790static MACHINE_CONFIG_DERIVED( bananadr, mjnanpas )
28132791
28142792   /* basic machine hardware */
r15082r15083
28192797   MCFG_NVRAM_ADD_0FILL("nvram")
28202798MACHINE_CONFIG_END
28212799
2822
28232800/* NBMJDRV6 */
28242801static MACHINE_CONFIG_DERIVED( mjfocusm, gionbana )
28252802
r15082r15083
28382815   /* sound hardware */
28392816   MCFG_SOUND_REPLACE("fmsnd", AY8910, 1250000)
28402817   MCFG_SOUND_CONFIG(ay8910_config)
2841   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
2818   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
28422819MACHINE_CONFIG_END
28432820
2844
28452821static MACHINE_CONFIG_DERIVED( taiwanmb, gionbana )
28462822
28472823   /* basic machine hardware */
r15082r15083
28602836   /* sound hardware */
28612837   MCFG_SOUND_REPLACE("fmsnd", AY8910, 1250000)
28622838   MCFG_SOUND_CONFIG(ay8910_config)
2863   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
2839   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
28642840MACHINE_CONFIG_END
28652841
28662842
2867
28682843ROM_START( gionbana )
28692844   ROM_REGION( 0x10000, "maincpu", 0 ) /* program */
28702845   ROM_LOAD( "gion_03.bin", 0x00000, 0x10000, CRC(615e993b) SHA1(6efda8d1f0d5be6418a73dd86b898bb518de3f8b) )
r15082r15083
38353810   DISK_IMAGE_READONLY( "hnageman", 0, NO_DUMP )
38363811ROM_END
38373812
3813
38383814//     YEAR,     NAME,   PARENT,  MACHINE,    INPUT,     INIT, MONITOR,COMPANY,FULLNAME,FLAGS)
38393815GAME( 1988, msjiken,   0,        msjiken,  msjiken,  msjiken,  ROT270, "Nichibutsu", "Mahjong Satsujin Jiken (Japan 881017)", 0 )
38403816GAME( 1988, hanamomo,  0,        hanamomo, hanamomo, hanamomo, ROT0,   "Nichibutsu", "Mahjong Hana no Momoko gumi (Japan 881201)", 0 )
src/mame/drivers/liberate.c
r15082r15083
5454
5555READ8_MEMBER(liberate_state::deco16_io_r)
5656{
57   if (offset == 0) return input_port_read(machine(), "IN1"); /* Player 1 controls */
58   if (offset == 1) return input_port_read(machine(), "IN2"); /* Player 2 controls */
59   if (offset == 2) return input_port_read(machine(), "IN3"); /* Vblank, coins */
60   if (offset == 3) return input_port_read(machine(), "DSW1"); /* Dip 1 */
61   if (offset == 4) return input_port_read(machine(), "DSW2"); /* Dip 2 */
57   if (offset == 0) return ioport("IN1")->read(); /* Player 1 controls */
58   if (offset == 1) return ioport("IN2")->read(); /* Player 2 controls */
59   if (offset == 2) return ioport("IN3")->read(); /* Vblank, coins */
60   if (offset == 3) return ioport("DSW1")->read(); /* Dip 1 */
61   if (offset == 4) return ioport("DSW2")->read(); /* Dip 2 */
6262
6363   logerror("%04x:  Read input %d\n", cpu_get_pc(&space.device()), offset);
6464   return 0xff;
r15082r15083
338338
339339static INPUT_PORTS_START( generic_input )
340340   PORT_START("IN0")
341   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_VBLANK )
341   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
342342
343343   PORT_START("IN1")
344344   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
r15082r15083
358358   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
359359   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
360360   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
361   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
361   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
362362
363363   PORT_START("IN3")
364364   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
r15082r15083
489489   PORT_INCLUDE( kamikcab )
490490
491491   PORT_MODIFY("IN0")
492   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_VBLANK )
492   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
493493   PORT_BIT( 0xfb, IP_ACTIVE_HIGH, IPT_UNKNOWN )
494494INPUT_PORTS_END
495495
r15082r15083
575575
576576   PORT_MODIFY("IN0")
577577   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT )
578   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_VBLANK )
578   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
579579   PORT_BIT( 0xf9, IP_ACTIVE_LOW,  IPT_UNKNOWN )
580580
581581   PORT_MODIFY("DSW1")
r15082r15083
763763static INTERRUPT_GEN( deco16_interrupt )
764764{
765765   liberate_state *state = device->machine().driver_data<liberate_state>();
766   int p = ~input_port_read(device->machine(), "IN3");
766   int p = ~state->ioport("IN3")->read();
767767   if ((p & 0x43) && !state->m_latch)
768768   {
769769      device_set_input_line(device, DECO16_IRQ_LINE, ASSERT_LINE);
src/mame/drivers/seta.c
r15082r15083
15171517/* DSW reading for 16 bit CPUs */
15181518READ16_MEMBER(seta_state::seta_dsw_r)
15191519{
1520   UINT16 dsw = input_port_read(machine(), "DSW");
1520   UINT16 dsw = ioport("DSW")->read();
15211521   if (offset == 0)   return (dsw >> 8) & 0xff;
15221522   else            return (dsw >> 0) & 0xff;
15231523}
r15082r15083
15271527
15281528static READ8_DEVICE_HANDLER( dsw1_r )
15291529{
1530   return (input_port_read(device->machine(), "DSW") >> 8) & 0xff;
1530   return (device->machine().root_device().ioport("DSW")->read() >> 8) & 0xff;
15311531}
15321532
15331533static READ8_DEVICE_HANDLER( dsw2_r )
15341534{
1535   return (input_port_read(device->machine(), "DSW") >> 0) & 0xff;
1535   return (device->machine().root_device().ioport("DSW")->read() >> 0) & 0xff;
15361536}
15371537
15381538
r15082r15083
16281628
16291629READ16_MEMBER(seta_state::calibr50_ip_r)
16301630{
1631   int dir1 = input_port_read(machine(), "ROT1");   // analog port
1632   int dir2 = input_port_read(machine(), "ROT2");   // analog port
1631   int dir1 = ioport("ROT1")->read();   // analog port
1632   int dir2 = ioport("ROT2")->read();   // analog port
16331633
16341634   switch (offset)
16351635   {
1636      case 0x00/2:   return input_port_read(machine(), "P1");   // p1
1637      case 0x02/2:   return input_port_read(machine(), "P2");   // p2
1636      case 0x00/2:   return ioport("P1")->read();   // p1
1637      case 0x02/2:   return ioport("P2")->read();   // p2
16381638
1639      case 0x08/2:   return input_port_read(machine(), "COINS");   // Coins
1639      case 0x08/2:   return ioport("COINS")->read();   // Coins
16401640
16411641      case 0x10/2:   return (dir1 & 0xff);      // lower 8 bits of p1 rotation
16421642      case 0x12/2:   return (dir1 >> 8);         // upper 4 bits of p1 rotation
r15082r15083
16911691{
16921692   switch (offset)
16931693   {
1694      case 0/2:   return (input_port_read(machine(), "DSW") >>  8) & 0xf;
1695      case 2/2:   return (input_port_read(machine(), "DSW") >> 12) & 0xf;
1696      case 4/2:   return (input_port_read(machine(), "DSW") >>  0) & 0xf;
1697      case 6/2:   return (input_port_read(machine(), "DSW") >>  4) & 0xf;
1694      case 0/2:   return (ioport("DSW")->read() >>  8) & 0xf;
1695      case 2/2:   return (ioport("DSW")->read() >> 12) & 0xf;
1696      case 4/2:   return (ioport("DSW")->read() >>  0) & 0xf;
1697      case 6/2:   return (ioport("DSW")->read() >>  4) & 0xf;
16981698   }
16991699   return 0;
17001700}
r15082r15083
17051705
17061706   switch (offset)
17071707   {
1708      case 0/2:   return (input_port_read(machine(), portx_name[m_usclssic_port_select]) >> 0) & 0xff;
1709      case 2/2:   return (input_port_read(machine(), portx_name[m_usclssic_port_select]) >> 8) & 0xff;
1708      case 0/2:   return (ioport(portx_name[m_usclssic_port_select])->read() >> 0) & 0xff;
1709      case 2/2:   return (ioport(portx_name[m_usclssic_port_select])->read() >> 8) & 0xff;
17101710   }
17111711   return 0;
17121712}
r15082r15083
17171717
17181718   switch (offset)
17191719   {
1720      case 0/2:   return (input_port_read(machine(), porty_name[m_usclssic_port_select]) >> 0) & 0xff;
1721      case 2/2:   return (input_port_read(machine(), porty_name[m_usclssic_port_select]) >> 8) & 0xff;
1720      case 0/2:   return (ioport(porty_name[m_usclssic_port_select])->read() >> 0) & 0xff;
1721      case 2/2:   return (ioport(porty_name[m_usclssic_port_select])->read() >> 8) & 0xff;
17221722   }
17231723   return 0;
17241724}
r15082r15083
18661866{
18671867   static const char *const portnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" };
18681868
1869   int data = input_port_read(machine(), portnames[m_gun_input_src]);   // Input Ports 5-8
1869   int data = ioport(portnames[m_gun_input_src])->read();   // Input Ports 5-8
18701870   return (data >> m_gun_input_bit) & 1;
18711871}
18721872
r15082r15083
20762076
20772077READ16_MEMBER(seta_state::keroppi_coin_r)
20782078{
2079   UINT16 result = input_port_read(machine(), "COINS");
2079   UINT16 result = ioport("COINS")->read();
20802080
20812081   if (m_keroppi_prize_hop == 2)
20822082   {
r15082r15083
23932393READ16_MEMBER(seta_state::krzybowl_input_r)
23942394{
23952395   // analog ports
2396   int dir1x = input_port_read(machine(), "TRACK1_X") & 0xfff;
2397   int dir1y = input_port_read(machine(), "TRACK1_Y") & 0xfff;
2398   int dir2x = input_port_read(machine(), "TRACK2_X") & 0xfff;
2399   int dir2y = input_port_read(machine(), "TRACK2_Y") & 0xfff;
2396   int dir1x = ioport("TRACK1_X")->read() & 0xfff;
2397   int dir1y = ioport("TRACK1_Y")->read() & 0xfff;
2398   int dir2x = ioport("TRACK2_X")->read() & 0xfff;
2399   int dir2y = ioport("TRACK2_Y")->read() & 0xfff;
24002400
24012401   switch (offset)
24022402   {
r15082r15083
25672567
25682568   switch( offset )
25692569   {
2570      case 0x00/2:   return input_port_read(machine(), keynames[i]);
2570      case 0x00/2:   return ioport(keynames[i])->read();
25712571      case 0x02/2:   return 0xffff;
2572      case 0x04/2:   return input_port_read(machine(), "COINS");
2572      case 0x04/2:   return ioport("COINS")->read();
25732573//      case 0x06/2:
25742574      case 0x08/2:   return 0xffff;
25752575
r15082r15083
28382838READ16_MEMBER(seta_state::inttoote_dsw_r)
28392839{
28402840   int shift = offset * 4;
2841   return   ((((input_port_read(machine(), "DSW1") >> shift)       & 0xf)) << 0) |
2842         ((((input_port_read(machine(), "DSW2_3") >> shift)     & 0xf)) << 4) |
2843         ((((input_port_read(machine(), "DSW2_3") >> (shift+8)) & 0xf)) << 8) ;
2841   return   ((((ioport("DSW1")->read() >> shift)       & 0xf)) << 0) |
2842         ((((ioport("DSW2_3")->read() >> shift)     & 0xf)) << 4) |
2843         ((((ioport("DSW2_3")->read() >> (shift+8)) & 0xf)) << 8) ;
28442844}
28452845
28462846READ16_MEMBER(seta_state::inttoote_key_r)
r15082r15083
28482848
28492849   switch( *m_inttoote_key_select )
28502850   {
2851      case 0x08:   return input_port_read(machine(), "BET0");
2852      case 0x10:   return input_port_read(machine(), "BET1");
2853      case 0x20:   return input_port_read(machine(), "BET2");
2854      case 0x40:   return input_port_read(machine(), "BET3");
2855      case 0x80:   return input_port_read(machine(), "BET4");
2851      case 0x08:   return ioport("BET0")->read();
2852      case 0x10:   return ioport("BET1")->read();
2853      case 0x20:   return ioport("BET2")->read();
2854      case 0x40:   return ioport("BET3")->read();
2855      case 0x80:   return ioport("BET4")->read();
28562856   }
28572857
28582858   logerror("%06X: unknown read, select = %04x\n",cpu_get_pc(&space.device()), *m_inttoote_key_select);
r15082r15083
29052905
29062906   switch( m_jockeyc_key_select )
29072907   {
2908      case 0x08:   return input_port_read(machine(), "BET0");
2909      case 0x10:   return input_port_read(machine(), "BET1");
2910      case 0x20:   return input_port_read(machine(), "BET2");
2911      case 0x40:   return input_port_read(machine(), "BET3");
2912      case 0x80:   return input_port_read(machine(), "BET4");
2908      case 0x08:   return ioport("BET0")->read();
2909      case 0x10:   return ioport("BET1")->read();
2910      case 0x20:   return ioport("BET2")->read();
2911      case 0x40:   return ioport("BET3")->read();
2912      case 0x80:   return ioport("BET4")->read();
29132913   }
29142914
29152915   return 0xffff;
r15082r15083
30373037
30383038READ8_MEMBER(seta_state::downtown_ip_r)
30393039{
3040   int dir1 = input_port_read(machine(), "ROT1");   // analog port
3041   int dir2 = input_port_read(machine(), "ROT2");   // analog port
3040   int dir1 = ioport("ROT1")->read();   // analog port
3041   int dir2 = ioport("ROT2")->read();   // analog port
30423042
30433043   dir1 = (~ (0x800 >> dir1)) & 0xfff;
30443044   dir2 = (~ (0x800 >> dir2)) & 0xfff;
30453045
30463046   switch (offset)
30473047   {
3048      case 0:   return (input_port_read(machine(), "COINS") & 0xf0) + (dir1 >> 8);   // upper 4 bits of p1 rotation + coins
3048      case 0:   return (ioport("COINS")->read() & 0xf0) + (dir1 >> 8);   // upper 4 bits of p1 rotation + coins
30493049      case 1:   return (dir1 & 0xff);               // lower 8 bits of p1 rotation
3050      case 2:   return input_port_read(machine(), "P1");   // p1
3050      case 2:   return ioport("P1")->read();   // p1
30513051      case 3:   return 0xff;                     // ?
30523052      case 4:   return (dir2 >> 8);                  // upper 4 bits of p2 rotation + ?
30533053      case 5:   return (dir2 & 0xff);               // lower 8 bits of p2 rotation
3054      case 6:   return input_port_read(machine(), "P2");   // p2
3054      case 6:   return ioport("P2")->read();   // p2
30553055      case 7:   return 0xff;                     // ?
30563056   }
30573057
r15082r15083
32343234
32353235   PORT_START("DSW")   // 2 DSWs - $600001 & 3.b
32363236   PORT_DIPNAME( 0x0001, 0x0001, "Licensed To" )      PORT_DIPLOCATION("SW1:1") /* Manual states "Don't Touch" */
3237   PORT_DIPSETTING(      0x0000, "Taito" )            PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
3238   PORT_DIPSETTING(      0x0001, "Jordan" )         PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
3239   PORT_DIPSETTING(      0x0000, "Taito" )            PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000)
3240   PORT_DIPSETTING(      0x0001, "Romstar" )         PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000) /* Manual shows DSW1-1=Off & DSW2-7=Off */
3237   PORT_DIPSETTING(      0x0000, "Taito" )            PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
3238   PORT_DIPSETTING(      0x0001, "Jordan" )         PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
3239   PORT_DIPSETTING(      0x0000, "Taito" )            PORT_CONDITION("DSW",0x4000,EQUALS,0x4000)
3240   PORT_DIPSETTING(      0x0001, "Romstar" )         PORT_CONDITION("DSW",0x4000,EQUALS,0x4000) /* Manual shows DSW1-1=Off & DSW2-7=Off */
32413241   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW1:2")
32423242   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
32433243   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r15082r15083
32463246   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
32473247   PORT_DIPSETTING(      0x0008, DEF_STR( On ) )
32483248   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5,6")
3249   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3250   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3251   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3252   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3253   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3254   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3255   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3256   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3249   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3250   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3251   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3252   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3253   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3254   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3255   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3256   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
32573257   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:7,8")
3258   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3259   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3260   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3261   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3262   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3263   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3264   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3265   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3258   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3259   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3260   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3261   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3262   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3263   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3264   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3265   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
32663266   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:1,2")
32673267   PORT_DIPSETTING(      0x0300, DEF_STR( Easy ) )
32683268   PORT_DIPSETTING(      0x0200, DEF_STR( Hard ) )
r15082r15083
34063406   PORT_DIPSETTING(      0x0014, DEF_STR( 1C_3C ) )
34073407   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
34083408   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,7,8")
3409   PORT_DIPSETTING(      0x0080, DEF_STR( 5C_1C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
3410   PORT_DIPSETTING(      0x0040, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
3411   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
3412   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
3413   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
3414   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
3415   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
3416   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
3417   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_4C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
3418   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
3419   PORT_DIPSETTING(      0x0080, "3 Coins/7 Credits" )      PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002) /* Manuals states "2 Coin 7 Credit" */
3420   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_5C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
3421   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_6C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
3422   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
3409   PORT_DIPSETTING(      0x0080, DEF_STR( 5C_1C ) )      PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
3410   PORT_DIPSETTING(      0x0040, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
3411   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
3412   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
3413   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
3414   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
3415   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
3416   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
3417   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_4C ) )      PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
3418   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
3419   PORT_DIPSETTING(      0x0080, "3 Coins/7 Credits" )      PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002) /* Manuals states "2 Coin 7 Credit" */
3420   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_5C ) )      PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
3421   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_6C ) )      PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
3422   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
34233423   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
34243424
34253425
r15082r15083
35353535
35363536   PORT_START("DSW")   //2 DSWs - $600001 & 3.b
35373537   PORT_DIPNAME( 0x0001, 0x0001, "Copyright / License" )      PORT_DIPLOCATION("SW1:1") /* Romstar's Manual states "Don't Touch" */
3538   PORT_DIPSETTING(      0x0000, "Seta (Japan only)" )      PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
3539   PORT_DIPSETTING(      0x0001, "Seta USA / Romstar" )      PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
3540   PORT_DIPSETTING(      0x0000, "Seta / Taito" )         PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000)
3541   PORT_DIPSETTING(      0x0001, "Seta USA / Taito America" )   PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000) /* Romstar's Manual shows DSW1-1=Off & DSW2-7=Off */
3538   PORT_DIPSETTING(      0x0000, "Seta (Japan only)" )      PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
3539   PORT_DIPSETTING(      0x0001, "Seta USA / Romstar" )      PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
3540   PORT_DIPSETTING(      0x0000, "Seta / Taito" )         PORT_CONDITION("DSW",0x4000,EQUALS,0x4000)
3541   PORT_DIPSETTING(      0x0001, "Seta USA / Taito America" )   PORT_CONDITION("DSW",0x4000,EQUALS,0x4000) /* Romstar's Manual shows DSW1-1=Off & DSW2-7=Off */
35423542   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW1:2")
35433543   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
35443544   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r15082r15083
35473547   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
35483548   PORT_DIPSETTING(      0x0008, DEF_STR( On ) )
35493549   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5,6")
3550   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3551   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3552   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3553   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3554   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3555   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3556   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3557   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3550   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3551   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3552   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3553   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3554   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3555   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3556   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3557   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
35583558   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:7,8")
3559   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3560   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3561   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3562   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
3563   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3564   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3565   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3566   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
3559   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3560   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3561   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3562   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
3563   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3564   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3565   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
3566   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
35673567   PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:1,2")
35683568   PORT_DIPSETTING(      0x0300, DEF_STR( Easiest ) )
35693569   PORT_DIPSETTING(      0x0200, DEF_STR( Easy ) )
r15082r15083
37403740   PORT_DIPSETTING(      0x0000, "1 of 8 Scenes" )
37413741   PORT_SERVICE_DIPLOC(  0x0800, IP_ACTIVE_LOW, "SW2:4" )
37423742   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW2:5,6")
3743   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
3744   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
3745   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
3746   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_2C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
3747   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
3748   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
3749   PORT_DIPSETTING(      0x2000, DEF_STR( 2C_1C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
3750   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
3743   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )         PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
3744   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )         PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
3745   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )         PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
3746   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_2C ) )         PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
3747   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )         PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
3748   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )         PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
3749   PORT_DIPSETTING(      0x2000, DEF_STR( 2C_1C ) )         PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
3750   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )         PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
37513751   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW2:7,8")
3752   PORT_DIPSETTING(      0x4000, DEF_STR( 2C_1C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
3753   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_1C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
3754   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
3755   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_2C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
3756   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_2C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
3757   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_3C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
3758   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_4C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
3759   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )         PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
3752   PORT_DIPSETTING(      0x4000, DEF_STR( 2C_1C ) )         PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
3753   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_1C ) )         PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
3754   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )         PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
3755   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_2C ) )         PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
3756   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_2C ) )         PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
3757   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_3C ) )         PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
3758   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_4C ) )         PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
3759   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )         PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
37603760
37613761INPUT_PORTS_END
37623762
r15082r15083
41404140   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
41414141   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
41424142   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
4143   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4144   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4145   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4146   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4147   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4148   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4149   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4150   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4143   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4144   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4145   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4146   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4147   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4148   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4149   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4150   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
41514151   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
4152   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4153   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4154   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4155   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4156   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4157   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4158   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4159   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4152   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4153   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4154   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4155   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4156   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4157   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4158   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4159   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
41604160   PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
41614161   PORT_DIPSETTING(      0x0200, DEF_STR( Easy ) )
41624162   PORT_DIPSETTING(      0x0300, DEF_STR( Normal ) )
r15082r15083
48534853
48544854   PORT_START("DSW") //$600001 & 3.b
48554855   PORT_DIPNAME( 0x0001, 0x0001, "Copyright / License" )   PORT_DIPLOCATION("SW1:1") /* Romstar's Manual states "Don't Touch" */
4856   PORT_DIPSETTING(      0x0000, "Seta USA / Taito America" )   PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
4857   PORT_DIPSETTING(      0x0001, "Seta / Jordan I.S." )      PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
4858   PORT_DIPSETTING(      0x0000, "Seta / Taito" )         PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000)
4859   PORT_DIPSETTING(      0x0001, "Seta USA / Romstar" )      PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000) /* Romstar's Manual shows DSW1-1=Off & DSW2-7=Off */
4856   PORT_DIPSETTING(      0x0000, "Seta USA / Taito America" )   PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
4857   PORT_DIPSETTING(      0x0001, "Seta / Jordan I.S." )      PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
4858   PORT_DIPSETTING(      0x0000, "Seta / Taito" )         PORT_CONDITION("DSW",0x4000,EQUALS,0x4000)
4859   PORT_DIPSETTING(      0x0001, "Seta USA / Romstar" )      PORT_CONDITION("DSW",0x4000,EQUALS,0x4000) /* Romstar's Manual shows DSW1-1=Off & DSW2-7=Off */
48604860   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW1:2")
48614861   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
48624862   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r15082r15083
48654865   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
48664866   PORT_DIPSETTING(      0x0008, DEF_STR( On ) )
48674867   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5,6")
4868   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4869   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4870   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4871   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4872   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4873   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4874   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4875   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4868   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4869   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4870   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4871   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4872   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4873   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4874   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4875   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
48764876   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:7,8")
4877   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4878   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4879   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4880   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
4881   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4882   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4883   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4884   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
4877   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4878   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4879   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4880   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
4881   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4882   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4883   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
4884   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
48854885   PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:1,2")
48864886   PORT_DIPSETTING(      0x0300, DEF_STR( Normal )  )
48874887   PORT_DIPSETTING(      0x0200, DEF_STR( Easy )    )
r15082r15083
57025702   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
57035703   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
57045704   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:5,6")
5705   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
5706   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
5707   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
5708   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_2C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
5709   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
5710   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
5711   PORT_DIPSETTING(      0x2000, DEF_STR( 2C_1C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
5712   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
5705   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )         PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
5706   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )         PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
5707   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )         PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
5708   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_2C ) )         PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
5709   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )         PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
5710   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )         PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
5711   PORT_DIPSETTING(      0x2000, DEF_STR( 2C_1C ) )         PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
5712   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )         PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
57135713   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:7,8")
5714   PORT_DIPSETTING(      0x4000, DEF_STR( 2C_1C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
5715   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_1C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
5716   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
5717   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_2C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
5718   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_2C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
5719   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_3C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
5720   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_4C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
5721   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )         PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
5714   PORT_DIPSETTING(      0x4000, DEF_STR( 2C_1C ) )         PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
5715   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_1C ) )         PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
5716   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )         PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
5717   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_2C ) )         PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
5718   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_2C ) )         PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
5719   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_3C ) )         PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
5720   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_4C ) )         PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
5721   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )         PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
57225722INPUT_PORTS_END
57235723
57245724
r15082r15083
57755775
57765776   PORT_START("DSW") //2 DSWs - $600001 & 3.b
57775777   PORT_DIPNAME( 0x0001, 0x0001, "Copyright / License" )   PORT_DIPLOCATION("SW1:1") /* Always "Seta" if sim. players = 1 */
5778   PORT_DIPSETTING(      0x0000, "Taito America / Romstar" )   PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
5779   PORT_DIPSETTING(      0x0001, "Taito Corp Japan" )      PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)   /* "World" Copyright */
5780   PORT_DIPSETTING(      0x0000, "Taito America" )         PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000)
5781   PORT_DIPSETTING(      0x0001, "Seta / Taito" )         PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000)   /* Japan Only Notice */
5778   PORT_DIPSETTING(      0x0000, "Taito America / Romstar" )   PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
5779   PORT_DIPSETTING(      0x0001, "Taito Corp Japan" )      PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)   /* "World" Copyright */
5780   PORT_DIPSETTING(      0x0000, "Taito America" )         PORT_CONDITION("DSW",0x4000,EQUALS,0x4000)
5781   PORT_DIPSETTING(      0x0001, "Seta / Taito" )         PORT_CONDITION("DSW",0x4000,EQUALS,0x4000)   /* Japan Only Notice */
57825782   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW1:2")
57835783   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
57845784   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r15082r15083
57875787   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
57885788   PORT_DIPSETTING(      0x0008, DEF_STR( Cocktail ) )
57895789   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5,6")
5790   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
5791   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
5792   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
5793   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
5794   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
5795   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
5796   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
5797   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
5790   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
5791   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
5792   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
5793   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
5794   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
5795   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
5796   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
5797   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
57985798   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:7,8")
5799   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
5800   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
5801   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
5802   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
5803   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
5804   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
5805   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
5806   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
5799   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
5800   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
5801   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
5802   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
5803   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
5804   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
5805   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
5806   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
58075807   PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:1,2")
58085808   PORT_DIPSETTING(      0x0300, DEF_STR( Normal )  )
58095809   PORT_DIPSETTING(      0x0200, DEF_STR( Easy )    )
r15082r15083
1064610646
1064710647static DRIVER_INIT( crazyfgt )
1064810648{
10649   //seta_state *state = machine.driver_data<seta_state>();
10650   UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
10649   seta_state *state = machine.driver_data<seta_state>();
10650   UINT16 *RAM = (UINT16 *) state->memregion("maincpu")->base();
1065110651
1065210652   // protection check at boot
1065310653   RAM[0x1078/2] = 0x4e71;
1065410654
1065510655   // fixed priorities?
10656   seta_state *state = machine.driver_data<seta_state>();
1065710656   state->m_vregs.allocate(3);
1065810657
1065910658   DRIVER_INIT_CALL(blandia);
r15082r15083
1066510664
1066610665static DRIVER_INIT( inttoote )
1066710666{
10668   //seta_state *state = machine.driver_data<seta_state>();
10669   UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
10667   seta_state *state = machine.driver_data<seta_state>();
10668   UINT16 *ROM = (UINT16 *)state->memregion( "maincpu" )->base();
1067010669
1067110670   // missing / unused video regs
10672   seta_state *state = machine.driver_data<seta_state>();
1067310671   state->m_vregs.allocate(3);
1067410672
1067510673   // code patches (to be removed...)
src/mame/drivers/truco.c
r15082r15083
395395   truco_state *state = device->machine().driver_data<truco_state>();
396396   /* coinup */
397397
398   if ( input_port_read(device->machine(),  "COIN") & 1 )
398   if ( state->ioport("COIN")->read() & 1 )
399399   {
400400      if ( state->m_trigger == 0 )
401401      {
src/mame/drivers/laserbat.c
r15082r15083
7777{
7878   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
7979
80   return input_port_read(machine(), portnames[m_input_mux]);
80   return ioport(portnames[m_input_mux])->read();
8181}
8282
8383WRITE8_MEMBER(laserbat_state::laserbat_cnteff_w)
r15082r15083
283283   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
284284
285285   PORT_START("SENSE")
286   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
286   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
287287INPUT_PORTS_END
288288
289289static INPUT_PORTS_START( lazarian )
r15082r15083
361361   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
362362
363363   PORT_START("SENSE")
364   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
364   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
365365INPUT_PORTS_END
366366
367367static INPUT_PORTS_START( catnmous )
r15082r15083
444444   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
445445
446446   PORT_START("SENSE")
447   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
447   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
448448INPUT_PORTS_END
449449
450450static const gfx_layout charlayout =
src/mame/drivers/vball.c
r15082r15083
258258   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
259259   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
260260   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
261   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
261   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
262262   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
263263   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
264264   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/naomi.c
r15082r15083
17261726
17271727   if (reg == 0x280/4)
17281728   {
1729      UINT32 coins = input_port_read(space->machine(), "COINS");
1729      UINT32 coins = space->machine().root_device().ioport("COINS")->read();
17301730
17311731      if (coins & 0x01)
17321732      {
src/mame/drivers/asteroid.c
r15082r15083
422422   PORT_DIPSETTING (   0x00, DEF_STR( Normal ) )
423423   PORT_DIPSETTING (   0x20, "Special" )
424424   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Coinage ) )               PORT_DIPLOCATION("SW:7,8")
425   PORT_DIPSETTING (   0xc0, DEF_STR( 2C_1C ) )               PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00)
426   PORT_DIPSETTING (   0x80, DEF_STR( 1C_1C ) )               PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00)
427   PORT_DIPSETTING (   0x40, DEF_STR( 1C_2C ) )               PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00)
428//  PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )                    PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00)
429   PORT_DIPSETTING (   0xc0, "Coin A 2/1 Coin B 2/1 Coin C 1/1" )   PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00)
430   PORT_DIPSETTING (   0x80, "Coin A 1/1 Coin B 1/1 Coin C 1/2" )   PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00)
431   PORT_DIPSETTING (   0x40, "Coin A 1/2 Coin B 1/2 Coin C 1/4" )   PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00)
432//  PORT_DIPSETTING (   0x00, "Coin A 1/1 Coin B 1/1 Coin C 1/2" )  PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00)
425   PORT_DIPSETTING (   0xc0, DEF_STR( 2C_1C ) )               PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
426   PORT_DIPSETTING (   0x80, DEF_STR( 1C_1C ) )               PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
427   PORT_DIPSETTING (   0x40, DEF_STR( 1C_2C ) )               PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
428//  PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )                    PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
429   PORT_DIPSETTING (   0xc0, "Coin A 2/1 Coin B 2/1 Coin C 1/1" )   PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
430   PORT_DIPSETTING (   0x80, "Coin A 1/1 Coin B 1/1 Coin C 1/2" )   PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
431   PORT_DIPSETTING (   0x40, "Coin A 1/2 Coin B 1/2 Coin C 1/4" )   PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
432//  PORT_DIPSETTING (   0x00, "Coin A 1/1 Coin B 1/1 Coin C 1/2" )  PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
433433INPUT_PORTS_END
434434
435435
src/mame/drivers/stv.c
r15082r15083
5858
5959   switch(offset)
6060   {
61      case 0x01: res = input_port_read(machine(), "PORTA"); break; // P1
62      case 0x03: res = input_port_read(machine(), "PORTB"); break; // P2
63      case 0x05: res = input_port_read(machine(), "PORTC"); break; // SYSTEM
61      case 0x01: res = ioport("PORTA")->read(); break; // P1
62      case 0x03: res = ioport("PORTB")->read(); break; // P2
63      case 0x05: res = ioport("PORTC")->read(); break; // SYSTEM
6464      case 0x07: res = m_system_output | 0xf0; break; // port D, read-backs value written
65      case 0x09: res = input_port_read(machine(), "PORTE"); break; // P3
66      case 0x0b: res = input_port_read(machine(), "PORTF"); break; // P4
65      case 0x09: res = ioport("PORTE")->read(); break; // P3
66      case 0x0b: res = ioport("PORTF")->read(); break; // P4
6767      case 0x1b: res = 0; break; // Serial COM READ status
6868   }
6969
r15082r15083
101101   {
102102      case 0x01:
103103      case 0x03:
104         res = input_port_read(machine(), lgnames[offset >> 1]);
104         res = ioport(lgnames[offset >> 1])->read();
105105         res = BITSWAP8(res, 2, 3, 0, 1, 6, 7, 5, 4) & 0xf3;
106         res |= (input_port_read(machine(), "PORTC") & 0x10) ? 0x0 : 0x4; // x/y hit latch actually
106         res |= (ioport("PORTC")->read() & 0x10) ? 0x0 : 0x4; // x/y hit latch actually
107107         break;
108108      default: res = stv_ioga_r(space,offset); break;
109109   }
r15082r15083
169169            for(i=0;i<5;i++)
170170            {
171171               if(m_mux_data & 1 << i)
172                  res = input_port_read(machine(), mpnames[offset >> 1][i]);
172                  res = ioport(mpnames[offset >> 1][i])->read();
173173            }
174174         }
175175         break;
src/mame/drivers/megatech.c
r15082r15083
222222   UINT8* game_region;
223223
224224   sprintf(tempname, "game%d", param);
225   game_region = machine.root_device().memregion(tempname)->base();
225   game_region = state->memregion(tempname)->base();
226226
227227   memcpy(state->memregion("maincpu")->base(), game_region, 0x400000);
228228
src/mame/drivers/champbwl.c
r15082r15083
175175READ8_MEMBER(champbwl_state::trackball_r)
176176{
177177   UINT8 ret;
178   UINT8 port4 = input_port_read(machine(), "FAKEX");
179   UINT8 port5 = input_port_read(machine(), "FAKEY");
178   UINT8 port4 = ioport("FAKEX")->read();
179   UINT8 port5 = ioport("FAKEY")->read();
180180
181181   ret = (((port4 - m_last_trackball_val[0]) & 0x0f)<<4) | ((port5 - m_last_trackball_val[1]) & 0x0f);
182182
src/mame/drivers/vamphalf.c
r15082r15083
649649CUSTOM_INPUT_MEMBER(vamphalf_state::boonggab_photo_sensors_r)
650650{
651651   static const UINT16 photo_sensors_table[8] = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 };
652   UINT8 res = input_port_read(machine(), "PHOTO_SENSORS");
652   UINT8 res = ioport("PHOTO_SENSORS")->read();
653653
654654   switch(res)
655655   {
src/mame/drivers/poolshrk.c
r15082r15083
7272READ8_MEMBER(poolshrk_state::poolshrk_input_r)
7373{
7474   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
75   UINT8 val = input_port_read(machine(), portnames[offset & 3]);
75   UINT8 val = ioport(portnames[offset & 3])->read();
7676
77   int x = input_port_read(machine(), (offset & 1) ? "AN1" : "AN0");
78   int y = input_port_read(machine(), (offset & 1) ? "AN3" : "AN2");
77   int x = ioport((offset & 1) ? "AN1" : "AN0")->read();
78   int y = ioport((offset & 1) ? "AN3" : "AN2")->read();
7979
8080   if (x >= m_da_latch) val |= 8;
8181   if (y >= m_da_latch) val |= 4;
src/mame/drivers/mayumi.c
r15082r15083
124124   for (i = 0; i < 5; i++)
125125   {
126126      if (BIT(p, i))
127         ret &= input_port_read(machine(), keynames[offset][i]);
127         ret &= ioport(keynames[offset][i])->read();
128128   }
129129
130130   return ret;
src/mame/drivers/raiden.c
r15082r15083
138138   PORT_DIPSETTING(      0x0001, "A" )
139139   PORT_DIPSETTING(      0x0000, "B" )
140140   /* Coin Mode A */
141   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3,4,5")
141   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0001, EQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3,4,5")
142142   PORT_DIPSETTING(      0x0014, DEF_STR( 6C_1C ) )
143143   PORT_DIPSETTING(      0x0016, DEF_STR( 5C_1C ) )
144144   PORT_DIPSETTING(      0x0018, DEF_STR( 4C_1C ) )
r15082r15083
156156   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
157157   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
158158   /* Coin Mode B */
159   PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0001, PORTCOND_NOTEQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3")
159   PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0001, NOTEQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3")
160160    PORT_DIPSETTING(      0x0000, "5C/1C or Free if Coin B too" )
161161    PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
162162    PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
163163    PORT_DIPSETTING(      0x0006, DEF_STR( 1C_1C ) )
164    PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0001, PORTCOND_NOTEQUALS, 0x0001) PORT_DIPLOCATION("SW1:4,5")
164    PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0001, NOTEQUALS, 0x0001) PORT_DIPLOCATION("SW1:4,5")
165165    PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
166166    PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
167167    PORT_DIPSETTING(      0x0008, DEF_STR( 1C_5C ) )
src/mame/drivers/bloodbro.c
r15082r15083
174174   PORT_DIPSETTING(      0x0001, "Mode 1" ) \
175175   PORT_DIPSETTING(      0x0000, "Mode 2" ) \
176176   /* Coin Mode 1 */ \
177   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) )           PORT_DIPLOCATION("SW1:2,3,4,5") PORT_CONDITION("DSW",0x0001,PORTCOND_EQUALS,0x0001) \
177   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) )           PORT_DIPLOCATION("SW1:2,3,4,5") PORT_CONDITION("DSW",0x0001,EQUALS,0x0001) \
178178   PORT_DIPSETTING(      0x0014, DEF_STR( 6C_1C ) ) \
179179   PORT_DIPSETTING(      0x0016, DEF_STR( 5C_1C ) ) \
180180   PORT_DIPSETTING(      0x0018, DEF_STR( 4C_1C ) ) \
r15082r15083
192192   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) ) \
193193   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) ) \
194194   /* Coin Mode 2 */ \
195    PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) )            PORT_DIPLOCATION("SW1:2,3") PORT_CONDITION("DSW",0x0001,PORTCOND_EQUALS,0x0000) \
195    PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) )            PORT_DIPLOCATION("SW1:2,3") PORT_CONDITION("DSW",0x0001,EQUALS,0x0000) \
196196    PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) ) \
197197    PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) ) \
198198    PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) ) \
199199    PORT_DIPSETTING(      0x0006, DEF_STR( 1C_1C ) ) \
200    PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) )            PORT_DIPLOCATION("SW1:4,5") PORT_CONDITION("DSW",0x0001,PORTCOND_EQUALS,0x0000) \
200    PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) )            PORT_DIPLOCATION("SW1:4,5") PORT_CONDITION("DSW",0x0001,EQUALS,0x0000) \
201201    PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) ) \
202202    PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) ) \
203203    PORT_DIPSETTING(      0x0008, DEF_STR( 1C_5C ) ) \
src/mame/drivers/galaxia.c
r15082r15083
234234   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
235235
236236   PORT_START("SENSE")
237   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
237   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
238238INPUT_PORTS_END
239239
240240
src/mame/drivers/vegaeo.c
r15082r15083
9393READ32_MEMBER(vegaeo_state::vegaeo_custom_read)
9494{
9595   eolith_speedup_read(&space);
96   return input_port_read(machine(), "SYSTEM");
96   return ioport("SYSTEM")->read();
9797}
9898
9999static ADDRESS_MAP_START( vega_map, AS_PROGRAM, 32, vegaeo_state )
src/mame/drivers/fromanc2.c
r15082r15083
5858
5959   switch (m_portselect)
6060   {
61   case 0x01:   ret = input_port_read(machine(), "KEY0"); break;
62   case 0x02:   ret = input_port_read(machine(), "KEY1"); break;
63   case 0x04:   ret = input_port_read(machine(), "KEY2"); break;
64   case 0x08:   ret = input_port_read(machine(), "KEY3"); break;
61   case 0x01:   ret = ioport("KEY0")->read(); break;
62   case 0x02:   ret = ioport("KEY1")->read(); break;
63   case 0x04:   ret = ioport("KEY2")->read(); break;
64   case 0x08:   ret = ioport("KEY3")->read(); break;
6565   default:   ret = 0xffff;
6666         logerror("PC:%08X unknown %02X\n", cpu_get_pc(&space.device()), m_portselect);
6767         break;
r15082r15083
8888WRITE16_MEMBER(fromanc2_state::fromanc2_eeprom_w)
8989{
9090   if (ACCESSING_BITS_8_15)
91      input_port_write(machine(), "EEPROMOUT", data, 0xffff);
91      ioport("EEPROMOUT")->write(data, 0xffff);
9292}
9393
9494WRITE16_MEMBER(fromanc2_state::fromancr_eeprom_w)
r15082r15083
9696   if (ACCESSING_BITS_0_7)
9797   {
9898      fromancr_gfxbank_w(machine(), data & 0xfff8);
99      input_port_write(machine(), "EEPROMOUT", data, 0xff);
99      ioport("EEPROMOUT")->write(data, 0xff);
100100   }
101101}
102102
103103WRITE16_MEMBER(fromanc2_state::fromanc4_eeprom_w)
104104{
105105   if (ACCESSING_BITS_0_7)
106      input_port_write(machine(), "EEPROMOUT", data, 0xff);
106      ioport("EEPROMOUT")->write(data, 0xff);
107107}
108108
109109WRITE16_MEMBER(fromanc2_state::fromanc2_subcpu_w)
r15082r15083
524524{
525525   fromanc2_state *state = machine.driver_data<fromanc2_state>();
526526
527   state->membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("sub")->base(), 0x4000);
528   state->membank("bank2")->configure_entry(0, machine.root_device().memregion("sub")->base() + 0x08000);
527   state->membank("bank1")->configure_entries(0, 4, state->memregion("sub")->base(), 0x4000);
528   state->membank("bank2")->configure_entry(0, state->memregion("sub")->base() + 0x08000);
529529   state->membank("bank2")->configure_entries(1, 3, state->memregion("sub")->base() + 0x14000, 0x4000);
530530
531531   MACHINE_START_CALL(fromanc4);
src/mame/drivers/rallyx.c
r15082r15083
397397   PORT_DIPSETTING(   0x20, "3 Cars, Medium" )
398398   PORT_DIPSETTING(   0x38, "3 Cars, Hard" )
399399   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Bonus_Life ) )
400   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x00)
401   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x00)
402   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x00)
400   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x00)
401   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x00)
402   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x00)
403403
404   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x08)
405   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x08)
406   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x08)
404   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x08)
405   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x08)
406   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x08)
407407
408   PORT_DIPSETTING(   0x02, "10000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x10)
409   PORT_DIPSETTING(   0x04, "20000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x10)
410   PORT_DIPSETTING(   0x06, "30000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x10)
408   PORT_DIPSETTING(   0x02, "10000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x10)
409   PORT_DIPSETTING(   0x04, "20000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x10)
410   PORT_DIPSETTING(   0x06, "30000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x10)
411411
412   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x18)
413   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x18)
414   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x18)
412   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x18)
413   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x18)
414   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x18)
415415
416   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x20)
417   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x20)
418   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x20)
416   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x20)
417   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x20)
418   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x20)
419419
420   PORT_DIPSETTING(   0x02, "10000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x28)
421   PORT_DIPSETTING(   0x04, "20000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x28)
422   PORT_DIPSETTING(   0x06, "30000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x28)
420   PORT_DIPSETTING(   0x02, "10000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x28)
421   PORT_DIPSETTING(   0x04, "20000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x28)
422   PORT_DIPSETTING(   0x06, "30000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x28)
423423
424   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x30)
425   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x30)
426   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x30)
424   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x30)
425   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x30)
426   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x30)
427427
428   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x38)
429   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x38)
430   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x38)
428   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x38)
429   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x38)
430   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW", 0x38, EQUALS, 0x38)
431431   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
432432   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
433433INPUT_PORTS_END
src/mame/drivers/gridlee.c
r15082r15083
180180   static const char *const portnames[] = { "TRACK0_Y", "TRACK0_X", "TRACK1_Y", "TRACK1_X" };
181181
182182   /* first read the new trackball value and compute the signed delta */
183   newval = input_port_read(machine(), portnames[offset + 2 * m_cocktail_flip]);
183   newval = ioport(portnames[offset + 2 * m_cocktail_flip])->read();
184184   delta = (int)newval - (int)m_last_analog_input[offset];
185185
186186   /* handle the case where we wrap around from 0x00 to 0xff, or vice versa */
r15082r15083
390390   PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNKNOWN )
391391   PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
392392   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
393   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
393   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
394394INPUT_PORTS_END
395395
396396
src/mame/drivers/bnstars.c
r15082r15083
12461246         return 0xffffffff;
12471247
12481248      case 0x0000:
1249         return input_port_read(machine(), "IN0");
1249         return ioport("IN0")->read();
12501250
12511251      case 0x0080:
1252         return input_port_read(machine(), "IN1");
1252         return ioport("IN1")->read();
12531253
12541254      case 0x2000:
1255         return input_port_read(machine(), "IN2");
1255         return ioport("IN2")->read();
12561256
12571257      case 0x2080:
1258         return input_port_read(machine(), "IN3");
1258         return ioport("IN3")->read();
12591259
12601260   }
12611261}
12621262
12631263READ32_MEMBER(bnstars_state::bnstars2_r)
12641264{
1265   return input_port_read(machine(), "IN4");
1265   return ioport("IN4")->read();
12661266}
12671267
12681268READ32_MEMBER(bnstars_state::bnstars3_r)
12691269{
1270   return input_port_read(machine(), "IN5");
1270   return ioport("IN5")->read();
12711271}
12721272
12731273WRITE32_MEMBER(bnstars_state::bnstars1_mahjong_select_w)
src/mame/drivers/dai3wksi.c
r15082r15083
150150      }
151151      else
152152      {
153         if (input_port_read(screen.machine(), "IN2") & 0x03)
153         if (state->ioport("IN2")->read() & 0x03)
154154            color = vr_prom2[value];
155155         else
156156            color = vr_prom1[value];
src/mame/drivers/realbrk.c
r15082r15083
5353READ16_MEMBER(realbrk_state::realbrk_dsw_r)
5454{
5555   UINT16 sel = ~m_dsw_select[0];
56   if (sel & 0x01)   return   (input_port_read(machine(), "SW1") & 0x00ff) << 8;      // DSW1 low bits
57   if (sel & 0x02)   return   (input_port_read(machine(), "SW2") & 0x00ff) << 8;      // DSW2 low bits
58   if (sel & 0x04)   return   (input_port_read(machine(), "SW3") & 0x00ff) << 8;      // DSW3 low bits
59   if (sel & 0x08)   return   (input_port_read(machine(), "SW4") & 0x00ff) << 8;      // DSW4 low bits
56   if (sel & 0x01)   return   (ioport("SW1")->read() & 0x00ff) << 8;      // DSW1 low bits
57   if (sel & 0x02)   return   (ioport("SW2")->read() & 0x00ff) << 8;      // DSW2 low bits
58   if (sel & 0x04)   return   (ioport("SW3")->read() & 0x00ff) << 8;      // DSW3 low bits
59   if (sel & 0x08)   return   (ioport("SW4")->read() & 0x00ff) << 8;      // DSW4 low bits
6060
61   if (sel & 0x10)   return   ((input_port_read(machine(), "SW1") & 0x0300) << 0) |   // DSWs high 2 bits
62                     ((input_port_read(machine(), "SW2") & 0x0300) << 2) |
63                     ((input_port_read(machine(), "SW3") & 0x0300) << 4) |
64                     ((input_port_read(machine(), "SW4") & 0x0300) << 6) ;
61   if (sel & 0x10)   return   ((ioport("SW1")->read() & 0x0300) << 0) |   // DSWs high 2 bits
62                     ((ioport("SW2")->read() & 0x0300) << 2) |
63                     ((ioport("SW3")->read() & 0x0300) << 4) |
64                     ((ioport("SW4")->read() & 0x0300) << 6) ;
6565
6666   logerror("CPU #0 PC %06X: read with unknown dsw_select = %02x\n",cpu_get_pc(&space.device()),m_dsw_select[0]);
6767   return 0xffff;
r15082r15083
7373   {
7474      case 0x00/2: return 0xffff;
7575      case 0x02/2: return 0xffff;
76      case 0x04/2: return input_port_read(machine(), "IN0");      /*Service buttons*/
77      case 0x06/2: return input_port_read(machine(), "SW1");      /*DIP 2*/
78      case 0x08/2: return input_port_read(machine(), "SW2");      /*DIP 1*/
79      case 0x0a/2: return input_port_read(machine(), "SW3");      /*DIP 1+2 Hi-Bits*/
80      case 0x0c/2: return input_port_read(machine(), "PADDLE1");   /*Handle 1p*/
81      case 0x0e/2: return input_port_read(machine(), "P1");         /*Buttons 1p*/
82      case 0x10/2: return input_port_read(machine(), "PADDLE2");   /*Handle 2p*/
83      case 0x12/2: return input_port_read(machine(), "P2");         /*Buttons 2p*/
76      case 0x04/2: return ioport("IN0")->read();      /*Service buttons*/
77      case 0x06/2: return ioport("SW1")->read();      /*DIP 2*/
78      case 0x08/2: return ioport("SW2")->read();      /*DIP 1*/
79      case 0x0a/2: return ioport("SW3")->read();      /*DIP 1+2 Hi-Bits*/
80      case 0x0c/2: return ioport("PADDLE1")->read();   /*Handle 1p*/
81      case 0x0e/2: return ioport("P1")->read();         /*Buttons 1p*/
82      case 0x10/2: return ioport("PADDLE2")->read();   /*Handle 2p*/
83      case 0x12/2: return ioport("P2")->read();         /*Buttons 2p*/
8484   }
8585   return 0xffff;
8686}
r15082r15083
9292   switch(offset)
9393   {
9494      case 0x00/2: return 0xffff;
95      case 0x02/2: return input_port_read(machine(), "IN0");   /*Service buttons*/
95      case 0x02/2: return ioport("IN0")->read();   /*Service buttons*/
9696      /*DSW,same handling as realbrk*/
9797      case 0x04/2:
98         if (sel & 0x01)   return   (input_port_read(machine(), "SW1") & 0x00ff) << 8;      // DSW1 low bits
99         if (sel & 0x02)   return   (input_port_read(machine(), "SW2") & 0x00ff) << 8;      // DSW2 low bits
100         if (sel & 0x04)   return   (input_port_read(machine(), "SW3") & 0x00ff) << 8;      // DSW3 low bits
101         if (sel & 0x08)   return   (input_port_read(machine(), "SW4") & 0x00ff) << 8;      // DSW4 low bits
98         if (sel & 0x01)   return   (ioport("SW1")->read() & 0x00ff) << 8;      // DSW1 low bits
99         if (sel & 0x02)   return   (ioport("SW2")->read() & 0x00ff) << 8;      // DSW2 low bits
100         if (sel & 0x04)   return   (ioport("SW3")->read() & 0x00ff) << 8;      // DSW3 low bits
101         if (sel & 0x08)   return   (ioport("SW4")->read() & 0x00ff) << 8;      // DSW4 low bits
102102
103         if (sel & 0x10)   return   ((input_port_read(machine(), "SW1") & 0x0300) << 0) |   // DSWs high 2 bits
104                           ((input_port_read(machine(), "SW2") & 0x0300) << 2) |
105                           ((input_port_read(machine(), "SW3") & 0x0300) << 4) |
106                           ((input_port_read(machine(), "SW4") & 0x0300) << 6) ;
103         if (sel & 0x10)   return   ((ioport("SW1")->read() & 0x0300) << 0) |   // DSWs high 2 bits
104                           ((ioport("SW2")->read() & 0x0300) << 2) |
105                           ((ioport("SW3")->read() & 0x0300) << 4) |
106                           ((ioport("SW4")->read() & 0x0300) << 6) ;
107107
108108         return 0xffff;
109      case 0x06/2: return input_port_read(machine(), "P2");/*Buttons+Handle 2p*/
110      case 0x08/2: return input_port_read(machine(), "P1");/*Buttons+Handle 1p*/
109      case 0x06/2: return ioport("P2")->read();/*Buttons+Handle 2p*/
110      case 0x08/2: return ioport("P1")->read();/*Buttons+Handle 1p*/
111111      case 0x0a/2: return 0xffff;
112112      case 0x0c/2: return 0xffff;
113113      case 0x0e/2: return 0xffff;
src/mame/drivers/vmetal.c
r15082r15083
164164}
165165
166166
167READ16_MEMBER(vmetal_state::varia_dips_bit8_r){ return ((input_port_read(machine(), "DSW2") & 0x80) << 0) | ((input_port_read(machine(), "DSW1") & 0x80) >> 1); }
168READ16_MEMBER(vmetal_state::varia_dips_bit7_r){ return ((input_port_read(machine(), "DSW2") & 0x40) << 1) | ((input_port_read(machine(), "DSW1") & 0x40) >> 0); }
169READ16_MEMBER(vmetal_state::varia_dips_bit6_r){ return ((input_port_read(machine(), "DSW2") & 0x20) << 2) | ((input_port_read(machine(), "DSW1") & 0x20) << 1); }
170READ16_MEMBER(vmetal_state::varia_dips_bit5_r){ return ((input_port_read(machine(), "DSW2") & 0x10) << 3) | ((input_port_read(machine(), "DSW1") & 0x10) << 2); }
171READ16_MEMBER(vmetal_state::varia_dips_bit4_r){ return ((input_port_read(machine(), "DSW2") & 0x08) << 4) | ((input_port_read(machine(), "DSW1") & 0x08) << 3); }
172READ16_MEMBER(vmetal_state::varia_dips_bit3_r){ return ((input_port_read(machine(), "DSW2") & 0x04) << 5) | ((input_port_read(machine(), "DSW1") & 0x04) << 4); }
173READ16_MEMBER(vmetal_state::varia_dips_bit2_r){ return ((input_port_read(machine(), "DSW2") & 0x02) << 6) | ((input_port_read(machine(), "DSW1") & 0x02) << 5); }
174READ16_MEMBER(vmetal_state::varia_dips_bit1_r){ return ((input_port_read(machine(), "DSW2") & 0x01) << 7) | ((input_port_read(machine(), "DSW1") & 0x01) << 6); }
167READ16_MEMBER(vmetal_state::varia_dips_bit8_r){ return ((ioport("DSW2")->read() & 0x80) << 0) | ((ioport("DSW1")->read() & 0x80) >> 1); }
168READ16_MEMBER(vmetal_state::varia_dips_bit7_r){ return ((ioport("DSW2")->read() & 0x40) << 1) | ((ioport("DSW1")->read() & 0x40) >> 0); }
169READ16_MEMBER(vmetal_state::varia_dips_bit6_r){ return ((ioport("DSW2")->read() & 0x20) << 2) | ((ioport("DSW1")->read() & 0x20) << 1); }
170READ16_MEMBER(vmetal_state::varia_dips_bit5_r){ return ((ioport("DSW2")->read() & 0x10) << 3) | ((ioport("DSW1")->read() & 0x10) << 2); }
171READ16_MEMBER(vmetal_state::varia_dips_bit4_r){ return ((ioport("DSW2")->read() & 0x08) << 4) | ((ioport("DSW1")->read() & 0x08) << 3); }
172READ16_MEMBER(vmetal_state::varia_dips_bit3_r){ return ((ioport("DSW2")->read() & 0x04) << 5) | ((ioport("DSW1")->read() & 0x04) << 4); }
173READ16_MEMBER(vmetal_state::varia_dips_bit2_r){ return ((ioport("DSW2")->read() & 0x02) << 6) | ((ioport("DSW1")->read() & 0x02) << 5); }
174READ16_MEMBER(vmetal_state::varia_dips_bit1_r){ return ((ioport("DSW2")->read() & 0x01) << 7) | ((ioport("DSW1")->read() & 0x01) << 6); }
175175
176176static WRITE8_DEVICE_HANDLER( vmetal_control_w )
177177{
r15082r15083
423423static void expand_gfx1(running_machine &machine)
424424{
425425   metro_state *state = machine.driver_data<metro_state>();
426   UINT8 *base_gfx = machine.root_device().memregion("gfx1")->base();
426   UINT8 *base_gfx = state->memregion("gfx1")->base();
427427   UINT32 length = 2 * state->memregion("gfx1")->bytes();
428428   state->m_expanded_gfx1 = auto_alloc_array(machine, UINT8, length);
429429   for (int i = 0; i < length; i += 2)
src/mame/drivers/superchs.c
r15082r15083
109109   switch (offset)
110110   {
111111      case 0x00:
112         return input_port_read(machine(), "INPUTS");
112         return ioport("INPUTS")->read();
113113
114114      case 0x01:
115115         return m_coin_word<<16;
r15082r15083
169169
170170READ32_MEMBER(superchs_state::superchs_stick_r)
171171{
172   int fake = input_port_read(machine(), "FAKE");
172   int fake = ioport("FAKE")->read();
173173   int accel;
174174
175175   if (!(fake &0x10))   /* Analogue steer (the real control method) */
176176   {
177      m_steer = input_port_read(machine(), "WHEEL");
177      m_steer = ioport("WHEEL")->read();
178178   }
179179   else   /* Digital steer, with smoothing - speed depends on how often stick_r is called */
180180   {
r15082r15083
199199   }
200200
201201   /* Accelerator is an analogue input but the game treats it as digital (on/off) */
202   if (input_port_read(machine(),  "FAKE") & 0x1)   /* pressing B1 */
202   if (ioport("FAKE")->read() & 0x1)   /* pressing B1 */
203203      accel = 0x0;
204204   else
205205      accel = 0xff;
206206
207207   /* Todo: Verify brake - and figure out other input */
208   return (m_steer << 24) | (accel << 16) | (input_port_read(machine(), "SOUND") << 8) | input_port_read(machine(), "UNKNOWN");
208   return (m_steer << 24) | (accel << 16) | (ioport("SOUND")->read() << 8) | ioport("UNKNOWN")->read();
209209}
210210
211211WRITE32_MEMBER(superchs_state::superchs_stick_w)
src/mame/drivers/battlera.c
r15082r15083
5151{
5252   switch (m_control_port_select)
5353   {
54      case 0xfe: return input_port_read(machine(), "IN0"); /* Player 1 */
55      case 0xfd: return input_port_read(machine(), "IN1"); /* Player 2 */
56      case 0xfb: return input_port_read(machine(), "IN2"); /* Coins */
57      case 0xf7: return input_port_read(machine(), "DSW2"); /* Dip 2 */
58      case 0xef: return input_port_read(machine(), "DSW1"); /* Dip 1 */
54      case 0xfe: return ioport("IN0")->read(); /* Player 1 */
55      case 0xfd: return ioport("IN1")->read(); /* Player 2 */
56      case 0xfb: return ioport("IN2")->read(); /* Coins */
57      case 0xf7: return ioport("DSW2")->read(); /* Dip 2 */
58      case 0xef: return ioport("DSW1")->read(); /* Dip 1 */
5959   }
6060
6161    return 0xff;
src/mame/drivers/namcos1.c
r15082r15083
369369
370370READ8_MEMBER(namcos1_state::dsw_r)
371371{
372   int ret = input_port_read(machine(), "DIPSW");
372   int ret = ioport("DIPSW")->read();
373373   if (!(offset & 2)) ret >>= 4;
374374   return 0xf0 | ret;
375375}
src/mame/drivers/galdrvr.c
r15082r15083
898898   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, gmgalax_port_r, "GMIN2\0GLIN2")
899899
900900   PORT_START("GMIN0")      /* Ghost Muncher - IN0 */
901   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )                                    PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
902   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_4WAY PORT_COCKTAIL     PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
903   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY                PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
904   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY               PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
905   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )                                 PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
906   PORT_DIPNAME( 0x20, 0x00, "Ghost Muncher - Cabinet" )                        PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
901   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )                                    PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
902   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_4WAY PORT_COCKTAIL     PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
903   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY                PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
904   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY               PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
905   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )                                 PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
906   PORT_DIPNAME( 0x20, 0x00, "Ghost Muncher - Cabinet" )                        PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
907907   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
908908   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
909   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY                PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
910   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY                  PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
909   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY                PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
910   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY                  PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
911911
912912   PORT_START("GMIN1")      /* Ghost Muncher - IN1 */
913   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )                                 PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
914   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )                                 PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
915   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL    PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
916   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
917   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )                                PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
918   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL    PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
919   PORT_DIPNAME( 0xc0, 0x40, "Ghost Muncher - Bonus Life" )                     PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
913   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )                                 PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
914   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )                                 PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
915   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL    PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
916   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
917   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )                                PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
918   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL    PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
919   PORT_DIPNAME( 0xc0, 0x40, "Ghost Muncher - Bonus Life" )                     PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
920920   PORT_DIPSETTING(    0x40, "10000" )
921921   PORT_DIPSETTING(    0x80, "15000" )
922922   PORT_DIPSETTING(    0xc0, "20000" )
923923   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
924924
925925   PORT_START("GMIN2")      /* Ghost Muncher - IN2 */
926   PORT_DIPNAME( 0x03, 0x02, "Ghost Muncher - Coinage" )                        PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
926   PORT_DIPNAME( 0x03, 0x02, "Ghost Muncher - Coinage" )                        PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
927927   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
928928   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
929929   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
930930   PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
931   PORT_DIPNAME( 0x0c, 0x04, "Ghost Muncher - Lives" )                            PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
931   PORT_DIPNAME( 0x0c, 0x04, "Ghost Muncher - Lives" )                            PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
932932   PORT_DIPSETTING(    0x0c, "1" )
933933   PORT_DIPSETTING(    0x08, "2" )
934934   PORT_DIPSETTING(    0x04, "3" )
r15082r15083
936936   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
937937
938938   PORT_START("GLIN0")      /* Galaxian - IN0 */
939   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )                                  PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
940   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )                                  PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
941   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY                PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
942   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY               PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
943   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )                                PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
944   PORT_DIPNAME( 0x20, 0x00, "Galaxian - Cabinet" )                             PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
939   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )                                  PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
940   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )                                  PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
941   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY                PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
942   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY               PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
943   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )                                PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
944   PORT_DIPNAME( 0x20, 0x00, "Galaxian - Cabinet" )                             PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
945945   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
946946   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
947   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )                                         PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
948   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )                               PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
947   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )                                         PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
948   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )                               PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
949949
950950   PORT_START("GLIN1")      /* Galaxian - IN1 */
951   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )                                 PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
952   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )                                 PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
953   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL    PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
954   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
955   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL                    PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
956   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )                                PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
957   PORT_DIPNAME( 0xc0, 0x00, "Galaxian - Coinage" )                            PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
951   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )                                 PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
952   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )                                 PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
953   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL    PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
954   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
955   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL                    PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
956   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )                                PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
957   PORT_DIPNAME( 0xc0, 0x00, "Galaxian - Coinage" )                            PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
958958   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
959959   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
960960   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
961961   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
962962
963963   PORT_START("GLIN2")      /* Galaxian - IN2 */
964   PORT_DIPNAME( 0x03, 0x01, "Galaxian - Bonus Life" )                          PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
964   PORT_DIPNAME( 0x03, 0x01, "Galaxian - Bonus Life" )                          PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
965965   PORT_DIPSETTING(    0x01, "4000" )
966966   PORT_DIPSETTING(    0x02, "5000" )
967967   PORT_DIPSETTING(    0x03, "7000" )
968968   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
969   PORT_DIPNAME( 0x04, 0x00, "Galaxian - Lives" )                               PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
969   PORT_DIPNAME( 0x04, 0x00, "Galaxian - Lives" )                               PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
970970   PORT_DIPSETTING(    0x00, "3" )
971971   PORT_DIPSETTING(    0x04, "5" )
972972   PORT_DIPUNUSED( 0x08, 0x00 )
r15082r15083
24892489   // see http://www.cityofberwyn.com/schematics/stern/MoonWar_opto.tiff for schematic
24902490   // I.e. a 74ls161 counts from 0 to 15 which is the absolute number of bars passed on the quadrature
24912491
2492   signed char dialread = input_port_read(machine(), dialname[p]);
2492   signed char dialread = ioport(dialname[p])->read();
24932493
24942494   UINT8 ret;
24952495
r15082r15083
25212521   PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )                  /* see notes */
25222522   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
25232523   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
2524   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL PORT_CONDITION("IN2", 0x08, PORTCOND_EQUALS, 0x08) // cocktail: p2 thrust
2525   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CONDITION("IN2", 0x08, PORTCOND_EQUALS, 0x00) // upright: p1&p2 hyperflip
2524   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL PORT_CONDITION("IN2", 0x08, EQUALS, 0x08) // cocktail: p2 thrust
2525   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CONDITION("IN2", 0x08, EQUALS, 0x00) // upright: p1&p2 hyperflip
25262526   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) // both: p1(upright: &p2) shield
25272527   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) // both: p1(upright: &p2) thrust
25282528   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) // both: p1(upright: &p2) fire
r15082r15083
25432543   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
25442544
25452545   PORT_START("P1_DIAL")
2546   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
2547   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
2546   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
2547   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(4) PORT_RESET PORT_CONDITION("IN2", 0x08, EQUALS, 0x00) // upright: dial works normally
25482548
25492549   PORT_START("P2_DIAL")
25502550   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(4) PORT_RESET PORT_COCKTAIL PORT_REVERSE // cocktail: dial is reversed
r15082r15083
42034203   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
42044204ROM_END
42054205
4206ROM_START( mooncrstuku )
4207   ROM_REGION( 0x8000, "maincpu", 0 )
4208   ROM_LOAD( "smc1f",        0x0000, 0x0800, CRC(389ca0d6) SHA1(51cf6d190a0ebf23b70c2bcf1ccaa4705e29cd09) )
4209   ROM_LOAD( "smc2f",        0x0800, 0x0800, CRC(410ab430) SHA1(d89abff6ac4afbf69377a1d63043d629a634aab7) )
4210   ROM_LOAD( "smc3f",        0x1000, 0x0800, CRC(a6b4144b) SHA1(2b27ad54d716286c0dc9476d47df182ae01bcfd7) )
4211   ROM_LOAD( "smc4f",        0x1800, 0x0800, CRC(4cc046fe) SHA1(465eaacd50967d768babadd09ab9cad35380f6bf) )
4212   ROM_LOAD( "smc5f",          0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
4213   ROM_LOAD( "smc6f",        0x2800, 0x0800, CRC(6e84a927) SHA1(82e8e825d157c3c947a3a222bca059a735169c7d) )
4214   ROM_LOAD( "smc7f",        0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
4215   ROM_LOAD( "smc8f_uk",     0x3800, 0x0800, CRC(b968b2ff) SHA1(40105423f48d2260e85597c3c1e4d8fe947db793) )
4216
4217   ROM_REGION( 0x2000, "gfx1", 0 )
4218   ROM_LOAD( "mcs_b",        0x0000, 0x0800, CRC(fb0f1f81) SHA1(38a6679a8b69bc1870a0e67e692131c42f9535c8) )
4219   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
4220   ROM_LOAD( "mcs_a",        0x1000, 0x0800, CRC(631ebb5a) SHA1(5bc9493afa76c55858b8c8849524cbc77dc838fc) )
4221   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
4222
4223   ROM_REGION( 0x0020, "proms", 0 )
4224   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
4225ROM_END
4226
42064227ROM_START( mooncrstu )
42074228   ROM_REGION( 0x8000, "maincpu", 0 )
42084229   ROM_LOAD( "smc1f",        0x0000, 0x0800, CRC(389ca0d6) SHA1(51cf6d190a0ebf23b70c2bcf1ccaa4705e29cd09) )
r15082r15083
64216442 *************************************/
64226443
64236444/* based on Galaxian, but with altered address map for more ROM */
6424GAME( 1980, mooncrst,  0,        mooncrst, mooncrst, mooncrst, ROT90,  "Nichibutsu", "Moon Cresta (Nichibutsu)", GAME_SUPPORTS_SAVE )
6425GAME( 1980, mooncrstuk,mooncrst, mooncrst, mooncrst, mooncrst, ROT90,  "Nichibutsu UK", "Moon Cresta (Nichibutsu UK)", GAME_SUPPORTS_SAVE )
6426GAME( 1980, mooncrstu, mooncrst, mooncrst, mooncrst, mooncrsu, ROT90,  "Nichibutsu USA", "Moon Cresta (Nichibutsu USA, unencrypted)", GAME_SUPPORTS_SAVE )
6427GAME( 1980, mooncrsto, mooncrst, mooncrst, mooncrsa, mooncrst, ROT90,  "Nichibutsu", "Moon Cresta (Nichibutsu, old rev)", GAME_SUPPORTS_SAVE )
6428GAME( 1980, mooncrstg, mooncrst, mooncrst, mooncrsg, mooncrsu, ROT90,  "Nichibutsu (Gremlin license)", "Moon Cresta (Gremlin)", GAME_SUPPORTS_SAVE )
6445GAME( 1980, mooncrst,   0,        mooncrst, mooncrst, mooncrst, ROT90,  "Nichibutsu", "Moon Cresta (Nichibutsu)", GAME_SUPPORTS_SAVE )
6446GAME( 1980, mooncrstuk, mooncrst, mooncrst, mooncrst, mooncrst, ROT90,  "Nichibutsu UK", "Moon Cresta (Nichibutsu UK)", GAME_SUPPORTS_SAVE )
6447GAME( 1980, mooncrstuku,mooncrst, mooncrst, mooncrst, mooncrsu, ROT90,  "Nichibutsu UK", "Moon Cresta (Nichibutsu UK, unencrypted)", GAME_SUPPORTS_SAVE )
6448GAME( 1980, mooncrstu,  mooncrst, mooncrst, mooncrst, mooncrsu, ROT90,  "Nichibutsu USA", "Moon Cresta (Nichibutsu USA, unencrypted)", GAME_SUPPORTS_SAVE )
6449GAME( 1980, mooncrsto,  mooncrst, mooncrst, mooncrsa, mooncrst, ROT90,  "Nichibutsu", "Moon Cresta (Nichibutsu, old rev)", GAME_SUPPORTS_SAVE )
6450GAME( 1980, mooncrstg,  mooncrst, mooncrst, mooncrsg, mooncrsu, ROT90,  "Nichibutsu (Gremlin license)", "Moon Cresta (Gremlin)", GAME_SUPPORTS_SAVE )
64296451
64306452/* straight Moon Cresta ripoffs on basic mooncrst hardware */
64316453GAME( 1980, mooncrsb, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "bootleg", "Moon Cresta (bootleg set 1)", GAME_SUPPORTS_SAVE )
src/mame/drivers/gundealr.c
r15082r15083
498498         break;
499499   }
500500
501   state->m_rambase[0x004] = input_port_read(timer.machine(), "IN2");
502   state->m_rambase[0x005] = input_port_read(timer.machine(), "IN1");
503   state->m_rambase[0x006] = input_port_read(timer.machine(), "IN0");
501   state->m_rambase[0x004] = timer.machine().root_device().ioport("IN2")->read();
502   state->m_rambase[0x005] = timer.machine().root_device().ioport("IN1")->read();
503   state->m_rambase[0x006] = timer.machine().root_device().ioport("IN0")->read();
504504}
505505
506506static MACHINE_CONFIG_DERIVED( yamyam, gundealr )
src/mame/drivers/firefox.c
r15082r15083
381381{
382382   if( m_control_num == 0 )
383383   {
384      return input_port_read( machine(), "PITCH" );
384      return ioport( "PITCH" )->read();
385385   }
386386
387   return input_port_read( machine(), "YAW" );
387   return ioport( "YAW" )->read();
388388}
389389
390390WRITE8_MEMBER(firefox_state::adc_select_w)
r15082r15083
579579   PORT_START("rdin1")
580580   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firefox_state,mainflag_r, NULL)
581581   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firefox_state,soundflag_r, NULL)
582   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK )
582   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
583583   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )
584584   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
585585   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
src/mame/drivers/deco156.c
r15082r15083
8989   if (ACCESSING_BITS_0_7)
9090   {
9191      m_oki2->set_bank_base(0x40000 * (data & 0x7));
92      input_port_write(machine(), "EEPROMOUT", data, 0xff);
92      ioport("EEPROMOUT")->write(data, 0xff);
9393   }
9494}
9595
r15082r15083
189189   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
190190   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_SERVICE1 )
191191   PORT_SERVICE_NO_TOGGLE( 0x00080000, IP_ACTIVE_LOW )
192   PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_VBLANK )
192   PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
193193   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED )
194194   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )
195195   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
231231   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
232232   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_SERVICE1 )
233233   PORT_SERVICE_NO_TOGGLE( 0x00080000, IP_ACTIVE_LOW )
234   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_VBLANK )
234   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
235235   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
236236   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )
237237   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/dwarfd.c
r15082r15083
12901290   UINT8 *src, *dst;
12911291
12921292   /* expand gfx roms */
1293   src = machine.root_device().memregion("gfx1")->base();
1293   src = state->memregion("gfx1")->base();
12941294   dst = state->memregion("gfx2")->base();
12951295
12961296   for (i = 0; i < 0x4000; i++)
src/mame/drivers/renegade.c
r15082r15083
717717   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)   /* attack right */
718718   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)   /* attack right */
719719   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, renegade_state,mcu_status_r, NULL)
720   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
720   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
721721   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
722722
723723   PORT_START("DSW1")   /* DIP1 */
src/mame/drivers/nbmj8688.c
r15082r15083
4242#include "machine/nvram.h"
4343
4444
45#define SIGNED_DAC   0      // 0:unsigned DAC, 1:signed DAC
46#if SIGNED_DAC
47#define DAC_WRITE   dac_signed_w
48#else
49#define DAC_WRITE   dac_w
50#endif
51
52
5345static DRIVER_INIT( mjsikaku )
5446{
5547   nb1413m3_type = NB1413M3_MJSIKAKU;
r15082r15083
316308   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
317309   AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj8688_clut_w)
318310   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
319   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
311   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
320312   AM_RANGE(0xe0, 0xe0) AM_WRITE(secolove_romsel_w)
321313//  AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r)
322314//  AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
341333   AM_RANGE(0xb0, 0xb0) AM_READ_LEGACY(nb1413m3_inputport2_r) AM_WRITE(barline_output_w)
342334   AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj8688_clut_w)
343335   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
344//  AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE) //not used
336//  AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w) //not used
345337   AM_RANGE(0xe0, 0xe0) AM_WRITE(secolove_romsel_w)
346338   AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r) AM_WRITE(mjsikaku_scrolly_w)
347339   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
359351   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
360352   AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj8688_clut_w)
361353   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
362   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
354   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
363355   AM_RANGE(0xe0, 0xe0) AM_WRITE(crystalg_romsel_w)
364356//  AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r)
365357//  AM_RANGE(0xf0, 0xf0) AM_WRITENOP
r15082r15083
379371   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
380372   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
381373   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
382   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
374   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
383375   AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
384376   AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r) AM_WRITE(mjsikaku_scrolly_w)
385377   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
399391   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
400392   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
401393   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
402   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
394   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
403395   AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
404396    AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r) AM_WRITE(mjsikaku_scrolly_w)
405397   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
420412   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
421413   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
422414   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
423   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
415   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
424416   AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
425417//  AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r)
426418//  AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
442434   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
443435   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
444436   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
445   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
437   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
446438   AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
447439//  AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r)
448440//  AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
462454   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
463455   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
464456   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
465   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
457   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
466458   AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
467459//  AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r)
468460//  AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
487479   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
488480   AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj8688_clut_w)
489481   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
490   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
482   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
491483   AM_RANGE(0xe0, 0xe0) AM_WRITE(secolove_romsel_w)
492484//  AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r)
493485//  AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
508500   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
509501   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
510502   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
511   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
503   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
512504   AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
513505   AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r)
514506   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
530522   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
531523   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
532524   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
533   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
525   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
534526   AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
535527//  AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r)
536528//  AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
13451337   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
13461338INPUT_PORTS_END
13471339
1348
13491340static INPUT_PORTS_START( citylove )
13501341   PORT_START("DSWA")
13511342   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Difficulty ) )
r15082r15083
29152906};
29162907
29172908
2918
29192909static MACHINE_CONFIG_START( NBMJDRV_4096, nbmj8688_state )
29202910
29212911   /* basic machine hardware */
r15082r15083
29462936   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
29472937
29482938   MCFG_SOUND_ADD("dac", DAC, 0)
2949   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
2939   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
29502940MACHINE_CONFIG_END
29512941
2952
29532942static MACHINE_CONFIG_DERIVED( NBMJDRV_256, NBMJDRV_4096 )
29542943
29552944   /* basic machine hardware */
r15082r15083
29612950   MCFG_VIDEO_START(mbmj8688_8bit)
29622951MACHINE_CONFIG_END
29632952
2964
29652953static MACHINE_CONFIG_DERIVED( NBMJDRV_65536, NBMJDRV_4096 )
29662954
29672955   /* basic machine hardware */
r15082r15083
29742962   MCFG_VIDEO_START(mbmj8688_hybrid_16bit)
29752963MACHINE_CONFIG_END
29762964
2977
29782965// --------------------------------------------------------------------------------
29792966
29802967static MACHINE_CONFIG_DERIVED( crystalg, NBMJDRV_256 )
r15082r15083
29852972   MCFG_CPU_IO_MAP(crystalg_io_map)
29862973MACHINE_CONFIG_END
29872974
2988
29892975static MACHINE_CONFIG_DERIVED( apparel, NBMJDRV_256 )
29902976
29912977   /* basic machine hardware */
r15082r15083
29942980   MCFG_CPU_IO_MAP(secolove_io_map)
29952981MACHINE_CONFIG_END
29962982
2997
29982983static MACHINE_CONFIG_DERIVED( mbmj_h12bit, NBMJDRV_4096 )
29992984
30002985   /* basic machine hardware */
r15082r15083
30142999   MCFG_CPU_IO_MAP(barline_io_map)
30153000
30163001   MCFG_SOUND_REPLACE("psg", YM3812, 20000000/8)
3017   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
3002   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
30183003
30193004   MCFG_DEVICE_REMOVE("dac")
30203005MACHINE_CONFIG_END
r15082r15083
30303015   MCFG_VIDEO_START(mbmj8688_pure_16bit)
30313016MACHINE_CONFIG_END
30323017
3033
30343018static MACHINE_CONFIG_START( mbmj_p16bit_LCD, nbmj8688_state )
30353019
30363020   /* basic machine hardware */
r15082r15083
30793063   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
30803064
30813065   MCFG_SOUND_ADD("dac", DAC, 0)
3082   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
3066   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
30833067MACHINE_CONFIG_END
30843068
3085
30863069static MACHINE_CONFIG_DERIVED( seiha, NBMJDRV_65536 )
30873070
30883071   /* basic machine hardware */
r15082r15083
31083091   MCFG_CPU_IO_MAP(iemoto_io_map)
31093092MACHINE_CONFIG_END
31103093
3111
31123094static MACHINE_CONFIG_DERIVED( ojousan, NBMJDRV_65536 )
31133095
31143096   /* basic machine hardware */
r15082r15083
31253107   MCFG_CPU_IO_MAP(kaguya_io_map)
31263108MACHINE_CONFIG_END
31273109
3128
31293110static MACHINE_CONFIG_DERIVED( mjsikaku, NBMJDRV_4096 )
31303111
31313112   /* basic machine hardware */
r15082r15083
31383119   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
31393120MACHINE_CONFIG_END
31403121
3141
31423122static MACHINE_CONFIG_DERIVED( mmsikaku, NBMJDRV_4096 )
31433123
31443124   /* basic machine hardware */
r15082r15083
31473127   MCFG_CPU_IO_MAP(mmsikaku_io_map)
31483128MACHINE_CONFIG_END
31493129
3150
31513130static MACHINE_CONFIG_DERIVED( otonano, mjsikaku )
31523131
31533132   /* basic machine hardware */
r15082r15083
31563135MACHINE_CONFIG_END
31573136
31583137
3159
3160
31613138ROM_START( crystalg )
31623139   ROM_REGION( 0x10000, "maincpu", 0 ) /* program */
31633140   ROM_LOAD( "mbs1.3c",  0x00000, 0x04000, CRC(1cacdbbd) SHA1(672e67b761ef1723ec2445f13881a435dbbdf53f) )
r15082r15083
34543431
34553432   /*TODO: check if the w labeled roms are correctly mapped.*/
34563433    ROM_REGION( 0x400000, "gfx1", 0 ) /* gfx */
3457    ROM_LOAD( "se1507.6a",0x000000, 0x80000, CRC(f1e9555e) SHA1(a34ffcff2b2d6ba40a8a453b89970d636515a8ad) ) // seiha/se1507.6a
3434    ROM_LOAD( "se1507.6a",0x000000, 0x80000, CRC(f1e9555e) SHA1(a34ffcff2b2d6ba40a8a453b89970d636515a8ad) )   // seiha/se1507.6a
34583435    ROM_LOAD( "w19.1a",   0x080000, 0x40000, CRC(788cd3ca) SHA1(955a520e122aaee30e080d0a784556b69ba3de36) )
34593436    ROM_LOAD( "w20.2a",   0x0c0000, 0x40000, CRC(a3175a8f) SHA1(8214fdefa1186dd96bc55a30b64a24a486750f05) )
34603437    ROM_LOAD( "w21.3a",   0x100000, 0x40000, CRC(da46163e) SHA1(c6e5f59fe813915f94d81ff28526614c943b7082) )
3461    ROM_LOAD( "6.2a",     0x180000, 0x10000, CRC(9fefe2ca) SHA1(7b638a739640e9d311ee15c0e7b4f3f2dfdd3589) ) // seiha/seiha06.8a
3462    ROM_LOAD( "7.3a",     0x190000, 0x10000, CRC(a7d438ec) SHA1(5d145bab0ffc76fd77582ea5495ca4496210d41a) )            // seiha/seiha07.9a
3438    ROM_LOAD( "6.2a",     0x180000, 0x10000, CRC(9fefe2ca) SHA1(7b638a739640e9d311ee15c0e7b4f3f2dfdd3589) )   // seiha/seiha06.8a
3439    ROM_LOAD( "7.3a",     0x190000, 0x10000, CRC(a7d438ec) SHA1(5d145bab0ffc76fd77582ea5495ca4496210d41a) )   // seiha/seiha07.9a
34633440    ROM_LOAD( "8.4a",     0x1a0000, 0x10000, CRC(e8e61e48) SHA1(e1d0e64b39bad3e294b061fb6f02ece2f2ee4bca) )
3464    ROM_LOAD( "9.2b",     0x1b0000, 0x10000, CRC(541f6e9f) SHA1(946a9c9cc8e6985098af4dd035f80ecc50e800ec) )            // seiha/seiha05.1i
3441    ROM_LOAD( "9.2b",     0x1b0000, 0x10000, CRC(541f6e9f) SHA1(946a9c9cc8e6985098af4dd035f80ecc50e800ec) )   // seiha/seiha05.1i
34653442    ROM_LOAD( "10.3b",    0x1c0000, 0x10000, CRC(a4144f78) SHA1(316ebe91aa604f1d4a0f1942df9d87de487c977a) )
34663443    ROM_LOAD( "w22.4a",   0x200000, 0x40000, CRC(ea2b78b3) SHA1(38ec10a29f32cbb6b270fa10ade815cf3e0a54c2) )
34673444    ROM_LOAD( "w23.5a",   0x240000, 0x40000, CRC(0263ff75) SHA1(16a18dfaf732ab94dec70fd8e955d6179525115c) )
r15082r15083
40354012   ROM_LOAD( "16061.k7", 0x000, 0x104, CRC(d25ccac8) SHA1(cfad5a4cd9609ac2461314d77a5e0cecd326c63b) )
40364013ROM_END
40374014
4015
40384016/* 8-bit palette */
40394017GAME( 1986, crystalg, 0,        crystalg,        crystalg, crystalg, ROT0, "Nichibutsu", "Crystal Gal (Japan 860512)", 0 )
40404018GAME( 1986, crystal2, 0,        crystalg,        crystal2, crystal2, ROT0, "Nichibutsu", "Crystal Gal 2 (Japan 860620)", 0 )
r15082r15083
40854063GAME( 1988, mmsikaku, mjsikaku, mmsikaku,        mmsikaku, mmsikaku, ROT0, "Nichibutsu", "Mahjong Shikaku [BET] (Japan 880929)", 0 )
40864064GAME( 1988, otonano,  0,        otonano,         otonano,  otonano,  ROT0, "Apple", "Otona no Mahjong (Japan 880628)", 0 )
40874065GAME( 1988, mjcamera, 0,        otonano,         mjcamera, mjcamera, ROT0, "Miki Syouji", "Mahjong Camera Kozou (set 1) (Japan 881109)", 0 )
4088
4089
4090/*
4091
4092iemotom     outcoin check
4093ojousanm    outcoin check
4094ryuuha      outcoin check
4095
4096*/
src/mame/drivers/hitpoker.c
r15082r15083
289289   PORT_DIPNAME( 0x40, 0x40, "Monitor" ) //a JP probably
290290   PORT_DIPSETTING(    0x40, "15KHz" )
291291   PORT_DIPSETTING(    0x00, "24KHz" )
292   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
292   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
293293
294294   PORT_START("IN0")
295295   PORT_DIPNAME( 0x01, 0x01, "IN0" )
src/mame/drivers/taito_h.c
r15082r15083
188188   switch( port )
189189   {
190190      case 0x08:            /* trackball y coords bottom 8 bits for 2nd player */
191         return input_port_read(machine(), P2TRACKY_PORT_TAG);
191         return ioport(P2TRACKY_PORT_TAG)->read();
192192
193193      case 0x09:            /* trackball y coords top 8 bits for 2nd player */
194         if (input_port_read(machine(), P2TRACKY_PORT_TAG) & 0x80)   /* y- direction (negative value) */
194         if (ioport(P2TRACKY_PORT_TAG)->read() & 0x80)   /* y- direction (negative value) */
195195            return 0xff;
196196         else                                    /* y+ direction (positive value) */
197197            return 0x00;
198198
199199      case 0x0a:            /* trackball x coords bottom 8 bits for 2nd player */
200         return input_port_read(machine(), P2TRACKX_PORT_TAG);
200         return ioport(P2TRACKX_PORT_TAG)->read();
201201
202202      case 0x0b:            /* trackball x coords top 8 bits for 2nd player */
203         if (input_port_read(machine(), P2TRACKX_PORT_TAG) & 0x80)   /* x- direction (negative value) */
203         if (ioport(P2TRACKX_PORT_TAG)->read() & 0x80)   /* x- direction (negative value) */
204204            return 0xff;
205205         else                                    /* x+ direction (positive value) */
206206            return 0x00;
207207
208208      case 0x0c:            /* trackball y coords bottom 8 bits for 1st player */
209         return input_port_read(machine(), P1TRACKY_PORT_TAG);
209         return ioport(P1TRACKY_PORT_TAG)->read();
210210
211211      case 0x0d:            /* trackball y coords top 8 bits for 1st player */
212         if (input_port_read(machine(), P1TRACKY_PORT_TAG) & 0x80)   /* y- direction (negative value) */
212         if (ioport(P1TRACKY_PORT_TAG)->read() & 0x80)   /* y- direction (negative value) */
213213            return 0xff;
214214         else                                    /* y+ direction (positive value) */
215215            return 0x00;
216216
217217      case 0x0e:            /* trackball x coords bottom 8 bits for 1st player */
218         return input_port_read(machine(), P1TRACKX_PORT_TAG);
218         return ioport(P1TRACKX_PORT_TAG)->read();
219219
220220      case 0x0f:            /* trackball x coords top 8 bits for 1st player */
221         if (input_port_read(machine(), P1TRACKX_PORT_TAG) & 0x80)   /* x- direction (negative value) */
221         if (ioport(P1TRACKX_PORT_TAG)->read() & 0x80)   /* x- direction (negative value) */
222222            return 0xff;
223223         else                                    /* x+ direction (positive value) */
224224            return 0x00;
src/mame/drivers/tail2nos.c
r15082r15083
227227   tail2nos_state *state = machine.driver_data<tail2nos_state>();
228228
229229   /* point to the extra ROMs */
230   state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base());
230   state->membank("bank1")->set_base(state->memregion("user1")->base());
231231   state->membank("bank2")->set_base(state->memregion("user2")->base());
232232
233233   state->m_charbank = 0;
src/mame/drivers/m79amb.c
r15082r15083
114114
115115READ8_MEMBER(m79amb_state::gray5bit_controller0_r)
116116{
117   UINT8 port_data = input_port_read(machine(), "8004");
118   UINT8 gun_pos = input_port_read(machine(), "GUN1");
117   UINT8 port_data = ioport("8004")->read();
118   UINT8 gun_pos = ioport("GUN1")->read();
119119
120120   return (port_data & 0xe0) | m_lut_gun1[gun_pos];
121121}
122122
123123READ8_MEMBER(m79amb_state::gray5bit_controller1_r)
124124{
125   UINT8 port_data = input_port_read(machine(), "8005");
126   UINT8 gun_pos = input_port_read(machine(), "GUN2");
125   UINT8 port_data = ioport("8005")->read();
126   UINT8 gun_pos = ioport("GUN2")->read();
127127
128128   return (port_data & 0xe0) | m_lut_gun2[gun_pos];
129129}
r15082r15083
171171   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ))
172172
173173   PORT_START("8002")
174   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK )
174   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
175175   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
176176   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
177177   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
src/mame/drivers/slapshot.c
r15082r15083
194194   switch (offset)
195195   {
196196      case 0x03:
197         return ((input_port_read(machine(), "SYSTEM") & 0xef) |
198              (input_port_read(machine(), "SERVICE") & 0x10))  << 8;   /* IN3 + service switch */
197         return ((ioport("SYSTEM")->read() & 0xef) |
198              (ioport("SERVICE")->read() & 0x10))  << 8;   /* IN3 + service switch */
199199
200200      default:
201201         return tc0640fio_r(m_tc0640fio, offset) << 8;
r15082r15083
207207{
208208   static const char *const adcnames[] = { "GUN1X", "GUN1Y", "GUN2X", "GUN2Y" };
209209
210   return input_port_read(machine(), adcnames[offset]) << 8;
210   return ioport(adcnames[offset])->read() << 8;
211211}
212212
213213WRITE16_MEMBER(slapshot_state::opwolf3_adc_req_w)
src/mame/drivers/meritm.c
r15082r15083
10161016   state->m_ram = auto_alloc_array(machine, UINT8,  0x8000 );
10171017   machine.device<nvram_device>("nvram")->set_base(state->m_ram, 0x8000);
10181018   memset(state->m_ram, 0x00, 0x8000);
1019   state->membank("bank1")->configure_entries(0, 128, machine.root_device().memregion("maincpu")->base(), 0x8000);
1019   state->membank("bank1")->configure_entries(0, 128, state->memregion("maincpu")->base(), 0x8000);
10201020   state->membank("bank2")->configure_entries(0, 128, state->memregion("maincpu")->base(), 0x8000);
10211021   state->membank("bank3")->configure_entries(0, 4, state->m_ram, 0x2000);
10221022   state->m_bank = 0xff;
src/mame/drivers/ertictac.c
r15082r15083
4444
4545   switch(offset)
4646   {
47      case 0x04/4: return input_port_read(machine(), "DSW1") & 0xff;
48      case 0x08/4: return input_port_read(machine(), "DSW2") & 0xff;
49      case 0x10/4: return input_port_read(machine(), "SYSTEM") & 0xff;
50      case 0x14/4: return input_port_read(machine(), "P2") & 0xff;
51      case 0x18/4: return input_port_read(machine(), "P1") & 0xff;
47      case 0x04/4: return ioport("DSW1")->read() & 0xff;
48      case 0x08/4: return ioport("DSW2")->read() & 0xff;
49      case 0x10/4: return ioport("SYSTEM")->read() & 0xff;
50      case 0x14/4: return ioport("P2")->read() & 0xff;
51      case 0x18/4: return ioport("P1")->read() & 0xff;
5252   }
5353
5454   return 0;
r15082r15083
167167   PORT_DIPSETTING(    0x01, "Manual" )
168168   PORT_DIPSETTING(    0x00, "Automatic" )
169169   PORT_DIPNAME( 0x1A, 0x00, "Setting 2" )  PORT_DIPLOCATION("DSW2:3,4,5")
170   PORT_DIPSETTING(    0x00, "Extremely Easy - 2:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
171   PORT_DIPSETTING(    0x02, "Very Easy - 1:30")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
172   PORT_DIPSETTING(    0x08, "Easy - 2:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
173   PORT_DIPSETTING(    0x0A, "Normal 1 - 1:30")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
174   PORT_DIPSETTING(    0x10, "Normal 2 - 1:45")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
175   PORT_DIPSETTING(    0x12, "Difficult - 2:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
176   PORT_DIPSETTING(    0x18, "Very Difficult - 2:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
177   PORT_DIPSETTING(    0x1A, "Extremely Difficult - 1:30")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
178   PORT_DIPSETTING(    0x00, "Clear 20% - 1:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
179   PORT_DIPSETTING(    0x02, "Clear 30% - 1:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
180   PORT_DIPSETTING(    0x08, "Clear 40% - 1:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
181   PORT_DIPSETTING(    0x0A, "Clear 50% - 1:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
182   PORT_DIPSETTING(    0x10, "Clear 60% - 1:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
183   PORT_DIPSETTING(    0x12, "Clear 70% - 1:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
184   PORT_DIPSETTING(    0x18, "Clear 80% - 1:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
185   PORT_DIPSETTING(    0x1A, "Clear 90% - 1:00")   PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
170   PORT_DIPSETTING(    0x00, "Extremely Easy - 2:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
171   PORT_DIPSETTING(    0x02, "Very Easy - 1:30")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
172   PORT_DIPSETTING(    0x08, "Easy - 2:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
173   PORT_DIPSETTING(    0x0A, "Normal 1 - 1:30")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
174   PORT_DIPSETTING(    0x10, "Normal 2 - 1:45")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
175   PORT_DIPSETTING(    0x12, "Difficult - 2:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
176   PORT_DIPSETTING(    0x18, "Very Difficult - 2:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
177   PORT_DIPSETTING(    0x1A, "Extremely Difficult - 1:30")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
178   PORT_DIPSETTING(    0x00, "Clear 20% - 1:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
179   PORT_DIPSETTING(    0x02, "Clear 30% - 1:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
180   PORT_DIPSETTING(    0x08, "Clear 40% - 1:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
181   PORT_DIPSETTING(    0x0A, "Clear 50% - 1:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
182   PORT_DIPSETTING(    0x10, "Clear 60% - 1:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
183   PORT_DIPSETTING(    0x12, "Clear 70% - 1:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
184   PORT_DIPSETTING(    0x18, "Clear 80% - 1:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
185   PORT_DIPSETTING(    0x1A, "Clear 90% - 1:00")   PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
186186   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "DSW2:1" )
187187   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DSW2:6" )
188188INPUT_PORTS_END
src/mame/drivers/atarisy4.c
r15082r15083
687687
688688READ16_MEMBER(atarisy4_state::analog_r)
689689{
690   return (input_port_read(machine(), "STICKX") << 8) | input_port_read(machine(), "STICKY");
690   return (ioport("STICKX")->read() << 8) | ioport("STICKY")->read();
691691}
692692
693693static INPUT_PORTS_START( atarisy4 )
r15082r15083
969969   state->m_shared_ram[0] = auto_alloc_array_clear(machine, UINT16, 0x2000);
970970
971971   /* Populate the 68000 address space with data from the HEX files */
972   load_hexfile(main, machine.root_device().memregion("code")->base());
973   load_hexfile(main, machine.root_device().memregion("data")->base());
972   load_hexfile(main, state->memregion("code")->base());
973   load_hexfile(main, state->memregion("data")->base());
974974
975975   /* Set up the DSP */
976976   state->membank("dsp0_bank0")->set_base(state->m_shared_ram[0]);
r15082r15083
986986   state->m_shared_ram[1] = auto_alloc_array_clear(machine, UINT16, 0x4000);
987987
988988   /* Populate RAM with data from the HEX files */
989   load_hexfile(machine.device("maincpu")->memory().space(AS_PROGRAM), machine.root_device().memregion("code")->base());
989   load_hexfile(machine.device("maincpu")->memory().space(AS_PROGRAM), state->memregion("code")->base());
990990
991991   /* Set up the first DSP */
992992   state->membank("dsp0_bank0")->set_base(state->m_shared_ram[0]);
993993   state->membank("dsp0_bank1")->set_base(&state->m_shared_ram[0][0x800]);
994   load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), machine.root_device().memregion("dsp")->base());
994   load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), state->memregion("dsp")->base());
995995
996996   /* Set up the second DSP */
997997   state->membank("dsp1_bank0")->set_base(state->m_shared_ram[1]);
src/mame/drivers/cninja.c
r15082r15083
131131   switch (offset << 1)
132132   {
133133      case 0x41a: /* Player 1 & 2 input ports */
134         return input_port_read(machine(), "IN0");
134         return ioport("IN0")->read();
135135      case 0x320: /* Coins */
136         return input_port_read(machine(), "IN1");
136         return ioport("IN1")->read();
137137      case 0x4e6: /* Dip switches */
138         return input_port_read(machine(), "DSW");
138         return ioport("DSW")->read();
139139      case 0x504: /* PC: 6b6.  b4, 2c, 36 written before read */
140140         logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(&space.device()), offset);
141141         return 0x84;
r15082r15083
386386   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
387387   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
388388   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
389   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
389   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
390390
391391   PORT_START("DSW")
392392   DATAEAST_COINAGE
r15082r15083
440440   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
441441   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
442442   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
443   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
443   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
444444
445445   PORT_START("DSW")   /* Dip switch bank 1 */
446446
r15082r15083
509509   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
510510   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
511511   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
512   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
512   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
513513
514514   PORT_START("DSW")   /* Dip switch bank 1 */
515515
r15082r15083
577577   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
578578   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
579579   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
580   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
580   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
581581
582582   PORT_START("DSW")   /* Dip switch bank 1 */
583583
src/mame/drivers/wardner.c
r15082r15083
291291   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
292292   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
293293   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
294   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )            /* "V-BLANKING" in "test mode" */
294   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")            /* "V-BLANKING" in "test mode" */
295295
296296   PORT_START("DSWA")
297297   TOAPLAN_MACHINE_COCKTAIL_LOC(SW1)
src/mame/drivers/missile.c
r15082r15083
798798      if (m_ctrld)   /* trackball */
799799      {
800800         if (!m_flipscreen)
801             result = ((input_port_read(machine(), "TRACK0_Y") << 4) & 0xf0) | (input_port_read(machine(), "TRACK0_X") & 0x0f);
801            result = ((ioport("TRACK0_Y")->read() << 4) & 0xf0) | (ioport("TRACK0_X")->read() & 0x0f);
802802         else
803             result = ((input_port_read(machine(), "TRACK1_Y") << 4) & 0xf0) | (input_port_read(machine(), "TRACK1_X") & 0x0f);
803            result = ((ioport("TRACK1_Y")->read() << 4) & 0xf0) | (ioport("TRACK1_X")->read() & 0x0f);
804804      }
805805      else   /* buttons */
806         result = input_port_read(machine(), "IN0");
806         result = ioport("IN0")->read();
807807   }
808808
809809   /* IN1 */
810810   else if (offset < 0x4a00)
811      result = input_port_read(machine(), "IN1");
811      result = ioport("IN1")->read();
812812
813813   /* IN2 */
814814   else if (offset < 0x4b00)
815      result = input_port_read(machine(), "R10");
815      result = ioport("R10")->read();
816816
817817   /* anything else */
818818   else
src/mame/drivers/go2000.c
r15082r15083
136136   PORT_DIPSETTING(      0x0100, "7" )
137137   PORT_DIPSETTING(      0x0000, "8" )
138138   PORT_DIPNAME( 0x1800, 0x1800, "M1 value" ) PORT_DIPLOCATION("SW-2:4,5")
139   PORT_DIPSETTING(      0x0800, "3000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_EQUALS, 0x0000)
140   PORT_DIPSETTING(      0x0000, "3500" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_EQUALS, 0x0000)
141   PORT_DIPSETTING(      0x1800, "4000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_EQUALS, 0x0000)
142   PORT_DIPSETTING(      0x1000, "4500" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_EQUALS, 0x0000)
143   PORT_DIPSETTING(      0x0800, "6000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_NOTEQUALS, 0x0000)
144   PORT_DIPSETTING(      0x0000, "7000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_NOTEQUALS, 0x0000)
145   PORT_DIPSETTING(      0x1800, "8000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_NOTEQUALS, 0x0000)
146   PORT_DIPSETTING(      0x1000, "9000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_NOTEQUALS, 0x0000)
139   PORT_DIPSETTING(      0x0800, "3000" ) PORT_CONDITION("DSW", 0x0003, EQUALS, 0x0000)
140   PORT_DIPSETTING(      0x0000, "3500" ) PORT_CONDITION("DSW", 0x0003, EQUALS, 0x0000)
141   PORT_DIPSETTING(      0x1800, "4000" ) PORT_CONDITION("DSW", 0x0003, EQUALS, 0x0000)
142   PORT_DIPSETTING(      0x1000, "4500" ) PORT_CONDITION("DSW", 0x0003, EQUALS, 0x0000)
143   PORT_DIPSETTING(      0x0800, "6000" ) PORT_CONDITION("DSW", 0x0003, NOTEQUALS, 0x0000)
144   PORT_DIPSETTING(      0x0000, "7000" ) PORT_CONDITION("DSW", 0x0003, NOTEQUALS, 0x0000)
145   PORT_DIPSETTING(      0x1800, "8000" ) PORT_CONDITION("DSW", 0x0003, NOTEQUALS, 0x0000)
146   PORT_DIPSETTING(      0x1000, "9000" ) PORT_CONDITION("DSW", 0x0003, NOTEQUALS, 0x0000)
147147   PORT_DIPUNKNOWN_DIPLOC( 0x2000, IP_ACTIVE_LOW, "SW-2:6" )
148148   PORT_DIPNAME( 0xc000, 0xc000, "Difficult-2" ) PORT_DIPLOCATION("SW-2:7,8")
149149   PORT_DIPSETTING(      0xc000, "1" )
src/mame/drivers/jack.c
r15082r15083
8282{
8383   UINT8 ret = 0;
8484
85   if ((input_port_read(machine(), "IN2") & 0x80) && !m_joinem_snd_bit)
85   if ((ioport("IN2")->read() & 0x80) && !m_joinem_snd_bit)
8686      ret = 1;
8787
8888   return ret;
r15082r15083
682682   PORT_DIPSETTING(    0x02, "Horizontal" )
683683   PORT_DIPSETTING(    0x00, "Vertical" )
684684   PORT_DIPNAME( 0x05, 0x05, "Gaming Option Number" )   PORT_DIPLOCATION("SW1:!1,!3")
685   PORT_DIPSETTING(    0x01, "2" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_EQUALS, 0x20)
686   PORT_DIPSETTING(    0x05, "3" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_EQUALS, 0x20)
687   PORT_DIPSETTING(    0x00, "4" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_EQUALS, 0x20)
688   PORT_DIPSETTING(    0x04, "5" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_EQUALS, 0x20)
689   PORT_DIPSETTING(    0x01, "4" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_NOTEQUALS, 0x20)
690   PORT_DIPSETTING(    0x05, "5" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_NOTEQUALS, 0x20)
691   PORT_DIPSETTING(    0x00, "6" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_NOTEQUALS, 0x20)
692   PORT_DIPSETTING(    0x04, "7" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_NOTEQUALS, 0x20)
685   PORT_DIPSETTING(    0x01, "2" ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x20)
686   PORT_DIPSETTING(    0x05, "3" ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x20)
687   PORT_DIPSETTING(    0x00, "4" ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x20)
688   PORT_DIPSETTING(    0x04, "5" ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x20)
689   PORT_DIPSETTING(    0x01, "4" ) PORT_CONDITION("DSW1", 0x20, NOTEQUALS, 0x20)
690   PORT_DIPSETTING(    0x05, "5" ) PORT_CONDITION("DSW1", 0x20, NOTEQUALS, 0x20)
691   PORT_DIPSETTING(    0x00, "6" ) PORT_CONDITION("DSW1", 0x20, NOTEQUALS, 0x20)
692   PORT_DIPSETTING(    0x04, "7" ) PORT_CONDITION("DSW1", 0x20, NOTEQUALS, 0x20)
693693   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW1:!4")
694694   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
695695   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
r15082r15083
857857static INTERRUPT_GEN( joinem_vblank_irq )
858858{
859859    /* TODO: looks hackish to me ... */
860   if (!(input_port_read(device->machine(), "IN2") & 0x80))
860   if (!(device->machine().root_device().ioport("IN2")->read() & 0x80))
861861      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
862862}
863863
src/mame/drivers/dogfgt.c
r15082r15083
160160   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
161161   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
162162   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
163   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
163   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
164164
165165/*  Manual shows:
166166
src/mame/drivers/taitosj.c
r15082r15083
290290      port_tag = "GEARP2";
291291
292292   /* gear MUST be 1, 2 or 3 */
293   if (input_port_read(machine(), port_tag) & 0x01) m_kikstart_gears[player] = 0x02;
294   if (input_port_read(machine(), port_tag) & 0x02) m_kikstart_gears[player] = 0x03;
295   if (input_port_read(machine(), port_tag) & 0x04) m_kikstart_gears[player] = 0x01;
293   if (ioport(port_tag)->read() & 0x01) m_kikstart_gears[player] = 0x02;
294   if (ioport(port_tag)->read() & 0x02) m_kikstart_gears[player] = 0x03;
295   if (ioport(port_tag)->read() & 0x04) m_kikstart_gears[player] = 0x01;
296296
297297   return m_kikstart_gears[player];
298298}
src/mame/drivers/nbmj8991.c
r15082r15083
3838#include "machine/nvram.h"
3939
4040
41#define SIGNED_DAC   0      // 0:unsigned DAC, 1:signed DAC
42#if SIGNED_DAC
43#define DAC_WRITE   dac_signed_w
44#else
45#define DAC_WRITE   dac_w
46#endif
47
48
4941WRITE8_MEMBER(nbmj8991_state::nbmj8991_soundbank_w)
5042{
5143   if (!(data & 0x80)) soundlatch_clear_byte_w(space, 0, 0);
r15082r15083
261253   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
262254   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
263255   AM_RANGE(0xc0, 0xc0) AM_READWRITE_LEGACY(nb1413m3_inputport3_r,nb1413m3_nmi_clock_w)
264   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
256   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
265257//  AM_RANGE(0xe0, 0xe0) AM_WRITENOP
266258   AM_RANGE(0xf0, 0xf0) AM_READWRITE_LEGACY(nb1413m3_dipsw1_r,nb1413m3_outcoin_w)
267259   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
276268   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
277269   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
278270   AM_RANGE(0xc0, 0xc0) AM_READWRITE_LEGACY(nb1413m3_inputport3_r,nb1413m3_nmi_clock_w)
279   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
271   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
280272//  AM_RANGE(0xe0, 0xe0) AM_WRITENOP
281273   AM_RANGE(0xf0, 0xf0) AM_READWRITE_LEGACY(nb1413m3_dipsw1_r,nb1413m3_outcoin_w)
282274   AM_RANGE(0xf1, 0xf1) AM_READ_LEGACY(nb1413m3_dipsw2_r)
r15082r15083
318310
319311static ADDRESS_MAP_START( nbmj8991_sound_io_map, AS_IO, 8, nbmj8991_state )
320312   ADDRESS_MAP_GLOBAL_MASK(0xff)
321   AM_RANGE(0x00, 0x00) AM_READ(nbmj8991_sound_r) AM_DEVWRITE_LEGACY("dac1", DAC_WRITE)
322   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("dac2", DAC_WRITE)
313   AM_RANGE(0x00, 0x00) AM_READ(nbmj8991_sound_r) AM_DEVWRITE_LEGACY("dac1", dac_w)
314   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("dac2", dac_w)
323315   AM_RANGE(0x04, 0x04) AM_WRITE(nbmj8991_soundbank_w)
324316   AM_RANGE(0x06, 0x06) AM_WRITENOP
325317   AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("fmsnd", ym3812_w)
src/mame/drivers/galivan.c
r15082r15083
10851085   galivan_state *state = machine.driver_data<galivan_state>();
10861086   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
10871087   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x7fff, "bank3");
1088   state->membank("bank3")->set_base(machine.root_device().memregion("maincpu")->base());
1088   state->membank("bank3")->set_base(state->memregion("maincpu")->base());
10891089
10901090   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank2");
10911091   state->membank("bank2")->configure_entries(0, 2, state->memregion("user2")->base(), 0x4000);
src/mame/drivers/meyc8088.c
r15082r15083
1010  also thanks to Darrell Hal Smith, Kevin Mullins
1111
1212
13  To initialize battery RAM, go into Meter Read mode (F1 -> 9),
14  and then press the Meter Read + Reset buttons (9 + 0).
15
16  If a game is not turned off properly, eg. exiting MAME
17  in mid-game, it may run faulty on the next boot.
18  Enable the Night Switch to prevent this.
19
20
1321  TODO:
14  - fix vblank failure
15    * dox note: to boot it in debugger, set bp ff5ec, and then ip=f5fe
1622  - coincounters/hopper
1723
1824****************************************************************/
r15082r15083
2430#include "sound/dac.h"
2531#include "video/resnet.h"
2632
33#include "gldarrow.lh"
34
35
2736class meyc8088_state : public driver_device
2837{
2938public:
3039   meyc8088_state(const machine_config &mconfig, device_type type, const char *tag)
3140      : driver_device(mconfig, type, tag) ,
3241      m_maincpu(*this,"maincpu"),
33      m_vram(*this, "vram")
42      m_vram(*this, "vram"),
43      m_heartbeat(*this, "heartbeat")
3444   { }
3545
3646   required_device<cpu_device> m_maincpu;
3747   required_shared_ptr<UINT8> m_vram;
48   required_device<timer_device> m_heartbeat;
3849
3950   UINT8 m_status;
4051   UINT8 m_common;
r15082r15083
148159
149160***************************************************************************/
150161
162TIMER_DEVICE_CALLBACK( heartbeat_callback )
163{
164   meyc8088_state *state = timer.machine().driver_data<meyc8088_state>();
165   state->m_status |= 0x20;
166}
167
151168WRITE8_MEMBER(meyc8088_state::drive_w)
152169{
170   // drivers go into high-impedance state ~100ms after write (LS374 /OC)
153171   m_status &= ~0x20;
172   m_heartbeat->adjust(attotime::from_msec(100));
154173
155174   // d0-d3: DC counter drivers
156175   // d4-d7: AC motor drivers
r15082r15083
203222   UINT8 ret = 0xff;
204223
205224   // multiplexed switch inputs
206   if (~state->m_common & 1) ret &= input_port_read_safe(device->machine(), "C0", 0); // bit switches
207   if (~state->m_common & 2) ret &= input_port_read_safe(device->machine(), "C1", 0); // control switches
208   if (~state->m_common & 4) ret &= input_port_read_safe(device->machine(), "C2", 0); // light switches
209   if (~state->m_common & 8) ret &= input_port_read_safe(device->machine(), "C3", 0); // light switches
225   if (~state->m_common & 1) ret &= state->ioport("C0")->read_safe(0); // bit switches
226   if (~state->m_common & 2) ret &= state->ioport("C1")->read_safe(0); // control switches
227   if (~state->m_common & 4) ret &= state->ioport("C2")->read_safe(0); // light switches
228   if (~state->m_common & 8) ret &= state->ioport("C3")->read_safe(0); // light switches
210229
211230   return ret;
212231}
r15082r15083
221240   // d3: N/C
222241   // d4: battery ok
223242   // d5: /drive on
224   return (state->m_status & 7) | 0x18;
243   return (state->m_status & 0x27) | 0x18;
225244}
226245
227246
r15082r15083
229248{
230249   // lite 1-8
231250   for (int i = 0; i < 8; i++)
232      output_set_lamp_value(i, data >> i & 1);
251      output_set_lamp_value(i, ~data >> i & 1);
233252}
234253
235254static WRITE8_DEVICE_HANDLER(meyc8088_lights2_w)
236255{
237256   // lite 9-16
238257   for (int i = 0; i < 8; i++)
239      output_set_lamp_value(i + 8, data >> i & 1);
258      output_set_lamp_value(i + 8, ~data >> i & 1);
240259}
241260
242261static WRITE8_DEVICE_HANDLER(meyc8088_common_w)
r15082r15083
292311
293312static INPUT_PORTS_START( gldarrow )
294313   PORT_START("SW")
295   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
314   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
296315   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
297316   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) // coin4
298317   PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
351370static MACHINE_CONFIG_START( meyc8088, meyc8088_state )
352371
353372   /* basic machine hardware */
354   MCFG_CPU_ADD("maincpu", I8088, XTAL_15MHz / 3)
373   MCFG_CPU_ADD("maincpu", I8088, (XTAL_15MHz / 3) * 0.95) // NOTE: underclocked to prevent errors on diagnostics, MAME i8088 cycle timing is probably inaccurate
355374   MCFG_CPU_PROGRAM_MAP(meyc8088_map)
356375
357376   MCFG_I8155_ADD("i8155_1", XTAL_15MHz / (3*1), i8155_intf[0])
r15082r15083
359378
360379   MCFG_NVRAM_ADD_0FILL("nvram")
361380
381   MCFG_TIMER_ADD("heartbeat", heartbeat_callback)
382
362383   /* video hardware */
363384   MCFG_SCREEN_ADD("screen", RASTER)
364385   MCFG_SCREEN_RAW_PARAMS(XTAL_15MHz/3, 320, 0, 256, 261, 0, 224)
r15082r15083
387408ROM_END
388409
389410
390GAME( 1984, gldarrow, 0,        meyc8088, gldarrow, 0, ROT0,  "Meyco Games, Inc.", "Golden Arrow (Standard G8-03)", GAME_NOT_WORKING )
411GAMEL(1984, gldarrow, 0,        meyc8088, gldarrow, 0, ROT0,  "Meyco Games, Inc.", "Golden Arrow (Standard G8-03)", 0, layout_gldarrow )
src/mame/drivers/deshoros.c
r15082r15083
8181   switch(offset)
8282   {
8383      case 0x00: return 0xff; //printer read
84      case 0x03: return input_port_read(machine(), "KEY0" );
85      case 0x04: return input_port_read(machine(), "KEY1" );
86      case 0x05: return input_port_read(machine(), "SYSTEM" );
84      case 0x03: return ioport("KEY0" )->read();
85      case 0x04: return ioport("KEY1" )->read();
86      case 0x05: return ioport("SYSTEM" )->read();
8787      case 0x0a: return m_io_ram[offset]; //"buzzer" 0 read
8888      case 0x0b: return m_io_ram[offset]; //"buzzer" 1 read
8989   }
src/mame/drivers/canyon.c
r15082r15083
6767{
6868   UINT8 val = 0;
6969
70   if ((input_port_read(machine(), "IN2") >> (offset & 7)) & 1)
70   if ((ioport("IN2")->read() >> (offset & 7)) & 1)
7171      val |= 0x80;
7272
73   if ((input_port_read(machine(), "IN1") >> (offset & 3)) & 1)
73   if ((ioport("IN1")->read() >> (offset & 3)) & 1)
7474      val |= 0x01;
7575
7676   return val;
r15082r15083
7979
8080READ8_MEMBER(canyon_state::canyon_options_r)
8181{
82   return (input_port_read(machine(), "DSW") >> (2 * (~offset & 3))) & 3;
82   return (ioport("DSW")->read() >> (2 * (~offset & 3))) & 3;
8383}
8484
8585
r15082r15083
160160   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
161161   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
162162   PORT_SERVICE( 0x10, IP_ACTIVE_HIGH )
163   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_VBLANK )
163   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
164164   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Hiscore Reset") PORT_CODE(KEYCODE_H)
165165   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_TILT ) /* SLAM */
166166
src/mame/drivers/splash.c
r15082r15083
10561056static DRIVER_INIT( funystrp )
10571057{
10581058   splash_state *state = machine.driver_data<splash_state>();
1059   UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
1059   UINT16 *ROM = (UINT16 *)state->memregion("maincpu")->base();
10601060
10611061   state->m_bitmap_type = 0;
10621062   state->m_sprite_attr2_shift = 0;
src/mame/drivers/subsino2.c
r15082r15083
786786
787787READ8_MEMBER(subsino2_state::dsw_r)
788788{
789   return   ( (input_port_read(machine(), "DSW1") & m_dsw_mask) ? 0x01 : 0 ) |
790         ( (input_port_read(machine(), "DSW2") & m_dsw_mask) ? 0x02 : 0 ) |
791         ( (input_port_read(machine(), "DSW3") & m_dsw_mask) ? 0x04 : 0 ) |
792         ( (input_port_read(machine(), "DSW4") & m_dsw_mask) ? 0x08 : 0 ) ;
789   return   ( (ioport("DSW1")->read() & m_dsw_mask) ? 0x01 : 0 ) |
790         ( (ioport("DSW2")->read() & m_dsw_mask) ? 0x02 : 0 ) |
791         ( (ioport("DSW3")->read() & m_dsw_mask) ? 0x04 : 0 ) |
792         ( (ioport("DSW4")->read() & m_dsw_mask) ? 0x08 : 0 ) ;
793793}
794794
795795
r15082r15083
915915
916916   for (i = 0; i < 5; i++)
917917      if (m_bishjan_input & (1 << i))
918         res = input_port_read(machine(), port[i]);
918         res = ioport(port[i])->read();
919919
920920   return   (res << 8) |                           // high byte
921         input_port_read(machine(), "SYSTEM") |      // low byte
921         ioport("SYSTEM")->read() |      // low byte
922922         (machine().device<ticket_dispenser_device>("hopper")->read(space, 0) ? 0x00 : 0x04)   // bit 2: hopper sensor
923923   ;
924924}
src/mame/drivers/route16.c
r15082r15083
163163
164164   switch (m_ttmahjng_port_select)
165165   {
166   case 1:  ret = input_port_read(machine(), "KEY0"); break;
167   case 2:  ret = input_port_read(machine(), "KEY1"); break;
168   case 4:  ret = input_port_read(machine(), "KEY2"); break;
169   case 8:  ret = input_port_read(machine(), "KEY3"); break;
166   case 1:  ret = ioport("KEY0")->read(); break;
167   case 2:  ret = ioport("KEY1")->read(); break;
168   case 4:  ret = ioport("KEY2")->read(); break;
169   case 8:  ret = ioport("KEY3")->read(); break;
170170   default: break;
171171   }
172172
src/mame/drivers/m63.c
r15082r15083
544544   PORT_DIPSETTING(    0x04, "x1.2" )
545545   PORT_DIPSETTING(    0x08, "x1.4" )
546546   PORT_DIPSETTING(    0x0c, "x1.6" )
547   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:!5,!6") PORT_CONDITION("DSW1",0x04,PORTCOND_EQUALS,0x04) /* coin mode 2 */
547   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:!5,!6") PORT_CONDITION("DSW1",0x04,EQUALS,0x04) /* coin mode 2 */
548548   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
549549   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
550550   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
551551   PORT_DIPSETTING(    0x30, DEF_STR( Free_Play ) )   /* Not documented */
552   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:!7,!8") PORT_CONDITION("DSW1",0x04,PORTCOND_EQUALS,0x04) /* coin mode 2 */
552   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:!7,!8") PORT_CONDITION("DSW1",0x04,EQUALS,0x04) /* coin mode 2 */
553553   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
554554   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
555555   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
556556   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
557   PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:!5,!6,!7,!8") PORT_CONDITION("DSW1",0x04,PORTCOND_EQUALS,0x00) /* coin mode 1 */
557   PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:!5,!6,!7,!8") PORT_CONDITION("DSW1",0x04,EQUALS,0x00) /* coin mode 1 */
558558   PORT_DIPSETTING(    0x60, DEF_STR( 7C_1C ) )
559559   PORT_DIPSETTING(    0x50, DEF_STR( 6C_1C ) )
560560   PORT_DIPSETTING(    0x40, DEF_STR( 5C_1C ) )
r15082r15083
696696{
697697   running_machine &machine = device.machine();
698698   m63_state *state = machine.driver_data<m63_state>();
699   int i, len = machine.root_device().memregion("samples")->bytes();
699   int i, len = state->memregion("samples")->bytes();
700700   UINT8 *ROM = state->memregion("samples")->base();
701701
702702   state->m_samplebuf = auto_alloc_array(machine, INT16, len);
src/mame/drivers/tecmosys.c
r15082r15083
447447
448448static MACHINE_START( tecmosys )
449449{
450//  tecmosys_state *state = machine.driver_data<tecmosys_state>();
451   machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("audiocpu")->base(), 0x4000);
450   tecmosys_state *state = machine.driver_data<tecmosys_state>();
451   state->membank("bank1")->configure_entries(0, 16, state->memregion("audiocpu")->base(), 0x4000);
452452}
453453
454454static MACHINE_CONFIG_START( deroon, tecmosys_state )
src/mame/drivers/polyplay.c
r15082r15083
129129{
130130   polyplay_state *state = device->machine().driver_data<polyplay_state>();
131131
132   if (input_port_read(device->machine(), "INPUT") & 0x80)
132   if (state->ioport("INPUT")->read() & 0x80)
133133      state->m_last = 0;
134134   else
135135   {
src/mame/drivers/exidy440.c
r15082r15083
282282CUSTOM_INPUT_MEMBER(exidy440_state::hitnmiss_button1_r)
283283{
284284   /* button 1 shows up in two bits */
285   UINT32 button1 = input_port_read(machine(), "HITNMISS_BUTTON1");
285   UINT32 button1 = ioport("HITNMISS_BUTTON1")->read();
286286   return (button1 << 1) | button1;
287287}
288288
r15082r15083
336336{
337337   /* I/O1 accesses clear the CIRQ flip/flop */
338338   cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
339   return input_port_read(machine(), "IN3");
339   return ioport("IN3")->read();
340340}
341341
342342
r15082r15083
424424
425425READ8_MEMBER(exidy440_state::topsecex_input_port_5_r)
426426{
427   return (input_port_read(machine(), "AN1") & 1) ? 0x01 : 0x02;
427   return (ioport("AN1")->read() & 1) ? 0x01 : 0x02;
428428}
429429
430430
src/mame/drivers/dassault.c
r15082r15083
134134   switch (offset << 1)
135135   {
136136      case 0: /* Player 1 & Player 2 joysticks & fire buttons */
137         return input_port_read(machine(), "P1_P2");
137         return ioport("P1_P2")->read();
138138
139139      case 2: /* Player 3 & Player 4 joysticks & fire buttons */
140         return input_port_read(machine(), "P3_P4");
140         return ioport("P3_P4")->read();
141141
142142      case 4: /* Dip 1 (stored at 0x3f8035) */
143         return input_port_read(machine(), "DSW1");
143         return ioport("DSW1")->read();
144144
145145      case 6: /* Dip 2 (stored at 0x3f8034) */
146         return input_port_read(machine(), "DSW2");
146         return ioport("DSW2")->read();
147147
148148      case 8: /* VBL, Credits */
149         return input_port_read(machine(), "SYSTEM");
149         return ioport("SYSTEM")->read();
150150   }
151151
152152   return 0xffff;
r15082r15083
161161
162162READ16_MEMBER(dassault_state::dassault_sub_control_r)
163163{
164   return input_port_read(machine(), "VBLANK1");
164   return ioport("VBLANK1")->read();
165165}
166166
167167WRITE16_MEMBER(dassault_state::dassault_sound_w)
r15082r15083
302302   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN4 )
303303
304304   PORT_START("VBLANK1") /* Cpu 1 vblank */
305   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_VBLANK )
305   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
306306INPUT_PORTS_END
307307
308308static INPUT_PORTS_START( thndzone )
r15082r15083
312312   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
313313   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
314314   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )         // Adds 4 credits/coins !
315   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
315   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
316316   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
317317   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
318318   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
369369   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
370370   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
371371   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
372   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
372   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
373373
374374   PORT_START("DSW1")
375375   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
r15082r15083
427427   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
428428   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
429429   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
430   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
430   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
431431
432432   PORT_START("DSW1")
433433   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3")
src/mame/drivers/dambustr.c
r15082r15083
136136   PORT_DIPSETTING(    0x00, "1" )
137137   PORT_DIPSETTING(    0x40, "2" )
138138   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!2")
139   PORT_DIPSETTING(    0x80, DEF_STR( 1C_1C ) )   PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
140   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )   PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
141   PORT_DIPSETTING(    0x80, "A 1/1  B 1/2" )     PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
142   PORT_DIPSETTING(    0x00, "A 1/2  B 1/6" )     PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
139   PORT_DIPSETTING(    0x80, DEF_STR( 1C_1C ) )   PORT_CONDITION("IN1", 0x40, EQUALS, 0x00)
140   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )   PORT_CONDITION("IN1", 0x40, EQUALS, 0x00)
141   PORT_DIPSETTING(    0x80, "A 1/1  B 1/2" )     PORT_CONDITION("IN1", 0x40, EQUALS, 0x40)
142   PORT_DIPSETTING(    0x00, "A 1/2  B 1/6" )     PORT_CONDITION("IN1", 0x40, EQUALS, 0x40)
143143
144144   PORT_START("DSW")
145145   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW:!3,!4")
r15082r15083
162162
163163   PORT_MODIFY("IN1")
164164   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!2")
165   PORT_DIPSETTING(    0x80, DEF_STR( 1C_1C ) )   PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
166   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )   PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
167   PORT_DIPSETTING(    0x80, "A 1/1  B 1/6" )     PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
168   PORT_DIPSETTING(    0x00, "A 1/2  B 1/12" )    PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
165   PORT_DIPSETTING(    0x80, DEF_STR( 1C_1C ) )   PORT_CONDITION("IN1", 0x40, EQUALS, 0x00)
166   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )   PORT_CONDITION("IN1", 0x40, EQUALS, 0x00)
167   PORT_DIPSETTING(    0x80, "A 1/1  B 1/6" )     PORT_CONDITION("IN1", 0x40, EQUALS, 0x40)
168   PORT_DIPSETTING(    0x00, "A 1/2  B 1/12" )    PORT_CONDITION("IN1", 0x40, EQUALS, 0x40)
169169INPUT_PORTS_END
170170
171171
src/mame/drivers/tatsumi.c
r15082r15083
188188READ16_MEMBER(tatsumi_state::cyclwarr_input_r)
189189{
190190   static const char *const port[] = { "SERVICE", "P1", "P2", "DSW3" };
191   return input_port_read(machine(), port[offset]);
191   return ioport(port[offset])->read();
192192}
193193
194194READ16_MEMBER(tatsumi_state::cyclwarr_input2_r)
195195{
196196   static const char *const port2[] = { "DSW1", "DSW2", "P3", "P4" };
197   return input_port_read(machine(), port2[offset]);
197   return ioport(port2[offset])->read();
198198}
199199
200200WRITE16_MEMBER(tatsumi_state::cyclwarr_sound_w)
r15082r15083
12841284static DRIVER_INIT( apache3 )
12851285{
12861286   tatsumi_state *state = machine.driver_data<tatsumi_state>();
1287   UINT8 *dst = machine.root_device().memregion("gfx1")->base();
1288   UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
1287   UINT8 *dst = state->memregion("gfx1")->base();
1288   UINT8 *src1 = state->memregion("gfx2")->base();
12891289   UINT8 *src2 = state->memregion("gfx3")->base();
12901290   int i;
12911291
r15082r15083
13121312static DRIVER_INIT( roundup5 )
13131313{
13141314   tatsumi_state *state = machine.driver_data<tatsumi_state>();
1315   UINT8 *dst = machine.root_device().memregion("gfx1")->base();
1316   UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
1315   UINT8 *dst = state->memregion("gfx1")->base();
1316   UINT8 *src1 = state->memregion("gfx2")->base();
13171317   UINT8 *src2 = state->memregion("gfx3")->base();
13181318   int i;
13191319
r15082r15083
13381338static DRIVER_INIT( cyclwarr )
13391339{
13401340   tatsumi_state *state = machine.driver_data<tatsumi_state>();
1341   UINT8 *dst = machine.root_device().memregion("gfx1")->base();
1342   UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
1343   int len1 = machine.root_device().memregion("gfx2")->bytes();
1344   UINT8 *src2 = machine.root_device().memregion("gfx3")->base();
1341   UINT8 *dst = state->memregion("gfx1")->base();
1342   UINT8 *src1 = state->memregion("gfx2")->base();
1343   int len1 = state->memregion("gfx2")->bytes();
1344   UINT8 *src2 = state->memregion("gfx3")->base();
13451345   int len2 = state->memregion("gfx3")->bytes();
13461346   int i;
13471347   for (i=0; i<len1; i+=32) {
src/mame/drivers/supbtime.c
r15082r15083
3636   switch (offset << 1)
3737   {
3838      case 0:
39         return input_port_read(machine(), "INPUTS");
39         return ioport("INPUTS")->read();
4040      case 2:
41         return input_port_read(machine(), "DSW");
41         return ioport("DSW")->read();
4242      case 8:
43         return input_port_read(machine(), "COIN");
43         return ioport("COIN")->read();
4444      case 10: /* ?  Not used for anything */
4545      case 12:
4646         return 0;
r15082r15083
131131   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
132132   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
133133   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
134   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
134   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
135135   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
136136   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
137137   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
209209   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
210210   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
211211   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
212   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
212   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
213213   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
214214   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
215215   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/blmbycar.c
r15082r15083
6262{
6363
6464   if (ACCESSING_BITS_0_7)
65      m_pot_wheel = ~input_port_read(machine(), "WHEEL") & 0xff;
65      m_pot_wheel = ~ioport("WHEEL")->read() & 0xff;
6666}
6767
6868WRITE16_MEMBER(blmbycar_state::blmbycar_pot_wheel_shift_w)
r15082r15083
8686
8787READ16_MEMBER(blmbycar_state::blmbycar_opt_wheel_r)
8888{
89   return (~input_port_read(machine(), "WHEEL") & 0xff) << 8;
89   return (~ioport("WHEEL")->read() & 0xff) << 8;
9090}
9191
9292
src/mame/drivers/toratora.c
r15082r15083
148148   if (state->m_timer & 0x100)
149149      popmessage("watchdog!");
150150
151   if (state->m_last != (input_port_read(device->machine(), "INPUT") & 0x0f))
151   if (state->m_last != (state->ioport("INPUT")->read() & 0x0f))
152152   {
153      state->m_last = input_port_read(device->machine(), "INPUT") & 0x0f;
153      state->m_last = state->ioport("INPUT")->read() & 0x0f;
154154      generic_pulse_irq_line(device, 0, 1);
155155   }
156   state->m_pia_u1->set_a_input(input_port_read(device->machine(), "INPUT") & 0x0f, 0);
157   state->m_pia_u1->ca1_w(input_port_read(device->machine(), "INPUT") & 0x10);
158   state->m_pia_u1->ca2_w(input_port_read(device->machine(), "INPUT") & 0x20);
156   state->m_pia_u1->set_a_input(device->machine().root_device().ioport("INPUT")->read() & 0x0f, 0);
157   state->m_pia_u1->ca1_w(device->machine().root_device().ioport("INPUT")->read() & 0x10);
158   state->m_pia_u1->ca2_w(device->machine().root_device().ioport("INPUT")->read() & 0x20);
159159}
160160
161161READ8_MEMBER(toratora_state::timer_r)
src/mame/drivers/bogeyman.c
r15082r15083
8181   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_COCKTAIL
8282   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
8383   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
84   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
84   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
8585
8686   PORT_START("DSW1")
8787   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
src/mame/drivers/m72.c
r15082r15083
845845
846846      for (i = 0;i < 4;i++)
847847      {
848         curr = input_port_read(machine(), axisnames[i]);
848         curr = ioport(axisnames[i])->read();
849849         m_diff[i] = (curr - m_prev[i]);
850850         m_prev[i] = curr;
851851      }
r15082r15083
857857      case 0:
858858         return (m_diff[0] & 0xff) | ((m_diff[2] & 0xff) << 8);
859859      case 1:
860         return ((m_diff[0] >> 8) & 0x1f) | (m_diff[2] & 0x1f00) | (input_port_read(machine(), "IN0") & 0xe0e0);
860         return ((m_diff[0] >> 8) & 0x1f) | (m_diff[2] & 0x1f00) | (ioport("IN0")->read() & 0xe0e0);
861861      case 2:
862862         return (m_diff[1] & 0xff) | ((m_diff[3] & 0xff) << 8);
863863      case 3:
r15082r15083
11221122ADDRESS_MAP_END
11231123
11241124#define COIN_MODE_1 \
1125   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0400, PORTCOND_NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW1:5,6,7,8") \
1125   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0400, NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW1:5,6,7,8") \
11261126   PORT_DIPSETTING(      0x00a0, DEF_STR( 6C_1C ) ) \
11271127   PORT_DIPSETTING(      0x00b0, DEF_STR( 5C_1C ) ) \
11281128   PORT_DIPSETTING(      0x00c0, DEF_STR( 4C_1C ) ) \
r15082r15083
11411141   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
11421142
11431143#define COIN_MODE_2_A \
1144   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0400, PORTCOND_EQUALS, 0x0000) PORT_DIPLOCATION("SW1:5,6") \
1144   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0400, EQUALS, 0x0000) PORT_DIPLOCATION("SW1:5,6") \
11451145   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) ) \
11461146   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) ) \
11471147   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) ) \
11481148   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) ) \
1149   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0400, PORTCOND_EQUALS, 0x0000) PORT_DIPLOCATION("SW1:7,8") \
1149   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0400, EQUALS, 0x0000) PORT_DIPLOCATION("SW1:7,8") \
11501150   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) ) \
11511151   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) ) \
11521152   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_5C ) ) \
r15082r15083
14261426   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
14271427   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
14281428   PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2")
1429   PORT_DIPSETTING(      0x0000, "Upright (single)" )      PORT_CONDITION("DSW", 0x1000, PORTCOND_NOTEQUALS, 0x0000)
1430   PORT_DIPSETTING(      0x0200, DEF_STR( Cocktail ) )      PORT_CONDITION("DSW", 0x1000, PORTCOND_NOTEQUALS, 0x0000)
1431   PORT_DIPSETTING(      0x0000, "Upright (double) On" )   PORT_CONDITION("DSW", 0x1000, PORTCOND_EQUALS, 0x0000)
1432   PORT_DIPSETTING(      0x0200, "Upright (double) Off" )   PORT_CONDITION("DSW", 0x1000, PORTCOND_EQUALS, 0x0000)
1429   PORT_DIPSETTING(      0x0000, "Upright (single)" )      PORT_CONDITION("DSW", 0x1000, NOTEQUALS, 0x0000)
1430   PORT_DIPSETTING(      0x0200, DEF_STR( Cocktail ) )      PORT_CONDITION("DSW", 0x1000, NOTEQUALS, 0x0000)
1431   PORT_DIPSETTING(      0x0000, "Upright (double) On" )   PORT_CONDITION("DSW", 0x1000, EQUALS, 0x0000)
1432   PORT_DIPSETTING(      0x0200, "Upright (double) Off" )   PORT_CONDITION("DSW", 0x1000, EQUALS, 0x0000)
14331433   PORT_DIPNAME( 0x0400, 0x0400, "Coin Mode" ) PORT_DIPLOCATION("SW2:3")
14341434   PORT_DIPSETTING(      0x0400, "Mode 1" )
14351435   PORT_DIPSETTING(      0x0000, "Mode 2" )
r15082r15083
16211621   PORT_DIPSETTING(      0x0800, "Mode 1" )
16221622   PORT_DIPSETTING(      0x0000, "Mode 2" )
16231623   /* Coin Mode 1 */
1624   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, PORTCOND_NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6,7,8")
1624   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6,7,8")
16251625   PORT_DIPSETTING(      0xa000, DEF_STR( 6C_1C ) )
16261626   PORT_DIPSETTING(      0xb000, DEF_STR( 5C_1C ) )
16271627   PORT_DIPSETTING(      0xc000, DEF_STR( 4C_1C ) )
r15082r15083
16831683   PORT_DIPSETTING(      0x0800, "Mode 1" )
16841684   PORT_DIPSETTING(      0x0000, "Mode 2" )
16851685   /* Coin Mode 1 */
1686   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, PORTCOND_NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6,7,8")
1686   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6,7,8")
16871687   PORT_DIPSETTING(      0xa000, DEF_STR( 6C_1C ) )
16881688   PORT_DIPSETTING(      0xb000, DEF_STR( 5C_1C ) )
16891689   PORT_DIPSETTING(      0xc000, DEF_STR( 4C_1C ) )
src/mame/drivers/crgolf.c
r15082r15083
9090{
9191   static const char *const portnames[] = { "IN0", "IN1", "P1", "P2", "DSW", "UNUSED0", "UNUSED1" };
9292
93   return input_port_read(machine(), portnames[m_port_select]);
93   return ioport(portnames[m_port_select])->read();
9494}
9595
9696
9797READ8_MEMBER(crgolf_state::analog_input_r)
9898{
99   return ((input_port_read(machine(), "STICK0") >> 4) | (input_port_read(machine(), "STICK1") & 0xf0)) ^ 0x88;
99   return ((ioport("STICK1")->read() & 0xf0)) ^ 0x88;
100100}
101101
102102
src/mame/drivers/rmhaihai.c
r15082r15083
114114
115115         for (i = 0; i < 31; i++)
116116         {
117            if (input_port_read(machine(), keynames[i/16]) & (1 << (i & 15))) return i+1;
117            if (ioport(keynames[i/16])->read() & (1 << (i & 15))) return i+1;
118118         }
119         if (input_port_read(machine(), "KEY1") & 0x8000) return 0x80;   // coin
119         if (ioport("KEY1")->read() & 0x8000) return 0x80;   // coin
120120         return 0;
121121      }
122122      case 0x5c7b:   // rmhaihai, rmhaisei, rmhaijin
src/mame/drivers/topspeed.c
r15082r15083
324324{
325325   UINT8 port = tc0220ioc_port_r(m_tc0220ioc, 0);   /* read port number */
326326   int steer = 0;
327   int analogue_steer = input_port_read_safe(machine(), STEER_PORT_TAG, 0x00);
328   int fake = input_port_read_safe(machine(), FAKE_PORT_TAG, 0x00);
327   int analogue_steer = ioport(STEER_PORT_TAG)->read_safe(0x00);
328   int fake = ioport(FAKE_PORT_TAG)->read_safe(0x00);
329329
330330   if (!(fake & 0x10))   /* Analogue steer (the real control method) */
331331   {
src/mame/drivers/segae.c
r15082r15083
487487   temp = 0;
488488
489489   if (m_port_fa_last == 0x08)  /* 0000 1000 */ /* Angle */
490      temp = input_port_read(machine(), "IN2");
490      temp = ioport("IN2")->read();
491491
492492   if (m_port_fa_last == 0x09)  /* 0000 1001 */ /* Accel */
493      temp = input_port_read(machine(), "IN3");
493      temp = ioport("IN3")->read();
494494
495495   return temp;
496496}
r15082r15083
524524
525525   if (data & 1)
526526   {
527      int curr = input_port_read(machine(), "IN2");
527      int curr = ioport("IN2")->read();
528528      m_diff1 = ((curr - m_last1) & 0x0fff) | (curr & 0xf000);
529529      m_last1 = curr;
530530   }
531531   if (data & 2)
532532   {
533      int curr = input_port_read(machine(), "IN3") & 0x0fff;
533      int curr = ioport("IN3")->read() & 0x0fff;
534534      m_diff2 = ((curr - m_last2) & 0x0fff) | (curr & 0xf000);
535535      m_last2 = curr;
536536   }
src/mame/drivers/amspdwy.c
r15082r15083
3838{
3939   amspdwy_state *state = machine.driver_data<amspdwy_state>();
4040   static const char *const portnames[] = { "WHEEL1", "WHEEL2", "AN1", "AN2" };
41   UINT8 wheel = input_port_read(machine, portnames[2 + index]);
41   UINT8 wheel = machine.root_device().ioport(portnames[2 + index])->read();
4242   if (wheel != state->m_wheel_old[index])
4343   {
4444      wheel = (wheel & 0x7fff) - (wheel & 0x8000);
r15082r15083
4949
5050   state->m_wheel_old[index] = wheel;
5151   }
52   return state->m_wheel_return[index] | input_port_read(machine, portnames[index]);
52   return state->m_wheel_return[index] | machine.root_device().ioport(portnames[index])->read();
5353}
5454
5555READ8_MEMBER(amspdwy_state::amspdwy_wheel_0_r)
r15082r15083
6464
6565static READ8_DEVICE_HANDLER( amspdwy_sound_r )
6666{
67   return (ym2151_status_port_r(device, 0) & ~ 0x30) | input_port_read(device->machine(), "IN0");
67   return (ym2151_status_port_r(device, 0) & ~ 0x30) | device->machine().root_device().ioport("IN0")->read();
6868}
6969
7070WRITE8_MEMBER(amspdwy_state::amspdwy_sound_w)
src/mame/drivers/fantland.c
r15082r15083
179179{
180180   int x, y, f;
181181
182   switch (input_port_read(machine(), "Controls") & 0x03)
182   switch (ioport("Controls")->read() & 0x03)
183183   {
184184      case 3:
185      case 1:   return input_port_read(machine(), offset ? "P2_GUN" : "P1_GUN");   // Lightgun buttons
186      case 2:   return input_port_read(machine(), offset ? "P2_JOY" : "P1_JOY");   // Joystick
185      case 1:   return ioport(offset ? "P2_GUN" : "P1_GUN")->read();   // Lightgun buttons
186      case 2:   return ioport(offset ? "P2_JOY" : "P1_JOY")->read();   // Joystick
187187   }
188188
189189   // Trackball
190190
191   x = input_port_read(machine(), offset ? "P2 Trackball X" : "P1 Trackball X");
192   y = input_port_read(machine(), offset ? "P2 Trackball Y" : "P1 Trackball Y");
191   x = ioport(offset ? "P2 Trackball X" : "P1 Trackball X")->read();
192   y = ioport(offset ? "P2 Trackball Y" : "P1 Trackball Y")->read();
193193   f = machine().primary_screen->frame_number();
194194
195   m_input_ret[offset] = (m_input_ret[offset] & 0x14) | (input_port_read(machine(), offset ? "P2_TRACK" : "P1_TRACK") & 0xc3);
195   m_input_ret[offset] = (m_input_ret[offset] & 0x14) | (ioport(offset ? "P2_TRACK" : "P1_TRACK")->read() & 0xc3);
196196
197197   x = (x & 0x7f) - (x & 0x80);
198198   y = (y & 0x7f) - (y & 0x80);
r15082r15083
368368   if (!state->m_adpcm_playing[voice])
369369      return;
370370
371   rom = device->machine().root_device().memregion("adpcm")->base();
371   rom = state->memregion("adpcm")->base();
372372   len = state->memregion("adpcm")->bytes() * 2;
373373
374374   start = state->m_adpcm_addr[0][voice] + state->m_adpcm_nibble[voice];
r15082r15083
585585
586586static INPUT_PORTS_START( borntofi )
587587   PORT_START("P1_GUN")   /* 53000 (Lightgun) */
588   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
589   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
590   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
591   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
592   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
593   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
594   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
595   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
588   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
589   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
590   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
591   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
592   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
593   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
594   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
595   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
596596
597597   PORT_START("P2_GUN")   /* 53001 (Lightgun) */
598   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
599   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
600   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03) PORT_PLAYER(2)
601   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03) PORT_PLAYER(2)
602   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
603   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
604   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
605   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
598   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
599   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
600   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03) PORT_PLAYER(2)
601   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03) PORT_PLAYER(2)
602   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
603   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
604   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
605   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
606606
607607   PORT_START("P1_TRACK")   /* 53000 (Trackball) */
608   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
609   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_START1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
610   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball x
611   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball x
612   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball y
613   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball y
614   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
615   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
608   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
609   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_START1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
610   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball x
611   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball x
612   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball y
613   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball y
614   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
615   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
616616
617617   PORT_START("P2_TRACK")   /* 53001 (Trackball) */
618   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
619   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_START2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
620   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball x
621   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball x
622   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball y
623   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball y
624   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) PORT_PLAYER(2)
625   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) PORT_PLAYER(2)
618   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
619   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_START2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
620   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball x
621   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball x
622   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball y
623   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball y
624   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) PORT_PLAYER(2)
625   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) PORT_PLAYER(2)
626626
627627   PORT_START("P1_JOY")   /* 53000 (Joystick) */
628   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
629   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
630   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
631   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
632   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
633   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
634   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
635   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
628   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
629   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
630   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
631   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
632   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
633   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
634   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
635   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
636636
637637   PORT_START("P2_JOY")   /* 53001 (Joystick) */
638   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
639   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
640   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
641   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
642   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
643   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
644   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
645   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
638   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
639   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
640   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
641   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
642   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
643   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
644   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
645   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
646646
647647   PORT_START("DSW")   /* 53002 */
648648   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )      PORT_DIPLOCATION("DSW1:1,2,3")
r15082r15083
721721CUSTOM_INPUT_MEMBER(fantland_state::wheelrun_wheel_r)
722722{
723723   int player = (FPTR)param;
724   int delta = input_port_read(machine(), player ? "WHEEL1" : "WHEEL0");
724   int delta = ioport(player ? "WHEEL1" : "WHEEL0")->read();
725725   delta = (delta & 0x7f) - (delta & 0x80) + 4;
726726
727727   if      (delta > 7)   delta = 7;
src/mame/drivers/atarig1.c
r15082r15083
9292
9393READ16_MEMBER(atarig1_state::special_port0_r)
9494{
95   int temp = input_port_read(machine(), "IN0");
95   int temp = ioport("IN0")->read();
9696   if (m_cpu_to_sound_ready) temp ^= 0x1000;
9797   temp ^= 0x2000;      /* A2DOK always high for now */
9898   return temp;
r15082r15083
111111
112112   /* Pit Fighter has no A2D, just another input port */
113113   if (m_is_pitfight)
114      return input_port_read(machine(), "ADC0");
114      return ioport("ADC0")->read();
115115
116116   /* otherwise, assume it's hydra */
117117   if (m_which_input < 3)
118      return input_port_read(machine(), adcnames[m_which_input]) << 8;
118      return ioport(adcnames[m_which_input])->read() << 8;
119119
120120   return 0;
121121}
r15082r15083
247247   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
248248   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
249249   PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
250   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK )
250   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
251251
252252   PORT_START("ADC0")      /* ADC 0 @ fc8000 */
253253   PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
r15082r15083
279279   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
280280   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
281281   PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
282   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK )
282   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
283283
284284   PORT_START("ADC0")      /* fc8000 */
285285   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
r15082r15083
324324   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
325325   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
326326   PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
327   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK )
327   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
328328
329329   PORT_START("ADC0")      /* fc8000 */
330330   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/toobin.c
r15082r15083
9090
9191READ16_MEMBER(toobin_state::special_port1_r)
9292{
93   int result = input_port_read(machine(), "FF9000");
93   int result = ioport("FF9000")->read();
9494   if (atarigen_get_hblank(*machine().primary_screen)) result ^= 0x8000;
9595   if (m_cpu_to_sound_ready) result ^= 0x2000;
9696   return result;
r15082r15083
158158   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
159159   PORT_SERVICE( 0x1000, IP_ACTIVE_LOW )
160160   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
161   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_VBLANK )
161   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
162162   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
163163
164164   PORT_INCLUDE( atarijsa_i )      /* audio port */
src/mame/drivers/midas.c
r15082r15083
299299
300300READ16_MEMBER(midas_state::hammer_sensor_r)
301301{
302   if (input_port_read(machine(), "HAMMER") & 0x80)
302   if (ioport("HAMMER")->read() & 0x80)
303303      return 0xffff;
304304
305   return (input_port_read(machine(), "SENSORY") << 8) | input_port_read(machine(), "SENSORX");
305   return (ioport("SENSORY")->read() << 8) | ioport("SENSORX")->read();
306306}
307307
308308WRITE16_MEMBER(midas_state::hammer_coin_w)
src/mame/drivers/aristmk4.c
r15082r15083
321321    There are 4 possible combinations for colour select via SW7, colours vary based on software installed.
322322    */
323323
324   switch(input_port_read(machine, "SW7"))
324   switch(state->ioport("SW7")->read())
325325   {
326326   case 0x00:
327327      // restore defaults
r15082r15083
380380READ8_MEMBER(aristmk4_state::ldsw)
381381{
382382
383   int U3_p2_ret= input_port_read(machine(), "5002");
383   int U3_p2_ret= ioport("5002")->read();
384384   if(U3_p2_ret & 0x1)
385385   {
386386   return 0;
387387   }
388   return m_cgdrsw = input_port_read(machine(), "5005");
388   return m_cgdrsw = ioport("5005")->read();
389389}
390390
391391READ8_MEMBER(aristmk4_state::cgdrr)
r15082r15083
420420READ8_MEMBER(aristmk4_state::u3_p2)
421421{
422422
423   int u3_p2_ret= input_port_read(machine(), "5002");
424   int u3_p3_ret= input_port_read(machine(), "5003");
423   int u3_p2_ret= ioport("5002")->read();
424   int u3_p3_ret= ioport("5003")->read();
425425
426426   output_set_lamp_value(19, (u3_p2_ret >> 4) & 1); //auditkey light
427427   output_set_lamp_value(20, (u3_p3_ret >> 2) & 1); //jackpotkey light
r15082r15083
434434
435435   if (m_inscrd==0)
436436   {
437      m_inscrd=input_port_read(machine(), "insertcoin");
437      m_inscrd=ioport("insertcoin")->read();
438438   }
439439
440440   if (m_inscrd==1)
r15082r15083
446446READ8_MEMBER(aristmk4_state::u3_p3)
447447{
448448
449    int u3_p3_ret= input_port_read(machine(), "5003");
449    int u3_p3_ret= ioport("5003")->read();
450450
451451    if ((m_printer_motor)==1) // Printer Motor Off
452452
r15082r15083
474474   switch(m_insnote)
475475   {
476476   case 0x01:
477      bv_p0_ret=input_port_read(machine(), "NS")+0x81; //check note selector
477      bv_p0_ret=ioport("NS")->read()+0x81; //check note selector
478478      m_insnote++;
479479      break;
480480   case 0x02:
r15082r15083
496496   int bv_p1_ret=0x00;
497497
498498   if (m_insnote==0)
499      m_insnote=input_port_read(machine(), "insertnote");
499      m_insnote=ioport("insertnote")->read();
500500
501501   if (m_insnote==1)
502502         bv_p1_ret=0x08;
r15082r15083
645645{
646646   aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
647647
648   int ret=input_port_read(device->machine(), "via_port_b");
648   int ret=state->ioport("via_port_b")->read();
649649
650650// Not expecting to read anything from port B on the AY8910's ( controls BC1, BC2 and BDIR )
651651// However there are extra 4 bits not going to the AY8910's on the schematics, which get read from here.
r15082r15083
15611561
15621562static READ8_DEVICE_HANDLER(pa1_r)
15631563{
1564   return (input_port_read(device->machine(), "SW3") << 4) + input_port_read(device->machine(), "SW4");
1564   return (device->machine().root_device().ioport("SW3")->read() << 4) + device->machine().root_device().ioport("SW4")->read();
15651565}
15661566
15671567static READ8_DEVICE_HANDLER(pb1_r)
15681568{
1569   return (input_port_read(device->machine(), "SW5") << 4) + input_port_read(device->machine(), "SW6");
1569   return (device->machine().root_device().ioport("SW5")->read() << 4) + device->machine().root_device().ioport("SW6")->read();
15701570}
15711571
15721572static READ8_DEVICE_HANDLER(pc1_r)
r15082r15083
16301630static MACHINE_RESET( aristmk4 )
16311631{
16321632   /* mark 4 has a link on the motherboard to switch between 1.5MHz and 3MHz clock speed */
1633   switch(input_port_read(machine, "LK13"))  // CPU speed control... 3mhz or 1.5MHz
1633   switch(machine.root_device().ioport("LK13")->read())  // CPU speed control... 3mhz or 1.5MHz
16341634   {
16351635   case 0x00:
16361636      machine.device("maincpu")->set_unscaled_clock(MAIN_CLOCK/4);  // 3 MHz
r15082r15083
16591659    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 )
16601660    */
16611661
1662   if(input_port_read(timer.machine(), "powerfail")) // send NMI signal if L pressed
1662   if(timer.machine().root_device().ioport("powerfail")->read()) // send NMI signal if L pressed
16631663   {
16641664   cputag_set_input_line( timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE );
16651665   }
src/mame/drivers/videopin.c
r15082r15083
2525static void update_plunger(running_machine &machine)
2626{
2727   videopin_state *state = machine.driver_data<videopin_state>();
28   UINT8 val = input_port_read(machine, "IN2");
28   UINT8 val = state->ioport("IN2")->read();
2929
3030   if (state->m_prev != val)
3131   {
r15082r15083
9494   // signals received. This results in the MPU displaying the
9595   // ball being shot onto the playfield at a certain speed.
9696
97   UINT8 val = input_port_read(machine(), "IN1");
97   UINT8 val = ioport("IN1")->read();
9898
9999   if (plunger >= 0.000 && plunger <= 0.001)
100100   {
r15082r15083
258258   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
259259   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
260260   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Nudge") PORT_CODE(KEYCODE_SPACE)
261   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
261   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
262262
263263   PORT_START("IN2")
264264   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Ball Shooter") PORT_CODE(KEYCODE_DOWN)
src/mame/drivers/runaway.c
r15082r15083
5050{
5151   UINT8 val = 0;
5252
53   if (input_port_read(machine(), "3000D7") & (1 << offset))
53   if (ioport("3000D7")->read() & (1 << offset))
5454   {
5555      val |= 0x80;
5656   }
57   if (input_port_read(machine(), "3000D6") & (1 << offset))
57   if (ioport("3000D6")->read() & (1 << offset))
5858   {
5959      val |= 0x40;
6060   }
r15082r15083
6565
6666static READ8_DEVICE_HANDLER( runaway_pot_r )
6767{
68   return (input_port_read(device->machine(), "7000") << (7 - offset)) & 0x80;
68   return (device->machine().root_device().ioport("7000")->read() << (7 - offset)) & 0x80;
6969}
7070
7171
r15082r15083
107107static INPUT_PORTS_START( qwak )
108108   PORT_START("3000D7")   /* 3000 D7 */
109109   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
110   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_VBLANK )
110   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
111111   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
112112   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
113113   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
159159static INPUT_PORTS_START( runaway )
160160   PORT_START("3000D7") /* 3000 D7 */
161161   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
162   PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_VBLANK )
162   PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
163163   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_TILT )
164164   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
165165   PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
src/mame/drivers/toypop.c
r15082r15083
306306   PORT_DIPSETTING(    0x1c, "40k 120k 200k 400k 600k 1m" )
307307   PORT_DIPSETTING(    0x0c, "40k 140k 250k 400k 700k 1m" )
308308   // bonus scores for 1, 2 or 3 lives
309   PORT_DIPSETTING(    0x14, "50k 150k 300k 500k 700k 1m" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
310   PORT_DIPSETTING(    0x04, "40k 120k and every 120k" )    PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
311   PORT_DIPSETTING(    0x18, "40k 150k and every 150k" )    PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
312   PORT_DIPSETTING(    0x08, "50k 150k 300k" )              PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
313   PORT_DIPSETTING(    0x10, "40k 120k 200k" )              PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
309   PORT_DIPSETTING(    0x14, "50k 150k 300k 500k 700k 1m" ) PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
310   PORT_DIPSETTING(    0x04, "40k 120k and every 120k" )    PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
311   PORT_DIPSETTING(    0x18, "40k 150k and every 150k" )    PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
312   PORT_DIPSETTING(    0x08, "50k 150k 300k" )              PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
313   PORT_DIPSETTING(    0x10, "40k 120k 200k" )              PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
314314   // bonus scores for 5 lives
315   PORT_DIPSETTING(    0x14, "40k 120k" )                   PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
316   PORT_DIPSETTING(    0x04, "50k 150k" )                   PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
317   PORT_DIPSETTING(    0x18, "50k 150k and every 150k" )    PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
318   PORT_DIPSETTING(    0x08, "60k 200k and every 200k" )    PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
319   PORT_DIPSETTING(    0x10, "50k" )                        PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
315   PORT_DIPSETTING(    0x14, "40k 120k" )                   PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01)
316   PORT_DIPSETTING(    0x04, "50k 150k" )                   PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01)
317   PORT_DIPSETTING(    0x18, "50k 150k and every 150k" )    PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01)
318   PORT_DIPSETTING(    0x08, "60k 200k and every 200k" )    PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01)
319   PORT_DIPSETTING(    0x10, "50k" )                        PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01)
320320   // bonus scores for common
321321   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
322322   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2,1")
r15082r15083
493493
494494***************************************************************************/
495495
496static READ8_DEVICE_HANDLER( dipA_l )   { return input_port_read(device->machine(), "DSW1"); }            // dips A
497static READ8_DEVICE_HANDLER( dipA_h )   { return input_port_read(device->machine(), "DSW1") >> 4; }         // dips A
498static READ8_DEVICE_HANDLER( dipB_l )   { return input_port_read(device->machine(), "DSW2"); }            // dips B
499static READ8_DEVICE_HANDLER( dipB_h )   { return input_port_read(device->machine(), "DSW2") >> 4; }         // dips B
496static READ8_DEVICE_HANDLER( dipA_l )   { return device->machine().root_device().ioport("DSW1")->read(); }            // dips A
497static READ8_DEVICE_HANDLER( dipA_h )   { return device->machine().root_device().ioport("DSW1")->read() >> 4; }         // dips A
498static READ8_DEVICE_HANDLER( dipB_l )   { return device->machine().root_device().ioport("DSW2")->read(); }            // dips B
499static READ8_DEVICE_HANDLER( dipB_h )   { return device->machine().root_device().ioport("DSW2")->read() >> 4; }         // dips B
500500
501501static WRITE8_DEVICE_HANDLER( out_coin0 )
502502{
src/mame/drivers/tumbleb.c
r15082r15083
361361   switch (offset << 1)
362362   {
363363      case 0:
364         return input_port_read(machine(), "PLAYERS");
364         return ioport("PLAYERS")->read();
365365      case 2:
366         return input_port_read(machine(), "DSW");
366         return ioport("DSW")->read();
367367      case 8:
368         return input_port_read(machine(), "SYSTEM");
368         return ioport("SYSTEM")->read();
369369      case 10: /* ? */
370370      case 12:
371371           return 0;
r15082r15083
952952   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
953953   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
954954   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
955   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
955   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
956956   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
957957   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
958958   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
10391039   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
10401040   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
10411041   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1042   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1042   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")       // to be confirmed
10431043   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
10441044   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
10451045   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
11591159   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
11601160   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
11611161   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1162   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
1162   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
11631163   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
11641164   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
11651165   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
12471247   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
12481248   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
12491249   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1250   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1250   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")       // to be confirmed
12511251   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
12521252   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
12531253   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
13091309   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
13101310   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
13111311   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1312   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1312   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")       // to be confirmed
13131313   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
13141314   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
13151315   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
13711371   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
13721372   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
13731373   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1374   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1374   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")       // to be confirmed
13751375   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
13761376   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
13771377   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
14461446   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
14471447   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
14481448   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1449   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1449   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")       // to be confirmed
14501450   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
14511451   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
14521452   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
15161516   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
15171517   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
15181518   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN )      // must be high to avoid endless loops
1519   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1519   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")       // to be confirmed
15201520   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
15211521   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
15221522   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
15931593   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
15941594   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
15951595   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1596   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1596   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")       // to be confirmed
15971597   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
15981598   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
15991599   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
16711671   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
16721672   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
16731673   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1674   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1674   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")       // to be confirmed
16751675   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
16761676   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
16771677   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
18141814   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
18151815   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
18161816   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1817   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1817   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")       // to be confirmed
18181818   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
18191819   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
18201820   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
22272227   tumbleb_state *state = machine.driver_data<tumbleb_state>();
22282228
22292229   /* copy protection data every reset */
2230   UINT16 *PROTDATA = (UINT16*)machine.root_device().memregion("user1")->base();
2230   UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
22312231   int i, len = state->memregion("user1")->bytes();
22322232
22332233   for (i = 0; i < len / 2; i++)
r15082r15083
34413441   //mame_printf_debug("bcstory_io %06x\n",cpu_get_pc(&space.device()));
34423442
34433443   if (cpu_get_pc(&space.device())==0x0560) return 0x1a0;
3444   else return input_port_read(machine(), "SYSTEM");
3444   else return ioport("SYSTEM")->read();
34453445}
34463446
34473447static DRIVER_INIT ( bcstory )
r15082r15083
34563456{
34573457
34583458   tumbleb_state *state = machine.driver_data<tumbleb_state>();
3459//  UINT16 *HCROM = (UINT16*)machine.root_device().memregion("maincpu")->base();
3460   UINT16 *PROTDATA = (UINT16*)machine.root_device().memregion("user1")->base();
3459//  UINT16 *HCROM = (UINT16*)state->memregion("maincpu")->base();
3460   UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
34613461   int i, len = state->memregion("user1")->bytes();
34623462   /* simulate RAM initialization done by the protection MCU */
34633463   /* verified on real hardware */
src/mame/drivers/cd32.c
r15082r15083
223223      /* shift at 1 == return one, >1 = return button states */
224224      if (state->m_cd32_shifter[i] == 0)
225225         potgor &= ~p9dat; /* shift at zero == return zero */
226      if (state->m_cd32_shifter[i] >= 2 && (input_port_read(machine, player_portname[i]) & (1 << (state->m_cd32_shifter[i] - 2))))
226      if (state->m_cd32_shifter[i] >= 2 && (state->ioport(player_portname[i])->read() & (1 << (state->m_cd32_shifter[i] - 2))))
227227         potgor &= ~p9dat;
228228   }
229229   return potgor;
src/mame/drivers/bmcpokr.c
r15082r15083
4848public:
4949   bmcpokr_state(const machine_config &mconfig, device_type type, const char *tag)
5050      : driver_device(mconfig, type, tag),
51      m_maincpu(*this,"maincpu")
51      m_maincpu(*this,"maincpu"),
52      m_videoram(*this, "videoram")
5253      { }
5354
55   DECLARE_READ16_MEMBER( bmcpokr_unk_r )
56   {
57      return space.machine().rand();
58   }
59
5460   required_device<cpu_device> m_maincpu;
61   required_shared_ptr<UINT16> m_videoram;
5562};
5663
5764
5865
5966static ADDRESS_MAP_START( bmcpokr_mem, AS_PROGRAM, 16, bmcpokr_state )
6067   AM_RANGE(0x000000, 0x03ffff) AM_ROM
68   AM_RANGE(0x210000, 0x21ffff) AM_RAM
69
70   AM_RANGE(0x2c0000, 0x2dffff) AM_RAM AM_SHARE("videoram")
71
72   AM_RANGE(0x2FF800, 0x2FFFFF) AM_RAM
73   AM_RANGE(0x34001A, 0x34001B) AM_READ(bmcpokr_unk_r)
74
6175ADDRESS_MAP_END
6276
6377static INPUT_PORTS_START( bmcpokr )
r15082r15083
185199
186200SCREEN_UPDATE_IND16( bmcpokr )
187201{
202   bmcpokr_state *state = screen.machine().driver_data<bmcpokr_state>();
203   const gfx_element *gfx = screen.machine().gfx[0];
204
205   int count = 0;
206   for (int y=0;y<32;y++)
207   {
208      for (int x=0;x<64;x++)
209      {
210         UINT16 data = state->m_videoram[count];
211         count++;
212         
213         drawgfx_opaque(bitmap,cliprect,gfx,data,0,0,0,x*8,y*8);
214
215      }
216   }
217
218
219
188220   return 0;
189221}
190222
r15082r15083
197229static MACHINE_CONFIG_START( bmcpokr, bmcpokr_state )
198230   MCFG_CPU_ADD("maincpu", M68000, XTAL_42MHz/4)
199231   MCFG_CPU_PROGRAM_MAP(bmcpokr_mem)
200   //MCFG_CPU_VBLANK_INT("screen",irq3_line_hold)
232   MCFG_CPU_VBLANK_INT("screen",irq3_line_hold)
201233
202234   MCFG_SCREEN_ADD("screen", RASTER)
203235   MCFG_SCREEN_REFRESH_RATE(60)
src/mame/drivers/ultratnk.c
r15082r15083
2626
2727CUSTOM_INPUT_MEMBER(ultratnk_state::get_joystick)
2828{
29   UINT8 joy = input_port_read(machine(), (const char *)param) & 3;
29   UINT8 joy = ioport((const char *)param)->read() & 3;
3030
3131   if (joy == 1)
3232   {
r15082r15083
5050
5151   /* NMI and watchdog are disabled during service mode */
5252
53   machine.watchdog_enable(input_port_read(machine, "IN0") & 0x40);
53   machine.watchdog_enable(machine.root_device().ioport("IN0")->read() & 0x40);
5454
55   if (input_port_read(machine, "IN0") & 0x40)
55   if (machine.root_device().ioport("IN0")->read() & 0x40)
5656      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
5757
5858   machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline);
r15082r15083
7474
7575READ8_MEMBER(ultratnk_state::ultratnk_analog_r)
7676{
77   return (input_port_read(machine(), "ANALOG") << (~offset & 7)) & 0x80;
77   return (ioport("ANALOG")->read() << (~offset & 7)) & 0x80;
7878}
7979READ8_MEMBER(ultratnk_state::ultratnk_coin_r)
8080{
81   return (input_port_read(machine(), "COIN") << (~offset & 7)) & 0x80;
81   return (ioport("COIN")->read() << (~offset & 7)) & 0x80;
8282}
8383READ8_MEMBER(ultratnk_state::ultratnk_collision_r)
8484{
85   return (input_port_read(machine(), "COLLISION") << (~offset & 7)) & 0x80;
85   return (ioport("COLLISION")->read() << (~offset & 7)) & 0x80;
8686}
8787
8888
8989READ8_MEMBER(ultratnk_state::ultratnk_options_r)
9090{
91   return (input_port_read(machine(), "DIP") >> (2 * (offset & 3))) & 3;
91   return (ioport("DIP")->read() >> (2 * (offset & 3))) & 3;
9292}
9393
9494
r15082r15083
181181static INPUT_PORTS_START( ultratnk )
182182   PORT_START("IN0")
183183   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
184   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
184   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
185185
186186   PORT_START("IN1")
187187   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Option 1") PORT_TOGGLE
src/mame/drivers/tugboat.c
r15082r15083
145145{
146146   tugboat_state *state = device->machine().driver_data<tugboat_state>();
147147   if (~state->m_ctrl & 0x80)
148      return input_port_read(device->machine(), "IN0");
148      return state->ioport("IN0")->read();
149149   else if (~state->m_ctrl & 0x40)
150      return input_port_read(device->machine(), "IN1");
150      return state->ioport("IN1")->read();
151151   else if (~state->m_ctrl & 0x20)
152      return input_port_read(device->machine(), "IN2");
152      return state->ioport("IN2")->read();
153153   else if (~state->m_ctrl & 0x10)
154      return input_port_read(device->machine(), "IN3");
154      return state->ioport("IN3")->read();
155155   else
156      return input_port_read(device->machine(), "IN4");
156      return state->ioport("IN4")->read();
157157}
158158
159159static READ8_DEVICE_HANDLER( tugboat_ctrl_r )
src/mame/drivers/kingdrby.c
r15082r15083
267267static READ8_DEVICE_HANDLER( hopper_io_r )
268268{
269269   kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
270   return (input_port_read(device->machine(),"HPIO") & 0x3f) | state->m_p1_hopper | state->m_p2_hopper;
270   return (state->ioport("HPIO")->read() & 0x3f) | state->m_p1_hopper | state->m_p2_hopper;
271271}
272272
273273static WRITE8_DEVICE_HANDLER( hopper_io_w )
r15082r15083
300300{
301301   kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
302302   if(state->m_mux_data & 0x80)
303      return input_port_read(device->machine(),"MUX0");
303      return state->ioport("MUX0")->read();
304304   else
305      return input_port_read(device->machine(),"MUX1");
305      return state->ioport("MUX1")->read();
306306}
307307
308308static READ8_DEVICE_HANDLER( key_matrix_r )
r15082r15083
310310   UINT16 p1_val,p2_val;
311311   UINT8 p1_res,p2_res;
312312
313   p1_val = input_port_read(device->machine(),"KEY_1P");
314   p2_val = input_port_read(device->machine(),"KEY_2P");
313   p1_val = device->machine().root_device().ioport("KEY_1P")->read();
314   p2_val = device->machine().root_device().ioport("KEY_2P")->read();
315315
316316   p1_res = 0;
317317   p2_res = 0;
r15082r15083
556556   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) //2p hopper i/o
557557
558558   PORT_START("IN1")   // ppi0 (5001)
559   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK ) //?
559   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") //?
560560   PORT_DIPNAME( 0x02, 0x02, "IN1" )
561561   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
562562   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r15082r15083
739739   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
740740
741741   PORT_START("IN1")   // ppi0 (5001)
742   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK ) //?
742   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") //?
743743   PORT_DIPNAME( 0x02, 0x02, "IN1" )
744744   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
745745   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/phoenix.c
r15082r15083
101101   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )          PORT_DIPLOCATION( "SW1:7" )
102102   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
103103   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
104   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
104   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
105105
106106   PORT_START("CAB")      /* fake port for non-memory mapped dip switch */
107107   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )          PORT_DIPLOCATION( "SW1:!8" )
r15082r15083
113113   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
114114   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_2WAY
115115   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 )
116   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL                  PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
117   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
118   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
119   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL                  PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
116   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL                  PORT_CONDITION("CAB",0x01,EQUALS,0x01)
117   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
118   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
119   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL                  PORT_CONDITION("CAB",0x01,EQUALS,0x01)
120120INPUT_PORTS_END
121121
122122static INPUT_PORTS_START( phoenixa )
r15082r15083
184184   PORT_DIPSETTING(   0x50, "Fast" )
185185   PORT_DIPSETTING(   0x60, "Faster" )
186186   PORT_DIPSETTING(   0x70, "Fastest" )
187   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
187   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
188188
189189   PORT_START("DSW1")
190190   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_B ) )           PORT_DIPLOCATION( "SW2:1,2,3,4" )
r15082r15083
232232   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
233233   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  ) PORT_2WAY
234234   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 )
235   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL                  PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
236   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
237   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
238   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL                  PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
235   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL                  PORT_CONDITION("CAB",0x01,EQUALS,0x01)
236   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
237   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
238   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL                  PORT_CONDITION("CAB",0x01,EQUALS,0x01)
239239INPUT_PORTS_END
240240
241241static INPUT_PORTS_START( falconz )
r15082r15083
305305   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
306306   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_2WAY
307307   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
308   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL               PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
309   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
310   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_2WAY PORT_COCKTAIL   PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
311   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )                           PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
308   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL               PORT_CONDITION("CAB",0x01,EQUALS,0x01)
309   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
310   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_2WAY PORT_COCKTAIL   PORT_CONDITION("CAB",0x01,EQUALS,0x01)
311   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )                           PORT_CONDITION("CAB",0x01,EQUALS,0x01)
312312INPUT_PORTS_END
313313
314314static INPUT_PORTS_START( pleiadbl )
r15082r15083
381381   PORT_DIPSETTING(   0x20, DEF_STR( 3C_1C ) )
382382   PORT_DIPSETTING(   0x40, DEF_STR( 2C_1C ) )
383383   PORT_DIPSETTING(   0x60, DEF_STR( 1C_1C ) )
384   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
384   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
385385
386386   PORT_START("CAB")      /* fake port for non-memory mapped dip switch */
387387   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
src/mame/drivers/lastfght.c
r15082r15083
382382{
383383   // high byte:
384384   // mask 0x1c: from sound?
385   return (machine().rand() & 0x1c00) | input_port_read(machine(), "IN0");
385   return (machine().rand() & 0x1c00) | ioport("IN0")->read();
386386}
387387
388388READ16_MEMBER(lastfght_state::lastfght_c00004_r)
389389{
390   return input_port_read(machine(), "IN1");
390   return ioport("IN1")->read();
391391}
392392
393393READ16_MEMBER(lastfght_state::lastfght_c00006_r)
r15082r15083
395395   // low byte:
396396   // bit 7 = protection?
397397   // bit 5 = blitter?
398   return input_port_read(machine(), "IN2");
398   return ioport("IN2")->read();
399399}
400400
401401WRITE16_MEMBER(lastfght_state::lastfght_c00006_w)
src/mame/drivers/embargo.c
r15082r15083
7272
7373READ8_MEMBER(embargo_state::input_port_bit_r)
7474{
75   return (input_port_read(machine(), "IN1") << (7 - m_input_select)) & 0x80;
75   return (ioport("IN1")->read() << (7 - m_input_select)) & 0x80;
7676}
7777
7878
r15082r15083
9797
9898   if (m_dial_enable_1 && !m_dial_enable_2)
9999   {
100      lo = input_port_read(machine(), "DIAL0");
101      hi = input_port_read(machine(), "DIAL1");
100      lo = ioport("DIAL0")->read();
101      hi = ioport("DIAL1")->read();
102102   }
103103
104104   if (m_dial_enable_2 && !m_dial_enable_1)
105105   {
106      lo = input_port_read(machine(), "DIAL2");
107      hi = input_port_read(machine(), "DIAL3");
106      lo = ioport("DIAL2")->read();
107      hi = ioport("DIAL3")->read();
108108   }
109109
110110   lo = 12 * lo / 256;
src/mame/drivers/superqix.c
r15082r15083
112112{
113113   superqix_state *state = device.machine().driver_data<superqix_state>();
114114   running_machine &machine = device.machine();
115   UINT8 *src = machine.root_device().memregion("samples")->base();
115   UINT8 *src = state->memregion("samples")->base();
116116   int i, len = state->memregion("samples")->bytes();
117117
118118   /* convert 8-bit unsigned samples to 8-bit signed */
r15082r15083
174174{
175175   superqix_state *state = device->machine().driver_data<superqix_state>();
176176//  logerror("%04x: in4_mcu_r\n",cpu_get_pc(&space->device()));
177   return input_port_read(device->machine(), "P2") | (state->m_from_mcu_pending << 6) | (state->m_from_z80_pending << 7);
177   return state->ioport("P2")->read() | (state->m_from_mcu_pending << 6) | (state->m_from_z80_pending << 7);
178178}
179179
180180static READ8_DEVICE_HANDLER( sqix_from_mcu_r )
r15082r15083
255255{
256256   if ((m_port1 & 0x10) == 0)
257257   {
258      return input_port_read(machine(), "DSW1");
258      return ioport("DSW1")->read();
259259   }
260260   else if ((m_port1 & 0x20) == 0)
261261   {
262      return input_port_read(machine(), "SYSTEM") | (m_from_mcu_pending << 6) | (m_from_z80_pending << 7);
262      return ioport("SYSTEM")->read() | (m_from_mcu_pending << 6) | (m_from_z80_pending << 7);
263263   }
264264   else if ((m_port1 & 0x40) == 0)
265265   {
r15082r15083
272272
273273READ8_MEMBER(superqix_state::sqixu_mcu_p0_r)
274274{
275   return input_port_read(machine(), "SYSTEM") | (m_from_mcu_pending << 6) | (m_from_z80_pending << 7);
275   return ioport("SYSTEM")->read() | (m_from_mcu_pending << 6) | (m_from_z80_pending << 7);
276276}
277277
278278WRITE8_MEMBER(superqix_state::sqixu_mcu_p2_w)
r15082r15083
325325
326326static READ8_DEVICE_HANDLER( bootleg_in0_r )
327327{
328   return BITSWAP8(input_port_read(device->machine(), "DSW1"), 0,1,2,3,4,5,6,7);
328   return BITSWAP8(device->machine().root_device().ioport("DSW1")->read(), 0,1,2,3,4,5,6,7);
329329}
330330
331331WRITE8_MEMBER(superqix_state::bootleg_flipscreen_w)
r15082r15083
352352   int newpos;
353353
354354   /* get the new position and adjust the result */
355   newpos = input_port_read(machine, player ? "DIAL2" : "DIAL1");
355   newpos = state->ioport(player ? "DIAL2" : "DIAL1")->read();
356356   if (newpos != state->m_oldpos[player])
357357   {
358358      state->m_sign[player] = ((newpos - state->m_oldpos[player]) & 0x80) >> 7;
r15082r15083
429429      switch (data & 0x07)
430430      {
431431         case 0x0:   // dsw A
432            m_portA_in = input_port_read(machine(), "DSW1");
432            m_portA_in = ioport("DSW1")->read();
433433            break;
434434
435435         case 0x1:   // dsw B
436            m_portA_in = input_port_read(machine(), "DSW2");
436            m_portA_in = ioport("DSW2")->read();
437437            break;
438438
439439         case 0x2:
r15082r15083
478478{
479479   superqix_state *state = device->machine().driver_data<superqix_state>();
480480//  logerror("%04x: ay_port_a_r and mcu_pending is %d\n",cpu_get_pc(&space->device()),state->m_from_mcu_pending);
481   return input_port_read(device->machine(), "SYSTEM") | ((state->m_from_mcu_pending^1) << 7);
481   return state->ioport("SYSTEM")->read() | ((state->m_from_mcu_pending^1) << 7);
482482}
483483
484484/**************************************************************************
r15082r15083
499499   {
500500      case 0x01:
501501      {
502         UINT8 p = input_port_read(machine(), m_curr_player ? "PLUNGER2" : "PLUNGER1") & 0xbf;
502         UINT8 p = ioport(m_curr_player ? "PLUNGER2" : "PLUNGER1")->read() & 0xbf;
503503         if ((p & 0x3f) == 0) p |= 0x40;
504504         return p;
505505      }
506506
507      case 0x02: return input_port_read(machine(), m_curr_player ? "DIAL2" : "DIAL1");
507      case 0x02: return ioport(m_curr_player ? "DIAL2" : "DIAL1")->read();
508508
509      case 0x04: return input_port_read(machine(), "DSW1");
510      case 0x08: return input_port_read(machine(), "DSW2");
509      case 0x04: return ioport("DSW1")->read();
510      case 0x08: return ioport("DSW2")->read();
511511
512512      case 0x80: m_curr_player = 0; return 0;
513513      case 0x81: m_curr_player = 1; return 0;
r15082r15083
521521{
522522//  logerror("%04x: ay_port_a_r\n",cpu_get_pc(&space->device()));
523523   /* bits 76------  MCU status bits */
524   return (device->machine().rand() & 0xc0) | input_port_read(device->machine(), "BUTTONS");
524   return (device->machine().rand() & 0xc0) | device->machine().root_device().ioport("BUTTONS")->read();
525525}
526526
527527
r15082r15083
867867   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
868868   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
869869   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
870   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )   /* ??? */
870   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")   /* ??? */
871871   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
872872
873873   PORT_START("P2")
src/mame/drivers/dday.c
r15082r15083
8686                                                  /* accessed */
8787   PORT_START("DSW0")
8888   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW3:1,2")
89   PORT_DIPSETTING(    0x00, "2" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x80)
90   PORT_DIPSETTING(    0x01, "3" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x80)
91   PORT_DIPSETTING(    0x02, "4" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x80)
92   PORT_DIPSETTING(    0x03, "5" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x80)
93   PORT_DIPSETTING(    0x00, "5" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x00)
94   PORT_DIPSETTING(    0x01, "6" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x00)
95   PORT_DIPSETTING(    0x02, "7" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x00)
96   PORT_DIPSETTING(    0x03, "8" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x00)
89   PORT_DIPSETTING(    0x00, "2" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x80)
90   PORT_DIPSETTING(    0x01, "3" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x80)
91   PORT_DIPSETTING(    0x02, "4" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x80)
92   PORT_DIPSETTING(    0x03, "5" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x80)
93   PORT_DIPSETTING(    0x00, "5" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x00)
94   PORT_DIPSETTING(    0x01, "6" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x00)
95   PORT_DIPSETTING(    0x02, "7" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x00)
96   PORT_DIPSETTING(    0x03, "8" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x00)
9797
9898   PORT_DIPNAME( 0x0c, 0x00, "Extended Play At" )      PORT_DIPLOCATION("SW3:3,4")
9999   PORT_DIPSETTING(    0x00, "10000" )
src/mame/drivers/cyberbal.c
r15082r15083
103103
104104READ16_MEMBER(cyberbal_state::special_port0_r)
105105{
106   int temp = input_port_read(machine(), "IN0");
106   int temp = ioport("IN0")->read();
107107   if (m_cpu_to_sound_ready) temp ^= 0x0080;
108108   return temp;
109109}
r15082r15083
111111
112112READ16_MEMBER(cyberbal_state::special_port2_r)
113113{
114   int temp = input_port_read(machine(), "IN2");
114   int temp = ioport("IN2")->read();
115115   if (m_cpu_to_sound_ready) temp ^= 0x2000;
116116   return temp;
117117}
r15082r15083
306306   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
307307   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
308308   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
309   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_VBLANK )
309   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
310310
311311   PORT_START("IN2")      /* fake port for screen switching */
312312   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
346346   PORT_START("IN2")      /* fc4000 */
347347   PORT_BIT( 0x1fff, IP_ACTIVE_LOW, IPT_UNUSED )
348348   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
349   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_VBLANK )
349   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
350350   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
351351
352352   PORT_INCLUDE( atarijsa_ii )      /* audio board port */
src/mame/drivers/lockon.c
r15082r15083
332332{
333333   switch (offset)
334334   {
335      case 0:  return input_port_read(machine(), "ADC_BANK");
336      case 1:  return input_port_read(machine(), "ADC_PITCH");
337      case 2:  return input_port_read(machine(), "ADC_MISSILE");
338      case 3:  return input_port_read(machine(), "ADC_HOVER");
335      case 0:  return ioport("ADC_BANK")->read();
336      case 1:  return ioport("ADC_PITCH")->read();
337      case 2:  return ioport("ADC_MISSILE")->read();
338      case 3:  return ioport("ADC_HOVER")->read();
339339      default: return 0;
340340   }
341341}
src/mame/drivers/bfm_sc4h.c
r15082r15083
4848 
4949   if (row<4)
5050   {
51      value = (input_port_read_safe(machine, portnames[row], 0x00) & 0x1f) + ((input_port_read_safe(machine, portnames[row+8], 0x00) & 0x07) << 5);
51      value = (machine.root_device().ioport(portnames[row])->read_safe(0x00) & 0x1f) + ((machine.root_device().ioport(portnames[row+8])->read_safe(0x00) & 0x07) << 5);
5252   }
5353   else
5454   {
55      value = (input_port_read_safe(machine, portnames[row], 0x00) & 0x1f) + ((input_port_read_safe(machine, portnames[row+4], 0x00) & 0x18) << 2);
55      value = (machine.root_device().ioport(portnames[row])->read_safe(0x00) & 0x1f) + ((machine.root_device().ioport(portnames[row+4])->read_safe(0x00) & 0x18) << 2);
5656   }
5757 
5858   return value;
5959}
6060 
61READ16_MEMBER(sc4_state::sc4_cs1_r)
62{
63   int pc = cpu_get_pc(&space.device());
64 
65   if (offset<0x100000/2)
66   {
67      // allow some sets to boot, should probably return this data on Mbus once we figure out what it is
68      if ((pc == m_chk41addr) && (offset == m_chk41addr>>1))
69      {
70         UINT32 r_A0 = cpu_get_reg(&space.device(), M68K_A0);
71         UINT32 r_A1 = cpu_get_reg(&space.device(), M68K_A1);
72         UINT32 r_D1 = cpu_get_reg(&space.device(), M68K_D1);
73 
74         if (r_D1 == 0x7)
75         {
76            bool valid = true;
77            for (int i=0;i<8;i++)
78            {
79               UINT8 code = space.read_byte(r_A0+i);
80               if (code != 0xff) // assume our mbus code just returns 0xff for now..
81                  valid = false;
82            }
83 
84            if (valid && m_dochk41)
85            {
86               m_dochk41 = false;
87               // the value is actually random.. probably based on other reads
88               // making this a comparison?
89               printf("Ident code? ");
90               for (int i=0;i<8;i++)
91               {
92                  UINT8 code = space.read_byte(r_A1+i);
93                  printf("%02x",code);
94                  space.write_byte(r_A0+i, code);
95               }
96               printf("\n");
97            }
98         }
99      }
100 
101 
102      return m_cpuregion[offset];
103   }
104   else
105      logerror("%08x maincpu read access offset %08x mem_mask %04x cs %d\n", pc, offset*2, mem_mask, 1);
106 
107   return 0x0000;
108}
109 
61110READ16_MEMBER(sc4_state::sc4_mem_r)
62111{
63112   int pc = cpu_get_pc(&space.device());
r15082r15083
70119   switch ( cs )
71120   {
72121      case 1:
73         if (offset<0x100000/2)
74         {
75            // allow some sets to boot, should probably return this data on Mbus once we figure out what it is
76            if ((pc == m_chk41addr) && (offset == m_chk41addr>>1))
77            {
78               UINT32 r_A0 = cpu_get_reg(&space.device(), M68K_A0);
79               UINT32 r_A1 = cpu_get_reg(&space.device(), M68K_A1);
80               UINT32 r_D1 = cpu_get_reg(&space.device(), M68K_D1);
122         return sc4_cs1_r(space,offset,mem_mask);
81123 
82               if (r_D1 == 0x7)
83               {
84                  bool valid = true;
85                  for (int i=0;i<8;i++)
86                  {
87                     UINT8 code = space.read_byte(r_A0+i);
88                     if (code != 0xff) // assume our mbus code just returns 0xff for now..
89                        valid = false;
90                  }
91124 
92                  if (valid && m_dochk41)
93                  {
94                     m_dochk41 = false;
95                     // the value is actually random.. probably based on other reads
96                     // making this a comparison?
97                     printf("Ident code? ");
98                     for (int i=0;i<8;i++)
99                     {
100                        UINT8 code = space.read_byte(r_A1+i);
101                        printf("%02x",code);
102                        space.write_byte(r_A0+i, code);
103                     }
104                     printf("\n");
105                  }
106               }
107            }
108125 
109 
110            return m_cpuregion[offset];
111 
112         }
113         else
114            logerror("%08x maincpu read access offset %08x mem_mask %04x cs %d\n", pc, offset*2, mem_mask, cs);
115         break;
116 
117126      case 2:
118127         base = 0x800000/2;
119128         end = base + 0x10000 / 2;
r15082r15083
378387}
379388 
380389static ADDRESS_MAP_START( sc4_map, AS_PROGRAM, 16, sc4_state )
390   AM_RANGE(0x0000000, 0x0fffff) AM_READ(sc4_cs1_r) // technically we should be going through the cs handler, but this is always set to ROM, and assuming that is a lot faster
381391   AM_RANGE(0x0000000, 0xffffff) AM_READWRITE(sc4_mem_r, sc4_mem_w)
382392ADDRESS_MAP_END
383393 
394 
395 
396 
397READ32_MEMBER(sc4_adder4_state::adder4_mem_r)
398{
399   int pc = cpu_get_pc(&space.device());
400   int cs = m68340_get_cs(m_adder4cpu, offset * 4);
401 
402   switch ( cs )
403   {
404      case 1:
405         return m_adder4cpuregion[offset];
406 
407      case 2:
408         offset &=0x3fff;
409         return m_adder4ram[offset];
410 
411      default:
412         logerror("%08x adder4cpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs);
413 
414   }
415 
416   return 0x0000;
417}
418 
419WRITE32_MEMBER(sc4_adder4_state::adder4_mem_w)
420{
421   int pc = cpu_get_pc(&space.device());
422   int cs = m68340_get_cs(m_adder4cpu, offset * 4);
423 
424   switch ( cs )
425   {
426      default:
427         logerror("%08x adder4cpu write access offset %08x data %08x mem_mask %08x cs %d\n", pc, offset*4, data, mem_mask, cs);
428 
429      case 2:
430         offset &=0x3fff;
431         COMBINE_DATA(&m_adder4ram[offset]);
432         break;
433 
434 
435   }
436 
437}
438 
384439static ADDRESS_MAP_START( sc4_adder4_map, AS_PROGRAM, 32, sc4_adder4_state )
385   AM_RANGE(0x000000, 0x2fffff) AM_ROM
440   AM_RANGE(0x00000000, 0xffffffff) AM_READWRITE(adder4_mem_r, adder4_mem_w)
386441ADDRESS_MAP_END
387442 
388443 
r15082r15083
722777MACHINE_CONFIG_END
723778 
724779 
780 
781static MACHINE_START( adder4 )
782{
783   sc4_adder4_state *state = machine.driver_data<sc4_adder4_state>();
784   state->m_adder4cpuregion = (UINT32*)state->memregion( "adder4" )->base();
785   state->m_adder4ram = (UINT32*)auto_alloc_array_clear(machine, UINT32, 0x10000);
786   MACHINE_START_CALL(sc4);
787}
788 
725789MACHINE_CONFIG_DERIVED_CLASS( sc4_adder4, sc4, sc4_adder4_state )
726790   MCFG_CPU_ADD("adder4", M68340, 25175000)    // 68340 (CPU32 core)
727791   MCFG_CPU_PROGRAM_MAP(sc4_adder4_map)
792 
793   MCFG_MACHINE_START( adder4 )
728794MACHINE_CONFIG_END
729795 
730796 
src/mame/drivers/warpsped.c
r15082r15083
243243   PORT_START("IN2")
244244   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
245245   PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_UNUSED )
246   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
246   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
247247
248248   PORT_START("DSW")
249249   PORT_DIPNAME( 0x07, 0x00, "Coin/Time" )
src/mame/drivers/gijoe.c
r15082r15083
7474      /* bit 3  (unknown: coin) */
7575      /* bit 5  is enable irq 6 */
7676      /* bit 7  (unknown: enable irq 5?) */
77      input_port_write(machine(), "EEPROMOUT", data, 0xff);
77      ioport("EEPROMOUT")->write(data, 0xff);
7878
7979      m_cur_control2 = data;
8080
src/mame/drivers/rltennis.c
r15082r15083
7272READ16_MEMBER(rltennis_state::rlt_io_r)
7373{
7474
75   return (input_port_read(machine(), "P1" )&0x1fff) | (m_unk_counter<<13); /* top 3 bits controls smaple address update */
75   return (ioport("P1" )->read()&0x1fff) | (m_unk_counter<<13); /* top 3 bits controls smaple address update */
7676}
7777
7878WRITE16_MEMBER(rltennis_state::rlt_snd1_w)
r15082r15083
162162   state->m_screen = machine.device(  "screen");
163163   state->m_dac_1 = machine.device("dac1");
164164   state->m_dac_2 = machine.device("dac2");
165   state->m_samples_1 = machine.root_device().memregion("samples1")->base();
166   state->m_samples_2 = machine.root_device().memregion("samples2")->base();
165   state->m_samples_1 = state->memregion("samples1")->base();
166   state->m_samples_2 = state->memregion("samples2")->base();
167167   state->m_gfx =  state->memregion("gfx1")->base();
168168   state->m_timer = machine.scheduler().timer_alloc(FUNC(sample_player));
169169}
src/mame/drivers/gei.c
r15082r15083
719719   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
720720
721721   PORT_START("IN0")
722   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x40)
723   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")
724   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x40)
725   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00)
722   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x40)
723   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x00) PORT_NAME ("Start in no coins mode")
724   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x40)
725   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x00)
726726   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r)      /* ticket status */
727727   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
728728   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
896896   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
897897
898898   PORT_START("IN0")
899   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x40)
900   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")
901   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x40)
902   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00)
899   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x40)
900   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x00) PORT_NAME ("Start in no coins mode")
901   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x40)
902   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x00)
903903   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r)      /* ticket status */
904904   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
905905   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
16951695   /* Missing "General Facts" */
16961696ROM_END
16971697
1698ROM_START( gt103a1 )
1698ROM_START( gtsers12 )
16991699   ROM_REGION( 0x38000, "maincpu", 0 )
1700   ROM_LOAD( "prog1_versiona",  0x00000, 0x4000, CRC(537d6566) SHA1(282a33e4a9fc54d34094393c00026bf31ccd6ab5) )
1701   ROM_LOAD( "new_science_2",   0x10000, 0x8000, CRC(3bd80fb8) SHA1(9a196595bc5dc6ed5ee5853786839ed4847fa436) ) /* Questions from an unknown set, will be corrected when verified */
1702   ROM_LOAD( "nfl_football",    0x18000, 0x8000, CRC(d676b7cd) SHA1(d652d2441adb500f7af526d110d0335ea453d75b) ) /* These questions are likely mix-n-match do to opperator swaps   */
1703   ROM_LOAD( "rock_music",      0x20000, 0x8000, CRC(7f11733a) SHA1(d4d0dee75518edf986cb1241ade45ccb4840f088) ) /* Currently unverified are Series 12, 13 & 14 */
1704   ROM_LOAD( "war_and_peace",   0x28000, 0x8000, CRC(bc709383) SHA1(2fba4c80773abea7bbd826c39378b821cddaa255) )
1705   ROM_LOAD( "entertainment",   0x30000, 0x8000, CRC(07068c9f) SHA1(1aedc78d071281ec8b08488cd82655d41a77cf6b) )
1700   ROM_LOAD( "prog1_versionc",  0x00000, 0x4000, CRC(340246a4) SHA1(d655e1cf2b1e87a05e87ff6af4b794e6d54a2a52) )
1701   ROM_LOAD( "new_science_2",   0x10000, 0x8000, CRC(3bd80fb8) SHA1(9a196595bc5dc6ed5ee5853786839ed4847fa436) )
1702   ROM_LOAD( "adult_sex_4",     0x18000, 0x8000, CRC(36a75071) SHA1(f08d31f241e1dc9b94b940cd2872a692f6f8475b) )
1703   ROM_LOAD( "cops_&_robbers",  0x20000, 0x8000, CRC(8b367c33) SHA1(013468157bf469c9cf138809fdc45b3ba60a423b) )
1704   ROM_LOAD( "famous_quotes",   0x28000, 0x8000, CRC(0a27d8ae) SHA1(427e6ae25e47da7f7f7c3e92a37e330d711da90c) )
1705   ROM_LOAD( "vices",           0x30000, 0x8000, CRC(e6069955) SHA1(68f7453f21a4ce1be912141bbe947fbd81d918a3) )
17061706ROM_END
17071707
1708ROM_START( gt103a2 )
1708ROM_START( gtsers14 )
17091709   ROM_REGION( 0x38000, "maincpu", 0 )
17101710   ROM_LOAD( "prog1_versionc",  0x00000, 0x4000, CRC(340246a4) SHA1(d655e1cf2b1e87a05e87ff6af4b794e6d54a2a52) )
1711   ROM_LOAD( "vices",           0x10000, 0x8000, CRC(e6069955) SHA1(68f7453f21a4ce1be912141bbe947fbd81d918a3) ) /* Questions from an unknown set, will be corrected when verified */
1712   ROM_LOAD( "cops_&_robbers",  0x18000, 0x8000, CRC(8b367c33) SHA1(013468157bf469c9cf138809fdc45b3ba60a423b) ) /* These questions are likely mix-n-match do to opperator swaps   */
1713   ROM_LOAD( "famous_couples",  0x20000, 0x8000, CRC(e0618218) SHA1(ff64fcd6dec83a2271b63c3ae64dc932a3954ec5) ) /* Currently unverified are Series 12, 13 & 14 */
1714   ROM_LOAD( "famous_quotes",   0x28000, 0x8000, CRC(0a27d8ae) SHA1(427e6ae25e47da7f7f7c3e92a37e330d711da90c) )
1711   ROM_LOAD( "famous_couples",  0x10000, 0x8000, CRC(e0618218) SHA1(ff64fcd6dec83a2271b63c3ae64dc932a3954ec5) )
1712   ROM_LOAD( "war_and_peace",   0x18000, 0x8000, CRC(bc709383) SHA1(2fba4c80773abea7bbd826c39378b821cddaa255) )
1713   ROM_LOAD( "tv_comedies",     0x20000, 0x8000, CRC(992ae38e) SHA1(312780d651a85a1c433f587ff2ede579456d3fd9) )
1714   ROM_LOAD( "the_sixties",     0x28000, 0x8000, CRC(8cfa854e) SHA1(81428c12f99841db1c61b471ac8d00f0c411883b) )
1715   /* Missing "New Sports" */
17151716ROM_END
17161717
1717ROM_START( gt103a3 )
1718ROM_START( gt103a1 ) /* Need to verify these are actually Series 13 */
17181719   ROM_REGION( 0x38000, "maincpu", 0 )
1719   ROM_LOAD( "t_3a-8_1.bin",    0x00000, 0x4000, CRC(02aef306) SHA1(1ffc10c79a55d41ea36bcaab13cb3f02cb3f9712) )
1720   ROM_LOAD( "rock-n-roll_alt", 0x10000, 0x8000, CRC(8eb83052) SHA1(93e3c1ae6c2048fb44ecafe1013b6a96da38fa84) ) /* Questions from an unknown set, will be corrected when verified */
1721   ROM_LOAD( "history-geog",    0x18000, 0x8000, CRC(c9a70fc3) SHA1(4021e5d702844416e8c798ed0a57c9ecd20b1d4b) ) /* These questions are likely mix-n-match do to opperator swaps   */
1722   ROM_LOAD( "the_sixties",     0x20000, 0x8000, CRC(8cfa854e) SHA1(81428c12f99841db1c61b471ac8d00f0c411883b) ) /* Currently unverified are Series 12, 13 & 14 */
1723   ROM_LOAD( "tv_comedies",     0x28000, 0x8000, CRC(992ae38e) SHA1(312780d651a85a1c433f587ff2ede579456d3fd9) )
1720   ROM_LOAD( "prog1_versiona",  0x00000, 0x4000, CRC(537d6566) SHA1(282a33e4a9fc54d34094393c00026bf31ccd6ab5) ) /* Currently unverified Series 13 */
1721   ROM_LOAD( "history-geog",    0x10000, 0x8000, CRC(c9a70fc3) SHA1(4021e5d702844416e8c798ed0a57c9ecd20b1d4b) )
1722   ROM_LOAD( "nfl_football",    0x18000, 0x8000, CRC(d676b7cd) SHA1(d652d2441adb500f7af526d110d0335ea453d75b) )
1723   ROM_LOAD( "rock_music",      0x20000, 0x8000, CRC(7f11733a) SHA1(d4d0dee75518edf986cb1241ade45ccb4840f088) )
1724   ROM_LOAD( "rock-n-roll_alt", 0x28000, 0x8000, CRC(8eb83052) SHA1(93e3c1ae6c2048fb44ecafe1013b6a96da38fa84) )
1725   ROM_LOAD( "entertainment",   0x30000, 0x8000, CRC(07068c9f) SHA1(1aedc78d071281ec8b08488cd82655d41a77cf6b) )
17241726ROM_END
17251727
17261728ROM_START( gt103aa )
17271729   ROM_REGION( 0x38000, "maincpu", 0 )
17281730   ROM_LOAD( "t_3a-8_1.bin",      0x00000, 0x4000, CRC(02aef306) SHA1(1ffc10c79a55d41ea36bcaab13cb3f02cb3f9712) )
1729   ROM_LOAD( "entertainment_alt", 0x10000, 0x8000, CRC(9a6628b9) SHA1(c0cb7e974329d4d5b91f107296d21a674e35a51b) ) /* Questions from an unknown set, will be corrected when verified */
1730   ROM_LOAD( "general_alt",       0x18000, 0x8000, CRC(df34f7f9) SHA1(329d123eea711d5135dc02dd7b89b220ce8ddd28) ) /* These questions are likely mix-n-match do to opperator swaps   */
1731   ROM_LOAD( "science_alt",       0x20000, 0x8000, CRC(9eaebd18) SHA1(3a4d787cb006dbb23ce346577cb1bb5e543ba52c) ) /* Currently unverified are Series 12, 13 & 14 */
1731   ROM_LOAD( "entertainment_alt", 0x10000, 0x8000, CRC(9a6628b9) SHA1(c0cb7e974329d4d5b91f107296d21a674e35a51b) )
1732   ROM_LOAD( "general_alt",       0x18000, 0x8000, CRC(df34f7f9) SHA1(329d123eea711d5135dc02dd7b89b220ce8ddd28) )
1733   ROM_LOAD( "science_alt",       0x20000, 0x8000, CRC(9eaebd18) SHA1(3a4d787cb006dbb23ce346577cb1bb5e543ba52c) )
17321734   ROM_LOAD( "science_alt2",      0x28000, 0x8000, CRC(ac93d348) SHA1(55550ba6b5daffdf9653854075ad4f8398a5e621) )
17331735   ROM_LOAD( "sports_alt2",       0x30000, 0x8000, CRC(40207845) SHA1(2dddb9685dcefabfde07057a639aa9d08da2329e) )
17341736ROM_END
17351737
17361738ROM_START( gt103asx )
17371739   ROM_REGION( 0x38000, "maincpu", 0 )
1738   ROM_LOAD( "t_3a-8_1.bin",    0x00000, 0x4000, CRC(02aef306) SHA1(1ffc10c79a55d41ea36bcaab13cb3f02cb3f9712) )
1739   ROM_LOAD( "adult_sex_2",     0x10000, 0x8000, CRC(0d683f21) SHA1(f47ce3c31c4c5ed02247fa280303e6ae760315df) )
1740   ROM_LOAD( "adult_sex_2_alt", 0x18000, 0x8000, CRC(8c0eacc8) SHA1(ddaa25548d161394b41c65a2db57a9fcf793062b) )
1740   ROM_LOAD( "t_3a-8_1.bin",    0x00000, 0x4000, CRC(02aef306) SHA1(1ffc10c79a55d41ea36bcaab13cb3f02cb3f9712) ) /* Not sure there was ever a specific Adult set  */
1741   ROM_LOAD( "adult_sex_2",     0x10000, 0x8000, CRC(0d683f21) SHA1(f47ce3c31c4c5ed02247fa280303e6ae760315df) ) /* These are likely just the collection of adult */
1742   ROM_LOAD( "adult_sex_2_alt", 0x18000, 0x8000, CRC(8c0eacc8) SHA1(ddaa25548d161394b41c65a2db57a9fcf793062b) ) /* from all the series combined here. */
17411743   ROM_LOAD( "adult_sex_3_alt", 0x20000, 0x8000, CRC(63cbd1d6) SHA1(8dcd5546dc8688d6b8404d5cf63d8a59acc9bf4c) )
17421744   ROM_LOAD( "adult_sex_4",     0x28000, 0x8000, CRC(36a75071) SHA1(f08d31f241e1dc9b94b940cd2872a692f6f8475b) )
17431745   ROM_LOAD( "adult_sex_5",     0x30000, 0x8000, CRC(fdbc3729) SHA1(7cb7cec4439ddc39de2f7f62c25623cfb869f493) )
r15082r15083
19091911GAME( 1984, gtsers9,  gtsers8,  findout,  gt103a,   0,       ROT0, "Greyhound Electronics", "Trivia (Questions Series 9)",             GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
19101912GAME( 1984, gtsers10, gtsers8,  findout,  gt103a,   0,       ROT0, "Greyhound Electronics", "Trivia (Questions Series 10)",            GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
19111913GAME( 1984, gtsers11, gtsers8,  findout,  gt103a,   0,       ROT0, "Greyhound Electronics", "Trivia (Questions Series 11)",            GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1914GAME( 1984, gtsers12, gtsers8,  findout,  gt103a,   0,       ROT0, "Greyhound Electronics", "Trivia (Questions Series 12)",            GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1915GAME( 1984, gtsers14, gtsers8,  findout,  gt103a,   0,       ROT0, "Greyhound Electronics", "Trivia (Questions Series 14)",            GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
19121916GAME( 1984, gt103a1,  gtsers8,  findout,  gt103a,   0,       ROT0, "Greyhound Electronics", "Trivia (Version 1.03a) (alt 1)",          GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1913GAME( 1984, gt103a2,  gtsers8,  findout,  gt103a,   0,       ROT0, "Greyhound Electronics", "Trivia (Version 1.03a) (alt 2)",          GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1914GAME( 1984, gt103a3,  gtsers8,  findout,  gt103a,   0,       ROT0, "Greyhound Electronics", "Trivia (Version 1.03a) (alt 3)",          GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
19151917GAME( 1984, gt103aa,  gtsers8,  findout,  gt103a,   0,       ROT0, "Greyhound Electronics", "Trivia (Version 1.03a Alt questions)",    GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
19161918GAME( 1984, gt103asx, gtsers8,  findout,  gt103a,   0,       ROT0, "Greyhound Electronics", "Trivia (Version 1.03a Sex questions)",    GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
19171919
r15082r15083
19351937GAME( 1991, quiz211,  0,        findout,  quiz,     0,       ROT0, "Elettronolo",           "Quiz (Revision 2.11)",                    GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
19361938
19371939GAME( 1992, geimulti, 0,        geimulti, geimulti, geimulti,ROT0, "Grayhound Electronics", "GEI Multi Game",                          GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1938GAME( 1992, sprtauth, 0,        sprtauth, sprtauth, geimulti,ROT0, "Classic Games",         "Sports Authority",                        GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1940GAME( 1992, sprtauth, 0,        sprtauth, sprtauth, geimulti,ROT0, "Classic Games",         "Sports Authority",                        GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
No newline at end of file
src/mame/drivers/segas32.c
r15082r15083
613613            return state->m_misc_io_data[which][offset];
614614
615615         /* otherwise, return an input port */
616         return input_port_read_safe(space->machine(), portnames[which][offset], 0xffff);
616         return state->ioport(portnames[which][offset])->read_safe(0xffff);
617617
618618      /* 'SEGA' protection */
619619      case 0x10/2:
r15082r15083
885885      case 0x12/2:
886886      case 0x14/2:
887887      case 0x16/2:
888         m_analog_value[offset & 3] = input_port_read_safe(machine(), names[offset & 3], 0);
888         m_analog_value[offset & 3] = ioport(names[offset & 3])->read_safe(0);
889889         return;
890890   }
891891   logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(&space.device()), offset*2, data, mem_mask);
r15082r15083
901901      case 0x22/2:
902902      case 0x24/2:
903903      case 0x26/2:
904         return input_port_read_safe(machine(), names[offset & 3], 0xffff);
904         return ioport(names[offset & 3])->read_safe(0xffff);
905905   }
906906
907907   logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", cpu_get_pc(&space.device()), offset*2, mem_mask);
r15082r15083
918918      case 0x12/2:
919919      case 0x14/2:
920920      case 0x16/2:
921         m_analog_value[offset & 3] = input_port_read_safe(machine(), names[m_analog_bank * 4 + (offset & 3)], 0);
921         m_analog_value[offset & 3] = ioport(names[m_analog_bank * 4 + (offset & 3)])->read_safe(0);
922922         return;
923923
924924      case 0x20/2:
r15082r15083
941941      case 0x0c/2:
942942      case 0x10/2:
943943      case 0x14/2:
944         return (UINT8)(input_port_read(machine(), names[offset/2]) - m_sonic_last[offset/2]);
944         return (UINT8)(ioport(names[offset/2])->read() - m_sonic_last[offset/2]);
945945   }
946946
947947   logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", cpu_get_pc(&space.device()), offset*2, mem_mask);
r15082r15083
958958      case 0x00/2:
959959      case 0x08/2:
960960      case 0x10/2:
961         m_sonic_last[offset/2 + 0] = input_port_read(machine(), names[offset/2 + 0]);
962         m_sonic_last[offset/2 + 1] = input_port_read(machine(), names[offset/2 + 1]);
961         m_sonic_last[offset/2 + 0] = ioport(names[offset/2 + 0])->read();
962         m_sonic_last[offset/2 + 1] = ioport(names[offset/2 + 1])->read();
963963         return;
964964   }
965965
src/mame/drivers/looping.c
r15082r15083
900900static DRIVER_INIT( looping )
901901{
902902   looping_state *state = machine.driver_data<looping_state>();
903   int length = machine.root_device().memregion("maincpu")->bytes();
903   int length = state->memregion("maincpu")->bytes();
904904   UINT8 *rom = state->memregion("maincpu")->base();
905905   int i;
906906
src/mame/drivers/badlands.c
r15082r15083
192192   /* sound IRQ is on 32V */
193193   if (scanline & 32)
194194      atarigen_6502_irq_ack_r(space, 0);
195   else if (!(input_port_read(screen.machine(), "FE4000") & 0x40))
195   else if (!(screen.machine().root_device().ioport("FE4000")->read() & 0x40))
196196      atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
197197}
198198
r15082r15083
232232static INTERRUPT_GEN( vblank_int )
233233{
234234   badlands_state *state = device->machine().driver_data<badlands_state>();
235   int pedal_state = input_port_read(device->machine(), "PEDALS");
235   int pedal_state = state->ioport("PEDALS")->read();
236236   int i;
237237
238238   /* update the pedals once per frame */
r15082r15083
306306                0x02 = coin 2
307307                0x01 = coin 1
308308            */
309         result = input_port_read(machine(), "AUDIO");
310         if (!(input_port_read(machine(), "FE4000") & 0x0080)) result ^= 0x90;
309         result = ioport("AUDIO")->read();
310         if (!(ioport("FE4000")->read() & 0x0080)) result ^= 0x90;
311311         if (m_cpu_to_sound_ready) result ^= 0x40;
312312         if (m_sound_to_cpu_ready) result ^= 0x20;
313313         result ^= 0x10;
r15082r15083
426426   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
427427   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
428428   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
429   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_VBLANK )
429   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
430430   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
431431   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
432432
r15082r15083
586586   badlands_state *state = machine.driver_data<badlands_state>();
587587
588588   /* initialize the audio system */
589   state->m_bank_base = &machine.root_device().memregion("audiocpu")->base()[0x03000];
589   state->m_bank_base = &state->memregion("audiocpu")->base()[0x03000];
590590   state->m_bank_source_data = &state->memregion("audiocpu")->base()[0x10000];
591591}
592592
r15082r15083
688688   /* sound IRQ is on 32V */
689689//  if (scanline & 32)
690690//      atarigen_6502_irq_ack_r(screen.machine(), 0);
691//  else if (!(input_port_read(machine, "FE4000") & 0x40))
691//  else if (!(machine.root_device().ioport("FE4000")->read() & 0x40))
692692//      atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
693693}
694694
src/mame/drivers/psikyosh.c
r15082r15083
338338{
339339   if (ACCESSING_BITS_24_31)
340340   {
341      return input_port_read(device->machine(), "JP4");
341      return device->machine().root_device().ioport("JP4")->read();
342342   }
343343
344344   logerror("Unk EEPROM read mask %x\n", mem_mask);
r15082r15083
437437    GND  55|56  GND
438438*/
439439
440   UINT32 controls = input_port_read(machine(), "CONTROLLER");
441   UINT32 value = input_port_read(machine(), "INPUTS");
440   UINT32 controls = ioport("CONTROLLER")->read();
441   UINT32 value = ioport("INPUTS")->read();
442442
443443   if(controls) {
444444      // Clearly has ghosting, game will only recognise one key depressed at once, and keyboard can only represent keys with distinct rows and columns
r15082r15083
483483         KEY11 | KEY6, // Ron
484484         KEY1 | KEY3   // Start
485485      }; // generic Mahjong keyboard encoder, corresponds to ordering in input port
486      UINT32 keys = input_port_read(machine(), "MAHJONG");
486      UINT32 keys = ioport("MAHJONG")->read();
487487      UINT32 which_key = 0x1;
488488      int count = 0;
489489
src/mame/drivers/astinvad.c
r15082r15083
352352   if (bits_gone_hi & 0x08) state->m_samples->start(5, SND_FLEET4);
353353   if (bits_gone_hi & 0x10) state->m_samples->start(4, SND_UFOHIT);
354354
355   state->m_screen_flip = (input_port_read(device->machine(), "CABINET") & data & 0x20) ? 0xff : 0x00;
355   state->m_screen_flip = (state->ioport("CABINET")->read() & data & 0x20) ? 0xff : 0x00;
356356}
357357
358358
r15082r15083
383383
384384   if (bits_gone_hi & 0x04) m_samples->start(3, SND_INVADERHIT);
385385
386   m_screen_flip = (input_port_read(machine(), "CABINET") & data & 0x80) ? 0xff : 0x00;
386   m_screen_flip = (ioport("CABINET")->read() & data & 0x80) ? 0xff : 0x00;
387387}
388388
389389
r15082r15083
460460   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
461461
462462   PORT_START("IN2")
463   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
463   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
464464   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
465465
466466   PORT_START("CABINET")
src/mame/drivers/boogwing.c
r15082r15083
148148   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
149149   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
150150   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
151   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
151   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
152152
153153   PORT_START("DSW")
154154   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
src/mame/drivers/offtwall.c
r15082r15083
9191
9292READ16_MEMBER(offtwall_state::special_port3_r)
9393{
94   int result = input_port_read(machine(), "260010");
94   int result = ioport("260010")->read();
9595   if (m_cpu_to_sound_ready) result ^= 0x0020;
9696   return result;
9797}
r15082r15083
346346   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
347347   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )   /* tested before writing to 260040 */
348348   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
349   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
349   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
350350   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
351351
352352   PORT_START("260012")
src/mame/drivers/neodrvr.c
r15082r15083
95599559
95609560static TIMER_CALLBACK( ms5pcb_bios_timer_callback )
95619561{
9562   int harddip3 = input_port_read(machine, "HARDDIP") & 1;
9562   int harddip3 = machine.root_device().ioport("HARDDIP")->read() & 1;
95639563   machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.root_device().memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
95649564}
95659565
r15082r15083
95969596
95979597static TIMER_CALLBACK( svcpcb_bios_timer_callback )
95989598{
9599   int harddip3 = input_port_read(machine, "HARDDIP") & 1;
9599   int harddip3 = machine.root_device().ioport("HARDDIP")->read() & 1;
96009600   machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.root_device().memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
96019601}
96029602
src/mame/drivers/fromance.c
r15082r15083
180180   int ret = 0xff;
181181
182182   if (m_portselect & 0x01)
183      ret &= input_port_read(machine(), "KEY1");
183      ret &= ioport("KEY1")->read();
184184   if (m_portselect & 0x02)
185      ret &= input_port_read(machine(), "KEY2");
185      ret &= ioport("KEY2")->read();
186186   if (m_portselect & 0x04)
187      ret &= input_port_read(machine(), "KEY3");
187      ret &= ioport("KEY3")->read();
188188   if (m_portselect & 0x08)
189      ret &= input_port_read(machine(), "KEY4");
189      ret &= ioport("KEY4")->read();
190190   if (m_portselect & 0x10)
191      ret &= input_port_read(machine(), "KEY5");
191      ret &= ioport("KEY5")->read();
192192
193193   return ret;
194194}
src/mame/drivers/skykid.c
r15082r15083
3737   switch (m_inputport_selected)
3838   {
3939      case 0x00:   /* DSW B (bits 0-4) */
40         return (input_port_read(machine(), "DSWB") & 0xf8) >> 3;
40         return (ioport("DSWB")->read() & 0xf8) >> 3;
4141      case 0x01:   /* DSW B (bits 5-7), DSW A (bits 0-1) */
42         return ((input_port_read(machine(), "DSWB") & 0x07) << 2) | ((input_port_read(machine(), "DSWA") & 0xc0) >> 6);
42         return ((ioport("DSWB")->read() & 0x07) << 2) | ((ioport("DSWA")->read() & 0xc0) >> 6);
4343      case 0x02:   /* DSW A (bits 2-6) */
44         return (input_port_read(machine(), "DSWA") & 0x3e) >> 1;
44         return (ioport("DSWA")->read() & 0x3e) >> 1;
4545      case 0x03:   /* DSW A (bit 7), DSW C (bits 0-3) */
46         return ((input_port_read(machine(), "DSWA") & 0x01) << 4) | (input_port_read(machine(), "BUTTON2") & 0x0f);
46         return ((ioport("DSWA")->read() & 0x01) << 4) | (ioport("BUTTON2")->read() & 0x0f);
4747      case 0x04:   /* coins, start */
48         return input_port_read(machine(), "SYSTEM");
48         return ioport("SYSTEM")->read();
4949      case 0x05:   /* 2P controls */
50         return input_port_read(machine(), "P2");
50         return ioport("P2")->read();
5151      case 0x06:   /* 1P controls */
52         return input_port_read(machine(), "P1");
52         return ioport("P1")->read();
5353      default:
5454         return 0xff;
5555   }
src/mame/drivers/halleys.c
r15082r15083
14881488      bitmap.fill(state->m_bgcolor, cliprect);
14891489
14901490#ifdef MAME_DEBUG
1491   if (input_port_read(screen.machine(), "DEBUG")) copy_scroll_xp(bitmap, state->m_render_layer[3], *state->m_scrollx0, *state->m_scrolly0); // not used???
1491   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???
14921492#endif
14931493
14941494   copy_scroll_xp(bitmap, state->m_render_layer[2], *state->m_scrollx1, *state->m_scrolly1);
r15082r15083
16281628   //   0x8599 : 'benberob'
16291629   //   0x83e2 : 'halleys', 'halleysc', 'halleycj'
16301630   //   0x83df : 'halley87'
1631   int inp = input_port_read(machine(), "IN0");
1632   int result = ((input_port_read(machine(), "DSW4")) & 0x20) >> 5;
1631   int inp = ioport("IN0")->read();
1632   int result = ((ioport("DSW4")->read()) & 0x20) >> 5;
16331633
16341634   if (inp & 0x80) result |= 0x02;
16351635   if (inp & 0x40) result |= 0x04;
r15082r15083
16421642{
16431643   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
16441644
1645   return input_port_read(machine(), portnames[offset]);
1645   return ioport(portnames[offset])->read();
16461646}
16471647
16481648
src/mame/drivers/djmain.c
r15082r15083
229229READ8_MEMBER(djmain_state::inp1_r)
230230{
231231   static const char *const portnames[] = { "DSW3", "BTN3", "BTN2", "BTN1" };
232   return input_port_read(machine(), portnames[ offset & 0x03 ]);
232   return ioport(portnames[ offset & 0x03 ])->read();
233233}
234234
235235READ8_MEMBER(djmain_state::inp2_r)
236236{
237237   static const char *const portnames[] = { "DSW1", "DSW2", "UNK2", "UNK1" };
238   return input_port_read(machine(), portnames[ offset & 0x03 ]);
238   return ioport(portnames[ offset & 0x03 ])->read();
239239}
240240
241241READ32_MEMBER(djmain_state::turntable_r)
r15082r15083
248248      UINT8 pos;
249249      int delta;
250250
251      pos = input_port_read_safe(machine(), ttnames[m_turntable_select], 0);
251      pos = ioport(ttnames[m_turntable_select])->read_safe(0);
252252      delta = pos - m_turntable_last_pos[m_turntable_select];
253253      if (delta < -128)
254254         delta += 256;
r15082r15083
660660
661661#ifdef PRIORITY_EASINESS_TO_PLAY
662662   #define BEATMANIA_DSW3_STAGES_OLD \
663      PORT_DIPNAME( 0x1c, 0x1c, "Normal Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
663      PORT_DIPNAME( 0x1c, 0x1c, "Normal Mode Stages" ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
664664      PORT_DIPSETTING(    0x10, "3 Stages" ) \
665665      PORT_DIPSETTING(    0x00, "4 Stages" ) \
666666      PORT_DIPSETTING(    0x08, "5 Stages" ) \
667      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
667      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
668668      PORT_DIPSETTING(    0x0c, "1 Stage" ) \
669669      PORT_DIPSETTING(    0x14, "2 Stages" ) \
670670      PORT_DIPSETTING(    0x10, "3 Stages" ) \
r15082r15083
672672      PORT_DIPSETTING(    0x08, "5 Stages" )
673673#else
674674   #define BEATMANIA_DSW3_STAGES_OLD \
675      PORT_DIPNAME( 0x1c, 0x1c, "Normal Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
675      PORT_DIPNAME( 0x1c, 0x1c, "Normal Mode Stages" ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
676676      PORT_DIPSETTING(    0x10, "3 Stages" ) \
677677        PORT_DIPSETTING(  0x1c, "4 Stages" ) /* duplicated setting */ \
678678        PORT_DIPSETTING(  0x0c, "4 Stages" ) /* duplicated setting */ \
r15082r15083
681681        PORT_DIPSETTING(  0x18, "4 Stages" ) /* duplicated setting */ \
682682      PORT_DIPSETTING(    0x00, "4 Stages" ) \
683683      PORT_DIPSETTING(    0x08, "5 Stages" ) \
684      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
684      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
685685      PORT_DIPSETTING(    0x0c, "1 Stage" ) \
686686      PORT_DIPSETTING(    0x14, "2 Stages" ) \
687687      PORT_DIPSETTING(    0x10, "3 Stages" ) \
r15082r15083
694694
695695#ifdef PRIORITY_EASINESS_TO_PLAY
696696   #define BEATMANIA_DSW3_STAGES_MIDDLE( str ) \
697      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
697      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
698698      PORT_DIPSETTING(    0x10, "3 / 3 Stages" ) \
699699      PORT_DIPSETTING(    0x00, "4 / 4 Stages" ) \
700700      PORT_DIPSETTING(    0x08, "5 / 5 Stages" ) \
701      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
701      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
702702      PORT_DIPSETTING(    0x0c, "1 Stage" ) \
703703      PORT_DIPSETTING(    0x14, "2 Stages" ) \
704704      PORT_DIPSETTING(    0x10, "3 Stages" ) \
r15082r15083
706706      PORT_DIPSETTING(    0x08, "5 Stages" )
707707#else
708708   #define BEATMANIA_DSW3_STAGES_MIDDLE( str ) \
709      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
709      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
710710      PORT_DIPSETTING(    0x10, "3 / 3 Stages" ) \
711711        PORT_DIPSETTING(  0x1c, "4 / 4 Stages" ) /* duplicated setting */ \
712712        PORT_DIPSETTING(  0x0c, "4 / 4 Stages" ) /* duplicated setting */ \
r15082r15083
715715        PORT_DIPSETTING(  0x18, "4 / 4 Stages" ) /* duplicated setting */ \
716716      PORT_DIPSETTING(    0x00, "4 / 4 Stages" ) \
717717      PORT_DIPSETTING(    0x08, "5 / 5 Stages" ) \
718      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
718      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
719719      PORT_DIPSETTING(    0x0c, "1 Stage" ) \
720720      PORT_DIPSETTING(    0x14, "2 Stages" ) \
721721      PORT_DIPSETTING(    0x10, "3 Stages" ) \
r15082r15083
728728
729729#ifdef PRIORITY_EASINESS_TO_PLAY
730730   #define BEATMANIA_DSW3_STAGES_NEW( str ) \
731      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
731      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
732732      PORT_DIPSETTING(    0x10, "3 / 2 Stages" ) \
733733      PORT_DIPSETTING(    0x00, "4 / 3 Stages" ) \
734734      PORT_DIPSETTING(    0x08, "5 / 3 Stages" ) \
735      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
735      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
736736      PORT_DIPSETTING(    0x0c, "1 Stage" ) \
737737      PORT_DIPSETTING(    0x14, "2 Stages" ) \
738738      PORT_DIPSETTING(    0x10, "3 Stages" ) \
r15082r15083
740740      PORT_DIPSETTING(    0x08, "5 Stages" )
741741#else
742742   #define BEATMANIA_DSW3_STAGES_NEW( str ) \
743      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
743      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
744744      PORT_DIPSETTING(    0x10, "3 / 2 Stages" ) \
745745        PORT_DIPSETTING(  0x1c, "4 / 3 Stages" ) /* duplicated setting */ \
746746        PORT_DIPSETTING(  0x0c, "4 / 3 Stages" ) /* duplicated setting */ \
r15082r15083
749749        PORT_DIPSETTING(  0x18, "4 / 3 Stages" ) /* duplicated setting */ \
750750      PORT_DIPSETTING(    0x00, "4 / 3 Stages" ) \
751751      PORT_DIPSETTING(    0x08, "5 / 3 Stages" ) \
752      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
752      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
753753      PORT_DIPSETTING(    0x0c, "1 Stage" ) \
754754      PORT_DIPSETTING(    0x14, "2 Stages" ) \
755755      PORT_DIPSETTING(    0x10, "3 Stages" ) \
r15082r15083
853853      PORT_START("DSW3") \
854854      PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) /* bit 7,6 don't exist */ \
855855      BEATMANIA_DSW3_EVENTMODE /* SW3:1 */ \
856      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
856      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
857857      PORT_DIPSETTING(    0x1c, "3 / 3 Stages" ) \
858858      PORT_DIPSETTING(    0x10, "4 / 4 Stages" ) \
859      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
859      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
860860      PORT_DIPSETTING(    0x0c, "1 Stage" ) \
861861      PORT_DIPSETTING(    0x14, "2 Stages" ) \
862862      PORT_DIPSETTING(    0x10, "3 Stages" ) \
r15082r15083
869869      PORT_START("DSW3") \
870870      PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) /* bit 7,6 don't exist */ \
871871      BEATMANIA_DSW3_EVENTMODE /* SW3:1 */ \
872      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
872      PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
873873      PORT_DIPSETTING(    0x1c, "3 / 3 Stages" ) \
874874        PORT_DIPSETTING(  0x0c, "3 / 3 Stages" ) /* duplicated setting */ \
875875        PORT_DIPSETTING(  0x14, "3 / 3 Stages" ) /* duplicated setting */ \
r15082r15083
878878        PORT_DIPSETTING(  0x08, "3 / 3 Stages" ) /* duplicated setting */ \
879879        PORT_DIPSETTING(  0x00, "3 / 3 Stages" ) /* duplicated setting */ \
880880      PORT_DIPSETTING(    0x10, "4 / 4 Stages" ) \
881      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
881      PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
882882      PORT_DIPSETTING(    0x0c, "1 Stage" ) \
883883      PORT_DIPSETTING(    0x14, "2 Stages" ) \
884884      PORT_DIPSETTING(    0x10, "3 Stages" ) \
r15082r15083
914914   /* "Free Hidden Songs" 3-3=On 3-6=On */
915915   PORT_MODIFY("DSW3")
916916   BEATMANIA_DSW3_EVENTMODE /* SW3:1 */
917   PORT_DIPNAME( 0x10, 0x10, "Unused (Used if Event Mode)" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:2")
917   PORT_DIPNAME( 0x10, 0x10, "Unused (Used if Event Mode)" ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:2")
918918   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
919919   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
920   PORT_DIPNAME( 0x08, 0x08, "Free Hidden Songs (step1of2)" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:3")
920   PORT_DIPNAME( 0x08, 0x08, "Free Hidden Songs (step1of2)" ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:3")
921921   PORT_DIPSETTING(    0x08, "No (Off)" )
922922   PORT_DIPSETTING(    0x00, "Yes (On)" )
923   PORT_DIPNAME( 0x18, 0x18, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:3,2")
923   PORT_DIPNAME( 0x18, 0x18, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:3,2")
924924   PORT_DIPSETTING(    0x18, "1 Stage" )
925925   PORT_DIPSETTING(    0x08, "2 Stages" )
926926   PORT_DIPSETTING(    0x10, "3 Stages" )
927927   PORT_DIPSETTING(    0x00, "4 Stages" )
928   PORT_DIPNAME( 0x01, 0x01, "Free Hidden Songs (step2of2)" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:6")
928   PORT_DIPNAME( 0x01, 0x01, "Free Hidden Songs (step2of2)" ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:6")
929929   PORT_DIPSETTING(    0x01, "No (Off)" )
930930   PORT_DIPSETTING(    0x00, "Yes (On)" )
931   PORT_DIPNAME( 0x01, 0x01, "Unused (Used if not Event Mode)" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:6")
931   PORT_DIPNAME( 0x01, 0x01, "Unused (Used if not Event Mode)" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:6")
932932   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
933933   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
934934   /* "Free Hidden Songs" 3-3=On 3-6=On */
src/mame/drivers/segas16a.c
r15082r15083
298298      case 0x1000/2:
299299      {
300300         static const char *const sysports[] = { "SERVICE", "P1", "UNUSED", "P2" };
301         return input_port_read(space->machine(), sysports[offset & 3]);
301         return state->ioport(sysports[offset & 3])->read();
302302      }
303303
304304      case 0x2000/2:
305         return input_port_read(space->machine(), (offset & 1) ? "DSW2" : "DSW1");
305         return state->ioport((offset & 1) ? "DSW2" : "DSW1")->read();
306306   }
307307   logerror("%06X:standard_io_r - unknown read access to address %04X\n", cpu_get_pc(&space->device()), offset * 2);
308308   return 0xffff;
r15082r15083
634634            {
635635               switch (state->m_video_control & 0xf)
636636               {
637                  case 0x00: return input_port_read(space->machine(), "P1"); // "HANDX1"
638                  case 0x04: return input_port_read(space->machine(), "TRACKX1");
639                  case 0x08: return input_port_read(space->machine(), "TRACKY1");
640                  case 0x0c: return input_port_read(space->machine(), "HANDY1");
637                  case 0x00: return state->ioport("P1")->read(); // "HANDX1"
638                  case 0x04: return state->ioport("TRACKX1")->read();
639                  case 0x08: return state->ioport("TRACKY1")->read();
640                  case 0x0c: return state->ioport("HANDY1")->read();
641641               }
642642               break;
643643            }
644644
645645            case 0x02:
646               return input_port_read(space->machine(), "DIAL1") | (input_port_read(space->machine(), "DIAL2") << 4);
646               return state->ioport("DIAL1")->read() | (state->ioport("DIAL2")->read() << 4);
647647               // low nibble: Sega 56pin Edge "16"-"19" // rotary switch 10positions 4bit-binary-pinout
648648               // high nibble: Sega 56pin Edge "T"-"W"  // ditto
649649
r15082r15083
651651            {
652652               switch (state->m_video_control & 0xf)
653653               {
654                  case 0x00: return input_port_read(space->machine(), "P2"); // "HANDX2"
655                  case 0x04: return input_port_read(space->machine(), "TRACKX2");
656                  case 0x08: return input_port_read(space->machine(), "TRACKY2");
657                  case 0x0c: return input_port_read(space->machine(), "HANDY2");
654                  case 0x00: return state->ioport("P2")->read(); // "HANDX2"
655                  case 0x04: return state->ioport("TRACKX2")->read();
656                  case 0x08: return state->ioport("TRACKY2")->read();
657                  case 0x0c: return state->ioport("HANDY2")->read();
658658               }
659659               break;
660660            }
r15082r15083
686686            /* upper bit of the trackball controls */
687687            case 0:
688688            {
689               UINT8 buttons = input_port_read(space->machine(), "SERVICE");
690               UINT8 analog1 = input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1");
691               UINT8 analog2 = input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2");
689               UINT8 buttons = state->ioport("SERVICE")->read();
690               UINT8 analog1 = state->ioport((state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1")->read();
691               UINT8 analog2 = state->ioport((state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2")->read();
692692               buttons |= (analog1 & 0x80) >> 1;
693693               buttons |= (analog2 & 0x80);
694694               return buttons;
r15082r15083
698698            /* player 1 select switch mapped to bit 7 */
699699            case 1:
700700            {
701               UINT8 buttons = input_port_read(space->machine(), "BUTTONS1");
702               UINT8 analog = input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1");
701               UINT8 buttons = state->ioport("BUTTONS1")->read();
702               UINT8 analog = state->ioport((state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1")->read();
703703               return (buttons & 0x80) | (analog & 0x7f);
704704            }
705705
r15082r15083
707707            case 2:
708708            {
709709               if (state->m_video_control & 4)
710                  return (input_port_read(space->machine(), "ANALOGZ1") >> 4) | (input_port_read(space->machine(), "ANALOGZ2") & 0xf0);
710                  return (state->ioport("ANALOGZ1")->read() >> 4) | (state->ioport("ANALOGZ2")->read() & 0xf0);
711711               else
712712               {
713                  UINT8 buttons1 = input_port_read(space->machine(), "BUTTONS1");
714                  UINT8 buttons2 = input_port_read(space->machine(), "BUTTONS2");
713                  UINT8 buttons1 = state->ioport("BUTTONS1")->read();
714                  UINT8 buttons2 = state->ioport("BUTTONS2")->read();
715715
716716                  if (!(buttons1 & 0x01))
717717                     state->m_last_buttons1 = 0;
r15082r15083
739739            /* player 2 select switch mapped to bit 7 */
740740            case 3:
741741            {
742               UINT8 buttons = input_port_read(space->machine(), "BUTTONS2");
743               UINT8 analog = input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2");
742               UINT8 buttons = state->ioport("BUTTONS2")->read();
743               UINT8 analog = state->ioport((state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2")->read();
744744               return (buttons & 0x80) | (analog & 0x7f);
745745            }
746746         }
r15082r15083
773773            case 1:
774774               switch ((state->m_read_port++) & 3)
775775               {
776                  case 0: return input_port_read(space->machine(), "P1");
777                  case 1: return input_port_read(space->machine(), "P2");
778                  case 2: return input_port_read(space->machine(), "P3");
779                  case 3: return input_port_read(space->machine(), "P4");
776                  case 0: return state->ioport("P1")->read();
777                  case 1: return state->ioport("P2")->read();
778                  case 2: return state->ioport("P3")->read();
779                  case 3: return state->ioport("P4")->read();
780780               }
781781
782782               break;
r15082r15083
803803      case 0x1000/2:
804804         switch (offset & 3)
805805         {
806            case 1:   return input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1");
807            case 3:   return input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2");
806            case 1:   return state->ioport((state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1")->read();
807            case 3:   return state->ioport((state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2")->read();
808808         }
809809         break;
810810   }
r15082r15083
830830         switch (offset & 3)
831831         {
832832            case 1:
833               if (input_port_read_safe(space->machine(), portname[state->m_mj_input_num], 0xff) != 0xff)
833               if (state->ioport(portname[state->m_mj_input_num])->read_safe(0xff) != 0xff)
834834                  return 0xff & ~(1 << state->m_mj_input_num);
835835               return 0xff;
836836
837837            case 2:
838               return input_port_read_safe(space->machine(), portname[state->m_mj_input_num], 0xff);
838               return state->ioport(portname[state->m_mj_input_num])->read_safe(0xff);
839839         }
840840         break;
841841   }
r15082r15083
973973         return maincpu_byte_r(space->machine(), 0x840001 ^ offset);
974974
975975      case 5:
976         return space->machine().root_device().memregion("maincpu")->base()[0x00000 + offset];
976         return state->memregion("maincpu")->base()[0x00000 + offset];
977977      case 6:
978         return space->machine().root_device().memregion("maincpu")->base()[0x10000 + offset];
978         return state->memregion("maincpu")->base()[0x10000 + offset];
979979      case 7:
980980         return state->memregion("maincpu")->base()[0x20000 + offset];
981981
src/mame/drivers/neogeo.c
r15082r15083
391391         { "IN0-0", "IN0-1" }, { "IN1-0", "IN1-1" }
392392      };
393393
394   return input_port_read_safe(machine(), cntrl[port][m_controller_select & 0x01], 0x00);
394   return ioport(cntrl[port][m_controller_select & 0x01])->read_safe(0x00);
395395}
396396
397397#if 1 // this needs to be added dynamically somehow
r15082r15083
410410   {
411411   default:
412412   case 0x00: ret = 0x0000; break; /* nothing? */
413   case 0x09: ret = input_port_read(machine(), "MAHJONG1"); break;
414   case 0x12: ret = input_port_read(machine(), "MAHJONG2"); break;
415   case 0x1b: ret = input_port_read(machine(), "MAHJONG3"); break; /* player 1 normal inputs? */
416   case 0x24: ret = input_port_read(machine(), "MAHJONG4"); break;
413   case 0x09: ret = ioport("MAHJONG1")->read(); break;
414   case 0x12: ret = ioport("MAHJONG2")->read(); break;
415   case 0x1b: ret = ioport("MAHJONG3")->read(); break; /* player 1 normal inputs? */
416   case 0x24: ret = ioport("MAHJONG4")->read(); break;
417417   }
418418
419419   return ret;
r15082r15083
800800   UINT32 address_mask;
801801
802802   /* audio bios/cartridge selection */
803   if (machine.root_device().memregion("audiobios")->base())
804      state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(0, machine.root_device().memregion("audiobios")->base());
805   state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(1, machine.root_device().memregion("audiocpu")->base());
803   if (state->memregion("audiobios")->base())
804      state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(0, state->memregion("audiobios")->base());
805   state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(1, state->memregion("audiocpu")->base());
806806
807807   /* audio banking */
808   address_mask = machine.root_device().memregion("audiocpu")->bytes() - 0x10000 - 1;
808   address_mask = state->memregion("audiocpu")->bytes() - 0x10000 - 1;
809809
810810   rgn = state->memregion("audiocpu")->base();
811811   for (region = 0; region < 4; region++)
src/mame/drivers/snookr10.c
r15082r15083
390390    BIT 7 = Complement of DS1, bit 7
391391   ---------------------------------
392392*/
393return input_port_read(machine(), "SW1");
393return ioport("SW1")->read();
394394}
395395
396396
src/mame/drivers/segahang.c
r15082r15083
180180      case 0x1000/2: /* Input ports and DIP switches */
181181      {
182182         static const char *const sysports[] = { "SERVICE", "COINAGE", "DSW", "UNKNOWN" };
183         return input_port_read(space->machine(), sysports[offset & 3]);
183         return space->machine().root_device().ioport(sysports[offset & 3])->read();
184184      }
185185
186186      case 0x3000/2: /* PPI @ 4C */
r15082r15083
189189      case 0x3020/2: /* ADC0804 data output */
190190      {
191191         static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
192         return input_port_read_safe(space->machine(), adcports[state->m_adc_select], 0);
192         return state->ioport(adcports[state->m_adc_select])->read_safe(0);
193193      }
194194   }
195195
r15082r15083
235235      case 0x0010/2: /* Input ports and DIP switches */
236236      {
237237         static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
238         return input_port_read(space->machine(), sysports[offset & 3]);
238         return space->machine().root_device().ioport(sysports[offset & 3])->read();
239239      }
240240
241241      case 0x0020/2: /* PPI @ 4C */
r15082r15083
245245      case 0x0030/2: /* ADC0804 data output */
246246      {
247247         static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
248         return input_port_read_safe(space->machine(), adcports[state->m_adc_select], 0);
248         return state->ioport(adcports[state->m_adc_select])->read_safe(0);
249249      }
250250   }
251251
r15082r15083
393393
394394static void sharrier_i8751_sim(running_machine &machine)
395395{
396   workram[0x492/2] = (input_port_read(machine, "ADC0") << 8) | input_port_read(machine, "ADC1");
396   workram[0x492/2] = (machine.root_device().ioport("ADC0")->read() << 8) | machine.root_device().ioport("ADC1")->read();
397397}
398398
399399
src/mame/drivers/statriv2.c
r15082r15083
204204static INTERRUPT_GEN( statriv2_interrupt )
205205{
206206   statriv2_state *state = device->machine().driver_data<statriv2_state>();
207   UINT8 new_coin = input_port_read(device->machine(), "COIN");
207   UINT8 new_coin = state->ioport("COIN")->read();
208208
209209   /* check the coin inputs once per frame */
210210   state->m_latched_coin |= new_coin & (new_coin ^ state->m_last_coin);
src/mame/drivers/ladybug.c
r15082r15083
203203
204204CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p1_control_r)
205205{
206   return input_port_read(machine(), LADYBUG_P1_CONTROL_PORT_TAG);
206   return ioport(LADYBUG_P1_CONTROL_PORT_TAG)->read();
207207}
208208
209209CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r)
r15082r15083
211211   UINT32 ret;
212212
213213   /* upright cabinet only uses a single set of controls */
214   if (input_port_read(machine(), "DSW0") & 0x20)
215      ret = input_port_read(machine(), LADYBUG_P2_CONTROL_PORT_TAG);
214   if (ioport("DSW0")->read() & 0x20)
215      ret = ioport(LADYBUG_P2_CONTROL_PORT_TAG)->read();
216216   else
217      ret = input_port_read(machine(), LADYBUG_P1_CONTROL_PORT_TAG);
217      ret = ioport(LADYBUG_P1_CONTROL_PORT_TAG)->read();
218218
219219   return ret;
220220}
r15082r15083
234234   /* Note that there are TWO VBlank inputs, one is active low, the other active */
235235   /* high. There are probably other differencies in the hardware, but emulating */
236236   /* them this way is enough to get the game running. */
237   PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
237   PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
238238
239239   PORT_START("IN2")
240240   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
331331   /* Note that there are TWO VBlank inputs, one is active low, the other active */
332332   /* high. There are probably other differencies in the hardware, but emulating */
333333   /* them this way is enough to get the game running. */
334   PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
334   PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
335335
336336   PORT_START("IN2")
337337   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
416416   /* Note that there are TWO VBlank inputs, one is active low, the other active */
417417   /* high. There are probably other differencies in the hardware, but emulating */
418418   /* them this way is enough to get the game running. */
419   PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
419   PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
420420
421421   PORT_START("IN2")
422422   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
r15082r15083
499499   /* Note that there are TWO VBlank inputs, one is active low, the other active */
500500   /* high. There are probably other differencies in the hardware, but emulating */
501501   /* them this way is enough to get the game running. */
502   PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
502   PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
503503
504504   PORT_START("IN2")
505505   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/icecold.c
r15082r15083
207207   {
208208      case 0:
209209         // override the ball gate switch
210         return input_port_read(machine(), "X0") & ~(m_ball_gate_sw<<2);
210         return ioport("X0")->read() & ~(m_ball_gate_sw<<2);
211211      case 1:
212         return input_port_read(machine(), "X1");
212         return ioport("X1")->read();
213213      case 2:
214         return input_port_read(machine(), "X2");
214         return ioport("X2")->read();
215215      default:
216216         return 0xff;
217217   }
src/mame/drivers/starshp1.c
r15082r15083
1616
1717static INTERRUPT_GEN( starshp1_interrupt )
1818{
19   if ((input_port_read(device->machine(), "SYSTEM") & 0x90) != 0x90)
19   if ((device->machine().root_device().ioport("SYSTEM")->read() & 0x90) != 0x90)
2020      generic_pulse_irq_line(device, 0, 1);
2121}
2222
r15082r15083
7171   switch (m_analog_in_select)
7272   {
7373   case 0:
74      val = input_port_read(machine(), "STICKY");
74      val = ioport("STICKY")->read();
7575      break;
7676   case 1:
77      val = input_port_read(machine(), "STICKX");
77      val = ioport("STICKX")->read();
7878      break;
7979   case 2:
8080      val = 0x20; /* DAC feedback, not used */
8181      break;
8282   case 3:
83      val = input_port_read(machine(), "PLAYTIME");
83      val = ioport("PLAYTIME")->read();
8484      break;
8585   }
8686
r15082r15083
202202   PORT_START("VBLANK")
203203   PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, starshp1_state,starshp1_analog_r, NULL)   /* analog in */
204204   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
205   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
205   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
206206
207207   PORT_START("COINAGE")
208208   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, starshp1_state,collision_latch_r, NULL)   /* collision latch */
src/mame/drivers/taito_f2.c
r15082r15083
324324   switch (offset)
325325   {
326326      case 0x00:
327         return (input_port_read(machine(), "DSWA") << 8);
327         return (ioport("DSWA")->read() << 8);
328328
329329      case 0x01:
330         return (input_port_read(machine(), "DSWB") << 8);
330         return (ioport("DSWB")->read() << 8);
331331
332332      case 0x02:
333         return (input_port_read(machine(), "IN0") << 8);
333         return (ioport("IN0")->read() << 8);
334334
335335      case 0x03:
336         return (input_port_read(machine(), "IN1") << 8);
336         return (ioport("IN1")->read() << 8);
337337
338338      case 0x04:
339         return (input_port_read(machine(), "IN3") << 8);
339         return (ioport("IN3")->read() << 8);
340340
341341      case 0x05:
342         return (input_port_read(machine(), "IN4") << 8);
342         return (ioport("IN4")->read() << 8);
343343
344344      case 0x06:
345         return (input_port_read(machine(), "IN2") << 8);
345         return (ioport("IN2")->read() << 8);
346346
347347//      case 0x07:
348348//          return (coin_word & mem_mask);
r15082r15083
360360   switch (offset)
361361   {
362362      case 0x00:
363         curr = input_port_read(machine(), "PADDLE1");
363         curr = ioport("PADDLE1")->read();
364364         res = curr - m_last[0];
365365         m_last[0] = curr;
366366         return res;
367367
368368      case 0x02:
369         curr = input_port_read(machine(), "PADDLE2");
369         curr = ioport("PADDLE2")->read();
370370         res = curr - m_last[1];
371371         m_last[1] = curr;
372372         return res;
r15082r15083
383383   {
384384      case 0x00:
385385      {
386         return (input_port_read(machine(), "IN5") << 8) + input_port_read(machine(), "DSWA");   /* DSW A + coin */
386         return (ioport("IN5")->read() << 8) + ioport("DSWA")->read();   /* DSW A + coin */
387387      }
388388
389389      case 0x01:
390390      {
391         return (input_port_read(machine(), "IN6") << 8) + input_port_read(machine(), "DSWB");   /* DSW B + coin */
391         return (ioport("IN6")->read() << 8) + ioport("DSWB")->read();   /* DSW B + coin */
392392      }
393393   }
394394
r15082r15083
402402   switch (m_mjnquest_input)
403403   {
404404      case 0x01:
405           return input_port_read(machine(), "IN0");
405           return ioport("IN0")->read();
406406
407407       case 0x02:
408           return input_port_read(machine(), "IN1");
408           return ioport("IN1")->read();
409409
410410       case 0x04:
411           return input_port_read(machine(), "IN2");
411           return ioport("IN2")->read();
412412
413413       case 0x08:
414           return input_port_read(machine(), "IN3");
414           return ioport("IN3")->read();
415415
416416       case 0x10:
417           return input_port_read(machine(), "IN4");
417           return ioport("IN4")->read();
418418
419419   }
420420
r15082r15083
24612461
24622462   PORT_START("IN0")
24632463   /* Joystick Control */
2464   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2465   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2466   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2467   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2468   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2469   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2470   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2471   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )                                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2464   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2465   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2466   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2467   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2468   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)                  PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2469   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2470   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2471   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )                                  PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
24722472   /* 4 Buttons Control */
2473   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2474   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2475   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2476   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2477   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )                                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2478   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2479   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2480   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2473   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)                  PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2474   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)                  PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2475   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)                  PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2476   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)                  PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2477   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )                                  PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2478   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2479   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2480   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
24812481
24822482   PORT_START("IN1")
24832483   /* Joystick Control */
2484   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2485   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2486   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2487   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2488   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2489   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2490   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2491   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )                                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
2484   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2485   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2486   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2487   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2488   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)                  PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2489   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2490   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
2491   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )                                  PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
24922492   /* 4 Buttons Control */
2493   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2494   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2495   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2496   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2497   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )                                  PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2498   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2499   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2500   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
2493   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)                  PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2494   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)                  PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2495   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)                  PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2496   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)                  PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2497   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )                                  PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2498   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2499   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
2500   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )                                 PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
25012501
25022502   PORT_START("IN2")
25032503   TAITO_F2_SYSTEM_INPUT
r15082r15083
53105310static DRIVER_INIT( mjnquest )
53115311{
53125312   taitof2_state *state = machine.driver_data<taitof2_state>();
5313   int i, len = machine.root_device().memregion("gfx2")->bytes();
5313   int i, len = state->memregion("gfx2")->bytes();
53145314   UINT8 *gfx = state->memregion("gfx2")->base();
53155315
53165316   /* the bytes in each longword are in reversed order, put them in the
src/mame/drivers/gottlieb.c
r15082r15083
295295   const char *string = (const char *)param;
296296   int which = string[0] - '0';
297297
298   return input_port_read(machine(), &string[1]) - m_track[which];
298   return ioport(&string[1])->read() - m_track[which];
299299}
300300
301301
302302WRITE8_MEMBER(gottlieb_state::gottlieb_analog_reset_w)
303303{
304304   /* reset the trackball counters */
305   m_track[0] = input_port_read_safe(machine(), "TRACKX", 0);
306   m_track[1] = input_port_read_safe(machine(), "TRACKY", 0);
305   m_track[0] = ioport("TRACKX")->read_safe(0);
306   m_track[1] = ioport("TRACKY")->read_safe(0);
307307}
308308
309309
310310CUSTOM_INPUT_MEMBER(gottlieb_state::stooges_joystick_r)
311311{
312312   static const char *const joyport[] = { "P2JOY", "P3JOY", "P1JOY", NULL };
313   return (joyport[m_joystick_select & 3] != NULL) ? input_port_read(machine(), joyport[m_joystick_select & 3]) : 0xff;
313   return (joyport[m_joystick_select & 3] != NULL) ? ioport(joyport[m_joystick_select & 3])->read() : 0xff;
314314}
315315
316316
r15082r15083
12351235   PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )
12361236   PORT_DIPSETTING(    0x20, DEF_STR( French ) )
12371237   PORT_DIPNAME( 0xc2, 0x00, DEF_STR( Coinage ) )         PORT_DIPLOCATION("DSW:!6,!7,!8")
1238   PORT_DIPSETTING(    0x42, "A 3/1 B 1/2" )   PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x20)
1239   PORT_DIPSETTING(    0x42, "A 4/1 B 1/1" )   PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x00)
1240   PORT_DIPSETTING(    0x82, "A 1/5 B 1/2" )   PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x20)
1241   PORT_DIPSETTING(    0x82, "A 3/1 B 1/1" )   PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x00)
1242   PORT_DIPSETTING(    0x02, "A 2/1 B 2/3" )   PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x20)
1243   PORT_DIPSETTING(    0x02, "A 2/1 B 1/1" )   PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x00)
1238   PORT_DIPSETTING(    0x42, "A 3/1 B 1/2" )   PORT_CONDITION("DSW",0x20,EQUALS,0x20)
1239   PORT_DIPSETTING(    0x42, "A 4/1 B 1/1" )   PORT_CONDITION("DSW",0x20,EQUALS,0x00)
1240   PORT_DIPSETTING(    0x82, "A 1/5 B 1/2" )   PORT_CONDITION("DSW",0x20,EQUALS,0x20)
1241   PORT_DIPSETTING(    0x82, "A 3/1 B 1/1" )   PORT_CONDITION("DSW",0x20,EQUALS,0x00)
1242   PORT_DIPSETTING(    0x02, "A 2/1 B 2/3" )   PORT_CONDITION("DSW",0x20,EQUALS,0x20)
1243   PORT_DIPSETTING(    0x02, "A 2/1 B 1/1" )   PORT_CONDITION("DSW",0x20,EQUALS,0x00)
12441244   PORT_DIPSETTING(    0xc0, "A 2/1 B 2/1" )
1245   PORT_DIPSETTING(    0x80, "A 1/1 B 1/2" )   PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x20)
1246   PORT_DIPSETTING(    0x80, "A 2/1 B 1/2" )   PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x00)
1247   PORT_DIPSETTING(    0x40, "A 1/1 B 1/3" )   PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x20)
1248   PORT_DIPSETTING(    0x40, "A 2/1 B 1/3" )   PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x00)
1245   PORT_DIPSETTING(    0x80, "A 1/1 B 1/2" )   PORT_CONDITION("DSW",0x20,EQUALS,0x20)
1246   PORT_DIPSETTING(    0x80, "A 2/1 B 1/2" )   PORT_CONDITION("DSW",0x20,EQUALS,0x00)
1247   PORT_DIPSETTING(    0x40, "A 1/1 B 1/3" )   PORT_CONDITION("DSW",0x20,EQUALS,0x20)
1248   PORT_DIPSETTING(    0x40, "A 2/1 B 1/3" )   PORT_CONDITION("DSW",0x20,EQUALS,0x00)
12491249   PORT_DIPSETTING(    0x00, "A 1/1 B 1/1" )
12501250   PORT_DIPSETTING(    0xc2, DEF_STR( Free_Play ) )
12511251
src/mame/drivers/ddragon.c
r15082r15083
690690   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
691691   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )
692692   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
693   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
693   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
694694   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ddragon_state,sub_cpu_busy, NULL)
695695   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
696696   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
20232023   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(ddragon_state::toffy_bankswitch_w),state));
20242024
20252025   /* the program rom has a simple bitswap encryption */
2026   rom = machine.root_device().memregion("maincpu")->base();
2027   length = machine.root_device().memregion("maincpu")->bytes();
2026   rom = state->memregion("maincpu")->base();
2027   length = state->memregion("maincpu")->bytes();
20282028   for (i = 0; i < length; i++)
20292029      rom[i] = BITSWAP8(rom[i], 6,7,5,4,3,2,1,0);
20302030
20312031   /* and the fg gfx ... */
2032   rom = machine.root_device().memregion("gfx1")->base();
2033   length = machine.root_device().memregion("gfx1")->bytes();
2032   rom = state->memregion("gfx1")->base();
2033   length = state->memregion("gfx1")->bytes();
20342034   for (i = 0; i < length; i++)
20352035      rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0);
20362036
20372037   /* and the sprites gfx */
2038   rom = machine.root_device().memregion("gfx2")->base();
2039   length = machine.root_device().memregion("gfx2")->bytes();
2038   rom = state->memregion("gfx2")->base();
2039   length = state->memregion("gfx2")->bytes();
20402040   for (i = 0; i < length; i++)
20412041      rom[i] = BITSWAP8(rom[i], 7,6,5,4,3,2,0,1);
20422042
20432043   /* and the bg gfx */
2044   rom = machine.root_device().memregion("gfx3")->base();
2044   rom = state->memregion("gfx3")->base();
20452045   length = state->memregion("gfx3")->bytes();
20462046   for (i = 0; i < length / 2; i++)
20472047   {
r15082r15083
20582058   int i;
20592059   UINT8 *dst,*src;
20602060
2061   src = machine.root_device().memregion("chars")->base();
2061   src = state->memregion("chars")->base();
20622062   dst = state->memregion("gfx1")->base();
20632063
20642064   for (i = 0; i < 0x8000; i++)
src/mame/drivers/acommand.c
r15082r15083
321321                ---- ---- ---- --x- (Activate Test)
322322                ---- ---- ---- ---x (Advance through Tests)
323323            */
324         return input_port_read(machine(), "IN0");
324         return ioport("IN0")->read();
325325      case 0x0014/2:
326326      case 0x0016/2:
327327         return machine().device<okim6295_device>("oki1")->read(space,0);
r15082r15083
392392                xxxx xxxx ---- ---- DIPSW4
393393                ---- ---- xxxx xxxx DIPSW3
394394            */
395         return input_port_read(machine(), "IN1");
395         return ioport("IN1")->read();
396396   }
397397   return m_ac_devram[offset];
398398}
src/mame/drivers/asterix.c
r15082r15083
4646      /* bit 0 is data */
4747      /* bit 1 is cs (active low) */
4848      /* bit 2 is clock (active high) */
49      input_port_write(machine(), "EEPROMOUT", data, 0xff);
49      ioport("EEPROMOUT")->write(data, 0xff);
5050
5151      /* bit 5 is select tile bank */
5252      k056832_set_tile_bank(m_k056832, (data & 0x20) >> 5);
src/mame/drivers/goldnpkr.c
r15082r15083
11991199   goldnpkr_state *state = device->machine().driver_data<goldnpkr_state>();
12001200   switch( state->m_mux_data & 0xf0 )      /* bits 4-7 */
12011201   {
1202      case 0x10: return input_port_read(device->machine(), "IN0-0");
1203      case 0x20: return input_port_read(device->machine(), "IN0-1");
1204      case 0x40: return input_port_read(device->machine(), "IN0-2");
1205      case 0x80: return input_port_read(device->machine(), "IN0-3");
1202      case 0x10: return state->ioport("IN0-0")->read();
1203      case 0x20: return state->ioport("IN0-1")->read();
1204      case 0x40: return state->ioport("IN0-2")->read();
1205      case 0x80: return state->ioport("IN0-3")->read();
12061206   }
12071207   return 0xff;
12081208}
r15082r15083
12141214
12151215   switch( state->m_mux_data & 0xf0 )      /* bits 4-7 */
12161216   {
1217      case 0x10: return input_port_read(device->machine(), "IN0-0");
1218      case 0x20: return input_port_read(device->machine(), "IN0-1");
1219      case 0x40: return input_port_read(device->machine(), "IN0-2");
1220      case 0x80: return input_port_read(device->machine(), "IN0-3");
1217      case 0x10: return state->ioport("IN0-0")->read();
1218      case 0x20: return state->ioport("IN0-1")->read();
1219      case 0x40: return state->ioport("IN0-2")->read();
1220      case 0x80: return state->ioport("IN0-3")->read();
12211221   }
12221222
12231223   pa_7 = (state->m_pia0_PA_data >> 7) & 1;   /* To do: bit PA5 to pin CB1 */
src/mame/drivers/xxmissio.c
r15082r15083
199199
200200   PORT_START("STATUS")
201201   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state,xxmissio_status_r, (void *)0x01)
202   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
202   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
203203   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state,xxmissio_status_r, (void *)0x04)
204204   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state,xxmissio_status_r, (void *)0x08)
205205   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state,xxmissio_status_r, (void *)0x10)
src/mame/drivers/hyhoo.c
r15082r15083
2929#include "includes/hyhoo.h"
3030#include "machine/nvram.h"
3131
32#define   SIGNED_DAC   0      // 0:unsigned DAC, 1:signed DAC
33#if SIGNED_DAC
34#define DAC_WRITE   dac_signed_w
35#else
36#define DAC_WRITE   dac_w
37#endif
3832
39
4033static DRIVER_INIT( hyhoo )
4134{
4235   nb1413m3_type = NB1413M3_HYHOO;
r15082r15083
6457   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r, nb1413m3_inputportsel_w)
6558   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r, nb1413m3_sndrombank1_w)
6659   AM_RANGE(0xc0, 0xcf) AM_WRITEONLY AM_SHARE("clut")
67   AM_RANGE(0xd0, 0xd0) AM_READNOP AM_DEVWRITE_LEGACY("dac", DAC_WRITE)      // unknown read
60   AM_RANGE(0xd0, 0xd0) AM_READNOP AM_DEVWRITE_LEGACY("dac", dac_w)      // unknown read
6861   AM_RANGE(0xe0, 0xe0) AM_WRITE(hyhoo_romsel_w)
6962   AM_RANGE(0xe0, 0xe1) AM_READ_LEGACY(nb1413m3_gfxrom_r)
7063   AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r)
r15082r15083
321314ROM_END
322315
323316
324GAME( 1987, hyhoo,  0, hyhoo,  hyhoo,  hyhoo,  ROT90, "Nichibutsu", "Taisen Quiz HYHOO (Japan)", 0 )
325GAME( 1987, hyhoo2, 0, hyhoo,  hyhoo2, hyhoo2, ROT90, "Nichibutsu", "Taisen Quiz HYHOO 2 (Japan)", 0 )
326
317GAME( 1987, hyhoo,  0, hyhoo,  hyhoo,  hyhoo,  ROT90, "Nichibutsu", "Hayaoshi Taisen Quiz Hyhoo (Japan)", 0 )
318GAME( 1987, hyhoo2, 0, hyhoo,  hyhoo2, hyhoo2, ROT90, "Nichibutsu", "Hayaoshi Taisen Quiz Hyhoo 2 (Japan)", 0 )
src/mame/drivers/moo.c
r15082r15083
8282
8383   COMBINE_DATA(&m_cur_control2);
8484
85   input_port_write(machine(), "EEPROMOUT", m_cur_control2, 0xff);
85   ioport("EEPROMOUT")->write(m_cur_control2, 0xff);
8686
8787   if (data & 0x100)
8888      k053246_set_objcha_line(m_k053246, ASSERT_LINE);
src/mame/drivers/taito_l.c
r15082r15083
487487static READ8_DEVICE_HANDLER( portA_r )
488488{
489489   taitol_state *state = device->machine().driver_data<taitol_state>();
490   return input_port_read(device->machine(), (state->m_extport == 0) ? state->m_porte0_tag : state->m_porte1_tag);
490   return state->ioport((state->m_extport == 0) ? state->m_porte0_tag : state->m_porte1_tag)->read();
491491}
492492
493493static READ8_DEVICE_HANDLER( portB_r )
494494{
495495   taitol_state *state = device->machine().driver_data<taitol_state>();
496   return input_port_read(device->machine(), (state->m_extport == 0) ? state->m_portf0_tag : state->m_portf1_tag);
496   return state->ioport((state->m_extport == 0) ? state->m_portf0_tag : state->m_portf1_tag)->read();
497497}
498498
499499static READ8_DEVICE_HANDLER( extport_select_and_ym2203_r )
r15082r15083
551551   switch (m_mux_ctrl)
552552   {
553553   case 0:
554      return input_port_read(machine(), "DSWA");
554      return ioport("DSWA")->read();
555555   case 1:
556      return input_port_read(machine(), "DSWB");
556      return ioport("DSWB")->read();
557557   case 2:
558      return input_port_read(machine(), "IN0");
558      return ioport("IN0")->read();
559559   case 3:
560      return input_port_read(machine(), "IN1");
560      return ioport("IN1")->read();
561561   case 7:
562      return input_port_read(machine(), "IN2");
562      return ioport("IN2")->read();
563563   default:
564564      logerror("Mux read from unknown port %d (%04x)\n", m_mux_ctrl, cpu_get_pc(&space.device()));
565565      return 0xff;
r15082r15083
636636{
637637
638638   /* reset the trackball counter */
639   m_tracky = input_port_read(machine(), "AN0");
639   m_tracky = ioport("AN0")->read();
640640   return 0;
641641}
642642
r15082r15083
644644{
645645
646646   /* reset the trackball counter */
647   m_trackx = input_port_read(machine(), "AN1");
647   m_trackx = ioport("AN1")->read();
648648   return 0;
649649}
650650
651651READ8_MEMBER(taitol_state::horshoes_tracky_lo_r)
652652{
653   return (input_port_read(machine(), "AN0") - m_tracky) & 0xff;
653   return (ioport("AN0")->read() - m_tracky) & 0xff;
654654}
655655
656656READ8_MEMBER(taitol_state::horshoes_tracky_hi_r)
657657{
658   return (input_port_read(machine(), "AN0") - m_tracky) >> 8;
658   return (ioport("AN0")->read() - m_tracky) >> 8;
659659}
660660
661661READ8_MEMBER(taitol_state::horshoes_trackx_lo_r)
662662{
663   return (input_port_read(machine(), "AN1") - m_trackx) & 0xff;
663   return (ioport("AN1")->read() - m_trackx) & 0xff;
664664}
665665
666666READ8_MEMBER(taitol_state::horshoes_trackx_hi_r)
667667{
668   return (input_port_read(machine(), "AN1") - m_trackx) >> 8;
668   return (ioport("AN1")->read() - m_trackx) >> 8;
669669}
670670
671671
r15082r15083
15321532   PORT_DIPSETTING(    0x08, "Mode A" )
15331533   PORT_DIPSETTING(    0x00, "Mode B" )
15341534   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:5,6")
1535   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
1536   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
1537   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
1538   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
1539   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
1540   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
1541   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
1542   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
1535   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
1536   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
1537   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
1538   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
1539   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
1540   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
1541   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
1542   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
15431543   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:7,8")
1544   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
1545   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
1546   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
1547   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
1548   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
1549   PORT_DIPSETTING(    0x40, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
1550   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
1551   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
1544   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
1545   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
1546   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
1547   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
1548   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
1549   PORT_DIPSETTING(    0x40, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
1550   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
1551   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
15521552
15531553   PORT_START("DSWB")
15541554   TAITO_DIFFICULTY_LOC(SW2)            /* Difficulty controls the number of hits requiered to destroy enemies */
src/mame/drivers/eolith16.c
r15082r15083
5151   m_vbuffer = (data & 0x80) >> 7;
5252   coin_counter_w(machine(), 0, data & 1);
5353
54   input_port_write(machine(), "EEPROMOUT", data, 0xff);
54   ioport("EEPROMOUT")->write(data, 0xff);
5555
5656   //data & 0x100 and data & 0x004 always set
5757}
r15082r15083
5959READ16_MEMBER(eolith16_state::eolith16_custom_r)
6060{
6161   eolith_speedup_read(&space);
62   return input_port_read(machine(), "SPECIAL");
62   return ioport("SPECIAL")->read();
6363}
6464
6565
src/mame/drivers/groundfx.c
r15082r15083
146146
147147         if (ACCESSING_BITS_0_7)
148148         {
149            input_port_write(machine(), "EEPROMOUT", data, 0xff);
149            ioport("EEPROMOUT")->write(data, 0xff);
150150         }
151151
152152         break;
r15082r15083
166166
167167READ32_MEMBER(groundfx_state::groundfx_adc_r)
168168{
169   return (input_port_read(machine(), "AN0") << 8) | input_port_read(machine(), "AN1");
169   return (ioport("AN0")->read() << 8) | ioport("AN1")->read();
170170}
171171
172172WRITE32_MEMBER(groundfx_state::groundfx_adc_w)
src/mame/drivers/tickee.c
r15082r15083
7171{
7272   const rectangle &visarea = machine.primary_screen->visible_area();
7373
74   *x = (((input_port_read(machine, player ? "GUNX2" : "GUNX1") & 0xff) * visarea.width()) >> 8) + visarea.min_x;
75   *y = (((input_port_read(machine, player ? "GUNY2" : "GUNY1") & 0xff) * visarea.height()) >> 8) + visarea.min_y;
74   *x = (((machine.root_device().ioport(player ? "GUNX2" : "GUNX1")->read() & 0xff) * visarea.width()) >> 8) + visarea.min_x;
75   *y = (((machine.root_device().ioport(player ? "GUNY2" : "GUNY1")->read() & 0xff) * visarea.height()) >> 8) + visarea.min_y;
7676}
7777
7878
src/mame/drivers/srmp5.c
r15082r15083
288288   switch (m_input_select)
289289   {
290290   case 0x01:
291      ret = input_port_read(machine(), "IN0");
291      ret = ioport("IN0")->read();
292292      break;
293293   case 0x02:
294      ret = input_port_read(machine(), "IN1");
294      ret = ioport("IN1")->read();
295295      break;
296296   case 0x04:
297      ret = input_port_read(machine(), "IN2");
297      ret = ioport("IN2")->read();
298298      break;
299299   case 0x00:
300300   case 0x08:
301      ret = input_port_read(machine(), "IN3");
301      ret = ioport("IN3")->read();
302302      break;
303303   }
304304   return ret;
src/mame/drivers/fcombat.c
r15082r15083
6161READ8_MEMBER(fcombat_state::fcombat_port01_r)
6262{
6363   /* the cocktail flip bit muxes between ports 0 and 1 */
64   return m_cocktail_flip ? input_port_read(machine(), "IN1") : input_port_read(machine(), "IN0");
64   return ioport(m_cocktail_flip ? "IN1" : "IN0")->read();
6565}
6666
6767
r15082r15083
194194   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
195195
196196   PORT_START("DSW1")      /* dip switches/VBLANK (0xe200) */
197   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
197   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
198198   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )      // related to vblank
199199   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
200200   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
src/mame/drivers/destroyr.c
r15082r15083
146146   state->m_potsense[1] = 0;
147147
148148   /* PCB supports two dials, but cab has only got one */
149   machine.scheduler().timer_set(machine.primary_screen->time_until_pos(input_port_read(machine, "PADDLE")), FUNC(destroyr_dial_callback));
149   machine.scheduler().timer_set(machine.primary_screen->time_until_pos(state->ioport("PADDLE")->read()), FUNC(destroyr_dial_callback));
150150   machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(destroyr_frame_callback));
151151}
152152
r15082r15083
237237
238238   if (offset & 1)
239239   {
240      return input_port_read(machine(), "IN1");
240      return ioport("IN1")->read();
241241   }
242242
243243   else
244244   {
245      UINT8 ret = input_port_read(machine(), "IN0");
245      UINT8 ret = ioport("IN0")->read();
246246
247247      if (m_potsense[0] && m_potmask[0])
248248         ret |= 4;
r15082r15083
297297   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
298298   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
299299   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
300   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
300   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
301301
302302   PORT_START("IN2")
303303   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:4,3")
src/mame/drivers/wwfwfest.c
r15082r15083
177177CUSTOM_INPUT_MEMBER(wwfwfest_state::dsw_3f_r)
178178{
179179   const char *tag = (const char *)param;
180   return input_port_read(machine(), tag) & 0x3f;
180   return ioport(tag)->read() & 0x3f;
181181}
182182
183183CUSTOM_INPUT_MEMBER(wwfwfest_state::dsw_c0_r)
184184{
185185   const char *tag = (const char *)param;
186   return (input_port_read(machine(), tag) & 0xc0) >> 6;
186   return (ioport(tag)->read() & 0xc0) >> 6;
187187}
188188
189189
r15082r15083
237237   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
238238   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START4 )
239239   PORT_BIT( 0x0300, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wwfwfest_state,dsw_c0_r, "DSW1")
240   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_VBLANK )
240   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
241241   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
242242   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
243243   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/feversoc.c
r15082r15083
138138{
139139
140140   m_x^=0x40; //vblank? eeprom read bit?
141   return (input_port_read(machine(), "IN0") | m_x) | (input_port_read(machine(), "IN1")<<16);
141   return (ioport("IN1")->read()<<16);
142142}
143143
144144WRITE32_MEMBER(feversoc_state::output_w)
src/mame/drivers/multigam.c
r15082r15083
263263   m_in_0_shift = 0;
264264   m_in_1_shift = 0;
265265
266   m_in_0 = input_port_read(machine(), "P1");
267   m_in_1 = input_port_read(machine(), "P2");
266   m_in_0 = ioport("P1")->read();
267   m_in_1 = ioport("P2")->read();
268268
269269   m_in_dsw_shift = 0;
270   m_in_dsw = input_port_read_safe(machine(), "DSW", 0);
270   m_in_dsw = ioport("DSW")->read_safe(0);
271271}
272272
273273READ8_MEMBER(multigam_state::multigam_IN1_r)
src/mame/drivers/sderby.c
r15082r15083
7777   switch (offset)
7878   {
7979      case 0x00 >> 1:
80         return input_port_read(machine(), "IN0");
80         return ioport("IN0")->read();
8181      case 0x02 >> 1:
8282         return 0xffff;         // to avoid game to reset (needs more work)
8383   }
r15082r15083
9292   switch (offset)
9393   {
9494      case 0x00 >> 1:
95         return input_port_read(machine(), "IN0");
95         return ioport("IN0")->read();
9696      case 0x02 >> 1:
97         return input_port_read(machine(), "IN1");
97         return ioport("IN1")->read();
9898      case 0x04 >> 1:
99         return input_port_read(machine(), "IN2");
99         return ioport("IN2")->read();
100100   }
101101
102102   return 0xffff;
r15082r15083
421421static INPUT_PORTS_START( pmroulet )
422422   PORT_START("IN0")
423423   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNKNOWN )
424   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK ) /* it must be toggled to boot anyway */
424   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* it must be toggled to boot anyway */
425425   PORT_SERVICE_NO_TOGGLE(0x0020, IP_ACTIVE_LOW)
426426   PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNKNOWN )
427427   PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/vcombat.c
r15082r15083
199199
200200READ16_MEMBER(vcombat_state::control_1_r)
201201{
202   return (input_port_read(machine(), "IN0") << 8);
202   return (ioport("IN0")->read() << 8);
203203}
204204
205205READ16_MEMBER(vcombat_state::control_2_r)
206206{
207   return (input_port_read(machine(), "IN1") << 8);
207   return (ioport("IN1")->read() << 8);
208208}
209209
210210READ16_MEMBER(vcombat_state::control_3_r)
211211{
212   return (input_port_read(machine(), "IN2") << 8);
212   return (ioport("IN2")->read() << 8);
213213}
214214
215215static void wiggle_i860_common(device_t *device, UINT16 data)
src/mame/drivers/shangha3.c
r15082r15083
207207   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2 )
208208   PORT_SERVICE_NO_TOGGLE(0x0020, IP_ACTIVE_LOW)
209209   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
210   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
210   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
211211
212212   PORT_START("DSW1")
213213   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
r15082r15083
268268   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
269269   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
270270   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
271   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )   /* vblank?? has to toggle */
271   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")   /* vblank?? has to toggle */
272272   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
273273   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
274274   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
r15082r15083
276276   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
277277   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
278278   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
279   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_VBLANK )   /* vblank?? has to toggle */
279   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")   /* vblank?? has to toggle */
280280
281281   PORT_START("SYSTEM")
282282   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
r15082r15083
347347   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
348348   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
349349   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
350   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )   /* vblank?? has to toggle */
350   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")   /* vblank?? has to toggle */
351351   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
352352   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
353353   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
r15082r15083
355355   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
356356   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
357357   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
358   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_VBLANK )   /* vblank?? has to toggle */
358   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")   /* vblank?? has to toggle */
359359
360360   PORT_START("SYSTEM")
361361   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
src/mame/drivers/39in1.c
r15082r15083
13771377   }
13781378   else if (cpu_get_pc(&space.device()) == 0xe3af4)
13791379   {
1380      return input_port_read(machine(), "MCUIPT");
1380      return ioport("MCUIPT")->read();
13811381   }
13821382   else
13831383   {
src/mame/drivers/gunpey.c
r15082r15083
120120{
121121   switch(offset+0x7f40)
122122   {
123      case 0x7f40: return input_port_read(machine(), "DSW1");
124      case 0x7f41: return input_port_read(machine(), "DSW2");
125      case 0x7f42: return input_port_read(machine(), "P1");
126      case 0x7f43: return input_port_read(machine(), "P2");
127      case 0x7f44: return input_port_read(machine(), "SYSTEM");
123      case 0x7f40: return ioport("DSW1")->read();
124      case 0x7f41: return ioport("DSW2")->read();
125      case 0x7f42: return ioport("P1")->read();
126      case 0x7f43: return ioport("P2")->read();
127      case 0x7f44: return ioport("SYSTEM")->read();
128128   }
129129
130130   return 0xff;
src/mame/drivers/guab.c
r15082r15083
579579      case 0x01:
580580      case 0x02:
581581      {
582         return input_port_read(machine(), portnames[offset]);
582         return ioport(portnames[offset])->read();
583583      }
584584      case 0x30:
585585      {
src/mame/drivers/baraduke.c
r15082r15083
129129   switch (m_inputport_selected)
130130   {
131131      case 0x00:   /* DSW A (bits 0-4) */
132         return (input_port_read(machine(), "DSWA") & 0xf8) >> 3;
132         return (ioport("DSWA")->read() & 0xf8) >> 3;
133133      case 0x01:   /* DSW A (bits 5-7), DSW B (bits 0-1) */
134         return ((input_port_read(machine(), "DSWA") & 0x07) << 2) | ((input_port_read(machine(), "DSWB") & 0xc0) >> 6);
134         return ((ioport("DSWA")->read() & 0x07) << 2) | ((ioport("DSWB")->read() & 0xc0) >> 6);
135135      case 0x02:   /* DSW B (bits 2-6) */
136         return (input_port_read(machine(), "DSWB") & 0x3e) >> 1;
136         return (ioport("DSWB")->read() & 0x3e) >> 1;
137137      case 0x03:   /* DSW B (bit 7), DSW C (bits 0-3) */
138         return ((input_port_read(machine(), "DSWB") & 0x01) << 4) | (input_port_read(machine(), "EDGE") & 0x0f);
138         return ((ioport("DSWB")->read() & 0x01) << 4) | (ioport("EDGE")->read() & 0x0f);
139139      case 0x04:   /* coins, start */
140         return input_port_read(machine(), "IN0");
140         return ioport("IN0")->read();
141141      case 0x05:   /* 2P controls */
142         return input_port_read(machine(), "IN2");
142         return ioport("IN2")->read();
143143      case 0x06:   /* 1P controls */
144         return input_port_read(machine(), "IN1");
144         return ioport("IN1")->read();
145145      default:
146146         return 0xff;
147147   }
src/mame/drivers/beaminv.c
r15082r15083
221221
222222READ8_MEMBER(beaminv_state::controller_r)
223223{
224   return input_port_read(machine(), (m_controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG);
224   return ioport((m_controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG)->read();
225225}
226226
227227
src/mame/drivers/mcr.c
r15082r15083
337337   /* game in cocktail mode, they don't work at all. So we fake-mux   */
338338   /* the controls through player 1's ports */
339339   if (mcr_cocktail_flip)
340      return input_port_read(machine(), "ssio:IP0") | 0x08;
340      return ioport("ssio:IP0")->read() | 0x08;
341341   else
342      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);
342      return ((ioport("ssio:IP2")->read() & 0x01) << 4);
343343}
344344
345345
r15082r15083
347347{
348348   /*  same deal as above */
349349   if (mcr_cocktail_flip)
350      return input_port_read(machine(), "ssio:IP1") | 0xf0;
350      return ioport("ssio:IP1")->read() | 0xf0;
351351   else
352      return (input_port_read(machine(), "ssio:IP1") >> 4) | 0xf0;
352      return (ioport("ssio:IP1")->read() >> 4) | 0xf0;
353353}
354354
355355
r15082r15083
362362
363363READ8_MEMBER(mcr_state::kick_ip1_r)
364364{
365   return (input_port_read(machine(), "DIAL2") << 4) & 0xf0;
365   return (ioport("DIAL2")->read() << 4) & 0xf0;
366366}
367367
368368
r15082r15083
382382READ8_MEMBER(mcr_state::wacko_ip1_r)
383383{
384384   if (!input_mux)
385      return input_port_read(machine(), "ssio:IP1");
385      return ioport("ssio:IP1")->read();
386386   else
387      return input_port_read(machine(), "ssio:IP1.ALT");
387      return ioport("ssio:IP1.ALT")->read();
388388}
389389
390390
391391READ8_MEMBER(mcr_state::wacko_ip2_r)
392392{
393393   if (!input_mux)
394      return input_port_read(machine(), "ssio:IP2");
394      return ioport("ssio:IP2")->read();
395395   else
396      return input_port_read(machine(), "ssio:IP2.ALT");
396      return ioport("ssio:IP2.ALT")->read();
397397}
398398
399399
r15082r15083
406406
407407READ8_MEMBER(mcr_state::kroozr_ip1_r)
408408{
409   int dial = input_port_read(machine(), "DIAL");
409   int dial = ioport("DIAL")->read();
410410   return ((dial & 0x80) >> 1) | ((dial & 0x70) >> 4);
411411}
412412
r15082r15083
629629
630630READ8_MEMBER(mcr_state::demoderb_ip1_r)
631631{
632   return input_port_read(machine(), "ssio:IP1") |
633      (input_port_read(machine(), input_mux ? "ssio:IP1.ALT2" : "ssio:IP1.ALT1") << 2);
632   return ioport("ssio:IP1")->read() |
633      (ioport(input_mux ? "ssio:IP1.ALT2" : "ssio:IP1.ALT1")->read() << 2);
634634}
635635
636636
637637READ8_MEMBER(mcr_state::demoderb_ip2_r)
638638{
639   return input_port_read(machine(), "ssio:IP2") |
640      (input_port_read(machine(), input_mux ? "ssio:IP2.ALT2" : "ssio:IP2.ALT1") << 2);
639   return ioport("ssio:IP2")->read() |
640      (ioport(input_mux ? "ssio:IP2.ALT2" : "ssio:IP2.ALT1")->read() << 2);
641641}
642642
643643
src/mame/drivers/matmania.c
r15082r15083
176176   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )      /* The default setting should be cocktail. */
177177   PORT_DIPSETTING(   0x20, DEF_STR( Cocktail ) )
178178   PORT_SERVICE_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW1:7" )
179   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )      /* Listed as always ON among DIPs in the manual */
179   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")      /* Listed as always ON among DIPs in the manual */
180180
181181   PORT_START("DSW2")
182182   PORT_DIPNAME(0x03, 0x02, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:1,2")
src/mame/drivers/mpu4vid.c
r15082r15083
11821182   LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine().describe_context()));
11831183
11841184
1185   UINT8 data = input_port_read(device->machine(), "AUX1");
1185   UINT8 data = state->ioport("AUX1")->read();
11861186
1187   INT8 dx = input_port_read(device->machine(), "TRACKX");
1188   INT8 dy = input_port_read(device->machine(), "TRACKY");
1187   INT8 dx = state->ioport("TRACKX")->read();
1188   INT8 dy = state->ioport("TRACKY")->read();
11891189
11901190   state->m_cur[0] = dy + dx;
11911191   state->m_cur[1] = dy - dx;
r15082r15083
14681468
14691469   PORT_START("ORANGE2")
14701470   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN5) PORT_NAME("20p Token")PORT_IMPULSE(5)
1471   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x04)
1472   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x05)
1473   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x06)
1474   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x07)
1475   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x08)
1476   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x09)
1471   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x04)
1472   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x05)
1473   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x06)
1474   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x07)
1475   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x08)
1476   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x09)
14771477   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
14781478   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
14791479   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
r15082r15083
14841484   PORT_START("BLACK1")
14851485   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Gamble")
14861486   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Pontoon")
1487   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x01)
1488   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x09)
1489   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x03)
1490   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x04)
1491   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x05)
1492   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x06)
1493   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x07)
1494   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x08)
1487   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x01)
1488   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x09)
1489   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x03)
1490   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x04)
1491   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x05)
1492   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x06)
1493   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x07)
1494   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x08)
14951495   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
14961496   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W)
14971497   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
14981498   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Rear Door")  PORT_CODE(KEYCODE_Q) PORT_TOGGLE
14991499
15001500   PORT_START("BLACK2")
1501   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x00)
1502   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x02)
1501   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x00)
1502   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x02)
15031503   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
15041504   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Twist")
15051505   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Lo")
r15082r15083
15741574   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL)
15751575   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL)
15761576   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL)
1577   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x00)
1578   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x01)
1579   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x02)
1580   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x03)
1577   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,EQUALS,0x00)
1578   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,EQUALS,0x01)
1579   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,EQUALS,0x02)
1580   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,EQUALS,0x03)
15811581   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5)
15821582   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5)
15831583   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5)
src/mame/drivers/bfm_swp.c
r15082r15083
1/* Bellfruit SWP (Skill With Prizes) Video hardware */
1/* Bellfruit SWP (Skill With Prizes) Video hardware
2    aka Cobra 3
23
3/*
4    This is 'Cobra 3' ?
5    is that an expansion board for Scorpion 4, or somehow related?
6    The CPU is the same (68340)
7
8    Radio Times is probably the only *COMPLETE* dump here, as it
9    includes the CD.  Other games probably have CDs or HDDs too.
10
11    Telly Addicts has a HDD dump (I'm assuming it's the same
12    platform) but no sound roms.
13
144*/
155
166/* Radio Times readme #1
r15082r15083
128118{
129119public:
130120   bfm_swp_state(const machine_config &mconfig, device_type type, const char *tag)
131      : driver_device(mconfig, type, tag) { }
121      : driver_device(mconfig, type, tag),
122        m_maincpu(*this, "maincpu")
123   { }
132124
125   UINT32* m_cpuregion;
126   UINT32* m_mainram;
127
128   DECLARE_READ32_MEMBER(bfm_swp_mem_r);
129   DECLARE_WRITE32_MEMBER(bfm_swp_mem_w);
130
131
133132   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
134133   {
135134      return 0;
136135   }
136
137protected:
138
139   // devices
140   required_device<cpu_device> m_maincpu;
141
137142};
138143
139144
140145
146
147READ32_MEMBER(bfm_swp_state::bfm_swp_mem_r)
148{
149   int pc = cpu_get_pc(&space.device());
150   int cs = m68340_get_cs(m_maincpu, offset * 4);
151
152   switch ( cs )
153   {
154      case 1:
155         if (offset<0x100000/4) return m_cpuregion[offset];
156
157      case 2:
158         offset&=0x3fff;
159         return m_mainram[offset];
160
161      default:
162         logerror("%08x maincpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs);
163
164   }
165
166   return 0x0000;
167}
168
169WRITE32_MEMBER(bfm_swp_state::bfm_swp_mem_w)
170{
171   int pc = cpu_get_pc(&space.device());
172   int cs = m68340_get_cs(m_maincpu, offset * 4);
173
174   switch ( cs )
175   {
176      default:
177         logerror("%08x maincpu write access offset %08x data %08x mem_mask %08x cs %d\n", pc, offset*4, data, mem_mask, cs);
178
179      case 2:
180         offset&=0x3fff;
181         COMBINE_DATA(&m_mainram[offset]);
182         break;
183
184
185   }
186
187}
188
189
190
191
141192static ADDRESS_MAP_START( bfm_swp_map, AS_PROGRAM, 32, bfm_swp_state )
142   AM_RANGE(0x000000, 0x0fffff) AM_ROM
143   AM_RANGE(0xb00000, 0xb03fff) AM_RAM
193   AM_RANGE(0x00000000, 0x000fffff) AM_ROM
194   AM_RANGE(0x00000000, 0xffffffff) AM_READWRITE(bfm_swp_mem_r, bfm_swp_mem_w)
144195ADDRESS_MAP_END
145196
146197
r15082r15083
148199INPUT_PORTS_END
149200
150201
202static MACHINE_START( bfm_swp )
203{
204   bfm_swp_state *state = machine.driver_data<bfm_swp_state>();
205   state->m_cpuregion = (UINT32*)state->memregion( "maincpu" )->base();
206   state->m_mainram = (UINT32*)auto_alloc_array_clear(machine, UINT32, 0x10000);
207
208}
209
210
151211static MACHINE_CONFIG_START( bfm_swp, bfm_swp_state )
152212
153213   /* basic machine hardware */
154   MCFG_CPU_ADD("maincpu", M68020,16000000) /* 68340 */
214   MCFG_CPU_ADD("maincpu", M68340, 16000000)
155215   MCFG_CPU_PROGRAM_MAP(bfm_swp_map)
156216
217   MCFG_MACHINE_START( bfm_swp )
218
157219   MCFG_SCREEN_ADD("screen", RASTER)
158220   MCFG_SCREEN_REFRESH_RATE(60)
159221   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
r15082r15083
232294   ROM_LOAD( "totpsnd.lhs", 0x000000, 0x080000, CRC(56a73136) SHA1(10656ede18de9432a8a728cc59d000b5b1bf0150) )
233295   ROM_LOAD( "totpsnd.rhs", 0x080000, 0x080000, CRC(28d156ab) SHA1(ebf5c4e008015b9b56b3aa5228c05b8e298daa80) )
234296
235   DISK_REGION( "scsi" ) // CD or HDD
236   DISK_IMAGE_READONLY( "cd or hdd", 0, NO_DUMP )
297   DISK_REGION( "scsi" ) // uses a CD, only one we've seen has been damaged to a point where not all data could be read tho
298   DISK_IMAGE_READONLY( "cd", 0, NO_DUMP )
237299ROM_END
238300
239301ROM_START( c3_ppays )
src/mame/drivers/clshroad.c
r15082r15083
3131
3232READ8_MEMBER(clshroad_state::clshroad_input_r)
3333{
34   return   ((~input_port_read(machine(), "P1") & (1 << offset)) ? 1 : 0) |
35         ((~input_port_read(machine(), "P2") & (1 << offset)) ? 2 : 0) |
36         ((~input_port_read(machine(), "DSW1") & (1 << offset)) ? 4 : 0) |
37         ((~input_port_read(machine(), "DSW2") & (1 << offset)) ? 8 : 0) ;
34   return   ((~ioport("P1")->read() & (1 << offset)) ? 1 : 0) |
35         ((~ioport("P2")->read() & (1 << offset)) ? 2 : 0) |
36         ((~ioport("DSW1")->read() & (1 << offset)) ? 4 : 0) |
37         ((~ioport("DSW2")->read() & (1 << offset)) ? 8 : 0) ;
3838}
3939
4040
src/mame/drivers/dcheese.c
r15082r15083
129129   /* bits $0080-$0010 are probably lamps */
130130   if (ACCESSING_BITS_0_7)
131131   {
132      input_port_write(machine(), "EEPROMOUT", data, 0xff);
132      ioport("EEPROMOUT")->write(data, 0xff);
133133      machine().device<ticket_dispenser_device>("ticket")->write(space, 0, (data & 1) << 7);
134134   }
135135}
src/mame/drivers/chqflag.c
r15082r15083
120120{
121121   switch (m_analog_ctrl & 0x03)
122122   {
123      case 0x00: return (m_accel = input_port_read(machine(), "IN3"));   /* accelerator */
124      case 0x01: return (m_wheel = input_port_read(machine(), "IN4"));   /* steering */
123      case 0x00: return (m_accel = ioport("IN3")->read());   /* accelerator */
124      case 0x01: return (m_wheel = ioport("IN4")->read());   /* steering */
125125      case 0x02: return m_accel;                  /* accelerator (previous?) */
126126      case 0x03: return m_wheel;                  /* steering (previous?) */
127127   }
src/mame/drivers/sengokmj.c
r15082r15083
8080{
8181   switch(m_sengokumj_mux_data)
8282   {
83      case 0x0100: return input_port_read(machine(), "KEY0");
84      case 0x0200: return input_port_read(machine(), "KEY1");
85      case 0x0400: return input_port_read(machine(), "KEY2");
86      case 0x0800: return input_port_read(machine(), "KEY3");
87      case 0x1000: return input_port_read(machine(), "KEY4");
88      case 0x2000: return input_port_read(machine(), "UNUSED");
83      case 0x0100: return ioport("KEY0")->read();
84      case 0x0200: return ioport("KEY1")->read();
85      case 0x0400: return ioport("KEY2")->read();
86      case 0x0800: return ioport("KEY3")->read();
87      case 0x1000: return ioport("KEY4")->read();
88      case 0x2000: return ioport("UNUSED")->read();
8989   }
9090
9191   return 0xffff;
r15082r15083
111111
112112READ16_MEMBER(sengokmj_state::sengokmj_system_r)
113113{
114   return (input_port_read(machine(), "SYSTEM") & 0xffbf) | m_hopper_io;
114   return (ioport("SYSTEM")->read() & 0xffbf) | m_hopper_io;
115115}
116116
117117static ADDRESS_MAP_START( sengokmj_map, AS_PROGRAM, 16, sengokmj_state )
src/mame/drivers/dooyong.c
r15082r15083
327327   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
328328   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
329329   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SWA:5,6")
330   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
331   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
332   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
333   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
334   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
335   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
336   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
337   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
330   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
331   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
332   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
333   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
334   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
335   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
336   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
337   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
338338   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SWA:7,8")
339   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
340   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
341   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
342   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
343   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
344   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
345   PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
346   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
339   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
340   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
341   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
342   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
343   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
344   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
345   PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
346   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
347347
348348   PORT_START("DSWB")
349349   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:1,2")
r15082r15083
413413   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
414414   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
415415   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SWA:5,6")
416   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
417   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
418   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
419   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
420   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
421   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
422   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
423   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
416   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
417   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
418   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
419   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
420   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )      PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
421   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )      PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
422   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
423   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
424424   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SWA:7,8")
425   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
426   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
427   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
428   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
429   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
430   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
431   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
432   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
425   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
426   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
427   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )      PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
428   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
429   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
430   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
431   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )      PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
432   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )      PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
433433   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:1,2")
434434   PORT_DIPSETTING(      0x0000, "1" )
435435   PORT_DIPSETTING(      0x0200, "2" )
r15082r15083
536536   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
537537   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
538538   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
539   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_VBLANK )   /* ??? */
539   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")   /* ??? */
540540   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
541541   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
542542   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
605605
606606   PORT_MODIFY("DSW")
607607   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SWA:7,8")
608   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
609   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
610   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
611   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
612   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
613   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
614   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
615   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
608   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
609   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
610   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
611   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
612   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
613   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
614   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
615   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
616616INPUT_PORTS_END
617617
618618static INPUT_PORTS_START( superx )
src/mame/drivers/cham24.c
r15082r15083
173173   m_in_0_shift = 0;
174174   m_in_1_shift = 0;
175175
176   m_in_0 = input_port_read(machine(), "P1");
177   m_in_1 = input_port_read(machine(), "P2");
176   m_in_0 = ioport("P1")->read();
177   m_in_1 = ioport("P2")->read();
178178
179179}
180180
r15082r15083
304304{
305305   cham24_state *state = machine.driver_data<cham24_state>();
306306   /* switch PRG rom */
307   UINT8* dst = machine.root_device().memregion("maincpu")->base();
308   UINT8* src = machine.root_device().memregion("user1")->base();
307   UINT8* dst = state->memregion("maincpu")->base();
308   UINT8* src = state->memregion("user1")->base();
309309
310310   memcpy(&dst[0x8000], &src[0x0f8000], 0x4000);
311311   memcpy(&dst[0xc000], &src[0x0f8000], 0x4000);
src/mame/drivers/brkthru.c
r15082r15083
181181   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
182182   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
183183   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
184   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )   /* used only by the self test */
184   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")   /* used only by the self test */
185185
186186   PORT_START("DSW1")
187187   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
src/mame/drivers/tourtabl.c
r15082r15083
4040{
4141   static const char *const tianames[] = { "PADDLE4", "PADDLE3", "PADDLE2", "PADDLE1", "TIA_IN4", "TIA_IN5" };
4242
43   return input_port_read(device->machine(), tianames[offset]);
43   return device->machine().root_device().ioport(tianames[offset])->read();
4444}
4545
4646static READ8_DEVICE_HANDLER( tourtabl_get_databus_contents )
src/mame/drivers/thepit.c
r15082r15083
536536   PORT_DIPSETTING(    0x20, "Number of Wrong Answer" )
537537   PORT_DIPSETTING(    0x00, "Number of Good Answer for Bonus Question" )
538538   PORT_DIPNAME( 0xc0, 0x40, "Gaming Option Number" )
539   PORT_DIPSETTING(    0x00, "2" ) PORT_CONDITION("DSW", 0x20, PORTCOND_EQUALS, 0x20)
540   PORT_DIPSETTING(    0x40, "3" ) PORT_CONDITION("DSW", 0x20, PORTCOND_EQUALS, 0x20)
541   PORT_DIPSETTING(    0x80, "4" ) PORT_CONDITION("DSW", 0x20, PORTCOND_EQUALS, 0x20)
542   PORT_DIPSETTING(    0xc0, "5" ) PORT_CONDITION("DSW", 0x20, PORTCOND_EQUALS, 0x20)
543   PORT_DIPSETTING(    0x00, "4" ) PORT_CONDITION("DSW", 0x20, PORTCOND_NOTEQUALS, 0x20)
544   PORT_DIPSETTING(    0x40, "5" ) PORT_CONDITION("DSW", 0x20, PORTCOND_NOTEQUALS, 0x20)
545   PORT_DIPSETTING(    0x80, "6" ) PORT_CONDITION("DSW", 0x20, PORTCOND_NOTEQUALS, 0x20)
546   PORT_DIPSETTING(    0xc0, "7" ) PORT_CONDITION("DSW", 0x20, PORTCOND_NOTEQUALS, 0x20)
539   PORT_DIPSETTING(    0x00, "2" ) PORT_CONDITION("DSW", 0x20, EQUALS, 0x20)
540   PORT_DIPSETTING(    0x40, "3" ) PORT_CONDITION("DSW", 0x20, EQUALS, 0x20)
541   PORT_DIPSETTING(    0x80, "4" ) PORT_CONDITION("DSW", 0x20, EQUALS, 0x20)
542   PORT_DIPSETTING(    0xc0, "5" ) PORT_CONDITION("DSW", 0x20, EQUALS, 0x20)
543   PORT_DIPSETTING(    0x00, "4" ) PORT_CONDITION("DSW", 0x20, NOTEQUALS, 0x20)
544   PORT_DIPSETTING(    0x40, "5" ) PORT_CONDITION("DSW", 0x20, NOTEQUALS, 0x20)
545   PORT_DIPSETTING(    0x80, "6" ) PORT_CONDITION("DSW", 0x20, NOTEQUALS, 0x20)
546   PORT_DIPSETTING(    0xc0, "7" ) PORT_CONDITION("DSW", 0x20, NOTEQUALS, 0x20)
547547
548548   /* Since the real inputs are multiplexed, we used this fake port
549549       to read the 2nd player controls when the screen is flipped */
src/mame/drivers/cloud9.c
r15082r15083
230230
231231READ8_MEMBER(cloud9_state::leta_r)
232232{
233   return input_port_read(machine(), offset ? "TRACKX" : "TRACKY");
233   return ioport(offset ? "TRACKX" : "TRACKY")->read();
234234}
235235
236236
src/mame/drivers/rpunch.c
r15082r15083
146146
147147CUSTOM_INPUT_MEMBER(rpunch_state::hi_bits_r)
148148{
149   return input_port_read(machine(), "SERVICE");
149   return ioport("SERVICE")->read();
150150}
151151
152152
src/mame/drivers/albazg.c
r15082r15083
154154   albazg_state *state = device->machine().driver_data<albazg_state>();
155155   switch(state->m_mux_data)
156156   {
157      case 0x00: return input_port_read(device->machine(), "IN0");
158      case 0x01: return input_port_read(device->machine(), "IN1");
159      case 0x02: return input_port_read(device->machine(), "IN2");
160      case 0x04: return input_port_read(device->machine(), "IN3");
161      case 0x08: return input_port_read(device->machine(), "IN4");
162      case 0x10: return input_port_read(device->machine(), "IN5");
163      case 0x20: return input_port_read(device->machine(), "IN6");
157      case 0x00: return state->ioport("IN0")->read();
158      case 0x01: return state->ioport("IN1")->read();
159      case 0x02: return state->ioport("IN2")->read();
160      case 0x04: return state->ioport("IN3")->read();
161      case 0x08: return state->ioport("IN4")->read();
162      case 0x10: return state->ioport("IN5")->read();
163      case 0x20: return state->ioport("IN6")->read();
164164   }
165165
166166   return 0xff;
r15082r15083
276276
277277   PORT_START("IN1")
278278   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
279   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
280   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
281   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
282   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
283   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
284   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
285   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
286   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
279   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
280   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
281   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
282   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
283   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
284   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
285   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
286   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
287287
288288   PORT_START("IN2")
289289   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
290   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
291   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
292   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
293   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
294   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
295   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
296   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
297   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
290   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
291   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
292   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
293   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
294   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
295   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
296   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
297   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
298298
299299   PORT_START("IN3")
300300   PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
301   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
302   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
303   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
304   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
301   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
302   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
303   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
304   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
305305
306306   /* Some bits of these three are actually used if you use the Royal Panel type */
307307   PORT_START("IN4")
r15082r15083
309309
310310   PORT_START("IN5")
311311   PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
312   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
313   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
314   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
315   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
312   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
313   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
314   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
315   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
316316
317317   PORT_START("IN6")
318318   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/changela.c
r15082r15083
5252
5353READ8_MEMBER(changela_state::changela_68705_port_b_r)
5454{
55   return (m_port_b_out & m_ddr_b) | (input_port_read(machine(), "MCU") & ~m_ddr_b);
55   return (m_port_b_out & m_ddr_b) | (ioport("MCU")->read() & ~m_ddr_b);
5656}
5757
5858WRITE8_MEMBER(changela_state::changela_68705_port_b_w)
r15082r15083
122122
123123READ8_MEMBER(changela_state::changela_30_r)
124124{
125   return input_port_read(machine(), "WHEEL") & 0x0f;   //wheel control (clocked input) signal on bits 3,2,1,0
125   return ioport("WHEEL")->read() & 0x0f;   //wheel control (clocked input) signal on bits 3,2,1,0
126126}
127127
128128READ8_MEMBER(changela_state::changela_31_r)
r15082r15083
130130   /* If the new value is less than the old value, and it did not wrap around,
131131       or if the new value is greater than the old value, and it did wrap around,
132132       then we are moving LEFT. */
133   UINT8 curr_value = input_port_read(machine(), "WHEEL");
133   UINT8 curr_value = ioport("WHEEL")->read();
134134
135135   if ((curr_value < m_prev_value_31 && (m_prev_value_31 - curr_value) < 0x80)
136136   ||  (curr_value > m_prev_value_31 && (curr_value - m_prev_value_31) > 0x80))
r15082r15083
147147
148148READ8_MEMBER(changela_state::changela_2c_r)
149149{
150   int val = input_port_read(machine(), "IN0");
150   int val = ioport("IN0")->read();
151151
152152   val = (val & 0x30) | ((val & 1) << 7) | (((val & 1) ^ 1) << 6);
153153
r15082r15083
164164      v8 = 1;
165165
166166   /* Gas pedal is made up of 2 switches, 1 active low, 1 active high */
167   switch (input_port_read(machine(), "IN1") & 0x03)
167   switch (ioport("IN1")->read() & 0x03)
168168   {
169169      case 0x02:
170170         gas = 0x80;
r15082r15083
177177         break;
178178   }
179179
180   return (input_port_read(machine(), "IN1") & 0x20) | gas | (v8 << 4);
180   return (ioport("IN1")->read() & 0x20) | gas | (v8 << 4);
181181}
182182
183183WRITE8_MEMBER(changela_state::mcu_pc_0_w)
src/mame/drivers/sstrangr.c
r15082r15083
186186   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
187187
188188   PORT_START("EXT")      /* External switches */
189   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
189   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
190190   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
191191INPUT_PORTS_END
192192
r15082r15083
253253   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
254254
255255   PORT_START("EXT")      /* External switches */
256   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
256   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
257257   PORT_DIPNAME( 0x02, 0x00, "Player's Bullet Speed (Cheat)" )
258258   PORT_DIPSETTING(    0x00, "Slow" )
259259   PORT_DIPSETTING(    0x02, "Fast" )
src/mame/drivers/backfire.c
r15082r15083
177177   /* some kind of screen indicator?  checked by backfirea set before it will boot */
178178   int backfire_screen = device->machine().rand() & 1;
179179   eeprom_device *eeprom = downcast<eeprom_device *>(device);
180   return ((eeprom->read_bit() << 24) | input_port_read(device->machine(), "IN0")
181         | ((input_port_read(device->machine(), "IN2") & 0xbf) << 16)
182         | ((input_port_read(device->machine(), "IN3") & 0x40) << 16)) ^ (backfire_screen << 26) ;
180   return ((eeprom->read_bit() << 24) | device->machine().root_device().ioport("IN0")->read()
181         | ((device->machine().root_device().ioport("IN2")->read() & 0xbf) << 16)
182         | ((device->machine().root_device().ioport("IN3")->read() & 0x40) << 16)) ^ (backfire_screen << 26) ;
183183}
184184
185185READ32_MEMBER(backfire_state::backfire_control2_r)
186186{
187187
188188//  logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space.device()), offset << 1, mem_mask);
189   return (m_eeprom->read_bit() << 24) | input_port_read(machine(), "IN1") | (input_port_read(machine(), "IN1") << 16);
189   return (m_eeprom->read_bit() << 24) | ioport("IN1")->read() | (ioport("IN1")->read() << 16);
190190}
191191
192192#ifdef UNUSED_FUNCTION
r15082r15083
194194{
195195
196196//  logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space.device()), offset << 1, mem_mask);
197   return (m_eeprom->read_bit() << 24) | input_port_read(machine(), "IN2") | (input_port_read(machine(), "IN2") << 16);
197   return (m_eeprom->read_bit() << 24) | ioport("IN2")->read() | (ioport("IN2")->read() << 16);
198198}
199199#endif
200200
r15082r15083
233233#ifdef UNUSED_FUNCTION
234234READ32_MEMBER(backfire_state::backfire_unknown_wheel_r)
235235{
236   return input_port_read(machine(), "PADDLE0");
236   return ioport("PADDLE0")->read();
237237}
238238
239239READ32_MEMBER(backfire_state::backfire_wheel1_r)
r15082r15083
339339   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
340340   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
341341   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
342   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
342   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
343343   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
344344   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
345345   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
354354
355355   PORT_START("IN3")
356356   PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED ) /* all other bits like low IN2 */
357   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_VBLANK )
357   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
358358   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
359359
360360   PORT_START("PADDLE0")
src/mame/drivers/cubeqst.c
r15082r15083
329329
330330READ16_MEMBER(cubeqst_state::io_r)
331331{
332   UINT16 port_data = input_port_read(machine(), "IO");
332   UINT16 port_data = ioport("IO")->read();
333333
334334   /*
335335         Certain bits depend on Q7 of the IO latch:
r15082r15083
350350/* Trackball ('CHOP') */
351351READ16_MEMBER(cubeqst_state::chop_r)
352352{
353   return (input_port_read(machine(), "TRACK_X") << 8) | input_port_read(machine(), "TRACK_Y");
353   return (ioport("TRACK_X")->read() << 8) | ioport("TRACK_Y")->read();
354354}
355355
356356
src/mame/drivers/exerion.c
r15082r15083
133133CUSTOM_INPUT_MEMBER(exerion_state::exerion_controls_r)
134134{
135135   static const char *const inname[2] = { "P1", "P2" };
136   return input_port_read(machine(), inname[m_cocktail_flip]) & 0x3f;
136   return ioport(inname[m_cocktail_flip])->read() & 0x3f;
137137}
138138
139139
r15082r15083
261261   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
262262
263263   PORT_START("DSW1")
264   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
264   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
265265   PORT_DIPNAME( 0x0e, 0x00, DEF_STR( Coinage ) )          /* see notes */
266266   PORT_DIPSETTING(    0x0e, DEF_STR( 5C_1C ) )
267267   PORT_DIPSETTING(    0x0a, DEF_STR( 4C_1C ) )
src/mame/drivers/segas18.c
r15082r15083
252252            return state->m_misc_io_data[offset];
253253
254254         /* otherwise, return an input port */
255         return input_port_read(space->machine(), portnames[offset]);
255         return space->machine().root_device().ioport(portnames[offset])->read();
256256
257257      /* 'SEGA' protection */
258258      case 0x10/2:
r15082r15083
359359
360360      /* video control latch */
361361      case 0x2000/2:
362         return input_port_read(space->machine(), portnames[offset & 1]);
362         return space->machine().root_device().ioport(portnames[offset & 1])->read();
363363   }
364364   if (state->m_custom_io_r)
365365      return state->m_custom_io_r(space, offset, mem_mask);
r15082r15083
450450   switch (offset)
451451   {
452452      case 0x3020/2:
453         return input_port_read(space->machine(), "P3");
453         return space->machine().root_device().ioport("P3")->read();
454454
455455      case 0x3022/2:
456         return input_port_read(space->machine(), "P4");
456         return space->machine().root_device().ioport("P4")->read();
457457
458458      case 0x3024/2:
459         return input_port_read(space->machine(), "P34START");
459         return space->machine().root_device().ioport("P34START")->read();
460460   }
461461   return segaic16_open_bus_r(space, 0, mem_mask);
462462}
r15082r15083
494494   switch (offset)
495495   {
496496      case 0x3010/2:
497         state->m_lghost_value = 255 - input_port_read(space->machine(), "GUNY1");
497         state->m_lghost_value = 255 - state->ioport("GUNY1")->read();
498498         break;
499499
500500      case 0x3012/2:
501         state->m_lghost_value = input_port_read(space->machine(), "GUNX1");
501         state->m_lghost_value = state->ioport("GUNX1")->read();
502502         break;
503503
504504      case 0x3014/2:
505         state->m_lghost_value = 255 - input_port_read(space->machine(), state->m_lghost_select ? "GUNY3" : "GUNY2");
505         state->m_lghost_value = 255 - state->ioport(state->m_lghost_select ? "GUNY3" : "GUNY2")->read();
506506         break;
507507
508508      case 0x3016/2:
509         state->m_lghost_value = input_port_read(space->machine(), state->m_lghost_select ? "GUNX3" : "GUNX2");
509         state->m_lghost_value = state->ioport(state->m_lghost_select ? "GUNX3" : "GUNX2")->read();
510510         break;
511511
512512      case 0x3020/2:
r15082r15083
530530   switch (offset)
531531   {
532532      case 0x3000/2:
533         return (input_port_read(space->machine(), "TRACKX1") - state->m_wwally_last_x[0]) & 0xff;
533         return (state->ioport("TRACKX1")->read() - state->m_wwally_last_x[0]) & 0xff;
534534
535535      case 0x3004/2:
536         return (input_port_read(space->machine(), "TRACKY1") - state->m_wwally_last_y[0]) & 0xff;
536         return (state->ioport("TRACKY1")->read() - state->m_wwally_last_y[0]) & 0xff;
537537
538538      case 0x3008/2:
539         return (input_port_read(space->machine(), "TRACKX2") - state->m_wwally_last_x[1]) & 0xff;
539         return (state->ioport("TRACKX2")->read() - state->m_wwally_last_x[1]) & 0xff;
540540
541541      case 0x300c/2:
542         return (input_port_read(space->machine(), "TRACKY2") - state->m_wwally_last_y[1]) & 0xff;
542         return (state->ioport("TRACKY2")->read() - state->m_wwally_last_y[1]) & 0xff;
543543
544544      case 0x3010/2:
545         return (input_port_read(space->machine(), "TRACKX3") - state->m_wwally_last_x[2]) & 0xff;
545         return (state->ioport("TRACKX3")->read() - state->m_wwally_last_x[2]) & 0xff;
546546
547547      case 0x3014/2:
548         return (input_port_read(space->machine(), "TRACKY3") - state->m_wwally_last_y[2]) & 0xff;
548         return (state->ioport("TRACKY3")->read() - state->m_wwally_last_y[2]) & 0xff;
549549   }
550550   return segaic16_open_bus_r(space, 0, mem_mask);
551551}
r15082r15083
559559   {
560560      case 0x3000/2:
561561      case 0x3004/2:
562         state->m_wwally_last_x[0] = input_port_read(space->machine(), "TRACKX1");
563         state->m_wwally_last_y[0] = input_port_read(space->machine(), "TRACKY1");
562         state->m_wwally_last_x[0] = state->ioport("TRACKX1")->read();
563         state->m_wwally_last_y[0] = state->ioport("TRACKY1")->read();
564564         break;
565565
566566      case 0x3008/2:
567567      case 0x300c/2:
568         state->m_wwally_last_x[1] = input_port_read(space->machine(), "TRACKX2");
569         state->m_wwally_last_y[1] = input_port_read(space->machine(), "TRACKY2");
568         state->m_wwally_last_x[1] = state->ioport("TRACKX2")->read();
569         state->m_wwally_last_y[1] = state->ioport("TRACKY2")->read();
570570         break;
571571
572572      case 0x3010/2:
573573      case 0x3014/2:
574         state->m_wwally_last_x[2] = input_port_read(space->machine(), "TRACKX3");
575         state->m_wwally_last_y[2] = input_port_read(space->machine(), "TRACKY3");
574         state->m_wwally_last_x[2] = state->ioport("TRACKX3")->read();
575         state->m_wwally_last_y[2] = state->ioport("TRACKY3")->read();
576576         break;
577577   }
578578}
src/mame/drivers/astrocorp.c
r15082r15083
177177{
178178   if (ACCESSING_BITS_0_7)
179179   {
180      input_port_write(machine(), "EEPROMOUT", data, 0xff);
180      ioport("EEPROMOUT")->write(data, 0xff);
181181   }
182182}
183183
src/mame/drivers/meijinsn.c
r15082r15083
112112   switch (offset)
113113   {
114114      case 0: /* Dipswitch 2 */
115         m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "DSW");
115         m_shared_ram[0] = (source & 0xff00) | ioport("DSW")->read();
116116         return 0;
117117
118118      case 0x22: /* Coin value */
r15082r15083
123123
124124         m_credits = 0;
125125
126         if ((input_port_read(machine(), "COINS") & 0x3) == 3)
126         if ((ioport("COINS")->read() & 0x3) == 3)
127127            m_mcu_latch = 0;
128128
129         if ((input_port_read(machine(), "COINS") & 0x1) == 0 && !m_mcu_latch)
129         if ((ioport("COINS")->read() & 0x1) == 0 && !m_mcu_latch)
130130         {
131131            m_shared_ram[0x29] = (source & 0xff00) | 0x22;   // coinA
132132            m_shared_ram[0x22] = (source & 0xff00) | 0x00;
133133            m_mcu_latch = 1;
134134
135            m_coinvalue = (~input_port_read(machine(), "DSW")>>3) & 1;
135            m_coinvalue = (~ioport("DSW")->read()>>3) & 1;
136136
137137            m_deposits1++;
138138            if (m_deposits1 == coinage1[m_coinvalue][0])
r15082r15083
143143            else
144144               m_credits = 0;
145145         }
146         else if ((input_port_read(machine(), "COINS") & 0x2) == 0 && !m_mcu_latch)
146         else if ((ioport("COINS")->read() & 0x2) == 0 && !m_mcu_latch)
147147         {
148148            m_shared_ram[0x29] = (source & 0xff00) | 0x22;   // coinA
149149            m_shared_ram[0x22] = (source & 0xff00) | 0x00;
150150            m_mcu_latch = 1;
151151
152            m_coinvalue = (~input_port_read(machine(), "DSW") >> 3) & 1;
152            m_coinvalue = (~ioport("DSW")->read() >> 3) & 1;
153153
154154            m_deposits2++;
155155            if (m_deposits2 == coinage2[m_coinvalue][0])
src/mame/drivers/blitz.c
r15082r15083
422422   blitz_state *state = device->machine().driver_data<blitz_state>();
423423   switch( state->m_mux_data & 0xf0 )      /* bits 4-7 */
424424   {
425      case 0x10: return input_port_read(device->machine(), "IN0-0");
426      case 0x20: return input_port_read(device->machine(), "IN0-1");
427      case 0x40: return input_port_read(device->machine(), "IN0-2");
428      case 0x80: return input_port_read(device->machine(), "IN0-3");
425      case 0x10: return state->ioport("IN0-0")->read();
426      case 0x20: return state->ioport("IN0-1")->read();
427      case 0x40: return state->ioport("IN0-2")->read();
428      case 0x80: return state->ioport("IN0-3")->read();
429429   }
430430   return 0xff;
431431}
src/mame/drivers/nitedrvr.c
r15082r15083
7878   PORT_DIPNAME( 0x20, 0x20, "Bonus Time" )
7979   PORT_DIPSETTING(   0x00, DEF_STR ( No ) )
8080   PORT_DIPSETTING(   0x20, "Score = 350" )
81   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
81   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
8282   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
8383
8484   PORT_START("GEARS")   // fake
src/mame/drivers/rainbow.c
r15082r15083
435435   PORT_START("DSWA")
436436   TAITO_MACHINE_COCKTAIL
437437   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
438   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
439   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
440   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
441   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
442   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
443   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
444   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
445   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
438   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
439   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
440   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
441   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
442   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
443   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
444   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
445   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
446446   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
447   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
448   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
449   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
450   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
451   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
452   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
453   PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
454   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
447   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
448   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
449   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
450   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
451   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
452   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
453   PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
454   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
455455
456456   PORT_START("DSWB")
457457   TAITO_DIFFICULTY
src/mame/drivers/tunhunt.c
r15082r15083
8888
8989READ8_MEMBER(tunhunt_state::tunhunt_button_r)
9090{
91   int data = input_port_read(machine(), "IN0");
91   int data = ioport("IN0")->read();
9292   return ((data>>offset)&1)?0x00:0x80;
9393}
9494
9595
9696static READ8_DEVICE_HANDLER( dsw2_0r )
9797{
98   return (input_port_read(device->machine(), "DSW")&0x0100)?0x80:0x00;
98   return (device->machine().root_device().ioport("DSW")->read()&0x0100)?0x80:0x00;
9999}
100100
101101
102102static READ8_DEVICE_HANDLER( dsw2_1r )
103103{
104   return (input_port_read(device->machine(), "DSW")&0x0200)?0x80:0x00;
104   return (device->machine().root_device().ioport("DSW")->read()&0x0200)?0x80:0x00;
105105}
106106
107107
108108static READ8_DEVICE_HANDLER( dsw2_2r )
109109{
110   return (input_port_read(device->machine(), "DSW")&0x0400)?0x80:0x00;
110   return (device->machine().root_device().ioport("DSW")->read()&0x0400)?0x80:0x00;
111111}
112112
113113
114114static READ8_DEVICE_HANDLER( dsw2_3r )
115115{
116   return (input_port_read(device->machine(), "DSW")&0x0800)?0x80:0x00;
116   return (device->machine().root_device().ioport("DSW")->read()&0x0800)?0x80:0x00;
117117}
118118
119119
120120static READ8_DEVICE_HANDLER( dsw2_4r )
121121{
122   return (input_port_read(device->machine(), "DSW")&0x1000)?0x80:0x00;
122   return (device->machine().root_device().ioport("DSW")->read()&0x1000)?0x80:0x00;
123123}
124124
125125
r15082r15083
171171   PORT_BIT ( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
172172   PORT_BIT ( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
173173   PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_START1 )
174   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
174   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
175175
176176   PORT_START("IN1")
177177   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
src/mame/drivers/tryout.c
r15082r15083
140140   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, tryout_state,coin_inserted, 0)
141141   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
142142   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
143   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
143   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
144144INPUT_PORTS_END
145145
146146static const gfx_layout charlayout =
src/mame/drivers/rungun.c
r15082r15083
7272   switch (offset)
7373   {
7474      case 0x00/2:
75         if (input_port_read(machine(), "DSW") & 0x20)
76            return (input_port_read(machine(), "P1") | input_port_read(machine(), "P3") << 8);
75         if (ioport("DSW")->read() & 0x20)
76            return (ioport("P1")->read() | ioport("P3")->read() << 8);
7777         else
7878         {
79            data = input_port_read(machine(), "P1") & input_port_read(machine(), "P3");
79            data = ioport("P1")->read() & ioport("P3")->read();
8080            return (data << 8 | data);
8181         }
8282
8383      case 0x02/2:
84         if (input_port_read(machine(), "DSW") & 0x20)
85            return (input_port_read(machine(), "P2") | input_port_read(machine(), "P4") << 8);
84         if (ioport("DSW")->read() & 0x20)
85            return (ioport("P2")->read() | ioport("P4")->read() << 8);
8686         else
8787         {
88            data = input_port_read(machine(), "P2") & input_port_read(machine(), "P4");
88            data = ioport("P2")->read() & ioport("P4")->read();
8989            return (data << 8 | data);
9090         }
9191
r15082r15083
9595                bit8 : freeze
9696                bit9 : joysticks layout(auto detect???)
9797            */
98         return input_port_read(machine(), "SYSTEM");
98         return ioport("SYSTEM")->read();
9999
100100      case 0x06/2:
101101         if (ACCESSING_BITS_0_7)
102102         {
103            data = input_port_read(machine(), "DSW");
103            data = ioport("DSW")->read();
104104         }
105105         return ((m_sysreg[0x06 / 2] & 0xff00) | data);
106106   }
r15082r15083
125125                bit10 : IRQ5 ACK
126126            */
127127         if (ACCESSING_BITS_0_7)
128            input_port_write(machine(), "EEPROMOUT", data, 0xff);
128            ioport("EEPROMOUT")->write(data, 0xff);
129129
130130         if (!(data & 0x40))
131131            device_set_input_line(m_maincpu, M68K_IRQ_5, CLEAR_LINE);
src/mame/drivers/sfbonus.c
r15082r15083
57335733
57345734   // dummy.rom helper
57355735   {
5736      UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
5737      int length = machine.root_device().memregion("maincpu")->bytes();
5736      UINT8 *ROM = state->memregion("maincpu")->base();
5737      int length = state->memregion("maincpu")->bytes();
57385738      UINT8* ROM2 = state->memregion("user1")->base();
57395739
57405740      if (ROM2)
src/mame/drivers/tempest.c
r15082r15083
334334
335335CUSTOM_INPUT_MEMBER(tempest_state::tempest_knob_r)
336336{
337   return input_port_read(machine(), (m_player_select == 0) ?
338                              TEMPEST_KNOB_P1_TAG : TEMPEST_KNOB_P2_TAG);
337   return ioport((m_player_select == 0) ? TEMPEST_KNOB_P1_TAG : TEMPEST_KNOB_P2_TAG)->read();
339338}
340339
341340CUSTOM_INPUT_MEMBER(tempest_state::tempest_buttons_r)
342341{
343   return input_port_read(machine(), (m_player_select == 0) ?
344                              TEMPEST_BUTTONS_P1_TAG : TEMPEST_BUTTONS_P2_TAG);
342   return ioport((m_player_select == 0) ? TEMPEST_BUTTONS_P1_TAG : TEMPEST_BUTTONS_P2_TAG)->read();
345343}
346344
347345
r15082r15083
354352
355353static READ8_DEVICE_HANDLER( input_port_1_bit_r )
356354{
357   return (input_port_read(device->machine(), "IN1/DSW0") & (1 << offset)) ? 0 : 228;
355   return (device->machine().root_device().ioport("IN1/DSW0")->read() & (1 << offset)) ? 0 : 228;
358356}
359357
360358
361359static READ8_DEVICE_HANDLER( input_port_2_bit_r )
362360{
363   return (input_port_read(device->machine(), "IN2") & (1 << offset)) ? 0 : 228;
361   return (device->machine().root_device().ioport("IN2")->read() & (1 << offset)) ? 0 : 228;
364362}
365363
366364
src/mame/drivers/crystal.c
r15082r15083
233233{
234234
235235   if (offset == 0)
236      return input_port_read(machine(), "P1_P2");
236      return ioport("P1_P2")->read();
237237   else if (offset == 1)
238      return input_port_read(machine(), "P3_P4");
238      return ioport("P3_P4")->read();
239239   else if( offset == 2)
240240   {
241      UINT8 Port4 = input_port_read(machine(), "SYSTEM");
241      UINT8 Port4 = ioport("SYSTEM")->read();
242242      if (!(Port4 & 0x10) && ((m_OldPort4 ^ Port4) & 0x10))   //coin buttons trigger IRQs
243243         IntReq(machine(), 12);
244244      if (!(Port4 & 0x20) && ((m_OldPort4 ^ Port4) & 0x20))
245245         IntReq(machine(), 19);
246246      m_OldPort4 = Port4;
247      return /*dips*/input_port_read(machine(), "DSW") | (Port4 << 16);
247      return /*dips*/ioport("DSW")->read() | (Port4 << 16);
248248   }
249249   return 0;
250250}
r15082r15083
565565   crystal_state *state = machine.driver_data<crystal_state>();
566566
567567   if (state->m_Bank <= 2)
568      state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base() + state->m_Bank * 0x1000000);
568      state->membank("bank1")->set_base(state->memregion("user1")->base() + state->m_Bank * 0x1000000);
569569   else
570570      state->membank("bank1")->set_base(state->memregion("user2")->base());
571571}
src/mame/drivers/eprom.c
r15082r15083
7676
7777READ16_MEMBER(eprom_state::special_port1_r)
7878{
79   int result = input_port_read(machine(), "260010");
79   int result = ioport("260010")->read();
8080
8181   if (m_sound_to_cpu_ready) result ^= 0x0004;
8282   if (m_cpu_to_sound_ready) result ^= 0x0008;
r15082r15083
8989READ16_MEMBER(eprom_state::adc_r)
9090{
9191   static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
92   int result = input_port_read(machine(), adcnames[m_last_offset & 3]);
92   int result = ioport(adcnames[m_last_offset & 3])->read();
9393
9494   m_last_offset = offset;
9595   return result;
r15082r15083
245245   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
246246
247247   PORT_START("260010")
248   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
248   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
249249   PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
250250   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )   /* Input buffer full (@260030) */
251251   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
r15082r15083
290290   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
291291
292292   PORT_START("260010")
293   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
293   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
294294   PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
295295   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )   /* Input buffer full (@260030) */
296296   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
r15082r15083
319319   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
320320
321321   PORT_START("260010")      /* 260010 */
322   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
322   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
323323   PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
324324   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )   /* Input buffer full (@260030) */
325325   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
src/mame/drivers/madmotor.c
r15082r15083
151151   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
152152   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
153153   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
154   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
154   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
155155   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
156156   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
157157   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/chinsan.c
r15082r15083
173173      /* i doubt these are both really the same.. */
174174      case 0x40:
175175      case 0x4f:
176         return input_port_read(machine(), "MAHJONG_P2_1");
176         return ioport("MAHJONG_P2_1")->read();
177177
178178      case 0x53:
179         return input_port_read(machine(), "MAHJONG_P2_2");
179         return ioport("MAHJONG_P2_2")->read();
180180
181181      case 0x57:
182         return input_port_read(machine(), "MAHJONG_P2_3");
182         return ioport("MAHJONG_P2_3")->read();
183183
184184      case 0x5b:
185         return input_port_read(machine(), "MAHJONG_P2_4");
185         return ioport("MAHJONG_P2_4")->read();
186186
187187      case 0x5d:
188         return input_port_read(machine(), "MAHJONG_P2_5");
188         return ioport("MAHJONG_P2_5")->read();
189189
190190      case 0x5e:
191         return input_port_read(machine(), "MAHJONG_P2_6");
191         return ioport("MAHJONG_P2_6")->read();
192192   }
193193
194194   printf("chinsan_input_port_0_r unk_r %02x\n", m_port_select);
r15082r15083
203203      /* i doubt these are both really the same.. */
204204      case 0x40:
205205      case 0x4f:
206         return input_port_read(machine(), "MAHJONG_P1_1");
206         return ioport("MAHJONG_P1_1")->read();
207207
208208      case 0x53:
209         return input_port_read(machine(), "MAHJONG_P1_2");
209         return ioport("MAHJONG_P1_2")->read();
210210
211211      case 0x57:
212         return input_port_read(machine(), "MAHJONG_P1_3");
212         return ioport("MAHJONG_P1_3")->read();
213213
214214      case 0x5b:
215         return input_port_read(machine(), "MAHJONG_P1_4");
215         return ioport("MAHJONG_P1_4")->read();
216216
217217      case 0x5d:
218         return input_port_read(machine(), "MAHJONG_P1_5");
218         return ioport("MAHJONG_P1_5")->read();
219219
220220      case 0x5e:
221         return input_port_read(machine(), "MAHJONG_P1_6");
221         return ioport("MAHJONG_P1_6")->read();
222222   }
223223
224224   printf("chinsan_input_port_1_r unk_r %02x\n", m_port_select);
src/mame/drivers/famibox.c
r15082r15083
207207   m_in_0_shift = 0;
208208   m_in_1_shift = 0;
209209
210   m_in_0 = input_port_read(machine(), "P1");
211   m_in_1 = input_port_read(machine(), "P2");
210   m_in_0 = ioport("P1")->read();
211   m_in_1 = ioport("P2")->read();
212212}
213213
214214READ8_MEMBER(famibox_state::famibox_IN1_r)
r15082r15083
312312            return ret;
313313         }
314314      case 2:
315         return input_port_read(machine(), "DSW");
315         return ioport("DSW")->read();
316316      case 3:
317         return input_port_read(machine(), "KEYSWITCH");
317         return ioport("KEYSWITCH")->read();
318318      case 7:
319319         return 0x02;
320320      default:
src/mame/drivers/cshooter.c
r15082r15083
226226   /* Even reads must return 0xff - Odd reads must return the contents of input port 5.
227227       Code at 0x5061 is executed once during P.O.S.T. where there is one read.
228228       Code at 0x50b4 is then executed each frame (not sure) where there are 2 reads. */
229   return ( (m_counter++ & 1) ? 0xff : input_port_read(machine(), "COIN") );
229   return ( (m_counter++ & 1) ? 0xff : ioport("COIN")->read() );
230230}
231231
232232WRITE8_MEMBER(cshooter_state::cshooter_c500_w)
src/mame/drivers/ultrsprt.c
r15082r15083
7878   UINT32 r = 0;
7979
8080   if (ACCESSING_BITS_24_31)
81      r |= input_port_read(machine(), "SERVICE");
81      r |= ioport("SERVICE")->read();
8282
8383   return r;
8484}
r15082r15083
8686WRITE32_MEMBER(ultrsprt_state::eeprom_w)
8787{
8888   if (ACCESSING_BITS_24_31)
89      input_port_write(machine(), "EEPROMOUT", data, 0xffffffff);
89      ioport("EEPROMOUT")->write(data, 0xffffffff);
9090}
9191
9292CUSTOM_INPUT_MEMBER(ultrsprt_state::analog_ctrl_r)
9393{
9494   const char *tag = (const char *)param;
95   return input_port_read(machine(), tag) & 0xfff;
95   return ioport(tag)->read() & 0xfff;
9696}
9797
9898WRITE32_MEMBER(ultrsprt_state::int_ack_w)
src/mame/drivers/hitme.c
r15082r15083
7272{
7373   hitme_state *state = screen.machine().driver_data<hitme_state>();
7474   /* the card width resistor comes from an input port, scaled to the range 0-25 kOhms */
75   double width_resist = input_port_read(screen.machine(), "WIDTH") * 25000 / 100;
75   double width_resist = screen.machine().root_device().ioport("WIDTH")->read() * 25000 / 100;
7676   /* this triggers a oneshot for the following length of time */
7777   double width_duration = 0.45 * 1000e-12 * width_resist;
7878   /* the dot clock runs at the standard horizontal frequency * 320+16 clocks per scanline */
r15082r15083
136136   hitme_state *state = machine.driver_data<hitme_state>();
137137   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
138138
139   UINT8 val = input_port_read(machine, portnames[port]);
139   UINT8 val = machine.root_device().ioport(portnames[port])->read();
140140   if (machine.time() > state->m_timeout_time)
141141      val ^= 0x80;
142142   return val;
r15082r15083
192192        system's equivalent computation, or else we will hang notes.
193193    */
194194   hitme_state *state = device->machine().driver_data<hitme_state>();
195   UINT8 raw_game_speed = input_port_read(device->machine(), "R3");
195   UINT8 raw_game_speed = state->ioport("R3")->read();
196196   double resistance = raw_game_speed * 25000 / 100;
197197   attotime duration = attotime(0, ATTOSECONDS_PER_SECOND * 0.45 * 6.8e-6 * resistance * (data + 1));
198198   state->m_timeout_time = device->machine().time() + duration;
src/mame/drivers/senjyo.c
r15082r15083
667667
668668ROM_START( starforc )
669669   ROM_REGION( 0x10000, "maincpu", 0 )
670   ROM_LOAD( "starforc.3",   0x0000, 0x4000, CRC(8ba27691) SHA1(2b8b1e634ef5bed5c61a078e64a6dda77f84cdf5) )
671   ROM_LOAD( "starforc.2",   0x4000, 0x4000, CRC(0fc4d2d6) SHA1(0743e3928d5cc0e3f1bcdaf4b0cc83aeb7a2f7a8) )
670   ROM_LOAD( "3.3p",    0x0000, 0x4000, CRC(8ba27691) SHA1(2b8b1e634ef5bed5c61a078e64a6dda77f84cdf5) )
671   ROM_LOAD( "2.3mn",   0x4000, 0x4000, CRC(0fc4d2d6) SHA1(0743e3928d5cc0e3f1bcdaf4b0cc83aeb7a2f7a8) )
672672
673673   ROM_REGION( 0x10000, "sub", 0 )     /* 64k for sound board */
674   ROM_LOAD( "starforc.1",   0x0000, 0x2000, CRC(2735bb22) SHA1(1bd0558e05b41aebab3911991969512df904fea5) )
674   ROM_LOAD( "1.3hj",   0x0000, 0x2000, CRC(2735bb22) SHA1(1bd0558e05b41aebab3911991969512df904fea5) )
675675
676676   ROM_REGION( 0x03000, "gfx1", 0 )
677   ROM_LOAD( "starforc.7",   0x00000, 0x1000, CRC(f4803339) SHA1(a119d68c2dd1c0e191231ce77353b31f30f7aa76) )   /* fg */
678   ROM_LOAD( "starforc.8",   0x01000, 0x1000, CRC(96979684) SHA1(bb4f7d3afc8dfaa723dfb5374996cc4bfd76fa3c) )
679   ROM_LOAD( "starforc.9",   0x02000, 0x1000, CRC(eead1d5c) SHA1(7c9165ed227c5228122b494a265cbfd6e843ba61) )
677   ROM_LOAD( "7.2fh",   0x00000, 0x1000, CRC(f4803339) SHA1(a119d68c2dd1c0e191231ce77353b31f30f7aa76) )   /* fg */
678   ROM_LOAD( "8.3fh",   0x01000, 0x1000, CRC(96979684) SHA1(bb4f7d3afc8dfaa723dfb5374996cc4bfd76fa3c) )
679   ROM_LOAD( "9.3fh",   0x02000, 0x1000, CRC(eead1d5c) SHA1(7c9165ed227c5228122b494a265cbfd6e843ba61) )
680680
681681   ROM_REGION( 0x06000, "gfx2", 0 )
682   ROM_LOAD( "starforc.15",  0x00000, 0x2000, CRC(c3bda12f) SHA1(3748ea8e34222a31a365a02ec77430f268b0b397) )   /* bg1 */
683   ROM_LOAD( "starforc.14",  0x02000, 0x2000, CRC(9e9384fe) SHA1(3aaa9cc64ef3775325f64733da4f6c328abf6514) )
684   ROM_LOAD( "starforc.13",  0x04000, 0x2000, CRC(84603285) SHA1(f4d6dfa3968fbd8ebf1a6451d5ea1821d65d9b49) )
682   ROM_LOAD( "15.10jk", 0x00000, 0x2000, CRC(c3bda12f) SHA1(3748ea8e34222a31a365a02ec77430f268b0b397) )   /* bg1 */
683   ROM_LOAD( "14.9jk",  0x02000, 0x2000, CRC(9e9384fe) SHA1(3aaa9cc64ef3775325f64733da4f6c328abf6514) )
684   ROM_LOAD( "13.8jk",  0x04000, 0x2000, CRC(84603285) SHA1(f4d6dfa3968fbd8ebf1a6451d5ea1821d65d9b49) )
685685
686686   ROM_REGION( 0x06000, "gfx3", 0 )
687   ROM_LOAD( "starforc.12",  0x00000, 0x2000, CRC(fdd9e38b) SHA1(3766835d9e9fc7e5dd99521e7303562029b78a65) )   /* bg2 */
688   ROM_LOAD( "starforc.11",  0x02000, 0x2000, CRC(668aea14) SHA1(62eb0df48f2f0c5778bb230cc3bf0b8eb3b4e3f8) )
689   ROM_LOAD( "starforc.10",  0x04000, 0x2000, CRC(c62a19c1) SHA1(9ce0e29630d3c8cba4db4cff333b250481348968) )
687   ROM_LOAD( "12.10de", 0x00000, 0x2000, CRC(fdd9e38b) SHA1(3766835d9e9fc7e5dd99521e7303562029b78a65) )   /* bg2 */
688   ROM_LOAD( "11.9de",  0x02000, 0x2000, CRC(668aea14) SHA1(62eb0df48f2f0c5778bb230cc3bf0b8eb3b4e3f8) )
689   ROM_LOAD( "10.8de",  0x04000, 0x2000, CRC(c62a19c1) SHA1(9ce0e29630d3c8cba4db4cff333b250481348968) )
690690
691691   ROM_REGION( 0x03000, "gfx4", 0 )
692   ROM_LOAD( "starforc.18",  0x00000, 0x1000, CRC(6455c3ad) SHA1(b163ccd3dc26ccfa8be1d16d52e17bc660ff84e3) )   /* bg3 */
693   ROM_LOAD( "starforc.17",  0x01000, 0x1000, CRC(68c60d0f) SHA1(1152ba0c274ecadb534133a860bbc8a93577dcf2) )
694   ROM_LOAD( "starforc.16",  0x02000, 0x1000, CRC(ce20b469) SHA1(60177a669d9c8cbeedd03ca5e2edf3f589c1c815) )
692   ROM_LOAD( "18.10pq", 0x00000, 0x1000, CRC(6455c3ad) SHA1(b163ccd3dc26ccfa8be1d16d52e17bc660ff84e3) )   /* bg3 */
693   ROM_LOAD( "17.9pq",  0x01000, 0x1000, CRC(68c60d0f) SHA1(1152ba0c274ecadb534133a860bbc8a93577dcf2) )
694   ROM_LOAD( "16.8pq",  0x02000, 0x1000, CRC(ce20b469) SHA1(60177a669d9c8cbeedd03ca5e2edf3f589c1c815) )
695695
696696   ROM_REGION( 0x0c000, "gfx5", 0 )
697   ROM_LOAD( "starforc.6",   0x00000, 0x4000, CRC(5468a21d) SHA1(4a1196d4cfb99616efdac9b3927609a85c6f1758) )   /* sprites */
698   ROM_LOAD( "starforc.5",   0x04000, 0x4000, CRC(f71717f8) SHA1(bf673571f772d8e0eddae89c00f31390c49a25d2) )
699   ROM_LOAD( "starforc.4",   0x08000, 0x4000, CRC(dd9d68a4) SHA1(34c60d2b34c7980bf65a5ebadb9c73f89128141f) )
697   ROM_LOAD( "6.10lm",  0x00000, 0x4000, CRC(5468a21d) SHA1(4a1196d4cfb99616efdac9b3927609a85c6f1758) )   /* sprites */
698   ROM_LOAD( "5.9lm",   0x04000, 0x4000, CRC(f71717f8) SHA1(bf673571f772d8e0eddae89c00f31390c49a25d2) )
699   ROM_LOAD( "4.8lm",   0x08000, 0x4000, CRC(dd9d68a4) SHA1(34c60d2b34c7980bf65a5ebadb9c73f89128141f) )
700700
701701   ROM_REGION( 0x0020, "proms", 0 )   /* PROMs */
702   ROM_LOAD( "07b.bin",    0x0000, 0x0020, CRC(68db8300) SHA1(33cd6b5ed92d7b73a708f2e4b12b6e7f6496d0c6) )   /* unknown - timing? */
702   ROM_LOAD( "07b.bin", 0x0000, 0x0020, CRC(68db8300) SHA1(33cd6b5ed92d7b73a708f2e4b12b6e7f6496d0c6) )   /* unknown - timing? */
703703ROM_END
704704
705705ROM_START( starforcb )
r15082r15083
744744   ROM_LOAD( "a18s030.7b",    0x0000, 0x0020, CRC(68db8300) SHA1(33cd6b5ed92d7b73a708f2e4b12b6e7f6496d0c6) )   /* unknown - timing? */
745745ROM_END
746746
747
748747ROM_START( starforca )
749748   ROM_REGION( 0x10000, "maincpu", 0 )
750749   ROM_LOAD( "5.bin",   0x0000, 0x2000, CRC(7691bbd4) SHA1(efcab11ea0ed58b6a47c9d7a994c921dfaa1b47e) )
r15082r15083
787786   ROM_LOAD( "prom.bin",    0x0000, 0x0020, CRC(68db8300) SHA1(33cd6b5ed92d7b73a708f2e4b12b6e7f6496d0c6) )   /* unknown - timing? */
788787ROM_END
789788
790
791789ROM_START( starforce )
792790   ROM_REGION( 2*0x10000, "maincpu", 0 )     /* 64k for code + 64k for decrypted opcodes */
793791   ROM_LOAD( "starfore.005", 0x0000, 0x2000, CRC(825f7ebe) SHA1(d63fd516e075bcc28d42189216b95bbf491a4cd1) )
r15082r15083
799797   ROM_LOAD( "starfore.000", 0x0000, 0x2000, CRC(a277c268) SHA1(99ed8439119fa4b850ad8aadb7ff3e54d4cd40be) )
800798
801799   ROM_REGION( 0x03000, "gfx1", 0 )
802   ROM_LOAD( "starforc.7",   0x00000, 0x1000, CRC(f4803339) SHA1(a119d68c2dd1c0e191231ce77353b31f30f7aa76) )   /* fg */
803   ROM_LOAD( "starforc.8",   0x01000, 0x1000, CRC(96979684) SHA1(bb4f7d3afc8dfaa723dfb5374996cc4bfd76fa3c) )
804   ROM_LOAD( "starforc.9",   0x02000, 0x1000, CRC(eead1d5c) SHA1(7c9165ed227c5228122b494a265cbfd6e843ba61) )
800   ROM_LOAD( "7.2fh",   0x00000, 0x1000, CRC(f4803339) SHA1(a119d68c2dd1c0e191231ce77353b31f30f7aa76) )   /* fg */
801   ROM_LOAD( "8.3fh",   0x01000, 0x1000, CRC(96979684) SHA1(bb4f7d3afc8dfaa723dfb5374996cc4bfd76fa3c) )
802   ROM_LOAD( "9.3fh",   0x02000, 0x1000, CRC(eead1d5c) SHA1(7c9165ed227c5228122b494a265cbfd6e843ba61) )
805803
806804   ROM_REGION( 0x06000, "gfx2", 0 )
807   ROM_LOAD( "starforc.15",  0x00000, 0x2000, CRC(c3bda12f) SHA1(3748ea8e34222a31a365a02ec77430f268b0b397) )   /* bg1 */
808   ROM_LOAD( "starforc.14",  0x02000, 0x2000, CRC(9e9384fe) SHA1(3aaa9cc64ef3775325f64733da4f6c328abf6514) )
809   ROM_LOAD( "starforc.13",  0x04000, 0x2000, CRC(84603285) SHA1(f4d6dfa3968fbd8ebf1a6451d5ea1821d65d9b49) )
805   ROM_LOAD( "15.10jk", 0x00000, 0x2000, CRC(c3bda12f) SHA1(3748ea8e34222a31a365a02ec77430f268b0b397) )   /* bg1 */
806   ROM_LOAD( "14.9jk",  0x02000, 0x2000, CRC(9e9384fe) SHA1(3aaa9cc64ef3775325f64733da4f6c328abf6514) )
807   ROM_LOAD( "13.8jk",  0x04000, 0x2000, CRC(84603285) SHA1(f4d6dfa3968fbd8ebf1a6451d5ea1821d65d9b49) )
810808
811809   ROM_REGION( 0x06000, "gfx3", 0 )
812   ROM_LOAD( "starforc.12",  0x00000, 0x2000, CRC(fdd9e38b) SHA1(3766835d9e9fc7e5dd99521e7303562029b78a65) )   /* bg2 */
813   ROM_LOAD( "starforc.11",  0x02000, 0x2000, CRC(668aea14) SHA1(62eb0df48f2f0c5778bb230cc3bf0b8eb3b4e3f8) )
814   ROM_LOAD( "starforc.10",  0x04000, 0x2000, CRC(c62a19c1) SHA1(9ce0e29630d3c8cba4db4cff333b250481348968) )
810   ROM_LOAD( "12.10de", 0x00000, 0x2000, CRC(fdd9e38b) SHA1(3766835d9e9fc7e5dd99521e7303562029b78a65) )   /* bg2 */
811   ROM_LOAD( "11.9de",  0x02000, 0x2000, CRC(668aea14) SHA1(62eb0df48f2f0c5778bb230cc3bf0b8eb3b4e3f8) )
812   ROM_LOAD( "10.8de",  0x04000, 0x2000, CRC(c62a19c1) SHA1(9ce0e29630d3c8cba4db4cff333b250481348968) )
815813
816814   ROM_REGION( 0x03000, "gfx4", 0 )
817   ROM_LOAD( "starforc.18",  0x00000, 0x1000, CRC(6455c3ad) SHA1(b163ccd3dc26ccfa8be1d16d52e17bc660ff84e3) )   /* bg3 */
818   ROM_LOAD( "starforc.17",  0x01000, 0x1000, CRC(68c60d0f) SHA1(1152ba0c274ecadb534133a860bbc8a93577dcf2) )
819   ROM_LOAD( "starforc.16",  0x02000, 0x1000, CRC(ce20b469) SHA1(60177a669d9c8cbeedd03ca5e2edf3f589c1c815) )
815   ROM_LOAD( "18.10pq", 0x00000, 0x1000, CRC(6455c3ad) SHA1(b163ccd3dc26ccfa8be1d16d52e17bc660ff84e3) )   /* bg3 */
816   ROM_LOAD( "17.9pq",  0x01000, 0x1000, CRC(68c60d0f) SHA1(1152ba0c274ecadb534133a860bbc8a93577dcf2) )
817   ROM_LOAD( "16.8pq",  0x02000, 0x1000, CRC(ce20b469) SHA1(60177a669d9c8cbeedd03ca5e2edf3f589c1c815) )
820818
821819   ROM_REGION( 0x0c000, "gfx5", 0 )
822   ROM_LOAD( "starforc.6",   0x00000, 0x4000, CRC(5468a21d) SHA1(4a1196d4cfb99616efdac9b3927609a85c6f1758) )   /* sprites */
823   ROM_LOAD( "starforc.5",   0x04000, 0x4000, CRC(f71717f8) SHA1(bf673571f772d8e0eddae89c00f31390c49a25d2) )
824   ROM_LOAD( "starforc.4",   0x08000, 0x4000, CRC(dd9d68a4) SHA1(34c60d2b34c7980bf65a5ebadb9c73f89128141f) )
820   ROM_LOAD( "6.10lm",  0x00000, 0x4000, CRC(5468a21d) SHA1(4a1196d4cfb99616efdac9b3927609a85c6f1758) )   /* sprites */
821   ROM_LOAD( "5.9lm",   0x04000, 0x4000, CRC(f71717f8) SHA1(bf673571f772d8e0eddae89c00f31390c49a25d2) )
822   ROM_LOAD( "4.8lm",   0x08000, 0x4000, CRC(dd9d68a4) SHA1(34c60d2b34c7980bf65a5ebadb9c73f89128141f) )
825823
826824   ROM_REGION( 0x0020, "proms", 0 )   /* PROMs */
827   ROM_LOAD( "07b.bin",    0x0000, 0x0020, CRC(68db8300) SHA1(33cd6b5ed92d7b73a708f2e4b12b6e7f6496d0c6) )   /* unknown - timing? */
825   ROM_LOAD( "07b.bin", 0x0000, 0x0020, CRC(68db8300) SHA1(33cd6b5ed92d7b73a708f2e4b12b6e7f6496d0c6) )   /* unknown - timing? */
828826ROM_END
829827
830828ROM_START( megaforc )
831829   ROM_REGION( 0x10000, "maincpu", 0 )
832   ROM_LOAD( "mf3.bin",      0x0000, 0x4000, CRC(d3ea82ec) SHA1(e15fda65ba24517cc04abc55b5d079a33327553c) )
833   ROM_LOAD( "mf2.bin",      0x4000, 0x4000, CRC(aa320718) SHA1(cbbf8e4d06a1ecf77d776058d965afdaa7f5b47f) )
830   ROM_LOAD( "mf3.bin",  0x0000, 0x4000, CRC(d3ea82ec) SHA1(e15fda65ba24517cc04abc55b5d079a33327553c) )
831   ROM_LOAD( "mf2.bin",  0x4000, 0x4000, CRC(aa320718) SHA1(cbbf8e4d06a1ecf77d776058d965afdaa7f5b47f) )
834832
835833   ROM_REGION( 0x10000, "sub", 0 )     /* 64k for sound board */
836   ROM_LOAD( "starforc.1",   0x0000, 0x2000, CRC(2735bb22) SHA1(1bd0558e05b41aebab3911991969512df904fea5) )
834   ROM_LOAD( "1.3hj",    0x0000, 0x2000, CRC(2735bb22) SHA1(1bd0558e05b41aebab3911991969512df904fea5) )
837835
838836   ROM_REGION( 0x03000, "gfx1", 0 )
839   ROM_LOAD( "mf7.bin",      0x00000, 0x1000, CRC(43ef8d20) SHA1(07ebe3e10fa56b671788a122cdc02e661b624f40) )   /* fg */
840   ROM_LOAD( "mf8.bin",      0x01000, 0x1000, CRC(c36fb746) SHA1(01960e068046bcc0e3e9370fdfe73f9fd64491ae) )
841   ROM_LOAD( "mf9.bin",      0x02000, 0x1000, CRC(62e7c9ec) SHA1(24dd1de3e268865c36c732714dc257c58cb88d67) )
837   ROM_LOAD( "mf7.bin",  0x00000, 0x1000, CRC(43ef8d20) SHA1(07ebe3e10fa56b671788a122cdc02e661b624f40) )   /* fg */
838   ROM_LOAD( "mf8.bin",  0x01000, 0x1000, CRC(c36fb746) SHA1(01960e068046bcc0e3e9370fdfe73f9fd64491ae) )
839   ROM_LOAD( "mf9.bin",  0x02000, 0x1000, CRC(62e7c9ec) SHA1(24dd1de3e268865c36c732714dc257c58cb88d67) )
842840
843841   ROM_REGION( 0x06000, "gfx2", 0 )
844   ROM_LOAD( "starforc.15",  0x00000, 0x2000, CRC(c3bda12f) SHA1(3748ea8e34222a31a365a02ec77430f268b0b397) )   /* bg1 */
845   ROM_LOAD( "starforc.14",  0x02000, 0x2000, CRC(9e9384fe) SHA1(3aaa9cc64ef3775325f64733da4f6c328abf6514) )
846   ROM_LOAD( "starforc.13",  0x04000, 0x2000, CRC(84603285) SHA1(f4d6dfa3968fbd8ebf1a6451d5ea1821d65d9b49) )
842   ROM_LOAD( "15.10jk",  0x00000, 0x2000, CRC(c3bda12f) SHA1(3748ea8e34222a31a365a02ec77430f268b0b397) )   /* bg1 */
843   ROM_LOAD( "14.9jk",   0x02000, 0x2000, CRC(9e9384fe) SHA1(3aaa9cc64ef3775325f64733da4f6c328abf6514) )
844   ROM_LOAD( "13.8jk",   0x04000, 0x2000, CRC(84603285) SHA1(f4d6dfa3968fbd8ebf1a6451d5ea1821d65d9b49) )
847845
848846   ROM_REGION( 0x06000, "gfx3", 0 )
849   ROM_LOAD( "starforc.12",  0x00000, 0x2000, CRC(fdd9e38b) SHA1(3766835d9e9fc7e5dd99521e7303562029b78a65) )   /* bg2 */
850   ROM_LOAD( "starforc.11",  0x02000, 0x2000, CRC(668aea14) SHA1(62eb0df48f2f0c5778bb230cc3bf0b8eb3b4e3f8) )
851   ROM_LOAD( "starforc.10",  0x04000, 0x2000, CRC(c62a19c1) SHA1(9ce0e29630d3c8cba4db4cff333b250481348968) )
847   ROM_LOAD( "12.10de",  0x00000, 0x2000, CRC(fdd9e38b) SHA1(3766835d9e9fc7e5dd99521e7303562029b78a65) )   /* bg2 */
848   ROM_LOAD( "11.9de",   0x02000, 0x2000, CRC(668aea14) SHA1(62eb0df48f2f0c5778bb230cc3bf0b8eb3b4e3f8) )
849   ROM_LOAD( "10.8de",   0x04000, 0x2000, CRC(c62a19c1) SHA1(9ce0e29630d3c8cba4db4cff333b250481348968) )
852850
853851   ROM_REGION( 0x03000, "gfx4", 0 )
854   ROM_LOAD( "starforc.18",  0x00000, 0x1000, CRC(6455c3ad) SHA1(b163ccd3dc26ccfa8be1d16d52e17bc660ff84e3) )   /* bg3 */
855   ROM_LOAD( "starforc.17",  0x01000, 0x1000, CRC(68c60d0f) SHA1(1152ba0c274ecadb534133a860bbc8a93577dcf2) )
856   ROM_LOAD( "starforc.16",  0x02000, 0x1000, CRC(ce20b469) SHA1(60177a669d9c8cbeedd03ca5e2edf3f589c1c815) )
852   ROM_LOAD( "18.10pq",  0x00000, 0x1000, CRC(6455c3ad) SHA1(b163ccd3dc26ccfa8be1d16d52e17bc660ff84e3) )   /* bg3 */
853   ROM_LOAD( "17.9pq",   0x01000, 0x1000, CRC(68c60d0f) SHA1(1152ba0c274ecadb534133a860bbc8a93577dcf2) )
854   ROM_LOAD( "16.8pq",   0x02000, 0x1000, CRC(ce20b469) SHA1(60177a669d9c8cbeedd03ca5e2edf3f589c1c815) )
857855
858856   ROM_REGION( 0x0c000, "gfx5", 0 )
859   ROM_LOAD( "starforc.6",   0x00000, 0x4000, CRC(5468a21d) SHA1(4a1196d4cfb99616efdac9b3927609a85c6f1758) )   /* sprites */
860   ROM_LOAD( "starforc.5",   0x04000, 0x4000, CRC(f71717f8) SHA1(bf673571f772d8e0eddae89c00f31390c49a25d2) )
861   ROM_LOAD( "starforc.4",   0x08000, 0x4000, CRC(dd9d68a4) SHA1(34c60d2b34c7980bf65a5ebadb9c73f89128141f) )
857   ROM_LOAD( "6.10lm",   0x00000, 0x4000, CRC(5468a21d) SHA1(4a1196d4cfb99616efdac9b3927609a85c6f1758) )   /* sprites */
858   ROM_LOAD( "5.9lm",    0x04000, 0x4000, CRC(f71717f8) SHA1(bf673571f772d8e0eddae89c00f31390c49a25d2) )
859   ROM_LOAD( "4.8lm",    0x08000, 0x4000, CRC(dd9d68a4) SHA1(34c60d2b34c7980bf65a5ebadb9c73f89128141f) )
862860
863861   ROM_REGION( 0x0020, "proms", 0 )   /* PROMs */
864   ROM_LOAD( "07b.bin",    0x0000, 0x0020, CRC(68db8300) SHA1(33cd6b5ed92d7b73a708f2e4b12b6e7f6496d0c6) )   /* unknown - timing? */
862   ROM_LOAD( "07b.bin",  0x0000, 0x0020, CRC(68db8300) SHA1(33cd6b5ed92d7b73a708f2e4b12b6e7f6496d0c6) )   /* unknown - timing? */
865863ROM_END
866864
867865ROM_START( baluba )
r15082r15083
947945GAME( 1984, starforca,starforc, senjyo,  starforc, starfora, ROT90, "Tehkan", "Star Force (encrypted, set 2)", 0 )
948946GAME( 1985, megaforc, starforc, senjyo,  starforc, starforc, ROT90, "Tehkan (Video Ware license)", "Mega Force", 0 )
949947GAME( 1986, baluba,   0,        senjyo,  baluba,   starforc, ROT90, "Able Corp, Ltd.", "Baluba-louk no Densetsu (Japan)", 0 )
950
src/mame/drivers/maygay1b.c
r15082r15083
202202         /* read sensor RAM */
203203         case 0x40:
204204            addr = chip->command & 0x07;
205            result = input_port_read(machine(),"SW1");
205            result = ioport("SW1")->read();
206206            /* handle autoincrement */
207207            if (chip->command & 0x10)
208208               chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
r15082r15083
229229   {
230230      if ( chip->read_sensor )
231231      {
232         result = input_port_read(machine(),portnames[chip->sense_address]);
232         result = ioport(portnames[chip->sense_address])->read();
233233//          break
234234      }
235235      if ( chip->sense_auto_inc )
r15082r15083
377377      {
378378         /* read sensor RAM */
379379         case 0x40:
380            //result = ~input_port_read(machine,"DSW1");  /* DSW 1 - inverted! */
380            //result = ~ioport("DSW1")->read();  /* DSW 1 - inverted! */
381381            break;
382382
383383         /* read display RAM */
src/mame/drivers/twinkle.c
r15082r15083
504504      switch( m_io_offset )
505505      {
506506         case 0x07:
507            data |= input_port_read( machine(), "IN0" );
507            data |= ioport( "IN0" )->read();
508508            break;
509509
510510         case 0x0f:
511            data |= input_port_read( machine(), "IN1" );
511            data |= ioport( "IN1" )->read();
512512            break;
513513
514514         case 0x17:
515            data |= input_port_read( machine(), "IN2" );
515            data |= ioport( "IN2" )->read();
516516            break;
517517
518518         case 0x1f:
519            data |= input_port_read( machine(), "IN3" );
519            data |= ioport( "IN3" )->read();
520520            break;
521521
522522         case 0x27:
523            data |= input_port_read( machine(), "IN4" );
523            data |= ioport( "IN4" )->read();
524524            break;
525525
526526         case 0x2f:
527            data |= input_port_read( machine(), "IN5" );
527            data |= ioport( "IN5" )->read();
528528            break;
529529
530530         default:
src/mame/drivers/bzone.c
r15082r15083
244244
245245static INTERRUPT_GEN( bzone_interrupt )
246246{
247   if (input_port_read(device->machine(), "IN0") & 0x10)
247   if (device->machine().root_device().ioport("IN0")->read() & 0x10)
248248      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
249249}
250250
r15082r15083
278278static READ8_DEVICE_HANDLER( redbaron_joy_r )
279279{
280280   bzone_state *state = device->machine().driver_data<bzone_state>();
281   return input_port_read(device->machine(), state->m_rb_input_select ? "FAKE1" : "FAKE2");
281   return state->ioport(state->m_rb_input_select ? "FAKE1" : "FAKE2")->read();
282282}
283283
284284static WRITE8_DEVICE_HANDLER( redbaron_joysound_w )
r15082r15083
789789   static const char *const analog_port[] = { "AN0", "AN1", "AN2" };
790790
791791   if (offset <= 2)
792      m_analog_data = input_port_read(machine(), analog_port[offset]);
792      m_analog_data = ioport(analog_port[offset])->read();
793793}
794794
795795
src/mame/drivers/spool99.c
r15082r15083
165165   {
166166      switch(offset+0xaf00)
167167      {
168         case 0xafd8: return input_port_read(machine(),"COIN1");
168         case 0xafd8: return ioport("COIN1")->read();
169169//          case 0xafd9: return 1;
170         case 0xafda: return input_port_read(machine(),"COIN2");
170         case 0xafda: return ioport("COIN2")->read();
171171         case 0xafdb: return 1;
172         case 0xafdc: return input_port_read(machine(),"SERVICE1");//attract mode
173         case 0xafdd: return input_port_read(machine(),"HOLD3");
174         case 0xafde: return input_port_read(machine(),"HOLD4");
175         case 0xafdf: return input_port_read(machine(),"HOLD2");
176         case 0xafe0: return input_port_read(machine(),"HOLD1");
177         case 0xafe1: return input_port_read(machine(),"HOLD5");
178         case 0xafe2: return input_port_read(machine(),"START");
179         case 0xafe3: return input_port_read(machine(),"BET");//system 2
180         case 0xafe4: return input_port_read(machine(),"SERVICE2");//attract mode
172         case 0xafdc: return ioport("SERVICE1")->read();//attract mode
173         case 0xafdd: return ioport("HOLD3")->read();
174         case 0xafde: return ioport("HOLD4")->read();
175         case 0xafdf: return ioport("HOLD2")->read();
176         case 0xafe0: return ioport("HOLD1")->read();
177         case 0xafe1: return ioport("HOLD5")->read();
178         case 0xafe2: return ioport("START")->read();
179         case 0xafe3: return ioport("BET")->read();//system 2
180         case 0xafe4: return ioport("SERVICE2")->read();//attract mode
181181//          case 0xafe5: return 1;
182182//          case 0xafe6: return 1;
183183         case 0xafe7: return machine().device<eeprom_device>("eeprom")->read_bit();
r15082r15083
235235   {
236236      switch(offset+0xa700)
237237      {
238         case 0xa720: return input_port_read(machine(),"SERVICE1");//attract mode
239         case 0xa722: return input_port_read(machine(),"COIN1");
240         case 0xa723: return input_port_read(machine(),"COIN2");
241         case 0xa724: return input_port_read(machine(),"SERVICE2");//attract mode
242         case 0xa725: return input_port_read(machine(),"HOLD3");
243         case 0xa726: return input_port_read(machine(),"HOLD4");
244         case 0xa727: return input_port_read(machine(),"HOLD2");
238         case 0xa720: return ioport("SERVICE1")->read();//attract mode
239         case 0xa722: return ioport("COIN1")->read();
240         case 0xa723: return ioport("COIN2")->read();
241         case 0xa724: return ioport("SERVICE2")->read();//attract mode
242         case 0xa725: return ioport("HOLD3")->read();
243         case 0xa726: return ioport("HOLD4")->read();
244         case 0xa727: return ioport("HOLD2")->read();
245245         case 0xa780: return machine().device<okim6295_device>("oki")->read(space,0);
246         case 0xa7a0: return input_port_read(machine(),"HOLD1");
247         case 0xa7a1: return input_port_read(machine(),"HOLD5");
248         case 0xa7a2: return input_port_read(machine(),"START");
249         case 0xa7a3: return input_port_read(machine(),"BET");//system 2
246         case 0xa7a0: return ioport("HOLD1")->read();
247         case 0xa7a1: return ioport("HOLD5")->read();
248         case 0xa7a2: return ioport("START")->read();
249         case 0xa7a3: return ioport("BET")->read();//system 2
250250
251251         case 0xa7a7: return machine().device<eeprom_device>("eeprom")->read_bit();
252252
src/mame/drivers/simpl156.c
r15082r15083
103103   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
104104   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
105105   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
106   PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_VBLANK ) // all bits? check..
106   PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // all bits? check..
107107   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) // eeprom?..
108108
109109
r15082r15083
130130READ32_MEMBER(simpl156_state::simpl156_inputs_read)
131131{
132132   int eep = m_eeprom->read_bit();
133   UINT32 returndata = input_port_read(machine(), "IN0") ^ 0xffff0000;
133   UINT32 returndata = ioport("IN0")->read() ^ 0xffff0000;
134134
135135   returndata ^= ((eep << 8));
136136   return returndata;
r15082r15083
161161{
162162   UINT32 returndata;
163163
164   returndata = input_port_read(machine(), "IN1");
164   returndata = ioport("IN1")->read();
165165
166166   return returndata;
167167}
src/mame/drivers/30test.c
r15082r15083
9393
9494   switch(m_mux_data)
9595   {
96      case 0x01: res = input_port_read(machine(), "IN0"); break;
97      case 0x02: res = input_port_read(machine(), "IN1"); break;
98      case 0x04: res = input_port_read(machine(), "IN2"); break;
99      case 0x08: res = input_port_read(machine(), "IN3"); break;
96      case 0x01: res = ioport("IN0")->read(); break;
97      case 0x02: res = ioport("IN1")->read(); break;
98      case 0x04: res = ioport("IN2")->read(); break;
99      case 0x08: res = ioport("IN3")->read(); break;
100100   }
101101
102102   return res;
src/mame/drivers/deadang.c
r15082r15083
4747
4848READ16_MEMBER(deadang_state::ghunter_trackball_low_r)
4949{
50   return (input_port_read(machine(), "TRACKX") & 0xff) | ((input_port_read(machine(), "TRACKY") & 0xff) << 8);
50   return (ioport("TRACKX")->read() & 0xff) | ((ioport("TRACKY")->read() & 0xff) << 8);
5151}
5252READ16_MEMBER(deadang_state::ghunter_trackball_high_r)
5353{
54   return ((input_port_read(machine(), "TRACKX") & 0x0f00) >> 4) | (input_port_read(machine(), "TRACKY") & 0x0f00);
54   return ((ioport("TRACKX")->read() & 0x0f00) >> 4) | (ioport("TRACKY")->read() & 0x0f00);
5555}
5656
5757/* Memory Maps */
src/mame/drivers/cliffhgr.c
r15082r15083
134134
135135
136136   if (m_port_bank < 7)
137      return input_port_read(machine(),  banknames[m_port_bank]);
137      return ioport(banknames[m_port_bank])->read();
138138
139139   /* output is pulled up for non-mapped ports */
140140   return 0xff;
r15082r15083
555555   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
556556   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
557557   PORT_DIPNAME( 0x02, 0x02, "Single Coin Continue" )   PORT_DIPLOCATION("E11:2")
558   PORT_DIPSETTING(    0x02, DEF_STR( Off ) ) PORT_CONDITION("BANK1",0x01,PORTCOND_EQUALS,0x00)
559   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) PORT_CONDITION("BANK1",0x01,PORTCOND_EQUALS,0x00)
558   PORT_DIPSETTING(    0x02, DEF_STR( Off ) ) PORT_CONDITION("BANK1",0x01,EQUALS,0x00)
559   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) PORT_CONDITION("BANK1",0x01,EQUALS,0x00)
560560   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("E11:1")
561561   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
562562   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/twincobr.c
r15082r15083
390390
391391   PORT_START("VBLANK")
392392   PORT_BIT( 0x7f, IP_ACTIVE_HIGH, IPT_UNUSED )
393   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
393   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
394394INPUT_PORTS_END
395395
396396/* verified from M68000 and Z80 code */
r15082r15083
425425
426426   PORT_MODIFY("VBLANK")
427427   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
428   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
428   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
429429INPUT_PORTS_END
430430
431431
r15082r15083
471471   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
472472   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
473473   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
474   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
474   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
475475INPUT_PORTS_END
476476
477477/* verified from M68000 code */
src/mame/drivers/artmagic.c
r15082r15083
152152      update_irq_state(machine());
153153      machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
154154   }
155   return input_port_read(machine(), "300000");
155   return ioport("300000")->read();
156156}
157157
158158
src/mame/drivers/sprint2.c
r15082r15083
5050static int service_mode(running_machine &machine)
5151{
5252   sprint2_state *state = machine.driver_data<sprint2_state>();
53   UINT8 v = input_port_read(machine, "INB");
53   UINT8 v = state->ioport("INB")->read();
5454
5555   if (GAME_IS_SPRINT1)
5656   {
r15082r15083
8282
8383      for (i = 0; i < 2; i++)
8484      {
85         signed char delta = input_port_read(device->machine(), i ? "DIAL_P2" : "DIAL_P1") - state->m_dial[i];
85         signed char delta = state->ioport(i ? "DIAL_P2" : "DIAL_P1")->read() - state->m_dial[i];
8686
8787         if (delta < 0)
8888         {
r15082r15083
9595
9696         state->m_dial[i] += delta;
9797
98         switch (input_port_read(device->machine(), i ? "GEAR_P2" : "GEAR_P1") & 15)
98         switch (device->machine().root_device().ioport(i ? "GEAR_P2" : "GEAR_P1")->read() & 15)
9999         {
100100         case 1: state->m_gear[i] = 1; break;
101101         case 2: state->m_gear[i] = 2; break;
r15082r15083
126126
127127READ8_MEMBER(sprint2_state::sprint2_dip_r)
128128{
129   return (input_port_read(machine(), "DSW") << (2 * ((offset & 3) ^ 3))) & 0xc0;
129   return (ioport("DSW")->read() << (2 * ((offset & 3) ^ 3))) & 0xc0;
130130}
131131
132132
133133READ8_MEMBER(sprint2_state::sprint2_input_A_r)
134134{
135   UINT8 val = input_port_read(machine(), "INA");
135   UINT8 val = ioport("INA")->read();
136136
137137   if (m_game == 2)// (GAME_IS_SPRINT2)
138138   {
r15082r15083
150150
151151READ8_MEMBER(sprint2_state::sprint2_input_B_r)
152152{
153   UINT8 val = input_port_read(machine(), "INB");
153   UINT8 val = ioport("INB")->read();
154154
155155   if (m_game == 1) // (GAME_IS_SPRINT1)
156156   {
src/mame/drivers/exterm.c
r15082r15083
101101   UINT16 port;
102102
103103   /* Read the fake input port */
104   UINT8 trackball_pos = input_port_read(space->machine(), which ? "DIAL1" : "DIAL0");
104   UINT8 trackball_pos = state->ioport(which ? "DIAL1" : "DIAL0")->read();
105105
106106   /* Calculate the change from the last position. */
107107   UINT8 trackball_diff = state->m_trackball_old[which] - trackball_pos;
r15082r15083
117117   state->m_aimpos[which] = (state->m_aimpos[which] + trackball_diff) & 0x3f;
118118
119119   /* Combine it with the standard input bits */
120   port = which ? input_port_read(space->machine(), "P2") : input_port_read(space->machine(), "P1");
120   port = state->ioport(which ? "P2" : "P1")->read();
121121
122122   return (port & 0xc0ff) | (state->m_aimpos[which] << 8);
123123}
src/mame/drivers/dragrace.c
r15082r15083
1818
1919   for (i = 0; i < 2; i++)
2020   {
21      switch (input_port_read(timer.machine(), portnames[i]))
21      switch (timer.machine().root_device().ioport(portnames[i])->read())
2222      {
2323      case 0x01: state->m_gear[i] = 1; break;
2424      case 0x02: state->m_gear[i] = 2; break;
r15082r15083
2929   }
3030
3131   /* watchdog is disabled during service mode */
32   timer.machine().watchdog_enable(input_port_read(timer.machine(), "IN0") & 0x20);
32   timer.machine().watchdog_enable(timer.machine().root_device().ioport("IN0")->read() & 0x20);
3333}
3434
3535
r15082r15083
112112
113113READ8_MEMBER(dragrace_state::dragrace_input_r)
114114{
115   int val = input_port_read(machine(), "IN2");
115   int val = ioport("IN2")->read();
116116   static const char *const portnames[] = { "IN0", "IN1" };
117117
118118   UINT8 maskA = 1 << (offset % 8);
r15082r15083
122122
123123   for (i = 0; i < 2; i++)
124124   {
125      int in = input_port_read(machine(), portnames[i]);
125      int in = ioport(portnames[i])->read();
126126
127127      if (m_gear[i] != 0)
128128         in &= ~(1 << m_gear[i]);
r15082r15083
145145
146146   for (i = 0; i < 2; i++)
147147   {
148      int dial = input_port_read(machine(), dialnames[i]);
148      int dial = ioport(dialnames[i])->read();
149149
150150      bitA[i] = ((dial + 1) / 2) & 1;
151151      bitB[i] = ((dial + 0) / 2) & 1;
src/mame/drivers/seibuspi.c
r15082r15083
917917{
918918   if( ACCESSING_BITS_0_7 )
919919   {
920      return input_port_read(machine(), "INPUTS");
920      return ioport("INPUTS")->read();
921921   }
922922   return 0xffffffff;
923923}
r15082r15083
926926{
927927   if( ACCESSING_BITS_0_7 )
928928   {
929      return input_port_read(machine(), "SYSTEM");
929      return ioport("SYSTEM")->read();
930930   }
931931   return 0xffffffff;
932932}
r15082r15083
936936   switch(m_ejsakura_input_port)
937937   {
938938      case 0x01:
939         return input_port_read(machine(), "INPUT01");
939         return ioport("INPUT01")->read();
940940      case 0x02:
941         return input_port_read(machine(), "INPUT02");
941         return ioport("INPUT02")->read();
942942      case 0x04:
943         return input_port_read(machine(), "INPUT04");
943         return ioport("INPUT04")->read();
944944      case 0x08:
945         return input_port_read(machine(), "INPUT08");
945         return ioport("INPUT08")->read();
946946      case 0x10:
947         return input_port_read(machine(), "INPUT10");
947         return ioport("INPUT10")->read();
948948      default:
949         return input_port_read(machine(), "SYSTEM");
949         return ioport("SYSTEM")->read();
950950   }
951951   return 0xffffffff;
952952}
r15082r15083
985985
986986READ8_MEMBER(seibuspi_state::z80_jp1_r)
987987{
988   return input_port_read(machine(), "JP1");
988   return ioport("JP1")->read();
989989}
990990
991991READ8_MEMBER(seibuspi_state::z80_coin_r)
992992{
993   return input_port_read(machine(), "COIN");
993   return ioport("COIN")->read();
994994}
995995
996996READ32_MEMBER(seibuspi_state::soundrom_r)
r15082r15083
12891289CUSTOM_INPUT_MEMBER(seibuspi_state::ejanhs_encode)
12901290{
12911291   static const UINT8 encoding[] = { 0x02, 0x10, 0x03, 0x18, 0x04, 0x20, 0x05, 0x28, 0x06, 0x30, 0x07 };
1292   input_port_value state = input_port_read(machine(), (const char *)param);
1292   ioport_value state = ioport((const char *)param)->read();
12931293   int bit;
12941294
12951295   for (bit = 0; bit < ARRAY_LENGTH(encoding); bit++)
r15082r15083
18121812{
18131813   seibuspi_state *state = machine.driver_data<seibuspi_state>();
18141814   int i;
1815   UINT8 *sound = machine.root_device().memregion("ymf")->base();
1815   UINT8 *sound = state->memregion("ymf")->base();
18161816
18171817   UINT8 *rombase = state->memregion("user1")->base();
18181818   UINT8 flash_data = rombase[0x1ffffc];
r15082r15083
20572057      device_spin_until_interrupt(&space.device()); // idle
20582058      // Hack to enter test mode
20592059      r = m_spimainram[(0x002894c-0x800)/4] & (~0x400);
2060      return r | (((input_port_read(machine(), "SYSTEM") ^ 0xff)<<8) & 0x400);
2060      return r | (((ioport("SYSTEM")->read() ^ 0xff)<<8) & 0x400);
20612061   }
20622062
20632063   /* rfjetj */
r15082r15083
20752075   state->m_flash[0] = machine.device<intel_e28f008sa_device>("flash0");
20762076   state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
20772077
2078   seibuspi_text_decrypt(machine.root_device().memregion("gfx1")->base());
2079   seibuspi_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
2078   seibuspi_text_decrypt(state->memregion("gfx1")->base());
2079   seibuspi_bg_decrypt(state->memregion("gfx2")->base(), state->memregion("gfx2")->bytes());
20802080   seibuspi_sprite_decrypt(state->memregion("gfx3")->base(), 0x400000);
20812081}
20822082
r15082r15083
21462146   state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
21472147
21482148   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x0282AC, 0x0282AF, read32_delegate(FUNC(seibuspi_state::rf2_speedup_r),state));
2149   seibuspi_rise10_text_decrypt(machine.root_device().memregion("gfx1")->base());
2150   seibuspi_rise10_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
2149   seibuspi_rise10_text_decrypt(state->memregion("gfx1")->base());
2150   seibuspi_rise10_bg_decrypt(state->memregion("gfx2")->base(), state->memregion("gfx2")->bytes());
21512151   seibuspi_rise10_sprite_decrypt(state->memregion("gfx3")->base(), 0x600000);
21522152
21532153   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state));
r15082r15083
21712171   state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
21722172
21732173   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x002894c, 0x002894f, read32_delegate(FUNC(seibuspi_state::rfjet_speedup_r),state));
2174   seibuspi_rise11_text_decrypt(machine.root_device().memregion("gfx1")->base());
2175   seibuspi_rise11_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
2174   seibuspi_rise11_text_decrypt(state->memregion("gfx1")->base());
2175   seibuspi_rise11_bg_decrypt(state->memregion("gfx2")->base(), state->memregion("gfx2")->bytes());
21762176   seibuspi_rise11_sprite_decrypt_rfjet(state->memregion("gfx3")->base(), 0x800000);
21772177
21782178   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state));
src/mame/drivers/coolpool.c
r15082r15083
406406
407407   m_result = (m_lastresult | 0x00ff);
408408
409   m_newx[1] = input_port_read(machine(), "XAXIS1");   /* Trackball 1  Left - Right */
410   m_newy[1] = input_port_read(machine(), "YAXIS1");   /* Trackball 1   Up  - Down  */
411   m_newx[2] = input_port_read(machine(), "XAXIS2");   /* Trackball 2  Left - Right */
412   m_newy[2] = input_port_read(machine(), "YAXIS2");   /* Trackball 2   Up  - Down  */
409   m_newx[1] = ioport("XAXIS1")->read();   /* Trackball 1  Left - Right */
410   m_newy[1] = ioport("YAXIS1")->read();   /* Trackball 1   Up  - Down  */
411   m_newx[2] = ioport("XAXIS2")->read();   /* Trackball 2  Left - Right */
412   m_newy[2] = ioport("YAXIS2")->read();   /* Trackball 2   Up  - Down  */
413413
414414   m_dx[1] = (INT8)(m_newx[1] - m_oldx[1]);
415415   m_dy[1] = (INT8)(m_newy[1] - m_oldy[1]);
r15082r15083
572572READ16_MEMBER(coolpool_state::coolpool_input_r)
573573{
574574
575   m_result = (input_port_read(machine(), "IN1") & 0x00ff) | (m_lastresult & 0xff00);
576   m_newx[1] = input_port_read(machine(), "XAXIS");
577   m_newy[1] = input_port_read(machine(), "YAXIS");
575   m_result = (ioport("IN1")->read() & 0x00ff) | (m_lastresult & 0xff00);
576   m_newx[1] = ioport("XAXIS")->read();
577   m_newy[1] = ioport("YAXIS")->read();
578578   m_dx[1] = (INT8)(m_newx[1] - m_oldx[1]);
579579   m_dy[1] = (INT8)(m_newy[1] - m_oldy[1]);
580580
src/mame/drivers/timetrv.c
r15082r15083
5959
6060READ8_MEMBER(timetrv_state::test1_r)
6161{
62   return input_port_read(machine(), "IN0");//machine().rand();
62   return ioport("IN0")->read();//machine().rand();
6363}
6464
6565READ8_MEMBER(timetrv_state::test2_r)
6666{
6767   /*bit 7,eeprom read bit*/
68   return (input_port_read(machine(), "IN1") & 0x7f);//machine().rand();
68   return (ioport("IN1")->read() & 0x7f);//machine().rand();
6969}
7070
7171
src/mame/drivers/astrafr.c
r15082r15083
1919{
2020public:
2121   astrafr_state(const machine_config &mconfig, device_type type, const char *tag)
22      : driver_device(mconfig, type, tag)
22      : driver_device(mconfig, type, tag),
23        m_maincpu(*this, "maincpu"),
24        m_slavecpu(*this, "slavecpu")
25
2326   {
2427      fgpa_first_read_addr = 0xffff;
2528      fgpa_rom_write_addr = 0xffff;
2629      fgpa_after_rom_write_addr = 0xffff;
2730   }
2831
32   UINT32* m_cpuregion;
33   int  m_cpuregion_size;
34   UINT32* m_mainram;
35
36   UINT32* m_slavecpuregion;
37   int  m_slavecpuregion_size;
38   UINT32* m_slaveram;
39
40
41
42   DECLARE_READ32_MEMBER(astrafr_mem_r);
43   DECLARE_WRITE32_MEMBER(astrafr_mem_w);
44
45   DECLARE_READ32_MEMBER(astrafr_slave_mem_r);
46   DECLARE_WRITE32_MEMBER(astrafr_slave_mem_w);
47
48
2949   // ports move above from game to game..
3050   UINT16 fgpa_rom_write_addr;
3151   UINT16 fgpa_first_read_addr;
r15082r15083
91111         logerror("%08x astra_fgpa_slave_w offset %02x %02x\n", pc, offset, data);
92112      }
93113   }
114   
115   // devices
116   required_device<cpu_device> m_maincpu;
117   optional_device<cpu_device> m_slavecpu;
94118
95119};
96120
97121
122
123READ32_MEMBER(astrafr_state::astrafr_mem_r)
124{
125   int pc = cpu_get_pc(&space.device());
126   int cs = m68340_get_cs(m_maincpu, offset * 4);
127
128   switch ( cs )
129   {
130      case 1:
131         if (offset<m_cpuregion_size)
132            return m_cpuregion[offset];
133         else
134            return 0x0000;
135
136      case 2:
137         offset &= 0x3fff;
138         return m_mainram[offset];
139
140      default:
141         logerror("%08x maincpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs);
142
143   }
144
145   return 0x0000;
146}
147
148
149
150WRITE32_MEMBER(astrafr_state::astrafr_mem_w)
151{
152   int pc = cpu_get_pc(&space.device());
153   int address = offset * 4;
154   int cs = m68340_get_cs(m_maincpu, address);
155
156
157   switch ( cs )
158   {
159      case 0: // some sets end up writng the FGPA data with CS0, I guess the CS logic is wrong??
160      case 3:
161         address &= 0xfffff;
162
163         if (mem_mask&0xff000000) astra_fgpa_w(space, address+0, data >> 24);
164         if (mem_mask&0x00ff0000) astra_fgpa_w(space, address+1, data >> 16);
165         if (mem_mask&0x0000ff00) astra_fgpa_w(space, address+2, data >> 8);
166         if (mem_mask&0x000000ff) astra_fgpa_w(space, address+3, data >> 0);
167         break;
168
169      case 2:
170         offset &= 0x3fff;
171         COMBINE_DATA(&m_mainram[offset]);
172         break;
173
174      default:
175         logerror("%08x maincpu write access offset %08x data %08x mem_mask %08x cs %d\n", pc, address, data, mem_mask, cs);
176
177   }
178}
179
180READ32_MEMBER(astrafr_state::astrafr_slave_mem_r)
181{
182   int pc = cpu_get_pc(&space.device());
183   int cs = m68340_get_cs(m_slavecpu, offset * 4);
184
185   switch ( cs )
186   {
187      case 1:
188         if (offset<m_slavecpuregion_size)
189            return m_slavecpuregion[offset];
190         else
191            return 0x0000;
192
193      case 2:
194         offset &= 0x3fff;
195         return m_slaveram[offset];
196
197      default:
198         logerror("%08x slavecpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs);
199
200   }
201
202   return 0x0000;
203}
204
205WRITE32_MEMBER(astrafr_state::astrafr_slave_mem_w)
206{
207   int pc = cpu_get_pc(&space.device());
208   int address = offset * 4;
209   int cs = m68340_get_cs(m_slavecpu, address);
210
211
212   switch ( cs )
213   {
214      case 0: // some sets end up writng the FGPA data with CS0, I guess the CS logic is wrong??
215      case 3:
216         address &= 0xfffff;
217
218         if (mem_mask&0xff000000) astra_fgpa_slave_w(space, address+0, data >> 24);
219         if (mem_mask&0x00ff0000) astra_fgpa_slave_w(space, address+1, data >> 16);
220         if (mem_mask&0x0000ff00) astra_fgpa_slave_w(space, address+2, data >> 8);
221         if (mem_mask&0x000000ff) astra_fgpa_slave_w(space, address+3, data >> 0);
222         break;
223
224      case 2:
225         offset &= 0x3fff;
226         COMBINE_DATA(&m_slaveram[offset]);
227         break;
228
229      default:
230         logerror("%08x slavecpu write access offset %08x data %08x mem_mask %08x cs %d\n", pc, address, data, mem_mask, cs);
231
232   }
233}
234
235
236
98237static ADDRESS_MAP_START( astrafr_master_map, AS_PROGRAM, 32, astrafr_state )
99   AM_RANGE(0x000000, 0x1fffff) AM_ROM
100   AM_RANGE(0x800000, 0x8000ff) AM_READWRITE8(astra_fgpa_r, astra_fgpa_w, 0xffffffff)
101   AM_RANGE(0x400000, 0x40ffff) AM_RAM // as_partyd set
238   AM_RANGE(0x000000, 0xffffffff) AM_READWRITE(astrafr_mem_r, astrafr_mem_w)
102239ADDRESS_MAP_END
103240
104// probably identical, afaik they're linked units..
105static ADDRESS_MAP_START( astrafr_slave_map, AS_PROGRAM, 32, astrafr_state )
106   AM_RANGE(0x000000, 0x1fffff) AM_ROM
107   AM_RANGE(0x800000, 0x8000ff) AM_READWRITE8(astra_fgpa_slave_r, astra_fgpa_slave_w, 0xffffffff)
108   AM_RANGE(0x400000, 0x40ffff) AM_RAM // as_partyd set
109ADDRESS_MAP_END
110241
111
112242static ADDRESS_MAP_START( astrafr_master_alt_map, AS_PROGRAM, 32, astrafr_state )
113   AM_RANGE(0x0000000, 0x01fffff) AM_ROM
114   AM_RANGE(0x1000000, 0x1009fff) AM_RAM // ?
115   AM_RANGE(0x2000000, 0x20000ff) AM_READWRITE8(astra_fgpa_r, astra_fgpa_w, 0xffffffff)
243   AM_RANGE(0x000000, 0xffffffff) AM_READWRITE(astrafr_mem_r, astrafr_mem_w)
116244ADDRESS_MAP_END
117245
118
119
120
121246static ADDRESS_MAP_START( astra_map, AS_PROGRAM, 32, astrafr_state )
122   AM_RANGE(0x000000, 0x1fffff) AM_ROM
123   AM_RANGE(0x800000, 0x8000ff) AM_READWRITE8(astra_fgpa_r, astra_fgpa_w, 0xffffffff)
124   AM_RANGE(0x400000, 0x40ffff) AM_RAM // as_partyd set
247   AM_RANGE(0x000000, 0xffffffff) AM_READWRITE(astrafr_mem_r, astrafr_mem_w)
125248ADDRESS_MAP_END
126249
127static ADDRESS_MAP_START( astra_alt_map, AS_PROGRAM, 32, astrafr_state )
128   AM_RANGE(0x0000000, 0x01fffff) AM_ROM
129   AM_RANGE(0x1000000, 0x1009fff) AM_RAM // ?
130   AM_RANGE(0x2000000, 0x20000ff) AM_READWRITE8(astra_fgpa_r, astra_fgpa_w, 0xffffffff)
250// probably identical, afaik they're linked units..
251static ADDRESS_MAP_START( astrafr_slave_map, AS_PROGRAM, 32, astrafr_state )
252   AM_RANGE(0x000000, 0xffffffff) AM_READWRITE(astrafr_slave_mem_r, astrafr_slave_mem_w)
131253ADDRESS_MAP_END
132254
255
133256static INPUT_PORTS_START( astrafr )
134257INPUT_PORTS_END
135258
259static MACHINE_START( astra_common )
260{
261   astrafr_state *state = machine.driver_data<astrafr_state>();
262
263   state->m_cpuregion = (UINT32*)state->memregion( "maincpu" )->base();
264   state->m_cpuregion_size = state->memregion( "maincpu" )->bytes()/4;
265   state->m_mainram = (UINT32*)auto_alloc_array_clear(machine, UINT32, 0x10000);
266
267   state->m_slavecpuregion = (UINT32*)state->memregion( "slavecpu" )->base();
268   state->m_slavecpuregion_size = state->memregion( "slavecpu" )->bytes()/4;
269   state->m_slaveram = (UINT32*)auto_alloc_array_clear(machine, UINT32, 0x10000);
270
271
272}
273
136274/* the FPGA area read/write addresses move around ... */
137275static MACHINE_START( astra_37 )
138276{
r15082r15083
140278   state->fgpa_after_rom_write_addr = 0x30;
141279   state->fgpa_first_read_addr = 0x33;
142280   state->fgpa_rom_write_addr = 0x37;
281   MACHINE_START_CALL(astra_common);
143282}
144283
145284static MACHINE_START( astra_2e )
r15082r15083
148287   state->fgpa_after_rom_write_addr = 0x20;
149288   state->fgpa_first_read_addr = 0x23;
150289   state->fgpa_rom_write_addr = 0x2e;
290   MACHINE_START_CALL(astra_common);
151291}
152292
153293
r15082r15083
157297
158298   MCFG_CPU_ADD("slavecpu", M68340, 16000000)
159299   MCFG_CPU_PROGRAM_MAP(astrafr_slave_map)
300
301   MCFG_MACHINE_START( astra_common )
160302MACHINE_CONFIG_END
161303
162304static MACHINE_CONFIG_DERIVED( astrafr_dual_2e, astrafr_dual )
r15082r15083
184326static MACHINE_CONFIG_START( astra_single, astrafr_state )
185327   MCFG_CPU_ADD("maincpu", M68340, 16000000)
186328   MCFG_CPU_PROGRAM_MAP(astra_map)
329   MCFG_MACHINE_START( astra_common )
187330MACHINE_CONFIG_END
188331
189332static MACHINE_CONFIG_DERIVED( astra_single_37, astra_single )
r15082r15083
200343//  state->fgpa_after_rom_write_addr = 0x20;
201344//  state->fgpa_first_read_addr = 0x23;
202345   state->fgpa_rom_write_addr = 0x57;
346   MACHINE_START_CALL(astra_common);
203347}
204348
205349
206350static MACHINE_CONFIG_START( astra_single_alt, astrafr_state )
207351   MCFG_CPU_ADD("maincpu", M68340, 16000000)
208   MCFG_CPU_PROGRAM_MAP(astra_alt_map)
352   MCFG_CPU_PROGRAM_MAP(astra_map)
353   MCFG_MACHINE_START( astra_common )
209354MACHINE_CONFIG_END
210355
211356static MACHINE_CONFIG_DERIVED( astra_single_alt_57, astra_single_alt )
r15082r15083
21692314GAME( 200?, as_tblf,  as_tbl        , astra_single,    astrafr,    0,    ROT0,  "Astra", "Triple Bells (Astra, V301)"      , GAME_IS_SKELETON_MECHANICAL)
21702315GAME( 200?, as_td,   0       , astra_single_2e,    astrafr,    astradec,   ROT0,  "Astra", "Twin Dragons (Astra, V103)"      , GAME_IS_SKELETON_MECHANICAL)
21712316
2172GAME( 200?, as_twp,   0          , astra_single,    astrafr,    0,    ROT0,  "Astra", "Twin Pots (Astra, V106)"      , GAME_IS_SKELETON_MECHANICAL)
2317GAME( 200?, as_twp,   0          , astra_single_2e,    astrafr,    0,    ROT0,  "Astra", "Twin Pots (Astra, V106)"      , GAME_IS_SKELETON_MECHANICAL)
21732318GAME( 200?, as_twpa,  as_twp      , astra_single,    astrafr,    0,    ROT0,  "Astra", "Twin Pots (Astra, V104)"      , GAME_IS_SKELETON_MECHANICAL)
21742319GAME( 200?, as_vn,    0        , astrafr_dual_alt_37,    astrafr,    astradec_dual,   ROT0,  "Astra", "Vegas Nights (Astra, V205)"      , GAME_IS_SKELETON_MECHANICAL)
21752320GAME( 200?, as_vcv,    0        , astra_single,    astrafr,    astradec,   ROT0,  "Astra", "Viva Cash Vegas (Astra, V005)"      , GAME_IS_SKELETON_MECHANICAL)
src/mame/drivers/system1.c
r15082r15083
356356static MACHINE_START( system1 )
357357{
358358   system1_state *state = machine.driver_data<system1_state>();
359   UINT32 numbanks = (machine.root_device().memregion("maincpu")->bytes() - 0x10000) / 0x4000;
359   UINT32 numbanks = (state->memregion("maincpu")->bytes() - 0x10000) / 0x4000;
360360
361361   if (numbanks > 0)
362      state->membank("bank1")->configure_entries(0, numbanks, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
362      state->membank("bank1")->configure_entries(0, numbanks, state->memregion("maincpu")->base() + 0x10000, 0x4000);
363363   else
364364      state->membank("bank1")->configure_entry(0, state->memregion("maincpu")->base() + 0x8000);
365365   state->membank("bank1")->set_entry(0);
r15082r15083
442442CUSTOM_INPUT_MEMBER(system1_state::dakkochn_mux_data_r)
443443{
444444   static const char *const ports[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6" };
445   return input_port_read(machine(), ports[m_dakkochn_mux_data]);
445   return ioport(ports[m_dakkochn_mux_data])->read();
446446}
447447
448448
src/mame/drivers/niyanpai.c
r15082r15083
1414    Mahjong Housoukyoku Honbanchuu
1515    (c)199? Nihon Bussan Co.,Ltd.
1616
17    Zoku Mahjong Housoukyoku Honbanchuu
18    (c)199? Nihon Bussan Co.,Ltd.
19
1720    Driver by Takahiro Nogi <nogi@kt.rim.or.jp> 2000/12/23 -
1821
1922******************************************************************************/
r15082r15083
4548#include "includes/niyanpai.h"
4649
4750
48#define SIGNED_DAC   0      // 0:unsigned DAC, 1:signed DAC
49#if SIGNED_DAC
50#define DAC_WRITE   dac_signed_w
51#else
52#define DAC_WRITE   dac_w
53#endif
54
55
5651static void niyanpai_soundbank_w(running_machine &machine, int data)
5752{
5853   UINT8 *SNDROM = machine.root_device().memregion("audiocpu")->base();
r15082r15083
117112         niyanpai_soundbank_w(machine(), data & 0x03);
118113         break;
119114      case 1:         /* PB_0 */
120         DAC_WRITE(machine().device("dac2"), 0, data);
115         dac_w(machine().device("dac1"), 0, data);
121116         break;
122117      case 2:         /* PC_0 */
123         DAC_WRITE(machine().device("dac1"), 0, data);
118         dac_w(machine().device("dac2"), 0, data);
124119         break;
125120      case 3:         /* PD_0 */
126121         break;
r15082r15083
283278{
284279   UINT8 dipsw_a, dipsw_b;
285280
286   dipsw_a = (((input_port_read(machine(), "DSWA") & 0x01) << 7) | ((input_port_read(machine(), "DSWA") & 0x02) << 5) |
287            ((input_port_read(machine(), "DSWA") & 0x04) << 3) | ((input_port_read(machine(), "DSWA") & 0x08) << 1) |
288            ((input_port_read(machine(), "DSWA") & 0x10) >> 1) | ((input_port_read(machine(), "DSWA") & 0x20) >> 3) |
289            ((input_port_read(machine(), "DSWA") & 0x40) >> 5) | ((input_port_read(machine(), "DSWA") & 0x80) >> 7));
281   dipsw_a = (((ioport("DSWA")->read() & 0x01) << 7) | ((ioport("DSWA")->read() & 0x02) << 5) |
282            ((ioport("DSWA")->read() & 0x04) << 3) | ((ioport("DSWA")->read() & 0x08) << 1) |
283            ((ioport("DSWA")->read() & 0x10) >> 1) | ((ioport("DSWA")->read() & 0x20) >> 3) |
284            ((ioport("DSWA")->read() & 0x40) >> 5) | ((ioport("DSWA")->read() & 0x80) >> 7));
290285
291   dipsw_b = (((input_port_read(machine(), "DSWB") & 0x01) << 7) | ((input_port_read(machine(), "DSWB") & 0x02) << 5) |
292            ((input_port_read(machine(), "DSWB") & 0x04) << 3) | ((input_port_read(machine(), "DSWB") & 0x08) << 1) |
293            ((input_port_read(machine(), "DSWB") & 0x10) >> 1) | ((input_port_read(machine(), "DSWB") & 0x20) >> 3) |
294            ((input_port_read(machine(), "DSWB") & 0x40) >> 5) | ((input_port_read(machine(), "DSWB") & 0x80) >> 7));
286   dipsw_b = (((ioport("DSWB")->read() & 0x01) << 7) | ((ioport("DSWB")->read() & 0x02) << 5) |
287            ((ioport("DSWB")->read() & 0x04) << 3) | ((ioport("DSWB")->read() & 0x08) << 1) |
288            ((ioport("DSWB")->read() & 0x10) >> 1) | ((ioport("DSWB")->read() & 0x20) >> 3) |
289            ((ioport("DSWB")->read() & 0x40) >> 5) | ((ioport("DSWB")->read() & 0x80) >> 7));
295290
296291   return ((dipsw_a << 8) | dipsw_b);
297292}
r15082r15083
302297
303298   switch ((m_musobana_inputport ^ 0xff00) >> 8)
304299   {
305      case 0x01:   portdata = input_port_read(machine(), "KEY0"); break;
306      case 0x02:   portdata = input_port_read(machine(), "KEY1"); break;
307      case 0x04:   portdata = input_port_read(machine(), "KEY2"); break;
308      case 0x08:   portdata = input_port_read(machine(), "KEY3"); break;
309      case 0x10:   portdata = input_port_read(machine(), "KEY4"); break;
310      default:   portdata = input_port_read(machine(), "KEY0") & input_port_read(machine(), "KEY1") & input_port_read(machine(), "KEY2")
311                        & input_port_read(machine(), "KEY3") & input_port_read(machine(), "KEY4"); break;
300      case 0x01:   portdata = ioport("KEY0")->read(); break;
301      case 0x02:   portdata = ioport("KEY1")->read(); break;
302      case 0x04:   portdata = ioport("KEY2")->read(); break;
303      case 0x08:   portdata = ioport("KEY3")->read(); break;
304      case 0x10:   portdata = ioport("KEY4")->read(); break;
305      default:   portdata = ioport("KEY0")->read() & ioport("KEY1")->read() & ioport("KEY2")->read()
306                        & ioport("KEY3")->read() & ioport("KEY4")->read(); break;
312307   }
313308
314309   return (portdata);
r15082r15083
454449   AM_IMPORT_FROM( tmp68301_regs )
455450ADDRESS_MAP_END
456451
452static ADDRESS_MAP_START( zokumahj_map, AS_PROGRAM, 16, niyanpai_state )
453   AM_RANGE(0x000000, 0x03ffff) AM_ROM
454   AM_RANGE(0x0ff000, 0x0fffff) AM_RAM
457455
456   AM_RANGE(0x0e0000, 0x0e08ff) AM_READWRITE(niyanpai_palette_r,niyanpai_palette_w)
457   AM_RANGE(0x0e0900, 0x0e11ff) AM_RAM            // palette work ram?
458
459   AM_RANGE(0x0a8000, 0x0a87ff) AM_RAM AM_SHARE("nvram")
460   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM
461
462   AM_RANGE(0x200000, 0x200001) AM_WRITE(niyanpai_sound_w)
463
464   AM_RANGE(0x200200, 0x200201) AM_WRITE(musobana_inputport_w)   // inputport select
465   AM_RANGE(0x240000, 0x240009) AM_WRITENOP         // unknown
466   AM_RANGE(0x240200, 0x2403ff) AM_WRITENOP         // unknown
467
468   AM_RANGE(0x240400, 0x240403) AM_READ(niyanpai_blitter_0_r)
469   AM_RANGE(0x240400, 0x24041f) AM_WRITE(niyanpai_blitter_0_w)
470   AM_RANGE(0x240420, 0x24043f) AM_WRITE(niyanpai_clut_0_w)
471
472   AM_RANGE(0x240600, 0x240603) AM_READ(niyanpai_blitter_1_r)
473   AM_RANGE(0x240600, 0x24061f) AM_WRITE(niyanpai_blitter_1_w)
474   AM_RANGE(0x240620, 0x24063f) AM_WRITE(niyanpai_clut_1_w)
475
476   AM_RANGE(0x240800, 0x240803) AM_READ(niyanpai_blitter_2_r)
477   AM_RANGE(0x240800, 0x24081f) AM_WRITE(niyanpai_blitter_2_w)
478   AM_RANGE(0x240820, 0x24083f) AM_WRITE(niyanpai_clut_2_w)
479
480   AM_RANGE(0x240a00, 0x240a01) AM_WRITE(niyanpai_clutsel_0_w)
481   AM_RANGE(0x240c00, 0x240c01) AM_WRITE(niyanpai_clutsel_1_w)
482   AM_RANGE(0x240e00, 0x240e01) AM_WRITE(niyanpai_clutsel_2_w)
483
484   AM_RANGE(0x280000, 0x280001) AM_READ(niyanpai_dipsw_r)
485   AM_RANGE(0x280200, 0x280201) AM_READ(musobana_inputport_0_r)
486   AM_RANGE(0x280400, 0x280401) AM_READ_PORT("SYSTEM")
487
488   AM_IMPORT_FROM( tmp68301_regs )
489ADDRESS_MAP_END
490
491
458492static ADDRESS_MAP_START( niyanpai_sound_map, AS_PROGRAM, 8, niyanpai_state )
459493   AM_RANGE(0x0000, 0x77ff) AM_ROM
460494   AM_RANGE(0x7800, 0x7fff) AM_RAM
r15082r15083
774808   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
775809   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
776810   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coinage ) )
777   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
778811   PORT_DIPSETTING(    0x08, DEF_STR( 1C_1C ) )
812   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
779813   PORT_DIPNAME( 0x10, 0x00, "DIPSW 1-5" )
780814   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
781815   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r15082r15083
828862   PORT_INCLUDE( nbmjctrl_16 )
829863INPUT_PORTS_END
830864
865static INPUT_PORTS_START( zokumahj )   // I don't have manual for this game.
866   PORT_START("DSWA")
867   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
868   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
869   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
870   PORT_DIPNAME( 0x02, 0x02, "DIPSW 1-2" )
871   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
872   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
873   PORT_DIPNAME( 0x04, 0x04, "DIPSW 1-3" )
874   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
875   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
876   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coinage ) )
877   PORT_DIPSETTING(    0x08, DEF_STR( 1C_1C ) )
878   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
879   PORT_DIPNAME( 0x10, 0x10, "DIPSW 1-5" )
880   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
881   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
882   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Flip_Screen ) )
883   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
884   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
885   PORT_DIPNAME( 0x40, 0x40, "DIPSW 1-7" )
886   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
887   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
888   PORT_DIPNAME( 0x80, 0x80, "DIPSW 1-8" )
889   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
890   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
831891
892   PORT_START("DSWB")
893   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
894   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
895   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
896   PORT_DIPNAME( 0x02, 0x02, "DIPSW 2-2" )
897   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
898   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
899   PORT_DIPNAME( 0x04, 0x04, "DIPSW 2-3" )
900   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
901   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
902   PORT_DIPNAME( 0x08, 0x08, "DIPSW 2-4" )
903   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
904   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
905   PORT_DIPNAME( 0x10, 0x10, "DIPSW 2-5" )
906   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
907   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
908   PORT_DIPNAME( 0x20, 0x20, "DIPSW 2-6" )
909   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
910   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
911   PORT_DIPNAME( 0x40, 0x40, "DIPSW 2-7" )
912   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
913   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
914   PORT_DIPNAME( 0x80, 0x80, "Option Test" )
915   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
916   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
917
918   PORT_START("SYSTEM")
919   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
920   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
921   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 )         // CREDIT CLEAR
922   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE3 )         // MEMORY RESET
923   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 )         // ANALYZER
924   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, niyanpai_state,musobana_outcoin_flag_r, NULL)   // OUT COIN
925   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
926   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )               // TEST
927
928   PORT_INCLUDE( nbmjctrl_16 )
929INPUT_PORTS_END
930
931
832932static INTERRUPT_GEN( niyanpai_interrupt )
833933{
834934   device_set_input_line_and_vector(device, 1, HOLD_LINE,0x100/4);
r15082r15083
866966   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 240-1)
867967   MCFG_SCREEN_UPDATE_STATIC(niyanpai)
868968
869   MCFG_PALETTE_LENGTH(768)
969   MCFG_PALETTE_LENGTH(256*3)
870970
871971   MCFG_VIDEO_START(niyanpai)
872972
r15082r15083
874974   MCFG_SPEAKER_STANDARD_MONO("mono")
875975
876976   MCFG_SOUND_ADD("ymsnd", YM3812, 4000000)
877   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
977   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
878978
879979   MCFG_SOUND_ADD("dac1", DAC, 0)
880   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
980   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
881981
882982   MCFG_SOUND_ADD("dac2", DAC, 0)
883983   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
r15082r15083
897997   MCFG_CPU_PROGRAM_MAP(mhhonban_map)
898998MACHINE_CONFIG_END
899999
1000static MACHINE_CONFIG_DERIVED( zokumahj, niyanpai )
9001001
1002   /* basic machine hardware */
1003   MCFG_CPU_MODIFY("maincpu")
1004   MCFG_CPU_PROGRAM_MAP(zokumahj_map)
1005MACHINE_CONFIG_END
1006
1007
9011008ROM_START( niyanpai )
9021009   ROM_REGION( 0x40000, "maincpu", 0 ) /* TMP68301 main program */
9031010   ROM_LOAD16_BYTE( "npai_01.bin", 0x00000, 0x20000, CRC(a904e8a1) SHA1(77865d7b48cac96af1e3cac4a702f7de4b5ee82b) )
r15082r15083
9741081   ROM_LOAD( "u107.bin",  0x280000, 0x80000, CRC(efc85912) SHA1(b9d523fd5f9ce879e2ed6916c89940be1d738a1c) )
9751082ROM_END
9761083
1084ROM_START( zokumahj )
1085   ROM_REGION( 0x40000, "maincpu", 0 ) /* TMP68301 main program */
1086   ROM_LOAD16_BYTE( "1.bin", 0x00000, 0x20000, CRC(53ca34a9) SHA1(5a1e2660442665efd529ec6c98ffc994c6103419) )
1087   ROM_LOAD16_BYTE( "2.bin", 0x00001, 0x20000, CRC(474f9303) SHA1(4b03e3b6b6ee864dfcce3978f19bf329e39b3fe7) )
9771088
978GAME( 1996, niyanpai, 0, niyanpai, niyanpai, niyanpai, ROT0, "Nichibutsu", "Niyanpai (Japan)", 0 )
979GAME( 1995, musobana, 0, musobana, musobana, niyanpai, ROT0, "Nichibutsu / Yubis", "Musoubana (Japan)", 0 )
980GAME( 1994, 4psimasy, 0, musobana, 4psimasy, niyanpai, ROT0, "Sphinx / AV Japan", "Mahjong 4P Simasyo (Japan)", 0 )
981GAME( 199?, mhhonban, 0, mhhonban, mhhonban, niyanpai, ROT0, "Nichibutsu?", "Mahjong Housoukyoku Honbanchuu (Japan)", 0 )
1089   ROM_REGION( 0x20000, "audiocpu", 0 ) /* TMPZ84C011 sound program */
1090   ROM_LOAD( "3.bin",  0x000000, 0x20000, CRC(48407507) SHA1(afd24d16d487fd2b6548d967e2f1ae122e2633a2) )
1091
1092   ROM_REGION( 0x300000, "gfx1", 0 ) /* gfx */
1093   ROM_LOAD( "4.bin",  0x000000, 0x80000, CRC(2b3e88b4) SHA1(d49a81f1bc6ac5b56df36caf7ee7188a917d947f) )
1094   ROM_LOAD( "5.bin",  0x080000, 0x80000, CRC(cfe9477a) SHA1(9d08f5b1d638cef7d8dc97bdd9d98627f9af1ef9) )
1095   ROM_LOAD( "6.bin",  0x100000, 0x80000, CRC(2d62df76) SHA1(83fe8e0a853c0137e7c77ecde762617c082774e5) )
1096   ROM_LOAD( "7.bin",  0x180000, 0x80000, CRC(75922e76) SHA1(4ad23e241a1a223e0fcd4fd26bd695b1a68c258a) )
1097   ROM_LOAD( "8.bin",  0x200000, 0x80000, CRC(22b3befa) SHA1(e44635e021962ce29b4e129ae394c794038aef39) )
1098   ROM_LOAD( "9.bin",  0x280000, 0x80000, CRC(f72d83af) SHA1(4b897b40765084fd9483065fd0eb0e29cbcfa5ac) )
1099ROM_END
1100
1101
1102GAME( 1996, niyanpai, 0,        niyanpai, niyanpai, niyanpai, ROT0, "Nichibutsu", "Niyanpai (Japan)", 0 )
1103GAME( 1995, musobana, 0,        musobana, musobana, niyanpai, ROT0, "Nichibutsu / Yubis", "Musoubana (Japan)", 0 )
1104GAME( 1994, 4psimasy, 0,        musobana, 4psimasy, niyanpai, ROT0, "Sphinx / AV Japan", "Mahjong 4P Simasyo (Japan)", 0 )
1105GAME( 199?, mhhonban, 0,        mhhonban, mhhonban, niyanpai, ROT0, "Nichibutsu?", "Mahjong Housoukyoku Honbanchuu (Japan)", 0 )
1106GAME( 199?, zokumahj, mhhonban, zokumahj, zokumahj, niyanpai, ROT0, "Nichibutsu?", "Zoku Mahjong Housoukyoku (Japan)", 0 )
src/mame/drivers/bfm_sc2.c
r15082r15083
630630      t1 = m_input_override[offset];   // strobe 0-7 data 0-4
631631      t2 = m_input_override[offset+idx];   // strobe 8-B data 0-4
632632
633      t1 = (m_sc2_Inputs[offset]   & t1) | ( ( input_port_read(machine(), port[offset])   & ~t1) & 0x1F);
633      t1 = (m_sc2_Inputs[offset]   & t1) | ( ( ioport(port[offset])->read()   & ~t1) & 0x1F);
634634      if (idx == 8)
635         t2 = (m_sc2_Inputs[offset+8] & t2) | ( ( input_port_read(machine(), port[offset+8]) & ~t2) << 5);
635         t2 = (m_sc2_Inputs[offset+8] & t2) | ( ( ioport(port[offset+8])->read() & ~t2) << 5);
636636      else
637         t2 =  (m_sc2_Inputs[offset+4] & t2) | ( ( ( input_port_read(machine(), port[offset+4]) & ~t2) << 2) & 0x60);
637         t2 =  (m_sc2_Inputs[offset+4] & t2) | ( ( ( ioport(port[offset+4])->read() & ~t2) << 2) & 0x60);
638638
639639      m_sc2_Inputs[offset]   = (m_sc2_Inputs[offset]   & ~0x1F) | t1;
640640      m_sc2_Inputs[offset+idx] = (m_sc2_Inputs[offset+idx] & ~0x60) | t2;
r15082r15083
857857
858858READ8_MEMBER(bfm_sc2_state::coin_input_r)
859859{
860   return input_port_read(machine(), "COINS");
860   return ioport("COINS")->read();
861861}
862862
863863///////////////////////////////////////////////////////////////////////////
r15082r15083
16961696
16971697   PORT_MODIFY("STROBE11")
16981698   PORT_DIPNAME( 0x01, 0x00, "Credits required:" )PORT_DIPLOCATION("DIL:!12")
1699   PORT_DIPSETTING(    0x00, "4 credits per game")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x00)
1700   PORT_DIPSETTING(    0x01, "2 credits per game")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x00)
1701   PORT_DIPSETTING(    0x00, "1 credit  per round")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x10)
1702   PORT_DIPSETTING(    0x01, "4 credits per round")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x10)
1699   PORT_DIPSETTING(    0x00, "4 credits per game")PORT_CONDITION("STROBE10",0x10,EQUALS,0x00)
1700   PORT_DIPSETTING(    0x01, "2 credits per game")PORT_CONDITION("STROBE10",0x10,EQUALS,0x00)
1701   PORT_DIPSETTING(    0x00, "1 credit  per round")PORT_CONDITION("STROBE10",0x10,EQUALS,0x10)
1702   PORT_DIPSETTING(    0x01, "4 credits per round")PORT_CONDITION("STROBE10",0x10,EQUALS,0x10)
17031703   PORT_DIPNAME( 0x02, 0x00, "Attract Mode" )PORT_DIPLOCATION("DIL:!13")
17041704   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
17051705   PORT_DIPSETTING(    0x00, DEF_STR( On  ) )
src/mame/drivers/tmmjprd.c
r15082r15083
515515READ32_MEMBER(tmmjprd_state::tmmjprd_mux_r)
516516{
517517
518   m_system_in = input_port_read(machine(), "SYSTEM");
518   m_system_in = ioport("SYSTEM")->read();
519519
520520   switch(m_mux_data)
521521   {
522      case 0x01: return (m_system_in & 0xff) | (input_port_read(machine(), "PL1_1")<<8) | (input_port_read(machine(), "PL2_1")<<16) | 0xff000000;
523      case 0x02: return (m_system_in & 0xff) | (input_port_read(machine(), "PL1_2")<<8) | (input_port_read(machine(), "PL2_2")<<16) | 0xff000000;
524      case 0x04: return (m_system_in & 0xff) | (input_port_read(machine(), "PL1_3")<<8) | (input_port_read(machine(), "PL2_3")<<16) | 0xff000000;
525      case 0x08: return (m_system_in & 0xff) | (input_port_read(machine(), "PL1_4")<<8) | (input_port_read(machine(), "PL2_4")<<16) | 0xff000000;
526      case 0x10: return (m_system_in & 0xff) | (input_port_read(machine(), "PL1_5")<<8) | (input_port_read(machine(), "PL2_5")<<16) | 0xff000000;
522      case 0x01: return (m_system_in & 0xff) | (ioport("PL1_1")->read()<<8) | (ioport("PL2_1")->read()<<16) | 0xff000000;
523      case 0x02: return (m_system_in & 0xff) | (ioport("PL1_2")->read()<<8) | (ioport("PL2_2")->read()<<16) | 0xff000000;
524      case 0x04: return (m_system_in & 0xff) | (ioport("PL1_3")->read()<<8) | (ioport("PL2_3")->read()<<16) | 0xff000000;
525      case 0x08: return (m_system_in & 0xff) | (ioport("PL1_4")->read()<<8) | (ioport("PL2_4")->read()<<16) | 0xff000000;
526      case 0x10: return (m_system_in & 0xff) | (ioport("PL1_5")->read()<<8) | (ioport("PL2_5")->read()<<16) | 0xff000000;
527527   }
528528
529529   return (m_system_in & 0xff) | 0xffffff00;
src/mame/drivers/suprnova.c
r15082r15083
458458CUSTOM_INPUT_MEMBER(skns_state::paddle_r)
459459{
460460   const char *tag = (const char *)param;
461   return input_port_read(machine(), tag);
461   return ioport(tag)->read();
462462}
463463
464464static INPUT_PORTS_START( skns )      /* 3 buttons, 2 players */
src/mame/drivers/witch.c
r15082r15083
345345   switch(offset)
346346   {
347347      case 0x02: return m_reg_a002;
348      case 0x04: return input_port_read(machine(), "A004");
349      case 0x05: return input_port_read(machine(), "A005");
350      case 0x0c: return input_port_read(machine(), "SERVICE");   // stats / reset
351      case 0x0e: return input_port_read(machine(), "A00E");      // coin/reset
348      case 0x04: return ioport("A004")->read();
349      case 0x05: return ioport("A005")->read();
350      case 0x0c: return ioport("SERVICE")->read();   // stats / reset
351      case 0x0e: return ioport("A00E")->read();      // coin/reset
352352   }
353353
354354   if(offset == 0x00) //muxed with A002?
r15082r15083
356356      switch(m_reg_a002 & 0x3f)
357357      {
358358      case 0x3b:
359         return input_port_read(machine(), "UNK");   //bet10 / pay out
359         return ioport("UNK")->read();   //bet10 / pay out
360360      case 0x3e:
361         return input_port_read(machine(), "INPUTS");   //TODO : trace f564
361         return ioport("INPUTS")->read();   //TODO : trace f564
362362      case 0x3d:
363         return input_port_read(machine(), "A005");
363         return ioport("A005")->read();
364364      default:
365365         logerror("A000 read with mux=0x%02x\n", m_reg_a002 & 0x3f);
366366      }
src/mame/drivers/namcofl.c
r15082r15083
282282   switch (m_mcu_port6 & 0xf0)
283283   {
284284      case 0x00:
285         return input_port_read(machine(), "IN0");
285         return ioport("IN0")->read();
286286
287287      case 0x20:
288         return input_port_read(machine(), "MISC");
288         return ioport("MISC")->read();
289289
290290      case 0x40:
291         return input_port_read(machine(), "IN1");
291         return ioport("IN1")->read();
292292
293293      case 0x60:
294         return input_port_read(machine(), "IN2");
294         return ioport("IN2")->read();
295295
296296      default:
297297         break;
r15082r15083
302302
303303READ8_MEMBER(namcofl_state::dac7_r)
304304{
305   return input_port_read_safe(machine(), "ACCEL", 0xff);
305   return ioport("ACCEL")->read_safe(0xff);
306306}
307307
308308READ8_MEMBER(namcofl_state::dac6_r)
309309{
310   return input_port_read_safe(machine(), "BRAKE", 0xff);
310   return ioport("BRAKE")->read_safe(0xff);
311311}
312312
313313READ8_MEMBER(namcofl_state::dac5_r)
314314{
315   return input_port_read_safe(machine(), "WHEEL", 0xff);
315   return ioport("WHEEL")->read_safe(0xff);
316316}
317317
318318READ8_MEMBER(namcofl_state::dac4_r){ return 0xff; }
src/mame/drivers/dynax.c
r15082r15083
235235   int res = 0x3f;
236236
237237   /* the game reads all rows at once (keyb = 0) to check if a key is pressed */
238   if (!BIT(m_keyb, 0)) res &= input_port_read(machine(), "KEY0");
239   if (!BIT(m_keyb, 1)) res &= input_port_read(machine(), "KEY1");
240   if (!BIT(m_keyb, 2)) res &= input_port_read(machine(), "KEY2");
241   if (!BIT(m_keyb, 3)) res &= input_port_read(machine(), "KEY3");
242   if (!BIT(m_keyb, 4)) res &= input_port_read(machine(), "KEY4");
238   if (!BIT(m_keyb, 0)) res &= ioport("KEY0")->read();
239   if (!BIT(m_keyb, 1)) res &= ioport("KEY1")->read();
240   if (!BIT(m_keyb, 2)) res &= ioport("KEY2")->read();
241   if (!BIT(m_keyb, 3)) res &= ioport("KEY3")->read();
242   if (!BIT(m_keyb, 4)) res &= ioport("KEY4")->read();
243243
244244   return res;
245245}
r15082r15083
249249   int res = 0x3f;
250250
251251   /* the game reads all rows at once (keyb = 0) to check if a key is pressed */
252   if (!BIT(m_keyb, 0)) res &= input_port_read(machine(), "KEY5");
253   if (!BIT(m_keyb, 1)) res &= input_port_read(machine(), "KEY6");
254   if (!BIT(m_keyb, 2)) res &= input_port_read(machine(), "KEY7");
255   if (!BIT(m_keyb, 3)) res &= input_port_read(machine(), "KEY8");
256   if (!BIT(m_keyb, 4)) res &= input_port_read(machine(), "KEY9");
252   if (!BIT(m_keyb, 0)) res &= ioport("KEY5")->read();
253   if (!BIT(m_keyb, 1)) res &= ioport("KEY6")->read();
254   if (!BIT(m_keyb, 2)) res &= ioport("KEY7")->read();
255   if (!BIT(m_keyb, 3)) res &= ioport("KEY8")->read();
256   if (!BIT(m_keyb, 4)) res &= ioport("KEY9")->read();
257257
258258   return res;
259259}
r15082r15083
621621
622622READ8_MEMBER(dynax_state::hjingi_keyboard_1_r)
623623{
624   return hanamai_keyboard_1_r(space, 0) | input_port_read(machine(), "BET");
624   return hanamai_keyboard_1_r(space, 0) | ioport("BET")->read();
625625}
626626
627627static ADDRESS_MAP_START( hjingi_mem_map, AS_PROGRAM, 8, dynax_state )
r15082r15083
715715         switch (m_input_sel)
716716         {
717717         case 0x00:
718            return input_port_read(machine(), "COINS");   // coins
718            return ioport("COINS")->read();   // coins
719719
720720         case 0x02:
721721            return 0xff;   // bit 7 must be 1. Bit 2?
r15082r15083
732732         // player 2
733733         case 0x01:   //quiztvqq
734734         case 0x81:
735            return input_port_read(machine(), keynames1[m_keyb++]);
735            return ioport(keynames1[m_keyb++])->read();
736736
737737         // player 1
738738         case 0x02:   //quiztvqq
739739         case 0x82:
740            return input_port_read(machine(), keynames0[m_keyb++]);
740            return ioport(keynames0[m_keyb++])->read();
741741
742742         default:
743743            return 0xff;
r15082r15083
10501050
10511051READ8_MEMBER(dynax_state::mjelctrn_keyboard_1_r)
10521052{
1053   return (hanamai_keyboard_1_r(space, 0) & 0x3f) | (input_port_read(machine(), "FAKE") ? 0x40 : 0);
1053   return (hanamai_keyboard_1_r(space, 0) & 0x3f) | (ioport("FAKE")->read() ? 0x40 : 0);
10541054}
10551055
10561056READ8_MEMBER(dynax_state::mjelctrn_dsw_r)
r15082r15083
10581058   int dsw = (m_keyb & 0xc0) >> 6;
10591059   static const char *const dswnames[] = { "DSW0", "DSW1", "DSW3", "DSW4" };
10601060
1061   return input_port_read(machine(), dswnames[dsw]);
1061   return ioport(dswnames[dsw])->read();
10621062}
10631063
10641064WRITE8_MEMBER(dynax_state::mjelctrn_blitter_ack_w)
r15082r15083
11241124static READ8_DEVICE_HANDLER( htengoku_dsw_r )
11251125{
11261126   dynax_state *state = device->machine().driver_data<dynax_state>();
1127   if (!BIT(state->m_dsw_sel, 0))   return input_port_read(device->machine(), "DSW0");
1128   if (!BIT(state->m_dsw_sel, 1))   return input_port_read(device->machine(), "DSW1");
1129   if (!BIT(state->m_dsw_sel, 2))   return input_port_read(device->machine(), "DSW2");
1130   if (!BIT(state->m_dsw_sel, 3))   return input_port_read(device->machine(), "DSW3");
1131   if (!BIT(state->m_dsw_sel, 4))   return input_port_read(device->machine(), "DSW4");
1127   if (!BIT(state->m_dsw_sel, 0))   return state->ioport("DSW0")->read();
1128   if (!BIT(state->m_dsw_sel, 1))   return state->ioport("DSW1")->read();
1129   if (!BIT(state->m_dsw_sel, 2))   return state->ioport("DSW2")->read();
1130   if (!BIT(state->m_dsw_sel, 3))   return state->ioport("DSW3")->read();
1131   if (!BIT(state->m_dsw_sel, 4))   return state->ioport("DSW4")->read();
11321132   logerror("%s: warning, unknown bits read, dsw_sel = %02x\n", device->machine().describe_context(), state->m_dsw_sel);
11331133
11341134   return 0xff;
r15082r15083
11651165
11661166   switch (m_input_sel)
11671167   {
1168      case 0x81:   return input_port_read(machine(), keynames1[m_keyb++]);
1169      case 0x82:   return input_port_read(machine(), keynames0[m_keyb++]);
1168      case 0x81:   return ioport(keynames1[m_keyb++])->read();
1169      case 0x82:   return ioport(keynames0[m_keyb++])->read();
11701170      case 0x0d:   return 0xff;   // unused
11711171   }
11721172   logerror("%04x: input_r with select = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
r15082r15083
11781178
11791179   switch (m_input_sel)
11801180   {
1181      case 0x00:   return input_port_read(machine(), "COINS");
1181      case 0x00:   return ioport("COINS")->read();
11821182      case 0x01:   return 0xff;   //?
11831183      case 0x02:   return 0xbf | ((m_hopper && !(machine().primary_screen->frame_number() % 10)) ? 0 : (1 << 6));   // bit 7 = blitter busy, bit 6 = hopper
11841184      case 0x03:   return m_coins;
r15082r15083
12901290         switch (m_input_sel)
12911291         {
12921292            case 0x00:
1293               return input_port_read(machine(), "COINS");   // coins
1293               return ioport("COINS")->read();   // coins
12941294
12951295            default:
12961296               logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(&space.device()), m_input_sel, offset);
r15082r15083
13091309            case 0x81:
13101310               if (m_keyb >= 5)
13111311                  logerror("%04x: unmapped keyb=%02x read\n", cpu_get_pc(&space.device()), m_keyb);
1312               return 0xff;//input_port_read(machine(), keynames1[m_keyb++]);
1312               return 0xff;//ioport(keynames1[m_keyb++])->read();
13131313
13141314            // player 1
13151315            case 0x82:
13161316               if (m_keyb >= 5)
13171317                  logerror("%04x: unmapped keyb=%02x read\n", cpu_get_pc(&space.device()), m_keyb);
1318               return input_port_read(machine(), keynames0[m_keyb++]);
1318               return ioport(keynames0[m_keyb++])->read();
13191319
13201320            default:
13211321               logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(&space.device()), m_input_sel, offset);
r15082r15083
13371337{
13381338   dynax_state *state = device->machine().driver_data<dynax_state>();
13391339
1340   if (!BIT(state->m_dsw_sel, 0)) return input_port_read(device->machine(), "DSW0");
1341   if (!BIT(state->m_dsw_sel, 1)) return input_port_read(device->machine(), "DSW1");
1342   if (!BIT(state->m_dsw_sel, 2)) return input_port_read(device->machine(), "DSW2");
1343   if (!BIT(state->m_dsw_sel, 3)) return input_port_read(device->machine(), "DSW3");
1344   if (!BIT(state->m_dsw_sel, 4)) return input_port_read(device->machine(), "DSW4");
1340   if (!BIT(state->m_dsw_sel, 0)) return state->ioport("DSW0")->read();
1341   if (!BIT(state->m_dsw_sel, 1)) return state->ioport("DSW1")->read();
1342   if (!BIT(state->m_dsw_sel, 2)) return state->ioport("DSW2")->read();
1343   if (!BIT(state->m_dsw_sel, 3)) return state->ioport("DSW3")->read();
1344   if (!BIT(state->m_dsw_sel, 4)) return state->ioport("DSW4")->read();
13451345   logerror("%s: unmapped dsw %02x read\n", device->machine().describe_context(), state->m_dsw_sel);
13461346
13471347   return 0xff;
r15082r15083
15331533{
15341534   int res = 0x3f;
15351535
1536   if (!BIT(m_keyb, 0)) res &= input_port_read(machine(), "KEY0");
1537   if (!BIT(m_keyb, 1)) res &= input_port_read(machine(), "KEY1");
1538   if (!BIT(m_keyb, 2)) res &= input_port_read(machine(), "KEY2");
1539   if (!BIT(m_keyb, 3)) res &= input_port_read(machine(), "KEY3");
1540   if (!BIT(m_keyb, 4)) res &= input_port_read(machine(), "KEY4");
1536   if (!BIT(m_keyb, 0)) res &= ioport("KEY0")->read();
1537   if (!BIT(m_keyb, 1)) res &= ioport("KEY1")->read();
1538   if (!BIT(m_keyb, 2)) res &= ioport("KEY2")->read();
1539   if (!BIT(m_keyb, 3)) res &= ioport("KEY3")->read();
1540   if (!BIT(m_keyb, 4)) res &= ioport("KEY4")->read();
15411541
15421542   return res;
15431543}
r15082r15083
15451545{
15461546   int res = 0x3f;
15471547
1548   if (!BIT(m_keyb, 0)) res &= input_port_read(machine(), "KEY5");
1549   if (!BIT(m_keyb, 1)) res &= input_port_read(machine(), "KEY6");
1550   if (!BIT(m_keyb, 2)) res &= input_port_read(machine(), "KEY7");
1551   if (!BIT(m_keyb, 3)) res &= input_port_read(machine(), "KEY8");
1552   if (!BIT(m_keyb, 4)) res &= input_port_read(machine(), "KEY9");
1548   if (!BIT(m_keyb, 0)) res &= ioport("KEY5")->read();
1549   if (!BIT(m_keyb, 1)) res &= ioport("KEY6")->read();
1550   if (!BIT(m_keyb, 2)) res &= ioport("KEY7")->read();
1551   if (!BIT(m_keyb, 3)) res &= ioport("KEY8")->read();
1552   if (!BIT(m_keyb, 4)) res &= ioport("KEY9")->read();
15531553
15541554   // bit 6
1555   res |= input_port_read(machine(), "BET");
1555   res |= ioport("BET")->read();
15561556
15571557   // bit 7 = blitter busy
15581558
r15082r15083
15861586
15871587   switch (offset + 0x8000)
15881588   {
1589      case 0x8061:   return input_port_read(machine(), "COINS");
1589      case 0x8061:   return ioport("COINS")->read();
15901590      case 0x8062:   return gekisha_keyboard_1_r(space, 0);
15911591      case 0x8063:   return gekisha_keyboard_0_r(space, 0);
1592      case 0x8064:   return input_port_read(machine(), "DSW1");
1593      case 0x8065:   return input_port_read(machine(), "DSW3");
1594      case 0x8066:   return input_port_read(machine(), "DSW4");
1595      case 0x8067:   return input_port_read(machine(), "DSW2");
1592      case 0x8064:   return ioport("DSW1")->read();
1593      case 0x8065:   return ioport("DSW3")->read();
1594      case 0x8066:   return ioport("DSW4")->read();
1595      case 0x8067:   return ioport("DSW2")->read();
15961596   }
15971597
15981598   logerror("%04x: unmapped offset %04X read with rombank=%02X\n",cpu_get_pc(&space.device()), offset, m_rombank);
r15082r15083
46304630static MACHINE_START( jantouki )
46314631{
46324632   dynax_state *state = machine.driver_data<dynax_state>();
4633   UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
4633   UINT8 *MAIN = state->memregion("maincpu")->base();
46344634   UINT8 *SOUND = state->memregion("soundcpu")->base();
46354635
46364636   state->membank("bank1")->configure_entries(0, 0x10, &MAIN[0x8000],  0x8000);
src/mame/drivers/sigmab98.c
r15082r15083
721721
722722READ8_MEMBER(sigmab98_state::sammymdl_coin_hopper_r)
723723{
724   UINT8 ret = input_port_read(machine(), "COIN");
724   UINT8 ret = ioport("COIN")->read();
725725
726726//  if ( !machine().device<ticket_dispenser_device>("hopper")->read(0) )
727727//      ret &= ~0x01;
r15082r15083
14991499
15001500   PORT_START("EEPROM")
15011501   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   // protection? checks. Must be 0
1502   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_VBLANK  )   // protection? checks. Must be 0
1502   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_CUSTOM  ) PORT_VBLANK("screen")   // protection? checks. Must be 0
15031503   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
15041504   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
15051505   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNKNOWN )
r15082r15083
15371537
15381538   PORT_START("EEPROM")
15391539   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   // protection? checks. Must be 0
1540   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_VBLANK  )   // protection? checks. Must be 0
1540   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_CUSTOM  ) PORT_VBLANK("screen")   // protection? checks. Must be 0
15411541   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
15421542   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
15431543   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNKNOWN )
r15082r15083
15751575
15761576   PORT_START("EEPROM")
15771577   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   // protection? checks. Must be 0
1578   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_VBLANK  )   // protection? checks. Must be 0
1578   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_CUSTOM  ) PORT_VBLANK("screen")   // protection? checks. Must be 0
15791579   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
15801580   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
15811581   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNKNOWN )
src/mame/drivers/shootout.c
r15082r15083
171171   PORT_DIPSETTING(   0x10, DEF_STR( Hard ) )
172172   PORT_DIPSETTING(   0x00, DEF_STR( Very_Hard ) )
173173   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) /* this is set when either coin is inserted */
174   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
174   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
175175INPUT_PORTS_END
176176
177177static INPUT_PORTS_START( shootouj )
src/mame/drivers/dribling.c
r15082r15083
6868
6969   /* low value in the given bit selects */
7070   if (!(state->m_input_mux & 0x01))
71      return input_port_read(device->machine(), "MUX0");
71      return state->ioport("MUX0")->read();
7272   else if (!(state->m_input_mux & 0x02))
73      return input_port_read(device->machine(), "MUX1");
73      return state->ioport("MUX1")->read();
7474   else if (!(state->m_input_mux & 0x04))
75      return input_port_read(device->machine(), "MUX2");
75      return state->ioport("MUX2")->read();
7676   return 0xff;
7777}
7878
src/mame/drivers/itech32.c
r15082r15083
474474
475475READ16_MEMBER(itech32_state::trackball_r)
476476{
477   int lower = input_port_read(machine(), "TRACKX1");
478   int upper = input_port_read(machine(), "TRACKY1");
477   int lower = ioport("TRACKX1")->read();
478   int upper = ioport("TRACKY1")->read();
479479
480480   return (lower & 15) | ((upper & 15) << 4);
481481}
r15082r15083
483483
484484READ32_MEMBER(itech32_state::trackball32_8bit_r)
485485{
486   int lower = input_port_read(machine(), "TRACKX1");
487   int upper = input_port_read(machine(), "TRACKY1");
486   int lower = ioport("TRACKX1")->read();
487   int upper = ioport("TRACKY1")->read();
488488
489489   return (lower & 255) | ((upper & 255) << 8);
490490}
r15082r15083
499499      int upper, lower;
500500      int dx, dy;
501501
502      int curx = input_port_read(machine(), "TRACKX1");
503      int cury = input_port_read(machine(), "TRACKY1");
502      int curx = ioport("TRACKX1")->read();
503      int cury = ioport("TRACKY1")->read();
504504
505505      dx = curx - m_p1_effx;
506506      if (dx < -0x80) dx += 0x100;
r15082r15083
535535      int upper, lower;
536536      int dx, dy;
537537
538      int curx = input_port_read(machine(), "TRACKX2");
539      int cury = input_port_read(machine(), "TRACKY2");
538      int curx = ioport("TRACKX2")->read();
539      int cury = ioport("TRACKY2")->read();
540540
541541      dx = curx - m_p2_effx;
542542      if (dx < -0x80) dx += 0x100;
r15082r15083
571571
572572READ32_MEMBER(itech32_state::drivedge_steering_r)
573573{
574   int val = input_port_read(machine(), "STEER") * 2 - 0x100;
574   int val = ioport("STEER")->read() * 2 - 0x100;
575575   if (val < 0) val = 0x100 | (-val);
576576   return val << 16;
577577}
r15082r15083
579579
580580READ32_MEMBER(itech32_state::drivedge_gas_r)
581581{
582   int val = input_port_read(machine(), "GAS");
582   int val = ioport("GAS")->read();
583583   return val << 16;
584584}
585585
r15082r15083
11151115   PORT_START("DIPS")      /* 58000 */
11161116   PORT_SERVICE_NO_TOGGLE( 0x0001, IP_ACTIVE_LOW )
11171117   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE1 )
1118   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
1118   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
11191119   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech32_state,special_port_r, NULL)
11201120   PORT_DIPNAME( 0x0010, 0x0000, "Video Sync" )    PORT_DIPLOCATION("SW1:1")
11211121   PORT_DIPSETTING(      0x0000, "-" )
r15082r15083
11601160   PORT_START("DIPS")   /* 280000 */
11611161   PORT_SERVICE_NO_TOGGLE( 0x0001, IP_ACTIVE_LOW )
11621162   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE1 )
1163   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
1163   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
11641164   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech32_state,special_port_r, NULL)
11651165   PORT_DIPNAME( 0x0010, 0x0000, "Video Sync" )    PORT_DIPLOCATION("SW1:4")
11661166   PORT_DIPSETTING(      0x0000, "-" )
r15082r15083
12781278   PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12791279   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
12801280   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_COIN3 )
1281   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_VBLANK )
1281   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
12821282   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_SPECIAL )
12831283   PORT_DIPNAME( 0x70000000, 0x00000000, "Network Number" ) PORT_DIPLOCATION("SW1:4,3,2")
12841284   PORT_DIPSETTING(          0x00000000, "1" )
r15082r15083
13631363   PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
13641364   PORT_SERVICE_NO_TOGGLE( 0x00010000, IP_ACTIVE_LOW )
13651365   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_SERVICE1 )
1366   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_VBLANK )
1366   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
13671367   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech32_state,special_port_r, NULL)
13681368   PORT_DIPNAME( 0x00100000, 0x00000000, "Video Sync" )    PORT_DIPLOCATION("SW1:4")
13691369   PORT_DIPSETTING(          0x00000000, "-" )
src/mame/drivers/mexico86.c
r15082r15083
452452
453453   /*TODO: check the PCB and see how the halt / reset lines are connected. */
454454   if (machine.device("sub") != NULL)
455      cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (input_port_read(machine, "DSW1") & 0x80) ? ASSERT_LINE : CLEAR_LINE);
455      cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (state->ioport("DSW1")->read() & 0x80) ? ASSERT_LINE : CLEAR_LINE);
456456
457457   state->m_port_a_in = 0;
458458   state->m_port_a_out = 0;
src/mame/drivers/calchase.c
r15082r15083
493493
494494READ16_MEMBER(calchase_state::calchase_iocard1_r)
495495{
496   return input_port_read(machine(), "IOCARD1");
496   return ioport("IOCARD1")->read();
497497}
498498
499499READ16_MEMBER(calchase_state::calchase_iocard2_r)
500500{
501   return input_port_read(machine(), "IOCARD2");
501   return ioport("IOCARD2")->read();
502502}
503503
504504READ16_MEMBER(calchase_state::calchase_iocard3_r)
505505{
506   return input_port_read(machine(), "IOCARD3");
506   return ioport("IOCARD3")->read();
507507}
508508
509509/* These two controls wheel pot or whatever this game uses ... */
510510READ16_MEMBER(calchase_state::calchase_iocard4_r)
511511{
512   return input_port_read(machine(), "IOCARD4");
512   return ioport("IOCARD4")->read();
513513}
514514
515515READ16_MEMBER(calchase_state::calchase_iocard5_r)
516516{
517   return input_port_read(machine(), "IOCARD5");
517   return ioport("IOCARD5")->read();
518518}
519519
520520
r15082r15083
677677   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)
678678   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
679679   PORT_START("IOCARD3")
680   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_VBLANK )
680   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
681681   PORT_BIT( 0xdfff, IP_ACTIVE_LOW, IPT_UNUSED )
682682
683683   PORT_START("IOCARD4")
src/mame/drivers/undrfire.c
r15082r15083
262262   {
263263      case 0x00:
264264      {
265         return input_port_read(machine(), "INPUTS");
265         return ioport("INPUTS")->read();
266266      }
267267
268268      case 0x01:
269269      {
270         return input_port_read(machine(), "SYSTEM") | (m_coin_word << 16);
270         return ioport("SYSTEM")->read() | (m_coin_word << 16);
271271      }
272272   }
273273
r15082r15083
376376
377377      case 0x00:   /* P1 */
378378      {
379         x = input_port_read(machine(), "GUNX1") << 6;
380         y = input_port_read(machine(), "GUNY1") << 6;
379         x = ioport("GUNX1")->read() << 6;
380         y = ioport("GUNY1")->read() << 6;
381381
382382         return ((x << 24) &0xff000000) | ((x << 8) &0xff0000)
383383             | ((y << 8) &0xff00) | ((y >> 8) &0xff) ;
r15082r15083
385385
386386      case 0x01:   /* P2 */
387387      {
388         x = input_port_read(machine(), "GUNX2") << 6;
389         y = input_port_read(machine(), "GUNY2") << 6;
388         x = ioport("GUNX2")->read() << 6;
389         y = ioport("GUNY2")->read() << 6;
390390
391391         return ((x << 24) &0xff000000) | ((x << 8) &0xff0000)
392392             | ((y << 8) &0xff00) | ((y >> 8) &0xff) ;
r15082r15083
457457
458458READ32_MEMBER(undrfire_state::cbombers_adc_r)
459459{
460   return (input_port_read(machine(), "STEER") << 24);
460   return (ioport("STEER")->read() << 24);
461461}
462462
463463WRITE32_MEMBER(undrfire_state::cbombers_adc_w)
src/mame/drivers/grchamp.c
r15082r15083
7979static MACHINE_RESET( grchamp )
8080{
8181   /* if the coin system is 1 way, lock Coin B (Page 40) */
82   coin_lockout_w(machine, 1, (input_port_read(machine, "DSWB") & 0x10) ? 1 : 0);
82   coin_lockout_w(machine, 1, (machine.root_device().ioport("DSWB")->read() & 0x10) ? 1 : 0);
8383}
8484
8585
src/mame/drivers/mpu3.c
r15082r15083
346346      case 2:
347347      case 3:
348348      {
349         data = (input_port_read(device->machine(), portnames[state->m_input_strobe])<<2);
349         data = (device->machine().root_device().ioport(portnames[state->m_input_strobe])->read()<<2);
350350         break;
351351      }
352352      case 4://DIL1
353353      case 6://DIL2
354354      {
355         swizzle = (input_port_read(device->machine(), portnames[state->m_input_strobe]));
355         swizzle = (device->machine().root_device().ioport(portnames[state->m_input_strobe])->read());
356356         data = (((swizzle & 0x01) << 7) + ((swizzle & 0x02) << 5) + ((swizzle & 0x04) << 3)
357357               + ((swizzle & 0x08) << 1) +((swizzle & 0x10) >> 1) + ((swizzle & 0x20) >> 3));
358358         break;
r15082r15083
360360      case 5://DIL1
361361      case 7://DIL2
362362      {
363         swizzle = (input_port_read(device->machine(), portnames[state->m_input_strobe]));
363         swizzle = (device->machine().root_device().ioport(portnames[state->m_input_strobe])->read());
364364         data = (((swizzle & 0x80) >> 1) + ((swizzle & 0x40) << 1));
365365         break;
366366      }
r15082r15083
600600static READ8_DEVICE_HANDLER( pia_ic6_porta_r )
601601{
602602   mpu3_state *state = device->machine().driver_data<mpu3_state>();
603   return (input_port_read(device->machine(), "AUX1"))|state->m_aux1_input;
603   return (state->ioport("AUX1")->read())|state->m_aux1_input;
604604}
605605
606606
607607static READ8_DEVICE_HANDLER( pia_ic6_portb_r )
608608{
609609   mpu3_state *state = device->machine().driver_data<mpu3_state>();
610   return (input_port_read(device->machine(), "AUX2"))|state->m_aux2_input;
610   return (state->ioport("AUX2")->read())|state->m_aux2_input;
611611}
612612
613613static WRITE8_DEVICE_HANDLER( pia_ic6_porta_w )
src/mame/drivers/goodejan.c
r15082r15083
8888
8989   switch(m_mux_data)
9090   {
91      case 1:    ret = input_port_read(machine(), "KEY0"); break;
92      case 2:    ret = input_port_read(machine(), "KEY1"); break;
93      case 4:    ret = input_port_read(machine(), "KEY2"); break;
94      case 8:    ret = input_port_read(machine(), "KEY3"); break;
95      case 0x10: ret = input_port_read(machine(), "KEY4"); break;
91      case 1:    ret = ioport("KEY0")->read(); break;
92      case 2:    ret = ioport("KEY1")->read(); break;
93      case 4:    ret = ioport("KEY2")->read(); break;
94      case 8:    ret = ioport("KEY3")->read(); break;
95      case 0x10: ret = ioport("KEY4")->read(); break;
9696   }
9797
9898   return ret;
src/mame/drivers/aleck64.c
r15082r15083
199199   switch( offset )
200200   {
201201      case 0:
202         return (input_port_read(space->machine(), "IN0"));   /* mtetrisc has regular inputs here */
202         return (space->machine().root_device().ioport("IN0")->read());   /* mtetrisc has regular inputs here */
203203      case 1:
204         return (input_port_read(space->machine(), "IN1"));
204         return (space->machine().root_device().ioport("IN1")->read());
205205      case 2:
206206      {
207         UINT32 val = input_port_read(space->machine(), "INMJ");
207         UINT32 val = space->machine().root_device().ioport("INMJ")->read();
208208
209209         switch( dip_read_offset >> 8 & 0xff )
210210         {
src/mame/drivers/trackfld.c
r15082r15083
634634   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
635635   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
636636   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
637   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )   PORT_CONDITION("DSW1", 0xf0, PORTCOND_EQUALS, 0x00)
638   PORT_DIPSETTING(    0x00, "No Coin A" )            PORT_CONDITION("DSW1", 0xf0, PORTCOND_NOTEQUALS, 0x00)
637   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )   PORT_CONDITION("DSW1", 0xf0, EQUALS, 0x00)
638   PORT_DIPSETTING(    0x00, "No Coin A" )            PORT_CONDITION("DSW1", 0xf0, NOTEQUALS, 0x00)
639639   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:5,6,7,8")
640640   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
641641   PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
r15082r15083
652652   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
653653   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
654654   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
655   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )   PORT_CONDITION("DSW1", 0x0f, PORTCOND_EQUALS, 0x00)
656   PORT_DIPSETTING(    0x00, "No Coin B" )            PORT_CONDITION("DSW1", 0x0f, PORTCOND_NOTEQUALS, 0x00)
655   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )   PORT_CONDITION("DSW1", 0x0f, EQUALS, 0x00)
656   PORT_DIPSETTING(    0x00, "No Coin B" )            PORT_CONDITION("DSW1", 0x0f, NOTEQUALS, 0x00)
657657   /* No Coin X = coin slot X open (coins produce sound), but no effect on coin counter */
658658
659659   PORT_START("DSW2")
src/mame/drivers/astrof.c
r15082r15083
120120
121121CUSTOM_INPUT_MEMBER(astrof_state::astrof_p1_controls_r)
122122{
123   return input_port_read(machine(), "P1");
123   return ioport("P1")->read();
124124}
125125
126126
r15082r15083
131131   /* on an upright cabinet, a single set of controls
132132       is connected to both sets of pins on the edge
133133       connector */
134   if (input_port_read(machine(), "CAB"))
135      ret = input_port_read(machine(), "P2");
134   if (ioport("CAB")->read())
135      ret = ioport("P2")->read();
136136   else
137      ret = input_port_read(machine(), "P1");
137      ret = ioport("P1")->read();
138138
139139   return ret;
140140}
r15082r15083
149149         (not verified on pcb) */
150150
151151   if (m_flipscreen)
152      ret = input_port_read(machine(), "P2");
152      ret = ioport("P2")->read();
153153   else
154      ret = input_port_read(machine(), "P1");
154      ret = ioport("P1")->read();
155155
156156   return ret;
157157}
r15082r15083
204204   astrof_state *state = machine.driver_data<astrof_state>();
205205   offs_t i;
206206   UINT8 bank = (state->m_astrof_palette_bank ? 0x10 : 0x00);
207   UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
207   UINT8 config = state->ioport("FAKE")->read_safe(0x00);
208208   UINT8 *prom = state->memregion("proms")->base();
209209
210210   /* a common wire hack to the pcb causes the prom halves to be inverted */
r15082r15083
240240{
241241   offs_t i;
242242   UINT8 *prom = machine.root_device().memregion("proms")->base();
243   UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
243   UINT8 config = machine.root_device().ioport("FAKE")->read_safe(0x00);
244244
245245   for (i = 0; i < TOMAHAWK_NUM_PENS; i++)
246246   {
r15082r15083
295295WRITE8_MEMBER(astrof_state::video_control_1_w)
296296{
297297
298   m_flipscreen = ((data >> 0) & 0x01) & input_port_read(machine(), "CAB");
298   m_flipscreen = ((data >> 0) & 0x01) & ioport("CAB")->read();
299299
300300   /* this ties to the CLR pin of the shift registers */
301301   m_screen_off = (data & 0x02) ? TRUE : FALSE;
r15082r15083
690690   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW:7")
691691   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
692692   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
693   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
693   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
694694
695695   PORT_START("CAB")
696696   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )          PORT_DIPLOCATION("SW:8")
r15082r15083
745745   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW:7")
746746   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
747747   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
748   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
748   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
749749
750750   PORT_START("CAB")
751751   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )          PORT_DIPLOCATION("SW:8")
r15082r15083
797797   PORT_DIPSETTING(    0x20, "2500" )
798798   PORT_DIPSETTING(    0x30, "3000" )
799799   PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW:7" )
800   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
800   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
801801
802802   PORT_START("CAB")
803803   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )          PORT_DIPLOCATION("SW:8")
r15082r15083
852852   PORT_DIPNAME( 0x40, 0x00, "Kill Saucer after Invaders" ) PORT_DIPLOCATION("SW:7")
853853   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
854854   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )              /* if saucer lands, game is over */
855   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
855   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
856856
857857   PORT_START("CAB")
858858   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )          PORT_DIPLOCATION("SW:8")
r15082r15083
911911   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW:7")
912912   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
913913   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
914   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
914   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
915915
916916   PORT_START("CAB")
917917   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )          PORT_DIPLOCATION("SW:8")
src/mame/drivers/peyper.c
r15082r15083
174174   switch (bit_mask)
175175   {
176176      case 0x03:
177         return ((input_port_read(machine(), "REPLAY") & bit_mask) >> 0);
177         return ((ioport("REPLAY")->read() & bit_mask) >> 0);
178178      case 0x40:
179         return ((input_port_read(machine(), "REPLAY") & bit_mask) >> 6);
179         return ((ioport("REPLAY")->read() & bit_mask) >> 6);
180180      default:
181181         logerror("wolfman_replay_hs_r : invalid %02X bit_mask\n",bit_mask);
182182         return 0;
src/mame/drivers/vegas.c
r15082r15083
14281428
14291429   if (data < 8 || data > 15)
14301430      logerror("%08X:Unexpected analog port select = %08X\n", cpu_get_pc(&space->device()), data);
1431   state->m_pending_analog_read = input_port_read_safe(space->machine(), portnames[data & 7], 0);
1431   state->m_pending_analog_read = state->ioport(portnames[data & 7])->read_safe(0);
14321432}
14331433
14341434
src/mame/drivers/tecmo.c
r15082r15083
105105/* the 8-bit dipswitches are split across addresses */
106106READ8_MEMBER(tecmo_state::tecmo_dswa_l_r)
107107{
108   UINT8 port = input_port_read(machine(), "DSWA");
108   UINT8 port = ioport("DSWA")->read();
109109   port &= 0x0f;
110110   return port;
111111}
112112
113113READ8_MEMBER(tecmo_state::tecmo_dswa_h_r)
114114{
115   UINT8 port = input_port_read(machine(), "DSWA");
115   UINT8 port = ioport("DSWA")->read();
116116   port &= 0xf0;
117117   return port>>4;
118118}
119119
120120READ8_MEMBER(tecmo_state::tecmo_dswb_l_r)
121121{
122   UINT8 port = input_port_read(machine(), "DSWB");
122   UINT8 port = ioport("DSWB")->read();
123123   port &= 0x0f;
124124   return port;
125125}
126126
127127READ8_MEMBER(tecmo_state::tecmo_dswb_h_r)
128128{
129   UINT8 port = input_port_read(machine(), "DSWB");
129   UINT8 port = ioport("DSWB")->read();
130130   port &= 0xf0;
131131   return port>>4;
132132}
src/mame/drivers/tourvis.c
r15082r15083
492492   TOURVISION_BIOS
493493ROM_END
494494
495
496ROM_START(tvlegaxe)
497   ROM_REGION( 0x100000, "maincpu", 0 )
498   ROM_LOAD( "tourv_makyodensetsuthelegendaryaxe.bin", 0x00000, 0x100000, CRC(50ec3f97) SHA1(d583fa240a4dfd14b0d53ff78762fbac52694dd2) )
499
500   TOURVISION_BIOS
501ROM_END
502
503
504ROM_START(tvsvball)
505   ROM_REGION( 0x100000, "maincpu", 0 )
506   ROM_LOAD( "tourv_supervalleyball.bin", 0x00000, 0x100000, CRC(8a32a1ca) SHA1(80144fb4035415eb9b2c67d78d55757ed0d641a1) )
507
508   TOURVISION_BIOS
509ROM_END
510
511
495512static DRIVER_INIT(tourvision)
496513{
497514   DRIVER_INIT_CALL(pce);
498515}
499516
500517GAME( 19??, tourvis,  0,       tourvision, tourvision, tourvision, ROT0, "bootleg (Tourvision)", "Tourvision PCE bootleg", GAME_IS_BIOS_ROOT | GAME_NOT_WORKING )
518GAME( 1988, tvlegaxe, tourvis, tourvision, tourvision, tourvision, ROT0, "bootleg (Tourvision) / Victor Musical Industries, Inc.", " Makyo Densetsu - The Legenary Axe (Tourvision PCE bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
501519GAME( 1989, tvusapb,  tourvis, tourvision, tourvision, tourvision, ROT0, "bootleg (Tourvision) / Aicom", "USA Pro Basketball (Tourvision PCE bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
502520GAME( 1989, tvdunexp, tourvis, tourvision, tourvision, tourvision, ROT0, "bootleg (Tourvision) / Hudson / Atlus", "Dungeon Explorer (Tourvision PCE bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
503521GAME( 1990, tvthbld,  tourvis, tourvision, tourvision, tourvision, ROT0, "bootleg (Tourvision) / Sega / NEC Avenue", "Thunder Blade (Tourvision PCE bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
504522GAME( 1990, tvrs2,    tourvis, tourvision, tourvision, tourvision, ROT0, "bootleg (Tourvision) / Taito", "Rastan Saga II (Tourvision PCE bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
523GAME( 1990, tvsvball, tourvis, tourvision, tourvision, tourvision, ROT0, "bootleg (Tourvision) / Video System", "Super Volleyball (Tourvision PCE bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
505524GAME( 1991, tvpwlg4,  tourvis, tourvision, tourvision, tourvision, ROT0, "bootleg (Tourvision) / Hudson", "Power League IV (Tourvision PCE bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
506525GAME( 1991, tvsci,    tourvis, tourvision, tourvision, tourvision, ROT0, "bootleg (Tourvision) / Taito", "Special Criminal Investigation (Tourvision PCE bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
src/mame/drivers/finalizr.c
r15082r15083
139139   KONAMI8_SYSTEM_10
140140   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
141141   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
142   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
142   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
143143
144144   PORT_START("P1")
145145   KONAMI8_MONO_B12_UNK
src/mame/drivers/shuuz.c
r15082r15083
100100   /* when reading the even ports, do a real analog port update */
101101   if (which == 0)
102102   {
103      int dx = (INT8)input_port_read(machine(), "TRACKX");
104      int dy = (INT8)input_port_read(machine(), "TRACKY");
103      int dx = (INT8)ioport("TRACKX")->read();
104      int dy = (INT8)ioport("TRACKY")->read();
105105
106106      m_cur[0] = dx + dy;
107107      m_cur[1] = dx - dy;
r15082r15083
121121
122122READ16_MEMBER(shuuz_state::special_port0_r)
123123{
124   int result = input_port_read(machine(), "SYSTEM");
124   int result = ioport("SYSTEM")->read();
125125
126126   if ((result & 0x0800) && atarigen_get_hblank(*machine().primary_screen))
127127      result &= ~0x0800;
r15082r15083
171171   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
172172   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
173173   PORT_BIT( 0x07fc, IP_ACTIVE_LOW, IPT_UNUSED )
174   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_VBLANK )
174   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
175175   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
176176
177177   PORT_START("BUTTONS")
r15082r15083
198198   PORT_BIT( 0x00fc, IP_ACTIVE_LOW, IPT_UNUSED )
199199   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Step Debug SW") PORT_CODE(KEYCODE_S)
200200   PORT_BIT( 0x0600, IP_ACTIVE_LOW, IPT_UNUSED )
201   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_VBLANK )
201   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
202202   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Playfield Debug SW") PORT_CODE(KEYCODE_Y)
203203   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reset Debug SW") PORT_CODE(KEYCODE_E)
204204   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Crosshair Debug SW") PORT_CODE(KEYCODE_C)
src/mame/drivers/enigma2.c
r15082r15083
365365      if (m_protection_data != 0xff)
366366         ret = m_protection_data ^ 0x88;
367367      else
368         ret = input_port_read(machine(), "DSW");
368         ret = ioport("DSW")->read();
369369      break;
370370
371371   case 0x02:
r15082r15083
413413
414414WRITE8_MEMBER(enigma2_state::enigma2_flip_screen_w)
415415{
416   m_flip_screen = ((data >> 5) & 0x01) && ((input_port_read(machine(), "DSW") & 0x20) == 0x20);
416   m_flip_screen = ((data >> 5) & 0x01) && ((ioport("DSW")->read() & 0x20) == 0x20);
417417}
418418
419419
420420CUSTOM_INPUT_MEMBER(enigma2_state::p1_controls_r)
421421{
422   return input_port_read(machine(), "P1CONTROLS");
422   return ioport("P1CONTROLS")->read();
423423}
424424
425425
426426CUSTOM_INPUT_MEMBER(enigma2_state::p2_controls_r)
427427{
428428   if (m_flip_screen)
429      return input_port_read(machine(), "P2CONTROLS");
429      return ioport("P2CONTROLS")->read();
430430   else
431      return input_port_read(machine(), "P1CONTROLS");
431      return ioport("P1CONTROLS")->read();
432432}
433433
434434
src/mame/drivers/videopkr.c
r15082r15083
493493{
494494   videopkr_state *state = machine.driver_data<videopkr_state>();
495495   int offs = tile_index;
496   int attr = state->m_color_ram[offs] + input_port_read(machine, "IN2"); /* Color Switch Action */
496   int attr = state->m_color_ram[offs] + state->ioport("IN2")->read(); /* Color Switch Action */
497497   int code = state->m_video_ram[offs];
498498   int color = attr;
499499   SET_TILE_INFO(0, code, color, 0);
r15082r15083
536536   {
537537      case 0xef:   /* inputs are multiplexed through a diode matrix */
538538      {
539         hf = ((input_port_read(machine(), "IN1") & 0x10 ) >> 4) & 1;         /* Hopper full detection */
540         co = 0x10 * ((input_port_read(machine(), "IN1") & 0x20 ) >> 5);      /* Coin Out detection */
541         kbdin = ((input_port_read(machine(), "IN1") & 0xaf ) << 8) + input_port_read(machine(), "IN0");
539         hf = ((ioport("IN1")->read() & 0x10 ) >> 4) & 1;         /* Hopper full detection */
540         co = 0x10 * ((ioport("IN1")->read() & 0x20 ) >> 5);      /* Coin Out detection */
541         kbdin = ((ioport("IN1")->read() & 0xaf ) << 8) + ioport("IN0")->read();
542542
543543         switch (kbdin)
544544         {
src/mame/drivers/igspoker.c
r15082r15083
298298
299299   switch (data)
300300   {
301      case 0x00: m_protection_res = input_port_read(machine(), "BUTTONS1"); break;
301      case 0x00: m_protection_res = ioport("BUTTONS1")->read(); break;
302302      // CSK227
303303      case 0x20: m_protection_res = 0x49; break;
304304      case 0x21: m_protection_res = 0x47; break;
src/mame/drivers/segaorun.c
r15082r15083
663663      case 0x10/2:
664664      {
665665         static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
666         return input_port_read(space->machine(), sysports[offset & 3]);
666         return space->machine().root_device().ioport(sysports[offset & 3])->read();
667667      }
668668
669669      case 0x30/2:
670670      {
671671         static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7" };
672         return input_port_read_safe(space->machine(), ports[state->m_adc_select], 0x0010);
672         return state->ioport(ports[state->m_adc_select])->read_safe(0x0010);
673673      }
674674
675675      case 0x60/2:
r15082r15083
733733      case 0x1006/2:
734734      {
735735         static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
736         return input_port_read(space->machine(), sysports[offset & 3]);
736         return space->machine().root_device().ioport(sysports[offset & 3])->read();
737737      }
738738
739739      case 0x3020/2:
740740      {
741741         static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
742         return input_port_read_safe(space->machine(), ports[state->m_adc_select], 0x0010);
742         return state->ioport(ports[state->m_adc_select])->read_safe(0x0010);
743743      }
744744   }
745745   logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(&space->device()), offset * 2);
src/mame/drivers/koikoi.c
r15082r15083
165165
166166   if (!state->m_inputcnt)
167167   {
168      int key = input_port_read(device->machine(), "IN1");
168      int key = state->ioport("IN1")->read();
169169      int keyval = 0; //we must return 0 (0x2 in 2nd read) to clear 4 bit at $6600 and allow next read
170170
171171      if (key)
r15082r15083
202202READ8_MEMBER(koikoi_state::io_r)
203203{
204204   if (!offset)
205      return input_port_read(machine(), "IN0") ^ m_ioram[4]; //coin
205      return ioport("IN0")->read() ^ m_ioram[4]; //coin
206206
207207   return 0;
208208}
src/mame/drivers/gticlub.c
r15082r15083
343343      case 0:
344344      case 1:
345345      case 3:
346         return input_port_read(machine(), portnames[offset]);
346         return ioport(portnames[offset])->read();
347347
348348      case 2:
349349         return adc1038_sars_read(adc1038) << 7;
r15082r15083
727727   int value = 0;
728728   switch (input)
729729   {
730   case 0: value = input_port_read(device->machine(), "AN0"); break;
731   case 1: value = input_port_read(device->machine(), "AN1"); break;
732   case 2: value = input_port_read(device->machine(), "AN2"); break;
733   case 3: value = input_port_read(device->machine(), "AN3"); break;
730   case 0: value = device->machine().root_device().ioport("AN0")->read(); break;
731   case 1: value = device->machine().root_device().ioport("AN1")->read(); break;
732   case 2: value = device->machine().root_device().ioport("AN2")->read(); break;
733   case 3: value = device->machine().root_device().ioport("AN3")->read(); break;
734734   case 4: value = 0x000; break;
735735   case 5: value = 0x000; break;
736736   case 6: value = 0x000; break;
r15082r15083
11651165
11661166   state->m_sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
11671167
1168   K001005_preprocess_texture_data(machine.root_device().memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 1);
1168   K001005_preprocess_texture_data(state->memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 1);
11691169}
11701170
11711171static DRIVER_INIT(hangplt)
r15082r15083
11731173   gticlub_state *state = machine.driver_data<gticlub_state>();
11741174
11751175   init_konami_cgboard(machine, 2, CGBOARD_TYPE_HANGPLT);
1176   set_cgboard_texture_bank(machine, 0, "bank5", machine.root_device().memregion("user5")->base());
1176   set_cgboard_texture_bank(machine, 0, "bank5", state->memregion("user5")->base());
11771177   set_cgboard_texture_bank(machine, 1, "bank6", state->memregion("user5")->base());
11781178
11791179   state->m_sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
src/mame/drivers/mazerbla.c
r15082r15083
889889
890890   UINT8 ret = 0;
891891
892   ret = input_port_read(machine(), strobenames[m_bcd_7445]);
892   ret = ioport(strobenames[m_bcd_7445])->read();
893893
894894   return ret;
895895}
src/mame/drivers/namcona1.c
r15082r15083
881881   switch (m_mcu_port6 & 0xe0)
882882   {
883883      case 0x40:
884         return input_port_read(machine(), "P1");
884         return ioport("P1")->read();
885885
886886      case 0x60:
887         return input_port_read(machine(), "P2");
887         return ioport("P2")->read();
888888
889889      case 0x20:
890         return input_port_read(machine(), "DSW");
890         return ioport("DSW")->read();
891891
892892      case 0x00:
893         return input_port_read(machine(), "P4");
893         return ioport("P4")->read();
894894   }
895895
896896   return 0xff;
r15082r15083
940940READ8_MEMBER(namcona1_state::portana_r)
941941{
942942   static const UINT8 bitnum[8] = { 0x40, 0x20, 0x10, 0x01, 0x02, 0x04, 0x08, 0x80 };
943   UINT8 port = input_port_read(machine(), "P3");
943   UINT8 port = ioport("P3")->read();
944944
945945   return (port & bitnum[offset>>1]) ? 0xff : 0x00;
946946}
src/mame/drivers/armedf.c
r15082r15083
556556            break;
557557
558558         case 0x642/2:
559            return (input_port_read(machine(), "DSW0") & 0xffff) ^ 0xffff;
559            return (ioport("DSW0")->read() & 0xffff) ^ 0xffff;
560560
561561         case 0x644/2:
562            return (input_port_read(machine(), "DSW1") & 0xffff) ^ 0xffff;
562            return (ioport("DSW1")->read() & 0xffff) ^ 0xffff;
563563
564564         case 0x646/2:
565            return (input_port_read(machine(), "P1") & 0xffff) ^ 0xffff;
565            return (ioport("P1")->read() & 0xffff) ^ 0xffff;
566566
567567         case 0x648/2:
568            return (input_port_read(machine(), "P2") & 0xffff) ^ 0xffff;
568            return (ioport("P2")->read() & 0xffff) ^ 0xffff;
569569      }
570570   }
571571
r15082r15083
581581            }
582582            break;
583583         case 0x642/2:
584            return (input_port_read(machine(), "DSW0") & 0xffff) ^ 0xffff;
584            return (ioport("DSW0")->read() & 0xffff) ^ 0xffff;
585585
586586         case 0x644/2:
587            return (input_port_read(machine(), "DSW1") & 0xffff) ^ 0xffff;
587            return (ioport("DSW1")->read() & 0xffff) ^ 0xffff;
588588
589589         case 0x646/2:
590            return (input_port_read(machine(), "P1") & 0xffff) ^ 0xffff;
590            return (ioport("P1")->read() & 0xffff) ^ 0xffff;
591591
592592         case 0x648/2:
593            return (input_port_read(machine(), "P2") & 0xffff) ^ 0xffff;
593            return (ioport("P2")->read() & 0xffff) ^ 0xffff;
594594
595595         /*
596596            protection controls where the program code should jump to.
src/mame/drivers/bsktball.c
r15082r15083
128128   /* 0x80 - DR3 = PL1 V DIR */
129129
130130   PORT_START("IN1")
131   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
131   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
132132   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_TILT )
133133   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* SPARE */
134134   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* TEST STEP */
src/mame/drivers/cdi.c
r15082r15083
8787   switch((FPTR)param)
8888   {
8989      case 0x39:
90         if(input_port_read(machine(), "INPUT1") & 0x01) send = true;
90         if(ioport("INPUT1")->read() & 0x01) send = true;
9191         break;
9292      case 0x37:
93         if(input_port_read(machine(), "INPUT1") & 0x02) send = true;
93         if(ioport("INPUT1")->read() & 0x02) send = true;
9494         break;
9595      case 0x31:
96         if(input_port_read(machine(), "INPUT1") & 0x04) send = true;
96         if(ioport("INPUT1")->read() & 0x04) send = true;
9797         break;
9898      case 0x32:
99         if(input_port_read(machine(), "INPUT1") & 0x08) send = true;
99         if(ioport("INPUT1")->read() & 0x08) send = true;
100100         break;
101101      case 0x33:
102         if(input_port_read(machine(), "INPUT1") & 0x10) send = true;
102         if(ioport("INPUT1")->read() & 0x10) send = true;
103103         break;
104104
105105      case 0x30:
106         if(input_port_read(machine(), "INPUT2") & 0x01) send = true;
106         if(ioport("INPUT2")->read() & 0x01) send = true;
107107         break;
108108      case 0x38:
109         if(input_port_read(machine(), "INPUT2") & 0x02) send = true;
109         if(ioport("INPUT2")->read() & 0x02) send = true;
110110         break;
111111      case 0x34:
112         if(input_port_read(machine(), "INPUT2") & 0x04) send = true;
112         if(ioport("INPUT2")->read() & 0x04) send = true;
113113         break;
114114      case 0x35:
115         if(input_port_read(machine(), "INPUT2") & 0x08) send = true;
115         if(ioport("INPUT2")->read() & 0x08) send = true;
116116         break;
117117      case 0x36:
118         if(input_port_read(machine(), "INPUT2") & 0x10) send = true;
118         if(ioport("INPUT2")->read() & 0x10) send = true;
119119         break;
120120   }
121121
src/mame/drivers/dkong.c
r15082r15083
579579   UINT8 mcustatus = latch8_bit4_q_r(m_dev_vp2, 0);
580580   UINT8 r;
581581
582   r = (input_port_read(machine(), "IN2") & 0xBF) | (mcustatus << 6);
582   r = (ioport("IN2")->read() & 0xBF) | (mcustatus << 6);
583583   coin_counter_w(machine(), offset, r >> 7);
584584   if (r & 0x10)
585585      r = (r & ~0x10) | 0x80; /* service ==> coin */
r15082r15083
592592
593593    UINT8 r;
594594
595    r = (input_port_read(machine(), "IN2") & 0xBF) | 0x40;
595    r = (ioport("IN2")->read() & 0xBF) | 0x40;
596596    coin_counter_w(machine(), offset, r >> 7);
597597    if (r & 0x10)
598598        r = (r & ~0x10) | 0x80; /* service ==> coin */
r15082r15083
724724
725725READ8_MEMBER(dkong_state::strtheat_inputport_0_r)
726726{
727    if(input_port_read(machine(), "DSW0") & 0x40)
727    if(ioport("DSW0")->read() & 0x40)
728728    {
729729        /* Joystick inputs */
730        return input_port_read(machine(), "IN0");
730        return ioport("IN0")->read();
731731    }
732732    else
733733    {
734734        /* Steering Wheel inputs */
735        return (input_port_read(machine(), "IN0") & ~3) | (input_port_read(machine(), "IN4") & 3);
735        return (ioport("IN4")->read() & 3);
736736    }
737737}
738738
739739
740740READ8_MEMBER(dkong_state::strtheat_inputport_1_r)
741741{
742    if(input_port_read(machine(), "DSW0") & 0x40)
742    if(ioport("DSW0")->read() & 0x40)
743743    {
744744        /* Joystick inputs */
745        return input_port_read(machine(), "IN1");
745        return ioport("IN1")->read();
746746    }
747747    else
748748    {
749749        /* Steering Wheel inputs */
750        return (input_port_read(machine(), "IN1") & ~3) | (input_port_read(machine(), "IN5") & 3);
750        return (ioport("IN5")->read() & 3);
751751    }
752752}
753753
r15082r15083
11961196    PORT_DIPSETTING(    0x0c, "80000" )
11971197
11981198    PORT_START("SENSE") /* Sense */
1199    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1199    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
12001200
12011201    PORT_INCLUDE( dkong_config )
12021202INPUT_PORTS_END
r15082r15083
12401240    PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
12411241
12421242    PORT_START("SENSE") /* Sense */
1243    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1243    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
12441244
12451245    PORT_INCLUDE( dkong_config )
12461246INPUT_PORTS_END
r15082r15083
12731273    PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" )
12741274
12751275    PORT_START("SENSE") /* Sense */
1276    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1276    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
12771277
12781278    PORT_INCLUDE( dkong_config )
12791279INPUT_PORTS_END
r15082r15083
12921292    PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" )
12931293
12941294    PORT_START("SENSE") /* Sense */
1295    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
1295    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
12961296
12971297    PORT_INCLUDE( dkong_config )
12981298INPUT_PORTS_END
r15082r15083
13261326    PORT_DIPSETTING(    0x0c, "3" )
13271327
13281328    PORT_START("SENSE") /* Sense */
1329    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1329    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
13301330
13311331    PORT_INCLUDE( dkong_config )
13321332INPUT_PORTS_END
r15082r15083
14241424    PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
14251425
14261426    PORT_START("SENSE") /* Sense */
1427    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
1427    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
14281428
14291429    PORT_INCLUDE( dkong_config )
14301430INPUT_PORTS_END
r15082r15083
14571457    PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:!8" )
14581458
14591459    PORT_START("SENSE") /* Sense */
1460    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
1460    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
14611461
14621462    PORT_INCLUDE( dkong_config )
14631463INPUT_PORTS_END
src/mame/drivers/acefruit.c
r15082r15083
179179   switch (bit_mask)
180180   {
181181      case 0x01:
182         return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 0);
182         return ((ioport("PAYOUT")->read() & bit_mask) >> 0);
183183      case 0x02:
184         return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 1);
184         return ((ioport("PAYOUT")->read() & bit_mask) >> 1);
185185      default:
186186         logerror("sidewndr_payout_r : invalid %02X bit_mask\n",bit_mask);
187187         return 0;
r15082r15083
195195   switch (bit_mask)
196196   {
197197      case 0x01:
198         return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 0);
198         return ((ioport("COINAGE")->read() & bit_mask) >> 0);
199199      case 0x02:
200         return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 1);
200         return ((ioport("COINAGE")->read() & bit_mask) >> 1);
201201      case 0x04:
202         return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 2);
202         return ((ioport("COINAGE")->read() & bit_mask) >> 2);
203203      case 0x08:
204         return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 3);
204         return ((ioport("COINAGE")->read() & bit_mask) >> 3);
205205      default:
206206         logerror("starspnr_coinage_r : invalid %02X bit_mask\n",bit_mask);
207207         return 0;
r15082r15083
215215   switch (bit_mask)
216216   {
217217      case 0x01:
218         return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 0);
218         return ((ioport("PAYOUT")->read() & bit_mask) >> 0);
219219      case 0x02:
220         return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 1);
220         return ((ioport("PAYOUT")->read() & bit_mask) >> 1);
221221      case 0x04:
222         return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 2);
222         return ((ioport("PAYOUT")->read() & bit_mask) >> 2);
223223      default:
224224         logerror("starspnr_payout_r : invalid %02X bit_mask\n",bit_mask);
225225         return 0;
r15082r15083
316316   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME( "Stop Nudge/Nudge Up or Down" )
317317   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Gamble" )
318318   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )              /* "Cash in" */
319   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK ) /* active low or high?? */
319   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* active low or high?? */
320320   PORT_BIT( 0xd8, IP_ACTIVE_LOW, IPT_UNKNOWN )
321321
322322   PORT_START("IN1")   // 1
r15082r15083
437437   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
438438   /* tested at 0xef77 after IN5 bit 1 and before IN2 bit 2 - after coins are tested - table at 0xefa5 (3 bytes) */
439439   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
440   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK ) /* active low or high?? */
440   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* active low or high?? */
441441
442442   PORT_START("IN1")   // 1
443443   /* tested at 0xe77c - call from 0x012c */
src/mame/drivers/sprint4.c
r15082r15083
5050
5151   UINT8 wheel[4] =
5252   {
53      input_port_read(machine, "WHEEL1"),
54      input_port_read(machine, "WHEEL2"),
55      input_port_read(machine, "WHEEL3"),
56      input_port_read(machine, "WHEEL4")
53      state->ioport("WHEEL1")->read(),
54      state->ioport("WHEEL2")->read(),
55      state->ioport("WHEEL3")->read(),
56      state->ioport("WHEEL4")->read()
5757   };
5858   UINT8 lever[4] =
5959   {
60      input_port_read(machine, "LEVER1"),
61      input_port_read(machine, "LEVER2"),
62      input_port_read(machine, "LEVER3"),
63      input_port_read(machine, "LEVER4")
60      machine.root_device().ioport("LEVER1")->read(),
61      machine.root_device().ioport("LEVER2")->read(),
62      machine.root_device().ioport("LEVER3")->read(),
63      machine.root_device().ioport("LEVER4")->read()
6464   };
6565
6666   int i;
r15082r15083
9999
100100   /* NMI and watchdog are disabled during service mode */
101101
102   machine.watchdog_enable(input_port_read(machine, "IN0") & 0x40);
102   machine.watchdog_enable(machine.root_device().ioport("IN0")->read() & 0x40);
103103
104   if (input_port_read(machine, "IN0") & 0x40)
104   if (machine.root_device().ioport("IN0")->read() & 0x40)
105105      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
106106
107107   machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline);
r15082r15083
134134
135135READ8_MEMBER(sprint4_state::sprint4_analog_r)
136136{
137   return (input_port_read(machine(), "ANALOG") << (~offset & 7)) & 0x80;
137   return (ioport("ANALOG")->read() << (~offset & 7)) & 0x80;
138138}
139139READ8_MEMBER(sprint4_state::sprint4_coin_r)
140140{
141   return (input_port_read(machine(), "COIN") << (~offset & 7)) & 0x80;
141   return (ioport("COIN")->read() << (~offset & 7)) & 0x80;
142142}
143143READ8_MEMBER(sprint4_state::sprint4_collision_r)
144144{
145   return (input_port_read(machine(), "COLLISION") << (~offset & 7)) & 0x80;
145   return (ioport("COLLISION")->read() << (~offset & 7)) & 0x80;
146146}
147147
148148
149149READ8_MEMBER(sprint4_state::sprint4_options_r)
150150{
151   return (input_port_read(machine(), "DIP") >> (2 * (offset & 3))) & 3;
151   return (ioport("DIP")->read() >> (2 * (offset & 3))) & 3;
152152}
153153
154154
r15082r15083
259259
260260   PORT_START("IN0")
261261   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
262   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
262   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
263263
264264   PORT_START("IN1")
265265   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE)
src/mame/drivers/metlclsh.c
r15082r15083
198198   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
199199   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )   // cpu2 will clr c040 on startup forever
200200   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, metlclsh_state,coin_inserted, 0)
201   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
201   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
202202INPUT_PORTS_END
203203
204204
src/mame/drivers/goldstar.c
r15082r15083
680680
681681   PORT_START("DSW3")
682682   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")   /* OK */
683   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
684   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
685   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
686   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
687   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
688   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
689   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
690   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
683   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
684   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
685   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
686   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
687   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
688   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
689   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
690   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
691691   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")   /* OK */
692692   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
693693   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
694694   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
695695   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
696696   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")   /* OK */
697   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
698   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
699   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
700   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
701   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
702   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
703   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
704   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
697   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
698   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
699   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
700   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
701   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
702   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
703   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
704   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
705705   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")   /* OK */
706706   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
707707   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
r15082r15083
842842
843843   PORT_START("DSW3")
844844   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")   /* OK */
845   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
846   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
847   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
848   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
849   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
850   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
851   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
852   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
845   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
846   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
847   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
848   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
849   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
850   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
851   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
852   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
853853   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")   /* OK */
854854   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
855855   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
856856   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
857857   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
858858   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")   /* OK */
859   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
860   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
861   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
862   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
863   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
864   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
865   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
866   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
859   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
860   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
861   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
862   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
863   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
864   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
865   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
866   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
867867   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")   /* OK */
868868   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
869869   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
r15082r15083
10041004
10051005   PORT_START("DSW3")
10061006   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")   /* OK */
1007   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
1008   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1009   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1010   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1011   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
1012   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1013   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1014   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1007   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
1008   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1009   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1010   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1011   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
1012   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1013   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1014   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
10151015   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")   /* OK */
10161016   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
10171017   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
10181018   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
10191019   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
10201020   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")   /* OK */
1021   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
1022   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1023   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1024   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1025   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
1026   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1027   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1028   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1021   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
1022   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1023   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1024   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1025   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
1026   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1027   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1028   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
10291029   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")   /* OK */
10301030   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
10311031   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
r15082r15083
11661166
11671167   PORT_START("DSW3")
11681168   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")   /* OK */
1169   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
1170   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1171   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1172   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1173   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
1174   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1175   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1176   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1169   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
1170   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1171   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1172   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1173   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
1174   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1175   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1176   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
11771177   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")   /* OK */
11781178   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
11791179   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
11801180   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
11811181   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
11821182   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")   /* OK */
1183   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
1184   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1185   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1186   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1187   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
1188   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1189   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1190   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1183   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
1184   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1185   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1186   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1187   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
1188   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1189   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1190   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
11911191   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")   /* OK */
11921192   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
11931193   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
r15082r15083
13281328
13291329   PORT_START("DSW3")
13301330   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")   /* OK */
1331   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
1332   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1333   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1334   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1335   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
1336   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1337   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1338   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1331   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
1332   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1333   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1334   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1335   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
1336   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1337   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1338   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
13391339   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")   /* OK */
13401340   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
13411341   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
13421342   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
13431343   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
13441344   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")   /* OK */
1345   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
1346   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1347   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1348   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1349   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
1350   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1351   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1352   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1345   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
1346   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1347   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1348   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1349   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
1350   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1351   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1352   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
13531353   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")   /* OK */
13541354   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
13551355   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
r15082r15083
14901490
14911491   PORT_START("DSW3")
14921492   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")   /* OK */
1493   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
1494   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1495   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1496   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1497   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
1498   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1499   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1500   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1493   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
1494   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1495   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1496   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1497   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
1498   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1499   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1500   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
15011501   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")   /* OK */
15021502   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
15031503   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
15041504   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
15051505   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
15061506   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")   /* OK */
1507   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
1508   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1509   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1510   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1511   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
1512   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1513   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1514   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1507   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
1508   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1509   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1510   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1511   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
1512   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1513   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1514   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
15151515   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")   /* OK */
15161516   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
15171517   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
r15082r15083
17891789
17901790   PORT_START("DSW3")   /* some of these could be wrong */
17911791   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")
1792   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // A-Type
1793   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1794   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1795   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" )   PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1796   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // B-Type
1797   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1798   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1799   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1792   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00) // A-Type
1793   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1794   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1795   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" )   PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1796   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40) // B-Type
1797   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1798   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1799   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
18001800   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")
18011801   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )
18021802   PORT_DIPSETTING(    0x04, "1 Coin/20 Credits" )
18031803   PORT_DIPSETTING(    0x08, "1 Coin/50 Credits" )
18041804   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
18051805   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")
1806   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // C-Type
1807   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1808   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1809   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1810   PORT_DIPSETTING(    0x30, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // D-Type
1811   PORT_DIPSETTING(    0x20, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1812   PORT_DIPSETTING(    0x10, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1813   PORT_DIPSETTING(    0x00, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1806   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10) // C-Type
1807   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1808   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1809   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1810   PORT_DIPSETTING(    0x30, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00) // D-Type
1811   PORT_DIPSETTING(    0x20, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1812   PORT_DIPSETTING(    0x10, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1813   PORT_DIPSETTING(    0x00, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
18141814   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")
18151815   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
18161816   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
r15082r15083
19611961
19621962   PORT_START("DSW3")   /* seems ok */
19631963   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")   /* OK */
1964   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // A-Type
1965   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1966   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1967   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" )   PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1968   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // B-Type
1969   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1970   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1971   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1964   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00) // A-Type
1965   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1966   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1967   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" )   PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
1968   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40) // B-Type
1969   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1970   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
1971   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
19721972   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")   /* OK */
19731973   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )
19741974   PORT_DIPSETTING(    0x04, "1 Coin/20 Credits" )
19751975   PORT_DIPSETTING(    0x08, "1 Coin/50 Credits" )
19761976   PORT_DIPSETTING(    0x0c, "1 Coin/100 Credits" )
19771977   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")   /* OK */
1978   PORT_DIPSETTING(    0x30, "5 Coin/10 Credits" )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // C-Type
1979   PORT_DIPSETTING(    0x20, "2 Coin/10 Credits" )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1980   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1981   PORT_DIPSETTING(    0x00, "1 Coin/20 Credits" )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1982   PORT_DIPSETTING(    0x00, "1 Ticket/Coin / 50 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1983   PORT_DIPSETTING(    0x10, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1984   PORT_DIPSETTING(    0x20, "1 Ticket/Coin / 200 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1985   PORT_DIPSETTING(    0x30, "1 Ticket/Coin / 500 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // D-Type
1978   PORT_DIPSETTING(    0x30, "5 Coin/10 Credits" )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10) // C-Type
1979   PORT_DIPSETTING(    0x20, "2 Coin/10 Credits" )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1980   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1981   PORT_DIPSETTING(    0x00, "1 Coin/20 Credits" )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
1982   PORT_DIPSETTING(    0x00, "1 Ticket/Coin / 50 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1983   PORT_DIPSETTING(    0x10, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1984   PORT_DIPSETTING(    0x20, "1 Ticket/Coin / 200 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
1985   PORT_DIPSETTING(    0x30, "1 Ticket/Coin / 500 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00) // D-Type
19861986   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")   /* OK */
19871987   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )
19881988   PORT_DIPSETTING(    0x40, "1 Coin/20 Credits" )
r15082r15083
21332133
21342134   PORT_START("DSW3")   /* some of these are wrong */
21352135   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")
2136   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // A-Type
2137   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2138   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2139   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" )   PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2140   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // B-Type
2141   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2142   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2143   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2136   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00) // A-Type
2137   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2138   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2139   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" )   PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2140   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40) // B-Type
2141   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
2142   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
2143   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
21442144   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")
21452145   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
21462146   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
21472147   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
21482148   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
21492149   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")
2150   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // C-Type
2151   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
2152   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
2153   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
2154   PORT_DIPSETTING(    0x30, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // D-Type
2155   PORT_DIPSETTING(    0x20, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
2156   PORT_DIPSETTING(    0x10, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
2157   PORT_DIPSETTING(    0x00, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
2150   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10) // C-Type
2151   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
2152   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
2153   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
2154   PORT_DIPSETTING(    0x30, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00) // D-Type
2155   PORT_DIPSETTING(    0x20, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
2156   PORT_DIPSETTING(    0x10, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
2157   PORT_DIPSETTING(    0x00, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
21582158   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")
21592159   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
21602160   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
r15082r15083
23052305
23062306   PORT_START("DSW3")   /* some of these are wrong */
23072307   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")
2308   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // A-Type
2309   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2310   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2311   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" )   PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
2312   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // B-Type
2313   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2314   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2315   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
2308   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00) // A-Type
2309   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2310   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2311   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" )   PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
2312   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40) // B-Type
2313   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
2314   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
2315   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
23162316   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")
23172317   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
23182318   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
23192319   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
23202320   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
23212321   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")
2322   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // C-Type
2323   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
2324   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
2325   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
2326   PORT_DIPSETTING(    0x30, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // D-Type
2327   PORT_DIPSETTING(    0x20, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
2328   PORT_DIPSETTING(    0x10, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
2329   PORT_DIPSETTING(    0x00, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
2322   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10) // C-Type
2323   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
2324   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
2325   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )            PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
2326   PORT_DIPSETTING(    0x30, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00) // D-Type
2327   PORT_DIPSETTING(    0x20, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
2328   PORT_DIPSETTING(    0x10, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
2329   PORT_DIPSETTING(    0x00, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
23302330   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")
23312331   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
23322332   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
r15082r15083
37593759   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
37603760   /* DIP switches 2 to 5 work only for version 3.51 */
37613761   PORT_DIPNAME( 0x02, 0x00, "Limit Score of Each Game to Max 10x Bet or $5.00" )   PORT_DIPLOCATION("DSW5:2")   /* OK */
3762   PORT_DIPSETTING(    0x00, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3763   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3764   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3765   PORT_DIPSETTING(    0x02, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3762   PORT_DIPSETTING(    0x00, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3763   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3764   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
3765   PORT_DIPSETTING(    0x02, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
37663766   PORT_DIPNAME( 0x04, 0x00, "Play Remaining Score when No Credit" )            PORT_DIPLOCATION("DSW5:3")   /* OK */
3767   PORT_DIPSETTING(    0x00, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3768   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3769   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3770   PORT_DIPSETTING(    0x04, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3767   PORT_DIPSETTING(    0x00, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3768   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3769   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
3770   PORT_DIPSETTING(    0x04, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
37713771   PORT_DIPNAME( 0x08, 0x00, "Reset Remaining Score to Zero" )                  PORT_DIPLOCATION("DSW5:4")   /* OK */
3772   PORT_DIPSETTING(    0x00, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3773   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3774   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3775   PORT_DIPSETTING(    0x08, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3772   PORT_DIPSETTING(    0x00, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3773   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3774   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
3775   PORT_DIPSETTING(    0x08, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
37763776   PORT_DIPNAME( 0x10, 0x00, "Ticket Dispense from Score" )                  PORT_DIPLOCATION("DSW5:5")   /* OK */
3777   PORT_DIPSETTING(    0x00, "Use TDDD" )         PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3778   PORT_DIPSETTING(    0x10, "Use Interface" )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3779   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3780   PORT_DIPSETTING(    0x10, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3777   PORT_DIPSETTING(    0x00, "Use TDDD" )         PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3778   PORT_DIPSETTING(    0x10, "Use Interface" )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3779   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
3780   PORT_DIPSETTING(    0x10, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
37813781   PORT_DIPNAME( 0x20, 0x20, "Reel Speed (ver 2.3)" )                        PORT_DIPLOCATION("DSW5:6")   /* OK (turn the machine off/on after change) */
37823782   PORT_DIPSETTING(    0x20, "Slow" )
37833783   PORT_DIPSETTING(    0x00, "Fast" )
r15082r15083
38313831   PORT_DIPSETTING(    0x01, "Level 7" )
38323832   PORT_DIPSETTING(    0x00, "Level 8" )
38333833   PORT_DIPNAME( 0x38, 0x38, "Maximum Play" )            PORT_DIPLOCATION("DSW1:4,5,6")   /* OK */
3834   PORT_DIPSETTING(    0x00, "10" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
3835   PORT_DIPSETTING(    0x08, "20" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
3836   PORT_DIPSETTING(    0x10, "30" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
3837   PORT_DIPSETTING(    0x18, "40" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
3838   PORT_DIPSETTING(    0x00, "8" )      PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
3839   PORT_DIPSETTING(    0x08, "16" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
3840   PORT_DIPSETTING(    0x10, "24" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
3841   PORT_DIPSETTING(    0x18, "32" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
3834   PORT_DIPSETTING(    0x00, "10" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
3835   PORT_DIPSETTING(    0x08, "20" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
3836   PORT_DIPSETTING(    0x10, "30" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
3837   PORT_DIPSETTING(    0x18, "40" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
3838   PORT_DIPSETTING(    0x00, "8" )      PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
3839   PORT_DIPSETTING(    0x08, "16" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
3840   PORT_DIPSETTING(    0x10, "24" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
3841   PORT_DIPSETTING(    0x18, "32" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
38423842   PORT_DIPSETTING(    0x20, "40" )
38433843   PORT_DIPSETTING(    0x28, "48" )
38443844   PORT_DIPSETTING(    0x30, "64" )
38453845   PORT_DIPSETTING(    0x38, "80" )
38463846   PORT_DIPNAME( 0xc0, 0x80, "Minimum Play for Bonus" )   PORT_DIPLOCATION("DSW1:7,8")   /* OK */
3847   PORT_DIPSETTING(    0x00, "10" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
3848   PORT_DIPSETTING(    0x40, "20" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
3849   PORT_DIPSETTING(    0x80, "30" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
3850   PORT_DIPSETTING(    0xc0, "40" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
3851   PORT_DIPSETTING(    0x00, "8" )      PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
3852   PORT_DIPSETTING(    0x40, "16" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
3853   PORT_DIPSETTING(    0x80, "24" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
3854   PORT_DIPSETTING(    0xc0, "32" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
3847   PORT_DIPSETTING(    0x00, "10" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
3848   PORT_DIPSETTING(    0x40, "20" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
3849   PORT_DIPSETTING(    0x80, "30" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
3850   PORT_DIPSETTING(    0xc0, "40" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
3851   PORT_DIPSETTING(    0x00, "8" )      PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
3852   PORT_DIPSETTING(    0x40, "16" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
3853   PORT_DIPSETTING(    0x80, "24" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
3854   PORT_DIPSETTING(    0xc0, "32" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
38553855
38563856   PORT_START("DSW2")
38573857   PORT_DIPNAME( 0x01, 0x01, "Double-Up Game" )         PORT_DIPLOCATION("DSW2:1")   /* OK */
r15082r15083
38813881   PORT_START("DSW3")
38823882   PORT_DIPNAME( 0x03, 0x02, "Minimum Play to Start" )         PORT_DIPLOCATION("DSW3:1,2")   /* OK */
38833883   PORT_DIPSETTING(    0x00, "1" )
3884   PORT_DIPSETTING(    0x01, "10" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
3885   PORT_DIPSETTING(    0x02, "20" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
3886   PORT_DIPSETTING(    0x03, "30" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
3887   PORT_DIPSETTING(    0x01, "8" )      PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
3888   PORT_DIPSETTING(    0x02, "16" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
3889   PORT_DIPSETTING(    0x03, "24" )   PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
3884   PORT_DIPSETTING(    0x01, "10" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
3885   PORT_DIPSETTING(    0x02, "20" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
3886   PORT_DIPSETTING(    0x03, "30" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
3887   PORT_DIPSETTING(    0x01, "8" )      PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
3888   PORT_DIPSETTING(    0x02, "16" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
3889   PORT_DIPSETTING(    0x03, "24" )   PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
38903890   PORT_DIPNAME( 0x0c, 0x08, "Max Coin In & Note In Point" )   PORT_DIPLOCATION("DSW3:3,4")   /* OK */
38913891   PORT_DIPSETTING(    0x00, "1000" )
38923892   PORT_DIPSETTING(    0x04, "5000" )
r15082r15083
39413941   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
39423942   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
39433943   PORT_DIPNAME( 0x02, 0x00, "Limit Score of Each Game to Max 10x Bet or $5.00" )   PORT_DIPLOCATION("DSW5:2")   /* OK */
3944   PORT_DIPSETTING(    0x00, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3945   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3946   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3947   PORT_DIPSETTING(    0x02, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3944   PORT_DIPSETTING(    0x00, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3945   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3946   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
3947   PORT_DIPSETTING(    0x02, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
39483948   PORT_DIPNAME( 0x04, 0x00, "Use Printer" )                              PORT_DIPLOCATION("DSW5:3")   /* OK */
39493949   PORT_DIPSETTING(    0x00, "No (Use TDDD)" )
39503950   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
r15082r15083
39553955   PORT_DIPSETTING(    0x10, "Base 8" )
39563956   PORT_DIPSETTING(    0x00, "Base 10" )
39573957   PORT_DIPNAME( 0x20, 0x20, "Play Score when no point left" )                  PORT_DIPLOCATION("DSW5:6")   /* OK (turn the machine off/on after change) */
3958   PORT_DIPSETTING(    0x20, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3959   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3960   PORT_DIPSETTING(    0x20, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3961   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3958   PORT_DIPSETTING(    0x20, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3959   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3960   PORT_DIPSETTING(    0x20, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
3961   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
39623962   PORT_DIPNAME( 0x40, 0x00, "Reset Remaining Score when Game Over" )            PORT_DIPLOCATION("DSW5:7")   /* OK (turn the machine off/on after change) */
3963   PORT_DIPSETTING(    0x40, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3964   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
3965   PORT_DIPSETTING(    0x40, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3966   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
3963   PORT_DIPSETTING(    0x40, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3964   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
3965   PORT_DIPSETTING(    0x40, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
3966   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
39673967   PORT_DIPNAME( 0x80, 0x00, "Advanced Count Game" )                        PORT_DIPLOCATION("DSW5:8")   /* OK (turn the machine off/on after change) */
39683968   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
39693969   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
r15082r15083
41114111   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
41124112   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
41134113   PORT_DIPNAME( 0x02, 0x00, "Limit Score of Each Game to Max 10x Bet or $5.00" )   PORT_DIPLOCATION("DSW5:2")   /* OK */
4114   PORT_DIPSETTING(    0x00, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
4115   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
4116   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
4117   PORT_DIPSETTING(    0x02, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
4114   PORT_DIPSETTING(    0x00, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
4115   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
4116   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
4117   PORT_DIPSETTING(    0x02, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
41184118   PORT_DIPNAME( 0x04, 0x00, "Use Printer" )                              PORT_DIPLOCATION("DSW5:3")   /* OK */
41194119   PORT_DIPSETTING(    0x00, "Interfase" )
41204120   PORT_DIPSETTING(    0x04, "Direct Driver" )
r15082r15083
41254125   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
41264126   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
41274127   PORT_DIPNAME( 0x20, 0x20, "Play Score when no point left" )                  PORT_DIPLOCATION("DSW5:6")   /* OK (turn the machine off/on after change) */
4128   PORT_DIPSETTING(    0x20, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
4129   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
4130   PORT_DIPSETTING(    0x20, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
4131   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
4128   PORT_DIPSETTING(    0x20, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
4129   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
4130   PORT_DIPSETTING(    0x20, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
4131   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
41324132   PORT_DIPNAME( 0x40, 0x00, "Reset Remaining Score when Game Over" )            PORT_DIPLOCATION("DSW5:7")   /* OK (turn the machine off/on after change) */
4133   PORT_DIPSETTING(    0x40, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
4134   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
4135   PORT_DIPSETTING(    0x40, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
4136   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
4133   PORT_DIPSETTING(    0x40, DEF_STR( No ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
4134   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )      PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
4135   PORT_DIPSETTING(    0x40, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
4136   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )   PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
41374137   PORT_DIPNAME( 0x80, 0x00, "Advanced Count Game" )                        PORT_DIPLOCATION("DSW5:8")   /* OK (turn the machine off/on after change) */
41384138   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
41394139   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
src/mame/drivers/seicross.c
r15082r15083
8585{
8686   seicross_state *state = device->machine().driver_data<seicross_state>();
8787
88   return (state->m_portb & 0x9f) | (input_port_read_safe(device->machine(), "DEBUG", 0) & 0x60);
88   return (state->m_portb & 0x9f) | (state->ioport("DEBUG")->read_safe(0) & 0x60);
8989}
9090
9191static WRITE8_DEVICE_HANDLER( friskyt_portB_w )
src/mame/drivers/system16.c
r15082r15083
203203
204204READ16_MEMBER(segas1x_bootleg_state::passht4b_service_r)
205205{
206   UINT16 val = input_port_read(machine(), "SERVICE");
206   UINT16 val = ioport("SERVICE")->read();
207207
208   if(!(input_port_read(machine(), "P1") & 0x40)) val &= 0xef;
209   if(!(input_port_read(machine(), "P2") & 0x40)) val &= 0xdf;
210   if(!(input_port_read(machine(), "P3") & 0x40)) val &= 0xbf;
211   if(!(input_port_read(machine(), "P4") & 0x40)) val &= 0x7f;
208   if(!(ioport("P1")->read() & 0x40)) val &= 0xef;
209   if(!(ioport("P2")->read() & 0x40)) val &= 0xdf;
210   if(!(ioport("P3")->read() & 0x40)) val &= 0xbf;
211   if(!(ioport("P4")->read() & 0x40)) val &= 0x7f;
212212
213   m_passht4b_io3_val = (input_port_read(machine(), "P1") << 4) | (input_port_read(machine(), "P3") & 0xf);
214   m_passht4b_io2_val = (input_port_read(machine(), "P2") << 4) | (input_port_read(machine(), "P4") & 0xf);
213   m_passht4b_io3_val = (ioport("P1")->read() << 4) | (ioport("P3")->read() & 0xf);
214   m_passht4b_io2_val = (ioport("P2")->read() << 4) | (ioport("P4")->read() & 0xf);
215215
216216   m_passht4b_io1_val = 0xff;
217217
218218   // player 1 buttons
219   if(!(input_port_read(machine(), "P1") & 0x10)) m_passht4b_io1_val &= 0xfe;
220   if(!(input_port_read(machine(), "P1") & 0x20)) m_passht4b_io1_val &= 0xfd;
221   if(!(input_port_read(machine(), "P1") & 0x80)) m_passht4b_io1_val &= 0xfc;
219   if(!(ioport("P1")->read() & 0x10)) m_passht4b_io1_val &= 0xfe;
220   if(!(ioport("P1")->read() & 0x20)) m_passht4b_io1_val &= 0xfd;
221   if(!(ioport("P1")->read() & 0x80)) m_passht4b_io1_val &= 0xfc;
222222
223223   // player 2 buttons
224   if(!(input_port_read(machine(), "P2") & 0x10)) m_passht4b_io1_val &= 0xfb;
225   if(!(input_port_read(machine(), "P2") & 0x20)) m_passht4b_io1_val &= 0xf7;
226   if(!(input_port_read(machine(), "P2") & 0x80)) m_passht4b_io1_val &= 0xf3;
224   if(!(ioport("P2")->read() & 0x10)) m_passht4b_io1_val &= 0xfb;
225   if(!(ioport("P2")->read() & 0x20)) m_passht4b_io1_val &= 0xf7;
226   if(!(ioport("P2")->read() & 0x80)) m_passht4b_io1_val &= 0xf3;
227227
228228   // player 3 buttons
229   if(!(input_port_read(machine(), "P3") & 0x10)) m_passht4b_io1_val &= 0xef;
230   if(!(input_port_read(machine(), "P3") & 0x20)) m_passht4b_io1_val &= 0xdf;
231   if(!(input_port_read(machine(), "P3") & 0x80)) m_passht4b_io1_val &= 0xcf;
229   if(!(ioport("P3")->read() & 0x10)) m_passht4b_io1_val &= 0xef;
230   if(!(ioport("P3")->read() & 0x20)) m_passht4b_io1_val &= 0xdf;
231   if(!(ioport("P3")->read() & 0x80)) m_passht4b_io1_val &= 0xcf;
232232
233233   // player 4 buttons
234   if(!(input_port_read(machine(), "P4") & 0x10)) m_passht4b_io1_val &= 0xbf;
235   if(!(input_port_read(machine(), "P4") & 0x20)) m_passht4b_io1_val &= 0x7f;
236   if(!(input_port_read(machine(), "P4") & 0x80)) m_passht4b_io1_val &= 0x3f;
234   if(!(ioport("P4")->read() & 0x10)) m_passht4b_io1_val &= 0xbf;
235   if(!(ioport("P4")->read() & 0x20)) m_passht4b_io1_val &= 0x7f;
236   if(!(ioport("P4")->read() & 0x80)) m_passht4b_io1_val &= 0x3f;
237237
238238   return val;
239239}
r15082r15083
18921892   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE4 )
18931893
18941894   PORT_MODIFY("COINAGE")
1895   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:5,6,7,8") PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x20)
1895   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:5,6,7,8") PORT_CONDITION("DSW1",0x20,EQUALS,0x20)
18961896   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
18971897   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
18981898   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
r15082r15083
33493349{
33503350   segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
33513351   int i;
3352   UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
3352   UINT8 *ROM = state->memregion("maincpu")->base();
33533353   UINT8 *KEY = state->memregion("decryption")->base();
33543354   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
33553355   UINT8 data[0x1000];
src/mame/drivers/nyny.c
r15082r15083
169169   /* update the different PIA pins from the input ports */
170170
171171   /* CA1 - copy of PA0 (COIN1) */
172   state->m_pia1->ca1_w(input_port_read(device->machine(), "IN0") & 0x01);
172   state->m_pia1->ca1_w(state->ioport("IN0")->read() & 0x01);
173173
174174   /* CA2 - copy of PA1 (SERVICE1) */
175   state->m_pia1->ca2_w(input_port_read(device->machine(), "IN0") & 0x02);
175   state->m_pia1->ca2_w(state->ioport("IN0")->read() & 0x02);
176176
177177   /* CB1 - (crosshatch) */
178   state->m_pia1->cb1_w(input_port_read(device->machine(), "CROSS"));
178   state->m_pia1->cb1_w(state->ioport("CROSS")->read());
179179
180180   /* CB2 - NOT CONNECTED */
181181}
src/mame/drivers/limenko.c
r15082r15083
371371   limenko_state *state = machine.driver_data<limenko_state>();
372372   int i;
373373
374   UINT8 *base_gfx   = machine.root_device().memregion("gfx1")->base();
374   UINT8 *base_gfx   = state->memregion("gfx1")->base();
375375   UINT8 *gfx_max   = base_gfx + state->memregion("gfx1")->bytes();
376376
377377   UINT8 *gfxdata;
r15082r15083
10661066static DRIVER_INIT( spotty )
10671067{
10681068   limenko_state *state = machine.driver_data<limenko_state>();
1069   UINT8 *dst    = machine.root_device().memregion("gfx1")->base();
1069   UINT8 *dst    = state->memregion("gfx1")->base();
10701070   UINT8 *src    = state->memregion("user2")->base();
10711071   int x;
10721072
src/mame/drivers/prehisle.c
r15082r15083
140140   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SW2:7")
141141   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
142142   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
143   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
143   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
144144INPUT_PORTS_END
145145
146146/******************************************************************************/
src/mame/drivers/byvid.c
r15082r15083
88#include "cpu/m6809/m6809.h"
99#include "video/tms9928a.h"
1010#include "machine/6821pia.h"
11#include "sound/dac.h"
1112
1213class by133_state : public driver_device
1314{
r15082r15083
1617      : driver_device(mconfig, type, tag),
1718        m_maincpu(*this, "maincpu"),
1819        m_videocpu(*this, "videocpu"),
19        m_pia(*this, "pia")
20        m_audiocpu(*this, "audiocpu"),
21        m_videopia(*this, "videopia")
2022   { }
2123
22
2324   // devices
2425   required_device<cpu_device> m_maincpu;
2526   required_device<cpu_device> m_videocpu;
26   required_device<pia6821_device> m_pia;
27   required_device<cpu_device> m_audiocpu;
28   required_device<pia6821_device> m_videopia;
2729
28   DECLARE_INPUT_CHANGED_MEMBER(test_switch_press);
30   DECLARE_READ8_MEMBER(m6803_port2_r);
31
32   DECLARE_INPUT_CHANGED_MEMBER(video_test);
33   DECLARE_INPUT_CHANGED_MEMBER(sound_test);
2934//  UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
35
3036protected:
3137
3238   // driver_device overrides
r15082r15083
4046}
4147#endif
4248
43static ADDRESS_MAP_START( by133_map, AS_PROGRAM, 8, by133_state )
49static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, by133_state )
4450   AM_RANGE(0x0000, 0xffff) AM_NOP
4551   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
4652   AM_RANGE(0x1000, 0x7fff) AM_ROM
r15082r15083
4854
4955
5056
51static ADDRESS_MAP_START( by133_video_map, AS_PROGRAM, 8, by133_state )
57static ADDRESS_MAP_START( video_map, AS_PROGRAM, 8, by133_state )
5258//  AM_RANGE(0x0000, 0x1fff) communication with main CPU
53   AM_RANGE(0x2000, 0x2003) AM_DEVREADWRITE("pia", pia6821_device, read, write)
54   AM_RANGE(0x4000, 0x4000) AM_DEVREADWRITE( "tms9928a", tms9928a_device, vram_read, vram_write )
55   AM_RANGE(0x4001, 0x4001) AM_DEVREADWRITE( "tms9928a", tms9928a_device, register_read, register_write )
59   AM_RANGE(0x2000, 0x2003) AM_DEVREADWRITE("videopia", pia6821_device, read, write)
60   AM_RANGE(0x4000, 0x4000) AM_DEVREADWRITE("tms9928a", tms9928a_device, vram_read, vram_write)
61   AM_RANGE(0x4001, 0x4001) AM_DEVREADWRITE("tms9928a", tms9928a_device, register_read, register_write)
5662   AM_RANGE(0x6000, 0x63ff) AM_RAM
5763   AM_RANGE(0x8000, 0xffff) AM_ROM
5864ADDRESS_MAP_END
5965
60INPUT_CHANGED_MEMBER(by133_state::test_switch_press)
66
67
68READ8_MEMBER(by133_state::m6803_port2_r)
6169{
70   // TODO: port 2 to /reset pin (see schematics)
71   UINT8 d0 = m_videopia->cb2_output() ? 1 : 0;
72   return (m_videopia->b_output() << 1 & 0x1e) | d0;
73}
6274
75static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, by133_state )
76   AM_RANGE(0xc000, 0xffff) AM_ROM
77ADDRESS_MAP_END
78
79static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, by133_state )
80   AM_RANGE(M6801_PORT1, M6801_PORT1) AM_DEVWRITE_LEGACY("dac", dac_w)
81   AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READ(m6803_port2_r)
82ADDRESS_MAP_END
83
84
85INPUT_CHANGED_MEMBER(by133_state::video_test)
86{
6387   if(newval)
6488      device_set_input_line(m_videocpu, INPUT_LINE_NMI, PULSE_LINE);
6589}
6690
91INPUT_CHANGED_MEMBER(by133_state::sound_test)
92{
93   if(newval)
94      device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
95}
96
6797static INPUT_PORTS_START( by133 )
68   /* service switch is directly hard-wired with the NMI signal */
98   /* test switch is directly hard-wired to the NMI signal */
6999   PORT_START("TEST")
70   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, by133_state,test_switch_press, 0)
100   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Video Test") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, by133_state, video_test, 0)
101   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Sound Test") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, by133_state, sound_test, 0)
71102INPUT_PORTS_END
72103
73104void by133_state::machine_reset()
r15082r15083
80111
81112static WRITE_LINE_DEVICE_HANDLER(vdp_interrupt)
82113{
83   cputag_set_input_line(device->machine(), "videocpu", M6809_IRQ_LINE, (state ? ASSERT_LINE : CLEAR_LINE));
114   cputag_set_input_line(device->machine(), "videocpu", M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
84115}
85116
86117static TMS9928A_INTERFACE(byvid_tms9928a_interface)
r15082r15083
90121   DEVCB_LINE(vdp_interrupt)
91122};
92123
93static WRITE_LINE_DEVICE_HANDLER( by133_firq )
124static WRITE_LINE_DEVICE_HANDLER(by133_firq)
94125{
95   cputag_set_input_line(device->machine(), "videocpu", M6809_FIRQ_LINE, (state ? ASSERT_LINE : CLEAR_LINE));
126   by133_state *drv_state = device->machine().driver_data<by133_state>();
127   device_set_input_line(drv_state->m_videocpu, M6809_FIRQ_LINE, (drv_state->m_videopia->irq_a_state() || drv_state->m_videopia->irq_b_state()) ? ASSERT_LINE : CLEAR_LINE);
96128}
97129
130static WRITE_LINE_DEVICE_HANDLER(by133_cb2)
131{
132   // to M6803 port 2 d0
133   by133_state *drv_state = device->machine().driver_data<by133_state>();
134   device_set_input_line(drv_state->m_audiocpu, M6801_TIN_LINE, state ? ASSERT_LINE : CLEAR_LINE);
135}
136
98137static READ8_DEVICE_HANDLER(by133_portb_r)
99138{
100139   return 0;
101140}
102141
103static const pia6821_interface pia_intf =
142static const pia6821_interface videopia_intf =
104143{
105144   DEVCB_NULL,      /* port A in */
106145   DEVCB_HANDLER(by133_portb_r),      /* port B in */
r15082r15083
111150   DEVCB_NULL,      /* port A out */
112151   DEVCB_NULL,      /* port B out */
113152   DEVCB_NULL,      /* line CA2 out */
114   DEVCB_NULL,      /* port CB2 out */
153   DEVCB_LINE(by133_cb2),      /* line CB2 out */
115154   DEVCB_LINE(by133_firq),      /* IRQA */
116155   DEVCB_LINE(by133_firq)      /* IRQB */
117156};
r15082r15083
121160   /* basic machine hardware */
122161   MCFG_CPU_ADD("maincpu", M6800, 3580000/4)
123162   MCFG_DEVICE_DISABLE()
124   MCFG_CPU_PROGRAM_MAP(by133_map)
163   MCFG_CPU_PROGRAM_MAP(main_map)
125164
126165   MCFG_CPU_ADD("videocpu", M6809, 3580000/4)
127   MCFG_CPU_PROGRAM_MAP(by133_video_map)
166   MCFG_CPU_PROGRAM_MAP(video_map)
128167
129   MCFG_PIA6821_ADD("pia", pia_intf)
168   MCFG_CPU_ADD("audiocpu", M6803, XTAL_3_579545MHz)
169   MCFG_CPU_PROGRAM_MAP(sound_map)
170   MCFG_CPU_IO_MAP(sound_portmap)
130171
172   MCFG_PIA6821_ADD("videopia", videopia_intf)
173
131174   /* video hardware */
132175   MCFG_TMS9928A_ADD( "tms9928a", TMS9928A, byvid_tms9928a_interface )
133176   MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
134177   MCFG_SCREEN_UPDATE_DEVICE( "tms9928a", tms9928a_device, screen_update )
135178
136
137179   /* sound hardware */
138180   MCFG_SPEAKER_STANDARD_MONO("mono")
139//  MCFG_SOUND_ADD("aysnd", AY8910, MAIN_CLOCK/4)
140//  MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
181
182   MCFG_SOUND_ADD("dac", DAC, 0)
183   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
141184MACHINE_CONFIG_END
142185
143186/*-----------------------------------------------------
r15082r15083
149192   ROM_CONTINUE( 0x5000, 0x0800)
150193   ROM_LOAD( "891-u6.732", 0x1800, 0x0800, CRC(6136d636) SHA1(c01a0a2fcad3bdabd649128e012ab558b1c90cd3) )
151194   ROM_CONTINUE( 0x5800, 0x0800)
152   ROM_RELOAD( 0x7000, 0x1000)
195   ROM_RELOAD(   0x7000, 0x1000)
196
153197   ROM_REGION(0x10000, "videocpu", 0)
154   ROM_LOAD( "891-u9.764",  0x8000, 0x2000, CRC(7fa570f3) SHA1(423ad9266b1ded00fa52ce4180d518874142a203))
155   ROM_LOAD( "891-u10.764", 0xa000, 0x2000, CRC(28f4df8b) SHA1(bd6a3598c2c90b5a3a59327616d2f5b9940d98bc))
156   ROM_LOAD( "891-u11.764", 0xc000, 0x2000, CRC(0a5967a4) SHA1(26d56ddea3f39d41e382449007bf7ba113c0285f))
157   ROM_LOAD( "891-u12.764", 0xe000, 0x2000, CRC(58cfe542) SHA1(e024d14019866bd460d1da6b901f9b786a76a181))
158   ROM_REGION(0x10000, "soundcpu", 0)
159   ROM_LOAD( "891-u29.764", 0xe000, 0x2000, CRC(0b57fd5d) SHA1(43a03e6d16c87c3305adb04722484f992f23a1bd))
198   ROM_LOAD( "891-16-u09.764", 0x8000, 0x2000, CRC(781e90e9) SHA1(940047cc875ae531a825af069bb650d59c9495a6))
199   ROM_LOAD( "891-11-u10.764", 0xa000, 0x2000, CRC(28f4df8b) SHA1(bd6a3598c2c90b5a3a59327616d2f5b9940d98bc))
200   ROM_LOAD( "891-05-u11.764", 0xc000, 0x2000, CRC(0a5967a4) SHA1(26d56ddea3f39d41e382449007bf7ba113c0285f))
201   ROM_LOAD( "891-06-u12.764", 0xe000, 0x2000, CRC(58cfe542) SHA1(e024d14019866bd460d1da6b901f9b786a76a181))
202
203   ROM_REGION(0x10000, "audiocpu", 0)
204   ROM_LOAD( "891-12-u29.764", 0xe000, 0x2000, CRC(0b57fd5d) SHA1(43a03e6d16c87c3305adb04722484f992f23a1bd))
160205ROM_END
161206
207ROM_START(babypac2)
208   ROM_REGION(0x10000, "maincpu", 0)
209   ROM_LOAD( "891-u2.732", 0x1000, 0x0800, CRC(7f7242d1) SHA1(213a697bb7fc69f93ea04621f0fcfdd796f35196))
210   ROM_CONTINUE( 0x5000, 0x0800)
211   ROM_LOAD( "891-u6.732", 0x1800, 0x0800, CRC(6136d636) SHA1(c01a0a2fcad3bdabd649128e012ab558b1c90cd3) )
212   ROM_CONTINUE( 0x5800, 0x0800)
213   ROM_RELOAD(   0x7000, 0x1000)
214
215   ROM_REGION(0x10000, "videocpu", 0)
216   ROM_LOAD( "891-13-u09.764", 0x8000, 0x2000, CRC(7fa570f3) SHA1(423ad9266b1ded00fa52ce4180d518874142a203))
217   ROM_LOAD( "891-11-u10.764", 0xa000, 0x2000, CRC(28f4df8b) SHA1(bd6a3598c2c90b5a3a59327616d2f5b9940d98bc))
218   ROM_LOAD( "891-05-u11.764", 0xc000, 0x2000, CRC(0a5967a4) SHA1(26d56ddea3f39d41e382449007bf7ba113c0285f))
219   ROM_LOAD( "891-06-u12.764", 0xe000, 0x2000, CRC(58cfe542) SHA1(e024d14019866bd460d1da6b901f9b786a76a181))
220
221   ROM_REGION(0x10000, "audiocpu", 0)
222   ROM_LOAD( "891-12-u29.764", 0xe000, 0x2000, CRC(0b57fd5d) SHA1(43a03e6d16c87c3305adb04722484f992f23a1bd))
223ROM_END
224
162225/*-----------------------------------------------------------------
163226/ Granny and the Gators (Video/Pinball Combo) - (BY35-???: 01/84)
164227/----------------------------------------------------------------*/
r15082r15083
168231   ROM_CONTINUE( 0x5000, 0x0800)
169232   ROM_LOAD( "cpu_u6.532", 0x1800, 0x0800, CRC(306aa673) SHA1(422c3d9decf9214a18edb536c2077bf52b272e7d) )
170233   ROM_CONTINUE( 0x5800, 0x0800)
171   ROM_RELOAD( 0xf000, 0x1000)
234   ROM_RELOAD(   0xf000, 0x1000)
235
172236   ROM_REGION(0x10000, "videocpu", 0)
173237   ROM_LOAD( "vid_u4.764", 0x4000, 0x2000, CRC(3a3d4c6b) SHA1(a6c27eee178a4bde67004e11f6ddf3b6414571dd))
174238   ROM_LOAD( "vid_u5.764", 0x6000, 0x2000, CRC(78bcb0fb) SHA1(d9dc1cc1bef063d5fbdbf2d1daf793234a9c55a0))
r15082r15083
176240   ROM_LOAD( "vid_u7.764", 0xa000, 0x2000, CRC(aa71cf29) SHA1(b69cd4060f5d4d2a7f85d901552cdc987013fde2))
177241   ROM_LOAD( "vid_u8.764", 0xc000, 0x2000, CRC(a442bc01) SHA1(2c01123dc5799561ae9e7c5d6db588b82b5ae59c))
178242   ROM_LOAD( "vid_u9.764", 0xe000, 0x2000, CRC(6b67a1f7) SHA1(251c2b941898363bbd6ee1a94710e2b2938ec851))
179   ROM_REGION(0x10000, "soundcpu", 0)
243
244   ROM_REGION(0x10000, "audiocpu", 0)
180245   ROM_LOAD( "cs_u3.764", 0xe000, 0x2000, CRC(0a39a51d) SHA1(98342ba38e48578ce9870f2ee85b553d46c0e35f))
181246ROM_END
182247
183248
184GAME(1982,  babypac,  0,  by133,  by133,  by133,  ROT90,  "Bally",    "Baby Pacman (Video/Pinball Combo)",              GAME_IS_SKELETON_MECHANICAL)
185GAME(1984,  granny,   0,  by133,  by133,  by133,  ROT0,  "Bally",    "Granny and the Gators (Video/Pinball Combo)",    GAME_IS_SKELETON_MECHANICAL)
249GAME( 1982, babypac,  0,        by133,  by133,  by133,  ROT90, "Bally",    "Baby Pac-Man (set 1)",     GAME_IS_SKELETON_MECHANICAL)
250GAME( 1982, babypac2, babypac,  by133,  by133,  by133,  ROT90, "Bally",    "Baby Pac-Man (set 2)",     GAME_IS_SKELETON_MECHANICAL)
251GAME( 1984, granny,   0,        by133,  by133,  by133,  ROT0,  "Bally",    "Granny and the Gators",    GAME_IS_SKELETON_MECHANICAL)
src/mame/drivers/actfancr.c
r15082r15083
4343{
4444   switch (m_trio_control_select)
4545   {
46      case 0: return input_port_read(machine(), "P1");
47      case 1: return input_port_read(machine(), "P2");
48      case 2: return input_port_read(machine(), "DSW1");
49      case 3: return input_port_read(machine(), "DSW2");
50      case 4: return input_port_read(machine(), "SYSTEM");   /* VBL */
46      case 0: return ioport("P1")->read();
47      case 1: return ioport("P2")->read();
48      case 2: return ioport("DSW1")->read();
49      case 3: return ioport("DSW2")->read();
50      case 4: return ioport("SYSTEM")->read();   /* VBL */
5151   }
5252
5353   return 0xff;
r15082r15083
154154   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
155155   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
156156   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
157   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
157   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
158158
159159   PORT_START("DSW1")
160160   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:1,2")
src/mame/drivers/model1.c
r15082r15083
640640   static const char *const inputnames[] = { "IN0", "IN1", "IN2" };
641641
642642   if(offset < 0x8)
643      return input_port_read_safe(machine(), analognames[offset], 0x00);
643      return ioport(analognames[offset])->read_safe(0x00);
644644
645645   if(offset < 0x10)
646646   {
647647      offset -= 0x8;
648648      if(offset < 3)
649         return input_port_read(machine(), inputnames[offset]);
649         return ioport(inputnames[offset])->read();
650650      return 0xff;
651651   }
652652
src/mame/drivers/polepos.c
r15082r15083
267267
268268READ8_MEMBER(polepos_state::polepos_adc_r)
269269{
270   return input_port_read(machine(), m_adc_input ? "ACCEL" : "BRAKE");
270   return ioport(m_adc_input ? "ACCEL" : "BRAKE")->read();
271271}
272272
273273READ8_MEMBER(polepos_state::polepos_ready_r)
r15082r15083
340340}
341341
342342
343CUSTOM_INPUT_MEMBER(polepos_state::high_port_r){ return input_port_read(field.machine(), (const char *)param) >> 4; }
344CUSTOM_INPUT_MEMBER(polepos_state::low_port_r){ return input_port_read(field.machine(), (const char *)param) & 0x0f; }
343CUSTOM_INPUT_MEMBER(polepos_state::high_port_r){ return field.machine().root_device().ioport((const char *)param)->read() >> 4; }
344CUSTOM_INPUT_MEMBER(polepos_state::low_port_r){ return field.machine().root_device().ioport((const char *)param)->read() & 0x0f; }
345345CUSTOM_INPUT_MEMBER(polepos_state::auto_start_r)
346346{
347347   return m_auto_start_mask;
r15082r15083
409409{
410410   polepos_state *state = device->machine().driver_data<polepos_state>();
411411   /* read the current steering value and update our delta */
412   UINT8 steer_new = input_port_read(device->machine(), "STEER");
412   UINT8 steer_new = state->ioport("STEER")->read();
413413   state->m_steer_accum += (INT8)(steer_new - state->m_steer_last) * 2;
414414   state->m_steer_last = steer_new;
415415
src/mame/drivers/tank8.c
r15082r15083
257257   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "RC 8" )
258258
259259   PORT_START("VBLANK")
260   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
260   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
261261
262262   PORT_START("CRASH")
263263   PORT_ADJUSTER( 50, "Crash, Explosion Volume" )
src/mame/drivers/qdrmfgp.c
r15082r15083
4141{
4242   const char *tag1 = (const char *)param;
4343   const char *tag2 = tag1 + strlen(tag1) + 1;
44   return input_port_read(machine(), (m_control & 0x0080) ? tag1 : tag2);
44   return ioport((m_control & 0x0080) ? tag1 : tag2)->read();
4545}
4646
4747CUSTOM_INPUT_MEMBER(qdrmfgp_state::battery_sensor_r)
src/mame/drivers/cps1.c
r15082r15083
247247READ16_MEMBER(cps_state::cps1_dsw_r)
248248{
249249   static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" };
250   int in = input_port_read(machine(), dswname[offset]);
250   int in = ioport(dswname[offset])->read();
251251   return (in << 8) | 0xff;
252252}
253253
254254READ16_MEMBER(cps_state::cps1_hack_dsw_r)
255255{
256256   static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" };
257   int in = input_port_read(machine(), dswname[offset]);
257   int in = ioport(dswname[offset])->read();
258258   return (in << 8) | in;
259259}
260260
261261READ16_MEMBER(cps_state::forgottn_dial_0_r)
262262{
263   return ((input_port_read(machine(), "DIAL0") - m_dial[0]) >> (8 * offset)) & 0xff;
263   return ((ioport("DIAL0")->read() - m_dial[0]) >> (8 * offset)) & 0xff;
264264}
265265
266266READ16_MEMBER(cps_state::forgottn_dial_1_r)
267267{
268   return ((input_port_read(machine(), "DIAL1") - m_dial[1]) >> (8 * offset)) & 0xff;
268   return ((ioport("DIAL1")->read() - m_dial[1]) >> (8 * offset)) & 0xff;
269269}
270270
271271WRITE16_MEMBER(cps_state::forgottn_dial_0_reset_w)
272272{
273   m_dial[0] = input_port_read(machine(), "DIAL0");
273   m_dial[0] = ioport("DIAL0")->read();
274274}
275275
276276WRITE16_MEMBER(cps_state::forgottn_dial_1_reset_w)
277277{
278   m_dial[1] = input_port_read(machine(), "DIAL1");
278   m_dial[1] = ioport("DIAL1")->read();
279279}
280280
281281
r15082r15083
912912
913913   PORT_MODIFY("DSWB")
914914   /* Standard Dip Switches */
915   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):1,2,3")
915   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):1,2,3")
916916   PORT_DIPSETTING(    0x04, "1 (Easiest)" )
917917   PORT_DIPSETTING(    0x05, "2" )
918918   PORT_DIPSETTING(    0x06, "3" )
r15082r15083
921921   PORT_DIPSETTING(    0x02, "6" )
922922   PORT_DIPSETTING(    0x01, "7" )
923923   PORT_DIPSETTING(    0x00, "8 (Hardest)" )
924   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):4")
924   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):4")
925925   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
926926   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
927   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )  PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):5,6")
927   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )  PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):5,6")
928928   PORT_DIPSETTING(    0x20, "10K, 30K and every 30K" )
929929   PORT_DIPSETTING(    0x10, "20K, 50K and every 70K" )
930930   PORT_DIPSETTING(    0x30, "30K, 60K and every 70K" )
931931   PORT_DIPSETTING(    0x00, "40K, 70K and every 80K" )
932932   /* Debug Dip Switches */
933   PORT_DIPNAME( 0x07, 0x07, "Starting Weapon" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):1,2,3")
933   PORT_DIPNAME( 0x07, 0x07, "Starting Weapon" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(B):1,2,3")
934934   PORT_DIPSETTING(    0x07, "Spear" )
935935   PORT_DIPSETTING(    0x06, "Knife" )
936936   PORT_DIPSETTING(    0x05, "Torch" )
r15082r15083
939939   PORT_DIPSETTING(    0x02, "Shield" )
940940   PORT_DIPSETTING(    0x01, "Super Weapon" )
941941//  PORT_DIPSETTING(    0x00, "INVALID !" )
942   PORT_DIPNAME( 0x38, 0x30, "Armor on New Life" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):4,5,6")
942   PORT_DIPNAME( 0x38, 0x30, "Armor on New Life" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(B):4,5,6")
943943//  PORT_DIPSETTING(    0x38, "Silver Armor" )
944944   PORT_DIPSETTING(    0x18, "Golden Armor" )
945945   PORT_DIPSETTING(    0x30, "Silver Armor" )
r15082r15083
956956
957957   PORT_MODIFY("DSWA")
958958   /* Standard Dip Switches */
959   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):1,2,3")
959   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(A):1,2,3")
960960   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
961961   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
962962   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
r15082r15083
965965   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
966966   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
967967   PORT_DIPSETTING(    0x03, DEF_STR( 1C_6C ) )
968   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):4,5,6")
968   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(A):4,5,6")
969969   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
970970   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
971971   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
r15082r15083
975975   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
976976   PORT_DIPSETTING(    0x18, DEF_STR( 1C_6C ) )
977977   /* Debug Dip Switches */
978   PORT_DIPNAME( 0x0f, 0x0f, "Starting Level" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):1,2,3,4")
978   PORT_DIPNAME( 0x0f, 0x0f, "Starting Level" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):1,2,3,4")
979979   PORT_DIPSETTING(    0x0f, "Level 1 (1st half)" )
980980   PORT_DIPSETTING(    0x0e, "Level 1 (2nd half)" )
981981   PORT_DIPSETTING(    0x0d, "Level 2 (1st half)" )
r15082r15083
992992//  PORT_DIPSETTING(    0x02, "INVALID !" )
993993//  PORT_DIPSETTING(    0x01, "INVALID !" )
994994//  PORT_DIPSETTING(    0x00, "INVALID !" )
995   PORT_DIPNAME( 0x10, 0x10, "Invulnerability" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):5")
995   PORT_DIPNAME( 0x10, 0x10, "Invulnerability" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):5")
996996   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
997997   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
998   PORT_DIPNAME( 0x20, 0x20, "Slow Motion" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):6")
998   PORT_DIPNAME( 0x20, 0x20, "Slow Motion" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):6")
999999   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
10001000   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10011001
r15082r15083
11391139
11401140   PORT_START("DSWC")
11411141   /* Standard Dip Switches */
1142   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(C):1,2")
1142   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(C):1,2")
11431143   PORT_DIPSETTING(    0x02, "1" )
11441144   PORT_DIPSETTING(    0x03, "2" )
11451145   PORT_DIPSETTING(    0x01, "3" )
11461146   PORT_DIPSETTING(    0x00, "4" )
1147   PORT_DIPNAME( 0x0c, 0x0c, "Vitality" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(C):3,4")
1147   PORT_DIPNAME( 0x0c, 0x0c, "Vitality" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(C):3,4")
11481148   PORT_DIPSETTING(    0x00, "2" )
11491149   PORT_DIPSETTING(    0x0c, "3" )
11501150   PORT_DIPSETTING(    0x08, "4" )
11511151   PORT_DIPSETTING(    0x04, "5" )
11521152   /* Debug Dip Switches */
1153   PORT_DIPNAME( 0x01, 0x01, "Turbo Mode" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):1")
1153   PORT_DIPNAME( 0x01, 0x01, "Turbo Mode" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(C):1")
11541154   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11551155   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1156   PORT_DIPNAME( 0x02, 0x02, "Freeze" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):2")
1156   PORT_DIPNAME( 0x02, 0x02, "Freeze" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(C):2")
11571157   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
11581158   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1159   PORT_DIPNAME( 0x04, 0x04, "Slow Motion" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):3")
1159   PORT_DIPNAME( 0x04, 0x04, "Slow Motion" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(C):3")
11601160   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
11611161   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1162   PORT_DIPNAME( 0x08, 0x08, "Invulnerability" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):4")
1162   PORT_DIPNAME( 0x08, 0x08, "Invulnerability" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(C):4")
11631163   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
11641164   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11651165
r15082r15083
11681168   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11691169
11701170   /* Standard Dip Switches */
1171   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(C):6")
1171   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(C):6")
11721172   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
11731173   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
11741174   /* Debug Dip Switches */
1175   PORT_DIPNAME( 0x20, 0x20, "Display Debug Infos" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):6")
1175   PORT_DIPNAME( 0x20, 0x20, "Display Debug Infos" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(C):6")
11761176   PORT_DIPSETTING(    0x20, DEF_STR( No ) )
11771177   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
11781178
r15082r15083
11851185
11861186   PORT_START("DSWB")
11871187   /* Standard Dip Switches */
1188   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):1,2,3")
1188   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):1,2,3")
11891189   PORT_DIPSETTING(    0x04, "1 (Easiest)" )
11901190   PORT_DIPSETTING(    0x05, "2" )
11911191   PORT_DIPSETTING(    0x06, "3" )
r15082r15083
11941194   PORT_DIPSETTING(    0x02, "6" )
11951195   PORT_DIPSETTING(    0x01, "7" )
11961196   PORT_DIPSETTING(    0x00, "8 (Hardest)" )
1197   PORT_DIPNAME( 0x18, 0x18, "Nando Speed" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):4,5")
1197   PORT_DIPNAME( 0x18, 0x18, "Nando Speed" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):4,5")
11981198   PORT_DIPSETTING(    0x10, "Slow" )
11991199   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )
12001200   PORT_DIPSETTING(    0x08, "Fast" )
12011201   PORT_DIPSETTING(    0x00, "Very Fast" )
1202   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):6")
1202   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):6")
12031203   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
12041204   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1205   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):7")
1205   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):7")
12061206   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
12071207   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1208   PORT_DIPNAME( 0x80, 0x80, "Stage Magic Continue" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):8")
1208   PORT_DIPNAME( 0x80, 0x80, "Stage Magic Continue" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):8")
12091209   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12101210   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12111211   /* Debug Dip Switches */
1212   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):1")
1212   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(B):1")
12131213   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
12141214   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1215   PORT_DIPNAME( 0x1e, 0x1e, "Slow Motion Delay" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):2,3,4,5")
1215   PORT_DIPNAME( 0x1e, 0x1e, "Slow Motion Delay" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(B):2,3,4,5")
12161216   PORT_DIPSETTING(    0x1e, "2 Frames" )
12171217   PORT_DIPSETTING(    0x1c, "3 Frames" )
12181218   PORT_DIPSETTING(    0x1a, "4 Frames" )
r15082r15083
12291229   PORT_DIPSETTING(    0x04, "15 Frames" )
12301230   PORT_DIPSETTING(    0x02, "16 Frames" )
12311231   PORT_DIPSETTING(    0x00, "17 Frames" )
1232   PORT_DIPNAME( 0xe0, 0xe0, "Starting Level" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):6,7,8")
1232   PORT_DIPNAME( 0xe0, 0xe0, "Starting Level" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(B):6,7,8")
12331233   PORT_DIPSETTING(    0xe0, "Level 1" )
12341234   PORT_DIPSETTING(    0xc0, "Level 2" )
12351235   PORT_DIPSETTING(    0xa0, "Level 3" )
r15082r15083
12411241
12421242   PORT_START("DSWA")
12431243   /* Standard Dip Switches */
1244   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):1,2,3")
1244   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(A):1,2,3")
12451245   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
12461246   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
12471247   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
r15082r15083
12501250   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
12511251   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
12521252   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
1253   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):4,5,6")
1253   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(A):4,5,6")
12541254   PORT_DIPSETTING(    0x08, DEF_STR( 4C_1C ) )
12551255   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
12561256   PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )
r15082r15083
12591259   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
12601260   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
12611261   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
1262   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Cabinet ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):7,8")
1262   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Cabinet ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(A):7,8")
12631263   PORT_DIPSETTING(    0xc0, "Upright 1 Player" )
12641264   PORT_DIPSETTING(    0x80, "Upright 2 Players" )
12651265//  PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
12661266   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
12671267   /* Debug Dip Switches */
1268   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")
1268   PORT_DIPNAME( 0x3f, 0x3f, DEF_STR( Free_Play ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):1,2,3,4,5,6")
12691269   PORT_DIPSETTING(    0x3f, DEF_STR( Off ) )
12701270   PORT_DIPSETTING(    0x38, DEF_STR( On ) )
12711271   /* Other values don't give free play */
1272   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):7")
1272   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):7")
12731273   PORT_DIPSETTING(    0x40, "Upright 1 Player" )
12741274   PORT_DIPSETTING(    0x00, "Upright 2 Players" )
1275   PORT_DIPNAME( 0x80, 0x80, "Maximum magic/sword power" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):8")
1275   PORT_DIPNAME( 0x80, 0x80, "Maximum magic/sword power" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):8")
12761276   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12771277   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12781278INPUT_PORTS_END
r15082r15083
18181818
18191819   PORT_START("DSWA")
18201820   CPS1_COINAGE_1( "SW(A)" )
1821   PORT_DIPNAME( 0x40, 0x40, "2 Coins to Start, 1 to Continue" ) PORT_CONDITION("DSWA", 0x3f,PORTCOND_NOTEQUALS,0x00) PORT_DIPLOCATION("SW(A):7")
1821   PORT_DIPNAME( 0x40, 0x40, "2 Coins to Start, 1 to Continue" ) PORT_CONDITION("DSWA", 0x3f,NOTEQUALS,0x00) PORT_DIPLOCATION("SW(A):7")
18221822   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
18231823   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1824   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_CONDITION("DSWA", 0x3f, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):7")
1824   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_CONDITION("DSWA", 0x3f, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):7")
18251825   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
18261826   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
18271827   /* Free Play: ALL bits 0 to 7 must be ON ; 4C_1C, 4C_1C, 2 Coins to Start, 1 to Continue ON */
src/mame/drivers/scobra.c
r15082r15083
268268CUSTOM_INPUT_MEMBER(scobra_state::stratgyx_coinage_r)
269269{
270270   int bit_mask = (FPTR)param;
271   return (input_port_read(machine(), "IN4") & bit_mask) ? 0x01 : 0x00;
271   return (ioport("IN4")->read() & bit_mask) ? 0x01 : 0x00;
272272}
273273
274274
src/mame/drivers/stactics.c
r15082r15083
8181    /* monitor motor under joystick control */
8282    if (*state->m_motor_on & 0x01)
8383    {
84      int ip3 = input_port_read(machine, "IN3");
85      int ip4 = input_port_read(machine, "FAKE");
84      int ip3 = machine.root_device().ioport("IN3")->read();
85      int ip4 = machine.root_device().ioport("FAKE")->read();
8686
8787      /* up */
8888      if (((ip4 & 0x01) == 0) && (state->m_vert_pos > -128))
src/mame/drivers/namcos11.c
r15082r15083
696696   switch( offset )
697697   {
698698   case 0:
699      data = input_port_read( machine(), "GUN1X" );
699      data = ioport( "GUN1X" )->read();
700700      break;
701701   case 1:
702      data = ( input_port_read( machine(), "GUN1Y" ) ) | ( ( input_port_read( machine(), "GUN1Y" ) + 1 ) << 16 );
702      data = ( ioport( "GUN1Y" )->read() ) | ( ( ioport( "GUN1Y" )->read() + 1 ) << 16 );
703703      break;
704704   case 2:
705      data = input_port_read( machine(), "GUN2X" );
705      data = ioport( "GUN2X" )->read();
706706      break;
707707   case 3:
708      data = ( input_port_read( machine(), "GUN2Y" ) ) | ( ( input_port_read( machine(), "GUN2Y" ) + 1 ) << 16 );
708      data = ( ioport( "GUN2Y" )->read() ) | ( ( ioport( "GUN2Y" )->read() + 1 ) << 16 );
709709      break;
710710   }
711711   verboselog( machine(), 2, "lightgun_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
r15082r15083
750750   switch (offset)
751751   {
752752      case 0:
753         return input_port_read(machine(), "PLAYER4");
753         return ioport("PLAYER4")->read();
754754
755755      case 1:
756         return input_port_read(machine(), "SWITCH");
756         return ioport("SWITCH")->read();
757757
758758      case 2:
759         return input_port_read(machine(), "PLAYER1");
759         return ioport("PLAYER1")->read();
760760
761761      case 3:
762         return input_port_read(machine(), "PLAYER2");
762         return ioport("PLAYER2")->read();
763763   }
764764
765765   return 0xff;
r15082r15083
779779
780780READ8_MEMBER(namcos11_state::dac7_r)// bit 7
781781{
782   return input_port_read_safe(machine(), "PLAYER3", 0xff)&0x80;
782   return ioport("PLAYER3")->read_safe(0xff)&0x80;
783783}
784784
785785READ8_MEMBER(namcos11_state::dac6_r)// bit 3
786786{
787   return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<4)&0x80;
787   return (ioport("PLAYER3")->read_safe(0xff)<<4)&0x80;
788788}
789789
790790READ8_MEMBER(namcos11_state::dac5_r)// bit 2
791791{
792   return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<5)&0x80;
792   return (ioport("PLAYER3")->read_safe(0xff)<<5)&0x80;
793793}
794794
795795READ8_MEMBER(namcos11_state::dac4_r)// bit 1
796796{
797   return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<6)&0x80;
797   return (ioport("PLAYER3")->read_safe(0xff)<<6)&0x80;
798798}
799799
800800READ8_MEMBER(namcos11_state::dac3_r)// bit 0
801801{
802   return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<7)&0x80;
802   return (ioport("PLAYER3")->read_safe(0xff)<<7)&0x80;
803803}
804804
805805READ8_MEMBER(namcos11_state::dac2_r)// bit 4
806806{
807   return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<3)&0x80;
807   return (ioport("PLAYER3")->read_safe(0xff)<<3)&0x80;
808808}
809809
810810READ8_MEMBER(namcos11_state::dac1_r)// bit 5
811811{
812   return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<2)&0x80;
812   return (ioport("PLAYER3")->read_safe(0xff)<<2)&0x80;
813813}
814814
815815READ8_MEMBER(namcos11_state::dac0_r)// bit 6
816816{
817   return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<1)&0x80;
817   return (ioport("PLAYER3")->read_safe(0xff)<<1)&0x80;
818818}
819819
820820READ8_MEMBER(namcos11_state::pocketrc_gas_r)
821821{
822   return input_port_read(machine(), "GAS");
822   return ioport("GAS")->read();
823823}
824824
825825READ8_MEMBER(namcos11_state::pocketrc_steer_r)
826826{
827   return input_port_read(machine(), "STEERING");
827   return ioport("STEERING")->read();
828828}
829829
830830ADDRESS_MAP_START( c76_io_map, AS_IO, 8, namcos11_state )
src/mame/drivers/lethalj.c
r15082r15083
161161
162162CUSTOM_INPUT_MEMBER(lethalj_state::cclownz_paddle)
163163{
164   int value = input_port_read(machine(), "PADDLE");
164   int value = ioport("PADDLE")->read();
165165   return ((value << 4) & 0xf00) | (value & 0x00f);
166166}
167167
src/mame/drivers/itech8.c
r15082r15083
11041104{
11051105   const char *tag1 = (const char *)param;
11061106   const char *tag2 = tag1 + strlen(tag1) + 1;
1107   return input_port_read(machine(), tag1) & input_port_read(machine(), tag2);
1107   return ioport(tag2)->read();
11081108}
11091109
11101110static INPUT_PORTS_START( gtg )
src/mame/drivers/galaxian.c
r15082r15083
452452   galaxian_state *state = device->machine().driver_data<galaxian_state>();
453453   interrupt_gen(device);
454454
455   if (input_port_read_safe(device->machine(), "FAKE_SELECT", 0x00))
455   if (state->ioport("FAKE_SELECT")->read_safe(0x00))
456456   {
457457      state->m_tenspot_current_game++;
458458      state->m_tenspot_current_game%=10;
r15082r15083
11031103   const char *portname = (const char *)param;
11041104   if (m_gmgalax_selected_game != 0)
11051105      portname += strlen(portname) + 1;
1106   return input_port_read(machine(), portname);
1106   return ioport(portname)->read();
11071107}
11081108
11091109
r15082r15083
11541154
11551155CUSTOM_INPUT_MEMBER(galaxian_state::azurian_port_r)
11561156{
1157   return (input_port_read(machine(), "FAKE") >> (FPTR)param) & 1;
1157   return (ioport("FAKE")->read() >> (FPTR)param) & 1;
11581158}
11591159
11601160
r15082r15083
11681168CUSTOM_INPUT_MEMBER(galaxian_state::kingball_muxbit_r)
11691169{
11701170   /* multiplex the service mode switch with a speech DIP switch */
1171   return (input_port_read(machine(), "FAKE") >> m_kingball_speech_dip) & 1;
1171   return (ioport("FAKE")->read() >> m_kingball_speech_dip) & 1;
11721172}
11731173
11741174
r15082r15083
28102810
28112811   /* ROM is banked */
28122812   space->install_read_bank(0x0000, 0x3fff, "bank1");
2813   machine.root_device().membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x10000, 0x4000);
2813   state->membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x10000, 0x4000);
28142814
28152815   /* callback when the game select is toggled */
2816   state->gmgalax_game_changed(*machine.ioport().first_port()->fieldlist().first(), NULL, 0, 0);
2816   state->gmgalax_game_changed(*machine.ioport().first_port()->first_field(), NULL, 0, 0);
28172817   state_save_register_global(machine, state->m_gmgalax_selected_game);
28182818}
28192819
r15082r15083
29272927{
29282928   char tmp[64];
29292929   sprintf(tmp,"IN2_GAME%d", m_tenspot_current_game);
2930   return input_port_read_safe(machine(), tmp, 0x00);
2930   return ioport(tmp)->read_safe(0x00);
29312931}
29322932
29332933
r15082r15083
30263026   /* make ROMs 2 & 3 swappable */
30273027   space->install_read_bank(0x2000, 0x2fff, "bank1");
30283028   space->install_read_bank(0x3000, 0x3fff, "bank2");
3029   state->membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x2000, 0x1000);
3030   state->membank("bank2")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x2000, 0x1000);
3029   state->membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x2000, 0x1000);
3030   state->membank("bank2")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x2000, 0x1000);
30313031
30323032   /* also re-install the fixed ROM area as a bank in order to inform the memory system that
30333033       the fixed area only extends to 0x1fff */
r15082r15083
35023502
35033503   /* extra ROM */
35043504   space->install_read_bank(0x5800, 0x67ff, "bank1");
3505   state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x5800);
3505   state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x5800);
35063506
35073507   /* no background related */
35083508//  space->nop_write(0x6803, 0x6803);
src/mame/drivers/mpu5.c
r15082r15083
4545      : driver_device(mconfig, type, tag),
4646        m_maincpu(*this, "maincpu")
4747   { }
48   UINT32* m_cpuregion;
49   UINT32* m_mainram;
4850
51   DECLARE_READ32_MEMBER(mpu5_mem_r);
52   DECLARE_WRITE32_MEMBER(mpu5_mem_w);
53
4954protected:
5055
5156   // devices
r15082r15083
5358};
5459
5560
61READ32_MEMBER(mpu5_state::mpu5_mem_r)
62{
63   int pc = cpu_get_pc(&space.device());
64   int cs = m68340_get_cs(m_maincpu, offset * 4);
65
66   switch ( cs )
67   {
68      case 1:
69         return m_cpuregion[offset];
70
71      case 4:
72         offset &=0x3fff;
73         return (m_mainram[offset]);
74
75      default:
76         logerror("%08x maincpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs);
77
78   }
79
80   return 0x0000;
81}
82
83WRITE32_MEMBER(mpu5_state::mpu5_mem_w)
84{
85   int pc = cpu_get_pc(&space.device());
86   int cs = m68340_get_cs(m_maincpu, offset * 4);
87
88   switch ( cs )
89   {
90      case 4:
91         offset &=0x3fff;
92         COMBINE_DATA(&m_mainram[offset]);
93         break;
94
95
96
97      default:
98         logerror("%08x maincpu write access offset %08x data %08x mem_mask %08x cs %d\n", pc, offset*4, data, mem_mask, cs);
99
100   }
101
102}
103
56104static ADDRESS_MAP_START( mpu5_map, AS_PROGRAM, 32, mpu5_state )
57   AM_RANGE(0x000000, 0x2fffff) AM_ROM
105   AM_RANGE(0x00000000, 0xffffffff) AM_READWRITE(mpu5_mem_r, mpu5_mem_w)
58106ADDRESS_MAP_END
59107
60108static INPUT_PORTS_START(  mpu5 )
61109INPUT_PORTS_END
62110
111
112static MACHINE_START( mpu5 )
113{
114   mpu5_state *state = machine.driver_data<mpu5_state>();
115   state->m_cpuregion = (UINT32*)state->memregion( "maincpu" )->base();
116   state->m_mainram = (UINT32*)auto_alloc_array_clear(machine, UINT32, 0x10000);
117
118}
119
120
63121static MACHINE_CONFIG_START( mpu5, mpu5_state )
64122   MCFG_CPU_ADD("maincpu", M68340, 16000000)    // ?
65123   MCFG_CPU_PROGRAM_MAP(mpu5_map)
66124
125   MCFG_MACHINE_START( mpu5 )
126
67127   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
68128   /* unknown sound */
69129MACHINE_CONFIG_END
src/mame/drivers/othldrby.c
r15082r15083
104104
105105static INPUT_PORTS_START( othldrby )
106106   PORT_START("VBLANK")
107   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
107   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
108108
109109   PORT_START("DSW1")
110110   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
src/mame/drivers/bbusters.c
r15082r15083
269269{
270270   static const char *const port[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2", "GUNX3", "GUNY3" };
271271
272   UINT16 retdata = input_port_read(machine(), port[m_gun_select]);
272   UINT16 retdata = ioport(port[m_gun_select])->read();
273273
274274   retdata >>=1; // by lowering the precision of the gun reading hardware the game seems to work better
275275
r15082r15083
309309{
310310   int x, y;
311311
312   x = input_port_read(machine(), offset ? "GUNX2" : "GUNX1");
313   y = input_port_read(machine(), offset ? "GUNY2" : "GUNY1");
312   x = ioport(offset ? "GUNX2" : "GUNX1")->read();
313   y = ioport(offset ? "GUNY2" : "GUNY1")->read();
314314
315315   /* Todo - does the hardware really clamp like this? */
316316   x += 0x18;
src/mame/drivers/arcadecl.c
r15082r15083
208208   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
209209   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
210210   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
211   PORT_BIT(  0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
211   PORT_BIT(  0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
212212   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
213213
214214   PORT_START("COIN")
r15082r15083
268268   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
269269   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
270270   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
271   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
271   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
272272   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
273273
274274   PORT_START("COIN")
src/mame/drivers/calomega.c
r15082r15083
660660static WRITE_LINE_DEVICE_HANDLER( tx_rx_clk )
661661{
662662   int trx_clk;
663   UINT8 dsw2 = input_port_read(device->machine(), "SW2");
663   UINT8 dsw2 = device->machine().root_device().ioport("SW2")->read();
664664   trx_clk = UART_CLOCK * dsw2 / 128;
665665   acia6850_device *acia = downcast<acia6850_device *>(device);
666666   acia->set_rx_clock(trx_clk);
r15082r15083
673673   calomega_state *state = device->machine().driver_data<calomega_state>();
674674   switch( state->m_s903_mux_data & 0xf0 )   /* bits 4-7 */
675675   {
676      case 0x10: return input_port_read(device->machine(), "IN0-0");
677      case 0x20: return input_port_read(device->machine(), "IN0-1");
678      case 0x40: return input_port_read(device->machine(), "IN0-2");
679      case 0x80: return input_port_read(device->machine(), "IN0-3");
676      case 0x10: return state->ioport("IN0-0")->read();
677      case 0x20: return state->ioport("IN0-1")->read();
678      case 0x40: return state->ioport("IN0-2")->read();
679      case 0x80: return state->ioport("IN0-3")->read();
680680   }
681681
682   return input_port_read(device->machine(), "FRQ");   /* bit7 used for 50/60 Hz selector */
682   return device->machine().root_device().ioport("FRQ")->read();   /* bit7 used for 50/60 Hz selector */
683683}
684684
685685static WRITE8_DEVICE_HANDLER( s903_mux_w )
r15082r15083
695695   calomega_state *state = device->machine().driver_data<calomega_state>();
696696   switch( state->m_s905_mux_data & 0x0f )   /* bits 0-3 */
697697   {
698      case 0x01: return input_port_read(device->machine(), "IN0-0");
699      case 0x02: return input_port_read(device->machine(), "IN0-1");
700      case 0x04: return input_port_read(device->machine(), "IN0-2");
701      case 0x08: return input_port_read(device->machine(), "IN0-3");
698      case 0x01: return state->ioport("IN0-0")->read();
699      case 0x02: return state->ioport("IN0-1")->read();
700      case 0x04: return state->ioport("IN0-2")->read();
701      case 0x08: return state->ioport("IN0-3")->read();
702702   }
703703
704   return input_port_read(device->machine(), "FRQ");   /* bit6 used for 50/60 Hz selector */
704   return device->machine().root_device().ioport("FRQ")->read();   /* bit6 used for 50/60 Hz selector */
705705}
706706
707707static WRITE8_DEVICE_HANDLER( s905_mux_w )
r15082r15083
717717{
718718   /* Valid input port. Each polled value is stored at $0538 */
719719   logerror("PIA0: Port A in\n");
720   return input_port_read(device->machine(), "IN0");
720   return device->machine().root_device().ioport("IN0")->read();
721721}
722722
723723static READ8_DEVICE_HANDLER( pia0_bin_r )
src/mame/drivers/sfkick.c
r15082r15083
9191   sfkick_state *state = device->machine().driver_data<sfkick_state>();
9292   switch(state->m_input_mux&0x0f)
9393   {
94      case 0: return input_port_read(device->machine(), "IN0");
95      case 1: return input_port_read(device->machine(), "IN1");
96      case 2: return BITSWAP8(input_port_read(device->machine(), "DIAL"),4,5,6,7,3,2,1,0);
97      case 3: return input_port_read(device->machine(), "DSW2");
98      case 4: return input_port_read(device->machine(), "DSW1");
94      case 0: return state->ioport("IN0")->read();
95      case 1: return state->ioport("IN1")->read();
96      case 2: return BITSWAP8(state->ioport("DIAL")->read(),4,5,6,7,3,2,1,0);
97      case 3: return state->ioport("DSW2")->read();
98      case 4: return state->ioport("DSW1")->read();
9999   }
100100   return 0xff;
101101}
src/mame/drivers/dgpix.c
r15082r15083
195195{
196196   /* burn a bunch of cycles because this is polled frequently during busy loops */
197197   device_eat_cycles(&space.device(), 100);
198   return input_port_read(machine(), "VBLANK");
198   return ioport("VBLANK")->read();
199199}
200200
201201static ADDRESS_MAP_START( cpu_map, AS_PROGRAM, 32, dgpix_state )
r15082r15083
250250
251251static INPUT_PORTS_START( dgpix )
252252   PORT_START("VBLANK")
253   PORT_BIT( 0x00000003, IP_ACTIVE_LOW, IPT_VBLANK ) //value 2 is used by fmaniac3
253   PORT_BIT( 0x00000003, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") //value 2 is used by fmaniac3
254254   PORT_BIT( 0xfffffffc, IP_ACTIVE_LOW, IPT_UNUSED )
255255
256256   PORT_START("INPUTS")
src/mame/drivers/atetris.c
r15082r15083
255255   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
256256   PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "50H:!2" )   /* Listed As "SPARE2 (Unused)" */
257257   PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "50H:!1" )   /* Listed As "SPARE1 (Unused)" */
258   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
258   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
259259   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
260260
261261   PORT_START("IN1")
src/mame/drivers/bmcbowl.c
r15082r15083
230230
231231static READ8_DEVICE_HANDLER(via_b_in)
232232{
233   return input_port_read(device->machine(), "IN3");
233   return device->machine().root_device().ioport("IN3")->read();
234234}
235235
236236
r15082r15083
444444   PORT_START("IN3")
445445   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1)
446446   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
447   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
447   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
448448
449449INPUT_PORTS_END
450450
r15082r15083
453453   bmcbowl_state *state = device->machine().driver_data<bmcbowl_state>();
454454   switch(state->m_bmc_input)
455455   {
456         case 0x00:   return  input_port_read(device->machine(), "IN1");
457         case 0x40:   return  input_port_read(device->machine(), "IN2");
456         case 0x00:   return  state->ioport("IN1")->read();
457         case 0x40:   return  state->ioport("IN2")->read();
458458   }
459459   logerror("%s:unknown input - %X\n",device->machine().describe_context(),state->m_bmc_input);
460460   return 0xff;
src/mame/drivers/pachifev.c
r15082r15083
311311      address_space *ramspace = device->memory().space(AS_PROGRAM);
312312      UINT8 player = 0;
313313
314      if ((ramspace->read_byte(0xe00f) == 0x01) && ((input_port_read(device->machine(), "DSW1") & 0x08) == 0x00))
314      if ((ramspace->read_byte(0xe00f) == 0x01) && ((state->ioport("DSW1")->read() & 0x08) == 0x00))
315315         player = 1;
316316
317        int current_power=input_port_read(device->machine(), inname[player]) & 0x3f;
317        int current_power=state->ioport(inname[player])->read() & 0x3f;
318318        if(current_power != state->m_previous_power)
319319        {
320320            popmessage    ("%d%%", (current_power * 100) / 0x3f);
src/mame/drivers/leland.c
r15082r15083
146146
147147   PORT_START("IN3")   /* 0x91 */
148148   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
149   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
149   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
150150   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
151151   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
152152   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
192192
193193   PORT_START("IN3")   /* 0xD1 */
194194   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
195   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
195   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
196196   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
197197   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
198198   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
225225
226226   PORT_START("IN3")   /* 0x91 */
227227   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
228   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
228   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
229229   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
230230   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
231231   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
264264
265265   PORT_START("IN3")   /* 0xD1 */
266266   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
267   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
267   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
268268   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
269269   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
270270   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
300300
301301   PORT_START("IN3")   /* 0xD1 */
302302   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
303   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
303   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
304304   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
305305   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
306306   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
335335
336336   PORT_START("IN3")   /* 0x91 */
337337   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
338   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
338   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
339339   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
340340   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
341341   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
370370
371371   PORT_START("IN3")   /* 0x51/D1 */
372372   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
373   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
373   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
374374   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
375375   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
376376   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
407407
408408   PORT_START("IN3")   /* 0xD1 */
409409   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
410   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
410   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
411411   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
412412   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
413413   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
445445
446446   PORT_START("IN3")   /* 0x91 */
447447   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
448   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
448   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
449449   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
450450   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
451451   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
487487
488488   PORT_START("IN3")   /* 0x91 */
489489   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
490   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
490   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
491491   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
492492   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
493493   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
545545
546546   PORT_START("IN3")   /* 0x91 */
547547   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
548   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
548   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
549549   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
550550   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
551551   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
600600
601601   PORT_START("IN3")   /* 0xD1 */
602602   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
603   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
603   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
604604   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
605605   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
606606   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
660660
661661   PORT_START("IN3")   /* 0x51 */
662662   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
663   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
663   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
664664   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
665665   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
666666
src/mame/drivers/lazercmd.c
r15082r15083
290290/* triggered by REDD,r opcode */
291291READ8_MEMBER(lazercmd_state::lazercmd_data_port_r)
292292{
293   UINT8 data = input_port_read(machine(), "DSW") & 0x0f;
293   UINT8 data = ioport("DSW")->read() & 0x0f;
294294   return data;
295295}
296296
r15082r15083
370370   switch (offset)
371371   {
372372      case 0:             /* player 1 joysticks */
373         data = input_port_read(machine(), "IN0");
373         data = ioport("IN0")->read();
374374         break;
375375      case 1:             /* player 2 joysticks */
376         data = input_port_read(machine(), "IN1");
376         data = ioport("IN1")->read();
377377         break;
378378      case 2:             /* player 1 + 2 buttons */
379         data = input_port_read(machine(), "IN3");
379         data = ioport("IN3")->read();
380380         break;
381381      case 3:             /* coin slot + start buttons */
382         data = input_port_read(machine(), "IN2");
382         data = ioport("IN2")->read();
383383         break;
384384      case 4:             /* vertical scan counter */
385385         data = ((m_timer_count & 0x10) >> 1) | ((m_timer_count & 0x20) >> 3)
src/mame/drivers/pcat_nit.c
r15082r15083
195195      case 0: /* 278 */
196196         return 0xff;
197197      case 1: /* 279 */
198         return input_port_read(machine(), "IN0");
198         return ioport("IN0")->read();
199199      case 7: /* 27f dips */
200200         return 0xff;
201201      default:
src/mame/drivers/blockade.c
r15082r15083
6363   blockade_state *state = device->machine().driver_data<blockade_state>();
6464   device_resume(device, SUSPEND_ANY_REASON);
6565
66   if ((input_port_read(device->machine(), "IN0") & 0x80) == 0)
66   if ((state->ioport("IN0")->read() & 0x80) == 0)
6767   {
6868      state->m_just_been_reset = 1;
6969      device_set_input_line(device, INPUT_LINE_RESET, PULSE_LINE);
r15082r15083
7979READ8_MEMBER(blockade_state::blockade_input_port_0_r)
8080{
8181   /* coin latch is bit 7 */
82   UINT8 temp = (input_port_read(machine(), "IN0") & 0x7f);
82   UINT8 temp = (ioport("IN0")->read() & 0x7f);
8383
8484   return (m_coin_latch << 7) | temp;
8585}
r15082r15083
183183   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
184184
185185   PORT_START("IN3")
186   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
186   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
187187   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
188188INPUT_PORTS_END
189189
r15082r15083
226226
227227   PORT_START("IN3")
228228   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
229   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
229   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
230230INPUT_PORTS_END
231231
232232static INPUT_PORTS_START( blasto )
r15082r15083
271271
272272   PORT_START("IN3")
273273   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
274   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
274   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
275275INPUT_PORTS_END
276276
277277static INPUT_PORTS_START( hustle )
r15082r15083
315315
316316   PORT_START("IN3")
317317   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
318   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
318   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
319319INPUT_PORTS_END
320320
321321static INPUT_PORTS_START( mineswpr )
r15082r15083
357357
358358   PORT_START("IN3")
359359   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
360   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
360   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
361361INPUT_PORTS_END
362362
363363static INPUT_PORTS_START( mineswpr4 )
r15082r15083
399399
400400   PORT_START("IN3")
401401   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
402   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
402   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
403403INPUT_PORTS_END
404404
405405
src/mame/drivers/lordgun.c
r15082r15083
208208   lordgun_state *state = device->machine().driver_data<lordgun_state>();
209209   switch (state->m_aliencha_dip_sel & 0x70)
210210   {
211      case 0x30:   return input_port_read(device->machine(), "DIP1");
212      case 0x60:   return input_port_read(device->machine(), "DIP2");
213      case 0x50:   return input_port_read(device->machine(), "DIP3");
211      case 0x30:   return state->ioport("DIP1")->read();
212      case 0x60:   return state->ioport("DIP2")->read();
213      case 0x50:   return state->ioport("DIP3")->read();
214214
215215      default:
216216         logerror("%s: dip_r with unknown dip_sel = %02X\n",device->machine().describe_context(),state->m_aliencha_dip_sel);
src/mame/drivers/lemmings.c
r15082r15083
3636{
3737   switch (offset)
3838   {
39   case 0: return input_port_read(machine(), "AN0");
40   case 1: return input_port_read(machine(), "AN1");
41   case 4: return input_port_read(machine(), "AN2");
42   case 5: return input_port_read(machine(), "AN3");
39   case 0: return ioport("AN0")->read();
40   case 1: return ioport("AN1")->read();
41   case 4: return ioport("AN2")->read();
42   case 5: return ioport("AN3")->read();
4343   }
4444   return 0;
4545}
r15082r15083
5050   switch (offset << 1)
5151   {
5252      case 0x41a:
53         return input_port_read(machine(), "BUTTONS");
53         return ioport("BUTTONS")->read();
5454
5555      case 0x320:
56         return input_port_read(machine(), "SYSTEM");
56         return ioport("SYSTEM")->read();
5757
5858      case 0x4e6:
59         return input_port_read(machine(), "DSW");
59         return ioport("DSW")->read();
6060   }
6161
6262   return 0;
r15082r15083
143143   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN2 )
144144   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN1 )
145145   PORT_SERVICE_NO_TOGGLE(0x0004, IP_ACTIVE_LOW)
146   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
146   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
147147   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
148148   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
149149   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/tiamc1.c
r15082r15083
188188   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
189189   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) // Kick
190190   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) // Jump
191   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
191   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
192192INPUT_PORTS_END
193193
194194static const gfx_layout sprites16x16_layout =
src/mame/drivers/toaplan1.c
r15082r15083
689689   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
690690
691691   PORT_START("VBLANK")
692   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )
692   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
693693   PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
694694INPUT_PORTS_END
695695
r15082r15083
724724   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )      \
725725   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )   \
726726   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )   \
727   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
727   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
728728
729729#define  TOAPLAN1_VBLANK_INPUT                  \
730730   PORT_START("VBLANK")                  \
731   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )   \
731   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")   \
732732   PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
733733
734734
src/mame/drivers/segag80r.c
r15082r15083
214214   /* read as two bits from each of 4 ports. For this reason, the input   */
215215   /* ports have been organized logically, and are demangled at runtime.  */
216216   /* 4 input ports each provide 8 bits of information. */
217   UINT8 d7d6 = input_port_read(machine(), "D7D6");
218   UINT8 d5d4 = input_port_read(machine(), "D5D4");
219   UINT8 d3d2 = input_port_read(machine(), "D3D2");
220   UINT8 d1d0 = input_port_read(machine(), "D1D0");
217   UINT8 d7d6 = ioport("D7D6")->read();
218   UINT8 d5d4 = ioport("D5D4")->read();
219   UINT8 d3d2 = ioport("D3D2")->read();
220   UINT8 d1d0 = ioport("D1D0")->read();
221221   int shift = offset & 3;
222222   return demangle(d7d6 >> shift, d5d4 >> shift, d3d2 >> shift, d1d0 >> shift);
223223}
r15082r15083
229229   /* versus cocktail cabinets; we fix this here. The input ports are */
230230   /* coded for cocktail mode; for upright mode, we manually shuffle the */
231231   /* bits around. */
232   UINT8 d7d6 = input_port_read(machine(), "D7D6");
233   UINT8 d5d4 = input_port_read(machine(), "D5D4");
234   UINT8 d3d2 = input_port_read(machine(), "D3D2");
235   UINT8 d1d0 = input_port_read(machine(), "D1D0");
232   UINT8 d7d6 = ioport("D7D6")->read();
233   UINT8 d5d4 = ioport("D5D4")->read();
234   UINT8 d3d2 = ioport("D3D2")->read();
235   UINT8 d1d0 = ioport("D1D0")->read();
236236   int shift = offset & 3;
237237
238238   /* tweak bits for the upright case */
239239   UINT8 upright = d3d2 & 0x04;
240240   if (upright)
241241   {
242      UINT8 fc = input_port_read(machine(), "FC");
242      UINT8 fc = ioport("FC")->read();
243243      d7d6 |= 0x60;
244244      d5d4 = (d5d4 & ~0x1c) |
245245            ((~fc & 0x20) >> 3) | /* IPT_BUTTON2 */
r15082r15083
253253
254254READ8_MEMBER(segag80r_state::spaceod_port_fc_r)
255255{
256   UINT8 upright = input_port_read(machine(), "D3D2") & 0x04;
257   UINT8 fc = input_port_read(machine(), "FC");
256   UINT8 upright = ioport("D3D2")->read() & 0x04;
257   UINT8 fc = ioport("FC")->read();
258258
259259   /* tweak bits for the upright case */
260260   if (upright)
src/mame/drivers/magic10.c
r15082r15083
427427   PORT_DIPSETTING(      0x0800, "Note A: 20 - Note B: 40 - Note C: 100 - Note D: 200" )
428428   PORT_DIPSETTING(      0x0400, "Note A: 50 - Note B: 100 - Note C: 500 - Note D: 1000" )
429429   PORT_DIPSETTING(      0x0c00, "Note A: 100 - Note B: 200 - Note C: 1000 - Note D: 2000" )
430   PORT_DIPNAME( 0x3000, 0x3000, "Lots At" )         PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0xc000)
430   PORT_DIPNAME( 0x3000, 0x3000, "Lots At" )         PORT_CONDITION("DSW", 0xc000, EQUALS, 0xc000)
431431   PORT_DIPSETTING(      0x0000, "50 200 500 1000 2000" )
432432   PORT_DIPSETTING(      0x1000, "100 300 1000 3000 5000" )
433433   PORT_DIPSETTING(      0x2000, "200 500 2000 3000 5000" )
434434   PORT_DIPSETTING(      0x3000, "500 1000 2000 4000 8000" )
435   PORT_DIPNAME( 0x3000, 0x3000, "1 Ticket Won" )      PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x8000)
435   PORT_DIPNAME( 0x3000, 0x3000, "1 Ticket Won" )      PORT_CONDITION("DSW", 0xc000, EQUALS, 0x8000)
436436//  PORT_DIPSETTING(      0x0000, "Every 100 Score" )
437437//  PORT_DIPSETTING(      0x1000, "Every 100 Score" )
438438//  PORT_DIPSETTING(      0x2000, "Every 100 Score" )
439439   PORT_DIPSETTING(      0x3000, "Every 100 Score" )
440   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) )   PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x4000)
440   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) )   PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000)
441441   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
442442   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
443   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) )   PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x4000)
443   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) )   PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000)
444444   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
445445   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
446   PORT_DIPNAME( 0x3000, 0x3000, "1 Play Won" )      PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x0000)
446   PORT_DIPNAME( 0x3000, 0x3000, "1 Play Won" )      PORT_CONDITION("DSW", 0xc000, EQUALS, 0x0000)
447447//  PORT_DIPSETTING(      0x0000, "Every 10 Score" )
448448//  PORT_DIPSETTING(      0x1000, "Every 10 Score" )
449449//  PORT_DIPSETTING(      0x2000, "Every 10 Score" )
src/mame/drivers/tmnt.c
r15082r15083
434434
435435   /* bit 3 is service button */
436436   /* bit 6 is ??? VBLANK? OBJMPX? */
437   res = input_port_read(machine(), "COINS");
437   res = ioport("COINS")->read();
438438
439439   m_toggle ^= 0x40;
440440   return res ^ m_toggle;
r15082r15083
448448   /* bit 1 is EEPROM ready */
449449   /* bit 2 is VBLANK (???) */
450450   /* bit 7 is service button */
451   res = input_port_read(machine(), "EEPROM");
451   res = ioport("EEPROM")->read();
452452
453453   m_toggle ^= 0x04;
454454   return res ^ m_toggle;
r15082r15083
462462   /* bit 1 is EEPROM ready */
463463   /* bit 2 is VBLANK (???) */
464464   /* bit 3 is service button */
465   res = input_port_read(machine(), "EEPROM");
465   res = ioport("EEPROM")->read();
466466
467467   m_toggle ^= 0x04;
468468   return res ^ m_toggle;
r15082r15083
475475      /* bit 0 is data */
476476      /* bit 1 is cs (active low) */
477477      /* bit 2 is clock (active high) */
478      input_port_write(machine(), "EEPROMOUT", data, 0xff);
478      ioport("EEPROMOUT")->write(data, 0xff);
479479   }
480480}
481481
r15082r15083
498498   /* bit 1 is EEPROM ready */
499499   /* bit 3 is VBLANK (???) */
500500   /* bit 7 is service button */
501   res = input_port_read(machine(), "P2/EEPROM");
501   res = ioport("P2/EEPROM")->read();
502502   m_toggle ^= 0x0800;
503503   return (res ^ m_toggle);
504504}
r15082r15083
511511      /* bit 0 is data */
512512      /* bit 1 is cs (active low) */
513513      /* bit 2 is clock (active high) */
514      input_port_write(machine(), "EEPROMOUT", data, 0xff);
514      ioport("EEPROMOUT")->write(data, 0xff);
515515
516516      /* bit 5 triggers IRQ on sound cpu */
517517      if (m_last == 0 && (data & 0x20) != 0)
r15082r15083
535535      /* bit 8 is data */
536536      /* bit 9 is cs (active low) */
537537      /* bit 10 is clock (active high) */
538      input_port_write(machine(), "EEPROMOUT", data, 0xffff);
538      ioport("EEPROMOUT")->write(data, 0xffff);
539539   }
540540}
541541
r15082r15083
17901790   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
17911791   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
17921792   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: OBJMPX */
1793   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK */
1793   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")   /* ?? TMNT2: NVBLK */
17941794   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: IPL0 */
17951795   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
17961796   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
r15082r15083
18281828   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
18291829   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
18301830   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: OBJMPX */
1831   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK */
1831   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")   /* ?? TMNT2: NVBLK */
18321832   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: IPL0 */
18331833   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
18341834   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
r15082r15083
18681868   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
18691869   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
18701870   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: OBJMPX */
1871   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK */
1871   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")   /* ?? TMNT2: NVBLK */
18721872   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: IPL0 */
18731873   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
18741874   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
r15082r15083
19571957   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
19581958   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
19591959   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: OBJMPX */
1960   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK (needs to be ACTIVE_HIGH to avoid problems) */
1960   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")   /* ?? TMNT2: NVBLK (needs to be ACTIVE_HIGH to avoid problems) */
19611961   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: IPL0 */
19621962   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
19631963   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
src/mame/drivers/kongambl.c
r15082r15083
5959{
6060   if (ACCESSING_BITS_0_7)
6161   {
62      UINT32 rv = input_port_read(machine(), "SYSTEM") & ~0x1;
62      UINT32 rv = ioport("SYSTEM")->read() & ~0x1;
6363
6464      return rv;   // bit 0 freezes the game if 1
6565   }
r15082r15083
7171{
7272   if (ACCESSING_BITS_8_15)
7373   {
74      input_port_write(machine(), "EEPROMOUT", (data>>8)&0xf, 0xff);
74      ioport("EEPROMOUT")->write((data>>8)&0xf, 0xff);
7575   }
7676}
7777
src/mame/drivers/taitojc.c
r15082r15083
397397      {
398398         if (ACCESSING_BITS_24_31)
399399         {
400            r |= ((input_port_read(machine(), "COINS") & 0x2) << 2) << 24;
400            r |= ((ioport("COINS")->read() & 0x2) << 2) << 24;
401401         }
402402         return r;
403403      }
r15082r15083
405405      {
406406         if (ACCESSING_BITS_24_31)
407407         {
408            r |= input_port_read(machine(), "COINS") << 24;
408            r |= ioport("COINS")->read() << 24;
409409         }
410410         return r;
411411      }
r15082r15083
413413      {
414414         if (ACCESSING_BITS_24_31)
415415         {
416            r |= input_port_read(machine(), "START") << 24;
416            r |= ioport("START")->read() << 24;
417417         }
418418         return r;
419419      }
r15082r15083
421421      {
422422         if (ACCESSING_BITS_24_31)
423423         {
424            r |= input_port_read(machine(), "UNUSED") << 24;
424            r |= ioport("UNUSED")->read() << 24;
425425         }
426426         return r;
427427      }
r15082r15083
437437      {
438438         if (ACCESSING_BITS_24_31)
439439         {
440            r |= input_port_read(machine(), "BUTTONS") << 24;
440            r |= ioport("BUTTONS")->read() << 24;
441441         }
442442         return r;
443443      }
r15082r15083
471471      {
472472         if (ACCESSING_BITS_24_31)
473473         {
474            input_port_write(machine(), "EEPROMOUT", data >> 24, 0xff);
474            ioport("EEPROMOUT")->write(data >> 24, 0xff);
475475         }
476476         else
477477            popmessage("jc_control_w: %08X, %08X, %08X\n", data, offset, mem_mask);
r15082r15083
828828   else if(offset == 1 && ACCESSING_BITS_16_31)
829829      m_brake_meter = taitojc_brake_table[(data >> 16) & 0xff];
830830
831   if(input_port_read_safe(machine(), "METER", 0))
831   if(ioport("METER")->read_safe(0))
832832   {
833      UINT8 mascon_lv = (input_port_read(machine(), "MASCON") & 0x70) >> 4;
833      UINT8 mascon_lv = (ioport("MASCON")->read() & 0x70) >> 4;
834834
835835      popmessage("%d %.02f km/h %.02f MPa",mascon_lv,m_speed_meter,m_brake_meter/10);
836836   }
r15082r15083
898898   static const char *const portnames[] = { "ANALOG1", "ANALOG2", "ANALOG3", "ANALOG4",
899899                              "ANALOG5", "ANALOG6", "ANALOG7", "ANALOG8" };
900900
901   return input_port_read_safe(machine(), portnames[offset], 0);
901   return ioport(portnames[offset])->read_safe(0);
902902}
903903
904904
r15082r15083
11661166CUSTOM_INPUT_MEMBER(taitojc_state::mascon_state_r)
11671167{
11681168   static const UINT8 mascon_table[6] = { 0x01, 0x10, 0x02, 0x20, 0x04, 0x40 };
1169   UINT8 res = input_port_read(machine(), "MASCON");
1169   UINT8 res = ioport("MASCON")->read();
11701170   int i;
11711171
11721172   //popmessage("%02x",res);
src/mame/drivers/ddealer.c
r15082r15083
309309
310310   /*coin/credit simulation*/
311311   /*$fe002 is used,might be for multiple coins for one credit settings.*/
312   state->m_coin_input = (~(input_port_read(timer.machine(), "IN0")));
312   state->m_coin_input = (~(timer.machine().root_device().ioport("IN0")->read()));
313313
314314   if (state->m_coin_input & 0x01)//coin 1
315315   {
src/mame/drivers/berzerk.c
r15082r15083
426426   int color;
427427   double color_weights[2];
428428
429   if (input_port_read(machine, MONITOR_TYPE_PORT_TAG) == 0)
429   if (machine.root_device().ioport(MONITOR_TYPE_PORT_TAG)->read() == 0)
430430      compute_resistor_weights(0, 0xff, -1.0,
431431                         2, resistances_wg, color_weights, 0, 270,
432432                         2, resistances_wg, color_weights, 0, 270,
r15082r15083
903903   // one difference is it lacks the strobe input (does it?), which if not active causes
904904   // the dial input to go open bus. This is used in moon war 2 to switch between player 1
905905   // and player 2 dials, which share a single port. moonwarp uses separate ports for the dials.
906   signed char dialread = input_port_read(machine(),"P1_DIAL");
906   signed char dialread = ioport("P1_DIAL")->read();
907907   UINT8 ret;
908   UINT8 buttons = (input_port_read(machine(),"P1")&0xe0);
908   UINT8 buttons = (ioport("P1")->read()&0xe0);
909909   if (dialread < 0) m_p1_direction = 0;
910910   else if (dialread > 0) m_p1_direction = 0x10;
911911   m_p1_counter_74ls161 += abs(dialread);
r15082r15083
918918READ8_MEMBER(berzerk_state::moonwarp_p2_r)
919919{
920920   // same as above, but for player 2 in cocktail mode
921   signed char dialread = input_port_read(machine(),"P2_DIAL");
921   signed char dialread = ioport("P2_DIAL")->read();
922922   UINT8 ret;
923   UINT8 buttons = (input_port_read(machine(),"P2")&0xe0);
923   UINT8 buttons = (ioport("P2")->read()&0xe0);
924924   if (dialread < 0) m_p2_direction = 0;
925925   else if (dialread > 0) m_p2_direction = 0x10;
926926   m_p2_counter_74ls161 += abs(dialread);
src/mame/drivers/vpoker.c
r15082r15083
158158READ8_MEMBER(vpoker_state::blitter_r)
159159{
160160   if(offset == 6)
161      return input_port_read(machine(), "IN0");
161      return ioport("IN0")->read();
162162
163163   return 0;
164164}
src/mame/drivers/magtouch.c
r15082r15083
147147   switch(offset)
148148   {
149149      case 1:
150         return input_port_read(machine(), "IN0");
150         return ioport("IN0")->read();
151151      default:
152152         return 0;
153153   }
src/mame/drivers/suprridr.c
r15082r15083
230230
231231   /* screen flip multiplexes controls */
232232   if (suprridr_is_screen_flipped(machine()))
233      ret = input_port_read(machine(), SUPRRIDR_P2_CONTROL_PORT_TAG);
233      ret = ioport(SUPRRIDR_P2_CONTROL_PORT_TAG)->read();
234234   else
235      ret = input_port_read(machine(), SUPRRIDR_P1_CONTROL_PORT_TAG);
235      ret = ioport(SUPRRIDR_P1_CONTROL_PORT_TAG)->read();
236236
237237   return ret;
238238}
src/mame/drivers/igs009.c
r15082r15083
434434   switch(m_igs_magic[0])
435435   {
436436      case 0x00:
437         if ( !(m_igs_magic[1] & 0x01) )   return input_port_read(machine(), "DSW1");
438         if ( !(m_igs_magic[1] & 0x02) )   return input_port_read(machine(), "DSW2");
439         if ( !(m_igs_magic[1] & 0x04) )   return input_port_read(machine(), "DSW3");
440         if ( !(m_igs_magic[1] & 0x08) )   return input_port_read(machine(), "DSW4");
441         if ( !(m_igs_magic[1] & 0x10) )   return input_port_read(machine(), "DSW5");
437         if ( !(m_igs_magic[1] & 0x01) )   return ioport("DSW1")->read();
438         if ( !(m_igs_magic[1] & 0x02) )   return ioport("DSW2")->read();
439         if ( !(m_igs_magic[1] & 0x04) )   return ioport("DSW3")->read();
440         if ( !(m_igs_magic[1] & 0x08) )   return ioport("DSW4")->read();
441         if ( !(m_igs_magic[1] & 0x10) )   return ioport("DSW5")->read();
442442         logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", cpu_get_pc(&space.device()), m_igs_magic[1]);
443443         break;
444444
src/mame/drivers/blitz68k.c
r15082r15083
11561156READ16_MEMBER(blitz68k_state::hermit_track_r)
11571157{
11581158#ifdef MAME_DEBUG
1159//  popmessage("track %02x %02x", input_port_read(machine(), "TRACK_X"), input_port_read(machine(), "TRACK_Y"));
1159//  popmessage("track %02x %02x", ioport("TRACK_Y")->read());
11601160#endif
11611161
11621162   return
1163      ((0xf - ((input_port_read(machine(), "TRACK_Y") + 0x7) & 0xf)) << 12) |
1164      ((0xf - ((input_port_read(machine(), "TRACK_X") + 0x7) & 0xf)) << 8)  ;
1163      ((0xf - ((ioport("TRACK_Y")->read() + 0x7) & 0xf)) << 12) |
1164      ((0xf - ((ioport("TRACK_X")->read() + 0x7) & 0xf)) << 8)  ;
11651165}
11661166
11671167static ADDRESS_MAP_START( hermit_map, AS_PROGRAM, 16, blitz68k_state )
r15082r15083
17371737//  for(i=0;i<8;i+=2)
17381738//      state->m_nvram[((0x8a0)+i)/2] = 0;
17391739   /*finally, read the inputs*/
1740   state->m_nvram[0x89e/2] = input_port_read(timer.machine(), "MENU") & 0xffff;
1741   state->m_nvram[0x8a0/2] = input_port_read(timer.machine(), "STAT") & 0xffff;
1742   state->m_nvram[0x8a2/2] = input_port_read(timer.machine(), "BET_DEAL") & 0xffff;
1743   state->m_nvram[0x8a4/2] = input_port_read(timer.machine(), "TAKE_DOUBLE") & 0xffff;
1744   state->m_nvram[0x8a6/2] = input_port_read(timer.machine(), "SMALL_BIG") & 0xffff;
1745   state->m_nvram[0x8a8/2] = input_port_read(timer.machine(), "CANCEL_HOLD1") & 0xffff;
1746   state->m_nvram[0x8aa/2] = input_port_read(timer.machine(), "HOLD2_HOLD3") & 0xffff;
1747   state->m_nvram[0x8ac/2] = input_port_read(timer.machine(), "HOLD4_HOLD5") & 0xffff;
1740   state->m_nvram[0x89e/2] = timer.machine().root_device().ioport("MENU")->read() & 0xffff;
1741   state->m_nvram[0x8a0/2] = timer.machine().root_device().ioport("STAT")->read() & 0xffff;
1742   state->m_nvram[0x8a2/2] = timer.machine().root_device().ioport("BET_DEAL")->read() & 0xffff;
1743   state->m_nvram[0x8a4/2] = timer.machine().root_device().ioport("TAKE_DOUBLE")->read() & 0xffff;
1744   state->m_nvram[0x8a6/2] = timer.machine().root_device().ioport("SMALL_BIG")->read() & 0xffff;
1745   state->m_nvram[0x8a8/2] = timer.machine().root_device().ioport("CANCEL_HOLD1")->read() & 0xffff;
1746   state->m_nvram[0x8aa/2] = timer.machine().root_device().ioport("HOLD2_HOLD3")->read() & 0xffff;
1747   state->m_nvram[0x8ac/2] = timer.machine().root_device().ioport("HOLD4_HOLD5")->read() & 0xffff;
17481748}
17491749
17501750
src/mame/drivers/psikyo.c
r15082r15083
124124{
125125   switch (offset)
126126   {
127      case 0x0:   return input_port_read(machine(), "P1_P2");
128      case 0x1:   return input_port_read(machine(), "DSW");
129      case 0x2:   return input_port_read(machine(), "COIN");
127      case 0x0:   return ioport("P1_P2")->read();
128      case 0x1:   return ioport("DSW")->read();
129      case 0x2:   return ioport("COIN")->read();
130130      default:   logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset * 2);
131131            return 0;
132132   }
r15082r15083
136136{
137137   switch (offset)
138138   {
139      case 0x0:   return input_port_read(machine(), "P1_P2");
140      case 0x1:   return input_port_read(machine(), "DSW");
139      case 0x0:   return ioport("P1_P2")->read();
140      case 0x1:   return ioport("DSW")->read();
141141      default:   logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset * 2);
142142            return 0;
143143   }
r15082r15083
288288{
289289   switch (offset)
290290   {
291      case 0x0:   return input_port_read(machine(), "P1_P2");
292      case 0x1:   return (input_port_read(machine(), "DSW") & 0xffff000f) | s1945_mcu_r(space, offset - 1, mem_mask);
291      case 0x0:   return ioport("P1_P2")->read();
292      case 0x1:   return (ioport("DSW")->read() & 0xffff000f) | s1945_mcu_r(space, offset - 1, mem_mask);
293293      case 0x2:   return s1945_mcu_r(space, offset - 1, mem_mask);
294294      default:   logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset * 2);
295295               return 0;
r15082r15083
543543   PORT_INCLUDE(psikyo_common)
544544
545545   PORT_START("COIN")
546   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
546   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_CUSTOM  ) PORT_VBLANK("screen")   // vblank
547547   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
548548   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
549549   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
670670   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
671671   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
672672   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
673   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_VBLANK  )   // vblank   ACTIVE_HIGH fixes slowdowns, but is it right?
673   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM  ) PORT_VBLANK("screen")   // vblank   ACTIVE_HIGH fixes slowdowns, but is it right?
674674   // This DSW is used for debugging the game
675675   PORT_DIPNAME( 0x00000100, 0x00000100, "Unknown 3-0" )   // tested!
676676   PORT_DIPSETTING(          0x00000100, DEF_STR( Off ) )
r15082r15083
756756   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
757757   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
758758   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
759   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
759   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_CUSTOM  ) PORT_VBLANK("screen")   // vblank
760760   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
761761   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
762762   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
r15082r15083
826826   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
827827   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
828828   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
829   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
829   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_CUSTOM  ) PORT_VBLANK("screen")   // vblank
830830   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
831831   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
832832   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
r15082r15083
898898
899899   // I need to invert the Vblank on this to avoid excessive slowdown
900900   PORT_MODIFY("DSW")      /* c00004 -> c00007 */
901   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_VBLANK  )   // vblank
901   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM  ) PORT_VBLANK("screen")   // vblank
902902INPUT_PORTS_END
903903
904904
r15082r15083
942942   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
943943   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
944944   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
945   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
945   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_CUSTOM  ) PORT_VBLANK("screen")   // vblank
946946   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
947947   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
948948   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
r15082r15083
18111811   psikyo_state *state = machine.driver_data<psikyo_state>();
18121812
18131813   {
1814      UINT8 *RAM = machine.root_device().memregion("ymsnd")->base();
1814      UINT8 *RAM = state->memregion("ymsnd")->base();
18151815      int len = state->memregion("ymsnd")->bytes();
18161816      int i;
18171817
src/mame/drivers/tapatune.c
r15082r15083
157157{
158158   switch( m_controls_mux )
159159   {
160      case 0x07: return input_port_read(machine(), "DSW1");
161      case 0x08: return input_port_read(machine(), "DSW2");
162      case 0x09: return input_port_read(machine(), "IN0");
160      case 0x07: return ioport("DSW1")->read();
161      case 0x08: return ioport("DSW2")->read();
162      case 0x09: return ioport("IN0")->read();
163163      default: return 0xff;
164164   }
165165}
src/mame/drivers/esd16.c
r15082r15083
125125WRITE16_MEMBER(esd16_state::esd_eeprom_w)
126126{
127127   if (ACCESSING_BITS_8_15)
128      input_port_write(machine(), "EEPROMOUT", data, 0xffff);
128      ioport("EEPROMOUT")->write(data, 0xffff);
129129
130130//  logerror("(0x%06x) Unk EEPROM write: %04x %04x\n", cpu_get_pc(&space.device()), data, mem_mask);
131131}
r15082r15083
305305   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
306306   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
307307   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:5,6")
308   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
309   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
310   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
311   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
308   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
309   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
310   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
311   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
312312   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )
313   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
314   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
313   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
314   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
315315   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:7,8")
316   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
316   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
317317   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )
318   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
319   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
320   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
321   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
322   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
318   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
319   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
320   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
321   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
322   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
323323
324324   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW2:1,2")
325325   PORT_DIPSETTING(      0x0200, DEF_STR( Easy ) )
src/mame/drivers/model3.c
r15082r15083
12771277   state->m_sound_irq_enable = 0;
12781278   state->m_sound_timer->adjust(attotime::never);
12791279
1280   state->membank("bank1")->set_base(machine.root_device().memregion( "user1" )->base() + 0x800000 ); /* banked CROM */
1280   state->membank("bank1")->set_base(state->memregion( "user1" )->base() + 0x800000 ); /* banked CROM */
12811281
1282   state->membank("bank4")->set_base(machine.root_device().memregion("samples")->base() + 0x200000);
1283   state->membank("bank5")->set_base(machine.root_device().memregion("samples")->base() + 0x600000);
1282   state->membank("bank4")->set_base(state->memregion("samples")->base() + 0x200000);
1283   state->membank("bank5")->set_base(state->memregion("samples")->base() + 0x600000);
12841284
12851285   // copy the 68k vector table into RAM
12861286   memcpy(state->m_soundram, state->memregion("audiocpu")->base()+0x80000, 16);
r15082r15083
13371337         {
13381338            if(m_controls_bank & 0x1)
13391339            {
1340               return (input_port_read(machine(), "IN1")) << 24;
1340               return (ioport("IN1")->read()) << 24;
13411341            }
13421342            else
13431343            {
1344               return (input_port_read(machine(), "IN0")) << 24;
1344               return (ioport("IN0")->read()) << 24;
13451345            }
13461346         }
13471347         break;
r15082r15083
13491349      case 1:
13501350         if (ACCESSING_BITS_56_63)
13511351         {
1352            return (UINT64)input_port_read(machine(), "IN2") << 56;
1352            return (UINT64)ioport("IN2")->read() << 56;
13531353         }
13541354         else if (ACCESSING_BITS_24_31)
13551355         {
1356            return input_port_read(machine(), "IN3") << 24;
1356            return ioport("IN3")->read() << 24;
13571357         }
13581358         break;
13591359
r15082r15083
13881388         if (ACCESSING_BITS_24_31)      /* ADC Data read */
13891389         {
13901390            static const char *const adcnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
1391            UINT8 adc_data = input_port_read_safe(machine(), adcnames[m_adc_channel], 0);
1391            UINT8 adc_data = ioport(adcnames[m_adc_channel])->read_safe(0);
13921392            m_adc_channel++;
13931393            m_adc_channel &= 0x7;
13941394            return (UINT64)adc_data << 24;
r15082r15083
14411441                  switch(m_lightgun_reg_sel)      /* read lightrun register */
14421442                  {
14431443                     case 0:      /* player 1 gun X-position, lower 8-bits */
1444                        m_serial_fifo2 = input_port_read(machine(), "LIGHT0_Y") & 0xff;
1444                        m_serial_fifo2 = ioport("LIGHT0_Y")->read() & 0xff;
14451445                        break;
14461446                     case 1:      /* player 1 gun X-position, upper 2-bits */
1447                        m_serial_fifo2 = (input_port_read(machine(), "LIGHT0_Y") >> 8) & 0x3;
1447                        m_serial_fifo2 = (ioport("LIGHT0_Y")->read() >> 8) & 0x3;
14481448                        break;
14491449                     case 2:      /* player 1 gun Y-position, lower 8-bits */
1450                        m_serial_fifo2 = input_port_read(machine(), "LIGHT0_X") & 0xff;
1450                        m_serial_fifo2 = ioport("LIGHT0_X")->read() & 0xff;
14511451                        break;
14521452                     case 3:      /* player 1 gun Y-position, upper 2-bits */
1453                        m_serial_fifo2 = (input_port_read(machine(), "LIGHT0_X") >> 8) & 0x3;
1453                        m_serial_fifo2 = (ioport("LIGHT0_X")->read() >> 8) & 0x3;
14541454                        break;
14551455                     case 4:      /* player 2 gun X-position, lower 8-bits */
1456                        m_serial_fifo2 = input_port_read(machine(), "LIGHT1_Y") & 0xff;
1456                        m_serial_fifo2 = ioport("LIGHT1_Y")->read() & 0xff;
14571457                        break;
14581458                     case 5:      /* player 2 gun X-position, upper 2-bits */
1459                        m_serial_fifo2 = (input_port_read(machine(), "LIGHT1_Y") >> 8) & 0x3;
1459                        m_serial_fifo2 = (ioport("LIGHT1_Y")->read() >> 8) & 0x3;
14601460                        break;
14611461                     case 6:      /* player 2 gun Y-position, lower 8-bits */
1462                        m_serial_fifo2 = input_port_read(machine(), "LIGHT1_X") & 0xff;
1462                        m_serial_fifo2 = ioport("LIGHT1_X")->read() & 0xff;
14631463                        break;
14641464                     case 7:      /* player 2 gun Y-position, upper 2-bits */
1465                        m_serial_fifo2 = (input_port_read(machine(), "LIGHT1_X") >> 8) & 0x3;
1465                        m_serial_fifo2 = (ioport("LIGHT1_X")->read() >> 8) & 0x3;
14661466                        break;
14671467                     case 8:      /* gun offscreen (bit set = gun offscreen, bit clear = gun on screen) */
14681468                        m_serial_fifo2 = 0;   /* bit 0 = player 1, bit 1 = player 2 */
1469                        if(input_port_read(machine(), "OFFSCREEN") & 0x1) {
1469                        if(ioport("OFFSCREEN")->read() & 0x1) {
14701470                           m_serial_fifo2 |= 0x01;
14711471                        }
14721472                        break;
r15082r15083
53025302   model3_state *state = machine.driver_data<model3_state>();
53035303   int start;
53045304   int i,j,x;
5305   UINT16 *vrom1 = (UINT16*)machine.root_device().memregion("user3")->base();
5306   UINT16 *vrom2 = (UINT16*)machine.root_device().memregion("user4")->base();
5305   UINT16 *vrom1 = (UINT16*)state->memregion("user3")->base();
5306   UINT16 *vrom2 = (UINT16*)state->memregion("user4")->base();
53075307   int vrom_length = state->memregion("user3")->bytes();
53085308   UINT16 *vrom;
53095309
src/mame/drivers/cb2001.c
r15082r15083
656656
657657   PORT_START("DSW3")
658658   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")   /* OK */
659   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
660   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
661   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
662   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
663   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
664   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
665   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
666   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
659   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
660   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
661   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
662   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
663   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
664   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
665   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
666   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
667667   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")   /* OK */
668668   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
669669   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
670670   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
671671   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
672672   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")   /* OK */
673   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
674   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
675   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
676   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
677   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
678   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
679   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
680   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
673   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
674   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
675   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
676   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
677   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
678   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
679   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
680   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
681681   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")   /* OK */
682682   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
683683   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
src/mame/drivers/funkyjet.c
r15082r15083
155155   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
156156   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
157157   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
158   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
158   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
159159
160160   /* Dips seem inverted with respect to other Deco games */
161161   PORT_START("DSW")
src/mame/drivers/xexex.c
r15082r15083
183183   /* bit 5  is enable irq 6 */
184184   /* bit 6  is enable irq 5 */
185185   /* bit 11 is watchdog */
186   input_port_write(machine, "EEPROMOUT", state->m_cur_control2, 0xff);
186   state->ioport("EEPROMOUT")->write(state->m_cur_control2, 0xff);
187187
188188   /* bit 8 = enable sprite ROM reading */
189189   k053246_set_objcha_line(state->m_k053246, (state->m_cur_control2 & 0x0100) ? ASSERT_LINE : CLEAR_LINE);
r15082r15083
684684   if (!strcmp(machine.system().name, "xexex"))
685685   {
686686      // Invulnerability
687//      *(UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x648d4) = 0x4a79;
687//      *(UINT16 *)(state->memregion("maincpu")->base() + 0x648d4) = 0x4a79;
688688//      *(UINT16 *)(state->memregion("maincpu")->base() + 0x00008) = 0x5500;
689689      state->m_strip_0x1a = 1;
690690   }
src/mame/drivers/marinedt.c
r15082r15083
163163   //might need to be reversed for cocktail stuff
164164
165165   /* x/y multiplexed */
166   return input_port_read(machine(), ((m_pf & 0x08) >> 3) ? "TRACKY" : "TRACKX");
166   return ioport(((m_pf & 0x08) >> 3) ? "TRACKY" : "TRACKX")->read();
167167}
168168
169169READ8_MEMBER(marinedt_state::marinedt_coll_r)
src/mame/drivers/skullxbo.c
r15082r15083
9797
9898READ16_MEMBER(skullxbo_state::special_port1_r)
9999{
100   int temp = input_port_read(machine(), "FF5802");
100   int temp = ioport("FF5802")->read();
101101   if (m_cpu_to_sound_ready) temp ^= 0x0040;
102102   if (atarigen_get_hblank(*machine().primary_screen)) temp ^= 0x0010;
103103   return temp;
r15082r15083
179179   PORT_START("FF5802")
180180   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
181181   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )   /* HBLANK */
182   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_VBLANK )
182   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
183183   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )   /* /AUDBUSY */
184184   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
185185   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
src/mame/drivers/cps3.c
r15082r15083
663663{
664664   cps3_state *state = machine.driver_data<cps3_state>();
665665   int i;
666   UINT32 *coderegion = (UINT32*)machine.root_device().memregion("user1")->base();
666   UINT32 *coderegion = (UINT32*)state->memregion("user1")->base();
667667
668668   state->m_decrypted_bios = (UINT32*)state->memregion("user1")->base();
669669
r15082r15083
701701   state->m_altEncryption = altEncryption;
702702
703703   // cache pointers to regions
704   state->m_user4region = machine.root_device().memregion("user4")->base();
704   state->m_user4region = state->memregion("user4")->base();
705705   state->m_user5region = state->memregion("user5")->base();
706706
707707   if (!state->m_user4region) state->m_user4region = auto_alloc_array(machine, UINT8, USER4REGION_LENGTH);
src/mame/drivers/spiders.c
r15082r15083
275275   /* update the different PIA pins from the input ports */
276276
277277   /* CA1 - copy of PA1 (COIN1) */
278   pia1->ca1_w(input_port_read(device->machine(), "IN0") & 0x02);
278   pia1->ca1_w(device->machine().root_device().ioport("IN0")->read() & 0x02);
279279
280280   /* CA2 - copy of PA0 (SERVICE1) */
281   pia1->ca2_w(input_port_read(device->machine(), "IN0") & 0x01);
281   pia1->ca2_w(device->machine().root_device().ioport("IN0")->read() & 0x01);
282282
283283   /* CB1 - (crosshatch) */
284   pia1->cb1_w(input_port_read(device->machine(), "XHATCH"));
284   pia1->cb1_w(device->machine().root_device().ioport("XHATCH")->read());
285285
286286   /* CB2 - NOT CONNECTED */
287287}
src/mame/drivers/jchan.c
r15082r15083
260260
261261      case 0x03:   // DSW
262262      {
263         state->m_mcu_ram[mcu_offset] = input_port_read(machine, "DSW");
263         state->m_mcu_ram[mcu_offset] = machine.root_device().ioport("DSW")->read();
264264         logerror("%s : MCU executed command: %04X %04X (read DSW)\n",machine.describe_context(),mcu_command,mcu_offset*2);
265265      }
266266      break;
r15082r15083
447447
448448   switch(offset)
449449   {
450      case 0/2: return input_port_read(machine(), "P1");
451      case 2/2: return input_port_read(machine(), "P2");
452      case 4/2: return input_port_read(machine(), "SYSTEM");
453      case 6/2: return input_port_read(machine(), "EXTRA");
450      case 0/2: return ioport("P1")->read();
451      case 2/2: return ioport("P2")->read();
452      case 4/2: return ioport("SYSTEM")->read();
453      case 6/2: return ioport("EXTRA")->read();
454454      default: logerror("jchan_ctrl_r unknown!"); break;
455455   }
456456   return m_ctrl[offset];
r15082r15083
590590   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_8WAY PORT_PLAYER(1)
591591   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
592592   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
593   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
594   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )                PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
593   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
594   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )                PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
595595   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
596596
597597   PORT_START("P2")      /* $f00002.w (-> $2000b5.b) */
r15082r15083
601601   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_8WAY PORT_PLAYER(2)
602602   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
603603   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
604   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
605   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )                PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
604   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
605   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )                PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
606606   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
607607
608608   PORT_START("SYSTEM")   /* $f00004.b */
r15082r15083
616616   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
617617
618618   PORT_START("EXTRA")      /* $f00006.b */
619   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
620   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )                PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
621   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
622   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )                PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
623   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
624   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
625   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
626   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
619   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
620   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )                PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
621   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
622   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )                PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
623   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
624   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
625   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
626   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
627627   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )               /* duplicated Player 1 Button 4 (whatever the layout is) */
628628   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )               /* duplicated Player 2 Button 4 (whatever the layout is) */
629629   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/mlanding.c
r15082r15083
250250    */
251251// multiplexed? or just overriden?
252252
253   int retval = (m_dma_active << 15) | (input_port_read(machine(), "DSW") & 0x7fff);
253   int retval = (m_dma_active << 15) | (ioport("DSW")->read() & 0x7fff);
254254   return retval;
255255}
256256
r15082r15083
365365
366366READ16_MEMBER(mlanding_state::ml_analog1_lsb_r)
367367{
368   return input_port_read(machine(), "STICKX") & 0xff;
368   return ioport("STICKX")->read() & 0xff;
369369}
370370
371371READ16_MEMBER(mlanding_state::ml_analog2_lsb_r)
372372{
373   return input_port_read(machine(), "STICKY") & 0xff;
373   return ioport("STICKY")->read() & 0xff;
374374}
375375
376376READ16_MEMBER(mlanding_state::ml_analog3_lsb_r)
377377{
378   return (input_port_read(machine(), "STICKZ") & 0xff);
378   return (ioport("STICKZ")->read() & 0xff);
379379}
380380
381381/*
r15082r15083
401401/* high bits of analog inputs + "limiters"/ADC converters. */
402402READ16_MEMBER(mlanding_state::ml_analog1_msb_r)
403403{
404   return ((input_port_read(machine(), "STICKY") & 0xf00)>>8) | (input_port_read(machine(), "IN2") & 0xf0);
404   return ((ioport("STICKY")->read() & 0xf00)>>8) | (ioport("IN2")->read() & 0xf0);
405405}
406406
407407READ16_MEMBER(mlanding_state::ml_analog2_msb_r)
r15082r15083
409409   UINT8 res;
410410   UINT16 y_adc,x_adc;
411411
412   y_adc = input_port_read(machine(), "STICKY");
413   x_adc = input_port_read(machine(), "STICKZ");
412   y_adc = ioport("STICKY")->read();
413   x_adc = ioport("STICKZ")->read();
414414
415415   res = 0;
416416
r15082r15083
426426
427427//  popmessage("%04x %04x",x_adc,y_adc);
428428
429   return ((input_port_read(machine(), "STICKZ") & 0xf00)>>8) | res;
429   return ((ioport("STICKZ")->read() & 0xf00)>>8) | res;
430430}
431431
432432READ16_MEMBER(mlanding_state::ml_analog3_msb_r)
r15082r15083
434434   UINT8 z_adc,res;
435435   UINT16 x_adc;
436436
437   z_adc = input_port_read(machine(), "STICKX");
438   x_adc = input_port_read(machine(), "STICKZ");
437   z_adc = ioport("STICKX")->read();
438   x_adc = ioport("STICKZ")->read();
439439
440440   res = 0;
441441
r15082r15083
449449   if(x_adc & 0x800 || x_adc == 0)
450450      res|= 0x10;
451451
452   return ((input_port_read(machine(), "STICKX") & 0xf00)>>8) | res;
452   return ((ioport("STICKX")->read() & 0xf00)>>8) | res;
453453}
454454
455455WRITE16_MEMBER(mlanding_state::ml_nmi_to_sound_w)
src/mame/drivers/pastelg.c
r15082r15083
8282{
8383   switch(m_mux_data)
8484   {
85      case 0x01: return input_port_read(machine(),"KEY0_PL1");
86      case 0x02: return input_port_read(machine(),"KEY1_PL1");
87      case 0x04: return input_port_read(machine(),"KEY2_PL1");
88      case 0x08: return input_port_read(machine(),"KEY3_PL1");
89      case 0x10: return input_port_read(machine(),"KEY4_PL1");
85      case 0x01: return ioport("KEY0_PL1")->read();
86      case 0x02: return ioport("KEY1_PL1")->read();
87      case 0x04: return ioport("KEY2_PL1")->read();
88      case 0x08: return ioport("KEY3_PL1")->read();
89      case 0x10: return ioport("KEY4_PL1")->read();
9090   }
9191
9292   return 0xff;
r15082r15083
9696{
9797   switch(m_mux_data)
9898   {
99      case 0x01: return input_port_read(machine(),"KEY0_PL2");
100      case 0x02: return input_port_read(machine(),"KEY1_PL2");
101      case 0x04: return input_port_read(machine(),"KEY2_PL2");
102      case 0x08: return input_port_read(machine(),"KEY3_PL2");
103      case 0x10: return input_port_read(machine(),"KEY4_PL2");
99      case 0x01: return ioport("KEY0_PL2")->read();
100      case 0x02: return ioport("KEY1_PL2")->read();
101      case 0x04: return ioport("KEY2_PL2")->read();
102      case 0x08: return ioport("KEY3_PL2")->read();
103      case 0x10: return ioport("KEY4_PL2")->read();
104104   }
105105
106106   return 0xff;
src/mame/drivers/seattle.c
r15082r15083
14351435
14361436   if (data < 8 || data > 15)
14371437      logerror("%08X:Unexpected analog port select = %08X\n", cpu_get_pc(&space.device()), data);
1438   m_pending_analog_read = input_port_read(machine(), portnames[data & 7]);
1438   m_pending_analog_read = ioport(portnames[data & 7])->read();
14391439}
14401440
14411441
r15082r15083
14531453   switch (offset)
14541454   {
14551455      case 0:      /* low 8 bits of X */
1456         result = (input_port_read(machine(), "LIGHT0_X") << 4) & 0xff;
1456         result = (ioport("LIGHT0_X")->read() << 4) & 0xff;
14571457         break;
14581458
14591459      case 1:      /* upper 4 bits of X */
1460         result = (input_port_read(machine(), "LIGHT0_X") >> 4) & 0x0f;
1461         result |= (input_port_read(machine(), "FAKE") & 0x03) << 4;
1460         result = (ioport("LIGHT0_X")->read() >> 4) & 0x0f;
1461         result |= (ioport("FAKE")->read() & 0x03) << 4;
14621462         result |= 0x40;
14631463         break;
14641464
14651465      case 2:      /* low 8 bits of Y */
1466         result = (input_port_read(machine(), "LIGHT0_Y") << 2) & 0xff;
1466         result = (ioport("LIGHT0_Y")->read() << 2) & 0xff;
14671467         break;
14681468
14691469      case 3:      /* upper 4 bits of Y */
1470         result = (input_port_read(machine(), "LIGHT0_Y") >> 6) & 0x03;
1470         result = (ioport("LIGHT0_Y")->read() >> 6) & 0x03;
14711471         break;
14721472
14731473      case 4:      /* low 8 bits of X */
1474         result = (input_port_read(machine(), "LIGHT1_X") << 4) & 0xff;
1474         result = (ioport("LIGHT1_X")->read() << 4) & 0xff;
14751475         break;
14761476
14771477      case 5:      /* upper 4 bits of X */
1478         result = (input_port_read(machine(), "LIGHT1_X") >> 4) & 0x0f;
1479         result |= (input_port_read(machine(), "FAKE") & 0x30);
1478         result = (ioport("LIGHT1_X")->read() >> 4) & 0x0f;
1479         result |= (ioport("FAKE")->read() & 0x30);
14801480         result |= 0x40;
14811481         break;
14821482
14831483      case 6:      /* low 8 bits of Y */
1484         result = (input_port_read(machine(), "LIGHT1_Y") << 2) & 0xff;
1484         result = (ioport("LIGHT1_Y")->read() << 2) & 0xff;
14851485         break;
14861486
14871487      case 7:      /* upper 4 bits of Y */
1488         result = (input_port_read(machine(), "LIGHT1_Y") >> 6) & 0x03;
1488         result = (ioport("LIGHT1_Y")->read() >> 6) & 0x03;
14891489         break;
14901490   }
14911491   return result;
src/mame/drivers/galastrm.c
r15082r15083
150150   if (offset == 0x00)
151151   {
152152      if (ACCESSING_BITS_24_31)
153         return input_port_read(machine(), "STICKX") << 24;
153         return ioport("STICKX")->read() << 24;
154154      if (ACCESSING_BITS_16_23)
155         return input_port_read(machine(), "STICKY") << 16;
155         return ioport("STICKY")->read() << 16;
156156   }
157157   return 0;
158158}
src/mame/drivers/tetrisp2.c
r15082r15083
212212
213213READ16_MEMBER(tetrisp2_state::tetrisp2_ip_1_word_r)
214214{
215   return   ( input_port_read(machine(), "SYSTEM") &  0xfcff ) |
215   return   ( ioport("SYSTEM")->read() &  0xfcff ) |
216216         (           machine().rand() & ~0xfcff ) |
217217         (      1 << (8 + (machine().rand()&1)) );
218218}
r15082r15083
540540READ16_MEMBER(stepstag_state::stepstag_coins_r)
541541{
542542   // bits 8 & 9?
543   return   ( input_port_read(machine(), "COINS") &  0xfcff ) |
543   return   ( ioport("COINS")->read() &  0xfcff ) |
544544         (                 machine().rand()  & ~0xfcff ) |
545545         (      1 << (8 + (machine().rand()&1)) );
546546}
src/mame/drivers/alpha68k.c
r15082r15083
233233
234234READ16_MEMBER(alpha68k_state::kyros_dip_r)
235235{
236   return input_port_read(machine(), "IN1") << 8;
236   return ioport("IN1")->read() << 8;
237237}
238238
239239READ16_MEMBER(alpha68k_state::control_1_r)
240240{
241241
242242   if (m_invert_controls)
243      return ~(input_port_read(machine(), "IN0") + (input_port_read(machine(), "IN1") << 8));
243      return ~(ioport("IN0")->read() + (ioport("IN1")->read() << 8));
244244
245   return (input_port_read(machine(), "IN0") + (input_port_read(machine(), "IN1") << 8));
245   return (ioport("IN1")->read() << 8);
246246}
247247
248248READ16_MEMBER(alpha68k_state::control_2_r)
249249{
250250
251251   if (m_invert_controls)
252      return ~(input_port_read(machine(), "IN3") + ((~(1 << input_port_read(machine(), "IN5"))) << 8));
252      return ~(ioport("IN3")->read() + ((~(1 << ioport("IN5")->read())) << 8));
253253
254   return input_port_read(machine(), "IN3") + /* Low byte of CN1 */
255      ((~(1 << input_port_read(machine(), "IN5"))) << 8);
254   return ioport("IN3")->read() + /* Low byte of CN1 */
255      ((~(1 << ioport("IN5")->read())) << 8);
256256}
257257
258258READ16_MEMBER(alpha68k_state::control_2_V_r)
259259{
260   return input_port_read(machine(), "IN3");
260   return ioport("IN3")->read();
261261}
262262
263263READ16_MEMBER(alpha68k_state::control_3_r)
264264{
265265
266266   if (m_invert_controls)
267      return ~(((~(1 << input_port_read(machine(), "IN6"))) << 8) & 0xff00);
267      return ~(((~(1 << ioport("IN6")->read())) << 8) & 0xff00);
268268
269   return ((~(1 << input_port_read(machine(), "IN6"))) << 8) & 0xff00;
269   return ((~(1 << ioport("IN6")->read())) << 8) & 0xff00;
270270}
271271
272272/* High 4 bits of CN1 & CN2 */
r15082r15083
274274{
275275
276276   if (m_invert_controls)
277      return ~((((~(1 << input_port_read(machine(), "IN6"))) << 4) & 0xf000)
278       + (((~(1 << input_port_read(machine(), "IN5")))) & 0x0f00));
277      return ~((((~(1 << ioport("IN6")->read())) << 4) & 0xf000)
278       + (((~(1 << ioport("IN5")->read()))) & 0x0f00));
279279
280   return (((~(1 << input_port_read(machine(), "IN6"))) << 4) & 0xf000)
281       + (((~(1 << input_port_read(machine(), "IN5")))) & 0x0f00);
280   return (((~(1 << ioport("IN6")->read())) << 4) & 0xf000)
281       + (((~(1 << ioport("IN5")->read()))) & 0x0f00);
282282}
283283
284284READ16_MEMBER(alpha68k_state::jongbou_inputs_r)
285285{
286   UINT8 inp1 = input_port_read(machine(), "IN3");
287   UINT8 inp2 = input_port_read(machine(), "IN4");
286   UINT8 inp1 = ioport("IN3")->read();
287   UINT8 inp2 = ioport("IN4")->read();
288288   inp1 = ((inp1 & 0x01) << 3) + ((inp1 & 0x02) << 1) + ((inp1 & 0x04) >> 1) + ((inp1 & 0x08) >> 3);
289289   inp2 = ((inp2 & 0x01) << 3) + ((inp2 & 0x02) << 1) + ((inp2 & 0x04) >> 1) + ((inp2 & 0x08) >> 3);
290   return input_port_read(machine(), "IN0") | inp1 | inp2 << 4;
290   return ioport("IN0")->read() | inp1 | inp2 << 4;
291291}
292292
293293
r15082r15083
353353      return 0;
354354   case 0x29: /* Query microcontroller for coin insert */
355355      m_trigstate++;
356      if ((input_port_read(machine(), "IN2") & 0x3) == 3)
356      if ((ioport("IN2")->read() & 0x3) == 3)
357357         m_latch = 0;
358      if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
358      if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
359359      {
360360         m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff);   // coinA
361361         m_shared_ram[0x22] = (source & 0xff00) | 0x0;
362362         m_latch = 1;
363363
364         m_coinvalue = (~input_port_read(machine(), "IN1") >> 1) & 7;
364         m_coinvalue = (~ioport("IN1")->read() >> 1) & 7;
365365         m_deposits1++;
366366         if (m_deposits1 == coinage1[m_coinvalue][0])
367367         {
r15082r15083
371371         else
372372            m_credits = 0;
373373      }
374      else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
374      else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
375375      {
376376         m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id >> 8);   // coinB
377377         m_shared_ram[0x22] = (source & 0xff00) | 0x0;
378378         m_latch = 1;
379379
380         m_coinvalue = (~input_port_read(machine(), "IN1") >>1 ) & 7;
380         m_coinvalue = (~ioport("IN1")->read() >>1 ) & 7;
381381         m_deposits2++;
382382         if (m_deposits2 == coinage2[m_coinvalue][0])
383383         {
r15082r15083
430430   switch (offset)
431431   {
432432      case 0: /* Dipswitch 2 */
433         m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "IN4");
433         m_shared_ram[0] = (source & 0xff00) | ioport("IN4")->read();
434434         return 0;
435435
436436      case 0x22: /* Coin value */
r15082r15083
438438         return 0;
439439
440440      case 0x29: /* Query microcontroller for coin insert */
441         if ((input_port_read(machine(), "IN2") & 0x3) == 3)
441         if ((ioport("IN2")->read() & 0x3) == 3)
442442            m_latch = 0;
443         if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
443         if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
444444         {
445445            m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff);   // coinA
446446            m_shared_ram[0x22] = (source & 0xff00) | 0x0;
r15082r15083
449449            if ((m_coin_id & 0xff) == 0x22)
450450            {
451451               if (m_game_id == ALPHA68K_BTLFIELDB)
452                  m_coinvalue = (input_port_read(machine(), "IN4") >> 0) & 7;
452                  m_coinvalue = (ioport("IN4")->read() >> 0) & 7;
453453               else
454                  m_coinvalue = (~input_port_read(machine(), "IN4") >> 0) & 7;
454                  m_coinvalue = (~ioport("IN4")->read() >> 0) & 7;
455455
456456               m_deposits1++;
457457               if (m_deposits1 == coinage1[m_coinvalue][0])
r15082r15083
463463                  m_credits = 0;
464464            }
465465         }
466         else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
466         else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
467467         {
468468            m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id >> 8);   // coinB
469469            m_shared_ram[0x22] = (source & 0xff00) | 0x0;
r15082r15083
472472            if ((m_coin_id >> 8) == 0x22)
473473            {
474474               if (m_game_id == ALPHA68K_BTLFIELDB)
475                  m_coinvalue = (input_port_read(machine(), "IN4") >> 0) & 7;
475                  m_coinvalue = (ioport("IN4")->read() >> 0) & 7;
476476               else
477                  m_coinvalue = (~input_port_read(machine(), "IN4") >> 0) & 7;
477                  m_coinvalue = (~ioport("IN4")->read() >> 0) & 7;
478478
479479               m_deposits2++;
480480               if (m_deposits2 == coinage2[m_coinvalue][0])
r15082r15083
524524   switch (offset)
525525   {
526526      case 0: /* Dipswitch 1 */
527         m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "IN4");
527         m_shared_ram[0] = (source & 0xff00) | ioport("IN4")->read();
528528         return 0;
529529      case 0x22: /* Coin value */
530530         m_shared_ram[0x22] = (source & 0xff00) | (m_credits & 0x00ff);
531531         return 0;
532532      case 0x29: /* Query microcontroller for coin insert */
533         if ((input_port_read(machine(), "IN2") & 0x3) == 3)
533         if ((ioport("IN2")->read() & 0x3) == 3)
534534            m_latch = 0;
535         if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
535         if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
536536         {
537537            m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff);   // coinA
538538            m_shared_ram[0x22] = (source & 0xff00) | 0x0;
r15082r15083
540540
541541            if ((m_coin_id & 0xff) == 0x22)
542542            {
543               m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
543               m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
544544               m_deposits1++;
545545               if (m_deposits1 == coinage1[m_coinvalue][0])
546546               {
r15082r15083
551551                  m_credits = 0;
552552            }
553553         }
554         else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
554         else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
555555         {
556556            m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id>>8);   // coinB
557557            m_shared_ram[0x22] = (source & 0xff00) | 0x0;
r15082r15083
559559
560560            if ((m_coin_id >> 8) == 0x22)
561561            {
562               m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
562               m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
563563               m_deposits2++;
564564               if (m_deposits2 == coinage2[m_coinvalue][0])
565565               {
r15082r15083
585585         break;
586586
587587      case 0x1f00: /* Dipswitch 1 */
588         m_shared_ram[0x1f00] = (source & 0xff00) | input_port_read(machine(), "IN4");
588         m_shared_ram[0x1f00] = (source & 0xff00) | ioport("IN4")->read();
589589         return 0;
590590      case 0x1f29: /* Query microcontroller for coin insert */
591         if ((input_port_read(machine(), "IN2") & 0x3) == 3)
591         if ((ioport("IN2")->read() & 0x3) == 3)
592592            m_latch = 0;
593         if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
593         if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
594594         {
595595            m_shared_ram[0x1f29] = (source & 0xff00) | (m_coin_id & 0xff);   // coinA
596596            m_shared_ram[0x1f22] = (source & 0xff00) | 0x0;
r15082r15083
598598
599599            if ((m_coin_id & 0xff) == 0x22)
600600            {
601               m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
601               m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
602602               m_deposits1++;
603603               if (m_deposits1 == coinage1[m_coinvalue][0])
604604               {
r15082r15083
609609                  m_credits = 0;
610610            }
611611         }
612         else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
612         else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
613613         {
614614            m_shared_ram[0x1f29] = (source & 0xff00) | (m_coin_id >> 8);   // coinB
615615            m_shared_ram[0x1f22] = (source & 0xff00) | 0x0;
r15082r15083
617617
618618            if ((m_coin_id >> 8) == 0x22)
619619            {
620               m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
620               m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
621621               m_deposits2++;
622622               if (m_deposits2 == coinage2[m_coinvalue][0])
623623               {
r15082r15083
638638               the microcontroller supplies it (it does for all the other games,
639639               but usually to 0x0 in RAM) when 0x21 is read (code at 0x009332) */
640640         source = m_shared_ram[0x0163];
641         m_shared_ram[0x0163] = (source & 0x00ff) | (input_port_read(machine(), "IN4") << 8);
641         m_shared_ram[0x0163] = (source & 0x00ff) | (ioport("IN4")->read() << 8);
642642
643643         return 0;
644644      case 0x1ffe:  /* Custom ID check */
r15082r15083
15681568   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
15691569   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
15701570   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1571   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,PORTCOND_EQUALS,0x08)
1571   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,EQUALS,0x08)
15721572   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
15731573   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1574   PORT_DIPNAME( 0x04, 0x04, "Game Mode" )            PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,PORTCOND_EQUALS,0x00)
1574   PORT_DIPNAME( 0x04, 0x04, "Game Mode" )            PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,EQUALS,0x00)
15751575   PORT_DIPSETTING(    0x00, "Freeze" )
15761576   PORT_DIPSETTING(    0x04, "Infinite Lives (Cheat)")
15771577   PORT_DIPNAME( 0x08, 0x08, "SW2:3 Demo Sound/Game Mode" )   PORT_DIPLOCATION("SW2:4")
src/mame/drivers/tmaster.c
r15082r15083
517517
518518READ16_MEMBER(tmaster_state::tmaster_coins_r)
519519{
520   return input_port_read(machine(), "COIN")|(machine().rand()&0x0800);
520   return ioport("COIN")->read()|(machine().rand()&0x0800);
521521}
522522
523523static ADDRESS_MAP_START( tmaster_map, AS_PROGRAM, 16, tmaster_state )
r15082r15083
18341834static DRIVER_INIT( galgames )
18351835{
18361836   tmaster_state *state = machine.driver_data<tmaster_state>();
1837   UINT8 *ROM   =   machine.root_device().memregion("maincpu")->base();
1837   UINT8 *ROM   =   state->memregion("maincpu")->base();
18381838   int cart;
18391839
18401840   // RAM bank at 0x000000-0x03ffff and 0x200000-0x23ffff
r15082r15083
18561856
18571857   for (cart = 1; cart <= 4; cart++)
18581858   {
1859      UINT8 *CART = machine.root_device().memregion("maincpu")->base();
1859      UINT8 *CART = state->memregion("maincpu")->base();
18601860
18611861      if  (0x200000 * (cart+1) <= state->memregion("maincpu")->bytes())
18621862         CART += 0x200000 * cart;
src/mame/drivers/namcos22.c
r15082r15083
11831183static void
11841184ReadAnalogDrivingPorts( running_machine &machine, UINT16 *gas, UINT16 *brake, UINT16 *steer )
11851185{
1186   *gas   = input_port_read(machine, "GAS");
1187   *brake = input_port_read(machine, "BRAKE");
1188   *steer = input_port_read(machine, "STEER");
1186   *gas   = machine.root_device().ioport("GAS")->read();
1187   *brake = machine.root_device().ioport("BRAKE")->read();
1188   *steer = machine.root_device().ioport("STEER")->read();
11891189}
11901190
11911191/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
r15082r15083
11931193AnalogAsDigital( running_machine &machine )
11941194{
11951195   namcos22_state *state = machine.driver_data<namcos22_state>();
1196   UINT16 inputs = input_port_read_safe(machine, "INPUTS", 0);
1197   UINT16 gas    = input_port_read_safe(machine, "GAS", 0);
1198   UINT16 steer  = input_port_read_safe(machine, "STEER", 0);
1196   UINT16 inputs = state->ioport("INPUTS")->read_safe(0);
1197   UINT16 gas    = state->ioport("GAS")->read_safe(0);
1198   UINT16 steer  = state->ioport("STEER")->read_safe(0);
11991199   UINT16 result = 0xffff;
12001200
12011201   switch( state->m_gametype )
r15082r15083
12481248   UINT16 *share16 = (UINT16 *)state->m_shareram.target();
12491249   UINT32 coin_state;
12501250
1251   coin_state = input_port_read(machine, "INPUTS") & 0x1200;
1251   coin_state = state->ioport("INPUTS")->read() & 0x1200;
12521252
12531253   if (!(coin_state & 0x1000) && (state->m_old_coin_state & 0x1000))
12541254   {
r15082r15083
12771277   namcos22_state *state = machine.driver_data<namcos22_state>();
12781278   if( nthbyte(state->m_system_controller, 0x18) != 0 )
12791279   {
1280      UINT16 flags = input_port_read(machine, "INPUTS");
1280      UINT16 flags = state->ioport("INPUTS")->read();
12811281      UINT16 gas, brake, steer, coinram_address_is_odd = 0;
12821282      ReadAnalogDrivingPorts( machine, &gas, &brake, &steer );
12831283
r15082r15083
13351335   namcos22_state *state = machine.driver_data<namcos22_state>();
13361336   if( nthbyte(state->m_system_controller, 0x18) != 0 )
13371337   {
1338      UINT16 flags = input_port_read(machine, "INPUTS");
1338      UINT16 flags = state->ioport("INPUTS")->read();
13391339
1340      UINT16 volume0 = input_port_read(machine, "STICKY1") * 0x10;
1341      UINT16 volume1 = input_port_read(machine, "STICKY2") * 0x10;
1342      UINT16 volume2 = input_port_read(machine, "STICKX1") * 0x10;
1343      UINT16 volume3 = input_port_read(machine, "STICKX2") * 0x10;
1340      UINT16 volume0 = state->ioport("STICKY1")->read() * 0x10;
1341      UINT16 volume1 = state->ioport("STICKY2")->read() * 0x10;
1342      UINT16 volume2 = state->ioport("STICKX1")->read() * 0x10;
1343      UINT16 volume3 = state->ioport("STICKX2")->read() * 0x10;
13441344
13451345      state->m_shareram[0x030/4] = (flags<<16) | volume0;
13461346      state->m_shareram[0x034/4] = (volume1<<16) | volume2;
r15082r15083
24212421
24222422READ32_MEMBER(namcos22_state::namcos22_dipswitch_r)
24232423{
2424   return input_port_read(machine(), "DSW0")<<16;
2424   return ioport("DSW0")->read()<<16;
24252425}
24262426
24272427READ32_MEMBER(namcos22_state::namcos22_mcuram_r)
r15082r15083
24362436
24372437READ32_MEMBER(namcos22_state::namcos22_gun_r)
24382438{
2439   int xpos = input_port_read_safe(machine(), "LIGHTX", 0) * 640 / 0xff;
2440   int ypos = input_port_read_safe(machine(), "LIGHTY", 0) * 240 / 0xff + 0x10;
2439   int xpos = ioport("LIGHTX")->read_safe(0) * 640 / 0xff;
2440   int ypos = ioport("LIGHTY")->read_safe(0) * 240 / 0xff + 0x10;
24412441   switch( offset )
24422442   {
24432443   case 0: /* 430000 */
r15082r15083
26262626{
26272627
26282628   if (m_p4 & 8)
2629      return input_port_read_safe(machine(), "MCUP5A", 0xff);
2629      return ioport("MCUP5A")->read_safe(0xff);
26302630   else
2631      return input_port_read_safe(machine(), "MCUP5B", 0xff);
2631      return ioport("MCUP5B")->read_safe(0xff);
26322632}
26332633
26342634WRITE8_MEMBER(namcos22_state::mcu_port6_w)
r15082r15083
26662666   // H+L = horizontal, 1 H+L = vertical
26672667   UINT16 ddx, ddy;
26682668
2669   ddx = input_port_read(machine(), "STICKX");
2669   ddx = ioport("STICKX")->read();
26702670   if (ddx > 0) ddx -= 1;
2671   ddy = input_port_read(machine(), "STICKY");
2671   ddy = ioport("STICKY")->read();
26722672   if (ddy > 0) ddy -= 1;
26732673
26742674   ddx <<= 2;
r15082r15083
26852685         // and timer A3 is configured by the MCU program to cause an interrupt each time
26862686         // it's clocked.  by counting the number of interrupts in a frame, we can determine
26872687         // how fast the user is pedaling.
2688         if( input_port_read(machine(), "JOY") & 0x10 )
2688         if( ioport("JOY")->read() & 0x10 )
26892689         {
26902690            int i;
26912691            for (i = 0; i < 16; i++)
r15082r15083
27392739READ8_MEMBER(namcos22_state::alpineracer_mcu_adc_r)
27402740{
27412741   // 0 H+L = swing, 1 H+L = edge
2742   UINT16 swing = input_port_read(machine(), "SWING")<<2;
2743   UINT16 edge  = input_port_read(machine(), "EDGE" )<<2;
2742   UINT16 swing = ioport("SWING")->read()<<2;
2743   UINT16 edge  = ioport("EDGE" )->read()<<2;
27442744
27452745   switch (offset)
27462746   {
r15082r15083
28332833{
28342834   UINT16 gas, steer, ddy;
28352835
2836   gas   = input_port_read(machine(), "GAS") ^ 0x7f;
2837   steer = input_port_read(machine(), "STEER") ^ 0xff;
2838   ddy = input_port_read(machine(), "STICKY");
2836   gas   = ioport("GAS")->read() ^ 0x7f;
2837   steer = ioport("STEER")->read() ^ 0xff;
2838   ddy = ioport("STICKY")->read();
28392839   if (ddy > 0) ddy -= 1;
28402840
28412841   gas <<= 2;
r15082r15083
28772877{
28782878   UINT16 pedal, x, y;
28792879
2880   pedal = input_port_read(machine(), "PEDAL")<<2;
2881   x = input_port_read(machine(), "STICKX")<<2;
2882   y = input_port_read(machine(), "STICKY")<<2;
2880   pedal = ioport("PEDAL")->read()<<2;
2881   x = ioport("STICKX")->read()<<2;
2882   y = ioport("STICKY")->read()<<2;
28832883
28842884
28852885   switch (offset)
src/mame/drivers/flyball.c
r15082r15083
145145
146146   memset(potsense, 0, sizeof potsense);
147147
148   potsense[input_port_read(machine, "STICK1_Y")] |= 1;
149   potsense[input_port_read(machine, "STICK1_X")] |= 2;
150   potsense[input_port_read(machine, "STICK0_Y")] |= 4;
151   potsense[input_port_read(machine, "STICK0_X")] |= 8;
148   potsense[state->ioport("STICK1_Y")->read()] |= 1;
149   potsense[state->ioport("STICK1_X")->read()] |= 2;
150   potsense[state->ioport("STICK0_Y")->read()] |= 4;
151   potsense[state->ioport("STICK0_X")->read()] |= 8;
152152
153153   for (i = 0; i < 64; i++)
154154      if (potsense[i] != 0)
r15082r15083
173173/* two physical buttons (start game and stop runner) share the same port bit */
174174READ8_MEMBER(flyball_state::flyball_input_r)
175175{
176   return input_port_read(machine(), "IN0") & input_port_read(machine(), "IN1");
176   return ioport("IN1")->read();
177177}
178178
179179READ8_MEMBER(flyball_state::flyball_scanline_r)
src/mame/drivers/pluto5.c
r15082r15083
2828  ---------------------------------------------------------------------
2929
3030  Pluto 5 Technical Notes....
31   (why is this information here? it seems to be c+p straight from a tech manual
32    and is completely unneccessary)
3133
3234
3335  * Clocks...
r15082r15083
180182{
181183public:
182184   pluto5_state(const machine_config &mconfig, device_type type, const char *tag)
183      : driver_device(mconfig, type, tag) { }
185      : driver_device(mconfig, type, tag),
186        m_maincpu(*this, "maincpu")
187   { }
184188
189   UINT32* m_cpuregion;
190   UINT32* m_mainram;
191
192   DECLARE_READ32_MEMBER(pluto5_mem_r);
193   DECLARE_WRITE32_MEMBER(pluto5_mem_w);
194
195protected:
196
197   // devices
198   required_device<cpu_device> m_maincpu;
199
185200};
186201
202READ32_MEMBER(pluto5_state::pluto5_mem_r)
203{
204   int pc = cpu_get_pc(&space.device());
205   int cs = m68340_get_cs(m_maincpu, offset * 4);
187206
207   switch ( cs )
208   {
209      case 1:
210         return m_cpuregion[offset];
211
212      default:
213         logerror("%08x maincpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs);
214
215   }
216
217   return 0x0000;
218}
219
220WRITE32_MEMBER(pluto5_state::pluto5_mem_w)
221{
222   int pc = cpu_get_pc(&space.device());
223   int cs = m68340_get_cs(m_maincpu, offset * 4);
224
225   switch ( cs )
226   {
227      default:
228         logerror("%08x maincpu write access offset %08x data %08x mem_mask %08x cs %d\n", pc, offset*4, data, mem_mask, cs);
229
230   }
231
232}
233
234
188235static ADDRESS_MAP_START( pluto5_map, AS_PROGRAM, 32, pluto5_state )
189   AM_RANGE(0x000000, 0x2fffff) AM_ROM
236   AM_RANGE(0x00000000, 0xffffffff) AM_READWRITE(pluto5_mem_r, pluto5_mem_w)
190237ADDRESS_MAP_END
191238
192239static INPUT_PORTS_START(  pluto5 )
193240INPUT_PORTS_END
194241
242static MACHINE_START( pluto5 )
243{
244   pluto5_state *state = machine.driver_data<pluto5_state>();
245   state->m_cpuregion = (UINT32*)state->memregion( "maincpu" )->base();
246   state->m_mainram = (UINT32*)auto_alloc_array_clear(machine, UINT32, 0x10000);
247
248}
249
195250static MACHINE_CONFIG_START( pluto5, pluto5_state )
196251   MCFG_CPU_ADD("maincpu", M68340, 16000000)
197252   MCFG_CPU_PROGRAM_MAP(pluto5_map)
198253
254   MCFG_MACHINE_START( pluto5 )
255
256
199257   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
200258   /* unknown sound */
201259MACHINE_CONFIG_END
src/mame/drivers/galaxold.c
r15082r15083
580580ADDRESS_MAP_END
581581
582582READ8_MEMBER(galaxold_state::scramb2_protection_r){ return 0x25; }
583READ8_MEMBER(galaxold_state::scramb2_port0_r){ return (input_port_read(machine(), "IN0") >> offset) & 0x1; }
584READ8_MEMBER(galaxold_state::scramb2_port1_r){ return (input_port_read(machine(), "IN1") >> offset) & 0x1; }
585READ8_MEMBER(galaxold_state::scramb2_port2_r){ return (input_port_read(machine(), "IN2") >> offset) & 0x1; }
583READ8_MEMBER(galaxold_state::scramb2_port0_r){ return (ioport("IN0")->read() >> offset) & 0x1; }
584READ8_MEMBER(galaxold_state::scramb2_port1_r){ return (ioport("IN1")->read() >> offset) & 0x1; }
585READ8_MEMBER(galaxold_state::scramb2_port2_r){ return (ioport("IN2")->read() >> offset) & 0x1; }
586586
587587static ADDRESS_MAP_START( scramb2_map, AS_PROGRAM, 8, galaxold_state )
588588   AM_RANGE(0x0000, 0x3fff) AM_ROM
r15082r15083
923923   switch (bit_mask)
924924   {
925925      case 0x40:  /* vpool : IN1 (0xa800) bit 6 */
926         return ((input_port_read(machine(), "LIVES") & bit_mask) >> 6);
926         return ((ioport("LIVES")->read() & bit_mask) >> 6);
927927      case 0x01:  /* vpool : DSW (0xb000) bit 0 */
928         return ((input_port_read(machine(), "LIVES") & bit_mask) >> 0);
928         return ((ioport("LIVES")->read() & bit_mask) >> 0);
929929
930930      default:
931931         logerror("vpool_lives_r : invalid %02X bit_mask\n",bit_mask);
r15082r15083
10701070   switch (bit_mask)
10711071   {
10721072      case 0x0c:  /* ckongg  : DSW (0xc800) bits 2 and 3 */
1073         return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 2);
1073         return ((ioport("COINAGE")->read() & bit_mask) >> 2);
10741074      case 0x40:  /* ckongg  : IN1 (0xc400) bit 6 */
1075         return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 6);
1075         return ((ioport("COINAGE")->read() & bit_mask) >> 6);
10761076
10771077      case 0xc0:  /* ckongmc : IN1 (0xa800) bits 6 and 7 */
1078         return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 6);
1078         return ((ioport("COINAGE")->read() & bit_mask) >> 6);
10791079      case 0x01:  /* ckongmc : DSW (0xb000) bit 0 */
1080         return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 0);
1080         return ((ioport("COINAGE")->read() & bit_mask) >> 0);
10811081
10821082      default:
10831083         logerror("ckongg_coinage_r : invalid %02X bit_mask\n",bit_mask);
r15082r15083
14381438   switch (bit_mask)
14391439   {
14401440      case 0xc0:  /* dkongjrm : IN1 (0xa8??) bits 6 and 7 */
1441         return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 6);
1441         return ((ioport("COINAGE")->read() & bit_mask) >> 6);
14421442      case 0x01:  /* dkongjrm : DSW (0xb0??) bit 0 */
1443         return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 0);
1443         return ((ioport("COINAGE")->read() & bit_mask) >> 0);
14441444
14451445      default:
14461446         logerror("dkongjrm_coinage_r : invalid %02X bit_mask\n",bit_mask);
r15082r15083
18691869   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
18701870
18711871   PORT_START("SENSE")
1872   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1872   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
18731873INPUT_PORTS_END
18741874
18751875
r15082r15083
19331933   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
19341934
19351935   PORT_START("SENSE")
1936   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
1936   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
19371937INPUT_PORTS_END
19381938
19391939
r15082r15083
19971997   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
19981998
19991999   PORT_START("SENSE")
2000   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
2000   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
20012001INPUT_PORTS_END
20022002
20032003
src/mame/drivers/atarisy1.c
r15082r15083
268268
269269   /* digital joystick type */
270270   if (m_joystick_type == 1)
271      newval = (input_port_read(machine(), "IN0") & (0x80 >> offset)) ? 0xf0 : 0x00;
271      newval = (ioport("IN0")->read() & (0x80 >> offset)) ? 0xf0 : 0x00;
272272
273273   /* Hall-effect analog joystick */
274274   else if (m_joystick_type == 2)
275      newval = input_port_read(machine(), portnames[offset & 1]);
275      newval = ioport(portnames[offset & 1])->read();
276276
277277   /* Road Blasters gas pedal */
278278   else if (m_joystick_type == 3)
279      newval = input_port_read(machine(), "IN1");
279      newval = ioport("IN1")->read();
280280
281281   /* the A4 bit enables/disables joystick IRQs */
282282   m_joystick_int_enable = ((offset >> 3) & 1) ^ 1;
r15082r15083
321321
322322         if (player == 0)
323323         {
324            posx = (INT8)input_port_read(machine(), "IN0");
325            posy = (INT8)input_port_read(machine(), "IN1");
324            posx = (INT8)ioport("IN0")->read();
325            posy = (INT8)ioport("IN1")->read();
326326         }
327327         else
328328         {
329            posx = (INT8)input_port_read(machine(), "IN2");
330            posy = (INT8)input_port_read(machine(), "IN3");
329            posx = (INT8)ioport("IN2")->read();
330            posy = (INT8)ioport("IN3")->read();
331331         }
332332
333333         m_cur[player][0] = posx + posy;
r15082r15083
339339
340340   /* Road Blasters steering wheel */
341341   else if (m_trackball_type == 2)
342      result = input_port_read(machine(), "IN0");
342      result = ioport("IN0")->read();
343343
344344   return result;
345345}
r15082r15083
354354
355355READ16_MEMBER(atarisy1_state::port4_r)
356356{
357   int temp = input_port_read(machine(), "F60000");
357   int temp = ioport("F60000")->read();
358358   if (m_cpu_to_sound_ready) temp ^= 0x0080;
359359   return temp;
360360}
r15082r15083
369369
370370READ8_MEMBER(atarisy1_state::switch_6502_r)
371371{
372   int temp = input_port_read(machine(), "1820");
372   int temp = ioport("1820")->read();
373373
374374   if (m_cpu_to_sound_ready) temp ^= 0x08;
375375   if (m_sound_to_cpu_ready) temp ^= 0x10;
376   if (!(input_port_read(machine(), "F60000") & 0x0040)) temp ^= 0x80;
376   if (!(ioport("F60000")->read() & 0x0040)) temp ^= 0x80;
377377
378378   return temp;
379379}
r15082r15083
534534   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
535535   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
536536   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
537   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
537   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
538538   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
539539   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
540540   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
r15082r15083
573573   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Throw/P2 Start")
574574   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Jump")
575575   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
576   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
576   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
577577   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
578578   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
579579   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
r15082r15083
612612   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Whip/P2 Start")
613613   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* freeze? */
614614   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
615   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
615   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
616616   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
617617   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
618618   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
r15082r15083
659659   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Hop/P2 Start")
660660   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Unused Button 1")
661661   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Unused Button 2")
662   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
662   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
663663   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
664664   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
665665   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
r15082r15083
694694   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Lasers")
695695   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
696696   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
697   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
697   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
698698   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
699699   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
700700   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
src/mame/drivers/unkhorse.c
r15082r15083
9595 
9696   switch (state->m_output >> 6 & 3)
9797   {
98      case 0: return input_port_read(device->machine(), "IN0");
99      case 1: return input_port_read(device->machine(), "IN1");
100      case 2: return input_port_read(device->machine(), "IN2");
98      case 0: return state->ioport("IN0")->read();
99      case 1: return state->ioport("IN1")->read();
100      case 2: return state->ioport("IN2")->read();
101101      default: break;
102102   }
103103 
src/mame/drivers/sprint8.c
r15082r15083
3232
3333   for (i = 0; i < 8; i++)
3434   {
35      UINT8 val = input_port_read(timer.machine(), dialnames[i]) >> 4;
35      UINT8 val = timer.machine().root_device().ioport(dialnames[i])->read() >> 4;
3636
3737      signed char delta = (val - state->m_dial[i]) & 15;
3838
r15082r15083
6969READ8_MEMBER(sprint8_state::sprint8_input_r)
7070{
7171   static const char *const portnames[] = { "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8" };
72   UINT8 val = input_port_read(machine(), portnames[offset]);
72   UINT8 val = ioport(portnames[offset])->read();
7373
7474   if (m_steer_dir[offset])
7575   {
r15082r15083
255255   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE)
256256
257257   PORT_START("VBLANK")
258   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
258   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
259259
260260   /* this is actually a variable resistor */
261261   PORT_START("R132")
r15082r15083
383383   PORT_DIPSETTING(    0x01, "Tag" )
384384
385385   PORT_START("VBLANK")
386   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
386   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
387387
388388   /* this is actually a variable resistor */
389389   PORT_START("R132")
src/mame/drivers/dec0.c
r15082r15083
337337   switch (offset<<1)
338338   {
339339      case 0: /* Dip Switches */
340         return input_port_read(machine(), "DSW");
340         return ioport("DSW")->read();
341341
342342      case 2: /* Player 1 & Player 2 joysticks & fire buttons */
343         return input_port_read(machine(), "INPUTS");
343         return ioport("INPUTS")->read();
344344
345345      case 4: /* Credits */
346         return input_port_read(machine(), "SYSTEM");
346         return ioport("SYSTEM")->read();
347347   }
348348
349349   logerror("Unknown control read at 30c000 %d\n", offset);
r15082r15083
693693   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN1 )
694694   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 )
695695   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
696   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
696   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
697697INPUT_PORTS_END
698698
699699static INPUT_PORTS_START( dec1 )
r15082r15083
719719   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
720720   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
721721   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
722   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
722   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
723723   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
724724   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
725725   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
977977   PORT_DIPUNUSED_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW2:8" )   // Always OFF
978978
979979   PORT_START("VBLANK")
980   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
980   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
981981INPUT_PORTS_END
982982
983983static INPUT_PORTS_START( ffantasy )
r15082r15083
11211121   PORT_INCLUDE( dec1 )
11221122
11231123   PORT_MODIFY("SYSTEM")
1124   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )      /* extremely slow palette fades with ACTIVE_HIGH */
1124   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")      /* extremely slow palette fades with ACTIVE_HIGH */
11251125
11261126   PORT_START("DSW")
11271127   /* Different Coinage. Just a few combinations from manual, the rest was figured out */
src/mame/drivers/ssv.c
r15082r15083
459459   static const char *const gunnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" };
460460
461461   eeprom_device *eeprom = downcast<eeprom_device *>(device);
462   return (((state->m_gdfs_lightgun_select & 1) ? 0 : 0xff) ^ input_port_read(device->machine(), gunnames[state->m_gdfs_lightgun_select])) | (eeprom->read_bit() << 8);
462   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);
463463}
464464
465465static WRITE16_DEVICE_HANDLER( gdfs_eeprom_w )
r15082r15083
608608{
609609   UINT16 input_sel = *m_input_sel;
610610
611   if (input_sel & 0x0001)   return input_port_read(machine(), "KEY0");
612   if (input_sel & 0x0002)   return input_port_read(machine(), "KEY1");
613   if (input_sel & 0x0004)   return input_port_read(machine(), "KEY2");
614   if (input_sel & 0x0008)   return input_port_read(machine(), "KEY3");
611   if (input_sel & 0x0001)   return ioport("KEY0")->read();
612   if (input_sel & 0x0002)   return ioport("KEY1")->read();
613   if (input_sel & 0x0004)   return ioport("KEY2")->read();
614   if (input_sel & 0x0008)   return ioport("KEY3")->read();
615615   logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(&space.device()),input_sel);
616616   return 0xffff;
617617}
r15082r15083
733733{
734734   UINT16 input_sel = *m_input_sel;
735735
736   if (input_sel & 0x0002)   return input_port_read(machine(), "KEY0");
737   if (input_sel & 0x0004)   return input_port_read(machine(), "KEY1");
738   if (input_sel & 0x0008)   return input_port_read(machine(), "KEY2");
739   if (input_sel & 0x0010)   return input_port_read(machine(), "KEY3");
736   if (input_sel & 0x0002)   return ioport("KEY0")->read();
737   if (input_sel & 0x0004)   return ioport("KEY1")->read();
738   if (input_sel & 0x0008)   return ioport("KEY2")->read();
739   if (input_sel & 0x0010)   return ioport("KEY3")->read();
740740   logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(&space.device()),input_sel);
741741   return 0xffff;
742742}
r15082r15083
781781{
782782   UINT16 input_sel = *m_input_sel;
783783
784   if (input_sel & 0x0002)   return input_port_read(machine(), "KEY0");
785   if (input_sel & 0x0004)   return input_port_read(machine(), "KEY1");
786   if (input_sel & 0x0008)   return input_port_read(machine(), "KEY2");
787   if (input_sel & 0x0010)   return input_port_read(machine(), "KEY3");
784   if (input_sel & 0x0002)   return ioport("KEY0")->read();
785   if (input_sel & 0x0004)   return ioport("KEY1")->read();
786   if (input_sel & 0x0008)   return ioport("KEY2")->read();
787   if (input_sel & 0x0010)   return ioport("KEY3")->read();
788788   logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(&space.device()),input_sel);
789789   return 0xffff;
790790}
r15082r15083
827827
828828READ16_MEMBER(ssv_state::sxyreact_ballswitch_r)
829829{
830   return input_port_read_safe(machine(), "SERVICE", 0);
830   return ioport("SERVICE")->read_safe(0);
831831}
832832
833833READ16_MEMBER(ssv_state::sxyreact_dial_r)
r15082r15083
843843   {
844844
845845      if (data & 0x20)
846         m_sxyreact_serial = input_port_read_safe(machine(), "PADDLE", 0) & 0xff;
846         m_sxyreact_serial = ioport("PADDLE")->read_safe(0) & 0xff;
847847
848848      if ( (m_sxyreact_dial & 0x40) && !(data & 0x40) )   // $40 -> $00
849849         m_sxyreact_serial <<= 1;                  // shift 1 bit
r15082r15083
986986
987987   switch(m_trackball_select)
988988   {
989      case 0x60:   return (input_port_read(machine(), "TRACKX") >> 8) & 0xff;
990      case 0x40:   return (input_port_read(machine(), "TRACKX") >> 0) & 0xff;
989      case 0x60:   return (ioport("TRACKX")->read() >> 8) & 0xff;
990      case 0x40:   return (ioport("TRACKX")->read() >> 0) & 0xff;
991991
992      case 0x70:   return (input_port_read(machine(), "TRACKY") >> 8) & 0xff;
993      case 0x50:   return (input_port_read(machine(), "TRACKY") >> 0) & 0xff;
992      case 0x70:   return (ioport("TRACKY")->read() >> 8) & 0xff;
993      case 0x50:   return (ioport("TRACKY")->read() >> 0) & 0xff;
994994   }
995995   return 0;
996996}
src/mame/drivers/atarig42.c
r15082r15083
7272
7373READ16_MEMBER(atarig42_state::special_port2_r)
7474{
75   int temp = input_port_read(machine(), "IN2");
75   int temp = ioport("IN2")->read();
7676   if (m_cpu_to_sound_ready) temp ^= 0x0020;
7777   if (m_sound_to_cpu_ready) temp ^= 0x0010;
7878   temp ^= 0x0008;      /* A2D.EOC always high for now */
r15082r15083
8484{
8585   static const char *const portnames[] = { "A2D0", "A2D1" };
8686
87   m_analog_data = input_port_read(machine(), portnames[offset != 0]);
87   m_analog_data = ioport(portnames[offset != 0])->read();
8888}
8989
9090
r15082r15083
386386   PORT_START("IN2")      /* e00010 */
387387   PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
388388   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
389   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
389   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
390390   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
391391
392392   PORT_INCLUDE( atarijsa_iii )      /* audio board port */
r15082r15083
437437   PORT_START("IN2")      /* e00010 */
438438   PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
439439   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
440   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
440   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
441441   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
442442
443443   PORT_INCLUDE( atarijsa_iii )      /* audio board port */
src/mame/drivers/vindictr.c
r15082r15083
6565
6666READ16_MEMBER(vindictr_state::port1_r)
6767{
68   int result = input_port_read(machine(), "260010");
68   int result = ioport("260010")->read();
6969   if (m_sound_to_cpu_ready) result ^= 0x0004;
7070   if (m_cpu_to_sound_ready) result ^= 0x0008;
7171   result ^= 0x0010;
r15082r15083
124124   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(1)
125125
126126   PORT_START("260010")
127   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
127   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
128128   PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
129129   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
130130   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/cop01.c
r15082r15083
9898CUSTOM_INPUT_MEMBER(cop01_state::mightguy_area_r)
9999{
100100   int bit_mask = (FPTR)param;
101   return (input_port_read(machine(), "FAKE") & bit_mask) ? 0x01 : 0x00;
101   return (ioport("FAKE")->read() & bit_mask) ? 0x01 : 0x00;
102102}
103103
104104WRITE8_MEMBER(cop01_state::cop01_irq_ack_w)
src/mame/drivers/hanaawas.c
r15082r15083
3838   switch (m_mux)
3939   {
4040   case 1: /* start buttons */
41      buttons = input_port_read(machine(), "START");
41      buttons = ioport("START")->read();
4242      break;
4343   case 2: /* player 1 buttons */
44      buttons = input_port_read(machine(), "P1");
44      buttons = ioport("P1")->read();
4545      break;
4646   case 4: /* player 2 buttons */
47      buttons = input_port_read(machine(), "P2");
47      buttons = ioport("P2")->read();
4848      break;
4949   }
5050
r15082r15083
6060      }
6161   }
6262
63   return (input_port_read(machine(), "IN0") & 0xf0) | ordinal;
63   return (ioport("IN0")->read() & 0xf0) | ordinal;
6464}
6565
6666WRITE8_MEMBER(hanaawas_state::hanaawas_inputs_mux_w)
src/mame/drivers/midvunit.c
r15082r15083
8989
9090READ32_MEMBER(midvunit_state::port0_r)
9191{
92   UINT16 val = input_port_read(machine(), "IN0");
92   UINT16 val = ioport("IN0")->read();
9393   UINT16 diff = val ^ m_last_port0;
9494
9595   /* make sure the shift controls are mutually exclusive */
r15082r15083
143143      int which = (data >> m_adc_shift) - 4;
144144      if (which < 0 || which > 2)
145145         logerror("adc_w: unexpected which = %02X\n", which + 4);
146      m_adc_data = input_port_read_safe(machine(), adcnames[which], 0);
146      m_adc_data = ioport(adcnames[which])->read_safe(0);
147147      machine().scheduler().timer_set(attotime::from_msec(1), FUNC(adc_ready));
148148   }
149149   else
r15082r15083
296296READ32_MEMBER(midvunit_state::crusnwld_serial_status_r)
297297{
298298   int status = midway_serial_pic_status_r();
299   return (input_port_read(machine(), "991030") & 0x7fff7fff) | (status << 31) | (status << 15);
299   return (ioport("991030")->read() & 0x7fff7fff) | (status << 31) | (status << 15);
300300}
301301
302302
r15082r15083
359359READ32_MEMBER(midvunit_state::offroadc_serial_status_r)
360360{
361361   int status = midway_serial_pic2_status_r(&space);
362   return (input_port_read(machine(), "991030")  & 0x7fff7fff) | (status << 31) | (status << 15);
362   return (ioport("991030")->read()  & 0x7fff7fff) | (status << 31) | (status << 15);
363363}
364364
365365
src/mame/drivers/usgames.c
r15082r15083
131131   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
132132   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
133133   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) // +12 Volts?
134   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
134   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
135135
136136   PORT_START("UNK1")
137137   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
src/mame/drivers/opwolf.c
r15082r15083
304304READ16_MEMBER(opwolf_state::opwolf_in_r)
305305{
306306   static const char *const inname[2] = { "IN0", "IN1" };
307   return input_port_read(machine(), inname[offset]);
307   return ioport(inname[offset])->read();
308308}
309309
310310READ16_MEMBER(opwolf_state::opwolf_dsw_r)
311311{
312312   static const char *const dswname[2] = { "DSWA", "DSWB" };
313   return input_port_read(machine(), dswname[offset]);
313   return ioport(dswname[offset])->read();
314314}
315315
316316READ16_MEMBER(opwolf_state::opwolf_lightgun_r)
r15082r15083
320320   switch (offset)
321321   {
322322      case 0x00:   /* P1X - Have to remap 8 bit input value, into 0-319 visible range */
323         scaled = (input_port_read(machine(), P1X_PORT_TAG) * 320 ) / 256;
323         scaled = (ioport(P1X_PORT_TAG)->read() * 320 ) / 256;
324324         return (scaled + 0x15 + m_opwolf_gun_xoffs);
325325      case 0x01:   /* P1Y */
326         return (input_port_read(machine(), P1Y_PORT_TAG) - 0x24 + m_opwolf_gun_yoffs);
326         return (ioport(P1Y_PORT_TAG)->read() - 0x24 + m_opwolf_gun_yoffs);
327327   }
328328
329329   return 0xff;
r15082r15083
331331
332332READ8_MEMBER(opwolf_state::z80_input1_r)
333333{
334   return input_port_read(machine(), "IN0");   /* irrelevant mirror ? */
334   return ioport("IN0")->read();   /* irrelevant mirror ? */
335335}
336336
337337READ8_MEMBER(opwolf_state::z80_input2_r)
338338{
339   return input_port_read(machine(), "IN0");   /* needed for coins */
339   return ioport("IN0")->read();   /* needed for coins */
340340}
341341
342342
r15082r15083
979979static DRIVER_INIT( opwolf )
980980{
981981   opwolf_state *state = machine.driver_data<opwolf_state>();
982   UINT16* rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
982   UINT16* rom = (UINT16*)state->memregion("maincpu")->base();
983983
984984   state->m_opwolf_region = rom[0x03fffe / 2] & 0xff;
985985
r15082r15083
996996static DRIVER_INIT( opwolfb )
997997{
998998   opwolf_state *state = machine.driver_data<opwolf_state>();
999   UINT16* rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
999   UINT16* rom = (UINT16*)state->memregion("maincpu")->base();
10001000
10011001   state->m_opwolf_region = rom[0x03fffe / 2] & 0xff;
10021002
src/mame/drivers/shadfrce.c
r15082r15083
241241   switch (offset)
242242   {
243243      case 0 :
244         data = (input_port_read(machine(), "P1") & 0xff) | ((input_port_read(machine(), "DSW2") & 0xc0) << 6) | ((input_port_read(machine(), "SYSTEM") & 0x0f) << 8);
244         data = (ioport("P1")->read() & 0xff) | ((ioport("DSW2")->read() & 0xc0) << 6) | ((ioport("SYSTEM")->read() & 0x0f) << 8);
245245         break;
246246      case 1 :
247         data = (input_port_read(machine(), "P2") & 0xff) | ((input_port_read(machine(), "DSW2") & 0x3f) << 8);
247         data = (ioport("P2")->read() & 0xff) | ((ioport("DSW2")->read() & 0x3f) << 8);
248248         break;
249249      case 2 :
250         data = (input_port_read(machine(), "EXTRA") & 0xff) | ((input_port_read(machine(), "DSW1") & 0x3f) << 8);
250         data = (ioport("EXTRA")->read() & 0xff) | ((ioport("DSW1")->read() & 0x3f) << 8);
251251         break;
252252      case 3 :
253         data = (input_port_read(machine(), "OTHER") & 0xff) | ((input_port_read(machine(), "DSW1") & 0xc0) << 2) | ((input_port_read(machine(), "MISC") & 0x38) << 8) | (m_vblank << 8);
253         data = (ioport("OTHER")->read() & 0xff) | ((ioport("DSW1")->read() & 0xc0) << 2) | ((ioport("MISC")->read() & 0x38) << 8) | (m_vblank << 8);
254254         break;
255255   }
256256
src/mame/drivers/firebeat.c
r15082r15083
727727
728728   if (ACCESSING_BITS_24_31)
729729   {
730      r |= (input_port_read(space->machine(), "IN0") & 0xff) << 24;
730      r |= (space->machine().root_device().ioport("IN0")->read() & 0xff) << 24;
731731   }
732732   if (ACCESSING_BITS_8_15)
733733   {
734      r |= (input_port_read(space->machine(), "IN1") & 0xff) << 8;
734      r |= (space->machine().root_device().ioport("IN1")->read() & 0xff) << 8;
735735   }
736736   if (ACCESSING_BITS_0_7)
737737   {
738      r |= (input_port_read(space->machine(), "IN2") & 0xff);
738      r |= (space->machine().root_device().ioport("IN2")->read() & 0xff);
739739   }
740740
741741   return r;
r15082r15083
745745{
746746   if (offset == 0)
747747   {
748      return input_port_read(space->machine(), "SENSOR1") | 0x01000100;
748      return space->machine().root_device().ioport("SENSOR1")->read() | 0x01000100;
749749   }
750750   else
751751   {
752      return input_port_read(space->machine(), "SENSOR2") | 0x01000100;
752      return space->machine().root_device().ioport("SENSOR2")->read() | 0x01000100;
753753   }
754754}
755755
r15082r15083
13651365{
13661366   if (offset == 0)      // Keyboard Wheel (P1)
13671367   {
1368      return input_port_read(space->machine(), "WHEEL_P1") << 24;
1368      return space->machine().root_device().ioport("WHEEL_P1")->read() << 24;
13691369   }
13701370   else if (offset == 2)   // Keyboard Wheel (P2)
13711371   {
1372      return input_port_read(space->machine(), "WHEEL_P2") << 24;
1372      return space->machine().root_device().ioport("WHEEL_P2")->read() << 24;
13731373   }
13741374
13751375   return 0;
r15082r15083
14591459
14601460   for (keyboard=0; keyboard < 2; keyboard++)
14611461   {
1462      UINT32 kbstate = input_port_read(machine, keynames[keyboard]);
1462      UINT32 kbstate = machine.root_device().ioport(keynames[keyboard])->read();
14631463      int uart_channel = kb_uart_channel[keyboard];
14641464
14651465      if (kbstate != state->m_keyboard_state[keyboard])
src/mame/drivers/clayshoo.c
r15082r15083
5454   UINT8 ret = 0;
5555
5656   /* read fake port and remap the buttons to 2 bits */
57   UINT8   raw = input_port_read(machine, "FAKE");
57   UINT8   raw = machine.root_device().ioport("FAKE")->read();
5858
5959   if (raw & (1 << (bit + 1)))
6060      ret = 0x03;      /* expert */
r15082r15083
7474
7575   switch (state->m_input_port_select)
7676   {
77   case 0x01:   ret = input_port_read(device->machine(), "IN0"); break;
78   case 0x02:   ret = input_port_read(device->machine(), "IN1"); break;
79   case 0x04:   ret = (input_port_read(device->machine(), "IN2") & 0xf0) | difficulty_input_port_r(device->machine(), 0) |
77   case 0x01:   ret = state->ioport("IN0")->read(); break;
78   case 0x02:   ret = state->ioport("IN1")->read(); break;
79   case 0x04:   ret = (state->ioport("IN2")->read() & 0xf0) | difficulty_input_port_r(device->machine(), 0) |
8080                 (difficulty_input_port_r(device->machine(), 3) << 2); break;
81   case 0x08:   ret = input_port_read(device->machine(), "IN3"); break;
81   case 0x08:   ret = state->ioport("IN3")->read(); break;
8282   case 0x10:
8383   case 0x20:   break;   /* these two are not really used */
8484   default: logerror("Unexpected port read: %02X\n", state->m_input_port_select);
r15082r15083
118118
119119   m_analog_port_val = 0xff;
120120
121   m_analog_timer_1->adjust(compute_duration(&space.device(), input_port_read(machine(), "AN1")), 0x02);
122   m_analog_timer_2->adjust(compute_duration(&space.device(), input_port_read(machine(), "AN2")), 0x01);
121   m_analog_timer_1->adjust(compute_duration(&space.device(), ioport("AN1")->read()), 0x02);
122   m_analog_timer_2->adjust(compute_duration(&space.device(), ioport("AN2")->read()), 0x01);
123123}
124124
125125
src/mame/drivers/bigevglf.c
r15082r15083
196196{
197197   static const char *const portx_name[2] = { "P1X", "P2X" };
198198
199   return input_port_read(machine(), portx_name[m_port_select]);
199   return ioport(portx_name[m_port_select])->read();
200200}
201201
202202READ8_MEMBER(bigevglf_state::beg_trackball_y_r)
203203{
204204   static const char *const porty_name[2] = { "P1Y", "P2Y" };
205205
206   return input_port_read(machine(), porty_name[m_port_select]);
206   return ioport(porty_name[m_port_select])->read();
207207}
208208
209209WRITE8_MEMBER(bigevglf_state::beg_port08_w)
r15082r15083
336336
337337    */
338338   m_mcu_coin_bit5 ^= 0x20;
339   return bigevglf_mcu_status_r(space, 0) | (input_port_read(machine(), "PORT04") & 3) | m_mcu_coin_bit5;   /* bit 0 and bit 1 - coin inputs */
339   return bigevglf_mcu_status_r(space, 0) | (ioport("PORT04")->read() & 3) | m_mcu_coin_bit5;   /* bit 0 and bit 1 - coin inputs */
340340}
341341
342342static ADDRESS_MAP_START( bigevglf_sub_portmap, AS_IO, 8, bigevglf_state )
src/mame/drivers/bagman.c
r15082r15083
379379   bagman_state *state = device->machine().driver_data<bagman_state>();
380380   UINT8 dial_val;
381381
382   dial_val = input_port_read(device->machine(), "DIAL_P1");
382   dial_val = state->ioport("DIAL_P1")->read();
383383
384384   if(state->m_p1_res != 0x60)
385385      state->m_p1_res = 0x60;
r15082r15083
392392
393393   state->m_p1_old_val = dial_val;
394394
395   return (input_port_read(device->machine(), "P1") & 0x9f) | (state->m_p1_res);
395   return (state->ioport("P1")->read() & 0x9f) | (state->m_p1_res);
396396}
397397
398398static READ8_DEVICE_HANDLER( dial_input_p2_r )
r15082r15083
400400   bagman_state *state = device->machine().driver_data<bagman_state>();
401401   UINT8 dial_val;
402402
403   dial_val = input_port_read(device->machine(), "DIAL_P2");
403   dial_val = state->ioport("DIAL_P2")->read();
404404
405405   if(state->m_p2_res != 0x60)
406406      state->m_p2_res = 0x60;
r15082r15083
413413
414414   state->m_p2_old_val = dial_val;
415415
416   return (input_port_read(device->machine(), "P2") & 0x9f) | (state->m_p2_res);
416   return (state->ioport("P2")->read() & 0x9f) | (state->m_p2_res);
417417}
418418
419419static const ay8910_interface ay8910_dial_config =
src/mame/drivers/cbuster.c
r15082r15083
8484   switch (offset << 1)
8585   {
8686      case 0: /* Player 1 & Player 2 joysticks & fire buttons */
87         return input_port_read(machine(), "P1_P2");
87         return ioport("P1_P2")->read();
8888
8989      case 2: /* Dip Switches */
90         return input_port_read(machine(), "DSW");
90         return ioport("DSW")->read();
9191
9292      case 4: /* Protection */
9393         logerror("%04x : protection control read at 30c000 %d\n", cpu_get_pc(&space.device()), offset);
9494         return m_prot;
9595
9696      case 6: /* Credits, VBL in byte 7 */
97         return input_port_read(machine(), "COINS");
97         return ioport("COINS")->read();
9898   }
9999
100100   return ~0;
r15082r15083
164164   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
165165   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
166166   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
167   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
167   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
168168   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
169169   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
170170   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/dunhuang.c
r15082r15083
432432
433433READ8_MEMBER(dunhuang_state::dunhuang_service_r)
434434{
435   return input_port_read(machine(), "SERVICE")
435   return ioport("SERVICE")->read()
436436    | ((m_hopper && !(machine().primary_screen->frame_number() % 10)) ? 0x00 : 0x08)   // bit 3: hopper sensor
437437    | 0x80                                                // bit 7 low -> tiles block transferrer busy
438438   ;
r15082r15083
441441static READ8_DEVICE_HANDLER( dunhuang_dsw_r )
442442{
443443   dunhuang_state *state = device->machine().driver_data<dunhuang_state>();
444   if (!(state->m_input & 0x01))   return input_port_read(device->machine(), "DSW1");
445   if (!(state->m_input & 0x02))   return input_port_read(device->machine(), "DSW2");
446   if (!(state->m_input & 0x04))   return input_port_read(device->machine(), "DSW3");
447   if (!(state->m_input & 0x08))   return input_port_read(device->machine(), "DSW4");
448   if (!(state->m_input & 0x10))   return input_port_read(device->machine(), "DSW5");
444   if (!(state->m_input & 0x01))   return state->ioport("DSW1")->read();
445   if (!(state->m_input & 0x02))   return state->ioport("DSW2")->read();
446   if (!(state->m_input & 0x04))   return state->ioport("DSW3")->read();
447   if (!(state->m_input & 0x08))   return state->ioport("DSW4")->read();
448   if (!(state->m_input & 0x10))   return state->ioport("DSW5")->read();
449449   logerror("%s: warning, unknown dsw bits read, input = %02x\n", device->machine().describe_context(), state->m_input);
450450   return 0xff;
451451}
452452READ8_MEMBER(dunhuang_state::dunhuang_input_r)
453453{
454   if (!(m_input & 0x01))   return input_port_read(machine(), "IN0");
455   if (!(m_input & 0x02))   return input_port_read(machine(), "IN1");
456   if (!(m_input & 0x04))   return input_port_read(machine(), "IN2");
457   if (!(m_input & 0x08))   return input_port_read(machine(), "IN3");
458   if (!(m_input & 0x10))   return input_port_read(machine(), "IN4");
454   if (!(m_input & 0x01))   return ioport("IN0")->read();
455   if (!(m_input & 0x02))   return ioport("IN1")->read();
456   if (!(m_input & 0x04))   return ioport("IN2")->read();
457   if (!(m_input & 0x08))   return ioport("IN3")->read();
458   if (!(m_input & 0x10))   return ioport("IN4")->read();
459459   logerror("%s: warning, unknown input bits read, input = %02x\n", machine().describe_context(), m_input);
460460   return 0xff;
461461}
src/mame/drivers/ojankohs.c
r15082r15083
113113
114114   switch (m_portselect)
115115   {
116      case 0x01:   ret = input_port_read(machine(), "KEY0");   break;
117      case 0x02:   ret = input_port_read(machine(), "KEY1"); break;
118      case 0x04:   ret = input_port_read(machine(), "KEY2"); break;
119      case 0x08:   ret = input_port_read(machine(), "KEY3"); break;
120      case 0x10:   ret = input_port_read(machine(), "KEY4"); break;
116      case 0x01:   ret = ioport("KEY0")->read();   break;
117      case 0x02:   ret = ioport("KEY1")->read(); break;
118      case 0x04:   ret = ioport("KEY2")->read(); break;
119      case 0x08:   ret = ioport("KEY3")->read(); break;
120      case 0x10:   ret = ioport("KEY4")->read(); break;
121121      case 0x20:   ret = 0xff; break;
122122      case 0x3f:   ret = 0xff;
123               ret &= input_port_read(machine(), "KEY0");
124               ret &= input_port_read(machine(), "KEY1");
125               ret &= input_port_read(machine(), "KEY2");
126               ret &= input_port_read(machine(), "KEY3");
127               ret &= input_port_read(machine(), "KEY4");
123               ret &= ioport("KEY0")->read();
124               ret &= ioport("KEY1")->read();
125               ret &= ioport("KEY2")->read();
126               ret &= ioport("KEY3")->read();
127               ret &= ioport("KEY4")->read();
128128               break;
129129      default:   ret = 0xff;
130130               logerror("PC:%04X unknown %02X\n", cpu_get_pc(&space.device()), m_portselect);
r15082r15083
147147   for (i = 0; i < 5; i++)
148148   {
149149      if (!BIT(m_portselect, i))
150         ret |= input_port_read(machine(), keynames[offset][i]);
150         ret |= ioport(keynames[offset][i])->read();
151151   }
152152
153   return (ret & 0x3f) | (input_port_read(machine(), offset ? "IN1" : "IN0") & 0xc0);
153   return (ret & 0x3f) | (ioport(offset ? "IN1" : "IN0")->read() & 0xc0);
154154}
155155
156156static READ8_DEVICE_HANDLER( ojankohs_ay8910_0_r )
157157{
158158   // DIPSW 1
159   return (((input_port_read(device->machine(), "DSW1") & 0x01) << 7) | ((input_port_read(device->machine(), "DSW1") & 0x02) << 5) |
160           ((input_port_read(device->machine(), "DSW1") & 0x04) << 3) | ((input_port_read(device->machine(), "DSW1") & 0x08) << 1) |
161           ((input_port_read(device->machine(), "DSW1") & 0x10) >> 1) | ((input_port_read(device->machine(), "DSW1") & 0x20) >> 3) |
162           ((input_port_read(device->machine(), "DSW1") & 0x40) >> 5) | ((input_port_read(device->machine(), "DSW1") & 0x80) >> 7));
159   device_t &root = device->machine().root_device();
160   return (((root.ioport("DSW1")->read() & 0x01) << 7) | ((root.ioport("DSW1")->read() & 0x02) << 5) |
161           ((root.ioport("DSW1")->read() & 0x04) << 3) | ((root.ioport("DSW1")->read() & 0x08) << 1) |
162           ((root.ioport("DSW1")->read() & 0x10) >> 1) | ((root.ioport("DSW1")->read() & 0x20) >> 3) |
163           ((root.ioport("DSW1")->read() & 0x40) >> 5) | ((root.ioport("DSW1")->read() & 0x80) >> 7));
163164}
164165
165166static READ8_DEVICE_HANDLER( ojankohs_ay8910_1_r )
166167{
167168   // DIPSW 1
168   return (((input_port_read(device->machine(), "DSW2") & 0x01) << 7) | ((input_port_read(device->machine(), "DSW2") & 0x02) << 5) |
169           ((input_port_read(device->machine(), "DSW2") & 0x04) << 3) | ((input_port_read(device->machine(), "DSW2") & 0x08) << 1) |
170           ((input_port_read(device->machine(), "DSW2") & 0x10) >> 1) | ((input_port_read(device->machine(), "DSW2") & 0x20) >> 3) |
171           ((input_port_read(device->machine(), "DSW2") & 0x40) >> 5) | ((input_port_read(device->machine(), "DSW2") & 0x80) >> 7));
169   device_t &root = device->machine().root_device();
170   return (((root.ioport("DSW2")->read() & 0x01) << 7) | ((root.ioport("DSW2")->read() & 0x02) << 5) |
171           ((root.ioport("DSW2")->read() & 0x04) << 3) | ((root.ioport("DSW2")->read() & 0x08) << 1) |
172           ((root.ioport("DSW2")->read() & 0x10) >> 1) | ((root.ioport("DSW2")->read() & 0x20) >> 3) |
173           ((root.ioport("DSW2")->read() & 0x40) >> 5) | ((root.ioport("DSW2")->read() & 0x80) >> 7));
172174}
173175
174176READ8_MEMBER(ojankohs_state::ccasino_dipsw3_r)
175177{
176   return (input_port_read(machine(), "DSW3") ^ 0xff);      // DIPSW 3
178   return (ioport("DSW3")->read() ^ 0xff);      // DIPSW 3
177179}
178180
179181READ8_MEMBER(ojankohs_state::ccasino_dipsw4_r)
180182{
181   return (input_port_read(machine(), "DSW4") ^ 0xff);      // DIPSW 4
183   return (ioport("DSW4")->read() ^ 0xff);      // DIPSW 4
182184}
183185
184186WRITE8_MEMBER(ojankohs_state::ojankoy_coinctr_w)
src/mame/drivers/3do.c
r15082r15083
135135
136136   state->m_maincpu = downcast<legacy_cpu_device*>( machine.device("maincpu") );
137137
138   state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base());
138   state->membank("bank2")->set_base(state->memregion("user1")->base());
139139
140140   /* configure overlay */
141141   state->membank("bank1")->configure_entry(0, state->m_dram);
src/mame/drivers/spdodgeb.c
r15082r15083
9898   {
9999      int curr[2][2];
100100
101      curr[p][0] = input_port_read(machine, p ? "P2" : "P1") & 0x01;
102      curr[p][1] = input_port_read(machine, p ? "P2" : "P1") & 0x02;
101      curr[p][0] = state->ioport(p ? "P2" : "P1")->read() & 0x01;
102      curr[p][1] = state->ioport(p ? "P2" : "P1")->read() & 0x02;
103103
104104      for (j = 0;j <= 1;j++)
105105      {
r15082r15083
133133   {
134134      int curr[2];
135135
136      curr[p] = input_port_read(machine, p ? "P2" : "P1") & 0x30;
136      curr[p] = machine.root_device().ioport(p ? "P2" : "P1")->read() & 0x30;
137137
138138      if (state->m_jumped[p]) buttons[p] = 0;   /* jump only momentarily flips the buttons */
139139      else buttons[p] = curr[p];
r15082r15083
144144      state->m_prev[p] = curr[p];
145145   }
146146
147   state->m_inputs[0] = input_port_read(machine, "P1") & 0xcf;
148   state->m_inputs[1] = input_port_read(machine, "P2") & 0x0f;
147   state->m_inputs[0] = machine.root_device().ioport("P1")->read() & 0xcf;
148   state->m_inputs[1] = machine.root_device().ioport("P2")->read() & 0x0f;
149149   state->m_inputs[2] = state->m_running[0] | buttons[0];
150150   state->m_inputs[3] = state->m_running[1] | buttons[1];
151151}
r15082r15083
166166
167167   for (p=0; p<=1; p++)
168168   {
169      curr_port[p] = input_port_read(machine, p ? "P2" : "P1");
169      curr_port[p] = state->ioport(p ? "P2" : "P1")->read();
170170      curr_dash[p] = 0;
171171
172172      if (curr_port[p] & R)
r15082r15083
221221      case 1: return m_inputs[1];
222222      case 2: return m_inputs[2];
223223      case 3: return m_inputs[3];
224      case 4: return input_port_read(machine(), "IN1");
224      case 4: return ioport("IN1")->read();
225225   }
226226}
227227
r15082r15083
235235
236236READ8_MEMBER(spdodgeb_state::port_0_r)
237237{
238   int port = input_port_read(machine(), "IN0");
238   int port = ioport("IN0")->read();
239239
240240   m_toggle^=0x02;   /* mcu63701_busy flag */
241241
r15082r15083
272272
273273static INPUT_PORTS_START( spdodgeb )
274274   PORT_START("IN0")
275   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
275   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
276276   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* mcu63701_busy flag */
277277   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
278278   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
src/mame/drivers/deco_ld.c
r15082r15083
286286   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
287287   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
288288   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
289   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
289   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
290290
291291   PORT_START("IN1")
292292   PORT_DIPNAME( 0x01, 0x00, "SYS1" )
r15082r15083
442442   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
443443   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
444444   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
445   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
445   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
446446
447447   PORT_START("IN1")
448448   PORT_DIPNAME( 0x01, 0x00, "SYS1" )
src/mame/drivers/turbo.c
r15082r15083
490490READ8_MEMBER(turbo_state::turbo_collision_r)
491491{
492492   machine().primary_screen->update_partial(machine().primary_screen->vpos());
493   return input_port_read(machine(), "DSW3") | (m_turbo_collision & 15);
493   return ioport("DSW3")->read() | (m_turbo_collision & 15);
494494}
495495
496496
r15082r15083
504504static READ8_DEVICE_HANDLER( turbo_analog_r )
505505{
506506   turbo_state *state = device->machine().driver_data<turbo_state>();
507   return input_port_read(device->machine(), "DIAL") - state->m_turbo_last_analog;
507   return state->ioport("DIAL")->read() - state->m_turbo_last_analog;
508508}
509509
510510
511511WRITE8_MEMBER(turbo_state::turbo_analog_reset_w)
512512{
513   m_turbo_last_analog = input_port_read(machine(), "DIAL");
513   m_turbo_last_analog = ioport("DIAL")->read();
514514}
515515
516516
r15082r15083
548548
549549READ8_MEMBER(turbo_state::buckrog_port_2_r)
550550{
551   int inp1 = input_port_read(machine(), "DSW1");
552   int inp2 = input_port_read(machine(), "DSW2");
551   int inp1 = ioport("DSW1")->read();
552   int inp2 = ioport("DSW2")->read();
553553
554554   return  (((inp2 >> 6) & 1) << 7) |
555555         (((inp2 >> 4) & 1) << 6) |
r15082r15083
564564
565565READ8_MEMBER(turbo_state::buckrog_port_3_r)
566566{
567   int inp1 = input_port_read(machine(), "DSW1");
568   int inp2 = input_port_read(machine(), "DSW2");
567   int inp1 = ioport("DSW1")->read();
568   int inp2 = ioport("DSW2")->read();
569569
570570   return  (((inp2 >> 7) & 1) << 7) |
571571         (((inp2 >> 5) & 1) << 6) |
src/mame/drivers/cvs.c
r15082r15083
261261   /* the lower 4 (or 3?) bits select the port to read */
262262   switch (offset & 0x0f)   /* might be 0x07 */
263263   {
264   case 0x00:  ret = input_port_read(machine(), "IN0"); break;
265   case 0x02:  ret = input_port_read(machine(), "IN1"); break;
266   case 0x03:  ret = input_port_read(machine(), "IN2"); break;
267   case 0x04:  ret = input_port_read(machine(), "IN3"); break;
268   case 0x06:  ret = input_port_read(machine(), "DSW3"); break;
269   case 0x07:  ret = input_port_read(machine(), "DSW2"); break;
264   case 0x00:  ret = ioport("IN0")->read(); break;
265   case 0x02:  ret = ioport("IN1")->read(); break;
266   case 0x03:  ret = ioport("IN2")->read(); break;
267   case 0x04:  ret = ioport("IN3")->read(); break;
268   case 0x06:  ret = ioport("DSW3")->read(); break;
269   case 0x07:  ret = ioport("DSW2")->read(); break;
270270   default:    logerror("%04x : CVS: Reading unmapped input port 0x%02x\n", cpu_get_pc(&space.device()), offset & 0x0f); break;
271271   }
272272
r15082r15083
425425static int speech_rom_read_bit( device_t *device )
426426{
427427   cvs_state *state = device->machine().driver_data<cvs_state>();
428   running_machine &machine = device->machine();
429   UINT8 *ROM = machine.root_device().memregion("speechdata")->base();
428   UINT8 *ROM = state->memregion("speechdata")->base();
430429   int bit;
431430
432431   /* before reading the bit, clamp the address to the region length */
r15082r15083
612611   PORT_DIPUNUSED( 0x20, IP_ACTIVE_HIGH )                  /* can't tell if it's ACTIVE_HIGH or ACTIVE_LOW */
613612
614613   PORT_START("SENSE")
615   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
614   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
616615INPUT_PORTS_END
617616
618617static INPUT_PORTS_START( cvs_registration )
src/mame/drivers/tnzs.c
r15082r15083
680680   tnzs_state *state = device->machine().driver_data<tnzs_state>();
681681   int dsw, dsw1, dsw2;
682682
683   dsw1 = input_port_read(device->machine(), "DSWA");
684   dsw2 = input_port_read(device->machine(), "DSWB");
683   dsw1 = state->ioport("DSWA")->read();
684   dsw2 = state->ioport("DSWB")->read();
685685
686686   switch (state->m_kageki_csport_sel)
687687   {
src/mame/drivers/rohga.c
r15082r15083
298298   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
299299   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
300300   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
301   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
301   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
302302
303303   PORT_START("DSW1_2")
304304   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
r15082r15083
396396   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
397397   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
398398   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
399   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
399   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
400400
401401   PORT_START("DSW1_2")
402402   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
r15082r15083
469469   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
470470   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
471471   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
472   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
472   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
473473
474474   PORT_START("DSW1_2")
475475   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
r15082r15083
553553   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
554554   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
555555   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
556   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
556   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
557557
558558   PORT_START("DSW1_2")
559559   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
src/mame/drivers/plygonet.c
r15082r15083
110110   }
111111   else
112112   {
113      UINT8 lowInputBits = input_port_read(device->machine(), "IN1");
114      UINT8 highInputBits = input_port_read(device->machine(), "IN0");
113      UINT8 lowInputBits = device->machine().root_device().ioport("IN1")->read();
114      UINT8 highInputBits = device->machine().root_device().ioport("IN0")->read();
115115      return ((highInputBits << 24) | (lowInputBits << 16));
116116   }
117117
r15082r15083
124124{
125125   if (ACCESSING_BITS_24_31)
126126   {
127      input_port_write(machine(), "EEPROMOUT", data, 0xffffffff);
127      ioport("EEPROMOUT")->write(data, 0xffffffff);
128128      return;
129129   }
130130
src/mame/drivers/batman.c
r15082r15083
8989
9090READ16_MEMBER(batman_state::special_port2_r)
9191{
92   int result = input_port_read(machine(), "260010");
92   int result = ioport("260010")->read();
9393   if (m_sound_to_cpu_ready) result ^= 0x0010;
9494   if (m_cpu_to_sound_ready) result ^= 0x0020;
9595   return result;
r15082r15083
180180   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )   /* Input buffer full (@260030) */
181181   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )   /* Output buffer full (@260040) */
182182   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
183   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
183   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
184184
185185   PORT_INCLUDE( atarijsa_iii )      /* audio board port */
186186INPUT_PORTS_END
src/mame/drivers/nemesis.c
r15082r15083
198198    bit 12-15: accel
199199*/
200200
201   int data = input_port_read(machine(), "IN3");
202   int data2 = input_port_read(machine(), "PADDLE");
201   int data = ioport("IN3")->read();
202   int data2 = ioport("PADDLE")->read();
203203
204204   int ret=0x0000;
205205
r15082r15083
228228
229229   switch (m_selected_ip & 0xf)
230230   {                                    // From WEC Le Mans Schems:
231      case 0xc:  return input_port_read(machine(), "ACCEL");   // Accel - Schems: Accelevr
232      case 0:    return input_port_read(machine(), "ACCEL");
233      case 0xd:  return input_port_read(machine(), "WHEEL");   // Wheel - Schems: Handlevr
234      case 1:    return input_port_read(machine(), "WHEEL");
231      case 0xc:  return ioport("ACCEL")->read();   // Accel - Schems: Accelevr
232      case 0:    return ioport("ACCEL")->read();
233      case 0xd:  return ioport("WHEEL")->read();   // Wheel - Schems: Handlevr
234      case 1:    return ioport("WHEEL")->read();
235235
236236      default: return ~0;
237237   }
r15082r15083
12811281   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12821282   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12831283   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1284   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x02)      // only in WEC Le Mans 24 cabinets
1285   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x02)   // player 2?
1284   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x02)      // only in WEC Le Mans 24 cabinets
1285   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x02)   // player 2?
12861286   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 )
12871287   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL )   // must be 0 otherwise game freezes when using WEC Le Mans 24 cabinet
12881288   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r15082r15083
13291329   PORT_BIT( 0x7f, 0x40, IPT_PADDLE ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10)
13301330
13311331   PORT_START("IN3")
1332   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)      // only in Konami GT cabinet with brake
1333   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
1332   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01)      // only in Konami GT cabinet with brake
1333   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
13341334   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
13351335//  PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 )
13361336
src/mame/drivers/progolf.c
r15082r15083
279279static INPUT_PORTS_START( progolf )
280280   PORT_START("IN0")
281281   PORT_BIT( 0x7f, IP_ACTIVE_HIGH, IPT_UNUSED )
282   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
282   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
283283
284284   PORT_START("P1")
285285   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
r15082r15083
311311   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
312312   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
313313   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
314   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
315   PORT_DIPSETTING(    0x02, DEF_STR( 1C_6C ) )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
314   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
315   PORT_DIPSETTING(    0x02, DEF_STR( 1C_6C ) )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
316316   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_A ) )
317317   PORT_DIPSETTING(    0x0c, DEF_STR( 2C_1C ) )
318318   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
319319   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
320   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
321   PORT_DIPSETTING(    0x08, DEF_STR( 1C_6C ) )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
320   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )  PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
321   PORT_DIPSETTING(    0x08, DEF_STR( 1C_6C ) )  PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
322322   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) )
323323   PORT_DIPSETTING(    0x10, DEF_STR( Upright ) )
324324   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
src/mame/drivers/powerbal.c
r15082r15083
227227   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
228228   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
229229   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
230   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
230   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
231231   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
232232
233233   PORT_START("DSW1")
234234   PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
235235   PORT_DIPSETTING(    0x01, "Mode 1" )
236236   PORT_DIPSETTING(    0x00, "Mode 2" )
237   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
238   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
239   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
240   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
241   PORT_DIPSETTING(    0x1a, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
242   PORT_DIPSETTING(    0x02, DEF_STR( 8C_3C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
243   PORT_DIPSETTING(    0x1c, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
244   PORT_DIPSETTING(    0x04, DEF_STR( 5C_3C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
245   PORT_DIPSETTING(    0x06, DEF_STR( 3C_2C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
246   PORT_DIPSETTING(    0x1e, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
247   PORT_DIPSETTING(    0x08, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
248   PORT_DIPSETTING(    0x12, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
249   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
250   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
251   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
252   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
253   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
254   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
255   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
256   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
257   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
258   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
259   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
260   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
261   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
262   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
263   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
237   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
238   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
239   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
240   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
241   PORT_DIPSETTING(    0x1a, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
242   PORT_DIPSETTING(    0x02, DEF_STR( 8C_3C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
243   PORT_DIPSETTING(    0x1c, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
244   PORT_DIPSETTING(    0x04, DEF_STR( 5C_3C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
245   PORT_DIPSETTING(    0x06, DEF_STR( 3C_2C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
246   PORT_DIPSETTING(    0x1e, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
247   PORT_DIPSETTING(    0x08, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
248   PORT_DIPSETTING(    0x12, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
249   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
250   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
251   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
252   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
253   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
254   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
255   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
256   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
257   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
258   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
259   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
260   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
261   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
262   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
263   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
264264   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
265265   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
266266   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r15082r15083
324324   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
325325   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
326326   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
327   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
327   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
328328   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
329329
330330   PORT_START("DSW1")
src/mame/drivers/goal92.c
r15082r15083
2929   switch(offset)
3030   {
3131      case 0:
32         return input_port_read(machine(), "DSW1");
32         return ioport("DSW1")->read();
3333      case 1:
34         return input_port_read(machine(), "IN1");
34         return ioport("IN1")->read();
3535      case 2:
36         return input_port_read(machine(), "IN2");
36         return ioport("IN2")->read();
3737      case 3:
38         return input_port_read(machine(), "IN3");
38         return ioport("IN3")->read();
3939      case 7:
40         return input_port_read(machine(), "DSW2");
40         return ioport("DSW2")->read();
4141
4242      default:
4343         logerror("reading unhandled goal92 inputs %04X %04X @ PC = %04X\n", offset, mem_mask,cpu_get_pc(&space.device()));
src/mame/drivers/alg.c
r15082r15083
6161{
6262   const rectangle &visarea = screen.visible_area();
6363
64   int xpos = input_port_read_safe(screen.machine(), (player == 0) ? "GUN1X" : "GUN2X", 0xffffffff);
65   int ypos = input_port_read_safe(screen.machine(), (player == 0) ? "GUN1Y" : "GUN2Y", 0xffffffff);
64   int xpos = screen.machine().root_device().ioport((player == 0) ? "GUN1X" : "GUN2X")->read_safe(0xffffffff);
65   int ypos = screen.machine().root_device().ioport((player == 0) ? "GUN1Y" : "GUN2Y")->read_safe(0xffffffff);
6666
6767   if (xpos == -1 || ypos == -1)
6868      return FALSE;
r15082r15083
201201{
202202
203203   /* read the trigger control based on the input select */
204   return (input_port_read(machine(), "TRIGGERS") >> m_input_select) & 1;
204   return (ioport("TRIGGERS")->read() >> m_input_select) & 1;
205205}
206206
207207
r15082r15083
209209{
210210
211211   /* read the holster control based on the input select */
212   return (input_port_read(machine(), "TRIGGERS") >> (2 + m_input_select)) & 1;
212   return (ioport("TRIGGERS")->read() >> (2 + m_input_select)) & 1;
213213}
214214
215215
r15082r15083
240240
241241static READ8_DEVICE_HANDLER( alg_cia_0_porta_r )
242242{
243   return input_port_read(device->machine(), "FIRE") | 0x3f;
243   return device->machine().root_device().ioport("FIRE")->read() | 0x3f;
244244}
245245
246246
src/mame/drivers/unico.c
r15082r15083
104104/* Light Gun - need to wiggle the input slightly otherwise fire doesn't work */
105105READ16_MEMBER(unico_state::unico_gunx_0_msb_r)
106106{
107   int x=input_port_read(machine(), "X0");
107   int x=ioport("X0")->read();
108108
109109   x=x*384/256; /* On screen pixel X */
110110   if (x<0x160) x=0x30 + (x*0xd0/0x15f);
r15082r15083
115115
116116READ16_MEMBER(unico_state::unico_guny_0_msb_r)
117117{
118   int y=input_port_read(machine(), "Y0");
118   int y=ioport("Y0")->read();
119119
120120   y=0x18+((y*0xe0)/0xff);
121121
r15082r15083
124124
125125READ16_MEMBER(unico_state::unico_gunx_1_msb_r)
126126{
127   int x=input_port_read(machine(), "X1");
127   int x=ioport("X1")->read();
128128
129129   x=x*384/256; /* On screen pixel X */
130130   if (x<0x160) x=0x30 + (x*0xd0/0x15f);
r15082r15083
135135
136136READ16_MEMBER(unico_state::unico_guny_1_msb_r)
137137{
138   int y=input_port_read(machine(), "Y1");
138   int y=ioport("Y1")->read();
139139
140140   y=0x18+((y*0xe0)/0xff);
141141
src/mame/drivers/gcpinbal.c
r15082r15083
8282   switch (offset)
8383   {
8484      case 0x80/2:
85         return input_port_read(machine(), "DSW");
85         return ioport("DSW")->read();
8686
8787      case 0x84/2:
88         return input_port_read(machine(), "IN0");
88         return ioport("IN0")->read();
8989
9090      case 0x86/2:
91         return input_port_read(machine(), "IN1");
91         return ioport("IN1")->read();
9292
9393      case 0x50:
9494      case 0x51:
src/mame/drivers/segag80v.c
r15082r15083
233233   /* read as two bits from each of 4 ports. For this reason, the input   */
234234   /* ports have been organized logically, and are demangled at runtime.  */
235235   /* 4 input ports each provide 8 bits of information. */
236   UINT8 d7d6 = input_port_read(machine(), "D7D6");
237   UINT8 d5d4 = input_port_read(machine(), "D5D4");
238   UINT8 d3d2 = input_port_read(machine(), "D3D2");
239   UINT8 d1d0 = input_port_read(machine(), "D1D0");
236   UINT8 d7d6 = ioport("D7D6")->read();
237   UINT8 d5d4 = ioport("D5D4")->read();
238   UINT8 d3d2 = ioport("D3D2")->read();
239   UINT8 d1d0 = ioport("D1D0")->read();
240240   int shift = offset & 3;
241241   return demangle(d7d6 >> shift, d5d4 >> shift, d3d2 >> shift, d1d0 >> shift);
242242}
r15082r15083
260260   INT8 delta;
261261
262262   if (m_spinner_select & 1)
263      return input_port_read(machine(), "FC");
263      return ioport("FC")->read();
264264
265265/*
266266 * The values returned are always increasing.  That is, regardless of whether
r15082r15083
270270 */
271271
272272   /* I'm sure this can be further simplified ;-) BW */
273   delta = input_port_read(machine(), "SPINNER");
273   delta = ioport("SPINNER")->read();
274274   if (delta != 0)
275275   {
276276      m_spinner_sign = (delta >> 7) & 1;
r15082r15083
289289
290290CUSTOM_INPUT_MEMBER(segag80v_state::elim4_joint_coin_r)
291291{
292   return (input_port_read(machine(), "COINS") & 0xf) != 0xf;
292   return (ioport("COINS")->read() & 0xf) != 0xf;
293293}
294294
295295
r15082r15083
305305      {
306306         case 6:
307307            /* player 3 & 4 controls */
308            result = input_port_read(machine(), "FC");
308            result = ioport("FC")->read();
309309            break;
310310         case 7:
311311            /* the 4 coin inputs */
312            result = input_port_read(machine(), "COINS");
312            result = ioport("COINS")->read();
313313            break;
314314      }
315315   }
src/mame/drivers/ace.c
r15082r15083
248248   //c012
249249
250250   PORT_START("c014")   /* VBLANK??? */
251   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
251   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
252252
253253   PORT_START("c015")   /* coin input */
254254   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
src/mame/drivers/astrocde.c
r15082r15083
256256CUSTOM_INPUT_MEMBER(astrocde_state::ebases_trackball_r)
257257{
258258   static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" };
259   return input_port_read(machine(), names[m_input_select]);
259   return ioport(names[m_input_select])->read();
260260}
261261
262262
r15082r15083
283283{
284284   coin_counter_w(machine(), 0, (offset >> 8) & 1);
285285   coin_counter_w(machine(), 1, (offset >> 9) & 1);
286   return input_port_read_safe(machine(), "P3HANDLE", 0xff);
286   return ioport("P3HANDLE")->read_safe(0xff);
287287}
288288
289289
r15082r15083
482482CUSTOM_INPUT_MEMBER(astrocde_state::demndragn_joystick_r)
483483{
484484   static const char *const names[] = { "MOVEX", "MOVEY" };
485   return input_port_read(machine(), names[m_input_select]);
485   return ioport(names[m_input_select])->read();
486486}
487487
488488
src/mame/drivers/40love.c
r15082r15083
578578static DRIVER_INIT( 40love )
579579{
580580   fortyl_state *state = machine.driver_data<fortyl_state>();
581   UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
581   UINT8 *ROM = state->memregion("maincpu")->base();
582582   state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x2000);
583583
584584   #if 0
src/mame/drivers/galaga.c
r15082r15083
717717{
718718   int bit0,bit1;
719719
720   bit0 = (input_port_read(machine(), "DSWB") >> offset) & 1;
721   bit1 = (input_port_read(machine(), "DSWA") >> offset) & 1;
720   bit0 = (ioport("DSWB")->read() >> offset) & 1;
721   bit1 = (ioport("DSWA")->read() >> offset) & 1;
722722
723723   return bit0 | (bit1 << 1);
724724}
r15082r15083
777777   }
778778}
779779
780CUSTOM_INPUT_MEMBER(digdug_state::shifted_port_r){ return input_port_read(machine(), (const char *)param) >> 4; }
780CUSTOM_INPUT_MEMBER(digdug_state::shifted_port_r){ return ioport((const char *)param)->read() >> 4; }
781781
782782static WRITE8_DEVICE_HANDLER( out_0 )
783783{
r15082r15083
10771077   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
10781078   /* bonus scores are different for 5 lives */
10791079   PORT_DIPNAME( 0x38, 0x20, "Bonus Fighter" )         PORT_DIPLOCATION("SWA:4,5,6")
1080   PORT_DIPSETTING(    0x30, "15K and 50K Only" )      PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0) /* Began with 1, 2 or 3 fighters */
1081   PORT_DIPSETTING(    0x38, "20K and 70K Only" )      PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1082   PORT_DIPSETTING(    0x08, "10K, 50K, Every 50K" )   PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1083   PORT_DIPSETTING(    0x10, "15K, 50K, Every 50K" )   PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1084   PORT_DIPSETTING(    0x18, "15K, 70K, Every 70K" )   PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1085   PORT_DIPSETTING(    0x20, "20K, 70K, Every 70K" )   PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0) // factory default = "20K, 70K, Every70K"
1086   PORT_DIPSETTING(    0x28, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1087   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1088   PORT_DIPSETTING(    0x30, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0) /* Began with 5 fighters */
1089   PORT_DIPSETTING(    0x38, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1090   PORT_DIPSETTING(    0x08, "15K and 70K Only" )      PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1091   PORT_DIPSETTING(    0x10, "20K and 70K Only" )      PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1092   PORT_DIPSETTING(    0x18, "20K and 100K Only" )     PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1093   PORT_DIPSETTING(    0x20, "30K and 120K Only" )     PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1094   PORT_DIPSETTING(    0x28, "30K, 80K, Every 80K" )   PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1095   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1080   PORT_DIPSETTING(    0x30, "15K and 50K Only" )      PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0) /* Began with 1, 2 or 3 fighters */
1081   PORT_DIPSETTING(    0x38, "20K and 70K Only" )      PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1082   PORT_DIPSETTING(    0x08, "10K, 50K, Every 50K" )   PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1083   PORT_DIPSETTING(    0x10, "15K, 50K, Every 50K" )   PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1084   PORT_DIPSETTING(    0x18, "15K, 70K, Every 70K" )   PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1085   PORT_DIPSETTING(    0x20, "20K, 70K, Every 70K" )   PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0) // factory default = "20K, 70K, Every70K"
1086   PORT_DIPSETTING(    0x28, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1087   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1088   PORT_DIPSETTING(    0x30, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0) /* Began with 5 fighters */
1089   PORT_DIPSETTING(    0x38, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1090   PORT_DIPSETTING(    0x08, "15K and 70K Only" )      PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1091   PORT_DIPSETTING(    0x10, "20K and 70K Only" )      PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1092   PORT_DIPSETTING(    0x18, "20K and 100K Only" )     PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1093   PORT_DIPSETTING(    0x20, "30K and 120K Only" )     PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1094   PORT_DIPSETTING(    0x28, "30K, 80K, Every 80K" )   PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1095   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
10961096   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Lives ) )        PORT_DIPLOCATION("SWA:7,8")
10971097   PORT_DIPSETTING(    0x00, "1" )
10981098   PORT_DIPSETTING(    0x40, "2" )
r15082r15083
11811181   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
11821182   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
11831183   PORT_DIPNAME( 0x38, 0x10, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWA:4,5,6")
1184   PORT_DIPSETTING(    0x20, "20K, 60K, Every 60K" )   PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0) /* Began with 2, 3 or 4 fighters */
1185   PORT_DIPSETTING(    0x18, "20K and 60K Only" )      PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1186   PORT_DIPSETTING(    0x10, "20K, 70K, Every 70K" )   PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0) // factory default = "20K, 70K, Every70K"
1187   PORT_DIPSETTING(    0x30, "20K, 80K, Every 80K" )   PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1188   PORT_DIPSETTING(    0x38, "30K and 80K Only" )      PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1189   PORT_DIPSETTING(    0x08, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1190   PORT_DIPSETTING(    0x28, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1191   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
1192   PORT_DIPSETTING(    0x20, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0) /* Began with 5 fighters */
1193   PORT_DIPSETTING(    0x18, "30K and 150K Only" )     PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1194   PORT_DIPSETTING(    0x10, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1195   PORT_DIPSETTING(    0x30, "30K, 150K, Every 150K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1196   PORT_DIPSETTING(    0x38, "30K Only" )              PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1197   PORT_DIPSETTING(    0x08, "30K and 100K Only" )     PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1198   PORT_DIPSETTING(    0x28, "30K and 120K Only" )     PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1199   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
1184   PORT_DIPSETTING(    0x20, "20K, 60K, Every 60K" )   PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0) /* Began with 2, 3 or 4 fighters */
1185   PORT_DIPSETTING(    0x18, "20K and 60K Only" )      PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1186   PORT_DIPSETTING(    0x10, "20K, 70K, Every 70K" )   PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0) // factory default = "20K, 70K, Every70K"
1187   PORT_DIPSETTING(    0x30, "20K, 80K, Every 80K" )   PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1188   PORT_DIPSETTING(    0x38, "30K and 80K Only" )      PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1189   PORT_DIPSETTING(    0x08, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1190   PORT_DIPSETTING(    0x28, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1191   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
1192   PORT_DIPSETTING(    0x20, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0) /* Began with 5 fighters */
1193   PORT_DIPSETTING(    0x18, "30K and 150K Only" )     PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1194   PORT_DIPSETTING(    0x10, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1195   PORT_DIPSETTING(    0x30, "30K, 150K, Every 150K" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1196   PORT_DIPSETTING(    0x38, "30K Only" )              PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1197   PORT_DIPSETTING(    0x08, "30K and 100K Only" )     PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1198   PORT_DIPSETTING(    0x28, "30K and 120K Only" )     PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
1199   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
12001200   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Lives ) )        PORT_DIPLOCATION("SWA:7,8")
12011201   PORT_DIPSETTING(    0x00, "2" )
12021202   PORT_DIPSETTING(    0x80, "3" ) // factory default = "3"
r15082r15083
12681268   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
12691269   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
12701270   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWA:3,4,5")
1271   PORT_DIPSETTING(    0x18, "10K, 40K, Every 40K" )   PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
1272   PORT_DIPSETTING(    0x14, "10K, 50K, Every 50K" )   PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
1273   PORT_DIPSETTING(    0x10, "20K, 50K, Every 50K" )   PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
1274   PORT_DIPSETTING(    0x1c, "20K, 60K, Every 60K" )   PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00) // factory default = "20K, 60K, Every60K"
1275   PORT_DIPSETTING(    0x0c, "20K, 70K, Every 70K" )   PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
1276   PORT_DIPSETTING(    0x08, "20K, 80K, Every 80K" )   PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
1277   PORT_DIPSETTING(    0x04, "20K and 60K Only" )      PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
1278   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
1279   PORT_DIPSETTING(    0x18, "10K, 50K, Every 50K" )   PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
1280   PORT_DIPSETTING(    0x14, "20K, 50K, Every 50K" )   PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
1281   PORT_DIPSETTING(    0x10, "20K, 60K, Every 60K" )   PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
1282   PORT_DIPSETTING(    0x1c, "20K, 70K, Every 70K" )   PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
1283   PORT_DIPSETTING(    0x0c, "20K, 80K, Every 80K" )   PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
1284   PORT_DIPSETTING(    0x08, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
1285   PORT_DIPSETTING(    0x04, "20K and 80K Only" )      PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
1286   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
1271   PORT_DIPSETTING(    0x18, "10K, 40K, Every 40K" )   PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
1272   PORT_DIPSETTING(    0x14, "10K, 50K, Every 50K" )   PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
1273   PORT_DIPSETTING(    0x10, "20K, 50K, Every 50K" )   PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
1274   PORT_DIPSETTING(    0x1c, "20K, 60K, Every 60K" )   PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00) // factory default = "20K, 60K, Every60K"
1275   PORT_DIPSETTING(    0x0c, "20K, 70K, Every 70K" )   PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
1276   PORT_DIPSETTING(    0x08, "20K, 80K, Every 80K" )   PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
1277   PORT_DIPSETTING(    0x04, "20K and 60K Only" )      PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
1278   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
1279   PORT_DIPSETTING(    0x18, "10K, 50K, Every 50K" )   PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
1280   PORT_DIPSETTING(    0x14, "20K, 50K, Every 50K" )   PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
1281   PORT_DIPSETTING(    0x10, "20K, 60K, Every 60K" )   PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
1282   PORT_DIPSETTING(    0x1c, "20K, 70K, Every 70K" )   PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
1283   PORT_DIPSETTING(    0x0c, "20K, 80K, Every 80K" )   PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
1284   PORT_DIPSETTING(    0x08, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
1285   PORT_DIPSETTING(    0x04, "20K and 80K Only" )      PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
1286   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
12871287   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Lives ) )        PORT_DIPLOCATION("SWA:6,7")
12881288   PORT_DIPSETTING(    0x40, "1" )
12891289   PORT_DIPSETTING(    0x20, "2" )
r15082r15083
13931393   PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )
13941394   PORT_DIPSETTING(    0x00, DEF_STR( 1C_7C ) )
13951395   PORT_DIPNAME( 0x38, 0x18, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWA:4,5,6")
1396   PORT_DIPSETTING(    0x20, "10K, 40K, Every 40K" )   PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0) // Atari factory default = "10K, 40K, Every40K"
1397   PORT_DIPSETTING(    0x10, "10K, 50K, Every 50K" )   PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
1398   PORT_DIPSETTING(    0x30, "20K, 60K, Every 60K" )   PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
1399   PORT_DIPSETTING(    0x08, "20K, 70K, Every 70K" )   PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
1400   PORT_DIPSETTING(    0x28, "10K and 40K Only" )      PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
1401   PORT_DIPSETTING(    0x18, "20K and 60K Only" )      PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0) // Namco factory default = "20K, 60K"
1402   PORT_DIPSETTING(    0x38, "10K Only" )              PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
1403   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
1404   PORT_DIPSETTING(    0x20, "20K, 60K, Every 60K" )   PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
1405   PORT_DIPSETTING(    0x10, "30K, 80K, Every 80K" )   PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
1406   PORT_DIPSETTING(    0x30, "20K and 50K Only" )      PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
1407   PORT_DIPSETTING(    0x08, "20K and 60K Only" )      PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
1408   PORT_DIPSETTING(    0x28, "30K and 70K Only" )      PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
1409   PORT_DIPSETTING(    0x18, "20K Only" )              PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
1410   PORT_DIPSETTING(    0x38, "30K Only" )              PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
1411   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
1396   PORT_DIPSETTING(    0x20, "10K, 40K, Every 40K" )   PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0) // Atari factory default = "10K, 40K, Every40K"
1397   PORT_DIPSETTING(    0x10, "10K, 50K, Every 50K" )   PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
1398   PORT_DIPSETTING(    0x30, "20K, 60K, Every 60K" )   PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
1399   PORT_DIPSETTING(    0x08, "20K, 70K, Every 70K" )   PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
1400   PORT_DIPSETTING(    0x28, "10K and 40K Only" )      PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
1401   PORT_DIPSETTING(    0x18, "20K and 60K Only" )      PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0) // Namco factory default = "20K, 60K"
1402   PORT_DIPSETTING(    0x38, "10K Only" )              PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
1403   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
1404   PORT_DIPSETTING(    0x20, "20K, 60K, Every 60K" )   PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
1405   PORT_DIPSETTING(    0x10, "30K, 80K, Every 80K" )   PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
1406   PORT_DIPSETTING(    0x30, "20K and 50K Only" )      PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
1407   PORT_DIPSETTING(    0x08, "20K and 60K Only" )      PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
1408   PORT_DIPSETTING(    0x28, "30K and 70K Only" )      PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
1409   PORT_DIPSETTING(    0x18, "20K Only" )              PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
1410   PORT_DIPSETTING(    0x38, "30K Only" )              PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
1411   PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
14121412   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Lives ) )        PORT_DIPLOCATION("SWA:7,8")
14131413   PORT_DIPSETTING(    0x00, "1" )
14141414   PORT_DIPSETTING(    0x40, "2" )
src/mame/drivers/macs.c
r15082r15083
110110         /*It's bit-wise*/
111111         switch(m_mux_data&0x0f)
112112         {
113            case 0x00: return input_port_read(machine(), "IN0");
114            case 0x01: return input_port_read(machine(), "IN1");
115            case 0x02: return input_port_read(machine(), "IN2");
116            case 0x04: return input_port_read(machine(), "IN3");
117            case 0x08: return input_port_read(machine(), "IN4");
113            case 0x00: return ioport("IN0")->read();
114            case 0x01: return ioport("IN1")->read();
115            case 0x02: return ioport("IN2")->read();
116            case 0x04: return ioport("IN3")->read();
117            case 0x08: return ioport("IN4")->read();
118118            default:
119119            logerror("Unmapped mahjong panel mux data %02x\n",m_mux_data);
120120            return 0xff;
121121         }
122122      }
123      case 1: return input_port_read(machine(), "SYS0");
124      case 2: return input_port_read(machine(), "DSW0");
125      case 3: return input_port_read(machine(), "DSW1");
126      case 4: return input_port_read(machine(), "DSW2");
127      case 5: return input_port_read(machine(), "DSW3");
128      case 6: return input_port_read(machine(), "DSW4");
129      case 7: return input_port_read(machine(), "SYS1");
123      case 1: return ioport("SYS0")->read();
124      case 2: return ioport("DSW0")->read();
125      case 3: return ioport("DSW1")->read();
126      case 4: return ioport("DSW2")->read();
127      case 5: return ioport("DSW3")->read();
128      case 6: return ioport("DSW4")->read();
129      case 7: return ioport("SYS1")->read();
130130      default:   popmessage("Unmapped I/O read at PC = %06x offset = %02x",cpu_get_pc(&space.device()),offset+0xc0);
131131   }
132132
r15082r15083
676676        730E: ED B0         ldir
677677        ...
678678*/
679      memcpy(macs_ram1 + 0x0e9f, machine.root_device().memregion("user1")->base()+0x7327, 0xc7);
680      memcpy(macs_ram1 + 0x1e9f, machine.root_device().memregion("user1")->base()+0x7327, 0xc7);
679      memcpy(macs_ram1 + 0x0e9f, state->memregion("user1")->base()+0x7327, 0xc7);
680      memcpy(macs_ram1 + 0x1e9f, state->memregion("user1")->base()+0x7327, 0xc7);
681681
682      memcpy(macs_ram1 + 0x0800, machine.root_device().memregion("user1")->base()+0x73fa, 0x507);
682      memcpy(macs_ram1 + 0x0800, state->memregion("user1")->base()+0x73fa, 0x507);
683683      memcpy(macs_ram1 + 0x1800, state->memregion("user1")->base()+0x73fa, 0x507);
684684
685685#define MAKEJMP(n,m)   macs_ram2[(n) - 0xe800 + 0]=0xc3;\
src/mame/drivers/sbowling.c
r15082r15083
216216{
217217
218218   if (m_sbw_system & 2)
219      return input_port_read(machine(), "TRACKY");
219      return ioport("TRACKY")->read();
220220   else
221      return input_port_read(machine(), "TRACKX");
221      return ioport("TRACKX")->read();
222222}
223223
224224static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, sbowling_state )
src/mame/drivers/8080bw.c
r15082r15083
18921892   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
18931893   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
18941894   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1895   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_VBLANK )
1895   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
18961896   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
18971897   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
18981898   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
r15082r15083
19321932   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
19331933   PORT_DIPSETTING(    0x01, DEF_STR( Off ) ) // must be off to boot
19341934   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1935   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
1935   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
19361936   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
19371937   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
19381938   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
src/mame/drivers/othunder.c
r15082r15083
372372READ16_MEMBER(othunder_state::othunder_lightgun_r)
373373{
374374   static const char *const portname[4] = { P1X_PORT_TAG, P1Y_PORT_TAG, P2X_PORT_TAG, P2Y_PORT_TAG };
375   return input_port_read(machine(), portname[offset]);
375   return ioport(portname[offset])->read();
376376}
377377
378378WRITE16_MEMBER(othunder_state::othunder_lightgun_w)
src/mame/drivers/quasar.c
r15082r15083
7272
7373   switch (m_io_page)
7474   {
75   case 0:  ans = input_port_read(machine(), "IN0"); break;
76   case 1:  ans = input_port_read(machine(), "IN1"); break;
77   case 2:  ans = input_port_read(machine(), "DSW0"); break;
78   case 3:  ans = input_port_read(machine(), "DSW1"); break;
75   case 0:  ans = ioport("IN0")->read(); break;
76   case 1:  ans = ioport("IN1")->read(); break;
77   case 2:  ans = ioport("DSW0")->read(); break;
78   case 3:  ans = ioport("DSW1")->read(); break;
7979   }
8080
8181   return ans;
r15082r15083
9999
100100READ8_MEMBER(quasar_state::quasar_sh_command_r)
101101{
102   return soundlatch_byte_r(space, 0) + (input_port_read(machine(), "DSW2") & 0x30);
102   return soundlatch_byte_r(space, 0) + (ioport("DSW2")->read() & 0x30);
103103}
104104
105105READ8_MEMBER(quasar_state::audio_t1_r)
r15082r15083
220220   PORT_DIPSETTING(    0x00, "Wrap Around" )
221221
222222   PORT_START("SENSE")
223   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
223   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
224224
225225   PORT_START("DSW2")
226226#if 0
src/mame/drivers/xyonix.c
r15082r15083
4343
4444   if (coin & 1)   // Coin 2 !
4545   {
46      tmp = (input_port_read(machine, "DSW") & 0xc0) >> 6;
46      tmp = (state->ioport("DSW")->read() & 0xc0) >> 6;
4747      state->m_coins++;
4848      if (state->m_coins >= coinage_table[tmp][0])
4949      {
r15082r15083
5656
5757   if (coin & 2)   // Coin 1 !
5858   {
59      tmp = (input_port_read(machine, "DSW") & 0x30) >> 4;
59      tmp = (machine.root_device().ioport("DSW")->read() & 0x30) >> 4;
6060      state->m_coins++;
6161      if (state->m_coins >= coinage_table[tmp][0])
6262      {
r15082r15083
8989      switch (m_e0_data)
9090      {
9191         case 0x81 :
92            return input_port_read(machine(), "P1") & 0x7f;
92            return ioport("P1")->read() & 0x7f;
9393         case 0x82 :
94            return input_port_read(machine(), "P2") & 0x7f;
94            return ioport("P2")->read() & 0x7f;
9595         case 0x91:
9696            /* check coin inputs */
97            coin = ((input_port_read(machine(), "P1") & 0x80) >> 7) | ((input_port_read(machine(), "P2") & 0x80) >> 6);
97            coin = ((ioport("P1")->read() & 0x80) >> 7) | ((ioport("P2")->read() & 0x80) >> 6);
9898            if (coin ^ m_prev_coin && coin != 3)
9999            {
100100               if (m_credits < 9) handle_coins(machine(), coin);
r15082r15083
102102            m_prev_coin = coin;
103103            return m_credits;
104104         case 0x92:
105            return ((input_port_read(machine(), "P1") & 0x80) >> 7) | ((input_port_read(machine(), "P2") & 0x80) >> 6);
105            return ((ioport("P1")->read() & 0x80) >> 7) | ((ioport("P2")->read() & 0x80) >> 6);
106106         case 0xe0:   /* reset? */
107107            m_coins = 0;
108108            m_credits = 0;
r15082r15083
111111            m_credits--;
112112            return 0xff;
113113         case 0xfe:   /* Dip Switches 1 to 4 */
114            return input_port_read(machine(), "DSW") & 0x0f;
114            return ioport("DSW")->read() & 0x0f;
115115         case 0xff:   /* Dip Switches 5 to 8 */
116            return input_port_read(machine(), "DSW") >> 4;
116            return ioport("DSW")->read() >> 4;
117117      }
118118   }
119119
src/mame/drivers/pacland.c
r15082r15083
198198   int shift = 4 * (offset & 1);
199199   int port = offset & 2;
200200   static const char *const portnames[] = { "DSWA", "DSWB", "IN0", "IN1" };
201   int r = (input_port_read(machine(), portnames[port]) << shift) & 0xf0;
202   r |= (input_port_read(machine(), portnames[port+1]) >> (4 - shift)) & 0x0f;
201   int r = (ioport(portnames[port])->read() << shift) & 0xf0;
202   r |= (ioport(portnames[port+1])->read() >> (4 - shift)) & 0x0f;
203203
204204   return r;
205205}
src/mame/drivers/psikyo4.c
r15082r15083
182182{
183183   if (ACCESSING_BITS_16_31)
184184   {
185      return input_port_read(device->machine(), "JP4");
185      return device->machine().root_device().ioport("JP4")->read();
186186   }
187187
188188//  logerror("Unk EEPROM read mask %x\n", mem_mask);
r15082r15083
197197
198198CUSTOM_INPUT_MEMBER(psikyo4_state::system_port_r)
199199{
200   return input_port_read(machine(), "SYSTEM");
200   return ioport("SYSTEM")->read();
201201}
202202
203203CUSTOM_INPUT_MEMBER(psikyo4_state::mahjong_ctrl_r)/* used by hotgmck/hgkairak */
r15082r15083
206206   int sel = (m_io_select[0] & 0x0000ff00) >> 8;
207207   int ret = 0xff;
208208
209   if (sel & 1) ret &= input_port_read(machine(), player ? "KEY4" : "KEY0" );
210   if (sel & 2) ret &= input_port_read(machine(), player ? "KEY5" : "KEY1" );
211   if (sel & 4) ret &= input_port_read(machine(), player ? "KEY6" : "KEY2" );
212   if (sel & 8) ret &= input_port_read(machine(), player ? "KEY7" : "KEY3" );
209   if (sel & 1) ret &= ioport(player ? "KEY4" : "KEY0" )->read();
210   if (sel & 2) ret &= ioport(player ? "KEY5" : "KEY1" )->read();
211   if (sel & 4) ret &= ioport(player ? "KEY6" : "KEY2" )->read();
212   if (sel & 8) ret &= ioport(player ? "KEY7" : "KEY3" )->read();
213213
214214   return ret;
215215}
r15082r15083
328328static void set_hotgmck_pcm_bank( running_machine &machine, int n )
329329{
330330   psikyo4_state *state = machine.driver_data<psikyo4_state>();
331   UINT8 *ymf_pcmbank = machine.root_device().memregion("ymf")->base() + 0x200000;
331   UINT8 *ymf_pcmbank = state->memregion("ymf")->base() + 0x200000;
332332   UINT8 *pcm_rom = state->memregion("ymfsource")->base();
333333
334334   memcpy(ymf_pcmbank + n * 0x100000, pcm_rom + PCM_BANK_NO_LEGACY(n) * 0x100000, 0x100000);
r15082r15083
955955static void install_hotgmck_pcm_bank(running_machine &machine)
956956{
957957   psikyo4_state *state = machine.driver_data<psikyo4_state>();
958   UINT8 *ymf_pcm = machine.root_device().memregion("ymf")->base();
958   UINT8 *ymf_pcm = state->memregion("ymf")->base();
959959   UINT8 *pcm_rom = state->memregion("ymfsource")->base();
960960
961961   memcpy(ymf_pcm, pcm_rom, 0x200000);
src/mame/drivers/rollrace.c
r15082r15083
127127   PORT_DIPSETTING(   0x10, DEF_STR( 1C_3C ) )
128128   PORT_DIPSETTING(   0x18, DEF_STR( 1C_6C ) )
129129
130/*  PORT_BIT( 0x40, IP_ACTIVE_HIGH , IPT_VBLANK )  freezes frame, could be vblank ?*/
130/*  PORT_BIT( 0x40, IP_ACTIVE_HIGH , IPT_CUSTOM ) PORT_VBLANK("screen")  freezes frame, could be vblank ?*/
131131   PORT_DIPNAME( 0x40, 0x00, "Freeze" )
132132   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
133133   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
src/mame/drivers/mirage.c
r15082r15083
111111{
112112   switch (m_mux_data & 0x1f)
113113   {
114      case 0x01: return input_port_read(machine(), "KEY0");
115      case 0x02: return input_port_read(machine(), "KEY1");
116      case 0x04: return input_port_read(machine(), "KEY2");
117      case 0x08: return input_port_read(machine(), "KEY3");
118      case 0x10: return input_port_read(machine(), "KEY4");
114      case 0x01: return ioport("KEY0")->read();
115      case 0x02: return ioport("KEY1")->read();
116      case 0x04: return ioport("KEY2")->read();
117      case 0x08: return ioport("KEY3")->read();
118      case 0x10: return ioport("KEY4")->read();
119119   }
120120
121121   return 0xffff;
r15082r15083
166166   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
167167   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
168168   PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
169   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
169   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
170170   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Flip_Screen ) )
171171   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
172172   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
src/mame/drivers/popper.c
r15082r15083
126126   switch (offset)
127127   {
128128      //           player inputs        dsw1                           dsw2
129      case 0: data = input_port_read(machine(), "IN0") | ((input_port_read(machine(), "DSW1") & 0x02) << 5) | ((input_port_read(machine(), "DSW2") & 0x01) << 4); break;
130      case 1: data = input_port_read(machine(), "IN1") | ((input_port_read(machine(), "DSW1") & 0x01) << 6) | ((input_port_read(machine(), "DSW2") & 0x02) << 3); break;
131      case 2: data = input_port_read(machine(), "IN2") | ((input_port_read(machine(), "DSW1") & 0x08) << 3) | ((input_port_read(machine(), "DSW2") & 0x04) << 2); break;
132      case 3: data = input_port_read(machine(), "IN3") | ((input_port_read(machine(), "DSW1") & 0x04) << 4) | ((input_port_read(machine(), "DSW2") & 0x08) << 1); break;
133      case 4: data = ((input_port_read(machine(), "DSW1") & 0x20) << 2) | ((input_port_read(machine(), "DSW2") & 0x10) << 1); break;
134      case 5: data = ((input_port_read(machine(), "DSW1") & 0x10) << 3) | ((input_port_read(machine(), "DSW2") & 0x20) << 0); break;
135      case 6: data = ((input_port_read(machine(), "DSW1") & 0x80) << 0) | ((input_port_read(machine(), "DSW2") & 0x40) >> 1); break;
136      case 7: data = ((input_port_read(machine(), "DSW1") & 0x40) << 1) | ((input_port_read(machine(), "DSW2") & 0x80) >> 2); break;
129      case 0: data = ioport("IN0")->read() | ((ioport("DSW1")->read() & 0x02) << 5) | ((ioport("DSW2")->read() & 0x01) << 4); break;
130      case 1: data = ioport("IN1")->read() | ((ioport("DSW1")->read() & 0x01) << 6) | ((ioport("DSW2")->read() & 0x02) << 3); break;
131      case 2: data = ioport("IN2")->read() | ((ioport("DSW1")->read() & 0x08) << 3) | ((ioport("DSW2")->read() & 0x04) << 2); break;
132      case 3: data = ioport("IN3")->read() | ((ioport("DSW1")->read() & 0x04) << 4) | ((ioport("DSW2")->read() & 0x08) << 1); break;
133      case 4: data = ((ioport("DSW1")->read() & 0x20) << 2) | ((ioport("DSW2")->read() & 0x10) << 1); break;
134      case 5: data = ((ioport("DSW1")->read() & 0x10) << 3) | ((ioport("DSW2")->read() & 0x20) << 0); break;
135      case 6: data = ((ioport("DSW1")->read() & 0x80) << 0) | ((ioport("DSW2")->read() & 0x40) >> 1); break;
136      case 7: data = ((ioport("DSW1")->read() & 0x40) << 1) | ((ioport("DSW2")->read() & 0x80) >> 2); break;
137137   }
138138   return data;
139139}
src/mame/drivers/taito_x.c
r15082r15083
340340   switch (offset)
341341   {
342342      case 0x00:
343         return  input_port_read(machine(), "DSWA") & 0x0f;
343         return  ioport("DSWA")->read() & 0x0f;
344344      case 0x01:
345         return (input_port_read(machine(), "DSWA") & 0xf0) >> 4;
345         return (ioport("DSWA")->read() & 0xf0) >> 4;
346346      case 0x02:
347         return  input_port_read(machine(), "DSWB") & 0x0f;
347         return  ioport("DSWB")->read() & 0x0f;
348348      case 0x03:
349         return (input_port_read(machine(), "DSWB") & 0xf0) >> 4;
349         return (ioport("DSWB")->read() & 0xf0) >> 4;
350350      default:
351351         logerror("taitox unknown dsw read offset: %04x\n", offset);
352352         return 0x00;
r15082r15083
358358   switch (offset)
359359   {
360360      case 0x00:
361         return input_port_read(machine(), "IN0");    /* Player 1 controls + START1 */
361         return ioport("IN0")->read();    /* Player 1 controls + START1 */
362362      case 0x01:
363         return input_port_read(machine(), "IN1");    /* Player 2 controls + START2 */
363         return ioport("IN1")->read();    /* Player 2 controls + START2 */
364364      case 0x02:
365         return input_port_read(machine(), "IN2");    /* COINn + SERVICE1 + TILT */
365         return ioport("IN2")->read();    /* COINn + SERVICE1 + TILT */
366366
367367      default:
368368         logerror("taitox unknown input read offset: %04x\n", offset);
src/mame/drivers/djboy.c
r15082r15083
347347
348348   switch ((m_beast_p0 >> 2) & 3)
349349   {
350      case 0: return input_port_read(machine(), "IN1");
351      case 1: return input_port_read(machine(), "IN2");
352      case 2: return input_port_read(machine(), "IN0");
350      case 0: return ioport("IN1")->read();
351      case 1: return ioport("IN2")->read();
352      case 2: return ioport("IN0")->read();
353353      default: return 0xff;
354354   }
355355}
r15082r15083
363363{
364364
365365   UINT8 dsw = 0;
366   UINT8 dsw1 = ~input_port_read(machine(), "DSW1");
367   UINT8 dsw2 = ~input_port_read(machine(), "DSW2");
366   UINT8 dsw1 = ~ioport("DSW1")->read();
367   UINT8 dsw2 = ~ioport("DSW2")->read();
368368
369369   switch ((m_beast_p0 >> 5) & 3)
370370   {
r15082r15083
522522static MACHINE_START( djboy )
523523{
524524   djboy_state *state = machine.driver_data<djboy_state>();
525   UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
526   UINT8 *CPU1 = machine.root_device().memregion("cpu1")->base();
525   UINT8 *MAIN = state->memregion("maincpu")->base();
526   UINT8 *CPU1 = state->memregion("cpu1")->base();
527527   UINT8 *CPU2 = state->memregion("cpu2")->base();
528528
529529   state->membank("bank1")->configure_entries(0, 4,  &MAIN[0x00000], 0x2000);
src/mame/drivers/sidearms.c
r15082r15083
6363
6464   res = 0;
6565   for (i = 0;i < 8;i++)
66      res |= ((input_port_read_safe(machine(), portnames[i], 0) >> offset) & 1) << i;
66      res |= ((ioport(portnames[i])->read_safe(0) >> offset) & 1) << i;
6767
6868   return res;
6969}
r15082r15083
260260
261261   PORT_START("DSW2")
262262   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
263   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )     /* not sure, but likely */
263   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")     /* not sure, but likely */
264264INPUT_PORTS_END
265265
266266static INPUT_PORTS_START( turtship )
r15082r15083
534534   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
535535   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
536536   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
537   PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_VBLANK )
537   PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_VBLANK("screen")
538538   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
539539   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
540540   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/tumblep.c
r15082r15083
8989   switch (offset << 1)
9090   {
9191      case 0:
92         return input_port_read(machine(), "PLAYERS");
92         return ioport("PLAYERS")->read();
9393      case 2:
94         return input_port_read(machine(), "DSW");
94         return ioport("DSW")->read();
9595      case 8:
96         return input_port_read(machine(), "SYSTEM");
96         return ioport("SYSTEM")->read();
9797      case 10: /* ? */
9898      case 12:
9999           return 0;
r15082r15083
164164   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
165165   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
166166   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
167   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
167   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
168168   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
169169   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
170170   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/dietgo.c
r15082r15083
5050   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
5151   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
5252   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
53   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
53   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
5454
5555   PORT_START("IN1")
5656   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
src/mame/drivers/kingobox.c
r15082r15083
301301   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
302302   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
303303   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Sound busy??? */
304   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_VBLANK )
304   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
305305   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
306306   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
307307
src/mame/drivers/esripsys.c
r15082r15083
276276         return m_cmos_ram[(m_cmos_ram_a10_3 << 3) | (m_cmos_ram_a2_0 & 3)];
277277      case 8:
278278      {
279         int keypad = input_port_read(machine(), "KEYPAD_B") | m_keypad_status;
279         int keypad = ioport("KEYPAD_B")->read() | m_keypad_status;
280280         m_keypad_status = 0;
281281         m_io_firq_status = 0;
282282         return keypad;
283283      }
284284      case 9:
285285      {
286         return input_port_read(machine(), "KEYPAD_A");
286         return ioport("KEYPAD_A")->read();
287287      }
288288      case 0xa:
289289      {
290         int coins =  m_coin_latch | (input_port_read(machine(), "COINS") & 0x30);
290         int coins =  m_coin_latch | (ioport("COINS")->read() & 0x30);
291291         m_coin_latch = 0;
292292         m_io_firq_status = 0;
293293         return coins;
294294      }
295295      case 0x10:
296         return input_port_read(machine(), "IO_1");
296         return ioport("IO_1")->read();
297297      case 0x11:
298         return input_port_read(machine(), "JOYSTICK_X");
298         return ioport("JOYSTICK_X")->read();
299299      case 0x12:
300         return input_port_read(machine(), "JOYSTICK_Y");
300         return ioport("JOYSTICK_Y")->read();
301301      case 0x16:
302302         return m_io_firq_status;
303303      case 0x18:
304         return input_port_read(machine(), "IO_2");
304         return ioport("IO_2")->read();
305305         /* Unused I/O */
306306      case 0x19:
307307      case 0x1a:
r15082r15083
417417   if (newval == 1)
418418   {
419419      m_io_firq_status |= 2;
420      m_coin_latch = input_port_read(machine(), "COINS") << 2;
420      m_coin_latch = ioport("COINS")->read() << 2;
421421      cputag_set_input_line(machine(), "game_cpu", M6809_FIRQ_LINE, HOLD_LINE);
422422   }
423423}
src/mame/drivers/ettrivia.c
r15082r15083
290290
291291static INTERRUPT_GEN( ettrivia_interrupt )
292292{
293   if( input_port_read(device->machine(), "COIN") & 0x01 )
293   if( device->machine().root_device().ioport("COIN")->read() & 0x01 )
294294      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
295295   else
296296      device_set_input_line(device, 0, HOLD_LINE);
src/mame/drivers/jalmah.c
r15082r15083
698698
699699
700700#define MCU_READ(tag, _bit_, _offset_, _retval_) \
701if((0xffff - input_port_read(machine, tag)) & _bit_) { jm_shared_ram[_offset_] = _retval_; }
701if((0xffff - machine.root_device().ioport(tag)->read()) & _bit_) { jm_shared_ram[_offset_] = _retval_; }
702702
703703/*Funky "DMA" / protection thing*/
704704/*---- -x-- "DMA" execute.*/
r15082r15083
749749
750750   if(state->m_test_mode)   //service_mode
751751   {
752      jm_shared_ram[0x000/2] = input_port_read(machine, "KEY0");
753      jm_shared_ram[0x002/2] = input_port_read(machine, "KEY1");
754      jm_shared_ram[0x004/2] = input_port_read(machine, "KEY2");
755      jm_shared_ram[0x006/2] = input_port_read(machine, "KEY3");
756      jm_shared_ram[0x008/2] = input_port_read(machine, "KEY4");
757      jm_shared_ram[0x00a/2] = input_port_read(machine, "KEY5");
752      jm_shared_ram[0x000/2] = machine.root_device().ioport("KEY0")->read();
753      jm_shared_ram[0x002/2] = machine.root_device().ioport("KEY1")->read();
754      jm_shared_ram[0x004/2] = machine.root_device().ioport("KEY2")->read();
755      jm_shared_ram[0x006/2] = machine.root_device().ioport("KEY3")->read();
756      jm_shared_ram[0x008/2] = machine.root_device().ioport("KEY4")->read();
757      jm_shared_ram[0x00a/2] = machine.root_device().ioport("KEY5")->read();
758758   }
759759   else
760760   {
r15082r15083
793793
794794   if(state->m_test_mode)   //service_mode
795795   {
796      jm_shared_ram[0x000/2] = input_port_read(machine, "KEY0");
797      jm_shared_ram[0x002/2] = input_port_read(machine, "KEY1");
798      jm_shared_ram[0x004/2] = input_port_read(machine, "KEY2");
799      jm_shared_ram[0x006/2] = input_port_read(machine, "KEY3");
800      jm_shared_ram[0x008/2] = input_port_read(machine, "KEY4");
801      jm_shared_ram[0x00a/2] = input_port_read(machine, "KEY5");
796      jm_shared_ram[0x000/2] = state->ioport("KEY0")->read();
797      jm_shared_ram[0x002/2] = state->ioport("KEY1")->read();
798      jm_shared_ram[0x004/2] = state->ioport("KEY2")->read();
799      jm_shared_ram[0x006/2] = state->ioport("KEY3")->read();
800      jm_shared_ram[0x008/2] = state->ioport("KEY4")->read();
801      jm_shared_ram[0x00a/2] = state->ioport("KEY5")->read();
802802   }
803803   else
804804   {
r15082r15083
838838
839839   if(state->m_test_mode)   //service_mode
840840   {
841      jm_shared_ram[0x300/2] = input_port_read(machine, "KEY0");
842      jm_shared_ram[0x302/2] = input_port_read(machine, "KEY1");
843      jm_shared_ram[0x304/2] = input_port_read(machine, "KEY2");
844      jm_shared_ram[0x306/2] = input_port_read(machine, "KEY3");
845      jm_shared_ram[0x308/2] = input_port_read(machine, "KEY4");
846      jm_shared_ram[0x30a/2] = input_port_read(machine, "KEY5");
841      jm_shared_ram[0x300/2] = state->ioport("KEY0")->read();
842      jm_shared_ram[0x302/2] = state->ioport("KEY1")->read();
843      jm_shared_ram[0x304/2] = state->ioport("KEY2")->read();
844      jm_shared_ram[0x306/2] = state->ioport("KEY3")->read();
845      jm_shared_ram[0x308/2] = state->ioport("KEY4")->read();
846      jm_shared_ram[0x30a/2] = state->ioport("KEY5")->read();
847847   }
848848   else
849849   {
r15082r15083
882882   UINT16 *jm_shared_ram = state->m_jm_shared_ram;
883883   if(state->m_test_mode)   //service_mode
884884   {
885      jm_shared_ram[0x200/2] = input_port_read(machine, "KEY0");
886      jm_shared_ram[0x202/2] = input_port_read(machine, "KEY1");
887      jm_shared_ram[0x204/2] = input_port_read(machine, "KEY2");
885      jm_shared_ram[0x200/2] = state->ioport("KEY0")->read();
886      jm_shared_ram[0x202/2] = state->ioport("KEY1")->read();
887      jm_shared_ram[0x204/2] = state->ioport("KEY2")->read();
888888   }
889889   else
890890   {
r15082r15083
13781378   {
13791379      case MJZOOMIN_MCU:
13801380      case DAIREIKA_MCU:
1381         state->m_test_mode = (~(input_port_read(machine, "SYSTEM")) & 0x0008) ? (1) : (0);
1381         state->m_test_mode = (~(state->ioport("SYSTEM")->read()) & 0x0008) ? (1) : (0);
13821382         break;
13831383      case URASHIMA_MCU:
1384         state->m_test_mode = ((~(input_port_read(machine, "SYSTEM")) & 0x0008) || (~(input_port_read(machine, "DSW")) & 0x8000)) ? (1) : (0);
1384         state->m_test_mode = ((~(state->ioport("SYSTEM")->read()) & 0x0008) || (~(state->ioport("DSW")->read()) & 0x8000)) ? (1) : (0);
13851385         break;
13861386      case KAKUMEI_MCU:
13871387      case KAKUMEI2_MCU:
13881388      case SUCHIPI_MCU:
1389         state->m_test_mode = (~(input_port_read(machine, "DSW")) & 0x0004) ? (1) : (0);
1389         state->m_test_mode = (~(state->ioport("DSW")->read()) & 0x0004) ? (1) : (0);
13901390         break;
13911391   }
13921392}
src/mame/drivers/f1gp.c
r15082r15083
241241
242242   PORT_START("DSW1")
243243   PORT_DIPUNUSED_DIPLOC( 0x0100, 0x0100, "SW1:1" )      /* Listed as "Unused" */
244   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) )      PORT_CONDITION("DSW1",0x8000,PORTCOND_EQUALS,0x8000) PORT_DIPLOCATION("SW1:2,3,4")
244   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) )      PORT_CONDITION("DSW1",0x8000,EQUALS,0x8000) PORT_DIPLOCATION("SW1:2,3,4")
245245   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
246246   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
247247   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
r15082r15083
250250   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
251251   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
252252   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
253   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) )      PORT_CONDITION("DSW1",0x8000,PORTCOND_EQUALS,0x8000) PORT_DIPLOCATION("SW1:5,6,7")
253   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) )      PORT_CONDITION("DSW1",0x8000,EQUALS,0x8000) PORT_DIPLOCATION("SW1:5,6,7")
254254   PORT_DIPSETTING(      0x5000, DEF_STR( 3C_1C ) )
255255   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
256256   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
r15082r15083
259259   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
260260   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_5C ) )
261261   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
262   PORT_DIPNAME( 0x7e00, 0x7e00, DEF_STR( Coinage ) )      PORT_CONDITION("DSW1",0x8000,PORTCOND_NOTEQUALS,0x8000) PORT_DIPLOCATION("SW1:2,3,4,5,6,7")
262   PORT_DIPNAME( 0x7e00, 0x7e00, DEF_STR( Coinage ) )      PORT_CONDITION("DSW1",0x8000,NOTEQUALS,0x8000) PORT_DIPLOCATION("SW1:2,3,4,5,6,7")
263263   PORT_DIPSETTING(      0x7e00, "2 to Start, 1 to Continue" )
264264   PORT_DIPNAME( 0x8000, 0x8000, "Continue Coin" )         PORT_DIPLOCATION("SW1:8")
265265   PORT_DIPSETTING(      0x8000, "Normal Coinage" )
r15082r15083
273273   PORT_DIPSETTING(      0x0004, DEF_STR( Single ) )
274274   PORT_DIPSETTING(      0x0000, "Multiple" )
275275   PORT_DIPNAME( 0x0008, 0x0008, "Multi Player Mode" )      PORT_DIPLOCATION("SW2:4")
276   PORT_DIPSETTING(      0x0008, "Single or Multi Player" )      PORT_CONDITION("DSW1",0x0004,PORTCOND_EQUALS,0x0000)
277   PORT_DIPSETTING(      0x0000, "Multi Player Game Only" )      PORT_CONDITION("DSW1",0x0004,PORTCOND_EQUALS,0x0000)
278   PORT_DIPSETTING(      0x0008, "Multi Player Off" )         PORT_CONDITION("DSW1",0x0004,PORTCOND_NOTEQUALS,0x0000)
279   PORT_DIPSETTING(      0x0000, "Multi Player Off" )         PORT_CONDITION("DSW1",0x0004,PORTCOND_NOTEQUALS,0x0000)
276   PORT_DIPSETTING(      0x0008, "Single or Multi Player" )      PORT_CONDITION("DSW1",0x0004,EQUALS,0x0000)
277   PORT_DIPSETTING(      0x0000, "Multi Player Game Only" )      PORT_CONDITION("DSW1",0x0004,EQUALS,0x0000)
278   PORT_DIPSETTING(      0x0008, "Multi Player Off" )         PORT_CONDITION("DSW1",0x0004,NOTEQUALS,0x0000)
279   PORT_DIPSETTING(      0x0000, "Multi Player Off" )         PORT_CONDITION("DSW1",0x0004,NOTEQUALS,0x0000)
280280   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" )      /* Listed as "Unused" */
281281   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" )      /* Listed as "Unused" */
282282   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" )      /* Listed as "Unused" */
src/mame/drivers/lvcards.c
r15082r15083
130130
131131READ8_MEMBER(lvcards_state::payout_r)
132132{
133   m_result = input_port_read(machine(), "IN2");
133   m_result = ioport("IN2")->read();
134134
135135   if (m_payout)
136136   {
src/mame/drivers/tx1.c
r15082r15083
381381
382382READ16_MEMBER(tx1_state::dipswitches_r)
383383{
384   return (input_port_read(machine(), "DSW") & 0xfffe) | m_ts;
384   return (ioport("DSW")->read() & 0xfffe) | m_ts;
385385}
386386
387387/*
r15082r15083
417417
418418WRITE8_MEMBER(tx1_state::tx1_ppi_latch_w)
419419{
420   m_ppi_latch_a = ((input_port_read(machine(), "AN_BRAKE") & 0xf) << 4) | (input_port_read(machine(), "AN_ACCELERATOR") & 0xf);
421   m_ppi_latch_b = input_port_read(machine(), "AN_STEERING");
420   m_ppi_latch_a = ((ioport("AN_BRAKE")->read() & 0xf) << 4) | (ioport("AN_ACCELERATOR")->read() & 0xf);
421   m_ppi_latch_b = ioport("AN_STEERING")->read();
422422}
423423
424424static READ8_DEVICE_HANDLER( tx1_ppi_porta_r )
r15082r15083
430430static READ8_DEVICE_HANDLER( tx1_ppi_portb_r )
431431{
432432   tx1_state *state = device->machine().driver_data<tx1_state>();
433   return input_port_read(device->machine(), "PPI_PORTD") | state->m_ppi_latch_b;
433   return state->ioport("PPI_PORTD")->read() | state->m_ppi_latch_b;
434434}
435435
436436
r15082r15083
446446READ8_MEMBER(tx1_state::bb_analog_r)
447447{
448448   if (offset == 0)
449      return bit_reverse8(((input_port_read(machine(), "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(machine(), "AN_STEERING"));
449      return bit_reverse8(((ioport("AN_ACCELERATOR")->read() & 0xf) << 4) | ioport("AN_STEERING")->read());
450450   else
451      return bit_reverse8((input_port_read(machine(), "AN_BRAKE") & 0xf) << 4);
451      return bit_reverse8((ioport("AN_BRAKE")->read() & 0xf) << 4);
452452}
453453
454454READ8_MEMBER(tx1_state::bbjr_analog_r)
455455{
456456   if (offset == 0)
457      return ((input_port_read(machine(), "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(machine(), "AN_STEERING");
457      return ((ioport("AN_ACCELERATOR")->read() & 0xf) << 4) | ioport("AN_STEERING")->read();
458458   else
459      return (input_port_read(machine(), "AN_BRAKE") & 0xf) << 4;
459      return (ioport("AN_BRAKE")->read() & 0xf) << 4;
460460}
461461
462462
src/mame/drivers/thayers.c
r15082r15083
300300
301301         sprintf(port, "R%d", m_keylatch);
302302
303         data = BIT(input_port_read(machine(), port), m_rx_bit - 5);
303         data = BIT(ioport(port)->read(), m_rx_bit - 5);
304304
305305         return data;
306306      }
r15082r15083
359359
360360READ8_MEMBER(thayers_state::dsw_b_r)
361361{
362   return (input_port_read(machine(), "COIN") & 0xf0) | (input_port_read(machine(), "DSWB") & 0x0f);
362   return (ioport("COIN")->read() & 0xf0) | (ioport("DSWB")->read() & 0x0f);
363363}
364364
365365READ8_MEMBER(thayers_state::laserdsc_data_r)
r15082r15083
764764   state->m_cart_present = 0;
765765   state->m_pr7820_enter = 0;
766766
767//  newtype = (input_port_read(machine, "DSWB") & 0x18) ? LASERDISC_TYPE_PIONEER_LDV1000 : LASERDISC_TYPE_PIONEER_PR7820;
767//  newtype = (state->ioport("DSWB")->read() & 0x18) ? LASERDISC_TYPE_PIONEER_LDV1000 : LASERDISC_TYPE_PIONEER_PR7820;
768768//  laserdisc_set_type(state->m_laserdisc, newtype);
769769}
770770
src/mame/drivers/merit.c
r15082r15083
220220   UINT16 x = 0;
221221   int rlen;
222222
223   gfx[0] = device->machine().root_device().memregion("gfx1")->base();
224   gfx[1] = device->machine().root_device().memregion("gfx2")->base();
223   gfx[0] = state->memregion("gfx1")->base();
224   gfx[1] = state->memregion("gfx2")->base();
225225   rlen = state->memregion("gfx2")->bytes();
226226
227227   //ma = ma ^ 0x7ff;
src/mame/drivers/pingpong.c
r15082r15083
598598   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5700, 0x57ff, "bank8");
599599
600600   // setup default banks
601   state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base() + 0x100*0 );
602   state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base() + 0x100*1 );
603   state->membank("bank3")->set_base(machine.root_device().memregion("user1")->base() + 0x100*2 );
604   state->membank("bank4")->set_base(machine.root_device().memregion("user1")->base() + 0x100*3 );
605   state->membank("bank5")->set_base(machine.root_device().memregion("user1")->base() + 0x100*4 );
606   state->membank("bank6")->set_base(machine.root_device().memregion("user1")->base() + 0x100*5 );
607   state->membank("bank7")->set_base(machine.root_device().memregion("user1")->base() + 0x100*6 );
601   state->membank("bank1")->set_base(state->memregion("user1")->base() + 0x100*0 );
602   state->membank("bank2")->set_base(state->memregion("user1")->base() + 0x100*1 );
603   state->membank("bank3")->set_base(state->memregion("user1")->base() + 0x100*2 );
604   state->membank("bank4")->set_base(state->memregion("user1")->base() + 0x100*3 );
605   state->membank("bank5")->set_base(state->memregion("user1")->base() + 0x100*4 );
606   state->membank("bank6")->set_base(state->memregion("user1")->base() + 0x100*5 );
607   state->membank("bank7")->set_base(state->memregion("user1")->base() + 0x100*6 );
608608   state->membank("bank8")->set_base(state->memregion("user1")->base() + 0x100*7 );
609609}
610610
src/mame/drivers/ssrj.c
r15082r15083
4545
4646READ8_MEMBER(ssrj_state::ssrj_wheel_r)
4747{
48   int port = input_port_read(machine(), "IN1") - 0x80;
48   int port = ioport("IN1")->read() - 0x80;
4949   int retval = port - m_oldport;
5050
5151   m_oldport = port;
src/mame/drivers/blstroid.c
r15082r15083
7474READ16_MEMBER(blstroid_state::inputs_r)
7575{
7676   static const char *const iptnames[] = { "IN0", "IN1" };
77   int temp = input_port_read(machine(), iptnames[offset & 1]);
77   int temp = ioport(iptnames[offset & 1])->read();
7878
7979   if (m_cpu_to_sound_ready) temp ^= 0x0040;
8080   if (atarigen_get_hblank(*machine().primary_screen)) temp ^= 0x0010;
r15082r15083
135135   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
136136   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
137137   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )
138   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_VBLANK )
138   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
139139   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
140140   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
141141   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
146146   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
147147   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
148148   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )
149   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_VBLANK )
149   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
150150   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
151151   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
152152   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/cchance.c
r15082r15083
6565READ8_MEMBER(cchance_state::input_1_r)
6666{
6767
68   return (m_hop_io) | (m_bell_io) | (input_port_read(machine(), "SP") & 0xff);
68   return (m_hop_io) | (m_bell_io) | (ioport("SP")->read() & 0xff);
6969}
7070
7171WRITE8_MEMBER(cchance_state::output_1_w)
src/mame/drivers/aztarac.c
r15082r15083
6363
6464READ16_MEMBER(aztarac_state::joystick_r)
6565{
66    return (((input_port_read(machine(), "STICKZ") - 0xf) << 8) |
67            ((input_port_read(machine(), "STICKY") - 0xf) & 0xff));
66    return (((ioport("STICKZ")->read() - 0xf) << 8) |
67            ((ioport("STICKY")->read() - 0xf) & 0xff));
6868}
6969
7070
src/mame/drivers/harddriv.c
r15082r15083
686686   PORT_START("IN0")      /* 600000 */
687687   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )   /* diagnostic switch */
688688   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL )   /* HBLANK */
689   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
689   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
690690   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 12-bit EOC */
691691   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 8-bit EOC */
692692   PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
r15082r15083
742742   PORT_START("IN0")      /* 600000 */
743743   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )   /* diagnostic switch */
744744   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL )   /* HBLANK */
745   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
745   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
746746   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 12-bit EOC */
747747   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 8-bit EOC */
748748   PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
r15082r15083
798798   PORT_START("IN0")      /* 60c000 */
799799   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )   /* diagnostic switch */
800800   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL )   /* HBLANK */
801   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
801   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
802802   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 12-bit EOC */
803803   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 8-bit EOC */
804804   PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
r15082r15083
860860   PORT_START("IN0")      /* 60c000 */
861861   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
862862   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL )   /* HBLANK */
863   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
863   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
864864   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 12-bit EOC */
865865   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 8-bit EOC */
866866   PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
r15082r15083
922922   PORT_START("IN0")      /* 60c000 */
923923   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
924924   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL )   /* HBLANK */
925   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
925   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
926926   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 12-bit EOC */
927927   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 8-bit EOC */
928928   PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
r15082r15083
985985   PORT_START("IN0")      /* 60c000 */
986986   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
987987   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL )   /* HBLANK */
988   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
988   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
989989   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 12-bit EOC */
990990   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 8-bit EOC */
991991   PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
r15082r15083
10481048   PORT_START("IN0")      /* 60c000 */
10491049   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
10501050   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL )   /* HBLANK */
1051   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
1051   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
10521052   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 12-bit EOC */
10531053   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* 8-bit EOC */
10541054   PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
src/mame/drivers/spoker.c
r15082r15083
201201   switch(m_igs_magic[0])
202202   {
203203      case 0x00:
204         if ( !(m_igs_magic[1] & 0x01) )   return input_port_read(machine(), "DSW1");
205         if ( !(m_igs_magic[1] & 0x02) )   return input_port_read(machine(), "DSW2");
206         if ( !(m_igs_magic[1] & 0x04) )   return input_port_read(machine(), "DSW3");
207         if ( !(m_igs_magic[1] & 0x08) )   return input_port_read(machine(), "DSW4");
208         if ( !(m_igs_magic[1] & 0x10) )   return input_port_read(machine(), "DSW5");
204         if ( !(m_igs_magic[1] & 0x01) )   return ioport("DSW1")->read();
205         if ( !(m_igs_magic[1] & 0x02) )   return ioport("DSW2")->read();
206         if ( !(m_igs_magic[1] & 0x04) )   return ioport("DSW3")->read();
207         if ( !(m_igs_magic[1] & 0x08) )   return ioport("DSW4")->read();
208         if ( !(m_igs_magic[1] & 0x10) )   return ioport("DSW5")->read();
209209         logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", cpu_get_pc(&space.device()), m_igs_magic[1]);
210210         break;
211211
src/mame/drivers/srmp2.c
r15082r15083
261261
262262      for (t = 0 ; t < 8 ; t ++)
263263      {
264         if (!(input_port_read(machine, keynames[j+p_side]) & ( 1 << t )))
264         if (!(machine.root_device().ioport(keynames[j+p_side])->read() & ( 1 << t )))
265265         {
266266            return (i + t) | (p_side ? 0x20 : 0x00);
267267         }
r15082r15083
313313      return iox_key_matrix_calc(machine(),(iox.mux == 2) ? 0 : 4);
314314   }
315315
316   return input_port_read(machine(),"SERVICE") & 0xff;
316   return ioport("SERVICE")->read() & 0xff;
317317}
318318
319319READ8_MEMBER(srmp2_state::iox_status_r)
src/mame/drivers/snk68.c
r15082r15083
6363
6464READ16_MEMBER(snk68_state::control_1_r)
6565{
66   return (input_port_read(machine(), "P1") + (input_port_read(machine(), "P2") << 8));
66   return (ioport("P1")->read() + (ioport("P2")->read() << 8));
6767}
6868
6969READ16_MEMBER(snk68_state::control_2_r)
7070{
71   return input_port_read(machine(), "SYSTEM");
71   return ioport("SYSTEM")->read();
7272}
7373
7474READ16_MEMBER(snk68_state::rotary_1_r)
7575{
76   return (( ~(1 << input_port_read(machine(), "ROT1")) )<<8)&0xff00;
76   return (( ~(1 << ioport("ROT1")->read()) )<<8)&0xff00;
7777}
7878
7979READ16_MEMBER(snk68_state::rotary_2_r)
8080{
81   return (( ~(1 << input_port_read(machine(), "ROT2")) )<<8)&0xff00;
81   return (( ~(1 << ioport("ROT2")->read()) )<<8)&0xff00;
8282}
8383
8484READ16_MEMBER(snk68_state::rotary_lsb_r)
8585{
86   return ((( ~(1 << input_port_read(machine(), "ROT2"))  ) <<4)&0xf000)
87       + ((( ~(1 << input_port_read(machine(), "ROT1"))  )    )&0x0f00);
86   return ((( ~(1 << ioport("ROT2")->read())  ) <<4)&0xf000)
87       + ((( ~(1 << ioport("ROT1")->read())  )    )&0x0f00);
8888}
8989
9090READ16_MEMBER(snk68_state::protcontrols_r)
9191{
9292   static const char *const portnames[] = { "P1", "P2", "SYSTEM" };
9393
94   return input_port_read(machine(), portnames[offset]) ^ m_invert_controls;
94   return ioport(portnames[offset])->read() ^ m_invert_controls;
9595}
9696
9797WRITE16_MEMBER(snk68_state::protection_w)
src/mame/drivers/aeroboto.c
r15082r15083
227227{
228228   aeroboto_state *state = machine.driver_data<aeroboto_state>();
229229
230   state->m_stars_rom = machine.root_device().memregion("gfx2")->base();
230   state->m_stars_rom = state->memregion("gfx2")->base();
231231   state->m_stars_length = state->memregion("gfx2")->bytes();
232232
233233   state->save_item(NAME(state->m_disable_irq));
src/mame/drivers/madalien.c
r15082r15083
143143   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet )) PORT_DIPLOCATION("SW:8")
144144   PORT_DIPSETTING(    0x00, DEF_STR( Upright ))
145145   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ))
146   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
146   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
147147
148148   PORT_START("PLAYER2")
149149   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
src/mame/drivers/konamigv.c
r15082r15083
503503
504504      for( axis = 0; axis < 2; axis++ )
505505      {
506         value = input_port_read(machine(), axisnames[axis]);
506         value = ioport(axisnames[axis])->read();
507507         diff = value - m_trackball_prev[ axis ];
508508         m_trackball_prev[ axis ] = value;
509509         m_trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 );
r15082r15083
595595
596596      for( axis = 0; axis < 4; axis++ )
597597      {
598         value = input_port_read(machine(), axisnames[axis]);
598         value = ioport(axisnames[axis])->read();
599599         diff = value - m_btc_trackball_prev[ axis ];
600600         m_btc_trackball_prev[ axis ] = value;
601601         m_btc_trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 );
src/mame/drivers/firetrap.c
r15082r15083
192192   /* the following only works in the bootleg version, which doesn't have an */
193193   /* 8751 - the real thing is much more complicated than that. */
194194   UINT8 coin = 0;
195   UINT8 port = input_port_read(machine(), "IN2") & 0x70;
195   UINT8 port = ioport("IN2")->read() & 0x70;
196196
197197   if (cpu_get_pc(&space.device()) == 0x1188)
198198      return ~m_coin_command_pending;
r15082r15083
454454   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
455455   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
456456   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
457   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
457   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
458458
459459   PORT_START("DSW0")   /* DSW0 */
460460   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:1,2,3")
r15082r15083
593593static MACHINE_START( firetrap )
594594{
595595   firetrap_state *state = machine.driver_data<firetrap_state>();
596   UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
596   UINT8 *MAIN = state->memregion("maincpu")->base();
597597   UINT8 *SOUND = state->memregion("audiocpu")->base();
598598
599599   state->m_maincpu = machine.device("maincpu");
src/mame/drivers/thedeep.c
r15082r15083
250250{
251251   UINT8 coin_mux;
252252
253   coin_mux = ((input_port_read(machine(),"COINS") & 0x0e) == 0x0e); // bit 0 is hard-wired to ALL three coin latches
253   coin_mux = ((ioport("COINS")->read() & 0x0e) == 0x0e); // bit 0 is hard-wired to ALL three coin latches
254254
255   return (input_port_read(machine(),"COINS") & 0xfe) | (coin_mux & 1);
255   return (ioport("COINS")->read() & 0xfe) | (coin_mux & 1);
256256}
257257
258258static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, thedeep_state )
r15082r15083
416416   {
417417      if (state->m_protection_command != 0x59)
418418      {
419         int coins = input_port_read(timer.machine(), "MCU");
419         int coins = timer.machine().root_device().ioport("MCU")->read();
420420         if      (coins & 1)   state->m_protection_data = 1;
421421         else if   (coins & 2)   state->m_protection_data = 2;
422422         else if   (coins & 4)   state->m_protection_data = 3;
src/mame/drivers/oneshot.c
r15082r15083
4141
4242READ16_MEMBER(oneshot_state::oneshot_in0_word_r)
4343{
44   int data = input_port_read(machine(), "DSW1");
44   int data = ioport("DSW1")->read();
4545
4646   switch (data & 0x0c)
4747   {
src/mame/drivers/stlforce.c
r15082r15083
137137   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
138138   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
139139   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
140   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
140   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
141141   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
142142   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* eeprom */
143143   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/zr107.c
r15082r15083
295295      case 2:   /* I/O port 2 */
296296      case 3:   /* System Port 0 */
297297      case 4:   /* System Port 1 */
298         r = input_port_read(machine(), portnames[offset]);
298         r = ioport(portnames[offset])->read();
299299         break;
300300
301301      case 5:   /* Parallel data port */
r15082r15083
331331                0x02 = EEPCLK
332332                0x01 = EEPDI
333333            */
334         input_port_write(machine(), "EEPROMOUT", data & 0x07, 0xff);
334         ioport("EEPROMOUT")->write(data & 0x07, 0xff);
335335         cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
336336         mame_printf_debug("System register 0 = %02X\n", data);
337337         break;
r15082r15083
352352         if (data & 0x40)   /* CG Board 0 IRQ Ack */
353353            cputag_set_input_line(machine(), "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
354354         set_cgboard_id((data >> 4) & 3);
355         input_port_write(machine(), "OUT4", data, 0xff);
355         ioport("OUT4")->write(data, 0xff);
356356         mame_printf_debug("System register 1 = %02X\n", data);
357357         break;
358358
r15082r15083
647647   switch (input)
648648   {
649649   case ADC083X_CH0:
650      return (double)(5 * input_port_read(device->machine(), "ANALOG1")) / 255.0;
650      return (double)(5 * device->machine().root_device().ioport("ANALOG1")->read()) / 255.0;
651651   case ADC083X_CH1:
652      return (double)(5 * input_port_read(device->machine(), "ANALOG2")) / 255.0;
652      return (double)(5 * device->machine().root_device().ioport("ANALOG2")->read()) / 255.0;
653653   case ADC083X_CH2:
654      return (double)(5 * input_port_read(device->machine(), "ANALOG3")) / 255.0;
654      return (double)(5 * device->machine().root_device().ioport("ANALOG3")->read()) / 255.0;
655655   case ADC083X_CH3:
656656      return 0;
657657   case ADC083X_COM:
r15082r15083
838838   state->m_led_reg0 = state->m_led_reg1 = 0x7f;
839839   state->m_ccu_vcth = state->m_ccu_vctl = 0;
840840
841   K001005_preprocess_texture_data(machine.root_device().memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 0);
841   K001005_preprocess_texture_data(state->memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 0);
842842}
843843
844844static DRIVER_INIT(zr107)
src/mame/drivers/ksys573.c
r15082r15083
597597READ32_MEMBER(ksys573_state::jamma_r)
598598{
599599   int security_cart_number = m_security_cart_number;
600   UINT32 data = input_port_read(machine(), "IN1");
600   UINT32 data = ioport("IN1")->read();
601601   data |= 0x000000c0;
602602
603603   ds2401_device *ds2401 = machine().device<ds2401_device>(security_cart_number ? "game_id" : "install_id");
r15082r15083
12331233      }
12341234   }
12351235
1236   input_port_write_safe( machine(), "OUT1", data, mem_mask );
1236   machine().root_device().ioport("OUT1")->write_safe( data, mem_mask );
12371237}
12381238
12391239READ32_MEMBER(ksys573_state::security_r)
r15082r15083
13661366static void update_mode( running_machine &machine )
13671367{
13681368   ksys573_state *state = machine.driver_data<ksys573_state>();
1369   int cart = input_port_read(machine, "CART");
1370   int cd = input_port_read( machine, "CD" );
1369   int cart = state->ioport("CART")->read();
1370   int cd = state->ioport( "CD" )->read();
13711371   SCSIInstance *new_cdrom;
13721372
13731373   if( state->machine().device<device_secure_serial_flash>("game_eeprom") )
r15082r15083
14891489   switch (offset)
14901490   {
14911491   case 0x26:
1492      upd4701_y_add(upd4701, 0, input_port_read_safe(machine(), "uPD4701_y", 0), 0xffff);
1493      upd4701_switches_set(upd4701, 0, input_port_read_safe(machine(), "uPD4701_switches", 0));
1492      upd4701_y_add(upd4701, 0, ioport("uPD4701_y")->read_safe(0), 0xffff);
1493      upd4701_switches_set(upd4701, 0, ioport("uPD4701_switches")->read_safe(0));
14941494
14951495      upd4701_cs_w(upd4701, 0, 0);
14961496      upd4701_xy_w(upd4701, 0, 1);
r15082r15083
17581758CUSTOM_INPUT_MEMBER(ksys573_state::gn845pwbb_read)
17591759{
17601760
1761   return input_port_read(machine(), "STAGE") & m_stage_mask;
1761   return ioport("STAGE")->read() & m_stage_mask;
17621762}
17631763
17641764static void gn845pwbb_output_callback( running_machine &machine, int offset, int data )
r15082r15083
27172717{
27182718   ksys573_state *state = device->machine().driver_data<ksys573_state>();
27192719   double *pad_position = state->m_pad_position;
2720   int pads = input_port_read(device->machine(), "PADS");
2720   int pads = state->ioport("PADS")->read();
27212721   for( int i = 0; i < 6; i++ )
27222722   {
27232723      if( ( pads & ( 1 << i ) ) != 0 )
r15082r15083
30043004   switch( offset )
30053005   {
30063006   case 0x20:
3007      data = input_port_read( machine(), "GUNX" ) | ds2401->read() << 7;
3007      data = ioport( "GUNX" )->read() | ds2401->read() << 7;
30083008      break;
30093009
30103010   case 0x22:
3011      data = input_port_read( machine(), "GUNY" ) | input_port_read( machine(), "SENSOR" );
3011      data = ioport( "SENSOR" )->read();
30123012      break;
30133013
30143014   case 0x34:
3015      data = input_port_read( machine(), "ENCODER" );
3015      data = ioport( "ENCODER" )->read();
30163016      popmessage( "encoder %04x", data );
30173017      break;
30183018   }
r15082r15083
30353035   switch (input)
30363036   {
30373037   case ADC083X_CH0:
3038      return (double)( 5 * input_port_read_safe( device->machine(), "analog0", 0 ) ) / 255.0;
3038      return (double)( 5 * device->machine().root_device().ioport( "analog0" )->read_safe( 0 ) ) / 255.0;
30393039   case ADC083X_CH1:
3040      return (double)( 5 * input_port_read_safe( device->machine(), "analog1", 0 ) ) / 255.0;
3040      return (double)( 5 * device->machine().root_device().ioport( "analog1" )->read_safe( 0 ) ) / 255.0;
30413041   case ADC083X_CH2:
3042      return (double)( 5 * input_port_read_safe( device->machine(), "analog2", 0 ) ) / 255.0;
3042      return (double)( 5 * device->machine().root_device().ioport( "analog2" )->read_safe( 0 ) ) / 255.0;
30433043   case ADC083X_CH3:
3044      return (double)( 5 * input_port_read_safe( device->machine(), "analog3", 0 ) ) / 255.0;
3044      return (double)( 5 * device->machine().root_device().ioport( "analog3" )->read_safe( 0 ) ) / 255.0;
30453045   case ADC083X_AGND:
30463046      return 0;
30473047   case ADC083X_VREF:
src/mame/drivers/sbrkout.c
r15082r15083
142142   /* on the VBLANK, read the pot and schedule an interrupt time for it */
143143   if (scanline == machine.primary_screen->visible_area().max_y + 1)
144144   {
145      UINT8 potvalue = input_port_read(machine, "PADDLE");
145      UINT8 potvalue = state->ioport("PADDLE")->read();
146146      state->m_pot_timer->adjust(machine.primary_screen->time_until_pos(56 + (potvalue / 2), (potvalue % 2) * 128));
147147   }
148148
r15082r15083
173173
174174   /* DIP switches are selected by ADR0+ADR1 if ADR3 == 0 */
175175   if ((offset & 0x0b) == 0x00)
176      result &= (input_port_read(machine(), "DIPS") << 6) | 0x3f;
176      result &= (ioport("DIPS")->read() << 6) | 0x3f;
177177   if ((offset & 0x0b) == 0x01)
178      result &= (input_port_read(machine(), "DIPS") << 4) | 0x3f;
178      result &= (ioport("DIPS")->read() << 4) | 0x3f;
179179   if ((offset & 0x0b) == 0x02)
180      result &= (input_port_read(machine(), "DIPS") << 0) | 0x3f;
180      result &= (ioport("DIPS")->read() << 0) | 0x3f;
181181   if ((offset & 0x0b) == 0x03)
182      result &= (input_port_read(machine(), "DIPS") << 2) | 0x3f;
182      result &= (ioport("DIPS")->read() << 2) | 0x3f;
183183
184184   /* other switches are selected by ADR0+ADR1+ADR2 if ADR4 == 0 */
185185   if ((offset & 0x17) == 0x00)
186      result &= (input_port_read(machine(), "SELECT") << 7) | 0x7f;
186      result &= (ioport("SELECT")->read() << 7) | 0x7f;
187187   if ((offset & 0x17) == 0x04)
188188      result &= ((m_pot_trigger[0] & ~m_pot_mask[0]) << 7) | 0x7f;
189189   if ((offset & 0x17) == 0x05)
190190      result &= ((m_pot_trigger[1] & ~m_pot_mask[1]) << 7) | 0x7f;
191191   if ((offset & 0x17) == 0x06)
192      result &= input_port_read(machine(), "SERVE");
192      result &= ioport("SERVE")->read();
193193   if ((offset & 0x17) == 0x07)
194      result &= (input_port_read(machine(), "SELECT") << 6) | 0x7f;
194      result &= (ioport("SELECT")->read() << 6) | 0x7f;
195195
196196   return result;
197197}
r15082r15083
398398   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
399399   PORT_DIPNAME( 0x70, 0x00, "Extended Play" )
400400   /* Progressive */
401   PORT_DIPSETTING(   0x10, "200" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
402   PORT_DIPSETTING(   0x20, "400" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
403   PORT_DIPSETTING(   0x30, "600" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
404   PORT_DIPSETTING(   0x40, "900" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
405   PORT_DIPSETTING(   0x50, "1200" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
406   PORT_DIPSETTING(   0x60, "1600" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
407   PORT_DIPSETTING(   0x70, "2000" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
401   PORT_DIPSETTING(   0x10, "200" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
402   PORT_DIPSETTING(   0x20, "400" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
403   PORT_DIPSETTING(   0x30, "600" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
404   PORT_DIPSETTING(   0x40, "900" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
405   PORT_DIPSETTING(   0x50, "1200" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
406   PORT_DIPSETTING(   0x60, "1600" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
407   PORT_DIPSETTING(   0x70, "2000" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
408408   /* Double */
409   PORT_DIPSETTING(   0x10, "200" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
410   PORT_DIPSETTING(   0x20, "400" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
411   PORT_DIPSETTING(   0x30, "600" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
412   PORT_DIPSETTING(   0x40, "800" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
413   PORT_DIPSETTING(   0x50, "1000" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
414   PORT_DIPSETTING(   0x60, "1200" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
415   PORT_DIPSETTING(   0x70, "1500" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
409   PORT_DIPSETTING(   0x10, "200" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
410   PORT_DIPSETTING(   0x20, "400" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
411   PORT_DIPSETTING(   0x30, "600" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
412   PORT_DIPSETTING(   0x40, "800" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
413   PORT_DIPSETTING(   0x50, "1000" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
414   PORT_DIPSETTING(   0x60, "1200" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
415   PORT_DIPSETTING(   0x70, "1500" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
416416   /* Cavity */
417   PORT_DIPSETTING(   0x10, "200" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
418   PORT_DIPSETTING(   0x20, "300" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
419   PORT_DIPSETTING(   0x30, "400" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
420   PORT_DIPSETTING(   0x40, "700" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
421   PORT_DIPSETTING(   0x50, "900" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
422   PORT_DIPSETTING(   0x60, "1100" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
423   PORT_DIPSETTING(   0x70, "1400" )   PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
417   PORT_DIPSETTING(   0x10, "200" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
418   PORT_DIPSETTING(   0x20, "300" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
419   PORT_DIPSETTING(   0x30, "400" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
420   PORT_DIPSETTING(   0x40, "700" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
421   PORT_DIPSETTING(   0x50, "900" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
422   PORT_DIPSETTING(   0x60, "1100" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
423   PORT_DIPSETTING(   0x70, "1400" )   PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
424424   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
425425   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) )
426426   PORT_DIPSETTING(   0x80, "3" )
src/mame/drivers/bladestl.c
r15082r15083
5959   static const char *const port[] = { "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P1_2" };
6060   int curr, delta;
6161
62   curr = input_port_read(machine(), port[offset]);
62   curr = ioport(port[offset])->read();
6363   delta = (curr - m_last_track[offset]) & 0xff;
6464   m_last_track[offset] = curr;
6565
src/mame/drivers/bwidow.c
r15082r15083
274274   int res2;
275275   int res3;
276276
277   res1 = input_port_read(machine(), "IN3");
278   res2 = input_port_read(machine(), "IN4");
279   res3 = input_port_read_safe(machine(), "DSW2", 0);
277   res1 = ioport("IN3")->read();
278   res2 = ioport("IN4")->read();
279   res3 = ioport("DSW2")->read_safe(0);
280280   res = 0x00;
281281
282282   switch (offset & 0x07)
src/mame/drivers/re900.c
r15082r15083
108108
109109static READ8_DEVICE_HANDLER (re_psg_portA_r)
110110{
111   if ((input_port_read(device->machine(), "IN0") & 0x01) == 0)
111   if ((device->machine().root_device().ioport("IN0")->read() & 0x01) == 0)
112112   {
113113      output_set_lamp_value(0,1);      // Operator Key ON
114114   }
r15082r15083
118118      output_set_lamp_value(0,0);      // Operator Key OFF
119119   }
120120
121   return input_port_read(device->machine(), "IN0");
121   return device->machine().root_device().ioport("IN0")->read();
122122}
123123
124124static READ8_DEVICE_HANDLER (re_psg_portB_r)
r15082r15083
130130
131131   output_set_lamp_value(state->m_player,1);
132132
133   if (input_port_read(device->machine(), "IN_S"))
133   if (state->ioport("IN_S")->read())
134134   {
135135      if (!state->m_stat_a)
136136      {
r15082r15083
161161   /* "INA": Unified port to share the player Keys among all players - Key In & Key Out have their own buttons on keyboard. */
162162   switch( state->m_mux_data )
163163   {
164      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 */
165      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 */
166      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 */
167      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 */
168      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 */
169      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 */
164      case 0x01: retval = (state->ioport("IN6")->read() | 0x80 ) - (( state->m_player == 6 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 6 */
165      case 0x02: retval = (state->ioport("IN5")->read() | 0x80 ) - (( state->m_player == 5 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 5 */
166      case 0x04: retval = (state->ioport("IN4")->read() | 0x80 ) - (( state->m_player == 4 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 4 */
167      case 0x08: retval = (state->ioport("IN3")->read() | 0x80 ) - (( state->m_player == 3 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 3 */
168      case 0x10: retval = (state->ioport("IN2")->read() | 0x80 ) - (( state->m_player == 2 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 2 */
169      case 0x20: retval = (state->ioport("IN1")->read() | 0x80 ) - (( state->m_player == 1 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 1 */
170170   }
171171
172172   return retval;
src/mame/drivers/mcr68.c
r15082r15083
6969
7070READ8_DEVICE_HANDLER( zwackery_port_2_r )
7171{
72   int result = input_port_read(device->machine(), "IN2");
73   int wheel = input_port_read(device->machine(), "IN5");
72   int result = device->machine().root_device().ioport("IN2")->read();
73   int wheel = device->machine().root_device().ioport("IN5")->read();
7474
7575   return result | ((wheel >> 2) & 0x3e);
7676}
r15082r15083
131131READ16_MEMBER(mcr68_state::spyhunt2_port_0_r)
132132{
133133   static const char *const portnames[] = { "AN1", "AN2", "AN3", "AN4" };
134   int result = input_port_read(machine(), "IN0");
134   int result = ioport("IN0")->read();
135135   int which = (m_control_word >> 3) & 3;
136   int analog = input_port_read(machine(), portnames[which]);
136   int analog = ioport(portnames[which])->read();
137137
138138   return result | ((m_sounds_good->read(space, 0) & 1) << 5) | (analog << 8);
139139}
r15082r15083
141141
142142READ16_MEMBER(mcr68_state::spyhunt2_port_1_r)
143143{
144   int result = input_port_read(machine(), "IN1");
144   int result = ioport("IN1")->read();
145145   return result | ((m_turbo_chip_squeak->read(space, 0) & 1) << 7);
146146}
147147
r15082r15083
194194
195195READ16_MEMBER(mcr68_state::archrivl_port_1_r)
196196{
197   return (translate49[input_port_read(machine(), "49WAYY2") >> 4] << 12) |
198         (translate49[input_port_read(machine(), "49WAYX2") >> 4] << 8) |
199         (translate49[input_port_read(machine(), "49WAYY1") >> 4] << 4) |
200         (translate49[input_port_read(machine(), "49WAYX1") >> 4] << 0);
197   return (translate49[ioport("49WAYY2")->read() >> 4] << 12) |
198         (translate49[ioport("49WAYX2")->read() >> 4] << 8) |
199         (translate49[ioport("49WAYY1")->read() >> 4] << 4) |
200         (translate49[ioport("49WAYX1")->read() >> 4] << 0);
201201}
202202
203203
r15082r15083
256256READ16_MEMBER(mcr68_state::pigskin_port_1_r)
257257{
258258   /* see archrivl_port_1_r for 49-way joystick description */
259   return input_port_read(machine(), "IN1") |
260         (translate49[input_port_read(machine(), "49WAYX1") >> 4] << 12) |
261         (translate49[input_port_read(machine(), "49WAYY1") >> 4] << 8);
259   return ioport("IN1")->read() |
260         (translate49[ioport("49WAYX1")->read() >> 4] << 12) |
261         (translate49[ioport("49WAYY1")->read() >> 4] << 8);
262262}
263263
264264
265265READ16_MEMBER(mcr68_state::pigskin_port_2_r)
266266{
267267   /* see archrivl_port_1_r for 49-way joystick description */
268   return input_port_read(machine(), "DSW") |
269         (translate49[input_port_read(machine(), "49WAYX2") >> 4] << 12) |
270         (translate49[input_port_read(machine(), "49WAYY2") >> 4] << 8);
268   return ioport("DSW")->read() |
269         (translate49[ioport("49WAYX2")->read() >> 4] << 12) |
270         (translate49[ioport("49WAYY2")->read() >> 4] << 8);
271271}
272272
273273
r15082r15083
280280
281281READ16_MEMBER(mcr68_state::trisport_port_1_r)
282282{
283   int xaxis = (INT8)input_port_read(machine(), "AN1");
284   int yaxis = (INT8)input_port_read(machine(), "AN2");
285   int result = input_port_read(machine(), "IN1");
283   int xaxis = (INT8)ioport("AN1")->read();
284   int yaxis = (INT8)ioport("AN2")->read();
285   int result = ioport("IN1")->read();
286286
287287   result |= (xaxis & 0x3c) << 6;
288288   result |= (yaxis & 0x3c) << 10;
src/mame/drivers/overdriv.c
r15082r15083
7070      /* bit 0 is data */
7171      /* bit 1 is clock (active high) */
7272      /* bit 2 is cs (active low) */
73      input_port_write(machine(), "EEPROMOUT", data, 0xff);
73      ioport("EEPROMOUT")->write(data, 0xff);
7474   }
7575}
7676
src/mame/drivers/jackpool.c
r15082r15083
9797{
9898   switch(offset*2)
9999   {
100      case 0x00: return input_port_read(machine(),"COIN1");
101      case 0x04: return input_port_read(machine(),"UNK1");
102      case 0x06: return input_port_read(machine(),"UNK2");
103      case 0x08: return input_port_read(machine(),"SERVICE1");
104      case 0x0a: return input_port_read(machine(),"SERVICE2");//probably not a button, remote?
105      case 0x0c: return input_port_read(machine(),"PAYOUT");
106      case 0x0e: return input_port_read(machine(),"START2");
107      case 0x10: return input_port_read(machine(),"HOLD3");
108      case 0x12: return input_port_read(machine(),"HOLD4");
109      case 0x14: return input_port_read(machine(),"HOLD2");
110      case 0x16: return input_port_read(machine(),"HOLD1");
111      case 0x18: return input_port_read(machine(),"HOLD5");
112      case 0x1a: return input_port_read(machine(),"START1");
113      case 0x1c: return input_port_read(machine(),"BET");
100      case 0x00: return ioport("COIN1")->read();
101      case 0x04: return ioport("UNK1")->read();
102      case 0x06: return ioport("UNK2")->read();
103      case 0x08: return ioport("SERVICE1")->read();
104      case 0x0a: return ioport("SERVICE2")->read();//probably not a button, remote?
105      case 0x0c: return ioport("PAYOUT")->read();
106      case 0x0e: return ioport("START2")->read();
107      case 0x10: return ioport("HOLD3")->read();
108      case 0x12: return ioport("HOLD4")->read();
109      case 0x14: return ioport("HOLD2")->read();
110      case 0x16: return ioport("HOLD1")->read();
111      case 0x18: return ioport("HOLD5")->read();
112      case 0x1a: return ioport("START1")->read();
113      case 0x1c: return ioport("BET")->read();
114114      case 0x1e: return 0xff; //ticket motor
115115      case 0x20: return 0xff; //hopper motor
116116       case 0x2c: return machine().device<eeprom_device>("eeprom")->read_bit();
src/mame/drivers/spcforce.c
r15082r15083
152152   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
153153   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
154154   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
155   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
155   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
156156   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
157157INPUT_PORTS_END
158158
r15082r15083
194194
195195   PORT_START("P2")
196196   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
197   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
197   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
198198INPUT_PORTS_END
199199
200200
src/mame/drivers/gsword.c
r15082r15083
153153static int gsword_coins_in(void)
154154{
155155   /* emulate 8741 coin slot */
156   if (input_port_read(machine, "IN4") & 0xc0)
156   if (machine.root_device().ioport("IN4")->read() & 0xc0)
157157   {
158158      logerror("Coin In\n");
159159      return 0x80;
r15082r15083
191191   switch (offset)
192192   {
193193   case 0x01: /* start button , coins */
194      return input_port_read(space->machine(), "IN0");
194      return space->machine().root_device().ioport("IN0")->read();
195195   case 0x02: /* Player 1 Controller */
196      return input_port_read(space->machine(), "IN1");
196      return space->machine().root_device().ioport("IN1")->read();
197197   case 0x04: /* Player 2 Controller */
198      return input_port_read(space->machine(), "IN3");
198      return space->machine().root_device().ioport("IN3")->read();
199199//  default:
200200//      logerror("8741-2 unknown read %d PC=%04x\n",offset,cpu_get_pc(&space->device()));
201201   }
r15082r15083
208208   switch (offset)
209209   {
210210   case 0x01: /* start button  */
211      return input_port_read(space->machine(), "IN2");
211      return space->machine().root_device().ioport("IN2")->read();
212212   case 0x02: /* Player 1 Controller? */
213      return input_port_read(space->machine(), "IN1");
213      return space->machine().root_device().ioport("IN1")->read();
214214   case 0x04: /* Player 2 Controller? */
215      return input_port_read(space->machine(), "IN3");
215      return space->machine().root_device().ioport("IN3")->read();
216216   }
217217   /* unknown */
218218//  logerror("8741-3 unknown read %d PC=%04x\n",offset,cpu_get_pc(&space->device()));
src/mame/drivers/nmg5.c
r15082r15083
418418   PORT_DIPSETTING(      0x0080, DEF_STR( Hard ) )
419419   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
420420   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Coin_B ) )       PORT_DIPLOCATION("SW2:8,7")
421   PORT_DIPSETTING(      0x0200, DEF_STR( 2C_1C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
422   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_1C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
423   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
424   PORT_DIPSETTING(      0x0100, DEF_STR( 1C_2C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
425   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_1C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
426   PORT_DIPSETTING(      0x0100, DEF_STR( 1C_3C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
427   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_4C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
428   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
421   PORT_DIPSETTING(      0x0200, DEF_STR( 2C_1C ) )        PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
422   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_1C ) )        PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
423   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )        PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
424   PORT_DIPSETTING(      0x0100, DEF_STR( 1C_2C ) )        PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
425   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_1C ) )        PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
426   PORT_DIPSETTING(      0x0100, DEF_STR( 1C_3C ) )        PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
427   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_4C ) )        PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
428   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )        PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
429429   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Coin_A ) )       PORT_DIPLOCATION("SW2:6,5")
430   PORT_DIPSETTING(      0x0800, DEF_STR( 2C_1C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
431   PORT_DIPSETTING(      0x0c00, DEF_STR( 1C_1C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
432   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
433   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_2C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
434   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
435   PORT_DIPSETTING(      0x0800, DEF_STR( 3C_1C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
436   PORT_DIPSETTING(      0x0400, DEF_STR( 2C_1C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
437   PORT_DIPSETTING(      0x0c00, DEF_STR( 1C_1C ) )        PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
430   PORT_DIPSETTING(      0x0800, DEF_STR( 2C_1C ) )        PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
431   PORT_DIPSETTING(      0x0c00, DEF_STR( 1C_1C ) )        PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
432   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )        PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
433   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_2C ) )        PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
434   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )        PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
435   PORT_DIPSETTING(      0x0800, DEF_STR( 3C_1C ) )        PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
436   PORT_DIPSETTING(      0x0400, DEF_STR( 2C_1C ) )        PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
437   PORT_DIPSETTING(      0x0c00, DEF_STR( 1C_1C ) )        PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
438438   PORT_DIPUNUSED_DIPLOC( 0x1000, IP_ACTIVE_LOW, "SW2:4" )                               // See notes
439439   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Demo_Sounds ) )  PORT_DIPLOCATION("SW2:3")
440440   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
src/mame/drivers/nbmj8900.c
r15082r15083
3232#include "includes/nbmj8900.h"
3333
3434
35#define SIGNED_DAC   0      // 0:unsigned DAC, 1:signed DAC
36#if SIGNED_DAC
37#define DAC_WRITE   dac_signed_w
38#else
39#define DAC_WRITE   dac_w
40#endif
41
42
43
44
4535static DRIVER_INIT( ohpaipee )
4636{
4737#if 0
r15082r15083
7161#endif
7262
7363   nb1413m3_type = NB1413M3_OHPAIPEE;
74
75//  init_nb1413m3(machine);
7664}
7765
7866static DRIVER_INIT( togenkyo )
r15082r15083
10391#endif
10492
10593   nb1413m3_type = NB1413M3_TOGENKYO;
106
107//S init_nb1413m3(machine);
10894}
10995
11096
r15082r15083
139125   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
140126   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
141127   AM_RANGE(0xc0, 0xc0) AM_READ_LEGACY(nb1413m3_inputport3_r)
142   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", DAC_WRITE)
128   AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
143129   AM_RANGE(0xe0, 0xe0) AM_WRITE(nbmj8900_vramsel_w)
144130   AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r)
145131   AM_RANGE(0xf1, 0xf1) AM_READWRITE_LEGACY(nb1413m3_dipsw2_r, nb1413m3_outcoin_w)
r15082r15083
341327   MCFG_SPEAKER_STANDARD_MONO("mono")
342328
343329   MCFG_SOUND_ADD("ymsnd", YM3812, 2500000)
344   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
330   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
345331
346332   MCFG_SOUND_ADD("dac", DAC, 0)
347   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
333   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.85)
348334MACHINE_CONFIG_END
349335
350
351336static MACHINE_CONFIG_DERIVED( togenkyo, ohpaipee )
352337
353338   /* basic machine hardware */
r15082r15083
356341MACHINE_CONFIG_END
357342
358343
359
360344ROM_START( ohpaipee )
361345   ROM_REGION( 0x10000, "maincpu", 0 ) /* program */
362346   ROM_LOAD( "02.3h",  0x00000, 0x10000, CRC(2b6c9afc) SHA1(591a7016ebd99d4a2bfdef5e99da3a1ac9d30d75) )
src/mame/drivers/xmen.c
r15082r15083
5454      /* bit 3 is clock (active high) */
5555      /* bit 4 is cs (active low) */
5656      /* bit 5 is enabled in IRQ3, disabled in IRQ5 (sprite DMA start?) */
57      input_port_write(machine(), "EEPROMOUT", data, 0xff);
57      ioport("EEPROMOUT")->write(data, 0xff);
5858   }
5959   if (ACCESSING_BITS_8_15)
6060   {
src/mame/drivers/atarifb.c
r15082r15083
240240   PORT_BIT ( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
241241   PORT_BIT ( 0x10, IP_ACTIVE_LOW,  IPT_BUTTON1 )
242242   PORT_BIT ( 0x20, IP_ACTIVE_LOW,  IPT_TILT )
243   PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
243   PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
244244   PORT_BIT ( 0x80, IP_ACTIVE_LOW,  IPT_COIN1 )
245245
246246   PORT_START("IN1")
r15082r15083
310310   PORT_BIT ( 0x04, IP_ACTIVE_LOW,  IPT_COIN3 )
311311   PORT_BIT ( 0x38, IP_ACTIVE_LOW, IPT_UNKNOWN )
312312   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
313   PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
313   PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
314314INPUT_PORTS_END
315315
316316
r15082r15083
387387   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused on schematics */
388388   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_TILT )
389389   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
390   PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
390   PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
391391
392392   PORT_START("DSW1")
393393   PORT_DIPNAME( 0x07, 0x00, "Time per coin" )      PORT_DIPLOCATION("SW1:1,2,3")
src/mame/drivers/wink.c
r15082r15083
9595
9696READ8_MEMBER(wink_state::analog_port_r)
9797{
98   return input_port_read(machine(), /* player_mux ? "DIAL2" : */ "DIAL1");
98   return ioport(/* player_mux ? "DIAL2" : */ "DIAL1")->read();
9999}
100100
101101READ8_MEMBER(wink_state::player_inputs_r)
102102{
103   return input_port_read(machine(), /* player_mux ? "INPUTS2" : */ "INPUTS1");
103   return ioport(/* player_mux ? "INPUTS2" : */ "INPUTS1")->read();
104104}
105105
106106WRITE8_MEMBER(wink_state::sound_irq_w)
src/mame/drivers/lethal.c
r15082r15083
174174static const char *const gunnames[] = { "LIGHT0_X", "LIGHT0_Y", "LIGHT1_X", "LIGHT1_Y" };
175175
176176/* a = 1, 2 = player # */
177#define GUNX( a ) (( ( input_port_read(machine(), gunnames[2 * (a - 1)]) * 287 ) / 0xff ) + 16)
178#define GUNY( a ) (( ( input_port_read(machine(), gunnames[2 * (a - 1) + 1]) * 223 ) / 0xff ) + 10)
177#define GUNX( a ) (( ( ioport(gunnames[2 * (a - 1)])->read() * 287 ) / 0xff ) + 16)
178#define GUNY( a ) (( ( ioport(gunnames[2 * (a - 1) + 1])->read() * 223 ) / 0xff ) + 10)
179179
180180static const eeprom_interface eeprom_intf =
181181{
r15082r15083
200200
201201   m_cur_control2 = data;
202202
203   input_port_write(machine(), "EEPROMOUT", m_cur_control2, 0xff);
203   ioport("EEPROMOUT")->write(m_cur_control2, 0xff);
204204}
205205
206206static INTERRUPT_GEN(lethalen_interrupt)
src/mame/drivers/exprraid.c
r15082r15083
238238
239239READ8_MEMBER(exprraid_state::vblank_r)
240240{
241   return input_port_read(machine(), "IN0");
241   return ioport("IN0")->read();
242242}
243243
244244static ADDRESS_MAP_START( master_map, AS_PROGRAM, 8, exprraid_state )
r15082r15083
288288
289289static INPUT_PORTS_START( exprraid )
290290   PORT_START("IN0")   /* 0x3800 */
291   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_VBLANK )
291   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
292292
293293   PORT_START("DSW0")   /* 0x1800 */
294294   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )           PORT_DIPLOCATION("SW1:1,2")
295   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
296   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
297   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
298   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
299   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
300   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
301   PORT_DIPSETTING(    0x01, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
302   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
295   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
296   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
297   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
298   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
299   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
300   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
301   PORT_DIPSETTING(    0x01, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
302   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
303303   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )           PORT_DIPLOCATION("SW1:3,4")
304   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
305   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
306   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
307   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
308   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
309   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
310   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
311   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
304   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
305   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
306   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
307   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
308   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
309   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
310   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
311   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
312312   PORT_DIPNAME( 0x10, 0x10, "Coin Mode" )                 PORT_DIPLOCATION("SW1:5")     /* see notes */
313313   PORT_DIPSETTING(    0x10, "Mode 1" )
314314   PORT_DIPSETTING(    0x00, "Mode 2" )
r15082r15083
451451{
452452   exprraid_state *state = device->machine().driver_data<exprraid_state>();
453453
454   if ((~input_port_read(device->machine(), "IN2")) & 0xc0)
454   if ((~state->ioport("IN2")->read()) & 0xc0)
455455   {
456456      if (state->m_coin == 0)
457457      {
src/mame/drivers/2mindril.c
r15082r15083
7373
7474   switch(offset)
7575   {
76      case 0x0/2: return input_port_read(machine(), "DSW");
76      case 0x0/2: return ioport("DSW")->read();
7777      case 0x2/2:
7878      {
79         int arm_pwr = input_port_read(machine(), "IN0");//throw
79         int arm_pwr = ioport("IN0")->read();//throw
8080         //popmessage("PC=%08x %02x",cpu_get_pc(&space.device()),arm_pwr);
8181
8282         if(arm_pwr > 0xe0) return ~0x1800;
r15082r15083
8686         else return ~0x0000;
8787      }
8888      case 0x4/2: return (m_defender_sensor) | (m_shutter_sensor);
89      case 0xe/2: return input_port_read(machine(), "IN2");//coins
89      case 0xe/2: return ioport("IN2")->read();//coins
9090//      default:  printf("PC=%08x [%04x] -> %04x R\n", cpu_get_pc(&space.device()), offset * 2, m_iodata[offset]);
9191   }
9292
src/mame/drivers/naughtyb.c
r15082r15083
112112
113113READ8_MEMBER(naughtyb_state::in0_port_r)
114114{
115   int in0 = input_port_read(machine(), "IN0");
115   int in0 = ioport("IN0")->read();
116116
117117   if ( m_cocktail )
118118   {
119119      // cabinet == cocktail -AND- handling player 2
120120
121121      in0 = ( in0 & 0x03 ) |            // start buttons
122           ( input_port_read(machine(), "IN0_COCKTAIL") & 0xFC );   // cocktail inputs
122           ( ioport("IN0_COCKTAIL")->read() & 0xFC );   // cocktail inputs
123123   }
124124
125125   return in0;
r15082r15083
129129{
130130   // vblank replaces the cabinet dip
131131
132   return ( ( input_port_read(machine(), "DSW0") & 0x7F ) |      // dsw0
133          ( input_port_read(machine(), "FAKE") & 0x80 ) );      // vblank
132   return ( ( ioport("DSW0")->read() & 0x7F ) |      // dsw0
133          ( ioport("FAKE")->read() & 0x80 ) );      // vblank
134134}
135135
136136/* Pop Flamer
r15082r15083
331331   PORT_START( "FAKE" )
332332   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, naughtyb_state,coin_inserted, 0)
333333   // when reading DSW0, bit 7 doesn't read cabinet, but vblank
334   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
334   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
335335INPUT_PORTS_END
336336
337337static INPUT_PORTS_START( trvmstr )
r15082r15083
379379   PORT_START( "FAKE" )
380380   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, naughtyb_state,coin_inserted, 0)
381381   // when reading DSW0, bit 7 doesn't read cabinet, but vblank
382   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
382   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
383383INPUT_PORTS_END
384384
385385
src/mame/drivers/corona.c
r15082r15083
515515{
516516   switch( m_input_selector )
517517   {
518      case 0x01: return input_port_read(machine(), "IN0-1");
519      case 0x02: return input_port_read(machine(), "IN0-2");
520      case 0x04: return input_port_read(machine(), "IN0-3");
521      case 0x08: return input_port_read(machine(), "IN0-4");
522      case 0x10: return input_port_read(machine(), "IN0-5");
523      case 0x20: return input_port_read(machine(), "IN0-6");
518      case 0x01: return ioport("IN0-1")->read();
519      case 0x02: return ioport("IN0-2")->read();
520      case 0x04: return ioport("IN0-3")->read();
521      case 0x08: return ioport("IN0-4")->read();
522      case 0x10: return ioport("IN0-5")->read();
523      case 0x20: return ioport("IN0-6")->read();
524524   }
525525
526526   return 0xff;
src/mame/drivers/taitogn.c
r15082r15083
754754   {
755755      if( state->m_b_lastclock )
756756      {
757         int bit = ( ( input_port_read(machine, "DSW") >> state->m_n_dip_bit ) & 1 );
757         int bit = ( ( state->ioport("DSW")->read() >> state->m_n_dip_bit ) & 1 );
758758         psx_sio_input( machine, 0, PSX_SIO_IN_DATA, bit * PSX_SIO_IN_DATA );
759759         state->m_n_dip_bit++;
760760         state->m_n_dip_bit &= 7;
r15082r15083
866866
867867   switch(m_mux_data)
868868   {
869      case 0x04: return input_port_read(machine(), "KEY0");
870      case 0x08: return input_port_read(machine(), "KEY1");
871      case 0x40: return input_port_read(machine(), "KEY2");
872      case 0x80: return input_port_read(machine(), "KEY3");
869      case 0x04: return ioport("KEY0")->read();
870      case 0x08: return ioport("KEY1")->read();
871      case 0x40: return ioport("KEY2")->read();
872      case 0x80: return ioport("KEY3")->read();
873873   }
874874
875875   /* mux disabled */
876   return input_port_read(machine(), "P4");
876   return ioport("P4")->read();
877877}
878878
879879// Init and reset
src/mame/drivers/gunbustr.c
r15082r15083
174174
175175READ32_MEMBER(gunbustr_state::gunbustr_gun_r)
176176{
177   return ( input_port_read(machine(), "LIGHT0_X") << 24) | (input_port_read(machine(), "LIGHT0_Y") << 16) |
178       ( input_port_read(machine(), "LIGHT1_X") << 8)  |  input_port_read(machine(), "LIGHT1_Y");
177   return ( ioport("LIGHT0_X")->read() << 24) | (ioport("LIGHT0_Y")->read() << 16) |
178         ( ioport("LIGHT1_X")->read() << 8)  |  ioport("LIGHT1_Y")->read();
179179}
180180
181181WRITE32_MEMBER(gunbustr_state::gunbustr_gun_w)
src/mame/drivers/taito_z.c
r15082r15083
10461046            x0000000    (unused)                  */
10471047
10481048         COMBINE_DATA(&m_eep_latch);
1049         input_port_write(machine(), "EEPROMOUT", data, 0xff);
1049         ioport("EEPROMOUT")->write(data, 0xff);
10501050         break;
10511051
10521052      default:
r15082r15083
10651065
10661066   UINT8 port = tc0220ioc_port_r(m_tc0220ioc, 0);   /* read port number */
10671067   int steer = 0;
1068   int fake = input_port_read(machine(), "FAKE");
1068   int fake = ioport("FAKE")->read();
10691069
10701070   if (!(fake & 0x10))   /* Analogue steer (the real control method) */
10711071   {
10721072      /* center around zero and reduce span to 0xc0 */
1073      steer = ((input_port_read(machine(), "STEER") - 0x80) * 0xc0) / 0x100;
1073      steer = ((ioport("STEER")->read() - 0x80) * 0xc0) / 0x100;
10741074
10751075   }
10761076   else   /* Digital steer */
r15082r15083
11051105
11061106   UINT8 port = tc0220ioc_port_r(m_tc0220ioc, 0);   /* read port number */
11071107   int steer = 0;
1108   int fake = input_port_read(machine(), "FAKE");
1108   int fake = ioport("FAKE")->read();
11091109
11101110   if (!(fake & 0x10))   /* Analogue steer (the real control method) */
11111111   {
11121112      /* center around zero */
1113      steer = input_port_read(machine(), "STEER") - 0x80;
1113      steer = ioport("STEER")->read() - 0x80;
11141114   }
11151115   else   /* Digital steer */
11161116   {
r15082r15083
11271127   switch (port)
11281128   {
11291129      case 0x08:
1130         return input_port_read(machine(), "UNK1");
1130         return ioport("UNK1")->read();
11311131
11321132      case 0x09:
1133         return input_port_read(machine(), "UNK2");
1133         return ioport("UNK2")->read();
11341134
11351135      case 0x0a:
1136         return input_port_read(machine(), "UNK3");
1136         return ioport("UNK3")->read();
11371137
11381138      case 0x0b:
1139         return input_port_read(machine(), "UNK4");
1139         return ioport("UNK4")->read();
11401140
11411141      case 0x0c:
11421142         return steer & 0xff;
r15082r15083
11551155   switch (offset)
11561156   {
11571157      case 0x00:
1158         return input_port_read(machine(), "STICKX");
1158         return ioport("STICKX")->read();
11591159
11601160      case 0x01:
1161         return input_port_read(machine(), "X_ADJUST");
1161         return ioport("X_ADJUST")->read();
11621162
11631163      case 0x02:
1164         return input_port_read(machine(), "STICKY");
1164         return ioport("STICKY")->read();
11651165
11661166      case 0x03:
1167         return input_port_read(machine(), "Y_ADJUST");
1167         return ioport("Y_ADJUST")->read();
11681168   }
11691169
11701170   logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n", cpu_get_pc(&space.device()), offset);
r15082r15083
11781178   switch (offset)
11791179   {
11801180      case 0x00:
1181         return input_port_read(machine(), "STICKX");
1181         return ioport("STICKX")->read();
11821182
11831183      case 0x01:
1184         return input_port_read(machine(), "STICKY");
1184         return ioport("STICKY")->read();
11851185
11861186      case 0x02:
1187         return input_port_read(machine(), "X_ADJUST");
1187         return ioport("X_ADJUST")->read();
11881188
11891189      case 0x03:
1190         return input_port_read(machine(), "Y_ADJUST");
1190         return ioport("Y_ADJUST")->read();
11911191   }
11921192
11931193   logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n", cpu_get_pc(&space.device()), offset);
r15082r15083
12101210READ16_MEMBER(taitoz_state::sci_steer_input_r)
12111211{
12121212   int steer = 0;
1213   int fake = input_port_read(machine(), "FAKE");
1213   int fake = ioport("FAKE")->read();
12141214
12151215   if (!(fake & 0x10))   /* Analogue steer (the real control method) */
12161216   {
12171217      /* center around zero and reduce span to 0xc0 */
1218      steer = ((input_port_read(machine(), "STEER") - 0x80) * 0xc0) / 0x100;
1218      steer = ((ioport("STEER")->read() - 0x80) * 0xc0) / 0x100;
12191219   }
12201220   else   /* Digital steer */
12211221   {
r15082r15083
12621262   switch (offset)
12631263   {
12641264      case 0x00:
1265         return input_port_read(machine(), "STICKX1");
1265         return ioport("STICKX1")->read();
12661266
12671267      case 0x01:
1268         return input_port_read(machine(), "STICKY1");
1268         return ioport("STICKY1")->read();
12691269
12701270      case 0x02:
1271         return input_port_read(machine(), "STICKX2");
1271         return ioport("STICKX2")->read();
12721272
12731273      case 0x03:
1274         return input_port_read(machine(), "STICKY2");
1274         return ioport("STICKY2")->read();
12751275   }
12761276
12771277   return 0x00;
r15082r15083
13001300READ16_MEMBER(taitoz_state::dblaxle_steer_input_r)
13011301{
13021302   int steer = 0;
1303   int fake = input_port_read(machine(), "FAKE");
1303   int fake = ioport("FAKE")->read();
13041304
13051305   if (!(fake & 0x10))   /* Analogue steer (the real control method) */
13061306   {
13071307      /* center around zero and reduce span to 0x80 */
1308      steer = ((input_port_read(machine(), "STEER") - 0x80) * 0x80) / 0x100;
1308      steer = ((ioport("STEER")->read() - 0x80) * 0x80) / 0x100;
13091309   }
13101310   else   /* Digital steer */
13111311   {
src/mame/drivers/msisaac.c
r15082r15083
116116         //6-down
117117         //7-leftdwn
118118
119         UINT8 val= (input_port_read(machine(), "IN1") >> 2) & 0x0f;
119         UINT8 val= (ioport("IN1")->read() >> 2) & 0x0f;
120120         /* bit0 = left
121121               bit1 = right
122122               bit2 = down
src/mame/drivers/playch10.c
r15082r15083
426426    PORT_START("SW1")
427427    PORT_DIPNAME( 0x3f, 0x09, "Prime Time Bonus" )
428428    // STANDARD TIME (no bonus)
429    PORT_DIPSETTING(    0x00, "0%" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
429    PORT_DIPSETTING(    0x00, "0%" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
430430    // PRIME TIME (bonus) for 2 COINS
431    PORT_DIPSETTING(    0x07, "8%" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
432    PORT_DIPSETTING(    0x08, "17%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
433    PORT_DIPSETTING(    0x09, "25%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
434    PORT_DIPSETTING(    0x10, "33%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
435    PORT_DIPSETTING(    0x11, "42%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
436    PORT_DIPSETTING(    0x12, "50%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
437    PORT_DIPSETTING(    0x13, "58%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
438    PORT_DIPSETTING(    0x14, "67%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
439    PORT_DIPSETTING(    0x15, "75%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
440    PORT_DIPSETTING(    0x16, "83%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
441    PORT_DIPSETTING(    0x17, "92%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
442    PORT_DIPSETTING(    0x18, "100%" )  PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
431    PORT_DIPSETTING(    0x07, "8%" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
432    PORT_DIPSETTING(    0x08, "17%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
433    PORT_DIPSETTING(    0x09, "25%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
434    PORT_DIPSETTING(    0x10, "33%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
435    PORT_DIPSETTING(    0x11, "42%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
436    PORT_DIPSETTING(    0x12, "50%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
437    PORT_DIPSETTING(    0x13, "58%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
438    PORT_DIPSETTING(    0x14, "67%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
439    PORT_DIPSETTING(    0x15, "75%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
440    PORT_DIPSETTING(    0x16, "83%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
441    PORT_DIPSETTING(    0x17, "92%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
442    PORT_DIPSETTING(    0x18, "100%" )  PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
443443    // PRIME TIME (bonus) for 4 COINS
444    PORT_DIPSETTING(    0x04, "8%" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
445    PORT_DIPSETTING(    0x05, "17%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
446    PORT_DIPSETTING(    0x06, "25%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
447    PORT_DIPSETTING(    0x07, "33%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
448    PORT_DIPSETTING(    0x08, "42%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
449    PORT_DIPSETTING(    0x09, "50%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
450    PORT_DIPSETTING(    0x10, "58%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
451    PORT_DIPSETTING(    0x11, "67%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
452    PORT_DIPSETTING(    0x12, "75%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
453    PORT_DIPSETTING(    0x13, "83%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
454    PORT_DIPSETTING(    0x14, "92%" )   PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
455    PORT_DIPSETTING(    0x15, "100%" )  PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
444    PORT_DIPSETTING(    0x04, "8%" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
445    PORT_DIPSETTING(    0x05, "17%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
446    PORT_DIPSETTING(    0x06, "25%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
447    PORT_DIPSETTING(    0x07, "33%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
448    PORT_DIPSETTING(    0x08, "42%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
449    PORT_DIPSETTING(    0x09, "50%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
450    PORT_DIPSETTING(    0x10, "58%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
451    PORT_DIPSETTING(    0x11, "67%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
452    PORT_DIPSETTING(    0x12, "75%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
453    PORT_DIPSETTING(    0x13, "83%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
454    PORT_DIPSETTING(    0x14, "92%" )   PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
455    PORT_DIPSETTING(    0x15, "100%" )  PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
456456
457457    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
458458    PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
r15082r15083
462462    PORT_START("SW2")
463463    PORT_DIPNAME( 0x3f, 0x28, "Play Time/Coin" )
464464    // STANDARD TIME (no bonus)
465    PORT_DIPSETTING(    0x3f, DEF_STR( Free_Play ) )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
466    PORT_DIPSETTING(    0x23, "2:00 (120)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
467    PORT_DIPSETTING(    0x21, "2:10 (130)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
468    PORT_DIPSETTING(    0x1f, "2:20 (140)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
469    PORT_DIPSETTING(    0x1d, "2:30 (150)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
470    PORT_DIPSETTING(    0x1b, "2:40 (160)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
471    PORT_DIPSETTING(    0x19, "2:50 (170)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
472    PORT_DIPSETTING(    0x17, "3:00 (180)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
473    PORT_DIPSETTING(    0x15, "3:10 (190)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
474    PORT_DIPSETTING(    0x13, "3:20 (200)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
475    PORT_DIPSETTING(    0x11, "3:30 (210)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
476    PORT_DIPSETTING(    0x0f, "3:40 (220)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
477    PORT_DIPSETTING(    0x0d, "3:50 (230)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
478    PORT_DIPSETTING(    0x0b, "4:00 (240)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
479    PORT_DIPSETTING(    0x09, "4:10 (250)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
480    PORT_DIPSETTING(    0x07, "4:20 (260)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
481    PORT_DIPSETTING(    0x05, "4:30 (270)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
482    PORT_DIPSETTING(    0x03, "4:40 (280)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
483    PORT_DIPSETTING(    0x01, "4:50 (290)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
465    PORT_DIPSETTING(    0x3f, DEF_STR( Free_Play ) )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
466    PORT_DIPSETTING(    0x23, "2:00 (120)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
467    PORT_DIPSETTING(    0x21, "2:10 (130)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
468    PORT_DIPSETTING(    0x1f, "2:20 (140)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
469    PORT_DIPSETTING(    0x1d, "2:30 (150)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
470    PORT_DIPSETTING(    0x1b, "2:40 (160)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
471    PORT_DIPSETTING(    0x19, "2:50 (170)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
472    PORT_DIPSETTING(    0x17, "3:00 (180)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
473    PORT_DIPSETTING(    0x15, "3:10 (190)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
474    PORT_DIPSETTING(    0x13, "3:20 (200)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
475    PORT_DIPSETTING(    0x11, "3:30 (210)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
476    PORT_DIPSETTING(    0x0f, "3:40 (220)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
477    PORT_DIPSETTING(    0x0d, "3:50 (230)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
478    PORT_DIPSETTING(    0x0b, "4:00 (240)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
479    PORT_DIPSETTING(    0x09, "4:10 (250)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
480    PORT_DIPSETTING(    0x07, "4:20 (260)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
481    PORT_DIPSETTING(    0x05, "4:30 (270)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
482    PORT_DIPSETTING(    0x03, "4:40 (280)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
483    PORT_DIPSETTING(    0x01, "4:50 (290)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
484484    // PRIME TIME (bonus) for 2 COINS
485    PORT_DIPSETTING(    0x1c, "2:00 (120)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
486    PORT_DIPSETTING(    0x1e, "2:10 (130)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
487    PORT_DIPSETTING(    0x20, "2:20 (140)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
488    PORT_DIPSETTING(    0x22, "2:30 (150)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
489    PORT_DIPSETTING(    0x24, "2:40 (160)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
490    PORT_DIPSETTING(    0x26, "2:50 (170)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
491    PORT_DIPSETTING(    0x28, "3:00 (180)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
492    PORT_DIPSETTING(    0x2a, "3:10 (190)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
493    PORT_DIPSETTING(    0x2c, "3:20 (200)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
494    PORT_DIPSETTING(    0x2e, "3:30 (210)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
495    PORT_DIPSETTING(    0x30, "3:40 (220)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
496    PORT_DIPSETTING(    0x32, "3:50 (230)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
497    PORT_DIPSETTING(    0x34, "4:00 (240)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
485    PORT_DIPSETTING(    0x1c, "2:00 (120)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
486    PORT_DIPSETTING(    0x1e, "2:10 (130)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
487    PORT_DIPSETTING(    0x20, "2:20 (140)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
488    PORT_DIPSETTING(    0x22, "2:30 (150)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
489    PORT_DIPSETTING(    0x24, "2:40 (160)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
490    PORT_DIPSETTING(    0x26, "2:50 (170)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
491    PORT_DIPSETTING(    0x28, "3:00 (180)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
492    PORT_DIPSETTING(    0x2a, "3:10 (190)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
493    PORT_DIPSETTING(    0x2c, "3:20 (200)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
494    PORT_DIPSETTING(    0x2e, "3:30 (210)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
495    PORT_DIPSETTING(    0x30, "3:40 (220)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
496    PORT_DIPSETTING(    0x32, "3:50 (230)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
497    PORT_DIPSETTING(    0x34, "4:00 (240)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
498498    // PRIME TIME (bonus) for 4 COINS
499    PORT_DIPSETTING(    0x1c, "2:00 (120)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
500    PORT_DIPSETTING(    0x1e, "2:10 (130)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
501    PORT_DIPSETTING(    0x20, "2:20 (140)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
502    PORT_DIPSETTING(    0x22, "2:30 (150)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
503    PORT_DIPSETTING(    0x24, "2:40 (160)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
504    PORT_DIPSETTING(    0x26, "2:50 (170)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
505    PORT_DIPSETTING(    0x28, "3:00 (180)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
506    PORT_DIPSETTING(    0x2a, "3:10 (190)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
507    PORT_DIPSETTING(    0x2c, "3:20 (200)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
508    PORT_DIPSETTING(    0x2e, "3:30 (210)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
509    PORT_DIPSETTING(    0x30, "3:40 (220)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
510    PORT_DIPSETTING(    0x32, "3:50 (230)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
511    PORT_DIPSETTING(    0x34, "4:00 (240)" )    PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
499    PORT_DIPSETTING(    0x1c, "2:00 (120)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
500    PORT_DIPSETTING(    0x1e, "2:10 (130)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
501    PORT_DIPSETTING(    0x20, "2:20 (140)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
502    PORT_DIPSETTING(    0x22, "2:30 (150)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
503    PORT_DIPSETTING(    0x24, "2:40 (160)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
504    PORT_DIPSETTING(    0x26, "2:50 (170)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
505    PORT_DIPSETTING(    0x28, "3:00 (180)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
506    PORT_DIPSETTING(    0x2a, "3:10 (190)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
507    PORT_DIPSETTING(    0x2c, "3:20 (200)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
508    PORT_DIPSETTING(    0x2e, "3:30 (210)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
509    PORT_DIPSETTING(    0x30, "3:40 (220)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
510    PORT_DIPSETTING(    0x32, "3:50 (230)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
511    PORT_DIPSETTING(    0x34, "4:00 (240)" )    PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
512512
513513    PORT_DIPNAME( 0xc0, 0x80, "Bonus" )
514514    PORT_DIPSETTING(    0xc0, "Standard Time" )
src/mame/drivers/mappy.c
r15082r15083
10501050   PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )
10511051   PORT_DIPSETTING(    0x03, DEF_STR( 1C_7C ) )
10521052   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:4,5,6")
1053   PORT_DIPSETTING(    0x08, "30k Only" )         PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
1054   PORT_DIPSETTING(    0x30, "30k & 80k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
1055   PORT_DIPSETTING(    0x20, "30k, 80k & Every 80k" )   PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
1056   PORT_DIPSETTING(    0x38, "30k & 100k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
1057   PORT_DIPSETTING(    0x18, "30k, 100k & Every 100k" )   PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
1058   PORT_DIPSETTING(    0x28, "30k & 120k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
1059   PORT_DIPSETTING(    0x10, "30k, 120k & Every 120k" )   PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
1053   PORT_DIPSETTING(    0x08, "30k Only" )         PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
1054   PORT_DIPSETTING(    0x30, "30k & 80k Only" )      PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
1055   PORT_DIPSETTING(    0x20, "30k, 80k & Every 80k" )   PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
1056   PORT_DIPSETTING(    0x38, "30k & 100k Only" )      PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
1057   PORT_DIPSETTING(    0x18, "30k, 100k & Every 100k" )   PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
1058   PORT_DIPSETTING(    0x28, "30k & 120k Only" )      PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
1059   PORT_DIPSETTING(    0x10, "30k, 120k & Every 120k" )   PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
10601060   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1061   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 */
1062   PORT_DIPSETTING(    0x38, "30k & 100k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
1063   PORT_DIPSETTING(    0x20, "30k, 100k & Every 100k" )   PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
1064   PORT_DIPSETTING(    0x30, "30k & 120k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
1065   PORT_DIPSETTING(    0x08, "40k Only" )         PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
1066   PORT_DIPSETTING(    0x28, "40k & 120k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
1067   PORT_DIPSETTING(    0x18, "40k, 120k & Every 120k" )   PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
1061   PORT_DIPSETTING(    0x10, "30k Only" )         PORT_CONDITION("DSW2",0xc0,EQUALS,0x00) /* Manual shows 100k only, Test Mode shows 30k which is what we use */
1062   PORT_DIPSETTING(    0x38, "30k & 100k Only" )      PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
1063   PORT_DIPSETTING(    0x20, "30k, 100k & Every 100k" )   PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
1064   PORT_DIPSETTING(    0x30, "30k & 120k Only" )      PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
1065   PORT_DIPSETTING(    0x08, "40k Only" )         PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
1066   PORT_DIPSETTING(    0x28, "40k & 120k Only" )      PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
1067   PORT_DIPSETTING(    0x18, "40k, 120k & Every 120k" )   PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
10681068   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW2:7,8")
10691069   PORT_DIPSETTING(    0x80, "1" )
10701070   PORT_DIPSETTING(    0x40, "2" )
r15082r15083
10891089   PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )
10901090   PORT_DIPSETTING(    0x03, DEF_STR( 1C_7C ) )
10911091   PORT_DIPNAME( 0x38, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:4,5,6")
1092   PORT_DIPSETTING(    0x20, "20k & 70k Only" )      PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
1093   PORT_DIPSETTING(    0x30, "20k, 70k & Every 70k" )   PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
1094   PORT_DIPSETTING(    0x00, "30k Only" )         PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
1095   PORT_DIPSETTING(    0x18, "30k & 70k Only" )      PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
1096   PORT_DIPSETTING(    0x10, "30k & 80k Only" )      PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
1097   PORT_DIPSETTING(    0x28, "30k, 100k & Every 80k" )   PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
1098   PORT_DIPSETTING(    0x08, "30k & 100k Only" )      PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
1099   PORT_DIPSETTING(    0x08, "30k Only" )         PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
1100   PORT_DIPSETTING(    0x00, "40k Only" )         PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
1101   PORT_DIPSETTING(    0x20, "30k & 80k Only" )      PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
1102   PORT_DIPSETTING(    0x30, "30k, 80k & Every 80k" )   PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
1103   PORT_DIPSETTING(    0x18, "30k & 100k Only" )      PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
1104   PORT_DIPSETTING(    0x10, "40k & 120k Only" )      PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
1105   PORT_DIPSETTING(    0x28, "40k, 100k & Every 100k" )   PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
1092   PORT_DIPSETTING(    0x20, "20k & 70k Only" )      PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
1093   PORT_DIPSETTING(    0x30, "20k, 70k & Every 70k" )   PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
1094   PORT_DIPSETTING(    0x00, "30k Only" )         PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
1095   PORT_DIPSETTING(    0x18, "30k & 70k Only" )      PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
1096   PORT_DIPSETTING(    0x10, "30k & 80k Only" )      PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
1097   PORT_DIPSETTING(    0x28, "30k, 100k & Every 80k" )   PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
1098   PORT_DIPSETTING(    0x08, "30k & 100k Only" )      PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
1099   PORT_DIPSETTING(    0x08, "30k Only" )         PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
1100   PORT_DIPSETTING(    0x00, "40k Only" )         PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
1101   PORT_DIPSETTING(    0x20, "30k & 80k Only" )      PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
1102   PORT_DIPSETTING(    0x30, "30k, 80k & Every 80k" )   PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
1103   PORT_DIPSETTING(    0x18, "30k & 100k Only" )      PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
1104   PORT_DIPSETTING(    0x10, "40k & 120k Only" )      PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
1105   PORT_DIPSETTING(    0x28, "40k, 100k & Every 100k" )   PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
11061106   PORT_DIPSETTING(    0x38, DEF_STR( None ) )
11071107   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:7,8")
11081108   PORT_DIPSETTING(    0xc0, "1" )
r15082r15083
12281228   PORT_DIPSETTING(    0x01, "4" )
12291229   PORT_DIPSETTING(    0x00, "5" )
12301230   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:3,4,5")
1231   PORT_DIPSETTING(    0x08, "20k & 80k Only" )      PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
1232   PORT_DIPSETTING(    0x10, "20k, 80k & Every 80k" )   PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
1233   PORT_DIPSETTING(    0x04, "30k Only" )         PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
1234   PORT_DIPSETTING(    0x18, "30k & 60k Only" )      PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
1235   PORT_DIPSETTING(    0x1c, "30k & 100k Only" )      PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
1236//  PORT_DIPSETTING(    0x14, "30k 100k" )  // repeated         PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
1237   PORT_DIPSETTING(    0x0c, "30k, 120k & Every 120k" )   PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
1238   PORT_DIPSETTING(    0x0c, "20k & 80k Only" )      PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
1239   PORT_DIPSETTING(    0x08, "30k" )         PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
1240   PORT_DIPSETTING(    0x10, "30k, 100k & Every 100k" )   PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
1241   PORT_DIPSETTING(    0x1c, "30k & 100k Only" )      PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
1242//  PORT_DIPSETTING(    0x14, "30k 100k" )  // repeated     PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
1243   PORT_DIPSETTING(    0x18, "40k & 80k Only" )      PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
1244   PORT_DIPSETTING(    0x04, "100k Only" )         PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
1231   PORT_DIPSETTING(    0x08, "20k & 80k Only" )      PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
1232   PORT_DIPSETTING(    0x10, "20k, 80k & Every 80k" )   PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
1233   PORT_DIPSETTING(    0x04, "30k Only" )         PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
1234   PORT_DIPSETTING(    0x18, "30k & 60k Only" )      PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
1235   PORT_DIPSETTING(    0x1c, "30k & 100k Only" )      PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
1236//  PORT_DIPSETTING(    0x14, "30k 100k" )  // repeated         PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
1237   PORT_DIPSETTING(    0x0c, "30k, 120k & Every 120k" )   PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
1238   PORT_DIPSETTING(    0x0c, "20k & 80k Only" )      PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
1239   PORT_DIPSETTING(    0x08, "30k" )         PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
1240   PORT_DIPSETTING(    0x10, "30k, 100k & Every 100k" )   PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
1241   PORT_DIPSETTING(    0x1c, "30k & 100k Only" )      PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
1242//  PORT_DIPSETTING(    0x14, "30k 100k" )  // repeated     PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
1243   PORT_DIPSETTING(    0x18, "40k & 80k Only" )      PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
1244   PORT_DIPSETTING(    0x04, "100k Only" )         PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
12451245   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
12461246   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW2:6,7,8")
12471247   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
r15082r15083
13081308   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
13091309   PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )
13101310   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) )      PORT_DIPLOCATION("SW2:4,5,6")
1311   PORT_DIPSETTING(    0x18, "20k Only" )         PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
1312   PORT_DIPSETTING(    0x30, "20k & 60k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
1313   PORT_DIPSETTING(    0x38, "20k & 70k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
1314   PORT_DIPSETTING(    0x10, "20k, 70k & Every 70k" )   PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
1315   PORT_DIPSETTING(    0x28, "20k & 80k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
1316   PORT_DIPSETTING(    0x08, "20k, 80k & Every 80k" )   PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
1317   PORT_DIPSETTING(    0x20, "30k & 100k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
1318   PORT_DIPSETTING(    0x20, "30k Only" )         PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
1319   PORT_DIPSETTING(    0x38, "30k & 80k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
1320   PORT_DIPSETTING(    0x30, "30k & 100k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
1321   PORT_DIPSETTING(    0x10, "30k, 100k & Every 100k" )   PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
1322   PORT_DIPSETTING(    0x28, "30k & 120k Only" )      PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
1323   PORT_DIPSETTING(    0x18, "40k Only" )         PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
1324   PORT_DIPSETTING(    0x08, "40k, 120k & Every 120k" )   PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
1311   PORT_DIPSETTING(    0x18, "20k Only" )         PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
1312   PORT_DIPSETTING(    0x30, "20k & 60k Only" )      PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
1313   PORT_DIPSETTING(    0x38, "20k & 70k Only" )      PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
1314   PORT_DIPSETTING(    0x10, "20k, 70k & Every 70k" )   PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
1315   PORT_DIPSETTING(    0x28, "20k & 80k Only" )      PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
1316   PORT_DIPSETTING(    0x08, "20k, 80k & Every 80k" )   PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
1317   PORT_DIPSETTING(    0x20, "30k & 100k Only" )      PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
1318   PORT_DIPSETTING(    0x20, "30k Only" )         PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
1319   PORT_DIPSETTING(    0x38, "30k & 80k Only" )      PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
1320   PORT_DIPSETTING(    0x30, "30k & 100k Only" )      PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
1321   PORT_DIPSETTING(    0x10, "30k, 100k & Every 100k" )   PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
1322   PORT_DIPSETTING(    0x28, "30k & 120k Only" )      PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
1323   PORT_DIPSETTING(    0x18, "40k Only" )         PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
1324   PORT_DIPSETTING(    0x08, "40k, 120k & Every 120k" )   PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
13251325   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
13261326   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )         PORT_DIPLOCATION("SW2:7,8")
13271327   PORT_DIPSETTING(    0x40, "1" )
r15082r15083
15601560
15611561***************************************************************************/
15621562
1563static READ8_DEVICE_HANDLER( dipA_l )   { return input_port_read(device->machine(), "DSW1"); }      // dips A
1564static READ8_DEVICE_HANDLER( dipA_h )   { return input_port_read(device->machine(), "DSW1") >> 4; }   // dips A
1563static READ8_DEVICE_HANDLER( dipA_l )   { return device->machine().root_device().ioport("DSW1")->read(); }      // dips A
1564static READ8_DEVICE_HANDLER( dipA_h )   { return device->machine().root_device().ioport("DSW1")->read() >> 4; }   // dips A
15651565
15661566static READ8_DEVICE_HANDLER( dipB_mux )   // dips B
15671567{
15681568   mappy_state *state = device->machine().driver_data<mappy_state>();
15691569
1570   return input_port_read(device->machine(), "DSW2") >> (4 * state->m_mux);
1570   return state->ioport("DSW2")->read() >> (4 * state->m_mux);
15711571}
15721572
15731573static READ8_DEVICE_HANDLER( dipB_muxi )   // dips B
r15082r15083
15751575   mappy_state *state = device->machine().driver_data<mappy_state>();
15761576
15771577   // bits are interleaved in Phozon
1578   return BITSWAP8(input_port_read(device->machine(), "DSW2"),6,4,2,0,7,5,3,1) >> (4 * state->m_mux);
1578   return BITSWAP8(state->ioport("DSW2")->read(),6,4,2,0,7,5,3,1) >> (4 * state->m_mux);
15791579}
15801580
15811581static WRITE8_DEVICE_HANDLER( out_mux )
src/mame/drivers/safarir.c
r15082r15083
388388   PORT_DIPSETTING(    0x20, "5000" )
389389   PORT_DIPSETTING(    0x40, "7000" )
390390   PORT_DIPSETTING(    0x60, "9000" )
391   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
391   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
392392INPUT_PORTS_END
393393
394394
src/mame/drivers/pzletime.c
r15082r15083
235235   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
236236   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
237237   PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )
238   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_VBLANK )
238   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
239239   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
240240   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
241241   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* eeprom */
src/mame/drivers/pntnpuzl.c
r15082r15083
170170   pntnpuzl_state *state = device->machine().driver_data<pntnpuzl_state>();
171171   /* bit 11 is EEPROM data */
172172   eeprom_device *eeprom = downcast<eeprom_device *>(device);
173   return (state->m_eeprom & 0xf4ff) | (eeprom->read_bit()<<11) | (input_port_read(device->machine(), "IN1") & 0x0300);
173   return (state->m_eeprom & 0xf4ff) | (eeprom->read_bit()<<11) | (state->ioport("IN1")->read() & 0x0300);
174174}
175175
176176static WRITE16_DEVICE_HANDLER( pntnpuzl_eeprom_w )
r15082r15083
241241
242242   if (m_serial_out == 0x11)
243243   {
244      if (input_port_read(machine(), "IN0") & 0x10)
244      if (ioport("IN0")->read() & 0x10)
245245      {
246246         m_touchscr[0] = 0x1b;
247         m_touchscr[2] = BITSWAP8(input_port_read(machine(), "TOUCHX"),0,1,2,3,4,5,6,7);
248         m_touchscr[4] = BITSWAP8(input_port_read(machine(), "TOUCHY"),0,1,2,3,4,5,6,7);
247         m_touchscr[2] = BITSWAP8(ioport("TOUCHX")->read(),0,1,2,3,4,5,6,7);
248         m_touchscr[4] = BITSWAP8(ioport("TOUCHY")->read(),0,1,2,3,4,5,6,7);
249249      }
250250      else
251251         m_touchscr[0] = 0;
r15082r15083
325325
326326static INPUT_PORTS_START( pntnpuzl )
327327   PORT_START("IN0")   /* fake inputs */
328   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
328   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
329329   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, pntnpuzl_state,coin_inserted, 1) PORT_IMPULSE(1)
330330   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_HIGH )PORT_CHANGED_MEMBER(DEVICE_SELF, pntnpuzl_state,coin_inserted, 2) PORT_IMPULSE(1)
331331   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, pntnpuzl_state,coin_inserted, 4) PORT_IMPULSE(1)
src/mame/drivers/uapce.c
r15082r15083
173173{
174174   UINT8 dsw_val;
175175
176   dsw_val = input_port_read(machine(),  "DSW" );
176   dsw_val = ioport("DSW" )->read();
177177
178178   if ( BIT( offset, 7 ) == 0 )
179179   {
r15082r15083
216216   uapce_state *state = machine.driver_data<uapce_state>();
217217   if ( state->m_jamma_if_control_latch & 0x10 )
218218   {
219      return input_port_read(machine,  "JOY" );
219      return state->ioport("JOY" )->read();
220220   }
221221   else
222222   {
223      return input_port_read(machine,  "JOY" ) | 0x08;
223      return machine.root_device().ioport("JOY" )->read() | 0x08;
224224   }
225225}
226226
src/mame/drivers/funkball.c
r15082r15083
555555   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7",
556556                                            "IN8", "IN9", "INA", "INB", "INC", "IND", "INE", "INF",};
557557
558   return input_port_read(machine(), portnames[offset]);
558   return ioport(portnames[offset])->read();
559559}
560560
561561static ADDRESS_MAP_START(funkball_map, AS_PROGRAM, 32, funkball_state)
r15082r15083
11181118static MACHINE_RESET( funkball )
11191119{
11201120   funkball_state *state = machine.driver_data<funkball_state>();
1121   state->membank("bios_ext1")->set_base(machine.root_device().memregion("bios")->base() + 0x00000);
1122   state->membank("bios_ext2")->set_base(machine.root_device().memregion("bios")->base() + 0x04000);
1123   state->membank("bios_ext3")->set_base(machine.root_device().memregion("bios")->base() + 0x08000);
1124   state->membank("bios_ext4")->set_base(machine.root_device().memregion("bios")->base() + 0x0c000);
1125   state->membank("bios_bank1")->set_base(machine.root_device().memregion("bios")->base() + 0x10000);
1126   state->membank("bios_bank2")->set_base(machine.root_device().memregion("bios")->base() + 0x14000);
1127   state->membank("bios_bank3")->set_base(machine.root_device().memregion("bios")->base() + 0x18000);
1121   state->membank("bios_ext1")->set_base(state->memregion("bios")->base() + 0x00000);
1122   state->membank("bios_ext2")->set_base(state->memregion("bios")->base() + 0x04000);
1123   state->membank("bios_ext3")->set_base(state->memregion("bios")->base() + 0x08000);
1124   state->membank("bios_ext4")->set_base(state->memregion("bios")->base() + 0x0c000);
1125   state->membank("bios_bank1")->set_base(state->memregion("bios")->base() + 0x10000);
1126   state->membank("bios_bank2")->set_base(state->memregion("bios")->base() + 0x14000);
1127   state->membank("bios_bank3")->set_base(state->memregion("bios")->base() + 0x18000);
11281128   state->membank("bios_bank4")->set_base(state->memregion("bios")->base() + 0x1c000);
11291129   state->m_voodoo_pci_regs.base_addr = 0xff000000;
11301130}
src/mame/drivers/aristmk5.c
r15082r15083
392392
393393   /* load the roms according to what the operator wants */
394394   {
395      UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
395      UINT8 *ROM = state->memregion("maincpu")->base();
396396      UINT8 *PRG;// = state->memregion("prg_code")->base();
397397      int i;
398398      UINT8 op_mode;
399399      static const char *const rom_region[] = { "set_chip_4.04", "set_chip_4.4", "clear_chip", "game_prg" };
400400
401      op_mode = input_port_read(machine, "ROM_LOAD");
401      op_mode = machine.root_device().ioport("ROM_LOAD")->read();
402402
403403      PRG = machine.root_device().memregion(rom_region[op_mode & 3])->base();
404404
src/mame/drivers/tmspoker.c
r15082r15083
300300
301301static MACHINE_RESET( tmspoker )
302302{
303   UINT8 seldsw = (input_port_read(machine, "SELDSW") );
303   UINT8 seldsw = (machine.root_device().ioport("SELDSW")->read() );
304304
305305   popmessage("ROM Bank: %02X", seldsw);
306306
src/mame/drivers/darkhors.c
r15082r15083
313313   int bit_p2 = mask_to_bit((m_input_sel & 0xff000000) >> 24);
314314   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
315315
316   return   (input_port_read(machine(), portnames[bit_p1]) & 0x00ffffff) |
317         (input_port_read(machine(), portnames[bit_p2]) & 0xff000000) ;
316   return   (ioport(portnames[bit_p1])->read() & 0x00ffffff) |
317         (ioport(portnames[bit_p2])->read() & 0xff000000) ;
318318}
319319
320320WRITE32_MEMBER(darkhors_state::darkhors_unk1_w)
src/mame/drivers/upscope.c
r15082r15083
218218      if (data & 4)
219219      {
220220         if (LOG_IO) logerror("Internal register (%d) read\n", state->m_nvram_address_latch);
221         state->m_nvram_data_latch = (state->m_nvram_address_latch == 0) ? input_port_read(device->machine(), "IO0") : 0xff;
221         state->m_nvram_data_latch = (state->m_nvram_address_latch == 0) ? device->machine().root_device().ioport("IO0")->read() : 0xff;
222222      }
223223
224224      /* if SEL == 0, we read NVRAM */
src/mame/drivers/equites.c
r15082r15083
404404static TIMER_CALLBACK( equites_frq_adjuster_callback )
405405{
406406   equites_state *state = machine.driver_data<equites_state>();
407   UINT8 frq = input_port_read(machine, FRQ_ADJUSTER_TAG);
407   UINT8 frq = state->ioport(FRQ_ADJUSTER_TAG)->read();
408408
409409   msm5232_set_clock(state->m_msm, MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100);
410410//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);
r15082r15083
647647#if HVOLTAGE_DEBUG
648648READ16_MEMBER(equites_state::hvoltage_debug_r)
649649{
650   return(input_port_read(machine(), "FAKE"));
650   return(ioport("FAKE")->read());
651651}
652652#endif
653653
src/mame/drivers/mirax.c
r15082r15083
535535static DRIVER_INIT( mirax )
536536{
537537   mirax_state *state = machine.driver_data<mirax_state>();
538   UINT8 *DATA = machine.root_device().memregion("data_code")->base();
538   UINT8 *DATA = state->memregion("data_code")->base();
539539   UINT8 *ROM = state->memregion("maincpu")->base();
540540   int i;
541541
src/mame/drivers/omegrace.c
r15082r15083
297297
298298READ8_MEMBER(omegrace_state::omegrace_spinner1_r)
299299{
300   return (spinnerTable[input_port_read(machine(), "SPIN0") & 0x3f]);
300   return (spinnerTable[ioport("SPIN0")->read() & 0x3f]);
301301}
302302
303303
src/mame/drivers/decocass.c
r15082r15083
239239   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )                  PORT_DIPLOCATION("SW1:7")
240240   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
241241   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
242   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK)
242   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
243243
244244   PORT_START("DSW2") /* Start with all Unknown as each can change per game, except for Country Code */
245245   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1")      /* Most Dipswitch Settings sheets show this as "Number of Players" (Lives) */
r15082r15083
14751475static DRIVER_INIT( decocrom )
14761476{
14771477   decocass_state *state = machine.driver_data<decocass_state>();
1478   int romlength = machine.root_device().memregion("user3")->bytes();
1479   UINT8 *rom = machine.root_device().memregion("user3")->base();
1478   int romlength = state->memregion("user3")->bytes();
1479   UINT8 *rom = state->memregion("user3")->base();
14801480   int i;
14811481
14821482   state->m_decrypted2 = auto_alloc_array(machine, UINT8, romlength);
src/mame/drivers/mystwarr.c
r15082r15083
6363{
6464   if (ACCESSING_BITS_0_7)
6565   {
66      return input_port_read(machine(), "IN1");
66      return ioport("IN1")->read();
6767   }
6868
6969//  logerror("msb access to eeprom port\n");
r15082r15083
7575{
7676   if (ACCESSING_BITS_8_15)
7777   {
78      input_port_write(machine(), "EEPROMOUT", data, 0xffff);
78      ioport("EEPROMOUT")->write(data, 0xffff);
7979   }
8080
8181//  logerror("unknown LSB write %x to eeprom\n", data);
r15082r15083
8686{
8787   if (ACCESSING_BITS_8_15)
8888   {
89      return input_port_read(machine(), "IN1") << 8;
89      return ioport("IN1")->read() << 8;
9090   }
9191
92   return input_port_read(machine(), "P2");
92   return ioport("P2")->read();
9393}
9494
9595WRITE16_MEMBER(mystwarr_state::mmeeprom_w)
9696{
9797   if (ACCESSING_BITS_0_7)
9898   {
99      input_port_write(machine(), "EEPROMOUT", data, 0xff);
99      ioport("EEPROMOUT")->write(data, 0xff);
100100   }
101101}
102102
src/mame/drivers/dlair.c
r15082r15083
260260   /* determine the laserdisc player from the DIP switches */
261261   if (state->m_laserdisc_type == LASERDISC_TYPE_VARIABLE)
262262   {
263      int newtype = (input_port_read(machine, "DSW2") & 0x08) ? LASERDISC_TYPE_PIONEER_LDV1000 : LASERDISC_TYPE_PIONEER_PR7820;
263      int newtype = (state->ioport("DSW2")->read() & 0x08) ? LASERDISC_TYPE_PIONEER_LDV1000 : LASERDISC_TYPE_PIONEER_PR7820;
264264      laserdisc_set_type(state->m_laserdisc, newtype);
265265   }
266266#endif
r15082r15083
555555   PORT_DIPSETTING(    0x40, "PAYG3" )
556556   PORT_DIPSETTING(    0x60, "PAYG4" )
557557   PORT_DIPNAME( 0x90, 0x10, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("B:8,5")
558   PORT_DIPSETTING(   0x00, "Increase after 5" ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
559   PORT_DIPSETTING(   0x10, "Increase after 9" ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
560   PORT_DIPSETTING(   0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
561   PORT_DIPSETTING(   0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
562   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
563   PORT_DIPSETTING(   0x10, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
564   PORT_DIPSETTING(   0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
565   PORT_DIPSETTING(   0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
558   PORT_DIPSETTING(   0x00, "Increase after 5" ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
559   PORT_DIPSETTING(   0x10, "Increase after 9" ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
560   PORT_DIPSETTING(   0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
561   PORT_DIPSETTING(   0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
562   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
563   PORT_DIPSETTING(   0x10, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
564   PORT_DIPSETTING(   0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
565   PORT_DIPSETTING(   0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
566566
567567   PORT_START("CONTROLS")
568568   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
r15082r15083
657657   PORT_DIPSETTING(    0x40, "PAYG3" )
658658   PORT_DIPSETTING(    0x60, "PAYG4" )
659659   PORT_DIPNAME( 0x90, 0x10, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("B:8,5s")
660   PORT_DIPSETTING(   0x00, "Increase after 5" ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
661   PORT_DIPSETTING(   0x10, "Increase after 9" ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
662   PORT_DIPSETTING(   0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
663   PORT_DIPSETTING(   0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
664   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
665   PORT_DIPSETTING(   0x10, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
666   PORT_DIPSETTING(   0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
667   PORT_DIPSETTING(   0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
660   PORT_DIPSETTING(   0x00, "Increase after 5" ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
661   PORT_DIPSETTING(   0x10, "Increase after 9" ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
662   PORT_DIPSETTING(   0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
663   PORT_DIPSETTING(   0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
664   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
665   PORT_DIPSETTING(   0x10, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
666   PORT_DIPSETTING(   0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
667   PORT_DIPSETTING(   0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
668668INPUT_PORTS_END
669669
670670
src/mame/drivers/irobot.c
r15082r15083
185185   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
186186   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* MB DONE */
187187   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* EXT DONE */
188   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
188   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
189189
190190   PORT_START("DSW2") /* DSW2 - 5E*/
191191   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Language ) )  PORT_DIPLOCATION("SW5E:1")
src/mame/drivers/klax.c
r15082r15083
4141static void scanline_update(screen_device &screen, int scanline)
4242{
4343   /* generate 32V signals */
44   if ((scanline & 32) == 0 && !(input_port_read(screen.machine(), "P1") & 0x800))
44   if ((scanline & 32) == 0 && !(screen.machine().root_device().ioport("P1")->read() & 0x800))
4545      atarigen_scanline_int_gen(screen.machine().device("maincpu"));
4646}
4747
r15082r15083
115115   PORT_BIT( 0x00fc, IP_ACTIVE_LOW, IPT_UNUSED )
116116   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
117117   PORT_BIT( 0x0600, IP_ACTIVE_LOW, IPT_UNUSED )
118   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK )
118   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
119119   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
120120   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
121121   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
src/mame/drivers/quizpani.c
r15082r15083
8888
8989   PORT_START("P1_P2")
9090   /* "Standard" buttons layout */
91   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
92   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
93   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
94   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
95   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
96   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
97   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
98   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
99   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
100   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
101   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
102   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
103   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
104   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
105   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
106   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
91   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
92   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
93   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
94   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
95   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
96   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
97   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
98   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
99   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
100   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
101   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
102   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
103   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
104   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
105   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
106   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
107107   /* "Alternate" buttons layout */
108   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */   PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
109   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */   PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
110   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */   PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
111   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
112   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
113   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
114   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
115   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
116   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */   PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
117   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */   PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
118   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */   PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
119   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
120   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
121   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
122   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
123   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
108   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */   PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
109   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */   PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
110   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */   PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
111   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
112   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
113   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
114   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
115   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
116   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */   PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
117   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */   PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
118   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */   PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
119   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
120   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
121   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
122   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)     PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
123   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )                    PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
124124
125125   PORT_START("DSW1")
126126   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )  /* guess, but check code at 0x004d9c and write to 0x100014 */
src/mame/drivers/gomoku.c
r15082r15083
3232
3333   res = 0;
3434   for (i = 0; i < 8; i++)
35      res |= ((input_port_read_safe(machine(), portnames[i], 0xff) >> offset) & 1) << i;
35      res |= ((ioport(portnames[i])->read_safe(0xff) >> offset) & 1) << i;
3636
3737   return res;
3838}
src/mame/drivers/ssfindo.c
r15082r15083
393393
394394         if( m_iocr_hack)
395395         {
396            return (input_port_read(machine(), "PS7500") & 0x80) | 0x34 | (machine().rand()&3); //eeprom read ?
396            return (ioport("PS7500")->read() & 0x80) | 0x34 | (machine().rand()&3); //eeprom read ?
397397         }
398398
399         return (input_port_read(machine(), "PS7500") & 0x80) | 0x37;
399         return (ioport("PS7500")->read() & 0x80) | 0x37;
400400
401401      case VIDCR:
402402         return (m_PS7500_IO[offset] | 0x50) & 0xfffffff0;
r15082r15083
613613
614614static INPUT_PORTS_START( ssfindo )
615615   PORT_START("PS7500")
616   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
616   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
617617
618618   PORT_START("IN0")
619619   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED   )            // IPT_START2 ??
r15082r15083
663663
664664static INPUT_PORTS_START( ppcar )
665665   PORT_START("PS7500")
666   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
666   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
667667
668668   PORT_START("IN0")
669669   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1   )
r15082r15083
680680
681681static INPUT_PORTS_START( tetfight )
682682   PORT_START("PS7500")
683   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
683   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
684684
685685   PORT_START("DSW")
686686   PORT_DIPNAME( 0x01, 0x01, "DSW 0" )
src/mame/drivers/firetrk.c
r15082r15083
172172
173173READ8_MEMBER(firetrk_state::firetrk_dip_r)
174174{
175   UINT8 val0 = input_port_read(machine(), "DIP_0");
176   UINT8 val1 = input_port_read(machine(), "DIP_1");
175   UINT8 val0 = ioport("DIP_0")->read();
176   UINT8 val1 = ioport("DIP_1")->read();
177177
178178   if (val1 & (1 << (2 * offset + 0))) val0 |= 1;
179179   if (val1 & (1 << (2 * offset + 1))) val0 |= 2;
r15082r15083
184184
185185READ8_MEMBER(firetrk_state::montecar_dip_r)
186186{
187   UINT8 val0 = input_port_read(machine(), "DIP_0");
188   UINT8 val1 = input_port_read(machine(), "DIP_1");
187   UINT8 val0 = ioport("DIP_0")->read();
188   UINT8 val1 = ioport("DIP_1")->read();
189189
190190   if (val1 & (1 << (3 - offset))) val0 |= 1;
191191   if (val1 & (1 << (7 - offset))) val0 |= 2;
r15082r15083
247247   /* update steering wheels */
248248   for (i = 0; i < 2; i++)
249249   {
250      UINT32 new_dial = input_port_read_safe(machine(), (i ? "STEER_2" : "STEER_1"), 0);
250      UINT32 new_dial = ioport((i ? "STEER_2" : "STEER_1"))->read_safe(0);
251251      INT32 delta = new_dial - m_dial[i];
252252
253253      if (delta != 0)
r15082r15083
259259      }
260260   }
261261
262   return ((input_port_read_safe(machine(), "BIT_0", 0) & (1 << offset)) ? 0x01 : 0) |
263         ((input_port_read_safe(machine(), "BIT_6", 0) & (1 << offset)) ? 0x40 : 0) |
264         ((input_port_read_safe(machine(), "BIT_7", 0) & (1 << offset)) ? 0x80 : 0);
262   return ((ioport("BIT_0")->read_safe(0) & (1 << offset)) ? 0x01 : 0) |
263         ((ioport("BIT_6")->read_safe(0) & (1 << offset)) ? 0x40 : 0) |
264         ((ioport("BIT_7")->read_safe(0) & (1 << offset)) ? 0x80 : 0);
265265}
266266
267267
r15082r15083
447447   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("Both Players Start")
448448   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE) PORT_PLAYER(1)
449449   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
450   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_VBLANK )
450   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_CUSTOM ) PORT_VBLANK("screen")
451451   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ))
452452   PORT_DIPSETTING(    0x00, "Smokey Joe (1 Player)" )
453453   PORT_DIPSETTING(    0x40, "Fire Truck (2 Players)" )
r15082r15083
579579   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state,gear_r, (void *)2)
580580   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE)
581581   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas")
582   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK )
582   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
583583   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state,steer_dir_r, (void *)0)
584584   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state,skid_r, (void *)1)
585585
src/mame/drivers/segas24.c
r15082r15083
515515   switch(port)
516516   {
517517   case 0:
518      return input_port_read(machine(), "P1");
518      return ioport("P1")->read();
519519   case 1:
520      return input_port_read(machine(), "P2");
520      return ioport("P2")->read();
521521   case 2:
522      return input_port_read_safe(machine(), "P3", 0xff);
522      return ioport("P3")->read_safe(0xff);
523523   case 3:
524524      return 0xff;
525525   case 4:
526      return input_port_read(machine(), "SERVICE");
526      return ioport("SERVICE")->read();
527527   case 5: // Dip switches
528      return input_port_read(machine(), "COINAGE");
528      return ioport("COINAGE")->read();
529529   case 6:
530      return input_port_read(machine(), "DSW");
530      return ioport("DSW")->read();
531531   case 7: // DAC
532532      return 0xff;
533533   }
r15082r15083
541541   case 0:
542542   {
543543      static const UINT8 pos[16] = { 0, 1, 3, 2, 6, 4, 12, 8, 9 };
544      return (input_port_read(machine(), "P1") & 0xf) | ((~pos[input_port_read(machine(), "PADDLE")>>4]<<4) & 0xf0);
544      return (ioport("P1")->read() & 0xf) | ((~pos[ioport("PADDLE")->read()>>4]<<4) & 0xf0);
545545   }
546546   case 1:
547      return input_port_read(machine(), "P2");
547      return ioport("P2")->read();
548548   case 2:
549549      return 0xff;
550550   case 3:
551551      return 0xff;
552552   case 4:
553      return input_port_read(machine(), "SERVICE");
553      return ioport("SERVICE")->read();
554554   case 5: // Dip switches
555      return input_port_read(machine(), "COINAGE");
555      return ioport("COINAGE")->read();
556556   case 6:
557      return input_port_read(machine(), "DSW");
557      return ioport("DSW")->read();
558558   case 7: // DAC
559559      return 0xff;
560560   }
r15082r15083
573573   case 1:
574574      return 0xff;
575575   case 2:
576      return input_port_read(machine(), keynames[cur_input_line]);
576      return ioport(keynames[cur_input_line])->read();
577577   case 3:
578578      return 0xff;
579579   case 4:
580      return input_port_read(machine(), "SERVICE");
580      return ioport("SERVICE")->read();
581581   case 5: // Dip switches
582      return input_port_read(machine(), "COINAGE");
582      return ioport("COINAGE")->read();
583583   case 6:
584      return input_port_read(machine(), "DSW");
584      return ioport("DSW")->read();
585585   case 7: // DAC
586586      return 0xff;
587587   }
r15082r15083
626626   if(ACCESSING_BITS_0_7)
627627   {
628628      data &= 3;
629      hotrod_ctrl_cur = input_port_read_safe(machine(), portnames[data], 0);
629      hotrod_ctrl_cur = ioport(portnames[data])->read_safe(0);
630630   }
631631}
632632
r15082r15083
638638      {
639639         // Steering dials
640640         case 0:
641            return input_port_read_safe(machine(), "DIAL1", 0) & 0xff;
641            return ioport("DIAL1")->read_safe(0) & 0xff;
642642         case 1:
643            return input_port_read_safe(machine(), "DIAL1", 0) >> 8;
643            return ioport("DIAL1")->read_safe(0) >> 8;
644644         case 2:
645            return input_port_read_safe(machine(), "DIAL2", 0) & 0xff;
645            return ioport("DIAL2")->read_safe(0) & 0xff;
646646         case 3:
647            return input_port_read_safe(machine(), "DIAL2", 0) >> 8;
647            return ioport("DIAL2")->read_safe(0) >> 8;
648648         case 4:
649            return input_port_read_safe(machine(), "DIAL3", 0) & 0xff;
649            return ioport("DIAL3")->read_safe(0) & 0xff;
650650         case 5:
651            return input_port_read_safe(machine(), "DIAL3", 0) >> 8;
651            return ioport("DIAL3")->read_safe(0) >> 8;
652652         case 6:
653            return input_port_read_safe(machine(), "DIAL4", 0) & 0xff;
653            return ioport("DIAL4")->read_safe(0) & 0xff;
654654         case 7:
655            return input_port_read_safe(machine(), "DIAL4", 0) >> 8;
655            return ioport("DIAL4")->read_safe(0) >> 8;
656656
657657         case 8:
658658         {
r15082r15083
12621262{
12631263   segas24_state *state = machine.driver_data<segas24_state>();
12641264   if (state->track_size)
1265      machine.device<nvram_device>("floppy_nvram")->set_base(machine.root_device().memregion("floppy")->base(), 2*state->track_size);
1265      machine.device<nvram_device>("floppy_nvram")->set_base(state->memregion("floppy")->base(), 2*state->track_size);
12661266
12671267   UINT8 *usr1 = state->memregion("romboard")->base();
12681268   if (usr1)
r15082r15083
17711771   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
17721772
17731773   PORT_START("SERVICE")
1774   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x00)
1775   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x00)
1774   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_CONDITION("DSW",0x08,EQUALS,0x00)
1775   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_CONDITION("DSW",0x08,EQUALS,0x00)
17761776   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE )
17771777   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
17781778   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
17791779   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1780   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x00)
1781   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x00)
1780   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW",0x08,EQUALS,0x00)
1781   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW",0x08,EQUALS,0x00)
17821782   /* alt coin mode */
1783   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x08)
1784   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x08)
1785   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x08)
1786   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x08)
1783   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW",0x08,EQUALS,0x08)
1784   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW",0x08,EQUALS,0x08)
1785   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW",0x08,EQUALS,0x08)
1786   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW",0x08,EQUALS,0x08)
17871787
17881788
17891789   PORT_INCLUDE( system24_DSW )
src/mame/drivers/peplus.c
r15082r15083
352352
353353static void handle_lightpen( device_t *device )
354354{
355    int x_val = input_port_read_safe(device->machine(), "TOUCH_X",0x00);
356    int y_val = input_port_read_safe(device->machine(), "TOUCH_Y",0x00);
355    int x_val = device->machine().root_device().ioport("TOUCH_X")->read_safe(0x00);
356    int y_val = device->machine().root_device().ioport("TOUCH_Y")->read_safe(0x00);
357357    const rectangle &vis_area = device->machine().primary_screen->visible_area();
358358    int xt, yt;
359359
r15082r15083
576576      sda = i2cmem_sda_read(device);
577577   }
578578
579   if ((input_port_read_safe(device->machine(), "SENSOR",0x00) & 0x01) == 0x01 && state->m_coin_state == 0) {
579   if ((state->ioport("SENSOR")->read_safe(0x00) & 0x01) == 0x01 && state->m_coin_state == 0) {
580580      state->m_coin_state = 1; // Start Coin Cycle
581581      state->m_last_cycles = device->machine().firstcpu->total_cycles();
582582   } else {
r15082r15083
615615      door_wait = 12345;
616616
617617   if (curr_cycles - state->m_last_door > door_wait) {
618      if ((input_port_read_safe(device->machine(), "DOOR",0xff) & 0x01) == 0x01) {
618      if ((state->ioport("DOOR")->read_safe(0xff) & 0x01) == 0x01) {
619619         state->m_door_open = (!state->m_door_open & 0x01);
620620      } else {
621621         state->m_door_open = 1;
r15082r15083
818818CUSTOM_INPUT_MEMBER(peplus_state::peplus_input_r)
819819{
820820   UINT8 inp_ret = 0x00;
821   UINT8 inp_read = input_port_read(machine(), (const char *)param);
821   UINT8 inp_read = ioport((const char *)param)->read();
822822
823823   if (inp_read & 0x01) inp_ret = 0x01;
824824   if (inp_read & 0x02) inp_ret = 0x02;
r15082r15083
10351035   state->m_autohold_addr = 0x5e7e; // AutoHold Address
10361036
10371037   if (state->m_autohold_addr)
1038      state->m_program_ram[state->m_autohold_addr] = input_port_read_safe(machine, "AUTOHOLD",0x00) & 0x01;
1038      state->m_program_ram[state->m_autohold_addr] = state->ioport("AUTOHOLD")->read_safe(0x00) & 0x01;
10391039#endif
10401040}
10411041
src/mame/drivers/konamigx.c
r15082r15083
463463          bit 0: eeprom data
464464        */
465465
466      input_port_write(machine(), "EEPROMOUT", odata, 0xff);
466      ioport("EEPROMOUT")->write(odata, 0xff);
467467
468468      konamigx_wrport1_0 = odata;
469469   }
r15082r15083
874874   switch (input)
875875   {
876876   case ADC083X_CH0:
877      return (double)(5 * input_port_read(device->machine(), "AN0")) / 255.0; // steer
877      return (double)(5 * device->machine().root_device().ioport("AN0")->read()) / 255.0; // steer
878878   case ADC083X_CH1:
879      return (double)(5 * input_port_read(device->machine(), "AN1")) / 255.0; // gas
879      return (double)(5 * device->machine().root_device().ioport("AN1")->read()) / 255.0; // gas
880880   case ADC083X_VREF:
881881      return 5;
882882   }
r15082r15083
890890
891891READ32_MEMBER(konamigx_state::le2_gun_H_r)
892892{
893   int p1x = input_port_read(machine(), "LIGHT0_X")*290/0xff+20;
894   int p2x = input_port_read(machine(), "LIGHT1_X")*290/0xff+20;
893   int p1x = ioport("LIGHT0_X")->read()*290/0xff+20;
894   int p2x = ioport("LIGHT1_X")->read()*290/0xff+20;
895895
896896   return (p1x<<16)|p2x;
897897}
898898
899899READ32_MEMBER(konamigx_state::le2_gun_V_r)
900900{
901   int p1y = input_port_read(machine(), "LIGHT0_Y")*224/0xff;
902   int p2y = input_port_read(machine(), "LIGHT1_Y")*224/0xff;
901   int p1y = ioport("LIGHT0_Y")->read()*224/0xff;
902   int p2y = ioport("LIGHT1_Y")->read()*224/0xff;
903903
904904   // make "off the bottom" reload too
905905   if (p1y >= 0xdf) p1y = 0;
src/mame/drivers/thunderj.c
r15082r15083
7070
7171READ16_MEMBER(thunderj_state::special_port2_r)
7272{
73   int result = input_port_read(machine(), "260012");
73   int result = ioport("260012")->read();
7474
7575   if (m_sound_to_cpu_ready) result ^= 0x0004;
7676   if (m_cpu_to_sound_ready) result ^= 0x0008;
r15082r15083
219219   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
220220
221221   PORT_START("260012")
222   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
222   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
223223   PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
224224   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )   /* Input buffer full (@260030) */
225225   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )   /* Output buffer full (@360030) */
src/mame/drivers/quantum.c
r15082r15083
7474
7575READ16_MEMBER(quantum_state::trackball_r)
7676{
77   return (input_port_read(machine(), "TRACKY") << 4) | input_port_read(machine(), "TRACKX");
77   return (ioport("TRACKY")->read() << 4) | ioport("TRACKX")->read();
7878}
7979
8080
8181static READ8_DEVICE_HANDLER( input_1_r )
8282{
83   return (input_port_read(device->machine(), "DSW0") << (7 - (offset - POT0_C))) & 0x80;
83   return (device->machine().root_device().ioport("DSW0")->read() << (7 - (offset - POT0_C))) & 0x80;
8484}
8585
8686
8787static READ8_DEVICE_HANDLER( input_2_r )
8888{
89   return (input_port_read(device->machine(), "DSW1") << (7 - (offset - POT0_C))) & 0x80;
89   return (device->machine().root_device().ioport("DSW1")->read() << (7 - (offset - POT0_C))) & 0x80;
9090}
9191
9292
src/mame/drivers/combatsc.c
r15082r15083
158158{
159159   static const char *const portnames[] = { "IN0", "IN1", "DSW1", "DSW2" };
160160
161   return input_port_read(machine(), portnames[offset]);
161   return ioport(portnames[offset])->read();
162162}
163163
164164WRITE8_MEMBER(combatsc_state::combatscb_priority_w)
r15082r15083
279279      {
280280         UINT8 curr;
281281
282         curr = input_port_read_safe(machine(), tracknames[i], 0xff);
282         curr = ioport(tracknames[i])->read_safe(0xff);
283283
284284         dir[i] = curr - m_pos[i];
285285         m_sign[i] = dir[i] & 0x80;
r15082r15083
690690static MACHINE_START( combatsc )
691691{
692692   combatsc_state *state = machine.driver_data<combatsc_state>();
693   UINT8 *MEM = machine.root_device().memregion("maincpu")->base() + 0x38000;
693   UINT8 *MEM = state->memregion("maincpu")->base() + 0x38000;
694694
695695   state->m_io_ram  = MEM + 0x0000;
696696   state->m_page[0] = MEM + 0x4000;
src/mame/drivers/segac2.c
r15082r15083
118118
119119   /* determine how many sound banks */
120120   state->m_sound_banks = 0;
121   if (machine.root_device().memregion("upd")->base())
121   if (state->memregion("upd")->base())
122122      state->m_sound_banks = state->memregion("upd")->bytes() / 0x20000;
123123
124124   /* reset the protection */
r15082r15083
326326
327327         /* otherwise, return an input port */
328328         if (offset == 0x04/2 && state->m_sound_banks)
329            return (input_port_read(space->machine(), portnames[offset]) & 0xbf) | (upd7759_busy_r(space->machine().device("upd")) << 6);
330         return input_port_read(space->machine(), portnames[offset]);
329            return (space->machine().root_device().ioport(portnames[offset])->read() & 0xbf) | (upd7759_busy_r(space->machine().device("upd")) << 6);
330         return space->machine().root_device().ioport(portnames[offset])->read();
331331
332332      /* 'SEGA' protection */
333333      case 0x10/2:
src/mame/drivers/splus.c
r15082r15083
395395         break;
396396      case 0x01: // Bank 10
397397            // Test for Coin-In
398           if ((input_port_read_safe(machine(),"SENSOR",0x00) & 0x01) == 0x01 && m_coin_state == 0) {
398           if ((ioport("SENSOR")->read_safe(0x00) & 0x01) == 0x01 && m_coin_state == 0) {
399399              m_coin_state = 1; // Start Coin Cycle
400400              m_last_cycles = machine().firstcpu->total_cycles();
401401#if DEBUG_OUTPUT
r15082r15083
438438           }
439439
440440            // Determine Door Optics
441            if ((input_port_read_safe(machine(),"I10",0x08) & 0x08) == 0x08)
441            if ((ioport("I10")->read_safe(0x08) & 0x08) == 0x08)
442442                door_optics = 0x08;
443443            else
444444                door_optics = (((m_bank20 >> 4) & 1) << 3); // Use Door Optics Transmitter
r15082r15083
483483            val = val | door_optics; // Door Optics Receiver
484484            val = val | coin_out; // Hopper Coin OutR
485485            val = val | 0x00; // Hopper Full
486            val = val | (input_port_read_safe(machine(),"I10",0x40) & 0x40); // Handle/Spin Button
487            val = val | (input_port_read_safe(machine(),"I10",0x80) & 0x80); // Jackpot Reset Key
486            val = val | (ioport("I10")->read_safe(0x40) & 0x40); // Handle/Spin Button
487            val = val | (ioport("I10")->read_safe(0x80) & 0x80); // Jackpot Reset Key
488488         break;
489489      case 0x02: // Bank 20
490            val = val | (input_port_read_safe(machine(),"I20",0x01) & 0x01); // Bet One Credit
491            val = val | (input_port_read_safe(machine(),"I20",0x02) & 0x02); // Play Max Credits
492            val = val | (input_port_read_safe(machine(),"I20",0x04) & 0x04); // Cash Out
493            val = val | (input_port_read_safe(machine(),"I20",0x08) & 0x08); // Change Request
490            val = val | (ioport("I20")->read_safe(0x01) & 0x01); // Bet One Credit
491            val = val | (ioport("I20")->read_safe(0x02) & 0x02); // Play Max Credits
492            val = val | (ioport("I20")->read_safe(0x04) & 0x04); // Cash Out
493            val = val | (ioport("I20")->read_safe(0x08) & 0x08); // Change Request
494494            val = val | 0x00; // Reel Mechanism
495            val = val | (input_port_read_safe(machine(),"I20",0x20) & 0x20); // Self Test Button
495            val = val | (ioport("I20")->read_safe(0x20) & 0x20); // Self Test Button
496496            val = val | 0x40; // Card Cage
497497            val = val | 0x80; // Bill Acceptor
498498         break;
499499      case 0x04: // Bank 30
500500            // Reserved
501            val = val | (input_port_read_safe(machine(),"I30",0x02) & 0x02); // Drop Door
501            val = val | (ioport("I30")->read_safe(0x02) & 0x02); // Drop Door
502502            // Jackpot to Credit Key
503503            // Reserved
504504            // Reserved
src/mame/drivers/gpworld.c
r15082r15083
247247READ8_MEMBER(gpworld_state::pedal_in)
248248{
249249   if (m_brake_gas)
250      return   input_port_read(machine(), "INACCEL");
250      return   ioport("INACCEL")->read();
251251
252   return   input_port_read(machine(), "INBRAKE");
252   return   ioport("INBRAKE")->read();
253253
254254}
255255
src/mame/drivers/exidy.c
r15082r15083
157157
158158CUSTOM_INPUT_MEMBER(exidy_state::teetert_input_r)
159159{
160   UINT8 dial = input_port_read(machine(), "DIAL");
160   UINT8 dial = ioport("DIAL")->read();
161161   int result = 0;
162162
163163   result = (dial != m_last_dial) << 4;
r15082r15083
379379   PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL )
380380   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
381381   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
382   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
382   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
383383
384384   PORT_START("IN2")
385385   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
404404
405405   PORT_MODIFY("DSW")
406406   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2")
407   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
408   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
409   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
410   PORT_DIPSETTING(    0x03, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
411   PORT_DIPSETTING(    0x00, "2C/1P, 50P Coin/3P" )   PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
412   PORT_DIPSETTING(    0x01, "1C/1P, 50P Coin/6P" )   PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
413   PORT_DIPSETTING(    0x02, "1C/2P, 50P Coin/12P" )   PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
414   PORT_DIPSETTING(    0x03, "1C/3P, 50P Coin/18P" )   PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
407   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
408   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
409   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
410   PORT_DIPSETTING(    0x03, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
411   PORT_DIPSETTING(    0x00, "2C/1P, 50P Coin/3P" )   PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
412   PORT_DIPSETTING(    0x01, "1C/1P, 50P Coin/6P" )   PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
413   PORT_DIPSETTING(    0x02, "1C/2P, 50P Coin/12P" )   PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
414   PORT_DIPSETTING(    0x03, "1C/3P, 50P Coin/18P" )   PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
415415   PORT_DIPNAME( 0x04, 0x00, "Top Score Award" ) PORT_DIPLOCATION("SW1:3")
416416   PORT_DIPSETTING(    0x00, "Credit" )
417417   PORT_DIPSETTING(    0x04, "Extended Play" )
r15082r15083
445445
446446   PORT_MODIFY("DSW")
447447   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2")
448   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
449   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
450   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
451   PORT_DIPSETTING(    0x03, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
452   PORT_DIPSETTING(    0x00, "2F/1P, 5F Coin/3P" )      PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
453   PORT_DIPSETTING(    0x01, "1F/1P, 5F Coin/6P" )      PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
454   PORT_DIPSETTING(    0x02, "1F/2P, 5F Coin/12P" )   PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
455   PORT_DIPSETTING(    0x03, "1F/3P, 5F Coin/18P" )   PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
448   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )      PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
449   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
450   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )      PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
451   PORT_DIPSETTING(    0x03, DEF_STR( 1C_3C ) )      PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
452   PORT_DIPSETTING(    0x00, "2F/1P, 5F Coin/3P" )      PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
453   PORT_DIPSETTING(    0x01, "1F/1P, 5F Coin/6P" )      PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
454   PORT_DIPSETTING(    0x02, "1F/2P, 5F Coin/12P" )   PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
455   PORT_DIPSETTING(    0x03, "1F/3P, 5F Coin/18P" )   PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
456456INPUT_PORTS_END
457457
458458
r15082r15083
507507   PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL )
508508   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
509509   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
510   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
510   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
511511
512512   PORT_START("IN2")
513513   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Yellow Button")
r15082r15083
569569   PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL )
570570   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
571571   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
572   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
572   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
573573
574574   PORT_START("IN2")
575575   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
625625   PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
626626   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
627627   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
628   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
628   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
629629
630630   PORT_START("IN2")
631631   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
685685   PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL )
686686   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
687687   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
688   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
688   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
689689
690690   PORT_START("IN2")
691691   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r15082r15083
737737   PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL )
738738   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
739739   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
740   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
740   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
741741
742742   PORT_START("IN2")
743743   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/homedata.c
r15082r15083
257257      {
258258         if (m_keyb & (1 << i))
259259         {
260            res = input_port_read(machine(), keynames[i]) & 0x3f;
260            res = ioport(keynames[i])->read() & 0x3f;
261261            break;
262262         }
263263      }
r15082r15083
370370
371371READ8_MEMBER(homedata_state::reikaids_io_r)
372372{
373   int res = input_port_read(machine(), "IN2");   // bit 4 = coin, bit 5 = service
373   int res = ioport("IN2")->read();   // bit 4 = coin, bit 5 = service
374374
375375   res |= BIT(m_upd7807_portc, 2) * 0x01;      // bit 0 = upd7807 status
376376   res |= BIT(m_upd7807_portc, 6) * 0x02;      // bit 1 = upd7807 data
r15082r15083
438438READ8_MEMBER(homedata_state::pteacher_keyboard_r)
439439{
440440   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
441   int dips = input_port_read(machine(), "DSW");
441   int dips = ioport("DSW")->read();
442442
443443   //  logerror("%04x: keyboard_r with port A = %02x\n",cpu_get_pc(&space.device()),upd7807_porta);
444444
r15082r15083
446446   {
447447      /* player 1 + dip switches */
448448      int row = (m_upd7807_porta & 0x07);
449      return input_port_read(machine(), keynames[row]) | (((dips >> row) & 1) << 5);   // 0-5
449      return ioport(keynames[row])->read() | (((dips >> row) & 1) << 5);   // 0-5
450450   }
451451   if (m_upd7807_porta & 0x08)
452452   {
r15082r15083
11491149static MACHINE_START( reikaids )
11501150{
11511151   homedata_state *state = machine.driver_data<homedata_state>();
1152   UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
1152   UINT8 *ROM = state->memregion("maincpu")->base();
11531153
11541154   state->membank("bank1")->configure_entries(0, 8, &ROM[0xc000], 0x4000);
11551155   state->membank("bank2")->configure_entries(0, 4, state->memregion("audiocpu")->base(), 0x10000);
r15082r15083
11661166static MACHINE_START( pteacher )
11671167{
11681168   homedata_state *state = machine.driver_data<homedata_state>();
1169   UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
1169   UINT8 *ROM = state->memregion("maincpu")->base();
11701170
11711171   state->membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
11721172   state->membank("bank2")->configure_entries(0, 4, state->memregion("audiocpu")->base(), 0x10000);
src/mame/drivers/mw18w.c
r15082r15083
141141   PORT_DIPSETTING(    0x30, "90 seconds" )
142142
143143   PORT_DIPNAME( 0x0c, 0x00, "Extended Time" ) PORT_DIPLOCATION("SW:3,4")
144   PORT_DIPSETTING(    0x00, "20 seconds at 4000" )  PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00) // @ 60 seconds
145   PORT_DIPSETTING(    0x04, "30 seconds at 8000" )  PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00)
146   PORT_DIPSETTING(    0x08, "15 seconds at 8000" )  PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00)
147   PORT_DIPSETTING(    0x0c, "30 seconds at 10000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00)
148   PORT_DIPSETTING(    0x00, "20 seconds at 6000" )  PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10) // @ 70 seconds
149   PORT_DIPSETTING(    0x04, "30 seconds at 9000" )  PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10)
150   PORT_DIPSETTING(    0x08, "20 seconds at 9000" )  PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10)
151   PORT_DIPSETTING(    0x0c, "30 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10)
152   PORT_DIPSETTING(    0x00, "20 seconds at 8000" )  PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20) // @ 80 seconds
153   PORT_DIPSETTING(    0x04, "30 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20)
154   PORT_DIPSETTING(    0x08, "20 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20)
155   PORT_DIPSETTING(    0x0c, "30 seconds at 16000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20)
156   PORT_DIPSETTING(    0x00, "20 seconds at 10000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30) // @ 90 seconds
157   PORT_DIPSETTING(    0x04, "30 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30)
158   PORT_DIPSETTING(    0x08, "20 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30)
159   PORT_DIPSETTING(    0x0c, "30 seconds at 20000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30)
144   PORT_DIPSETTING(    0x00, "20 seconds at 4000" )  PORT_CONDITION("DSW", 0x30, EQUALS, 0x00) // @ 60 seconds
145   PORT_DIPSETTING(    0x04, "30 seconds at 8000" )  PORT_CONDITION("DSW", 0x30, EQUALS, 0x00)
146   PORT_DIPSETTING(    0x08, "15 seconds at 8000" )  PORT_CONDITION("DSW", 0x30, EQUALS, 0x00)
147   PORT_DIPSETTING(    0x0c, "30 seconds at 10000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x00)
148   PORT_DIPSETTING(    0x00, "20 seconds at 6000" )  PORT_CONDITION("DSW", 0x30, EQUALS, 0x10) // @ 70 seconds
149   PORT_DIPSETTING(    0x04, "30 seconds at 9000" )  PORT_CONDITION("DSW", 0x30, EQUALS, 0x10)
150   PORT_DIPSETTING(    0x08, "20 seconds at 9000" )  PORT_CONDITION("DSW", 0x30, EQUALS, 0x10)
151   PORT_DIPSETTING(    0x0c, "30 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x10)
152   PORT_DIPSETTING(    0x00, "20 seconds at 8000" )  PORT_CONDITION("DSW", 0x30, EQUALS, 0x20) // @ 80 seconds
153   PORT_DIPSETTING(    0x04, "30 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x20)
154   PORT_DIPSETTING(    0x08, "20 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x20)
155   PORT_DIPSETTING(    0x0c, "30 seconds at 16000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x20)
156   PORT_DIPSETTING(    0x00, "20 seconds at 10000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30) // @ 90 seconds
157   PORT_DIPSETTING(    0x04, "30 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
158   PORT_DIPSETTING(    0x08, "20 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
159   PORT_DIPSETTING(    0x0c, "30 seconds at 20000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
160160
161161   PORT_DIPNAME( 0x40, 0x40, "I/O Test" ) PORT_DIPLOCATION("SW:7")
162162   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
src/mame/drivers/mugsmash.c
r15082r15083
154154   switch (offset)
155155   {
156156      case 0 :
157         data = (input_port_read(machine(), "P1") & 0xff) | ((input_port_read(machine(), "DSW1") & 0xc0) << 6) | ((input_port_read(machine(), "IN0") & 0x03) << 8);
157         data = (ioport("P1")->read() & 0xff) | ((ioport("DSW1")->read() & 0xc0) << 6) | ((ioport("IN0")->read() & 0x03) << 8);
158158         break;
159159      case 1 :
160         data = (input_port_read(machine(), "P2") & 0xff) | ((input_port_read(machine(), "DSW1") & 0x3f) << 8);
160         data = (ioport("P2")->read() & 0xff) | ((ioport("DSW1")->read() & 0x3f) << 8);
161161         break;
162162      case 2 :
163         data = ((input_port_read(machine(), "DSW2") & 0x3f) << 8);
163         data = ((ioport("DSW2")->read() & 0x3f) << 8);
164164         break;
165165      case 3 :
166         data = ((input_port_read(machine(), "DSW2") & 0xc0) << 2);
166         data = ((ioport("DSW2")->read() & 0xc0) << 2);
167167         break;
168168   }
169169
src/mame/drivers/hng64.c
r15082r15083
639639   switch (offset*4)
640640   {
641641      case 0x000: return 0x00000400;
642      case 0x004: return input_port_read(machine(), "SYSTEM");
643      case 0x008: return input_port_read(machine(), "P1_P2");
642      case 0x004: return ioport("SYSTEM")->read();
643      case 0x008: return ioport("P1_P2")->read();
644644      case 0x600: return m_no_machine_error_code;
645645   }
646646
r15082r15083
668668         else
669669            return 0x000;
670670      }
671      case 0x004: return input_port_read(machine(), "SYSTEM");
672      case 0x008: return input_port_read(machine(), "P1_P2");
671      case 0x004: return ioport("SYSTEM")->read();
672      case 0x008: return ioport("P1_P2")->read();
673673      case 0x600: return m_no_machine_error_code;
674674   }
675675
r15082r15083
696696      case 0x010:
697697      {
698698         /* Quick kludge for use the input test items */
699         if(input_port_read(machine(), "D_IN") & 0x01000000)
699         if(ioport("D_IN")->read() & 0x01000000)
700700            m_p1_trig = machine().rand() & 0x01000000;
701701
702         return (input_port_read(machine(), "D_IN") & ~0x01000000) | (m_p1_trig);
702         return (ioport("D_IN")->read() & ~0x01000000) | (m_p1_trig);
703703      }
704704      case 0x018:
705705      {
706706         UINT8 p1_x, p1_y, p2_x, p2_y;
707         p1_x = input_port_read(machine(), "LIGHT_P1_X") & 0xff;
708         p1_y = input_port_read(machine(), "LIGHT_P1_Y") & 0xff;
709         p2_x = input_port_read(machine(), "LIGHT_P2_X") & 0xff;
710         p2_y = input_port_read(machine(), "LIGHT_P2_Y") & 0xff;
707         p1_x = ioport("LIGHT_P1_X")->read() & 0xff;
708         p1_y = ioport("LIGHT_P1_Y")->read() & 0xff;
709         p2_x = ioport("LIGHT_P2_X")->read() & 0xff;
710         p2_y = ioport("LIGHT_P2_Y")->read() & 0xff;
711711
712712         return p1_x<<24 | p1_y<<16 | p2_x<<8 | p2_y;
713713      }
714714      case 0x01c:
715715      {
716716         UINT8 p3_x, p3_y;
717         p3_x = input_port_read(machine(), "LIGHT_P3_X") & 0xff;
718         p3_y = input_port_read(machine(), "LIGHT_P3_Y") & 0xff;
717         p3_x = ioport("LIGHT_P3_X")->read() & 0xff;
718         p3_y = ioport("LIGHT_P3_Y")->read() & 0xff;
719719
720720         return p3_x<<24 | p3_y<<16 | p3_x<<8 | p3_y; //FIXME: see what's the right bank here when the trigger works
721721      }
r15082r15083
741741         else
742742            return 0x000;
743743      }
744      case 0x004: return input_port_read(machine(), "SYSTEM");
745      case 0x008: return input_port_read(machine(), "P1_P2");
744      case 0x004: return ioport("SYSTEM")->read();
745      case 0x008: return ioport("P1_P2")->read();
746746      case 0x600: return m_no_machine_error_code;
747747   }
748748
r15082r15083
929929
930930   //printf("Q1 R : %.8x %.8x\n", offset, hng64_tcram[offset]);
931931   if(offset == 0x12)
932      return input_port_read(machine(), "VBLANK");
932      return ioport("VBLANK")->read();
933933
934934   return m_tcram[offset];
935935}
r15082r15083
12691269
12701270static INPUT_PORTS_START( hng64 )
12711271   PORT_START("VBLANK")
1272   PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_VBLANK )
1272   PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
12731273
12741274   PORT_START("IPT_TEST")
12751275   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r15082r15083
13451345
13461346static INPUT_PORTS_START( bbust2 )
13471347   PORT_START("VBLANK")
1348   PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_VBLANK )
1348   PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
13491349
13501350   PORT_START("D_IN")
13511351   PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_UNUSED )
src/mame/drivers/gladiatr.c
r15082r15083
202202
203203static READ8_HANDLER( gladiator_dsw1_r )
204204{
205   int orig = input_port_read(space->machine(), "DSW1")^0xff;
205   int orig = space->machine().root_device().ioport("DSW1")->read()^0xff;
206206
207207   return BITSWAP8(orig, 0,1,2,3,4,5,6,7);
208208}
209209
210210static READ8_HANDLER( gladiator_dsw2_r )
211211{
212   int orig = input_port_read(space->machine(), "DSW2")^0xff;
212   int orig = space->machine().root_device().ioport("DSW2")->read()^0xff;
213213
214214   return BITSWAP8(orig, 2,3,4,5,6,7,1,0);
215215}
r15082r15083
218218{
219219   int coins = 0;
220220
221   if( input_port_read(space->machine(), "COINS") & 0xc0 ) coins = 0x80;
221   if( space->machine().root_device().ioport("COINS")->read() & 0xc0 ) coins = 0x80;
222222   switch(offset)
223223   {
224224   case 0x01: /* start button , coins */
225      return input_port_read(space->machine(), "IN0") | coins;
225      return space->machine().root_device().ioport("IN0")->read() | coins;
226226   case 0x02: /* Player 1 Controller , coins */
227      return input_port_read(space->machine(), "IN1") | coins;
227      return space->machine().root_device().ioport("IN1")->read() | coins;
228228   case 0x04: /* Player 2 Controller , coins */
229      return input_port_read(space->machine(), "IN2") | coins;
229      return space->machine().root_device().ioport("IN2")->read() | coins;
230230   }
231231   /* unknown */
232232   return 0;
r15082r15083
237237   switch(offset)
238238   {
239239   case 0x01: /* button 3 */
240      return input_port_read(space->machine(), "IN3");
240      return space->machine().root_device().ioport("IN3")->read();
241241   }
242242   /* unknown */
243243   return 0;
src/mame/drivers/imolagp.c
r15082r15083
472472   imolagp_state *state = timer.machine().driver_data<imolagp_state>();
473473
474474   {
475      int newsteer = input_port_read(timer.machine(), "2802") & 0xf;
475      int newsteer = timer.machine().root_device().ioport("2802")->read() & 0xf;
476476      if (newsteer != state->m_oldsteer)
477477      {
478478         if (state->m_steerlatch == 0)
src/mame/drivers/cabal.c
r15082r15083
8484   static const char *const track_names[] = { "IN0", "IN1", "IN2", "IN3" };
8585
8686   for (i = 0; i < 4; i++)
87      m_last[i] = input_port_read(machine(), track_names[i]);
87      m_last[i] = ioport(track_names[i])->read();
8888}
8989
9090READ16_MEMBER(cabal_state::track_r)
r15082r15083
9393   switch (offset)
9494   {
9595      default:
96      case 0:   return (( input_port_read(machine(), "IN0") - m_last[0]) & 0x00ff)       | (((input_port_read(machine(), "IN2") - m_last[2]) & 0x00ff) << 8);   /* X lo */
97      case 1:   return (((input_port_read(machine(), "IN0") - m_last[0]) & 0xff00) >> 8) | (( input_port_read(machine(), "IN2") - m_last[2]) & 0xff00);         /* X hi */
98      case 2:   return (( input_port_read(machine(), "IN1") - m_last[1]) & 0x00ff)       | (((input_port_read(machine(), "IN3") - m_last[3]) & 0x00ff) << 8);   /* Y lo */
99      case 3:   return (((input_port_read(machine(), "IN1") - m_last[1]) & 0xff00) >> 8) | (( input_port_read(machine(), "IN3") - m_last[3]) & 0xff00);         /* Y hi */
96      case 0: return (( ioport("IN0")->read() - m_last[0]) & 0x00ff)           | (((ioport("IN2")->read() - m_last[2]) & 0x00ff) << 8);       /* X lo */
97      case 1: return (((ioport("IN0")->read() - m_last[0]) & 0xff00) >> 8) | (( ioport("IN2")->read() - m_last[2]) & 0xff00);                 /* X hi */
98      case 2: return (( ioport("IN1")->read() - m_last[1]) & 0x00ff)           | (((ioport("IN3")->read() - m_last[3]) & 0x00ff) << 8);       /* Y lo */
99      case 3: return (((ioport("IN1")->read() - m_last[1]) & 0xff00) >> 8) | (( ioport("IN3")->read() - m_last[3]) & 0xff00);                 /* Y hi */
100100   }
101101}
102102
r15082r15083
246246
247247static INPUT_PORTS_START( common )
248248   PORT_START("DSW")
249   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x00)
249   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x00)
250250   PORT_DIPSETTING(      0x000a, DEF_STR( 6C_1C ) )
251251   PORT_DIPSETTING(      0x000b, DEF_STR( 5C_1C ) )
252252   PORT_DIPSETTING(      0x000c, DEF_STR( 4C_1C ) )
r15082r15083
263263   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_5C ) )
264264   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_6C ) )
265265   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
266   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A )) PORT_DIPLOCATION("SW1:1,2") PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x00)
266   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A )) PORT_DIPLOCATION("SW1:1,2") PORT_CONDITION("DSW", 0x0010, EQUALS, 0x00)
267267   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
268268   PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
269269   PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
270270   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) )
271   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B )) PORT_DIPLOCATION("SW1:3,4") PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x00)
271   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B )) PORT_DIPLOCATION("SW1:3,4") PORT_CONDITION("DSW", 0x0010, EQUALS, 0x00)
272272   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_2C ) )
273273   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_3C ) )
274274   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_5C ) )
src/mame/drivers/vendetta.c
r15082r15083
134134      return;
135135
136136   /* EEPROM */
137   input_port_write(machine(), "EEPROMOUT", data, 0xff);
137   ioport("EEPROMOUT")->write(data, 0xff);
138138
139139   m_irq_enabled = (data >> 6) & 1;
140140
r15082r15083
322322   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
323323   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* EEPROM ready */
324324   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
325   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* not really vblank, object related. Its timed, otherwise sprites flicker */
325   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* not really vblank, object related. Its timed, otherwise sprites flicker */
326326   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
327327
328328   PORT_START( "EEPROMOUT" )
r15082r15083
378378   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
379379   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* EEPROM ready */
380380   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
381   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* not really vblank, object related. Its timed, otherwise sprites flicker */
381   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* not really vblank, object related. Its timed, otherwise sprites flicker */
382382   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
383383
384384   PORT_START( "EEPROMOUT" )
src/mame/drivers/segas16b.c
r15082r15083
11681168      case 0x1000/2:
11691169      {
11701170         static const char *const sysports[] = { "SERVICE", "P1", "UNUSED", "P2" };
1171         return input_port_read(space->machine(), sysports[offset & 3]);
1171         return space->machine().root_device().ioport(sysports[offset & 3])->read();
11721172      }
11731173
11741174      case 0x2000/2:
1175         return input_port_read(space->machine(), (offset & 1) ? "DSW1" : "DSW2");
1175         return space->machine().root_device().ioport((offset & 1) ? "DSW1" : "DSW2")->read();
11761176   }
11771177   logerror("%06X:standard_io_r - unknown read access to address %04X\n", cpu_get_pc(&space->device()), offset * 2);
11781178   return segaic16_open_bus_r(space, 0, mem_mask);
r15082r15083
14501450   }
14511451
14521452   /* read inputs */
1453   workram[inputoffs] = ~input_port_read(machine, "SERVICE") << 8;
1453   workram[inputoffs] = ~machine.root_device().ioport("SERVICE")->read() << 8;
14541454}
14551455
14561456static void altbeasj_i8751_sim(running_machine &machine)
r15082r15083
15341534   }
15351535
15361536   /* read inputs */
1537   workram[0x2cd0/2] = (input_port_read(machine, "P1") << 8) | input_port_read(machine, "P2");
1538   workram[0x2c96/2] = input_port_read(machine, "SERVICE") << 8;
1537   workram[0x2cd0/2] = (state->ioport("P1")->read() << 8) | state->ioport("P2")->read();
1538   workram[0x2c96/2] = machine.root_device().ioport("SERVICE")->read() << 8;
15391539}
15401540
15411541
r15082r15083
15571557   }
15581558
15591559   /* read inputs */
1560   workram[0x01e6/2] = input_port_read(machine, "SERVICE") << 8;
1561   workram[0x01e8/2] = input_port_read(machine, "P1") << 8;
1562   workram[0x01ea/2] = input_port_read(machine, "P2") << 8;
1560   workram[0x01e6/2] = machine.root_device().ioport("SERVICE")->read() << 8;
1561   workram[0x01e8/2] = machine.root_device().ioport("P1")->read() << 8;
1562   workram[0x01ea/2] = machine.root_device().ioport("P2")->read() << 8;
15631563}
15641564
15651565
r15082r15083
15911591
15921592static READ16_HANDLER( aceattac_custom_io_r )
15931593{
1594   segas1x_state *state = space->machine().driver_data<segas1x_state>();
15941595   switch (offset & (0x3000/2))
15951596   {
15961597      case 0x1000/2:
15971598         switch (offset & 3)
15981599         {
15991600            case 0x01:
1600               return input_port_read(space->machine(), "P1");
1601               return state->ioport("P1")->read();
16011602
16021603            case 0x02:
1603               return input_port_read(space->machine(), "DIAL1") | (input_port_read(space->machine(), "DIAL2") << 4);
1604               return state->ioport("DIAL1")->read() | (state->ioport("DIAL2")->read() << 4);
16041605               // low nibble: Sega 56pin Edge "16"-"19" // rotary switch 10positions 4bit-binary-pinout
16051606               // high nibble: Sega 56pin Edge "T"-"W"  // ditto
16061607
16071608            case 0x03:
1608               return input_port_read(space->machine(), "P2");
1609               return state->ioport("P2")->read();
16091610         }
16101611         break;
16111612      case 0x3000/2:
16121613         switch (offset & 3)
16131614         {
1614            case 0:   return input_port_read(space->machine(), "HANDX1");
1615            case 1:   return input_port_read(space->machine(), "TRACKX1");
1616            case 2:   return input_port_read(space->machine(), "TRACKY1");
1617            case 3:   return input_port_read(space->machine(), "HANDY1");
1618            case 4:   return input_port_read(space->machine(), "HANDX2");
1619            case 5:   return input_port_read(space->machine(), "TRACKX2");
1620            case 6:   return input_port_read(space->machine(), "TRACKY2");
1621            case 7:   return input_port_read(space->machine(), "HANDY2");
1615            case 0:   return state->ioport("HANDX1")->read();
1616            case 1:   return state->ioport("TRACKX1")->read();
1617            case 2:   return state->ioport("TRACKY1")->read();
1618            case 3:   return state->ioport("HANDY1")->read();
1619            case 4:   return state->ioport("HANDX2")->read();
1620            case 5:   return state->ioport("TRACKX2")->read();
1621            case 6:   return state->ioport("TRACKY2")->read();
1622            case 7:   return state->ioport("HANDY2")->read();
16221623         }
16231624         break;
16241625   }
r15082r15083
16561657
16571658static READ16_HANDLER( dunkshot_custom_io_r )
16581659{
1660   segas1x_state *state = space->machine().driver_data<segas1x_state>();
16591661   switch (offset & (0x3000/2))
16601662   {
16611663      case 0x3000/2:
16621664         switch ((offset/2) & 7)
16631665         {
1664            case 0:   return (input_port_read(space->machine(), "ANALOGX1") << 4) >> (8 * (offset & 1));
1665            case 1:   return (input_port_read(space->machine(), "ANALOGY1") << 4) >> (8 * (offset & 1));
1666            case 2:   return (input_port_read(space->machine(), "ANALOGX2") << 4) >> (8 * (offset & 1));
1667            case 3:   return (input_port_read(space->machine(), "ANALOGY2") << 4) >> (8 * (offset & 1));
1668            case 4:   return (input_port_read(space->machine(), "ANALOGX3") << 4) >> (8 * (offset & 1));
1669            case 5:   return (input_port_read(space->machine(), "ANALOGY3") << 4) >> (8 * (offset & 1));
1670            case 6:   return (input_port_read(space->machine(), "ANALOGX4") << 4) >> (8 * (offset & 1));
1671            case 7:   return (input_port_read(space->machine(), "ANALOGY4") << 4) >> (8 * (offset & 1));
1666            case 0:   return (state->ioport("ANALOGX1")->read() << 4) >> (8 * (offset & 1));
1667            case 1:   return (state->ioport("ANALOGY1")->read() << 4) >> (8 * (offset & 1));
1668            case 2:   return (state->ioport("ANALOGX2")->read() << 4) >> (8 * (offset & 1));
1669            case 3:   return (state->ioport("ANALOGY2")->read() << 4) >> (8 * (offset & 1));
1670            case 4:   return (state->ioport("ANALOGX3")->read() << 4) >> (8 * (offset & 1));
1671            case 5:   return (state->ioport("ANALOGY3")->read() << 4) >> (8 * (offset & 1));
1672            case 6:   return (state->ioport("ANALOGX4")->read() << 4) >> (8 * (offset & 1));
1673            case 7:   return (state->ioport("ANALOGY4")->read() << 4) >> (8 * (offset & 1));
16721674         }
16731675         break;
16741676   }
r15082r15083
17141716         switch (offset & 0x30/2)
17151717         {
17161718            case 0x20/2:
1717               state->m_hwc_input_value = input_port_read_safe(space->machine(), portname[offset & 3], 0xff);
1719               state->m_hwc_input_value = state->ioport(portname[offset & 3])->read_safe(0xff);
17181720               break;
17191721
17201722            case 0x30/2:
r15082r15083
17411743
17421744static READ16_HANDLER( passshtj_custom_io_r )
17431745{
1746   segas1x_state *state = space->machine().driver_data<segas1x_state>();
17441747   switch (offset & (0x3000/2))
17451748   {
17461749      case 0x3000/2:
17471750         switch (offset & 3)
17481751         {
1749            case 0:   return input_port_read(space->machine(), "P1");
1750            case 1:   return input_port_read(space->machine(), "P2");
1751            case 2:   return input_port_read(space->machine(), "P3");
1752            case 3:   return input_port_read(space->machine(), "P4");
1752            case 0:   return state->ioport("P1")->read();
1753            case 1:   return state->ioport("P2")->read();
1754            case 2:   return state->ioport("P3")->read();
1755            case 3:   return state->ioport("P4")->read();
17531756         }
17541757         break;
17551758   }
r15082r15083
17661769
17671770static READ16_HANDLER( sdi_custom_io_r )
17681771{
1772   segas1x_state *state = space->machine().driver_data<segas1x_state>();
17691773   switch (offset & (0x3000/2))
17701774   {
17711775      case 0x3000/2:
17721776         switch ((offset/2) & 3)
17731777         {
1774            case 0:   return input_port_read(space->machine(), "ANALOGX1");
1775            case 1:   return input_port_read(space->machine(), "ANALOGY1");
1776            case 2:   return input_port_read(space->machine(), "ANALOGX2");
1777            case 3:   return input_port_read(space->machine(), "ANALOGY2");
1778            case 0:   return state->ioport("ANALOGX1")->read();
1779            case 1:   return state->ioport("ANALOGY1")->read();
1780            case 2:   return state->ioport("ANALOGX2")->read();
1781            case 3:   return state->ioport("ANALOGY2")->read();
17781782         }
17791783         break;
17801784   }
r15082r15083
18001804         switch (offset & 3)
18011805         {
18021806            case 1:
1803               if (input_port_read_safe(space->machine(), portname[state->m_mj_input_num], 0xff) != 0xff)
1807               if (state->ioport(portname[state->m_mj_input_num])->read_safe(0xff) != 0xff)
18041808                  return 0xff & ~(1 << state->m_mj_input_num);
18051809               return 0xff;
18061810
18071811            case 2:
1808               return input_port_read_safe(space->machine(), portname[state->m_mj_input_num], 0xff);
1812               return state->ioport(portname[state->m_mj_input_num])->read_safe(0xff);
18091813         }
18101814         break;
18111815   }
src/mame/drivers/saturn.c
r15082r15083
830830}
831831
832832#define SATURN_PAD_P1(_mask_, _val_) \
833   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
834   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
835   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
836   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
837   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
838   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
839   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 C") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
840   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
841   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P1 R") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
842   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
843   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
844   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Z") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
845   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P1 L") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
846   PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) //read '1' when direct mode is polled
833   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
834   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
835   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
836   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
837   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
838   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
839   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 C") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
840   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
841   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P1 R") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
842   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
843   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
844   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Z") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
845   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P1 L") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
846   PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) //read '1' when direct mode is polled
847847
848848#define SATURN_PAD_P2(_mask_, _val_) \
849   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
850   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
851   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
852   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
853   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
854   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
855   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 C") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
856   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
857   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P2 R") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
858   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 X") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
859   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Y") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
860   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Z") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
861   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P2 L") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
862   PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) //read '1' when direct mode is polled
849   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
850   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
851   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
852   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
853   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
854   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
855   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 C") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
856   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
857   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P2 R") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
858   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 X") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
859   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Y") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
860   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Z") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
861   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P2 L") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
862   PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) //read '1' when direct mode is polled
863863
864864#define MD_PAD_P1(_mask_, _val_) \
865   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
866   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
867   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
868   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
869   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
870   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
871   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 C") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
872   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
873   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P1 Mode") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
874   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
875   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
876   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Z") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
877   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) //read '1' when direct mode is polled
865   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
866   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
867   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
868   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
869   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
870   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
871   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 C") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
872   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
873   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P1 Mode") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
874   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
875   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
876   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Z") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
877   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) //read '1' when direct mode is polled
878878
879879#define MD_PAD_P2(_mask_, _val_) \
880   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
881   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
882   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
883   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
884   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
885   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
886   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 C") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
887   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
888   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P2 Mode") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
889   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 X") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
890   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Y") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
891   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Z") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
892   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) //read '1' when direct mode is polled
880   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
881   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
882   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
883   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
884   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
885   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
886   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 C") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
887   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
888   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P2 Mode") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
889   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 X") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
890   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Y") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
891   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Z") PORT_PLAYER(2)   PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
892   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) //read '1' when direct mode is polled
893893
894#define SATURN_KEYBOARD   PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x05)
894#define SATURN_KEYBOARD   PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x05)
895895
896896INPUT_CHANGED_MEMBER(saturn_state::nmi_reset)
897897{
r15082r15083
10981098   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
10991099
11001100   PORT_START("MOUSEB1")
1101   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)
1102   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)
1103   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)
1104   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)
1105   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)
1106   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)
1107   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)
1108   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)
1101   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Pointer Left Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x04)
1102   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Pointer Right Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x04)
1103   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Pointer Middle Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x04)
1104   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P1 Pointer Start Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x04)
1105   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Mouse Left Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x08)
1106   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Mouse Right Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x08)
1107   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Mouse Middle Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x08)
1108   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P1 Mouse Start Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x08)
11091109
11101110   PORT_START("MOUSEX1")
1111    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)
1112   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)
1111    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)
1112   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)
11131113
11141114   PORT_START("MOUSEY1")
1115    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)
1116   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)
1115    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)
1116   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)
11171117
11181118   PORT_START("MOUSEB2")
1119   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)
1120   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)
1121   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)
1122   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)
1123   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)
1124   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)
1125   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)
1126   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)
1119   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Pointer Left Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x40)
1120   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Pointer Right Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x40)
1121   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Pointer Middle Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x40)
1122   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P2 Pointer Start Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x40)
1123   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Mouse Left Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x80)
1124   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Mouse Right Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x80)
1125   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Mouse Middle Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x80)
1126   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P2 Mouse Start Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x80)
11271127
11281128   PORT_START("MOUSEX2")
1129    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)
1130   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)
1129    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)
1130   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)
11311131
11321132   PORT_START("MOUSEY2")
1133    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)
1134   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)
1133    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)
1134   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)
11351135
11361136   PORT_START("AN_JOY1")
11371137   SATURN_PAD_P1(0x0f, 0x01)   // racing device
r15082r15083
11421142   SATURN_PAD_P2(0xf0, 0x20)   // analog controller
11431143
11441144   PORT_START("AN_X1")
1145   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)
1146   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)
1145   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)
1146   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)
11471147
11481148   PORT_START("AN_Y1")
1149   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)
1150   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)
1149   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)
1150   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)
11511151
11521152   PORT_START("AN_Z1")
1153   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)
1154   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)
1153   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)
1154   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)
11551155
11561156   PORT_START("AN_X2")
1157   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)
1158   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)
1157   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)
1158   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)
11591159
11601160   PORT_START("AN_Y2")
1161   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)
1162   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)
1161   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)
1162   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)
11631163
11641164   PORT_START("AN_Z2")
1165   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)
1166   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)
1165   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)
1166   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)
11671167
11681168   PORT_START("MD_JOY1")
11691169   MD_PAD_P1(0x0f, 0x06)   // MD 3 buttons pad
r15082r15083
14681468   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
14691469
14701470   PORT_MODIFY("PORTC")
1471   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1472   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1471   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1472   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
14731473   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
14741474
14751475   PORT_MODIFY("PORTE")
r15082r15083
14791479   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
14801480
14811481   PORT_START("P1_KEY0")
1482   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1483   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1484   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1485   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1486   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1487   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1488   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_M )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1489   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_I )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1490   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1482   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1483   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1484   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1485   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1486   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1487   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1488   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_M )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1489   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_I )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1490   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
14911491
14921492   PORT_START("P1_KEY1")
1493   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1494   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_BET )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1495   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1496   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1497   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_F )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1498   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_B )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1499   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_N )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1500   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_J )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1501   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1493   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1494   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_BET )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1495   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1496   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1497   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_F )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1498   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_B )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1499   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_N )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1500   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_J )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1501   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
15021502
15031503   PORT_START("P1_KEY2")
1504   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1505   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1506   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1507   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1508   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_G )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1509   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_C )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1510   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1511   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_K )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1512   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1504   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1505   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1506   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1507   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1508   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_G )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1509   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_C )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1510   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1511   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_K )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1512   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )  PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
15131513
15141514   PORT_START("P1_KEY3")
1515   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1516   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1517   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1518   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1519   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1520   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1521   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1522   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
1523   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1524   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1525   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1526   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1527   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1528   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1529   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1530   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
1515   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1516   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1517   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1518   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1519   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1520   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1521   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1522   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
1523   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
1524   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
1525   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
1526   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
1527   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
1528   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
1529   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
1530   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
15311531
15321532   PORT_START("P1_KEY4")
15331533   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) /* F/F is there, but these two games are single player so it isn't connected */
r15082r15083
20552055
20562056   stvcd_reset( machine );
20572057
2058   state->m_cart_type = input_port_read(machine,"CART_AREA") & 7;
2058   state->m_cart_type = state->ioport("CART_AREA")->read() & 7;
20592059
20602060   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02400000, 0x027fffff, FUNC(saturn_null_ram_r), FUNC(saturn_null_ram_w));
20612061   machine.device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02400000, 0x027fffff, FUNC(saturn_null_ram_r), FUNC(saturn_null_ram_w));
src/mame/drivers/pktgaldx.c
r15082r15083
162162   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
163163   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
164164   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
165   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
165   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
166166   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
167167   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
168168   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/atarigx2.c
r15082r15083
6767
6868READ32_MEMBER(atarigx2_state::special_port2_r)
6969{
70   int temp = input_port_read(machine(), "SERVICE");
70   int temp = ioport("SERVICE")->read();
7171   if (m_cpu_to_sound_ready) temp ^= 0x0020;
7272   if (m_sound_to_cpu_ready) temp ^= 0x0010;
7373   temp ^= 0x0008;      /* A2D.EOC always high for now */
r15082r15083
7777
7878READ32_MEMBER(atarigx2_state::special_port3_r)
7979{
80   int temp = input_port_read(machine(), "SPECIAL");
80   int temp = ioport("SPECIAL")->read();
8181   return (temp << 16) | temp;
8282}
8383
r15082r15083
8989   switch (offset)
9090   {
9191      case 0:
92         return (input_port_read(machine(), "A2D0") << 24) | (input_port_read(machine(), "A2D1") << 8);
92         return (ioport("A2D1")->read() << 8);
9393      case 1:
94         return (input_port_read(machine(), "A2D2") << 24) | (input_port_read(machine(), "A2D3") << 8);
94         return (ioport("A2D3")->read() << 8);
9595   }
9696
9797   return 0;
r15082r15083
12051205   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL )   /* /AUDIRQ */
12061206   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )   /* /AUDFULL */
12071207   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
1208   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
1208   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
12091209   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
12101210
12111211   PORT_START("SPECIAL")     /* 68.STATUS (A2=1) */
r15082r15083
12531253   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL )   /* /AUDIRQ */
12541254   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )   /* /AUDFULL */
12551255   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
1256   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
1256   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
12571257   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
12581258
12591259   PORT_START("SPECIAL")      /* 68.STATUS (A2=1) */
r15082r15083
13011301   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL )   /* /AUDIRQ */
13021302   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )   /* /AUDFULL */
13031303   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
1304   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
1304   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
13051305   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
13061306
13071307   PORT_START("SPECIAL")      /* 68.STATUS (A2=1) */
src/mame/drivers/nwk-tr.c
r15082r15083
296296   {
297297      if (ACCESSING_BITS_24_31)
298298      {
299         r |= input_port_read(machine(), "IN0") << 24;
299         r |= ioport("IN0")->read() << 24;
300300      }
301301      if (ACCESSING_BITS_16_23)
302302      {
303         r |= input_port_read(machine(), "IN1") << 16;
303         r |= ioport("IN1")->read() << 16;
304304      }
305305      if (ACCESSING_BITS_8_15)
306306      {
307         r |= input_port_read(machine(), "IN2") << 8;
307         r |= ioport("IN2")->read() << 8;
308308      }
309309      if (ACCESSING_BITS_0_7)
310310      {
r15082r15083
315315   {
316316      if (ACCESSING_BITS_24_31)
317317      {
318         r |= input_port_read(machine(), "DSW") << 24;
318         r |= ioport("DSW")->read() << 24;
319319      }
320320   }
321321   return r;
r15082r15083
625625   int value = 0;
626626   switch (input)
627627   {
628      case 0:      value = input_port_read(device->machine(), "ANALOG1") - 0x800; break;
629      case 1:      value = input_port_read(device->machine(), "ANALOG2"); break;
630      case 2:      value = input_port_read(device->machine(), "ANALOG3"); break;
631      case 3:      value = input_port_read(device->machine(), "ANALOG4"); break;
632      case 4:      value = input_port_read(device->machine(), "ANALOG5"); break;
628      case 0:      value = device->machine().root_device().ioport("ANALOG1")->read() - 0x800; break;
629      case 1:      value = device->machine().root_device().ioport("ANALOG2")->read(); break;
630      case 2:      value = device->machine().root_device().ioport("ANALOG3")->read(); break;
631      case 3:      value = device->machine().root_device().ioport("ANALOG4")->read(); break;
632      case 4:      value = device->machine().root_device().ioport("ANALOG5")->read(); break;
633633   }
634634
635635   return (double)(value) / 2047.0;
src/mame/drivers/circus.c
r15082r15083
5454{
5555   // also clears irq
5656   cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
57   return input_port_read(machine(), "PADDLE");
57   return ioport("PADDLE")->read();
5858}
5959
6060static ADDRESS_MAP_START( circus_map, AS_PROGRAM, 8, circus_state )
r15082r15083
9696   PORT_DIPSETTING(   0x00, "Single Line" )
9797   PORT_DIPSETTING(   0x20, "Super Bonus" )
9898   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "14A:1" ) /* Not mentioned in the manual */
99   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
99   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
100100
101101   PORT_START("PADDLE")
102102   PORT_BIT( 0xff, 115, IPT_PADDLE ) PORT_MINMAX(64,167) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_CENTERDELTA(0)
r15082r15083
130130   PORT_DIPSETTING(   0x20, "5 seconds" )
131131   PORT_DIPSETTING(   0x40, "7 seconds" )
132132   PORT_DIPSETTING(   0x60, "9 seconds" )
133   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
133   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
134134
135135   PORT_START("PADDLE")
136136   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED)
r15082r15083
164164   PORT_DIPSETTING(   0x10, "Credit Awarded" )
165165   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "14A:2" ) /* Not mentioned in the manual */
166166   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "14A:1" ) /* Not mentioned in the manual */
167   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
167   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
168168
169169   PORT_START("PADDLE")
170170   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED)
r15082r15083
204204   PORT_DIPSETTING(   0x00, "No Award" )
205205   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "14A:2" ) /* Not mentioned in the manual */
206206   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "14A:1" ) /* Not mentioned in the manual */
207   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
207   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
208208
209209   PORT_START("PADDLE")
210210   PORT_BIT( 0xff, 115, IPT_PADDLE ) PORT_MINMAX(64,167) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE
src/mame/drivers/zac2650.c
r15082r15083
7979   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
8080
8181   PORT_START("SENSE")
82   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
82   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
8383
8484   PORT_START("1E85")
8585   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
147147   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
148148
149149   PORT_START("SENSE")
150   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
150   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
151151
152152   PORT_START("1E85")
153153   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
src/mame/drivers/relief.c
r15082r15083
9595
9696READ16_MEMBER(relief_state::special_port2_r)
9797{
98   int result = input_port_read(machine(), "260010");
98   int result = ioport("260010")->read();
9999   if (m_cpu_to_sound_ready) result ^= 0x0020;
100100   if (!(result & 0x0080) || atarigen_get_hblank(*machine().primary_screen)) result ^= 0x0001;
101101   return result;
r15082r15083
235235   PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNUSED )
236236   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )   /* tested before writing to 260040 */
237237   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
238   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
238   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
239239   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
240240
241241   PORT_START("260012")   /* 260012 */
src/mame/drivers/taito_f3.c
r15082r15083
4646   const char *tag = (const char *)param;
4747   UINT32 ipt = 0;
4848
49   ipt = ((input_port_read(machine(), tag) & 0xf)<<12) | ((input_port_read(machine(), tag) & 0xff0)>>4);
49   ipt = ((ioport(tag)->read() & 0xf)<<12) | ((ioport(tag)->read() & 0xff0)>>4);
5050
5151   return ipt;
5252}
r15082r15083
6262   static const char *const iptnames[] = { "IN0", "IN1", "AN0", "AN1", "IN2", "IN3" };
6363
6464   if (offset < 6)
65      return input_port_read(machine(), iptnames[offset]);
65      return ioport(iptnames[offset])->read();
6666
6767   logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n", cpu_get_pc(&space.device()), offset);
6868   return 0xffffffff;
r15082r15083
9090      case 0x04: /* Eeprom */
9191         if (ACCESSING_BITS_0_7)
9292         {
93            input_port_write(machine(), "EEPROMOUT", data, 0xff);
93            ioport("EEPROMOUT")->write(data, 0xff);
9494         }
9595         return;
9696
src/mame/drivers/jpmsys5.c
r15082r15083
257257READ16_MEMBER(jpmsys5_state::coins_r)
258258{
259259   if (offset == 2)
260      return input_port_read(machine(), "COINS") << 8;
260      return ioport("COINS")->read() << 8;
261261   else
262262      return 0xffff;
263263}
r15082r15083
280280READ16_MEMBER(jpmsys5_state::mux_r)
281281{
282282   if (offset == 0x81/2)
283      return input_port_read(machine(), "DSW");
283      return ioport("DSW")->read();
284284
285285   return 0xffff;
286286}
r15082r15083
410410
411411      /* Each touch screen packet is 3 bytes */
412412      m_touch_data[0] = 0x2a;
413      m_touch_data[1] = 0x7 - (input_port_read(machine(), "TOUCH_Y") >> 5) + 0x30;
414      m_touch_data[2] = (input_port_read(machine(), "TOUCH_X") >> 5) + 0x30;
413      m_touch_data[1] = 0x7 - (ioport("TOUCH_Y")->read() >> 5) + 0x30;
414      m_touch_data[2] = (ioport("TOUCH_X")->read() >> 5) + 0x30;
415415
416416      /* Start sending the data to the 68000 serially */
417417      m_touch_data_count = 0;
src/mame/drivers/gaelco2.c
r15082r15083
206206                                BANG
207207  ============================================================================*/
208208
209READ16_MEMBER(gaelco2_state::p1_gun_x){return (input_port_read(machine(), "LIGHT0_X") * 320 / 0x100) + 1;}
210READ16_MEMBER(gaelco2_state::p1_gun_y){return (input_port_read(machine(), "LIGHT0_Y") * 240 / 0x100) - 4;}
211READ16_MEMBER(gaelco2_state::p2_gun_x){return (input_port_read(machine(), "LIGHT1_X") * 320 / 0x100) + 1;}
212READ16_MEMBER(gaelco2_state::p2_gun_y){return (input_port_read(machine(), "LIGHT1_Y") * 240 / 0x100) - 4;}
209READ16_MEMBER(gaelco2_state::p1_gun_x){return (ioport("LIGHT0_X")->read() * 320 / 0x100) + 1;}
210READ16_MEMBER(gaelco2_state::p1_gun_y){return (ioport("LIGHT0_Y")->read() * 240 / 0x100) - 4;}
211READ16_MEMBER(gaelco2_state::p2_gun_x){return (ioport("LIGHT1_X")->read() * 320 / 0x100) + 1;}
212READ16_MEMBER(gaelco2_state::p2_gun_y){return (ioport("LIGHT1_Y")->read() * 240 / 0x100) - 4;}
213213
214214static ADDRESS_MAP_START( bang_map, AS_PROGRAM, 16, gaelco2_state )
215215    AM_RANGE(0x000000, 0x0fffff) AM_ROM                                                         /* ROM */
src/mame/drivers/ssozumo.c
r15082r15083
129129   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Controls ) )
130130   PORT_DIPSETTING(    0x00, DEF_STR( Single ) )
131131   PORT_DIPSETTING(    0x40, DEF_STR( Dual ) )
132   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
132   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
133133INPUT_PORTS_END
134134
135135
src/mame/drivers/m107.c
r15082r15083
202202   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
203203   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE )
204204   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
205   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
205   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
206206
207207   /* DIP switch bank 3 */
208208   PORT_DIPUNKNOWN_DIPLOC( 0x0100, 0x0100, "SW3:1" )
r15082r15083
369369   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
370370   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE )
371371   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
372   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
372   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
373373   PORT_DIPNAME( 0x0100, 0x0000, "DSW3" )
374374   PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
375375   PORT_DIPSETTING(    0x0100, DEF_STR( On ) )
src/mame/drivers/arkanoid.c
r15082r15083
16431643static DRIVER_INIT( tetrsark )
16441644{
16451645   arkanoid_state *state = machine.driver_data<arkanoid_state>();
1646   UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
1646   UINT8 *ROM = state->memregion("maincpu")->base();
16471647   int x;
16481648
16491649   for (x = 0; x < 0x8000; x++)
src/mame/drivers/twin16.c
r15082r15083
176176{
177177   switch( offset )
178178   {
179      case 0x00: return input_port_read(machine(), "SYSTEM");
180      case 0x01: return input_port_read(machine(), "P1");
181      case 0x02: return input_port_read(machine(), "P2");
182      case 0x03: return input_port_read(machine(), "P3");
183      case 0x08: return input_port_read(machine(), "DSW2");
184      case 0x09: return input_port_read(machine(), "DSW1");
185      case 0x0c: return input_port_read(machine(), "DSW3");
179      case 0x00: return ioport("SYSTEM")->read();
180      case 0x01: return ioport("P1")->read();
181      case 0x02: return ioport("P2")->read();
182      case 0x03: return ioport("P3")->read();
183      case 0x08: return ioport("DSW2")->read();
184      case 0x09: return ioport("DSW1")->read();
185      case 0x0c: return ioport("DSW3")->read();
186186      default: break;
187187   }
188188   return 0;
src/mame/drivers/megasys1.c
r15082r15083
237237
238238   switch (i)
239239   {
240         case 0 :   return input_port_read(machine(), "SYSTEM");
241         case 1 :   return input_port_read(machine(), "P1");
242         case 2 :   return input_port_read(machine(), "P2");
243         case 3 :   return input_port_read(machine(), "DSW1");
244         case 4 :   return input_port_read(machine(), "DSW2");
240         case 0 :   return ioport("SYSTEM")->read();
241         case 1 :   return ioport("P1")->read();
242         case 2 :   return ioport("P2")->read();
243         case 3 :   return ioport("DSW1")->read();
244         case 4 :   return ioport("DSW2")->read();
245245         default    :   return 0x0006;
246246   }
247247}
r15082r15083
13671367   switch (m_protection_val)
13681368   {
13691369      case 0x02:   return 0x03;
1370      case 0x51:   return input_port_read(machine(), "P1");
1371      case 0x52:   return input_port_read(machine(), "P2");
1370      case 0x51:   return ioport("P1")->read();
1371      case 0x52:   return ioport("P2")->read();
13721372      default:   return m_protection_val;
13731373   }
13741374}
r15082r15083
38013801      case 0x04/2:
38023802      case 0x06/2:
38033803      case 0x08/2:
3804      case 0x0a/2: res = input_port_read(machine(), in_names[offset-1]); break;
3804      case 0x0a/2: res = ioport(in_names[offset-1])->read(); break;
38053805   }
38063806
38073807   return res;
r15082r15083
40174017      case 0x04/2:
40184018      case 0x06/2:
40194019      case 0x08/2:
4020      case 0x0a/2: res = input_port_read(machine(), in_names[offset-1]); break;
4020      case 0x0a/2: res = ioport(in_names[offset-1])->read(); break;
40214021   }
40224022
40234023   return res;
src/mame/drivers/crshrace.c
r15082r15083
271271   PORT_DIPNAME( 0x0100, 0x0100, "Coin Slot" ) PORT_DIPLOCATION("SW1:1")
272272   PORT_DIPSETTING(      0x0100, "Same" )
273273   PORT_DIPSETTING(      0x0000, "Individual" )
274   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3,4") PORT_CONDITION("DSW0", 0x0100, PORTCOND_EQUALS, 0x0100)
274   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3,4") PORT_CONDITION("DSW0", 0x0100, EQUALS, 0x0100)
275275   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
276276   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
277277   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
r15082r15083
280280   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
281281   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
282282   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
283   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7") PORT_CONDITION("DSW0", 0x0100, PORTCOND_EQUALS, 0x0100)
283   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7") PORT_CONDITION("DSW0", 0x0100, EQUALS, 0x0100)
284284   PORT_DIPSETTING(      0x5000, DEF_STR( 3C_1C ) )
285285   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
286286   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
r15082r15083
289289   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
290290   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_5C ) )
291291   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
292   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4") PORT_CONDITION("DSW0", 0x0100, PORTCOND_NOTEQUALS, 0x0100)
292   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4") PORT_CONDITION("DSW0", 0x0100, NOTEQUALS, 0x0100)
293293   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
294294   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
295295   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
r15082r15083
298298   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
299299   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
300300   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
301   PORT_DIPUNUSED_DIPLOC( 0x7000, 0x7000, "SW1:5,6,7") PORT_CONDITION("DSW0", 0x0100, PORTCOND_NOTEQUALS, 0x0100)
301   PORT_DIPUNUSED_DIPLOC( 0x7000, 0x7000, "SW1:5,6,7") PORT_CONDITION("DSW0", 0x0100, NOTEQUALS, 0x0100)
302302   PORT_DIPNAME( 0x8000, 0x8000, "2 to Start, 1 to Cont." ) PORT_DIPLOCATION("SW1:8")   // Other desc. was too long !
303303   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
304304   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
src/mame/drivers/airbustr.c
r15082r15083
439439   PORT_DIPSETTING(    0x08, "Mode 1" )         //     routine at 0x056d: 11 21 12 16 (bit 3 active)
440440   PORT_DIPSETTING(    0x00, "Mode 2" )         //     11 21 13 14 (bit 3 not active)
441441   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:5,6")
442   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
443   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
444   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
445   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
446   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
447   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
448   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
449   PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
442   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
443   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
444   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
445   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
446   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
447   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
448   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
449   PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
450450   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:7,8")
451   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
452   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
453   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
454   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
455   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
456   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
457   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
458   PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
451   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
452   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
453   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
454   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
455   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
456   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
457   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
458   PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
459459
460460   PORT_START("DSW2")
461461   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:1,2")
r15082r15083
571571static MACHINE_START( airbustr )
572572{
573573   airbustr_state *state = machine.driver_data<airbustr_state>();
574   UINT8 *MASTER = machine.root_device().memregion("master")->base();
575   UINT8 *SLAVE = machine.root_device().memregion("slave")->base();
574   UINT8 *MASTER = state->memregion("master")->base();
575   UINT8 *SLAVE = state->memregion("slave")->base();
576576   UINT8 *AUDIO = state->memregion("audiocpu")->base();
577577
578578   state->membank("bank1")->configure_entries(0, 3, &MASTER[0x00000], 0x4000);
src/mame/drivers/pacman.c
r15082r15083
374374static MACHINE_RESET( mschamp )
375375{
376376   UINT8 *rom = machine.root_device().memregion("maincpu")->base() + 0x10000;
377   int whichbank = input_port_read(machine, "GAME") & 1;
377   int whichbank = machine.root_device().ioport("GAME")->read() & 1;
378378
379379   machine.root_device().membank("bank1")->configure_entries(0, 2, &rom[0x0000], 0x8000);
380380   machine.root_device().membank("bank2")->configure_entries(0, 2, &rom[0x4000], 0x8000);
r15082r15083
541541
542542READ8_MEMBER(pacman_state::maketrax_special_port2_r)
543543{
544   int data = input_port_read(machine(), "DSW1");
544   int data = ioport("DSW1")->read();
545545   int pc = cpu_get_previouspc(&space.device());
546546
547547   if ((pc == 0x1973) || (pc == 0x2389)) return data | 0x40;
r15082r15083
584584
585585READ8_MEMBER(pacman_state::korosuke_special_port2_r)
586586{
587   int data = input_port_read(machine(), "DSW1");
587   int data = ioport("DSW1")->read();
588588   int pc = cpu_get_previouspc(&space.device());
589589
590590   if ((pc == 0x196e) || (pc == 0x2387)) return data | 0x40;
r15082r15083
28062806   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
28072807
28082808   PORT_START("Sense")
2809   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
2809   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
28102810INPUT_PORTS_END
28112811
28122812
r15082r15083
28582858   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
28592859
28602860   PORT_START("Sense")
2861   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
2861   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
28622862INPUT_PORTS_END
28632863
28642864
r15082r15083
29102910   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
29112911
29122912   PORT_START("Sense")
2913   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
2913   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
29142914INPUT_PORTS_END
29152915
29162916
src/mame/drivers/igs011.c
r15082r15083
540540
541541   for (i = 0; i < NUM; i++)
542542      if ((~m_igs_dips_sel) & (1 << i) )
543         ret = input_port_read(machine(), dipnames[i]);
543         ret = ioport(dipnames[i])->read();
544544   /* 0x0100 is blitter busy */
545545   return   (ret & 0xff) | 0x0000;
546546}
r15082r15083
13731373{
13741374   switch(m_igs003_reg[0])
13751375   {
1376      case 0x00:   return input_port_read(machine(), "IN0");
1377      case 0x01:   return input_port_read(machine(), "IN1");
1378      case 0x02:   return input_port_read(machine(), "IN2");
1376      case 0x00:   return ioport("IN0")->read();
1377      case 0x01:   return ioport("IN1")->read();
1378      case 0x02:   return ioport("IN2")->read();
13791379
13801380      case 0x20:   return 0x49;
13811381      case 0x21:   return 0x47;
r15082r15083
14311431      case 0:      return m_igs_input_sel;
14321432
14331433      case 1:
1434         if (~m_igs_input_sel & 0x01)   return input_port_read(machine(), "KEY0");
1435         if (~m_igs_input_sel & 0x02)   return input_port_read(machine(), "KEY1");
1436         if (~m_igs_input_sel & 0x04)   return input_port_read(machine(), "KEY2");
1437         if (~m_igs_input_sel & 0x08)   return input_port_read(machine(), "KEY3");
1438         if (~m_igs_input_sel & 0x10)   return input_port_read(machine(), "KEY4");
1434         if (~m_igs_input_sel & 0x01)   return ioport("KEY0")->read();
1435         if (~m_igs_input_sel & 0x02)   return ioport("KEY1")->read();
1436         if (~m_igs_input_sel & 0x04)   return ioport("KEY2")->read();
1437         if (~m_igs_input_sel & 0x08)   return ioport("KEY3")->read();
1438         if (~m_igs_input_sel & 0x10)   return ioport("KEY4")->read();
14391439
14401440         logerror("%06x: warning, reading with igs_input_sel = %02x\n", cpu_get_pc(&space.device()), m_igs_input_sel);
14411441         break;
r15082r15083
14941494   switch(m_igs003_reg[0])
14951495   {
14961496      case 0x01:
1497         if (~m_igs_input_sel & 0x01)   return input_port_read(machine(), "KEY0");
1498         if (~m_igs_input_sel & 0x02)   return input_port_read(machine(), "KEY1");
1499         if (~m_igs_input_sel & 0x04)   return input_port_read(machine(), "KEY2");
1500         if (~m_igs_input_sel & 0x08)   return input_port_read(machine(), "KEY3");
1501         if (~m_igs_input_sel & 0x10)   return input_port_read(machine(), "KEY4");
1497         if (~m_igs_input_sel & 0x01)   return ioport("KEY0")->read();
1498         if (~m_igs_input_sel & 0x02)   return ioport("KEY1")->read();
1499         if (~m_igs_input_sel & 0x04)   return ioport("KEY2")->read();
1500         if (~m_igs_input_sel & 0x08)   return ioport("KEY3")->read();
1501         if (~m_igs_input_sel & 0x10)   return ioport("KEY4")->read();
15021502         /* fall through */
15031503      default:
15041504         logerror("%06x: warning, reading with igs003_reg = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0]);
r15082r15083
15731573{
15741574   switch(m_igs003_reg[0])
15751575   {
1576      case 0x00:   return input_port_read(machine(), "IN0");
1576      case 0x00:   return ioport("IN0")->read();
15771577
15781578      case 0x20:   return 0x49;
15791579      case 0x21:   return 0x47;
r15082r15083
16391639{
16401640   switch(m_igs003_reg[0])
16411641   {
1642      case 0x00:   return input_port_read(machine(), "COIN");
1642      case 0x00:   return ioport("COIN")->read();
16431643
16441644      case 0x02:
1645         if (~m_igs_input_sel & 0x01)   return input_port_read(machine(), "KEY0");
1646         if (~m_igs_input_sel & 0x02)   return input_port_read(machine(), "KEY1");
1647         if (~m_igs_input_sel & 0x04)   return input_port_read(machine(), "KEY2");
1648         if (~m_igs_input_sel & 0x08)   return input_port_read(machine(), "KEY3");
1649         if (~m_igs_input_sel & 0x10)   return input_port_read(machine(), "KEY4");
1645         if (~m_igs_input_sel & 0x01)   return ioport("KEY0")->read();
1646         if (~m_igs_input_sel & 0x02)   return ioport("KEY1")->read();
1647         if (~m_igs_input_sel & 0x04)   return ioport("KEY2")->read();
1648         if (~m_igs_input_sel & 0x08)   return ioport("KEY3")->read();
1649         if (~m_igs_input_sel & 0x10)   return ioport("KEY4")->read();
16501650         /* fall through */
16511651
16521652      case 0x20:   return 0x49;
r15082r15083
17111711{
17121712   switch(m_igs003_reg[0])
17131713   {
1714      case 0x00:   return input_port_read(machine(), "IN0");
1715      case 0x01:   return input_port_read(machine(), "IN1");
1714      case 0x00:   return ioport("IN0")->read();
1715      case 0x01:   return ioport("IN1")->read();
17161716
17171717//      case 0x03:
17181718//          return 0xff;    // parametric bitswaps?
r15082r15083
24082408   {
24092409      igs011_state *state = screen.machine().driver_data<igs011_state>();
24102410      state->m_vbowl_trackball[0] = state->m_vbowl_trackball[1];
2411      state->m_vbowl_trackball[1] = (input_port_read(screen.machine(), "AN1") << 8) | input_port_read(screen.machine(), "AN0");
2411      state->m_vbowl_trackball[1] = (state->ioport("AN1")->read() << 8) | state->ioport("AN0")->read();
24122412   }
24132413}
24142414
src/mame/drivers/bwing.c
r15082r15083
6767READ8_MEMBER(bwing_state::bwp1_io_r)
6868{
6969
70   if (offset == 0) return(input_port_read(machine(), "DSW0"));
71   if (offset == 1) return(input_port_read(machine(), "DSW1"));
72   if (offset == 2) return(input_port_read(machine(), "IN0"));
73   if (offset == 3) return(input_port_read(machine(), "IN1"));
74   if (offset == 4) return(input_port_read(machine(), "IN2"));
70   if (offset == 0) return(ioport("DSW0")->read());
71   if (offset == 1) return(ioport("DSW1")->read());
72   if (offset == 2) return(ioport("IN0")->read());
73   if (offset == 3) return(ioport("IN1")->read());
74   if (offset == 4) return(ioport("IN2")->read());
7575
7676   return((m_bwp123_membase[0])[0x1b00 + offset]);
7777}
r15082r15083
279279   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
280280   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
281281   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
282   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
282   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
283283
284284   PORT_START("IN3")
285285   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_TILT ) PORT_CHANGED_MEMBER(DEVICE_SELF, bwing_state,tilt_pressed,0)
286286
287287   PORT_START("VBLANK")
288   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_VBLANK )
288   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
289289
290290   PORT_START("EXTRA") // a matter of taste
291291   PORT_DIPNAME( 0x07, 0x00, "RGB" )
r15082r15083
586586{
587587   bwing_state *state = machine.driver_data<bwing_state>();
588588
589   state->m_bwp123_membase[0] = machine.root_device().memregion("maincpu")->base();
590   state->m_bwp123_membase[1] = machine.root_device().memregion("sub")->base();
589   state->m_bwp123_membase[0] = state->memregion("maincpu")->base();
590   state->m_bwp123_membase[1] = state->memregion("sub")->base();
591591   state->m_bwp123_membase[2] = state->memregion("audiocpu")->base();
592592
593593   fix_bwp3(machine);
src/mame/drivers/srmp6.c
r15082r15083
311311{
312312
313313   if (offset == 0)         // DSW
314      return input_port_read(machine(), "DSW");
314      return ioport("DSW")->read();
315315
316316   switch (m_input_select)   // inputs
317317   {
318      case 1<<0: return input_port_read(machine(), "KEY0");
319      case 1<<1: return input_port_read(machine(), "KEY1");
320      case 1<<2: return input_port_read(machine(), "KEY2");
321      case 1<<3: return input_port_read(machine(), "KEY3");
318      case 1<<0: return ioport("KEY0")->read();
319      case 1<<1: return ioport("KEY1")->read();
320      case 1<<2: return ioport("KEY2")->read();
321      case 1<<3: return ioport("KEY3")->read();
322322   }
323323
324324   return 0;
src/mame/drivers/sf.c
r15082r15083
162162
163163READ16_MEMBER(sf_state::button1_r)
164164{
165   return (scale[input_port_read(machine(), "IN3")] << 8) | scale[input_port_read(machine(), "IN1")];
165   return (scale[ioport("IN3")->read()] << 8) | scale[ioport("IN1")->read()];
166166}
167167
168168READ16_MEMBER(sf_state::button2_r)
169169{
170   return (scale[input_port_read(machine(), "IN4")] << 8) | scale[input_port_read(machine(), "IN2")];
170   return (scale[ioport("IN4")->read()] << 8) | scale[ioport("IN2")->read()];
171171}
172172
173173
src/mame/drivers/cave.c
r15082r15083
859859READ16_MEMBER(cave_state::sailormn_input0_r)
860860{
861861//  watchdog_reset16_r(0, 0);    // written too rarely for mame.
862   return input_port_read(machine(), "IN0");
862   return ioport("IN0")->read();
863863}
864864
865865static ADDRESS_MAP_START( sailormn_map, AS_PROGRAM, 16, cave_state )
r15082r15083
13611361   PORT_DIPSETTING(      0x0200, "4" )
13621362   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Bonus_Life ) )      PORT_DIPLOCATION("SW2:3")
13631363   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1364   PORT_DIPSETTING(      0x0400, "150k/300k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0xc000)
1365   PORT_DIPSETTING(      0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0xa000)
1366   PORT_DIPSETTING(      0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0xe000)
1367   PORT_DIPSETTING(      0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0x6000)
1368   PORT_DIPSETTING(      0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0x8000)
1369   PORT_DIPSETTING(      0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0x2000)
1370   PORT_DIPSETTING(      0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0x4000)
1371   PORT_DIPSETTING(      0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0x0000)
1364   PORT_DIPSETTING(      0x0400, "150k/300k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0xc000)
1365   PORT_DIPSETTING(      0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0xa000)
1366   PORT_DIPSETTING(      0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0xe000)
1367   PORT_DIPSETTING(      0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x6000)
1368   PORT_DIPSETTING(      0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x8000)
1369   PORT_DIPSETTING(      0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x2000)
1370   PORT_DIPSETTING(      0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x4000)
1371   PORT_DIPSETTING(      0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x0000)
13721372   PORT_DIPNAME( 0x1800, 0x1800, "Damage" )               PORT_DIPLOCATION("SW2:4,5")
13731373   PORT_DIPSETTING(      0x1800, "+0" )
13741374   PORT_DIPSETTING(      0x1000, "+1" )
r15082r15083
13941394   PORT_DIPSETTING(      0x0004, DEF_STR( Chinese ) )
13951395   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Bonus_Life ) )      PORT_DIPLOCATION("SW2:3")
13961396   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1397   PORT_DIPSETTING(      0x0400, "150k/300k" ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x8000)
1398   PORT_DIPSETTING(      0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0xc000)
1399   PORT_DIPSETTING(      0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x4000)
1400   PORT_DIPSETTING(      0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x0000)
1397   PORT_DIPSETTING(      0x0400, "150k/300k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x8000)
1398   PORT_DIPSETTING(      0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0xc000)
1399   PORT_DIPSETTING(      0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000)
1400   PORT_DIPSETTING(      0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x0000)
14011401   PORT_DIPUNKNOWN_DIPLOC( 0x2000, 0x2000, "SW2:6" )
14021402   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW2:7,8")
14031403   PORT_DIPSETTING(      0x8000, DEF_STR( Very_Easy ) )
r15082r15083
45444544static DRIVER_INIT( hotdogst )
45454545{
45464546   cave_state *state = machine.driver_data<cave_state>();
4547   UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
4547   UINT8 *ROM = state->memregion("audiocpu")->base();
45484548
45494549   init_cave(machine);
45504550
r15082r15083
45634563static DRIVER_INIT( mazinger )
45644564{
45654565   cave_state *state = machine.driver_data<cave_state>();
4566   UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
4566   UINT8 *ROM = state->memregion("audiocpu")->base();
45674567   UINT8 *buffer;
4568   UINT8 *src = machine.root_device().memregion("sprites")->base();
4569   int len = machine.root_device().memregion("sprites")->bytes();
4568   UINT8 *src = state->memregion("sprites")->base();
4569   int len = state->memregion("sprites")->bytes();
45704570
45714571   init_cave(machine);
45724572
r15082r15083
46004600static DRIVER_INIT( metmqstr )
46014601{
46024602   cave_state *state = machine.driver_data<cave_state>();
4603   UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
4603   UINT8 *ROM = state->memregion("audiocpu")->base();
46044604
46054605   init_cave(machine);
46064606
46074607   state->membank("bank1")->configure_entries(0, 0x2, &ROM[0x00000], 0x4000);
46084608   state->membank("bank1")->configure_entries(2, 0xe, &ROM[0x10000], 0x4000);
46094609
4610   ROM = machine.root_device().memregion("oki1")->base();
4610   ROM = state->memregion("oki1")->base();
46114611   state->membank("bank3")->configure_entries(0, 8, &ROM[0x00000], 0x20000);
46124612   state->membank("bank4")->configure_entries(0, 8, &ROM[0x00000], 0x20000);
46134613
r15082r15083
46254625static DRIVER_INIT( pwrinst2j )
46264626{
46274627   cave_state *state = machine.driver_data<cave_state>();
4628   UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
4628   UINT8 *ROM = state->memregion("audiocpu")->base();
46294629   UINT8 *buffer;
4630   UINT8 *src = machine.root_device().memregion("sprites")->base();
4630   UINT8 *src = state->memregion("sprites")->base();
46314631   int len = state->memregion("sprites")->bytes();
46324632   int i, j;
46334633
r15082r15083
46744674static DRIVER_INIT( sailormn )
46754675{
46764676   cave_state *state = machine.driver_data<cave_state>();
4677   UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
4677   UINT8 *ROM = state->memregion("audiocpu")->base();
46784678   UINT8 *buffer;
4679   UINT8 *src = machine.root_device().memregion("sprites")->base();
4680   int len = machine.root_device().memregion("sprites")->bytes();
4679   UINT8 *src = state->memregion("sprites")->base();
4680   int len = state->memregion("sprites")->bytes();
46814681
46824682   init_cave(machine);
46834683
46844684   state->membank("bank1")->configure_entries(0, 0x02, &ROM[0x00000], 0x4000);
46854685   state->membank("bank1")->configure_entries(2, 0x1e, &ROM[0x10000], 0x4000);
46864686
4687   ROM = machine.root_device().memregion("oki1")->base();
4687   ROM = state->memregion("oki1")->base();
46884688   state->membank("bank3")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
46894689   state->membank("bank4")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
46904690
src/mame/drivers/williams.c
r15082r15083
783783   PORT_DIPSETTING(    0x00, "2" )
784784   PORT_DIPSETTING(    0x01, "3")
785785   PORT_DIPNAME( 0x02, 0x00, "Bonus At" )
786   PORT_DIPSETTING(    0x00, "20k/40k" )      PORT_CONDITION("IN2",0x01,PORTCOND_NOTEQUALS,0x01)
787   PORT_DIPSETTING(    0x02, "30k/50k" )      PORT_CONDITION("IN2",0x01,PORTCOND_NOTEQUALS,0x01)
788   PORT_DIPSETTING(    0x00, "30k/50k" )      PORT_CONDITION("IN2",0x01,PORTCOND_EQUALS,0x01)
789   PORT_DIPSETTING(    0x02, "40k/70k" )      PORT_CONDITION("IN2",0x01,PORTCOND_EQUALS,0x01)
786   PORT_DIPSETTING(    0x00, "20k/40k" )      PORT_CONDITION("IN2",0x01,NOTEQUALS,0x01)
787   PORT_DIPSETTING(    0x02, "30k/50k" )      PORT_CONDITION("IN2",0x01,NOTEQUALS,0x01)
788   PORT_DIPSETTING(    0x00, "30k/50k" )      PORT_CONDITION("IN2",0x01,EQUALS,0x01)
789   PORT_DIPSETTING(    0x02, "40k/70k" )      PORT_CONDITION("IN2",0x01,EQUALS,0x01)
790790   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ))      /* documented as unused */
791791   PORT_DIPSETTING(    0x04, DEF_STR( Off ))
792792   PORT_DIPSETTING(    0x00, DEF_STR( On ))
src/mame/drivers/dec8.c
r15082r15083
9696
9797READ8_MEMBER(dec8_state::gondo_player_1_r)
9898{
99   int val = 1 << input_port_read(machine(), "AN0");
99   int val = 1 << ioport("AN0")->read();
100100
101101   switch (offset)
102102   {
103103      case 0: /* Rotary low byte */
104104         return ~(val & 0xff);
105105      case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
106         return ((~val >> 4) & 0xf0) | (input_port_read(machine(), "IN0") & 0xf);
106         return ((~val >> 4) & 0xf0) | (ioport("IN0")->read() & 0xf);
107107   }
108108   return 0xff;
109109}
110110
111111READ8_MEMBER(dec8_state::gondo_player_2_r)
112112{
113   int val = 1 << input_port_read(machine(), "AN1");
113   int val = 1 << ioport("AN1")->read();
114114
115115   switch (offset)
116116   {
117117      case 0: /* Rotary low byte */
118118         return ~(val & 0xff);
119119      case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
120         return ((~val >> 4) & 0xf0) | (input_port_read(machine(), "IN1") & 0xf);
120         return ((~val >> 4) & 0xf0) | (ioport("IN1")->read() & 0xf);
121121   }
122122   return 0xff;
123123}
r15082r15083
183183   }
184184
185185   /* Coins are controlled by the i8751 */
186   if ((input_port_read(machine(), "IN2") & 3) == 3) m_latch = 1;
187   if ((input_port_read(machine(), "IN2") & 1) != 1 && m_latch)
186   if ((ioport("IN2")->read() & 3) == 3) m_latch = 1;
187   if ((ioport("IN2")->read() & 1) != 1 && m_latch)
188188   {
189189      m_coin1++;
190190      m_latch = 0;
r15082r15083
196196         m_credits+=m_cred1;
197197      }
198198   }
199   if ((input_port_read(machine(), "IN2") & 2) != 2 && m_latch)
199   if ((ioport("IN2")->read() & 2) != 2 && m_latch)
200200   {
201201      m_coin2++;
202202      m_latch = 0;
r15082r15083
246246   }
247247
248248   /* Coins are controlled by the i8751 */
249   if (/*(input_port_read(machine(), "IN2") & 3) == 3*/!m_latch) { m_latch = 1; m_coin1 = m_coin2 = 0; }
250   if ((input_port_read(machine(), "IN2") & 1) != 1 && m_latch)  { m_coin1 = 1; m_latch = 0; }
251   if ((input_port_read(machine(), "IN2") & 2) != 2 && m_latch)  { m_coin2 = 1; m_latch = 0; }
249   if (/*(ioport("IN2")->read() & 3) == 3*/!m_latch) { m_latch = 1; m_coin1 = m_coin2 = 0; }
250   if ((ioport("IN2")->read() & 1) != 1 && m_latch)  { m_coin1 = 1; m_latch = 0; }
251   if ((ioport("IN2")->read() & 2) != 2 && m_latch)  { m_coin2 = 1; m_latch = 0; }
252252
253253   if (m_i8751_value == 0x0102) m_i8751_return = 0;    /* ??? */
254254   if (m_i8751_value == 0x0101) m_i8751_return = 0;    /* ??? */
r15082r15083
284284   }
285285
286286   /* Coins are controlled by the i8751 */
287   if ((input_port_read(machine(), "IN2") & 3) == 3) m_latch = 1;
288   if ((input_port_read(machine(), "IN2") & 1) != 1 && m_latch)
287   if ((ioport("IN2")->read() & 3) == 3) m_latch = 1;
288   if ((ioport("IN2")->read() & 1) != 1 && m_latch)
289289   {
290290      m_coin1++;
291291      m_latch = 0;
r15082r15083
297297         m_credits+=m_cred1;
298298      }
299299   }
300   if ((input_port_read(machine(), "IN2") & 2) != 2 && m_latch)
300   if ((ioport("IN2")->read() & 2) != 2 && m_latch)
301301   {
302302      m_coin2++;
303303      m_latch = 0;
r15082r15083
351351   }
352352
353353   /* Coins are controlled by the i8751 */
354   if ((input_port_read(machine(), "I8751") & 3) == 3) m_latch = 1;
355   if ((input_port_read(machine(), "I8751") & 1) != 1 && m_latch)
354   if ((ioport("I8751")->read() & 3) == 3) m_latch = 1;
355   if ((ioport("I8751")->read() & 1) != 1 && m_latch)
356356   {
357357      m_coin1++;
358358      m_latch = 0;
r15082r15083
362362         m_credits+=m_cred1;
363363      }
364364   }
365   if ((input_port_read(machine(), "I8751") & 2) != 2 && m_latch)
365   if ((ioport("I8751")->read() & 2) != 2 && m_latch)
366366   {
367367      m_coin2++;
368368      m_latch = 0;
r15082r15083
934934      case 2:
935935         return 0xff;
936936      case 3:
937         return input_port_read(machine(), "I8751");
937         return ioport("I8751")->read();
938938   }
939939
940940   return 0xff; //compile safe.
r15082r15083
10051005   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
10061006   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
10071007   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1008   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1008   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
10091009
10101010   PORT_START("DSW0")
10111011   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
r15082r15083
10951095   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
10961096   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
10971097   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1098   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1098   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
10991099
11001100   PORT_START("DSW0")
11011101   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
r15082r15083
11891189   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
11901190   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
11911191   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1192   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1192   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
11931193
11941194   PORT_START("I8751")   /* hooked up on the i8751 */
11951195   /* Low 4 bits not connected on schematics */
r15082r15083
12601260   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)  /* shoot */
12611261   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)  /* bomb */
12621262   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1263   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1263   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
12641264
12651265   PORT_START("I8751")   /* hooked up on the (fake) i8751 */
12661266   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
r15082r15083
13441344   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
13451345   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
13461346   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1347   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
1347   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
13481348   PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
13491349   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
13501350   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
r15082r15083
14731473   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
14741474   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
14751475   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1476   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1476   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
14771477
14781478   PORT_START("DSW0")
14791479   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
r15082r15083
15601560   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
15611561   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
15621562   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1563   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1563   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
15641564
15651565   PORT_START("DSW0")
15661566   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )           /* table at 0xf8e3 (4 * 2 bytes : coins then credits) */
r15082r15083
16491649   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_COCKTAIL
16501650   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
16511651   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1652   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
1652   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
16531653   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
16541654
16551655   PORT_START("I8751") /* Fake port for i8751 */
r15082r15083
17431743   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
17441744   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
17451745   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1746   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
1746   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
17471747
17481748   PORT_START("DSW0")
17491749   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )           /* code at 0x88b7 in 'cobracom', 0x890e in 'cobracomj' */
r15082r15083
19661966static INTERRUPT_GEN( oscar_interrupt )
19671967{
19681968   dec8_state *state = device->machine().driver_data<dec8_state>();
1969   if ((input_port_read(device->machine(), "IN2") & 0x7) == 0x7) state->m_latch = 1;
1970   if (state->m_latch && (input_port_read(device->machine(), "IN2") & 0x7) != 0x7)
1969   if ((state->ioport("IN2")->read() & 0x7) == 0x7) state->m_latch = 1;
1970   if (state->m_latch && (state->ioport("IN2")->read() & 0x7) != 0x7)
19711971   {
19721972      state->m_latch = 0;
19731973      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
src/mame/drivers/fuukifg3.c
r15082r15083
425425   PORT_DIPSETTING(      0x2000, "2C Start / 1C Continue" )
426426//  PORT_DIPSETTING(      0x7000, "Error!!" )               // Causes graphics issues - Service Mode shows "Error"
427427//  PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )        // Duplicate 2C_1C
428   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW2",0x0f00,PORTCOND_NOTEQUALS,0x0000)
429   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )      PORT_CONDITION("DSW2",0x0f00,PORTCOND_EQUALS,0x0000)   // Set both for Free Play
428   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW2",0x0f00,NOTEQUALS,0x0000)
429   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )      PORT_CONDITION("DSW2",0x0f00,EQUALS,0x0000)   // Set both for Free Play
430430   PORT_DIPNAME( 0x0f00, 0x0f00, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW4:5,6,7,8") /* Service Mode Shows Player 1 */
431431   PORT_DIPSETTING(      0x0800, DEF_STR( 8C_1C ) )
432432   PORT_DIPSETTING(      0x0900, DEF_STR( 7C_1C ) )
r15082r15083
443443   PORT_DIPSETTING(      0x0200, "2C Start / 1C Continue" )
444444//  PORT_DIPSETTING(      0x0700, "Error!!" )               // Causes graphics issues - Service Mode shows "Error"
445445//  PORT_DIPSETTING(      0x0100, DEF_STR( 2C_1C ) )        // Duplicate 2C_1C
446   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW2",0xf000,PORTCOND_NOTEQUALS,0x0000)
447   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )      PORT_CONDITION("DSW2",0xf000,PORTCOND_EQUALS,0x0000)   // Set both for Free Play
446   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )      PORT_CONDITION("DSW2",0xf000,NOTEQUALS,0x0000)
447   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )      PORT_CONDITION("DSW2",0xf000,EQUALS,0x0000)   // Set both for Free Play
448448INPUT_PORTS_END
449449
450450static INPUT_PORTS_START( asurabus )
src/mame/drivers/slotcarn.c
r15082r15083
112112   UINT16 x = 0;
113113   int rlen;
114114
115   gfx[0] = device->machine().root_device().memregion("gfx1")->base();
116   gfx[1] = device->machine().root_device().memregion("gfx2")->base();
115   gfx[0] = state->memregion("gfx1")->base();
116   gfx[1] = state->memregion("gfx2")->base();
117117   rlen = state->memregion("gfx2")->bytes();
118118
119119   //ma = ma ^ 0x7ff;
src/mame/drivers/chance32.c
r0r15083
1/*
2
3Chance 32 - Poker Game by PAL Company
4
51x HD46505SP / HD6845SP
61x Z84C0008PEC
7
8XTAL: 12.000 Mhz
9
10
11 todo, fix tilemaps, colours, inputs, hook up oki, add CRTC device
12
13*/
14
15#include "emu.h"
16#include "cpu/z80/z80.h"
17#include "sound/okim6295.h"
18#include "video/mc6845.h"
19
20
21
22class chance32_state : public driver_device
23{
24public:
25   chance32_state(const machine_config &mconfig, device_type type, const char *tag)
26      : driver_device(mconfig, type, tag),
27      m_fgram(*this, "fgram"),
28      m_bgram(*this, "bgram")
29
30   { }
31
32   DECLARE_WRITE8_MEMBER(chance32_fgram_w)
33   {
34      m_fgram[offset] = data;
35      m_fg_tilemap->mark_tile_dirty(offset / 2);
36   }
37
38   DECLARE_WRITE8_MEMBER(chance32_bgram_w)
39   {
40      m_bgram[offset] = data;
41      m_bg_tilemap->mark_tile_dirty(offset / 2);
42   }
43
44   DECLARE_WRITE8_MEMBER(mux_w);
45   DECLARE_READ8_MEMBER(mux_r);
46
47   tilemap_t *m_fg_tilemap;
48   tilemap_t *m_bg_tilemap;
49
50   required_shared_ptr<UINT8> m_fgram;
51   required_shared_ptr<UINT8> m_bgram;
52
53   UINT8 mux_data;
54};
55
56static TILE_GET_INFO( get_fg_tile_info )
57{
58   chance32_state *state = machine.driver_data<chance32_state>();
59   int code = (state->m_fgram[tile_index * 2 + 1] << 8) | state->m_fgram[tile_index * 2];
60   int flip = (~code >> 12)&1;
61   SET_TILE_INFO(
62         1,
63         code & 0x0fff,
64         code >> 13,
65         TILE_FLIPYX(flip<<1)|flip);
66}
67
68static TILE_GET_INFO( get_bg_tile_info )
69{
70   chance32_state *state = machine.driver_data<chance32_state>();
71   int code = (state->m_bgram[tile_index * 2 +1] << 8) | state->m_bgram[tile_index * 2];
72   int flip = (~code >> 12)&1;
73   SET_TILE_INFO(
74         0,
75         code & 0x0fff,
76         code >> 13,
77         TILE_FLIPYX(flip<<1|flip));
78}
79
80
81VIDEO_START( chance32 )
82{
83   chance32_state *state = machine.driver_data<chance32_state>();
84
85   state->m_fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 8, 35, 29);
86   state->m_fg_tilemap->set_transparent_pen(0);
87
88   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 8, 35, 29);
89
90   state->m_fg_tilemap->set_flip(TILE_FLIPX|TILE_FLIPY);
91   state->m_bg_tilemap->set_flip(TILE_FLIPX|TILE_FLIPY);
92}
93
94SCREEN_UPDATE_IND16( chance32 )
95{
96   chance32_state *state = screen.machine().driver_data<chance32_state>();
97
98   /* TODO: wtf? */
99   state->m_bg_tilemap->set_scrollx(0, 352);
100   state->m_bg_tilemap->set_scrolly(0, 160);
101   state->m_fg_tilemap->set_scrollx(0, 352);
102   state->m_fg_tilemap->set_scrolly(0, 160);
103
104   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
105   state->m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
106
107   return 0;
108}
109
110
111static ADDRESS_MAP_START( chance32_map, AS_PROGRAM, 8, chance32_state )
112   AM_RANGE(0x0000, 0xcfff) AM_ROM
113   AM_RANGE(0xd800, 0xdfff) AM_RAM
114
115   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(paletteram_xGGGGGRRRRRBBBBB_byte_le_w) AM_SHARE("paletteram")
116
117   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(chance32_fgram_w) AM_SHARE("fgram")
118   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(chance32_bgram_w) AM_SHARE("bgram")
119ADDRESS_MAP_END
120
121WRITE8_MEMBER(chance32_state::mux_w)
122{
123   mux_data = data;
124}
125
126READ8_MEMBER(chance32_state::mux_r)
127{
128   UINT8 res,i;
129   const char *const muxnames[4] = { "IN0", "IN1", "IN2", "IN3" };
130   res = 0;
131
132   for(i=0;i<4;i++)
133   {
134      if(mux_data & 1 << i)
135         res |= ioport(muxnames[i])->read();
136   }
137
138   return res;
139}
140
141static ADDRESS_MAP_START( chance32_portmap, AS_IO, 8, chance32_state )
142   ADDRESS_MAP_GLOBAL_MASK(0xff)
143   //AM_RANGE(0x10, 0x10) AM_WRITENOP // ?
144   AM_RANGE(0x13, 0x13) AM_WRITE(mux_w)
145   AM_RANGE(0x20, 0x20) AM_READ_PORT("DSW0")
146   AM_RANGE(0x21, 0x21) AM_READ_PORT("DSW1")
147   AM_RANGE(0x22, 0x22) AM_READ_PORT("DSW2")
148   AM_RANGE(0x23, 0x23) AM_READ_PORT("DSW3")
149   AM_RANGE(0x24, 0x24) AM_READ_PORT("DSW4")
150   AM_RANGE(0x25, 0x25) AM_READ(mux_r)
151//   AM_RANGE(0x26, 0x26) AM_READ_PORT("UNK") // vblank?
152   AM_RANGE(0x30, 0x30) AM_DEVWRITE("crtc", mc6845_device, address_w)
153   AM_RANGE(0x31, 0x31) AM_DEVWRITE("crtc", mc6845_device, register_w)
154   AM_RANGE(0x50, 0x50) AM_DEVREADWRITE("oki", okim6295_device, read, write)
155//   AM_RANGE(0x60, 0x60) AM_WRITENOP // lamps
156
157ADDRESS_MAP_END
158
159
160
161static INPUT_PORTS_START( chance32 )
162   PORT_START("UNK")
163
164   PORT_START("DSW0")
165   PORT_DIPNAME( 0x01, 0x00, "DSW0" )
166   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
167   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
168   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
169   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
170   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
171   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
172   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
173   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
174   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
175   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
176   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
177   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
178   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
179   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
180   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
181   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
182   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
183   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
184   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
185   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
186   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
187   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
188   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
189
190   PORT_START("DSW1")
191   PORT_DIPNAME( 0x01, 0x00, "DSW1" )
192   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
193   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
194   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
195   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
196   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
197   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
198   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
199   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
200   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
201   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
202   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
203   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
204   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
205   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
206   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
207   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
208   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
209   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
210   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
211   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
212   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
213   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
214   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
215
216   PORT_START("DSW2")
217   PORT_DIPNAME( 0x01, 0x00, "DSW2" )
218   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
219   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
220   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
221   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
222   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
223   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
224   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
225   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
226   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
227   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
228   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
229   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
230   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
231   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
232   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
233   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
234   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
235   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
236   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
237   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
238   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
239   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
240   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
241
242   PORT_START("DSW3")
243   PORT_DIPNAME( 0x01, 0x00, "DSW3" )
244   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
245   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
246   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
247   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
248   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
249   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
250   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
251   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
252   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
253   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
254   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
255   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
256   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
257   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
258   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
259   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
260   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
261   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
262   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
263   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
264   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
265   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
266   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
267
268   PORT_START("DSW4")
269   PORT_DIPNAME( 0x01, 0x00, "DSW4" )
270   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
271   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
272   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
273   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
274   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
275   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
276   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
277   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
278   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
279   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
280   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
281   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
282   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
283   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
284   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
285   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
286   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
287   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
288   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
289   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
290   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
291   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
292   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
293
294   PORT_START("IN0")
295   PORT_DIPNAME( 0x01, 0x00, "0" )
296   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
297   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
298   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
299   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
300   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
301   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
302   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
303   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
304   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
305   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
306   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
307   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
308   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
309   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
310   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
311   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
312   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
313   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
314   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
315   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
316   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
317   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
318   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
319
320   PORT_START("IN1")
321   PORT_DIPNAME( 0x01, 0x00, "1" )
322   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
323   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
324   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
325   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
326   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
327   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
328   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
329   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
330   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
331   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
332   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
333   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
334   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
335   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
336   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
337   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
338   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
339   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
340   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
341   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
342   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
343   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
344   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
345
346   PORT_START("IN2")
347   PORT_DIPNAME( 0x01, 0x00, "2" )
348   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
349   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
350   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
351   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
352   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
353   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
354   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
355   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
356   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
357   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
358   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
359   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
360   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
361   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
362   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
363   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
364   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
365   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
366   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
367   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
368   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
369   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
370   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
371
372   PORT_START("IN3")
373   PORT_DIPNAME( 0x01, 0x00, "3" )
374   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
375   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
376   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
377   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
378   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
379   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
380   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
381   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
382   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
383   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
384   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
385   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
386   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
387   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
388   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
389   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
390   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
391   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
392   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
393   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
394   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
395   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
396   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
397INPUT_PORTS_END
398
399static const gfx_layout tiles8x8_layout =
400{
401   16,8,
402   RGN_FRAC(1,1),
403   8,
404   { 0, 1, 2, 3,4,5,6,7 },
405   { 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8, 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
406   { 7*128, 6*128, 5*128, 4*128, 3*128, 2*128, 1*128, 0*128 },
407   128*8
408};
409
410static GFXDECODE_START( chance32 )
411   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 8 )
412   GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout, 0, 8 )
413GFXDECODE_END
414
415
416
417static MACHINE_START( chance32 )
418{
419
420}
421
422static MACHINE_RESET( chance32 )
423{
424
425}
426
427static const mc6845_interface mc6845_intf =
428{
429   "screen",   /* screen we are acting on */
430   16,         /* number of pixels per video memory address */
431   NULL,      /* before pixel update callback */
432   NULL,      /* row update callback */
433   NULL,      /* after pixel update callback */
434   DEVCB_NULL,   /* callback for display state changes */
435   DEVCB_NULL,   /* callback for cursor state changes */
436   DEVCB_NULL,   /* HSYNC callback */
437   DEVCB_NULL,   /* VSYNC callback */
438   NULL      /* update address callback */
439};
440
441
442static MACHINE_CONFIG_START( chance32, chance32_state )
443
444   /* basic machine hardware */
445   MCFG_CPU_ADD("maincpu", Z80,12000000/2)
446   MCFG_CPU_PROGRAM_MAP(chance32_map)
447   MCFG_CPU_IO_MAP(chance32_portmap)
448   MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
449
450   MCFG_MACHINE_START(chance32)
451   MCFG_MACHINE_RESET(chance32)
452
453   /* video hardware */
454   MCFG_SCREEN_ADD("screen", RASTER)
455   MCFG_SCREEN_REFRESH_RATE(60)
456   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
457   MCFG_SCREEN_SIZE(40*16, 32*8)
458   MCFG_SCREEN_VISIBLE_AREA(0, 35*16-1, 0, 29*8-1)
459   MCFG_SCREEN_UPDATE_STATIC(chance32)
460
461   MCFG_MC6845_ADD("crtc", H46505, 12000000/14, mc6845_intf)   /* hand tuned to get ~60 fps */
462
463   MCFG_GFXDECODE(chance32)
464   MCFG_PALETTE_LENGTH(0x800)
465
466   MCFG_VIDEO_START(chance32)
467
468   /* sound hardware */
469   MCFG_SPEAKER_STANDARD_MONO("mono")
470
471   MCFG_OKIM6295_ADD("oki", 12000000/12, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
472   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
473MACHINE_CONFIG_END
474
475
476
477ROM_START( chance32 )
478   ROM_REGION( 0x10000, "maincpu", 0 )
479   ROM_LOAD( "0.u52", 0x00000, 0x10000, CRC(331048b2) SHA1(deb4da570b3efe6e15deefb6351f925b642b4614)  )
480
481   ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT )
482   ROM_LOAD16_BYTE( "4.u64", 0x00001, 0x20000, CRC(da80d9bd) SHA1(3b5235ab59fd55f0ec5584b3cf1aa5c8f36c76f6) )
483   ROM_LOAD16_BYTE( "5.u65", 0x00000, 0x20000, CRC(7528773b) SHA1(95c8e55cdec2c5c1dcdcc5a7edc6e590e3829f92) )
484   ROM_LOAD16_BYTE( "6.u66", 0x40001, 0x20000, CRC(cee2ffb0) SHA1(527c2072d39484317b0320afd975df1bbe244a01) )
485   ROM_LOAD16_BYTE( "7.u67", 0x40000, 0x20000, CRC(42dc4b69) SHA1(44c8f902db4c7ac235d5ea15d1b509f98663690a) )
486
487   ROM_REGION( 0x40000, "gfx2", ROMREGION_INVERT )
488   ROM_LOAD16_BYTE( "1.u71", 0x00001, 0x20000, CRC(f8e85873) SHA1(6ad24f7fcbc62a03180e168d70239df1ce662f0d) )
489   ROM_LOAD16_BYTE( "2.u72", 0x00000, 0x20000, CRC(860b534d) SHA1(44649ea93acdf173356bfcd7e81916253b52c378) )
490
491   ROM_REGION( 0x40000, "oki", 0 )
492   ROM_LOAD( "8.u21", 0x00000, 0x40000, CRC(161b35dd) SHA1(d20a75a4c4ed9cd9cfc12faee921122274840f06) )
493
494   ROM_REGION( 0x40000, "gals", 0 ) // no idea if these are any good
495   ROM_LOAD( "gal20v8a.u53.jed.bin", 0x0000, 0x157, CRC(9f680800) SHA1(2fa41ead85136e851d465432a7b9d3ec848c7a22) )
496   ROM_LOAD( "gal20v8a.u54.jed.bin", 0x0000, 0x157, CRC(9f680800) SHA1(2fa41ead85136e851d465432a7b9d3ec848c7a22) )
497   ROM_LOAD( "gal20v8a.u55.jed.bin", 0x0000, 0x157, CRC(9f680800) SHA1(2fa41ead85136e851d465432a7b9d3ec848c7a22) )
498   ROM_LOAD( "gal20v8a.u56.jed.bin", 0x0000, 0x157, CRC(6bab01ad) SHA1(c69e4be41a989a52788af8062f48bbe26bc3dab8) )
499   ROM_LOAD( "gal20v8a.u57.jed.bin", 0x0000, 0x157, CRC(787c4159) SHA1(f4a869b317c6be1024f1ca21bcc4af478c8227c8) )
500   ROM_LOAD( "gal20v8a.u58.jed.bin", 0x0000, 0x157, CRC(7b16053b) SHA1(cdb289d4f27c7a1a918393943bb8db9712e2f52e) )
501
502   ROM_LOAD( "gal16v8a.u47.jed.bin", 0x0000, 0x117, CRC(a733f0de) SHA1(6eec26043cedb3cae4efe93faa84a07327be468b) )
503   ROM_LOAD( "gal16v8a.u48.jed.bin", 0x0000, 0x117, CRC(5f1360ef) SHA1(56e4ee0dbae5602d810b2f7c744a71eb1a1e08a8) )
504
505   ROM_LOAD( "gal16v8a.u32.jed.bin", 0x0000, 0x117, CRC(c0784cd1) SHA1(0ae2ce482d379e29c2a9f130fc0d9ed928faef98) )
506
507   ROM_LOAD( "gal16v8a.u24.jed.bin", 0x0000, 0x117, CRC(a733f0de) SHA1(6eec26043cedb3cae4efe93faa84a07327be468b) )
508ROM_END
509
510
511
512
513
514GAME( 19??, chance32,  0,    chance32, chance32,  0, ROT0, "Pal Company", "Chance Thirty Two", GAME_NOT_WORKING )
src/mame/drivers/battlane.c
r15082r15083
137137   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
138138   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
139139   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
140   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
140   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
141141
142142   PORT_START("DSW1")
143143   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:1,2")
src/mame/drivers/atarigt.c
r15082r15083
9999
100100READ32_MEMBER(atarigt_state::special_port2_r)
101101{
102   int temp = input_port_read(machine(), "SERVICE");
102   int temp = ioport("SERVICE")->read();
103103   temp ^= 0x0001;      /* /A2DRDY always high for now */
104104   temp ^= 0x0008;      /* A2D.EOC always high for now */
105105   return (temp << 16) | temp;
r15082r15083
108108
109109READ32_MEMBER(atarigt_state::special_port3_r)
110110{
111   int temp = input_port_read(machine(), "COIN");
111   int temp = ioport("COIN")->read();
112112   if (m_video_int_state) temp ^= 0x0001;
113113   if (m_scanline_int_state) temp ^= 0x0002;
114114   return (temp << 16) | temp;
r15082r15083
118118#if (HACK_TMEK_CONTROLS)
119119INLINE void compute_fake_pots(int *pots)
120120{
121   int fake = input_port_read(machine, "FAKE");
121   int fake = machine.root_device().ioport("FAKE")->read();
122122
123123   pots[0] = pots[1] = pots[2] = pots[3] = 0x80;
124124
r15082r15083
155155   compute_fake_pots(pots);
156156   return (pots[0] << 24) | (pots[3] << 8);
157157#else
158   return (input_port_read(machine(), "AN1") << 24) | (input_port_read(machine(), "AN2") << 8);
158   return (ioport("AN2")->read() << 8);
159159#endif
160160}
161161
r15082r15083
167167   compute_fake_pots(pots);
168168   return (pots[2] << 24) | (pots[1] << 8);
169169#else
170   return (input_port_read(machine(), "AN3") << 24) | (input_port_read(machine(), "AN4") << 8);
170   return (ioport("AN4")->read() << 8);
171171#endif
172172}
173173
r15082r15083
658658   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* A2D.EOC */
659659   PORT_BIT( 0x0030, IP_ACTIVE_LOW, IPT_UNUSED )   /* NC */
660660   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )         /* SELFTEST */
661   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )   /* VBLANK */
661   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")   /* VBLANK */
662662   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
663663
664664   PORT_START("COIN")         /* 68.STATUS (A2=1) */
src/mame/drivers/asuka.c
r15082r15083
655655   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
656656   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
657657   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SWA:5,6")
658   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
659   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
660   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
661   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
662   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
663   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
664   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
665   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
658   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
659   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
660   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
661   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
662   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
663   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
664   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
665   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
666666   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SWA:7,8")
667   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
668   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
669   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
670   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
671   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
672   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
673   PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
674   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
667   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
668   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
669   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
670   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
671   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
672   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
673   PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
674   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
675675
676676   /* 0x400002 -> 0x100984 */
677677   PORT_MODIFY("DSWB")
r15082r15083
842842   state->m_tc0100scn = machine.device("tc0100scn");
843843
844844   /* configure the banks */
845   state->membank("bank1")->configure_entry(0, machine.root_device().memregion("audiocpu")->base());
845   state->membank("bank1")->configure_entry(0, state->memregion("audiocpu")->base());
846846   state->membank("bank1")->configure_entries(1, 3, state->memregion("audiocpu")->base() + 0x10000, 0x04000);
847847
848848   state->save_item(NAME(state->m_adpcm_pos));
src/mame/drivers/triplhnt.c
r15082r15083
7676   discrete_sound_w(discrete, TRIPLHNT_LAMP_EN, state->m_misc_flags & 0x02);   // Lamp is used to reset noise
7777   discrete_sound_w(discrete, TRIPLHNT_BEAR_EN, state->m_misc_flags & 0x80);   // bear
7878
79   is_witch_hunt = input_port_read(machine, "0C09") == 0x40;
79   is_witch_hunt = machine.root_device().ioport("0C09")->read() == 0x40;
8080   bit = ~state->m_misc_flags & 0x40;
8181
8282   /* if we're not playing the sample yet, start it */
r15082r15083
108108READ8_MEMBER(triplhnt_state::triplhnt_input_port_4_r)
109109{
110110   watchdog_reset_w(space, 0, 0);
111   return input_port_read(machine(), "0C0B");
111   return ioport("0C0B")->read();
112112}
113113
114114
115115READ8_MEMBER(triplhnt_state::triplhnt_misc_r)
116116{
117117   triplhnt_update_misc(machine(), offset);
118   return input_port_read(machine(), "VBLANK") | m_hit_code;
118   return ioport("VBLANK")->read() | m_hit_code;
119119}
120120
121121
122122READ8_MEMBER(triplhnt_state::triplhnt_da_latch_r)
123123{
124   int cross_x = input_port_read(machine(), "STICKX");
125   int cross_y = input_port_read(machine(), "STICKY");
124   int cross_x = ioport("STICKX")->read();
125   int cross_y = ioport("STICKY")->read();
126126
127127   m_da_latch = offset;
128128
r15082r15083
196196   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
197197
198198   PORT_START("VBLANK")
199   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
199   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
200200
201201   PORT_START("STICKX")
202202   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)
src/mame/drivers/hvyunit.c
r15082r15083
369369
370370   switch ((m_mermaid_p[0] >> 2) & 3)
371371   {
372      case 0: return input_port_read(machine(), "IN1");
373      case 1: return input_port_read(machine(), "IN2");
374      case 2: return input_port_read(machine(), "IN0");
372      case 0: return ioport("IN1")->read();
373      case 1: return ioport("IN2")->read();
374      case 2: return ioport("IN0")->read();
375375      default: return 0xff;
376376   }
377377}
r15082r15083
386386{
387387
388388   UINT8 dsw = 0;
389   UINT8 dsw1 = input_port_read(machine(), "DSW1");
390   UINT8 dsw2 = input_port_read(machine(), "DSW2");
389   UINT8 dsw1 = ioport("DSW1")->read();
390   UINT8 dsw2 = ioport("DSW2")->read();
391391
392392   switch ((m_mermaid_p[0] >> 5) & 3)
393393   {
r15082r15083
529529   PORT_DIPSETTING(    0x08, ( "Mode 1" ) )
530530   PORT_DIPSETTING(    0x00, ( "Mode 2" ) )
531531   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )         PORT_DIPLOCATION("DSW1:5,6")
532   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
533   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
534   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
535   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
536   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
537   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
538   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
539   PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
532   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
533   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
534   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
535   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
536   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
537   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
538   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
539   PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
540540   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )         PORT_DIPLOCATION("DSW1:7,8")
541   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
542   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
543   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
544   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
545   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
546   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
547   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
548   PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
541   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
542   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
543   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
544   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
545   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
546   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
547   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
548   PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
549549
550550   PORT_START("DSW2")
551551   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("DSW2:1,2")
src/mame/drivers/wolfpack.c
r15082r15083
3333CUSTOM_INPUT_MEMBER(wolfpack_state::wolfpack_dial_r)
3434{
3535   int bit = (FPTR)param;
36   return ((input_port_read(machine(), "DIAL") + bit) / 2) & 0x01;
36   return ((ioport("DIAL")->read() + bit) / 2) & 0x01;
3737}
3838
3939
src/mame/drivers/tankbatt.c
r15082r15083
7171{
7272   int val;
7373
74   val = input_port_read(machine(), "P1");
74   val = ioport("P1")->read();
7575   return ((val << (7 - offset)) & 0x80);
7676}
7777
r15082r15083
7979{
8080   int val;
8181
82   val = input_port_read(machine(), "P2");
82   val = ioport("P2")->read();
8383   return ((val << (7 - offset)) & 0x80);
8484}
8585
r15082r15083
8787{
8888   int val;
8989
90   val = input_port_read(machine(), "DSW");
90   val = ioport("DSW")->read();
9191   return ((val << (7 - offset)) & 0x80);
9292}
9393
src/mame/drivers/subs.c
r15082r15083
114114   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_START2 )
115115   PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
116116   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_START1 )
117   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_VBLANK )
117   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
118118   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
119119   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
120120   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
src/mame/drivers/royalmah.c
r15082r15083
326326static READ8_DEVICE_HANDLER( royalmah_player_1_port_r )
327327{
328328   royalmah_state *state = device->machine().driver_data<royalmah_state>();
329   int ret = (input_port_read(device->machine(), "KEY0") & 0xc0) | 0x3f;
329   int ret = (state->ioport("KEY0")->read() & 0xc0) | 0x3f;
330330
331   if ((state->m_input_port_select & 0x01) == 0)  ret &= input_port_read(device->machine(), "KEY0");
332   if ((state->m_input_port_select & 0x02) == 0)  ret &= input_port_read(device->machine(), "KEY1");
333   if ((state->m_input_port_select & 0x04) == 0)  ret &= input_port_read(device->machine(), "KEY2");
334   if ((state->m_input_port_select & 0x08) == 0)  ret &= input_port_read(device->machine(), "KEY3");
335   if ((state->m_input_port_select & 0x10) == 0)  ret &= input_port_read(device->machine(), "KEY4");
331   if ((state->m_input_port_select & 0x01) == 0)  ret &= state->ioport("KEY0")->read();
332   if ((state->m_input_port_select & 0x02) == 0)  ret &= state->ioport("KEY1")->read();
333   if ((state->m_input_port_select & 0x04) == 0)  ret &= state->ioport("KEY2")->read();
334   if ((state->m_input_port_select & 0x08) == 0)  ret &= state->ioport("KEY3")->read();
335   if ((state->m_input_port_select & 0x10) == 0)  ret &= state->ioport("KEY4")->read();
336336
337337   return ret;
338338}
r15082r15083
340340static READ8_DEVICE_HANDLER( royalmah_player_2_port_r )
341341{
342342   royalmah_state *state = device->machine().driver_data<royalmah_state>();
343   int ret = (input_port_read(device->machine(), "KEY5") & 0xc0) | 0x3f;
343   int ret = (state->ioport("KEY5")->read() & 0xc0) | 0x3f;
344344
345   if ((state->m_input_port_select & 0x01) == 0)  ret &= input_port_read(device->machine(), "KEY5");
346   if ((state->m_input_port_select & 0x02) == 0)  ret &= input_port_read(device->machine(), "KEY6");
347   if ((state->m_input_port_select & 0x04) == 0)  ret &= input_port_read(device->machine(), "KEY7");
348   if ((state->m_input_port_select & 0x08) == 0)  ret &= input_port_read(device->machine(), "KEY8");
349   if ((state->m_input_port_select & 0x10) == 0)  ret &= input_port_read(device->machine(), "KEY9");
345   if ((state->m_input_port_select & 0x01) == 0)  ret &= state->ioport("KEY5")->read();
346   if ((state->m_input_port_select & 0x02) == 0)  ret &= state->ioport("KEY6")->read();
347   if ((state->m_input_port_select & 0x04) == 0)  ret &= state->ioport("KEY7")->read();
348   if ((state->m_input_port_select & 0x08) == 0)  ret &= state->ioport("KEY8")->read();
349   if ((state->m_input_port_select & 0x10) == 0)  ret &= state->ioport("KEY9")->read();
350350
351351   return ret;
352352}
r15082r15083
357357{
358358   switch (m_dsw_select)
359359   {
360      case 0x00: return input_port_read(machine(), "DSW3");   /* DSW3 */
361      case 0x20: return input_port_read(machine(), "DSW4");   /* DSW4 */
362      case 0x40: return input_port_read(machine(), "DSW2");   /* DSW2 */
360      case 0x00: return ioport("DSW3")->read();   /* DSW3 */
361      case 0x20: return ioport("DSW4")->read();   /* DSW4 */
362      case 0x40: return ioport("DSW2")->read();   /* DSW2 */
363363   }
364364   return 0;
365365}
r15082r15083
376376   {
377377      switch (m_suzume_bank)
378378      {
379         case 0x08: return input_port_read(machine(), "DSW4");   /* DSW4 */
380         case 0x10: return input_port_read(machine(), "DSW3");   /* DSW3 */
381         case 0x18: return input_port_read(machine(), "DSW2");   /* DSW2 */
379         case 0x08: return ioport("DSW4")->read();   /* DSW4 */
380         case 0x10: return ioport("DSW3")->read();   /* DSW3 */
381         case 0x18: return ioport("DSW2")->read();   /* DSW2 */
382382      }
383383      return 0;
384384   }
r15082r15083
417417
418418READ8_MEMBER(royalmah_state::mjapinky_dsw_r)
419419{
420   if (m_rombank == 0x0e)   return input_port_read(machine(), "DSW3");
420   if (m_rombank == 0x0e)   return ioport("DSW3")->read();
421421   else               return *(machine().root_device().memregion("maincpu")->base() + 0x10000 + 0x8000 * m_rombank);
422422}
423423
r15082r15083
459459{
460460   switch (m_dsw_select)
461461   {
462      case 0x00: return input_port_read(machine(), "DSW4");
463      case 0x04: return input_port_read(machine(), "DSW1");
464      case 0x08: return input_port_read(machine(), "DSW2");
465      case 0x0c: return input_port_read(machine(), "DSW3");
462      case 0x00: return ioport("DSW4")->read();
463      case 0x04: return ioport("DSW1")->read();
464      case 0x08: return ioport("DSW2")->read();
465      case 0x0c: return ioport("DSW3")->read();
466466   }
467467
468468   return 0;
r15082r15083
487487{
488488   switch (m_dsw_select)
489489   {
490//      case 0x00: return input_port_read(machine(), "DSW4");
491      case 0x40: return input_port_read(machine(), "DSW2");
492      case 0x80: return input_port_read(machine(), "DSW3");
493      case 0xc0: return input_port_read(machine(), "DSW4");
490//      case 0x00: return ioport("DSW4")->read();
491      case 0x40: return ioport("DSW2")->read();
492      case 0x80: return ioport("DSW3")->read();
493      case 0xc0: return ioport("DSW4")->read();
494494   }
495495
496496   return 0;
r15082r15083
694694{
695695   switch (m_dsw_select & 7)
696696   {
697      case 1: return input_port_read(machine(), "DSW1");
698      case 2: return input_port_read(machine(), "DSW2");
699      case 4: return input_port_read(machine(), "DSW3");
697      case 1: return ioport("DSW1")->read();
698      case 2: return ioport("DSW2")->read();
699      case 4: return ioport("DSW3")->read();
700700   }
701701
702702   return 0xff;
r15082r15083
818818
819819READ8_MEMBER(royalmah_state::janptr96_dsw_r)
820820{
821   if (~m_dsw_select & 0x01) return input_port_read(machine(), "DSW4");
822   if (~m_dsw_select & 0x02) return input_port_read(machine(), "DSW3");
823   if (~m_dsw_select & 0x04) return input_port_read(machine(), "DSW2");
824   if (~m_dsw_select & 0x08) return input_port_read(machine(), "DSW1");
825   if (~m_dsw_select & 0x10) return input_port_read(machine(), "DSWTOP");
821   if (~m_dsw_select & 0x01) return ioport("DSW4")->read();
822   if (~m_dsw_select & 0x02) return ioport("DSW3")->read();
823   if (~m_dsw_select & 0x04) return ioport("DSW2")->read();
824   if (~m_dsw_select & 0x08) return ioport("DSW1")->read();
825   if (~m_dsw_select & 0x10) return ioport("DSWTOP")->read();
826826   return 0xff;
827827}
828828
r15082r15083
886886
887887   switch(offset)
888888   {
889      case 0x8000:   return input_port_read(machine(), "DSW4");      // dsw 4
890      case 0x8200:   return input_port_read(machine(), "DSW3");      // dsw 3
889      case 0x8000:   return ioport("DSW4")->read();      // dsw 4
890      case 0x8200:   return ioport("DSW3")->read();      // dsw 3
891891      case 0x9001:   return ay8910_r(machine().device("aysnd"), 0);   // inputs
892      case 0x9011:   return input_port_read(machine(), "SYSTEM");
892      case 0x9011:   return ioport("SYSTEM")->read();
893893   }
894894
895895   logerror("%04X: unmapped input read at %04X\n", cpu_get_pc(&space.device()), offset);
r15082r15083
940940
941941READ8_MEMBER(royalmah_state::mjifb_p3_r)
942942{
943   return input_port_read(machine(), "PORT3_5") >> 6;
943   return ioport("PORT3_5")->read() >> 6;
944944}
945945READ8_MEMBER(royalmah_state::mjifb_p5_r)
946946{
947   return input_port_read(machine(), "PORT3_5");
947   return ioport("PORT3_5")->read();
948948}
949949READ8_MEMBER(royalmah_state::mjifb_p6_r)
950950{
951   return input_port_read(machine(), "PORT6_7");
951   return ioport("PORT6_7")->read();
952952}
953953READ8_MEMBER(royalmah_state::mjifb_p7_r)
954954{
955   return input_port_read(machine(), "PORT6_7") >> 4;
955   return ioport("PORT6_7")->read() >> 4;
956956}
957957READ8_MEMBER(royalmah_state::mjifb_p8_r)
958958{
r15082r15083
995995
996996   switch(offset)
997997   {
998      case 0x8000:   return input_port_read(machine(), "DSW2");      // dsw 2
999      case 0x8001:   return input_port_read(machine(), "DSW1");      // dsw 1
998      case 0x8000:   return ioport("DSW2")->read();      // dsw 2
999      case 0x8001:   return ioport("DSW1")->read();      // dsw 1
10001000      case 0x9001:   return ay8910_r(machine().device("aysnd"), 0);   // inputs
1001      case 0x9011:   return input_port_read(machine(), "SYSTEM");
1001      case 0x9011:   return ioport("SYSTEM")->read();
10021002   }
10031003
10041004   logerror("%04X: unmapped input read at %04X\n", cpu_get_pc(&space.device()), offset);
r15082r15083
11131113{
11141114   switch( m_dsw_select )
11151115   {
1116      case 0x00: return input_port_read(machine(), "DSW1");
1117      case 0x01: return input_port_read(machine(), "DSW2");
1118      case 0x02: return input_port_read(machine(), "DSW3");
1119      case 0x03: return input_port_read(machine(), "DSW4");
1120      case 0x04: return input_port_read(machine(), "DSWTOP");
1116      case 0x00: return ioport("DSW1")->read();
1117      case 0x01: return ioport("DSW2")->read();
1118      case 0x02: return ioport("DSW3")->read();
1119      case 0x03: return ioport("DSW4")->read();
1120      case 0x04: return ioport("DSWTOP")->read();
11211121   }
11221122   logerror("%04X: unmapped dsw read %02X\n", cpu_get_pc(&space.device()), m_dsw_select);
11231123   return 0xff;
r15082r15083
18911891   PORT_DIPSETTING(    0x02, "B" )
18921892   PORT_DIPSETTING(    0x01, "C" )
18931893   PORT_DIPSETTING(    0x03, "D" )
1894   PORT_DIPUNUSED_DIPLOC( 0x0c, 0x08, "SW2:3,4" ) PORT_CONDITION("DSW3", 0x03, PORTCOND_EQUALS, 0x00)
1895   PORT_DIPUNUSED_DIPLOC( 0x0c, 0x08, "SW2:3,4" ) PORT_CONDITION("DSW3", 0x03, PORTCOND_EQUALS, 0x02)
1896   PORT_DIPNAME( 0x0c, 0x08, "Bonus Rate (3renchan bonus)" )   PORT_DIPLOCATION("SW2:3,4")   PORT_CONDITION("DSW3", 0x03, PORTCOND_EQUALS, 0x01)
1894   PORT_DIPUNUSED_DIPLOC( 0x0c, 0x08, "SW2:3,4" ) PORT_CONDITION("DSW3", 0x03, EQUALS, 0x00)
1895   PORT_DIPUNUSED_DIPLOC( 0x0c, 0x08, "SW2:3,4" ) PORT_CONDITION("DSW3", 0x03, EQUALS, 0x02)
1896   PORT_DIPNAME( 0x0c, 0x08, "Bonus Rate (3renchan bonus)" )   PORT_DIPLOCATION("SW2:3,4")   PORT_CONDITION("DSW3", 0x03, EQUALS, 0x01)
18971897   PORT_DIPSETTING(    0x00, "A (1 2 2 3 pts.)" )
18981898   PORT_DIPSETTING(    0x04, "B (1 2 2 5 pts.)" )
18991899   PORT_DIPSETTING(    0x08, "C (1 2 3 6 pts.)" )
19001900   PORT_DIPSETTING(    0x0c, "D (1 2 6 10 pts.)" )
1901   PORT_DIPNAME( 0x0c, 0x08, "Bonus Rate (5renchan bonus)" )   PORT_DIPLOCATION("SW2:3,4")   PORT_CONDITION("DSW3", 0x03, PORTCOND_EQUALS, 0x03)
1901   PORT_DIPNAME( 0x0c, 0x08, "Bonus Rate (5renchan bonus)" )   PORT_DIPLOCATION("SW2:3,4")   PORT_CONDITION("DSW3", 0x03, EQUALS, 0x03)
19021902   PORT_DIPSETTING(    0x00, "A (5 pts.)" )
19031903   PORT_DIPSETTING(    0x04, "B (10 pts.)" )
19041904   PORT_DIPSETTING(    0x08, "C (15 pts.)" )
src/mame/drivers/mquake.c
r15082r15083
107107static READ16_HANDLER( coin_chip_r )
108108{
109109   if (offset == 1)
110      return input_port_read(space->machine(), "COINCHIP");
110      return space->machine().root_device().ioport("COINCHIP")->read();
111111   logerror("%06x:coin_chip_r(%02x) & %04x\n", cpu_get_pc(&space->device()), offset, mem_mask);
112112   return 0xffff;
113113}
src/mame/drivers/shisen.c
r15082r15083
1515
1616READ8_MEMBER(shisen_state::sichuan2_dsw1_r)
1717{
18   int ret = input_port_read(machine(), "DSW1");
18   int ret = ioport("DSW1")->read();
1919
2020   /* Based on the coin mode fill in the upper bits */
21   if (input_port_read(machine(), "DSW2") & 0x04)
21   if (ioport("DSW2")->read() & 0x04)
2222   {
2323      /* Mode 1 */
24      ret   |= (input_port_read(machine(), "DSW1") << 4);
24      ret   |= (ioport("DSW1")->read() << 4);
2525   }
2626   else
2727   {
2828      /* Mode 2 */
29      ret   |= (input_port_read(machine(), "DSW1") & 0xf0);
29      ret   |= (ioport("DSW1")->read() & 0xf0);
3030   }
3131
3232   return ret;
r15082r15083
117117   PORT_DIPSETTING(    0x08, DEF_STR( Normal ) )
118118   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
119119   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
120   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_EQUALS,0x04) PORT_DIPLOCATION("SW1:5,6,7,8")
120   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2",0x04,EQUALS,0x04) PORT_DIPLOCATION("SW1:5,6,7,8")
121121   PORT_DIPSETTING(    0xa0, DEF_STR( 6C_1C ) )
122122   PORT_DIPSETTING(    0xb0, DEF_STR( 5C_1C ) )
123123   PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
r15082r15083
134134   PORT_DIPSETTING(    0x60, DEF_STR( 1C_5C ) )
135135   PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ) )
136136   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
137   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:5,6")
137   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2",0x04,NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:5,6")
138138   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
139139   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
140140   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
141141   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
142   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:7,8")
142   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2",0x04,NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:7,8")
143143   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )
144144   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
145145   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
src/mame/drivers/nmk16.c
r15082r15083
257257      return res << 8;
258258   }
259259   else
260      return ~input_port_read(machine(), "IN1");
260      return ~ioport("IN1")->read();
261261}
262262
263263WRITE16_MEMBER(nmk16_state::macross2_sound_reset_w)
r15082r15083
750750   /*needed because of the uncompatibility of the dsw settings.*/
751751   if(dsw_setting) // Thunder Dragon
752752   {
753      dsw[0] = (input_port_read(machine, "DSW2") & 0x7);
754      dsw[1] = (input_port_read(machine, "DSW2") & 0x38) >> 3;
753      dsw[0] = (machine.root_device().ioport("DSW2")->read() & 0x7);
754      dsw[1] = (machine.root_device().ioport("DSW2")->read() & 0x38) >> 3;
755755      for(i=0;i<2;i++)
756756      {
757757         switch(dsw[i] & 7)
r15082r15083
769769   }
770770   else // Hacha Mecha Fighter
771771   {
772      dsw[0] = (input_port_read(machine, "DSW1") & 0x0700) >> 8;
773      dsw[1] = (input_port_read(machine, "DSW1") & 0x3800) >> 11;
772      dsw[0] = (machine.root_device().ioport("DSW1")->read() & 0x0700) >> 8;
773      dsw[1] = (machine.root_device().ioport("DSW1")->read() & 0x3800) >> 11;
774774      for(i=0;i<2;i++)
775775      {
776776         switch(dsw[i] & 7)
r15082r15083
788788   }
789789
790790   /*read the coin port*/
791   coin_input = (~(input_port_read(machine, "IN0")));
791   coin_input = (~(machine.root_device().ioport("IN0")->read()));
792792
793793   if(coin_input & 0x01)//coin 1
794794   {
src/mame/drivers/m10.c
r15082r15083
251251   /* I have NO IDEA if this is correct or not */
252252   m_bottomline = ~data & 0x20;
253253
254   if (input_port_read(machine(), "CAB") & 0x01)
254   if (ioport("CAB")->read() & 0x01)
255255      m_flip = ~data & 0x10;
256256
257   if (!(input_port_read(machine(), "CAB") & 0x02))
257   if (!(ioport("CAB")->read() & 0x02))
258258      machine().sound().system_mute(data & 0x80);
259259
260260   /* sound command in lower 4 bytes */
r15082r15083
326326
327327   m_bottomline = ~data & 0x20;
328328
329   if (input_port_read(machine(), "CAB") & 0x01)
329   if (ioport("CAB")->read() & 0x01)
330330      m_flip = ~data & 0x10;
331331
332   if (!(input_port_read(machine(), "CAB") & 0x02))
332   if (!(ioport("CAB")->read() & 0x02))
333333      machine().sound().system_mute(data & 0x80);
334334}
335335
r15082r15083
355355   if (data & 0xf0)
356356      popmessage("M15 ctrl: %02x",data);
357357#endif
358   if (input_port_read(machine(), "CAB") & 0x01)
358   if (ioport("CAB")->read() & 0x01)
359359      m_flip = ~data & 0x04;
360   if (!(input_port_read(machine(), "CAB") & 0x02))
360   if (!(ioport("CAB")->read() & 0x02))
361361      machine().sound().system_mute(data & 0x08);
362362}
363363
src/osd/sdl/input.c
r15082r15083
16511651   // loop over the defaults
16521652   for (entry = typelist.first(); entry != NULL; entry = entry->next())
16531653   {
1654      switch (entry->type)
1654      switch (entry->type())
16551655      {
16561656         // configurable UI mode switch
16571657         case IPT_UI_TOGGLE_UI:
r15082r15083
16701670               mameid_code = lookup_mame_code(fullmode);
16711671            }
16721672            ui_code = input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(mameid_code));
1673            entry->defseq[SEQ_TYPE_STANDARD].set(ui_code);
1673            entry->defseq(SEQ_TYPE_STANDARD).set(ui_code);
16741674            break;
16751675         // alt-enter for fullscreen
16761676         case IPT_OSD_1:
1677            entry->token = "TOGGLE_FULLSCREEN";
1678            entry->name = "Toggle Fullscreen";
1679            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_ENTER, KEYCODE_LALT);
1677            entry->configure_osd("TOGGLE_FULLSCREEN", "Toggle Fullscreen");
1678            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_ENTER, KEYCODE_LALT);
16801679            break;
16811680
16821681         // disable UI_SELECT when LALT is down, this stops selecting
16831682         // things in the menu when toggling fullscreen with LALT+ENTER
16841683/*          case IPT_UI_SELECT:
1685                entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_ENTER, input_seq::not_code, KEYCODE_LALT);
1684                entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_ENTER, input_seq::not_code, KEYCODE_LALT);
16861685                break;*/
16871686
16881687         // page down for fastforward (must be OSD_3 as per src/emu/ui.c)
16891688         case IPT_UI_FAST_FORWARD:
1690            entry->token = "FAST_FORWARD";
1691            entry->name = "Fast Forward";
1692            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_PGDN);
1689            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_PGDN);
16931690            break;
16941691
16951692         // OSD hotkeys use LCTRL and start at F3, they start at
r15082r15083
16991696
17001697         // LCTRL-F3 to toggle fullstretch
17011698         case IPT_OSD_2:
1702            entry->token = "TOGGLE_FULLSTRETCH";
1703            entry->name = "Toggle Uneven stretch";
1704            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F3, KEYCODE_LCONTROL);
1699            entry->configure_osd("TOGGLE_FULLSTRETCH", "Toggle Uneven stretch");
1700            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F3, KEYCODE_LCONTROL);
17051701            break;
17061702         // add a Not lcrtl condition to the reset key
17071703         case IPT_UI_SOFT_RESET:
1708            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F3, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
1704            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F3, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
17091705            break;
17101706
17111707         // LCTRL-F4 to toggle keep aspect
17121708         case IPT_OSD_4:
1713            entry->token = "TOGGLE_KEEP_ASPECT";
1714            entry->name = "Toggle Keepaspect";
1715            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F4, KEYCODE_LCONTROL);
1709            entry->configure_osd("TOGGLE_KEEP_ASPECT", "Toggle Keepaspect");
1710            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F4, KEYCODE_LCONTROL);
17161711            break;
17171712         // add a Not lcrtl condition to the show gfx key
17181713         case IPT_UI_SHOW_GFX:
1719            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F4, input_seq::not_code, KEYCODE_LCONTROL);
1714            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F4, input_seq::not_code, KEYCODE_LCONTROL);
17201715            break;
17211716
17221717         // LCTRL-F5 to toggle OpenGL filtering
17231718         case IPT_OSD_5:
1724            entry->token = "TOGGLE_FILTER";
1725            entry->name = "Toggle Filter";
1726            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F5, KEYCODE_LCONTROL);
1719            entry->configure_osd("TOGGLE_FILTER", "Toggle Filter");
1720            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, KEYCODE_LCONTROL);
17271721            break;
17281722         // add a Not lcrtl condition to the toggle debug key
17291723         case IPT_UI_TOGGLE_DEBUG:
1730            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F5, input_seq::not_code, KEYCODE_LCONTROL);
1724            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, input_seq::not_code, KEYCODE_LCONTROL);
17311725            break;
17321726
17331727         // LCTRL-F6 to decrease OpenGL prescaling
17341728         case IPT_OSD_6:
1735            entry->token = "DECREASE_PRESCALE";
1736            entry->name = "Decrease Prescaling";
1737            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F6, KEYCODE_LCONTROL);
1729            entry->configure_osd("DECREASE_PRESCALE", "Decrease Prescaling");
1730            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F6, KEYCODE_LCONTROL);
17381731            break;
17391732         // add a Not lcrtl condition to the toggle cheat key
17401733         case IPT_UI_TOGGLE_CHEAT:
1741            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F6, input_seq::not_code, KEYCODE_LCONTROL);
1734            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F6, input_seq::not_code, KEYCODE_LCONTROL);
17421735            break;
17431736
17441737         // LCTRL-F7 to increase OpenGL prescaling
17451738         case IPT_OSD_7:
1746            entry->token = "INCREASE_PRESCALE";
1747            entry->name = "Increase Prescaling";
1748            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F7, KEYCODE_LCONTROL);
1739            entry->configure_osd("INCREASE_PRESCALE", "Increase Prescaling");
1740            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F7, KEYCODE_LCONTROL);
17491741            break;
17501742         // add a Not lcrtl condition to the load state key
17511743         case IPT_UI_LOAD_STATE:
1752            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F7, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
1744            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F7, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
17531745            break;
17541746
17551747         // add a Not lcrtl condition to the throttle key
17561748         case IPT_UI_THROTTLE:
1757            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F10, input_seq::not_code, KEYCODE_LCONTROL);
1749            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F10, input_seq::not_code, KEYCODE_LCONTROL);
17581750            break;
17591751
17601752         // disable the config menu if the ALT key is down
17611753         // (allows ALT-TAB to switch between apps)
17621754         case IPT_UI_CONFIGURE:
1763            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
1755            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
17641756            break;
1757
1758         // leave everything else alone
1759         default:
1760            break;
17651761      }
17661762   }
17671763}
src/osd/windows/windows.mak
r15082r15083
247247TEST_GCC = $(shell gcc --version)
248248ifeq ($(findstring 4.4,$(TEST_GCC)),)
249249   #if we use new tools
250   LDFLAGS += -static -static-libstdc++
250   LDFLAGS += -static-libstdc++
251251endif
252252
253253# add the windows libraries
src/osd/windows/input.c
r15082r15083
767767
768768   // loop over the defaults
769769   for (entry = typelist.first(); entry != NULL; entry = entry->next())
770      switch (entry->type)
770      switch (entry->type())
771771      {
772772         // disable the config menu if the ALT key is down
773773         // (allows ALT-TAB to switch between windows apps)
774774         case IPT_UI_CONFIGURE:
775            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
775            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
776776            break;
777777
778778         // alt-enter for fullscreen
779779         case IPT_OSD_1:
780            entry->token = "TOGGLE_FULLSCREEN";
781            entry->name = "Toggle Fullscreen";
782            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_LALT, KEYCODE_ENTER);
780            entry->configure_osd("TOGGLE_FULLSCREEN", "Toggle Fullscreen");
781            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_LALT, KEYCODE_ENTER);
783782            break;
784783
785784         // alt-F12 for fullscreen snap
786785         case IPT_OSD_2:
787            entry->token = "RENDER_SNAP";
788            entry->name = "Take Rendered Snapshot";
789            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_LALT, KEYCODE_F12);
786            entry->configure_osd("RENDER_SNAP", "Take Rendered Snapshot");
787            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_LALT, KEYCODE_F12);
790788            break;
791789
792790         // alt-F11 for fullscreen video
793791         case IPT_OSD_3:
794            entry->token = "RENDER_AVI";
795            entry->name = "Record Rendered Video";
796            entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_LALT, KEYCODE_F11);
792            entry->configure_osd("RENDER_AVI", "Record Rendered Video");
793            entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_LALT, KEYCODE_F11);
797794            break;
795         
796         // leave everything else alone
797         default:
798            break;
798799      }
799800}
800801
src/osd/windows/debugwin.c
r15082r15083
335335
336336static int debugwin_seq_pressed(running_machine &machine)
337337{
338   const input_seq &seq = input_type_seq(machine, IPT_UI_DEBUG_BREAK, 0, SEQ_TYPE_STANDARD);
338   const input_seq &seq = machine.ioport().type_seq(IPT_UI_DEBUG_BREAK);
339339   int result = FALSE;
340340   int invert = FALSE;
341341   int first = TRUE;
src/emu/cpu/m68000/m68000.h
r15082r15083
142142
143143void m68307_set_port_callbacks(device_t *device, m68307_porta_read_callback porta_r, m68307_porta_write_callback m_m68307_porta_w, m68307_portb_read_callback portb_r, m68307_portb_write_callback m_m68307_portb_w);
144144UINT16 m68307_get_cs(device_t *device, offs_t address);
145UINT16 m68340_get_cs(device_t *device, offs_t address);
145146void m68307_set_interrupt(device_t *device, int level, int vector);
146147void m68307_timer0_interrupt(legacy_cpu_device *cpudev);
147148void m68307_timer1_interrupt(legacy_cpu_device *cpudev);
src/emu/cpu/m68000/m68kcpu.c
r15082r15083
13181318   write32 = m68k_write32_delegate(FUNC(address_space::write_dword), &space);
13191319}
13201320
1321/* todo: is it possible to calculate the address map based on CS when they change
1322   and install handlers?  Going through this logic for every memory access is
1323   very slow */
1324
13211325int m68307_calc_cs(m68ki_cpu_core *m68k, offs_t address)
13221326{
13231327   m68307_sim* sim = m68k->m68307SIM;
r15082r15083
13331337   return 0;
13341338}
13351339
1340/* see note above */
13361341
1342int m68340_calc_cs(m68ki_cpu_core *m68k, offs_t address)
1343{
1344   m68340_sim* sim = m68k->m68340SIM;
13371345
1346   if ( !(sim->m_ba[0] & 1) ) return 1;
1347
1348   for (int i=0;i<4;i++)
1349   {
1350      if (sim->m_ba[i] & 1)
1351      {
1352         int mask = ((sim->m_am[i]&0xffffff00) | 0xff);
1353         int base = sim->m_ba[i] & 0xffffff00;
1354         int fcmask = (sim->m_am[i] & 0xf0);
1355         int fcbase = (sim->m_ba[i] & 0xf0) & ~(sim->m_am[i] & 0xf0);
1356         int fc = m68k->mmu_tmp_fc;
1357
1358         if ((address & ~mask) == base && ((fc << 4) & ~fcmask ) == fcbase ) return i+1;
1359      }
1360   }
1361
1362   return 0;
1363}
1364
1365
1366
1367
13381368UINT16 m68k_memory_interface::simple_read_immediate_16_m68307(offs_t address)
13391369{
13401370//  m_cpustate->m68307_currentcs = m68307_calc_cs(m_cpustate, address);
r15082r15083
18201850   return m68k->m68307_currentcs;
18211851}
18221852
1853UINT16 m68340_get_cs(device_t *device, offs_t address)
1854{
1855   m68ki_cpu_core *m68k = m68k_get_safe_token(device);
1856
1857   m68k->m68307_currentcs = m68340_calc_cs(m68k, address);
1858
1859   return m68k->m68307_currentcs;
1860}
1861
18231862/****************************************************************************
18241863 * State definition
18251864 ****************************************************************************/
src/emu/devcb.c
r15082r15083
6363class devcb_resolver
6464{
6565public:
66   static const input_port_config *resolve_port(const char *tag, device_t &current);
66   static ioport_port *resolve_port(const char *tag, device_t &current);
6767   static device_t *resolve_device(int index, const char *tag, device_t &current);
6868   static device_execute_interface *resolve_execute_interface(const char *tag, device_t &current);
6969   static address_space *resolve_space(int index, const char *tag, device_t &current);
r15082r15083
8080//  based on the provided tag
8181//-------------------------------------------------
8282
83const input_port_config *devcb_resolver::resolve_port(const char *tag, device_t &current)
83ioport_port *devcb_resolver::resolve_port(const char *tag, device_t &current)
8484{
8585   astring fullname;
86   const input_port_config *result = current.ioport(current.siblingtag(fullname, tag));
86   ioport_port *result = current.ioport(current.siblingtag(fullname, tag));
8787   if (result == NULL)
8888      throw emu_fatalerror("Unable to find input port '%s' (requested by %s '%s')", fullname.cstr(), current.name(), current.tag());
8989   return result;
r15082r15083
221221
222222int devcb_resolved_read_line::from_port()
223223{
224   return (input_port_read_direct(m_object.port) & 1) ? ASSERT_LINE : CLEAR_LINE;
224   return (m_object.port->read() & 1) ? ASSERT_LINE : CLEAR_LINE;
225225}
226226
227227
r15082r15083
325325
326326void devcb_resolved_write_line::to_port(int state)
327327{
328   input_port_write_direct(m_object.port, state, 0xffffffff);
328   m_object.port->write(state, 0xffffffff);
329329}
330330
331331
r15082r15083
419419
420420UINT8 devcb_resolved_read8::from_port(offs_t offset)
421421{
422   return input_port_read_direct(m_object.port);
422   return m_object.port->read();
423423}
424424
425425
r15082r15083
522522
523523void devcb_resolved_write8::to_port(offs_t offset, UINT8 data)
524524{
525   input_port_write_direct(m_object.port, data, 0xff);
525   m_object.port->write(data, 0xff);
526526}
527527
528528
r15082r15083
616616
617617UINT16 devcb_resolved_read16::from_port(offs_t offset, UINT16 mask)
618618{
619   return input_port_read_direct(m_object.port);
619   return m_object.port->read();
620620}
621621
622622
r15082r15083
719719
720720void devcb_resolved_write16::to_port(offs_t offset, UINT16 data, UINT16 mask)
721721{
722   input_port_write_direct(m_object.port, data, mask);
722   m_object.port->write(data, mask);
723723}
724724
725725
src/emu/video/pc_cga.c
r15082r15083
138138INPUT_PORTS_END
139139
140140/* Dipswitch for font selection */
141#define CGA_FONT        (input_port_read_direct(cga.config_input_port)&3)
141#define CGA_FONT        (cga.config_input_port->read()&3)
142142
143143/* Dipswitch for monitor selection */
144#define CGA_MONITOR     (input_port_read_direct(cga.config_input_port)&0x1C)
144#define CGA_MONITOR     (cga.config_input_port->read()&0x1C)
145145#define CGA_MONITOR_RGB         0x00    /* Colour RGB */
146146#define CGA_MONITOR_MONO        0x04    /* Greyscale RGB */
147147#define CGA_MONITOR_COMPOSITE   0x08    /* Colour composite */
r15082r15083
150150
151151
152152/* Dipswitch for chipset selection */
153#define CGA_CHIPSET     (input_port_read_direct(cga.config_input_port)&0xE0)
153#define CGA_CHIPSET     (cga.config_input_port->read()&0xE0)
154154#define CGA_CHIPSET_IBM         0x00    /* Original IBM CGA */
155155#define CGA_CHIPSET_PC1512      0x20    /* PC1512 CGA subset */
156156#define CGA_CHIPSET_PC200       0x40    /* PC200 in CGA mode */
r15082r15083
242242
243243   UINT8   *chr_gen;
244244
245   const input_port_config *config_input_port;
245   ioport_port *config_input_port;
246246
247247   mc6845_update_row_func   update_row;
248248   UINT8   palette_lut_2bpp[4];
src/emu/devcb.h
r15082r15083
203203// resolving a devcb may produce one of the following object types
204204union devcb_resolved_objects
205205{
206   const input_port_config *   port;
206   ioport_port *   port;
207207   address_space *            space;
208208   device_t *               device;
209209   device_execute_interface *   execute;
src/emu/uimenu.c
r15082r15083
907907
908908   /* see if any other UI keys are pressed */
909909   if (menu_event.iptkey == IPT_INVALID)
910      for (code = __ipt_ui_start; code <= __ipt_ui_end; code++)
910      for (code = IPT_UI_FIRST + 1; code < IPT_UI_LAST; code++)
911911      {
912912         if (code == IPT_UI_CONFIGURE || (code == IPT_UI_LEFT && ignoreleft) || (code == IPT_UI_RIGHT && ignoreright) || (code == IPT_UI_PAUSE && ignorepause))
913913            continue;
src/emu/emu.h
r15082r15083
8181class machine_config;
8282typedef device_t * (*machine_config_constructor)(machine_config &config, device_t *owner);
8383
84// device_delegate is a delegate that wraps with a device tag and can be easily
85// late bound without replicating logic everywhere
86template<typename _Signature>
87class device_delegate : public delegate<_Signature>
88{
89   typedef delegate<_Signature> basetype;
90
91public:
92   // provide same set of constructors as the base class, with additional device name
93   // parameter
94   device_delegate() : basetype(), m_device_name(NULL) { }
95   device_delegate(const basetype &src) : basetype(src), m_device_name(src.m_device_name) { }
96   device_delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object), m_device_name(src.m_device_name) { }
97   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) { }
98   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) { }
99   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) { }
100   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) { }
101   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) { }
102   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) { }
103   device_delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; m_device_name = src.m_device_name; return *this; }
104
105   // perform the binding
106   void bind_relative_to(device_t &search_root);
107
108private:
109   // internal state
110   const char *m_device_name;
111};
112
84113// I/O
85114#include "input.h"
86115#include "ioport.h"
src/emu/rendlay.c
r15082r15083
22082208   // if configured to an input, fetch the input value
22092209   else if (m_input_tag[0] != 0)
22102210   {
2211      const input_field_config *field = input_field_by_tag_and_mask(m_element->machine(), m_input_tag, m_input_mask);
2212      if (field != NULL)
2213         state = ((input_port_read_safe(m_element->machine(), m_input_tag, 0) ^ field->defvalue) & m_input_mask) ? 1 : 0;
2211      ioport_port *port = m_element->machine().root_device().ioport(m_input_tag);
2212      if (port != NULL)
2213      {
2214         ioport_field *field = port->field(m_input_mask);
2215         if (field != NULL)
2216            state = ((port->read() ^ field->defvalue()) & m_input_mask) ? 1 : 0;
2217      }
22142218   }
22152219   return state;
22162220}
src/emu/machine.c
r15082r15083
284284   // allocate the gfx elements prior to device initialization
285285   gfx_init(*this);
286286
287   // initialize natural keyboard support
288   inputx_init(*this);
289
290287   // initialize image devices
291288   image_init(*this);
292289   m_tilemap = auto_alloc(*this, tilemap_manager(*this));
src/emu/sound/disc_cls.h
r15082r15083
149149   void step(void);
150150   void reset(void);
151151private:
152   const input_port_config *m_port;
152   ioport_port *m_port;
153153   INT32               m_lastpval;
154154   INT32               m_pmin;
155155   double               m_pscale;
src/emu/sound/disc_inp.c
r15082r15083
5555
5656DISCRETE_STEP(dss_adjustment)
5757{
58   INT32  rawportval = input_port_read_direct(m_port);
58   INT32  rawportval = m_port->read();
5959
6060   /* only recompute if the value changed from last time */
6161   if (UNEXPECTED(rawportval != m_lastpval))
src/emu/ioport.c
r15082r15083
44
55    Input/output port handling.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038****************************************************************************
1139
1240    Theory of operation
r15082r15083
103131#include <ctype.h>
104132#include <time.h>
105133
106/* temporary: set this to 1 to enable the originally defined behavior that
107   a field specified via PORT_MODIFY which intersects a previously-defined
108   field completely wipes out the previous definition */
134// temporary: set this to 1 to enable the originally defined behavior that
135// a field specified via PORT_MODIFY which intersects a previously-defined
136// field completely wipes out the previous definition
109137#define INPUT_PORT_OVERRIDE_FULLY_NUKES_PREVIOUS   1
110138
111139
112/***************************************************************************
113    CONSTANTS
114***************************************************************************/
140//**************************************************************************
141//  DEBUGGING
142//**************************************************************************
115143
116/* these constants must match the order of the joystick directions in the IPT definition */
117#define JOYDIR_UP         0
118#define JOYDIR_DOWN         1
119#define JOYDIR_LEFT         2
120#define JOYDIR_RIGHT      3
144#define LOG_NATURAL_KEYBOARD   0
121145
122#define JOYDIR_UP_BIT      (1 << JOYDIR_UP)
123#define JOYDIR_DOWN_BIT      (1 << JOYDIR_DOWN)
124#define JOYDIR_LEFT_BIT      (1 << JOYDIR_LEFT)
125#define JOYDIR_RIGHT_BIT   (1 << JOYDIR_RIGHT)
126146
127#define LOG_INPUTX      0
128#define SPACE_COUNT      3
129#define INVALID_CHAR   '?'
130#define IP_NAME_DEFAULT   NULL
131147
148//**************************************************************************
149//  CONSTANTS
150//**************************************************************************
132151
133/***************************************************************************
134    TYPE DEFINITIONS
135***************************************************************************/
152const int SPACE_COUNT = 3;
153const int KEY_BUFFER_SIZE = 4096;
154const unicode_char INVALID_CHAR = '?';
136155
137/* live analog field information */
138typedef struct _analog_field_state analog_field_state;
139struct _analog_field_state
156
157
158//**************************************************************************
159//  TYPE DEFINITIONS
160//**************************************************************************
161
162// live analog field information
163class analog_field
140164{
141   analog_field_state *      next;            /* link to the next analog state for this port */
142   const input_field_config *   field;            /* pointer to the input field referenced */
165   friend class simple_list<analog_field>;
166   friend class ioport_manager;
167   friend void ioport_field::set_user_settings(const ioport_field::user_settings &settings);
168   
169public:
170   // construction/destruction
171   analog_field(ioport_field &field);
172   
173   // getters
174   analog_field *next() const { return m_next; }
175   ioport_manager &manager() const { return m_field.manager(); }
176   ioport_field &field() const { return m_field; }
177   INT32 sensitivity() const { return m_sensitivity; }
178   bool reverse() const { return m_reverse; }
179   INT32 delta() const { return m_delta; }
180   INT32 centerdelta() const { return m_centerdelta; }
143181
144   /* adjusted values (right-justified and tweaked) */
145   UINT8                  shift;            /* shift to align final value in the port */
146   INT32                  adjdefvalue;      /* adjusted default value from the config */
147   INT32                  adjmin;            /* adjusted minimum value from the config */
148   INT32                  adjmax;            /* adjusted maximum value from the config */
182   // helpers
183   ioport_value apply_min_max(ioport_value value) const;
184   ioport_value apply_settings(ioport_value value) const;
185   ioport_value apply_sensitivity(ioport_value value) const;
186   ioport_value apply_inverse_sensitivity(ioport_value value) const;
149187
150   /* live values of configurable parameters */
151   INT32                  sensitivity;      /* current live sensitivity (100=normal) */
152   UINT8                  reverse;         /* current live reverse flag */
153   INT32                  delta;            /* current live delta to apply each frame a digital inc/dec key is pressed */
154   INT32                  centerdelta;      /* current live delta to apply each frame no digital inputs are pressed */
188   // readers
189   void read(ioport_value &value);
190   float crosshair_read();
191   void frame_update(running_machine &machine);
192   
193private:
194   // internal state
195   analog_field *      m_next;               // link to the next analog state for this port
196   ioport_field &      m_field;            // pointer to the input field referenced
155197
156   /* live analog value tracking */
157   INT32                  accum;            /* accumulated value (including relative adjustments) */
158   INT32                  previous;         /* previous adjusted value */
159   INT32                  previousanalog;      /* previous analog value */
198   // adjusted values (right-justified and tweaked)
199   UINT8            m_shift;            // shift to align final value in the port
200   INT32            m_adjdefvalue;         // adjusted default value from the config
201   INT32            m_adjmin;            // adjusted minimum value from the config
202   INT32            m_adjmax;            // adjusted maximum value from the config
160203
161   /* parameters for modifying live values */
162   INT32                  minimum;         /* minimum adjusted value */
163   INT32                  maximum;         /* maximum adjusted value */
164   INT32                  center;            /* center adjusted value for autocentering */
165   INT32                  reverse_val;      /* value where we subtract from to reverse directions */
204   // live values of configurable parameters
205   INT32            m_sensitivity;         // current live sensitivity (100=normal)
206   bool            m_reverse;            // current live reverse flag
207   INT32            m_delta;            // current live delta to apply each frame a digital inc/dec key is pressed
208   INT32            m_centerdelta;         // current live delta to apply each frame no digital inputs are pressed
166209
167   /* scaling factors */
168   INT64                  scalepos;         /* scale factor to apply to positive adjusted values */
169   INT64                  scaleneg;         /* scale factor to apply to negative adjusted values */
170   INT64                  keyscalepos;      /* scale factor to apply to the key delta field when pos */
171   INT64                  keyscaleneg;      /* scale factor to apply to the key delta field when neg */
172   INT64                  positionalscale;   /* scale factor to divide a joystick into positions */
210   // live analog value tracking
211   INT32            m_accum;            // accumulated value (including relative adjustments)
212   INT32            m_previous;            // previous adjusted value
213   INT32            m_previousanalog;      // previous analog value
173214
174   /* misc flags */
175   UINT8                  absolute;         /* is this an absolute or relative input? */
176   UINT8                  wraps;            /* does the control wrap around? */
177   UINT8                  autocenter;         /* autocenter this input? */
178   UINT8                  single_scale;      /* scale joystick differently if default is between min/max */
179   UINT8                  interpolate;      /* should we do linear interpolation for mid-frame reads? */
180   UINT8                  lastdigital;      /* was the last modification caused by a digital form? */
215   // parameters for modifying live values
216   INT32            m_minimum;            // minimum adjusted value
217   INT32            m_maximum;            // maximum adjusted value
218   INT32            m_center;            // center adjusted value for autocentering
219   INT32            m_reverse_val;         // value where we subtract from to reverse directions
220
221   // scaling factors
222   INT64            m_scalepos;            // scale factor to apply to positive adjusted values
223   INT64            m_scaleneg;            // scale factor to apply to negative adjusted values
224   INT64            m_keyscalepos;         // scale factor to apply to the key delta field when pos
225   INT64            m_keyscaleneg;         // scale factor to apply to the key delta field when neg
226   INT64            m_positionalscale;      // scale factor to divide a joystick into positions
227
228   // misc flags
229   bool            m_absolute;            // is this an absolute or relative input?
230   bool            m_wraps;            // does the control wrap around?
231   bool            m_autocenter;         // autocenter this input?
232   bool            m_single_scale;         // scale joystick differently if default is between min/max
233   bool            m_interpolate;         // should we do linear interpolation for mid-frame reads?
234   bool            m_lastdigital;         // was the last modification caused by a digital form?
181235};
182236
183237
184/* live device field information */
185typedef struct _device_field_info device_field_info;
186struct _device_field_info
238// live device field information
239class dynamic_field
187240{
188   device_field_info *         next;            /* linked list of info for this port */
189   const input_field_config *   field;            /* pointer to the input field referenced */
190   device_t *               device;            /* device */
191   UINT8                  shift;            /* shift to apply to the final result */
192   input_port_value         oldval;            /* last value */
241   friend class simple_list<dynamic_field>;
242   
243public:
244   // construction/destruction
245   dynamic_field(ioport_field &field);
246   
247   // getters
248   dynamic_field *next() const { return m_next; }
249   ioport_field &field() const { return m_field; }
250   
251   // read/write
252   void read(ioport_value &result);
253   void write(ioport_value newval);
254   
255private:
256   // internal state
257   dynamic_field *         m_next;            // linked list of info for this port
258   ioport_field &         m_field;         // reference to the input field
259   UINT8               m_shift;         // shift to apply to the final result
260   ioport_value         m_oldval;         // last value
193261};
194262
195263
196/* internal live state of an input field */
197struct _input_field_state
264// internal live state of an input field
265struct ioport_field_live
198266{
199   analog_field_state *      analog;            /* pointer to live analog data if this is an analog field */
200   digital_joystick_state *   joystick;         /* pointer to digital joystick information */
201   input_seq               seq[SEQ_TYPE_TOTAL];/* currently configured input sequences */
202   input_port_value         value;            /* current value of this port */
203   UINT8                  impulse;         /* counter for impulse controls */
204   UINT8                  last;            /* were we pressed last time? */
205   UINT8                  joydir;            /* digital joystick direction index */
206   char *                  name;            /* overridden name */
267   // construction/destruction
268   ioport_field_live(ioport_field &field, analog_field *analog);
269
270   // public state
271   analog_field *         analog;            // pointer to live analog data if this is an analog field
272   digital_joystick *      joystick;         // pointer to digital joystick information
273   input_seq            seq[SEQ_TYPE_TOTAL];// currently configured input sequences
274   ioport_value         value;            // current value of this port
275   UINT8               impulse;         // counter for impulse controls
276   bool               last;            // were we pressed last time?
277   digital_joystick::direction_t joydir;      // digital joystick direction index
278   astring               name;            // overridden name
207279};
208280
209281
210/* internal live state of an input port */
211struct _input_port_state
282// internal live state of an input port
283struct ioport_port_live
212284{
213   analog_field_state *      analoglist;         /* pointer to list of analog port info */
214   device_field_info *         readdevicelist;      /* pointer to list of input device info */
215   device_field_info *         writedevicelist;   /* pointer to list of output device info */
216   input_port_value         defvalue;         /* combined default value across the port */
217   input_port_value         digital;         /* current value from all digital inputs */
218   input_port_value         vblank;            /* value of all IPT_VBLANK bits */
219   input_port_value         outputvalue;      /* current value for outputs */
285   // construction/destruction
286   ioport_port_live(ioport_port &port);
287   
288   // public state
289   simple_list<analog_field> analoglist;      // list of analog port info
290   simple_list<dynamic_field> readlist;      // list of dynamic read fields
291   simple_list<dynamic_field> writelist;      // list of dynamic write fields
292   ioport_value         defvalue;         // combined default value across the port
293   ioport_value         digital;         // current value from all digital inputs
294   ioport_value         outputvalue;      // current value for outputs
220295};
221296
222297
223#define KEY_BUFFER_SIZE   4096
224
225typedef struct _char_info char_info;
226struct _char_info
298// character information
299struct char_info
227300{
228301   unicode_char ch;
229302   const char *name;
230   const char *alternate;   /* alternative string, in UTF-8 */
303   const char *alternate;   // alternative string, in UTF-8
304
305   static const char_info *find(unicode_char target);
231306};
232307
233308
234/***************************************************************************
235    MACROS
236***************************************************************************/
237309
238#define APPLY_SENSITIVITY(x,s)      (((INT64)(x) * (s)) / 100.0 + 0.5)
239#define APPLY_INVERSE_SENSITIVITY(x,s) (((INT64)(x) * 100) / (s))
310//**************************************************************************
311//  INLINE FUNCTIONS
312//**************************************************************************
240313
241#define COMPUTE_SCALE(num,den)      (((INT64)(num) << 24) / (den))
242#define RECIP_SCALE(s)            (((INT64)1 << 48) / (s))
243#define APPLY_SCALE(x,s)         (((INT64)(x) * (s)) >> 24)
314//-------------------------------------------------
315//  compute_scale -- compute an 8.24 scale value
316//   from a numerator and a denominator
317//-------------------------------------------------
244318
319inline INT32 compute_scale(INT32 num, INT32 den)
320{
321   return (INT64(num) << 24) / den;
322}
245323
246324
247/***************************************************************************
248    GLOBAL VARIABLES
249***************************************************************************/
325//-------------------------------------------------
326//  recip_scale -- compute an 8.24 reciprocal of
327//  an 8.24 scale value
328//-------------------------------------------------
250329
251/* XML attributes for the different types */
252static const char *const seqtypestrings[] = { "standard", "increment", "decrement" };
330inline INT32 recip_scale(INT32 scale)
331{
332   return (INT64(1) << 48) / scale;
333}
253334
254335
336//-------------------------------------------------
337//  apply_scale -- apply an 8.24 scale value to
338//   a 32-bit value
339//-------------------------------------------------
340
341inline INT32 apply_scale(INT32 value, INT32 scale)
342{
343   return (INT64(value) * scale) >> 24;
344}
345
346
347
348//**************************************************************************
349//  GLOBAL VARIABLES
350//**************************************************************************
351
352// XML attributes for the different types
353static const char *const seqtypestrings[] = { "standard", "increment", "decrement" };
354
355// master character info table
255356static const char_info charinfo[] =
256357{
257   { 0x0008,               "Backspace",   NULL },      /* Backspace */
258   { 0x0009,               "Tab",         "    " },   /* Tab */
259   { 0x000c,               "Clear",      NULL },      /* Clear */
260   { 0x000d,               "Enter",      NULL },      /* Enter */
261   { 0x001a,               "Esc",         NULL },      /* Esc */
262   { 0x0020,               "Space",      " " },      /* Space */
263   { 0x0061,               NULL,         "A" },      /* a */
264   { 0x0062,               NULL,         "B" },      /* b */
265   { 0x0063,               NULL,         "C" },      /* c */
266   { 0x0064,               NULL,         "D" },      /* d */
267   { 0x0065,               NULL,         "E" },      /* e */
268   { 0x0066,               NULL,         "F" },      /* f */
269   { 0x0067,               NULL,         "G" },      /* g */
270   { 0x0068,               NULL,         "H" },      /* h */
271   { 0x0069,               NULL,         "I" },      /* i */
272   { 0x006a,               NULL,         "J" },      /* j */
273   { 0x006b,               NULL,         "K" },      /* k */
274   { 0x006c,               NULL,         "L" },      /* l */
275   { 0x006d,               NULL,         "M" },      /* m */
276   { 0x006e,               NULL,         "N" },      /* n */
277   { 0x006f,               NULL,         "O" },      /* o */
278   { 0x0070,               NULL,         "P" },      /* p */
279   { 0x0071,               NULL,         "Q" },      /* q */
280   { 0x0072,               NULL,         "R" },      /* r */
281   { 0x0073,               NULL,         "S" },      /* s */
282   { 0x0074,               NULL,         "T" },      /* t */
283   { 0x0075,               NULL,         "U" },      /* u */
284   { 0x0076,               NULL,         "V" },      /* v */
285   { 0x0077,               NULL,         "W" },      /* w */
286   { 0x0078,               NULL,         "X" },      /* x */
287   { 0x0079,               NULL,         "Y" },      /* y */
288   { 0x007a,               NULL,         "Z" },      /* z */
289   { 0x00a0,               NULL,         " " },      /* non breaking space */
290   { 0x00a1,               NULL,         "!" },      /* inverted exclaimation mark */
291   { 0x00a6,               NULL,         "|" },      /* broken bar */
292   { 0x00a9,               NULL,         "(c)" },   /* copyright sign */
293   { 0x00ab,               NULL,         "<<" },      /* left pointing double angle */
294   { 0x00ae,               NULL,         "(r)" },   /* registered sign */
295   { 0x00bb,               NULL,         ">>" },      /* right pointing double angle */
296   { 0x00bc,               NULL,         "1/4" },   /* vulgar fraction one quarter */
297   { 0x00bd,               NULL,         "1/2" },   /* vulgar fraction one half */
298   { 0x00be,               NULL,         "3/4" },   /* vulgar fraction three quarters */
299   { 0x00bf,               NULL,         "?" },      /* inverted question mark */
300   { 0x00c0,               NULL,         "A" },      /* 'A' grave */
301   { 0x00c1,               NULL,         "A" },      /* 'A' acute */
302   { 0x00c2,               NULL,         "A" },      /* 'A' circumflex */
303   { 0x00c3,               NULL,         "A" },      /* 'A' tilde */
304   { 0x00c4,               NULL,         "A" },      /* 'A' diaeresis */
305   { 0x00c5,               NULL,         "A" },      /* 'A' ring above */
306   { 0x00c6,               NULL,         "AE" },      /* 'AE' ligature */
307   { 0x00c7,               NULL,         "C" },      /* 'C' cedilla */
308   { 0x00c8,               NULL,         "E" },      /* 'E' grave */
309   { 0x00c9,               NULL,         "E" },      /* 'E' acute */
310   { 0x00ca,               NULL,         "E" },      /* 'E' circumflex */
311   { 0x00cb,               NULL,         "E" },      /* 'E' diaeresis */
312   { 0x00cc,               NULL,         "I" },      /* 'I' grave */
313   { 0x00cd,               NULL,         "I" },      /* 'I' acute */
314   { 0x00ce,               NULL,         "I" },      /* 'I' circumflex */
315   { 0x00cf,               NULL,         "I" },      /* 'I' diaeresis */
316   { 0x00d0,               NULL,         "D" },      /* 'ETH' */
317   { 0x00d1,               NULL,         "N" },      /* 'N' tilde */
318   { 0x00d2,               NULL,         "O" },      /* 'O' grave */
319   { 0x00d3,               NULL,         "O" },      /* 'O' acute */
320   { 0x00d4,               NULL,         "O" },      /* 'O' circumflex */
321   { 0x00d5,               NULL,         "O" },      /* 'O' tilde */
322   { 0x00d6,               NULL,         "O" },      /* 'O' diaeresis */
323   { 0x00d7,               NULL,         "X" },      /* multiplication sign */
324   { 0x00d8,               NULL,         "O" },      /* 'O' stroke */
325   { 0x00d9,               NULL,         "U" },      /* 'U' grave */
326   { 0x00da,               NULL,         "U" },      /* 'U' acute */
327   { 0x00db,               NULL,         "U" },      /* 'U' circumflex */
328   { 0x00dc,               NULL,         "U" },      /* 'U' diaeresis */
329   { 0x00dd,               NULL,         "Y" },      /* 'Y' acute */
330   { 0x00df,               NULL,         "SS" },      /* sharp S */
331   { 0x00e0,               NULL,         "a" },      /* 'a' grave */
332   { 0x00e1,               NULL,         "a" },      /* 'a' acute */
333   { 0x00e2,               NULL,         "a" },      /* 'a' circumflex */
334   { 0x00e3,               NULL,         "a" },      /* 'a' tilde */
335   { 0x00e4,               NULL,         "a" },      /* 'a' diaeresis */
336   { 0x00e5,               NULL,         "a" },      /* 'a' ring above */
337   { 0x00e6,               NULL,         "ae" },      /* 'ae' ligature */
338   { 0x00e7,               NULL,         "c" },      /* 'c' cedilla */
339   { 0x00e8,               NULL,         "e" },      /* 'e' grave */
340   { 0x00e9,               NULL,         "e" },      /* 'e' acute */
341   { 0x00ea,               NULL,         "e" },      /* 'e' circumflex */
342   { 0x00eb,               NULL,         "e" },      /* 'e' diaeresis */
343   { 0x00ec,               NULL,         "i" },      /* 'i' grave */
344   { 0x00ed,               NULL,         "i" },      /* 'i' acute */
345   { 0x00ee,               NULL,         "i" },      /* 'i' circumflex */
346   { 0x00ef,               NULL,         "i" },      /* 'i' diaeresis */
347   { 0x00f0,               NULL,         "d" },      /* 'eth' */
348   { 0x00f1,               NULL,         "n" },      /* 'n' tilde */
349   { 0x00f2,               NULL,         "o" },      /* 'o' grave */
350   { 0x00f3,               NULL,         "o" },      /* 'o' acute */
351   { 0x00f4,               NULL,         "o" },      /* 'o' circumflex */
352   { 0x00f5,               NULL,         "o" },      /* 'o' tilde */
353   { 0x00f6,               NULL,         "o" },      /* 'o' diaeresis */
354   { 0x00f8,               NULL,         "o" },      /* 'o' stroke */
355   { 0x00f9,               NULL,         "u" },      /* 'u' grave */
356   { 0x00fa,               NULL,         "u" },      /* 'u' acute */
357   { 0x00fb,               NULL,         "u" },      /* 'u' circumflex */
358   { 0x00fc,               NULL,         "u" },      /* 'u' diaeresis */
359   { 0x00fd,               NULL,         "y" },      /* 'y' acute */
360   { 0x00ff,               NULL,         "y" },      /* 'y' diaeresis */
361   { 0x2010,               NULL,         "-" },      /* hyphen */
362   { 0x2011,               NULL,         "-" },      /* non-breaking hyphen */
363   { 0x2012,               NULL,         "-" },      /* figure dash */
364   { 0x2013,               NULL,         "-" },      /* en dash */
365   { 0x2014,               NULL,         "-" },      /* em dash */
366   { 0x2015,               NULL,         "-" },      /* horizontal dash */
367   { 0x2018,               NULL,         "\'" },      /* left single quotation mark */
368   { 0x2019,               NULL,         "\'" },      /* right single quotation mark */
369   { 0x201a,               NULL,         "\'" },      /* single low quotation mark */
370   { 0x201b,               NULL,         "\'" },      /* single high reversed quotation mark */
371   { 0x201c,               NULL,         "\"" },      /* left double quotation mark */
372   { 0x201d,               NULL,         "\"" },      /* right double quotation mark */
373   { 0x201e,               NULL,         "\"" },      /* double low quotation mark */
374   { 0x201f,               NULL,         "\"" },      /* double high reversed quotation mark */
375   { 0x2024,               NULL,         "." },      /* one dot leader */
376   { 0x2025,               NULL,         ".." },      /* two dot leader */
377   { 0x2026,               NULL,         "..." },   /* horizontal ellipsis */
378   { 0x2047,               NULL,         "??" },      /* double question mark */
379   { 0x2048,               NULL,         "?!" },      /* question exclamation mark */
380   { 0x2049,               NULL,         "!?" },      /* exclamation question mark */
381   { 0xff01,               NULL,         "!" },      /* fullwidth exclamation point */
382   { 0xff02,               NULL,         "\"" },      /* fullwidth quotation mark */
383   { 0xff03,               NULL,         "#" },      /* fullwidth number sign */
384   { 0xff04,               NULL,         "$" },      /* fullwidth dollar sign */
385   { 0xff05,               NULL,         "%" },      /* fullwidth percent sign */
386   { 0xff06,               NULL,         "&" },      /* fullwidth ampersand */
387   { 0xff07,               NULL,         "\'" },      /* fullwidth apostrophe */
388   { 0xff08,               NULL,         "(" },      /* fullwidth left parenthesis */
389   { 0xff09,               NULL,         ")" },      /* fullwidth right parenthesis */
390   { 0xff0a,               NULL,         "*" },      /* fullwidth asterisk */
391   { 0xff0b,               NULL,         "+" },      /* fullwidth plus */
392   { 0xff0c,               NULL,         "," },      /* fullwidth comma */
393   { 0xff0d,               NULL,         "-" },      /* fullwidth minus */
394   { 0xff0e,               NULL,         "." },      /* fullwidth period */
395   { 0xff0f,               NULL,         "/" },      /* fullwidth slash */
396   { 0xff10,               NULL,         "0" },      /* fullwidth zero */
397   { 0xff11,               NULL,         "1" },      /* fullwidth one */
398   { 0xff12,               NULL,         "2" },      /* fullwidth two */
399   { 0xff13,               NULL,         "3" },      /* fullwidth three */
400   { 0xff14,               NULL,         "4" },      /* fullwidth four */
401   { 0xff15,               NULL,         "5" },      /* fullwidth five */
402   { 0xff16,               NULL,         "6" },      /* fullwidth six */
403   { 0xff17,               NULL,         "7" },      /* fullwidth seven */
404   { 0xff18,               NULL,         "8" },      /* fullwidth eight */
405   { 0xff19,               NULL,         "9" },      /* fullwidth nine */
406   { 0xff1a,               NULL,         ":" },      /* fullwidth colon */
407   { 0xff1b,               NULL,         ";" },      /* fullwidth semicolon */
408   { 0xff1c,               NULL,         "<" },      /* fullwidth less than sign */
409   { 0xff1d,               NULL,         "=" },      /* fullwidth equals sign */
410   { 0xff1e,               NULL,         ">" },      /* fullwidth greater than sign */
411   { 0xff1f,               NULL,         "?" },      /* fullwidth question mark */
412   { 0xff20,               NULL,         "@" },      /* fullwidth at sign */
413   { 0xff21,               NULL,         "A" },      /* fullwidth 'A' */
414   { 0xff22,               NULL,         "B" },      /* fullwidth 'B' */
415   { 0xff23,               NULL,         "C" },      /* fullwidth 'C' */
416   { 0xff24,               NULL,         "D" },      /* fullwidth 'D' */
417   { 0xff25,               NULL,         "E" },      /* fullwidth 'E' */
418   { 0xff26,               NULL,         "F" },      /* fullwidth 'F' */
419   { 0xff27,               NULL,         "G" },      /* fullwidth 'G' */
420   { 0xff28,               NULL,         "H" },      /* fullwidth 'H' */
421   { 0xff29,               NULL,         "I" },      /* fullwidth 'I' */
422   { 0xff2a,               NULL,         "J" },      /* fullwidth 'J' */
423   { 0xff2b,               NULL,         "K" },      /* fullwidth 'K' */
424   { 0xff2c,               NULL,         "L" },      /* fullwidth 'L' */
425   { 0xff2d,               NULL,         "M" },      /* fullwidth 'M' */
426   { 0xff2e,               NULL,         "N" },      /* fullwidth 'N' */
427   { 0xff2f,               NULL,         "O" },      /* fullwidth 'O' */
428   { 0xff30,               NULL,         "P" },      /* fullwidth 'P' */
429   { 0xff31,               NULL,         "Q" },      /* fullwidth 'Q' */
430   { 0xff32,               NULL,         "R" },      /* fullwidth 'R' */
431   { 0xff33,               NULL,         "S" },      /* fullwidth 'S' */
432   { 0xff34,               NULL,         "T" },      /* fullwidth 'T' */
433   { 0xff35,               NULL,         "U" },      /* fullwidth 'U' */
434   { 0xff36,               NULL,         "V" },      /* fullwidth 'V' */
435   { 0xff37,               NULL,         "W" },      /* fullwidth 'W' */
436   { 0xff38,               NULL,         "X" },      /* fullwidth 'X' */
437   { 0xff39,               NULL,         "Y" },      /* fullwidth 'Y' */
438   { 0xff3a,               NULL,         "Z" },      /* fullwidth 'Z' */
439   { 0xff3b,               NULL,         "[" },      /* fullwidth left bracket */
440   { 0xff3c,               NULL,         "\\" },      /* fullwidth backslash */
441   { 0xff3d,               NULL,         "]"   },      /* fullwidth right bracket */
442   { 0xff3e,               NULL,         "^" },      /* fullwidth caret */
443   { 0xff3f,               NULL,         "_" },      /* fullwidth underscore */
444   { 0xff40,               NULL,         "`" },      /* fullwidth backquote */
445   { 0xff41,               NULL,         "a" },      /* fullwidth 'a' */
446   { 0xff42,               NULL,         "b" },      /* fullwidth 'b' */
447   { 0xff43,               NULL,         "c" },      /* fullwidth 'c' */
448   { 0xff44,               NULL,         "d" },      /* fullwidth 'd' */
449   { 0xff45,               NULL,         "e" },      /* fullwidth 'e' */
450   { 0xff46,               NULL,         "f" },      /* fullwidth 'f' */
451   { 0xff47,               NULL,         "g" },      /* fullwidth 'g' */
452   { 0xff48,               NULL,         "h" },      /* fullwidth 'h' */
453   { 0xff49,               NULL,         "i" },      /* fullwidth 'i' */
454   { 0xff4a,               NULL,         "j" },      /* fullwidth 'j' */
455   { 0xff4b,               NULL,         "k" },      /* fullwidth 'k' */
456   { 0xff4c,               NULL,         "l" },      /* fullwidth 'l' */
457   { 0xff4d,               NULL,         "m" },      /* fullwidth 'm' */
458   { 0xff4e,               NULL,         "n" },      /* fullwidth 'n' */
459   { 0xff4f,               NULL,         "o" },      /* fullwidth 'o' */
460   { 0xff50,               NULL,         "p" },      /* fullwidth 'p' */
461   { 0xff51,               NULL,         "q" },      /* fullwidth 'q' */
462   { 0xff52,               NULL,         "r" },      /* fullwidth 'r' */
463   { 0xff53,               NULL,         "s" },      /* fullwidth 's' */
464   { 0xff54,               NULL,         "t" },      /* fullwidth 't' */
465   { 0xff55,               NULL,         "u" },      /* fullwidth 'u' */
466   { 0xff56,               NULL,         "v" },      /* fullwidth 'v' */
467   { 0xff57,               NULL,         "w" },      /* fullwidth 'w' */
468   { 0xff58,               NULL,         "x" },      /* fullwidth 'x' */
469   { 0xff59,               NULL,         "y" },      /* fullwidth 'y' */
470   { 0xff5a,               NULL,         "z" },      /* fullwidth 'z' */
471   { 0xff5b,               NULL,         "{" },      /* fullwidth left brace */
472   { 0xff5c,               NULL,         "|" },      /* fullwidth vertical bar */
473   { 0xff5d,               NULL,         "}" },      /* fullwidth right brace */
474   { 0xff5e,               NULL,         "~" },      /* fullwidth tilde */
475   { 0xff5f,               NULL,         "((" },      /* fullwidth double left parenthesis */
476   { 0xff60,               NULL,         "))" },      /* fullwidth double right parenthesis */
477   { 0xffe0,               NULL,         "\xC2\xA2" },      /* fullwidth cent sign */
478   { 0xffe1,               NULL,         "\xC2\xA3" },      /* fullwidth pound sign */
479   { 0xffe4,               NULL,         "\xC2\xA4" },      /* fullwidth broken bar */
480   { 0xffe5,               NULL,         "\xC2\xA5" },      /* fullwidth yen sign */
481   { 0xffe6,               NULL,         "\xE2\x82\xA9" },   /* fullwidth won sign */
482   { 0xffe9,               NULL,         "\xE2\x86\x90" },   /* fullwidth left arrow */
483   { 0xffea,               NULL,         "\xE2\x86\x91" },   /* fullwidth up arrow */
484   { 0xffeb,               NULL,         "\xE2\x86\x92" },   /* fullwidth right arrow */
485   { 0xffec,               NULL,         "\xE2\x86\x93" },   /* fullwidth down arrow */
486   { 0xffed,               NULL,         "\xE2\x96\xAA" },   /* fullwidth solid box */
487   { 0xffee,               NULL,         "\xE2\x97\xA6" },   /* fullwidth open circle */
488   { UCHAR_SHIFT_1,         "Shift",      NULL },      /* Shift key */
489   { UCHAR_SHIFT_2,         "Ctrl",         NULL },      /* Ctrl key */
490   { UCHAR_MAMEKEY(F1),      "F1",         NULL },      /* F1 function key */
491   { UCHAR_MAMEKEY(F2),      "F2",         NULL },      /* F2 function key */
492   { UCHAR_MAMEKEY(F3),      "F3",         NULL },      /* F3 function key */
493   { UCHAR_MAMEKEY(F4),      "F4",         NULL },      /* F4 function key */
494   { UCHAR_MAMEKEY(F5),      "F5",         NULL },      /* F5 function key */
495   { UCHAR_MAMEKEY(F6),      "F6",         NULL },      /* F6 function key */
496   { UCHAR_MAMEKEY(F7),      "F7",         NULL },      /* F7 function key */
497   { UCHAR_MAMEKEY(F8),      "F8",         NULL },      /* F8 function key */
498   { UCHAR_MAMEKEY(F9),      "F9",         NULL },      /* F9 function key */
499   { UCHAR_MAMEKEY(F10),      "F10",         NULL },      /* F10 function key */
500   { UCHAR_MAMEKEY(F11),      "F11",         NULL },      /* F11 function key */
501   { UCHAR_MAMEKEY(F12),      "F12",         NULL },      /* F12 function key */
502   { UCHAR_MAMEKEY(F13),      "F13",         NULL },      /* F13 function key */
503   { UCHAR_MAMEKEY(F14),      "F14",         NULL },      /* F14 function key */
504   { UCHAR_MAMEKEY(F15),      "F15",         NULL },      /* F15 function key */
505   { UCHAR_MAMEKEY(ESC),      "Esc",         "\033" },   /* Esc key */
506   { UCHAR_MAMEKEY(INSERT),   "Insert",      NULL },      /* Insert key */
507   { UCHAR_MAMEKEY(DEL),      "Delete",      "\010" },   /* Delete key */
508   { UCHAR_MAMEKEY(HOME),      "Home",         "\014" },   /* Home key */
509   { UCHAR_MAMEKEY(END),      "End",         NULL },      /* End key */
510   { UCHAR_MAMEKEY(PGUP),      "Page Up",      NULL },      /* Page Up key */
511   { UCHAR_MAMEKEY(PGDN),      "Page Down",   NULL },      /* Page Down key */
512   { UCHAR_MAMEKEY(LEFT),      "Cursor Left",   NULL },      /* Cursor Left */
513   { UCHAR_MAMEKEY(RIGHT),      "Cursor Right",   NULL },      /* Cursor Right */
514   { UCHAR_MAMEKEY(UP),      "Cursor Up",   NULL },      /* Cursor Up */
515   { UCHAR_MAMEKEY(DOWN),      "Cursor Down",   NULL },      /* Cursor Down */
516   { UCHAR_MAMEKEY(0_PAD),      "Keypad 0",      NULL },      /* 0 on the numeric keypad */
517   { UCHAR_MAMEKEY(1_PAD),      "Keypad 1",      NULL },      /* 1 on the numeric keypad */
518   { UCHAR_MAMEKEY(2_PAD),      "Keypad 2",      NULL },      /* 2 on the numeric keypad */
519   { UCHAR_MAMEKEY(3_PAD),      "Keypad 3",      NULL },      /* 3 on the numeric keypad */
520   { UCHAR_MAMEKEY(4_PAD),      "Keypad 4",      NULL },      /* 4 on the numeric keypad */
521   { UCHAR_MAMEKEY(5_PAD),      "Keypad 5",      NULL },      /* 5 on the numeric keypad */
522   { UCHAR_MAMEKEY(6_PAD),      "Keypad 6",      NULL },      /* 6 on the numeric keypad */
523   { UCHAR_MAMEKEY(7_PAD),      "Keypad 7",      NULL },      /* 7 on the numeric keypad */
524   { UCHAR_MAMEKEY(8_PAD),      "Keypad 8",      NULL },      /* 8 on the numeric keypad */
525   { UCHAR_MAMEKEY(9_PAD),      "Keypad 9",      NULL },      /* 9 on the numeric keypad */
526   { UCHAR_MAMEKEY(SLASH_PAD),   "Keypad /",      NULL },      /* / on the numeric keypad */
527   { UCHAR_MAMEKEY(ASTERISK),   "Keypad *",      NULL },      /* * on the numeric keypad */
528   { UCHAR_MAMEKEY(MINUS_PAD),   "Keypad -",      NULL },      /* - on the numeric Keypad */
529   { UCHAR_MAMEKEY(PLUS_PAD),   "Keypad +",      NULL },      /* + on the numeric Keypad */
530   { UCHAR_MAMEKEY(DEL_PAD),   "Keypad .",      NULL },      /* . on the numeric keypad */
531   { UCHAR_MAMEKEY(ENTER_PAD),   "Keypad Enter",   NULL },      /* Enter on the numeric keypad */
532   { UCHAR_MAMEKEY(PRTSCR),   "Print Screen",   NULL },      /* Print Screen key */
533   { UCHAR_MAMEKEY(PAUSE),      "Pause",      NULL },      /* Pause key */
534   { UCHAR_MAMEKEY(LSHIFT),   "Left Shift",   NULL },      /* Left Shift key */
535   { UCHAR_MAMEKEY(RSHIFT),   "Right Shift",   NULL },      /* Right Shift key */
536   { UCHAR_MAMEKEY(LCONTROL),   "Left Ctrl",   NULL },      /* Left Control key */
537   { UCHAR_MAMEKEY(RCONTROL),   "Right Ctrl",   NULL },      /* Right Control key */
538   { UCHAR_MAMEKEY(LALT),      "Left Alt",      NULL },      /* Left Alt key */
539   { UCHAR_MAMEKEY(RALT),      "Right Alt",   NULL },      /* Right Alt key */
540   { UCHAR_MAMEKEY(SCRLOCK),   "Scroll Lock",   NULL },      /* Scroll Lock key */
541   { UCHAR_MAMEKEY(NUMLOCK),   "Num Lock",      NULL },      /* Num Lock key */
542   { UCHAR_MAMEKEY(CAPSLOCK),   "Caps Lock",   NULL },      /* Caps Lock key */
543   { UCHAR_MAMEKEY(LWIN),      "Left Win",      NULL },      /* Left Win key */
544   { UCHAR_MAMEKEY(RWIN),      "Right Win",   NULL },      /* Right Win key */
545   { UCHAR_MAMEKEY(MENU),      "Menu",         NULL },      /* Menu key */
546   { UCHAR_MAMEKEY(CANCEL),   "Break",      NULL }      /* Break/Pause key */
358   { 0x0008,               "Backspace",   NULL },      // Backspace
359   { 0x0009,               "Tab",         "    " },   // Tab
360   { 0x000c,               "Clear",      NULL },      // Clear
361   { 0x000d,               "Enter",      NULL },      // Enter
362   { 0x001a,               "Esc",         NULL },      // Esc
363   { 0x0020,               "Space",      " " },      // Space
364   { 0x0061,               NULL,         "A" },      // a
365   { 0x0062,               NULL,         "B" },      // b
366   { 0x0063,               NULL,         "C" },      // c
367   { 0x0064,               NULL,         "D" },      // d
368   { 0x0065,               NULL,         "E" },      // e
369   { 0x0066,               NULL,         "F" },      // f
370   { 0x0067,               NULL,         "G" },      // g
371   { 0x0068,               NULL,         "H" },      // h
372   { 0x0069,               NULL,         "I" },      // i
373   { 0x006a,               NULL,         "J" },      // j
374   { 0x006b,               NULL,         "K" },      // k
375   { 0x006c,               NULL,         "L" },      // l
376   { 0x006d,               NULL,         "M" },      // m
377   { 0x006e,               NULL,         "N" },      // n
378   { 0x006f,               NULL,         "O" },      // o
379   { 0x0070,               NULL,         "P" },      // p
380   { 0x0071,               NULL,         "Q" },      // q
381   { 0x0072,               NULL,         "R" },      // r
382   { 0x0073,               NULL,         "S" },      // s
383   { 0x0074,               NULL,         "T" },      // t
384   { 0x0075,               NULL,         "U" },      // u
385   { 0x0076,               NULL,         "V" },      // v
386   { 0x0077,               NULL,         "W" },      // w
387   { 0x0078,               NULL,         "X" },      // x
388   { 0x0079,               NULL,         "Y" },      // y
389   { 0x007a,               NULL,         "Z" },      // z
390   { 0x00a0,               NULL,         " " },      // non breaking space
391   { 0x00a1,               NULL,         "!" },      // inverted exclaimation mark
392   { 0x00a6,               NULL,         "|" },      // broken bar
393   { 0x00a9,               NULL,         "(c)" },   // copyright sign
394   { 0x00ab,               NULL,         "<<" },      // left pointing double angle
395   { 0x00ae,               NULL,         "(r)" },   // registered sign
396   { 0x00bb,               NULL,         ">>" },      // right pointing double angle
397   { 0x00bc,               NULL,         "1/4" },   // vulgar fraction one quarter
398   { 0x00bd,               NULL,         "1/2" },   // vulgar fraction one half
399   { 0x00be,               NULL,         "3/4" },   // vulgar fraction three quarters
400   { 0x00bf,               NULL,         "?" },      // inverted question mark
401   { 0x00c0,               NULL,         "A" },      // 'A' grave
402   { 0x00c1,               NULL,         "A" },      // 'A' acute
403   { 0x00c2,               NULL,         "A" },      // 'A' circumflex
404   { 0x00c3,               NULL,         "A" },      // 'A' tilde
405   { 0x00c4,               NULL,         "A" },      // 'A' diaeresis
406   { 0x00c5,               NULL,         "A" },      // 'A' ring above
407   { 0x00c6,               NULL,         "AE" },      // 'AE' ligature
408   { 0x00c7,               NULL,         "C" },      // 'C' cedilla
409   { 0x00c8,               NULL,         "E" },      // 'E' grave
410   { 0x00c9,               NULL,         "E" },      // 'E' acute
411   { 0x00ca,               NULL,         "E" },      // 'E' circumflex
412   { 0x00cb,               NULL,         "E" },      // 'E' diaeresis
413   { 0x00cc,               NULL,         "I" },      // 'I' grave
414   { 0x00cd,               NULL,         "I" },      // 'I' acute
415   { 0x00ce,               NULL,         "I" },      // 'I' circumflex
416   { 0x00cf,               NULL,         "I" },      // 'I' diaeresis
417   { 0x00d0,               NULL,         "D" },      // 'ETH'
418   { 0x00d1,               NULL,         "N" },      // 'N' tilde
419   { 0x00d2,               NULL,         "O" },      // 'O' grave
420   { 0x00d3,               NULL,         "O" },      // 'O' acute
421   { 0x00d4,               NULL,         "O" },      // 'O' circumflex
422   { 0x00d5,               NULL,         "O" },      // 'O' tilde
423   { 0x00d6,               NULL,         "O" },      // 'O' diaeresis
424   { 0x00d7,               NULL,         "X" },      // multiplication sign
425   { 0x00d8,               NULL,         "O" },      // 'O' stroke
426   { 0x00d9,               NULL,         "U" },      // 'U' grave
427   { 0x00da,               NULL,         "U" },      // 'U' acute
428   { 0x00db,               NULL,         "U" },      // 'U' circumflex
429   { 0x00dc,               NULL,         "U" },      // 'U' diaeresis
430   { 0x00dd,               NULL,         "Y" },      // 'Y' acute
431   { 0x00df,               NULL,         "SS" },      // sharp S
432   { 0x00e0,               NULL,         "a" },      // 'a' grave
433   { 0x00e1,               NULL,         "a" },      // 'a' acute
434   { 0x00e2,               NULL,         "a" },      // 'a' circumflex
435   { 0x00e3,               NULL,         "a" },      // 'a' tilde
436   { 0x00e4,               NULL,         "a" },      // 'a' diaeresis
437   { 0x00e5,               NULL,         "a" },      // 'a' ring above
438   { 0x00e6,               NULL,         "ae" },      // 'ae' ligature
439   { 0x00e7,               NULL,         "c" },      // 'c' cedilla
440   { 0x00e8,               NULL,         "e" },      // 'e' grave
441   { 0x00e9,               NULL,         "e" },      // 'e' acute
442   { 0x00ea,               NULL,         "e" },      // 'e' circumflex
443   { 0x00eb,               NULL,         "e" },      // 'e' diaeresis
444   { 0x00ec,               NULL,         "i" },      // 'i' grave
445   { 0x00ed,               NULL,         "i" },      // 'i' acute
446   { 0x00ee,               NULL,         "i" },      // 'i' circumflex
447   { 0x00ef,               NULL,         "i" },      // 'i' diaeresis
448   { 0x00f0,               NULL,         "d" },      // 'eth'
449   { 0x00f1,               NULL,         "n" },      // 'n' tilde
450   { 0x00f2,               NULL,         "o" },      // 'o' grave
451   { 0x00f3,               NULL,         "o" },      // 'o' acute
452   { 0x00f4,               NULL,         "o" },      // 'o' circumflex
453   { 0x00f5,               NULL,         "o" },      // 'o' tilde
454   { 0x00f6,               NULL,         "o" },      // 'o' diaeresis
455   { 0x00f8,               NULL,         "o" },      // 'o' stroke
456   { 0x00f9,               NULL,         "u" },      // 'u' grave
457   { 0x00fa,               NULL,         "u" },      // 'u' acute
458   { 0x00fb,               NULL,         "u" },      // 'u' circumflex
459   { 0x00fc,               NULL,         "u" },      // 'u' diaeresis
460   { 0x00fd,               NULL,         "y" },      // 'y' acute
461   { 0x00ff,               NULL,         "y" },      // 'y' diaeresis
462   { 0x2010,               NULL,         "-" },      // hyphen
463   { 0x2011,               NULL,         "-" },      // non-breaking hyphen
464   { 0x2012,               NULL,         "-" },      // figure dash
465   { 0x2013,               NULL,         "-" },      // en dash
466   { 0x2014,               NULL,         "-" },      // em dash
467   { 0x2015,               NULL,         "-" },      // horizontal dash
468   { 0x2018,               NULL,         "\'" },      // left single quotation mark
469   { 0x2019,               NULL,         "\'" },      // right single quotation mark
470   { 0x201a,               NULL,         "\'" },      // single low quotation mark
471   { 0x201b,               NULL,         "\'" },      // single high reversed quotation mark
472   { 0x201c,               NULL,         "\"" },      // left double quotation mark
473   { 0x201d,               NULL,         "\"" },      // right double quotation mark
474   { 0x201e,               NULL,         "\"" },      // double low quotation mark
475   { 0x201f,               NULL,         "\"" },      // double high reversed quotation mark
476   { 0x2024,               NULL,         "." },      // one dot leader
477   { 0x2025,               NULL,         ".." },      // two dot leader
478   { 0x2026,               NULL,         "..." },   // horizontal ellipsis
479   { 0x2047,               NULL,         "??" },      // double question mark
480   { 0x2048,               NULL,         "?!" },      // question exclamation mark
481   { 0x2049,               NULL,         "!?" },      // exclamation question mark
482   { 0xff01,               NULL,         "!" },      // fullwidth exclamation point
483   { 0xff02,               NULL,         "\"" },      // fullwidth quotation mark
484   { 0xff03,               NULL,         "#" },      // fullwidth number sign
485   { 0xff04,               NULL,         "$" },      // fullwidth dollar sign
486   { 0xff05,               NULL,         "%" },      // fullwidth percent sign
487   { 0xff06,               NULL,         "&" },      // fullwidth ampersand
488   { 0xff07,               NULL,         "\'" },      // fullwidth apostrophe
489   { 0xff08,               NULL,         "(" },      // fullwidth left parenthesis
490   { 0xff09,               NULL,         ")" },      // fullwidth right parenthesis
491   { 0xff0a,               NULL,         "*" },      // fullwidth asterisk
492   { 0xff0b,               NULL,         "+" },      // fullwidth plus
493   { 0xff0c,               NULL,         "," },      // fullwidth comma
494   { 0xff0d,               NULL,         "-" },      // fullwidth minus
495   { 0xff0e,               NULL,         "." },      // fullwidth period
496   { 0xff0f,               NULL,         "/" },      // fullwidth slash
497   { 0xff10,               NULL,         "0" },      // fullwidth zero
498   { 0xff11,               NULL,         "1" },      // fullwidth one
499   { 0xff12,               NULL,         "2" },      // fullwidth two
500   { 0xff13,               NULL,         "3" },      // fullwidth three
501   { 0xff14,               NULL,         "4" },      // fullwidth four
502   { 0xff15,               NULL,         "5" },      // fullwidth five
503   { 0xff16,               NULL,         "6" },      // fullwidth six
504   { 0xff17,               NULL,         "7" },      // fullwidth seven
505   { 0xff18,               NULL,         "8" },      // fullwidth eight
506   { 0xff19,               NULL,         "9" },      // fullwidth nine
507   { 0xff1a,               NULL,         ":" },      // fullwidth colon
508   { 0xff1b,               NULL,         ";" },      // fullwidth semicolon
509   { 0xff1c,               NULL,         "<" },      // fullwidth less than sign
510   { 0xff1d,               NULL,         "=" },      // fullwidth equals sign
511   { 0xff1e,               NULL,         ">" },      // fullwidth greater than sign
512   { 0xff1f,               NULL,         "?" },      // fullwidth question mark
513   { 0xff20,               NULL,         "@" },      // fullwidth at sign
514   { 0xff21,               NULL,         "A" },      // fullwidth 'A'
515   { 0xff22,               NULL,         "B" },      // fullwidth 'B'
516   { 0xff23,               NULL,         "C" },      // fullwidth 'C'
517   { 0xff24,               NULL,         "D" },      // fullwidth 'D'
518   { 0xff25,               NULL,         "E" },      // fullwidth 'E'
519   { 0xff26,               NULL,         "F" },      // fullwidth 'F'
520   { 0xff27,               NULL,         "G" },      // fullwidth 'G'
521   { 0xff28,               NULL,         "H" },      // fullwidth 'H'
522   { 0xff29,               NULL,         "I" },      // fullwidth 'I'
523   { 0xff2a,               NULL,         "J" },      // fullwidth 'J'
524   { 0xff2b,               NULL,         "K" },      // fullwidth 'K'
525   { 0xff2c,               NULL,         "L" },      // fullwidth 'L'
526   { 0xff2d,               NULL,         "M" },      // fullwidth 'M'
527   { 0xff2e,               NULL,         "N" },      // fullwidth 'N'
528   { 0xff2f,               NULL,         "O" },      // fullwidth 'O'
529   { 0xff30,               NULL,         "P" },      // fullwidth 'P'
530   { 0xff31,               NULL,         "Q" },      // fullwidth 'Q'
531   { 0xff32,               NULL,         "R" },      // fullwidth 'R'
532   { 0xff33,               NULL,         "S" },      // fullwidth 'S'
533   { 0xff34,               NULL,         "T" },      // fullwidth 'T'
534   { 0xff35,               NULL,         "U" },      // fullwidth 'U'
535   { 0xff36,               NULL,         "V" },      // fullwidth 'V'
536   { 0xff37,               NULL,         "W" },      // fullwidth 'W'
537   { 0xff38,               NULL,         "X" },      // fullwidth 'X'
538   { 0xff39,               NULL,         "Y" },      // fullwidth 'Y'
539   { 0xff3a,               NULL,         "Z" },      // fullwidth 'Z'
540   { 0xff3b,               NULL,         "[" },      // fullwidth left bracket
541   { 0xff3c,               NULL,         "\\" },      // fullwidth backslash
542   { 0xff3d,               NULL,         "]"   },      // fullwidth right bracket
543   { 0xff3e,               NULL,         "^" },      // fullwidth caret
544   { 0xff3f,               NULL,         "_" },      // fullwidth underscore
545   { 0xff40,               NULL,         "`" },      // fullwidth backquote
546   { 0xff41,               NULL,         "a" },      // fullwidth 'a'
547   { 0xff42,               NULL,         "b" },      // fullwidth 'b'
548   { 0xff43,               NULL,         "c" },      // fullwidth 'c'
549   { 0xff44,               NULL,         "d" },      // fullwidth 'd'
550   { 0xff45,               NULL,         "e" },      // fullwidth 'e'
551   { 0xff46,               NULL,         "f" },      // fullwidth 'f'
552   { 0xff47,               NULL,         "g" },      // fullwidth 'g'
553   { 0xff48,               NULL,         "h" },      // fullwidth 'h'
554   { 0xff49,               NULL,         "i" },      // fullwidth 'i'
555   { 0xff4a,               NULL,         "j" },      // fullwidth 'j'
556   { 0xff4b,               NULL,         "k" },      // fullwidth 'k'
557   { 0xff4c,               NULL,         "l" },      // fullwidth 'l'
558   { 0xff4d,               NULL,         "m" },      // fullwidth 'm'
559   { 0xff4e,               NULL,         "n" },      // fullwidth 'n'
560   { 0xff4f,               NULL,         "o" },      // fullwidth 'o'
561   { 0xff50,               NULL,         "p" },      // fullwidth 'p'
562   { 0xff51,               NULL,         "q" },      // fullwidth 'q'
563   { 0xff52,               NULL,         "r" },      // fullwidth 'r'
564   { 0xff53,               NULL,         "s" },      // fullwidth 's'
565   { 0xff54,               NULL,         "t" },      // fullwidth 't'
566   { 0xff55,               NULL,         "u" },      // fullwidth 'u'
567   { 0xff56,               NULL,         "v" },      // fullwidth 'v'
568   { 0xff57,               NULL,         "w" },      // fullwidth 'w'
569   { 0xff58,               NULL,         "x" },      // fullwidth 'x'
570   { 0xff59,               NULL,         "y" },      // fullwidth 'y'
571   { 0xff5a,               NULL,         "z" },      // fullwidth 'z'
572   { 0xff5b,               NULL,         "{" },      // fullwidth left brace
573   { 0xff5c,               NULL,         "|" },      // fullwidth vertical bar
574   { 0xff5d,               NULL,         "}" },      // fullwidth right brace
575   { 0xff5e,               NULL,         "~" },      // fullwidth tilde
576   { 0xff5f,               NULL,         "((" },      // fullwidth double left parenthesis
577   { 0xff60,               NULL,         "))" },      // fullwidth double right parenthesis
578   { 0xffe0,               NULL,         "\xC2\xA2" },      // fullwidth cent sign
579   { 0xffe1,               NULL,         "\xC2\xA3" },      // fullwidth pound sign
580   { 0xffe4,               NULL,         "\xC2\xA4" },      // fullwidth broken bar
581   { 0xffe5,               NULL,         "\xC2\xA5" },      // fullwidth yen sign
582   { 0xffe6,               NULL,         "\xE2\x82\xA9" },   // fullwidth won sign
583   { 0xffe9,               NULL,         "\xE2\x86\x90" },   // fullwidth left arrow
584   { 0xffea,               NULL,         "\xE2\x86\x91" },   // fullwidth up arrow
585   { 0xffeb,               NULL,         "\xE2\x86\x92" },   // fullwidth right arrow
586   { 0xffec,               NULL,         "\xE2\x86\x93" },   // fullwidth down arrow
587   { 0xffed,               NULL,         "\xE2\x96\xAA" },   // fullwidth solid box
588   { 0xffee,               NULL,         "\xE2\x97\xA6" },   // fullwidth open circle
589   { UCHAR_SHIFT_1,         "Shift",      NULL },      // Shift key
590   { UCHAR_SHIFT_2,         "Ctrl",         NULL },      // Ctrl key
591   { UCHAR_MAMEKEY(F1),      "F1",         NULL },      // F1 function key
592   { UCHAR_MAMEKEY(F2),      "F2",         NULL },      // F2 function key
593   { UCHAR_MAMEKEY(F3),      "F3",         NULL },      // F3 function key
594   { UCHAR_MAMEKEY(F4),      "F4",         NULL },      // F4 function key
595   { UCHAR_MAMEKEY(F5),      "F5",         NULL },      // F5 function key
596   { UCHAR_MAMEKEY(F6),      "F6",         NULL },      // F6 function key
597   { UCHAR_MAMEKEY(F7),      "F7",         NULL },      // F7 function key
598   { UCHAR_MAMEKEY(F8),      "F8",         NULL },      // F8 function key
599   { UCHAR_MAMEKEY(F9),      "F9",         NULL },      // F9 function key
600   { UCHAR_MAMEKEY(F10),      "F10",         NULL },      // F10 function key
601   { UCHAR_MAMEKEY(F11),      "F11",         NULL },      // F11 function key
602   { UCHAR_MAMEKEY(F12),      "F12",         NULL },      // F12 function key
603   { UCHAR_MAMEKEY(F13),      "F13",         NULL },      // F13 function key
604   { UCHAR_MAMEKEY(F14),      "F14",         NULL },      // F14 function key
605   { UCHAR_MAMEKEY(F15),      "F15",         NULL },      // F15 function key
606   { UCHAR_MAMEKEY(ESC),      "Esc",         "\033" },   // Esc key
607   { UCHAR_MAMEKEY(INSERT),   "Insert",      NULL },      // Insert key
608   { UCHAR_MAMEKEY(DEL),      "Delete",      "\010" },   // Delete key
609   { UCHAR_MAMEKEY(HOME),      "Home",         "\014" },   // Home key
610   { UCHAR_MAMEKEY(END),      "End",         NULL },      // End key
611   { UCHAR_MAMEKEY(PGUP),      "Page Up",      NULL },      // Page Up key
612   { UCHAR_MAMEKEY(PGDN),      "Page Down",   NULL },      // Page Down key
613   { UCHAR_MAMEKEY(LEFT),      "Cursor Left",   NULL },      // Cursor Left
614   { UCHAR_MAMEKEY(RIGHT),      "Cursor Right",   NULL },      // Cursor Right
615   { UCHAR_MAMEKEY(UP),      "Cursor Up",   NULL },      // Cursor Up
616   { UCHAR_MAMEKEY(DOWN),      "Cursor Down",   NULL },      // Cursor Down
617   { UCHAR_MAMEKEY(0_PAD),      "Keypad 0",      NULL },      // 0 on the numeric keypad
618   { UCHAR_MAMEKEY(1_PAD),      "Keypad 1",      NULL },      // 1 on the numeric keypad
619   { UCHAR_MAMEKEY(2_PAD),      "Keypad 2",      NULL },      // 2 on the numeric keypad
620   { UCHAR_MAMEKEY(3_PAD),      "Keypad 3",      NULL },      // 3 on the numeric keypad
621   { UCHAR_MAMEKEY(4_PAD),      "Keypad 4",      NULL },      // 4 on the numeric keypad
622   { UCHAR_MAMEKEY(5_PAD),      "Keypad 5",      NULL },      // 5 on the numeric keypad
623   { UCHAR_MAMEKEY(6_PAD),      "Keypad 6",      NULL },      // 6 on the numeric keypad
624   { UCHAR_MAMEKEY(7_PAD),      "Keypad 7",      NULL },      // 7 on the numeric keypad
625   { UCHAR_MAMEKEY(8_PAD),      "Keypad 8",      NULL },      // 8 on the numeric keypad
626   { UCHAR_MAMEKEY(9_PAD),      "Keypad 9",      NULL },      // 9 on the numeric keypad
627   { UCHAR_MAMEKEY(SLASH_PAD),   "Keypad /",      NULL },      // / on the numeric keypad
628   { UCHAR_MAMEKEY(ASTERISK),   "Keypad *",      NULL },      // * on the numeric keypad
629   { UCHAR_MAMEKEY(MINUS_PAD),   "Keypad -",      NULL },      // - on the numeric Keypad
630   { UCHAR_MAMEKEY(PLUS_PAD),   "Keypad +",      NULL },      // + on the numeric Keypad
631   { UCHAR_MAMEKEY(DEL_PAD),   "Keypad .",      NULL },      // . on the numeric keypad
632   { UCHAR_MAMEKEY(ENTER_PAD),   "Keypad Enter",   NULL },      // Enter on the numeric keypad
633   { UCHAR_MAMEKEY(PRTSCR),   "Print Screen",   NULL },      // Print Screen key
634   { UCHAR_MAMEKEY(PAUSE),      "Pause",      NULL },      // Pause key
635   { UCHAR_MAMEKEY(LSHIFT),   "Left Shift",   NULL },      // Left Shift key
636   { UCHAR_MAMEKEY(RSHIFT),   "Right Shift",   NULL },      // Right Shift key
637   { UCHAR_MAMEKEY(LCONTROL),   "Left Ctrl",   NULL },      // Left Control key
638   { UCHAR_MAMEKEY(RCONTROL),   "Right Ctrl",   NULL },      // Right Control key
639   { UCHAR_MAMEKEY(LALT),      "Left Alt",      NULL },      // Left Alt key
640   { UCHAR_MAMEKEY(RALT),      "Right Alt",   NULL },      // Right Alt key
641   { UCHAR_MAMEKEY(SCRLOCK),   "Scroll Lock",   NULL },      // Scroll Lock key
642   { UCHAR_MAMEKEY(NUMLOCK),   "Num Lock",      NULL },      // Num Lock key
643   { UCHAR_MAMEKEY(CAPSLOCK),   "Caps Lock",   NULL },      // Caps Lock key
644   { UCHAR_MAMEKEY(LWIN),      "Left Win",      NULL },      // Left Win key
645   { UCHAR_MAMEKEY(RWIN),      "Right Win",   NULL },      // Right Win key
646   { UCHAR_MAMEKEY(MENU),      "Menu",         NULL },      // Menu key
647   { UCHAR_MAMEKEY(CANCEL),   "Break",      NULL }      // Break/Pause key
547648};
548649
549static TIMER_CALLBACK(inputx_timerproc);
550650
551651
552/*  Debugging commands and handlers. */
553static void execute_input(running_machine &machine, int ref, int params, const char *param[]);
554static void execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[]);
652//**************************************************************************
653//  COMMON SHARED STRINGS
654//**************************************************************************
555655
556/***************************************************************************
557    COMMON SHARED STRINGS
558***************************************************************************/
559
560656static const struct
561657{
562658   UINT32 id;
r15082r15083
686782
687783
688784
689/***************************************************************************
690    BUILT-IN CORE MAPPINGS
691***************************************************************************/
785//**************************************************************************
786//  BUILT-IN CORE MAPPINGS
787//**************************************************************************
692788
693789#include "inpttype.h"
694790
695791
696792
697/***************************************************************************
698    FUNCTION PROTOTYPES
699***************************************************************************/
793//**************************************************************************
794//  PORT CONFIGURATIONS
795//**************************************************************************
700796
701/* core system management */
702static void input_port_exit(running_machine &machine);
797//**************************************************************************
798//  I/O PORT LIST
799//**************************************************************************
703800
704/* port reading */
705static INT32 apply_analog_settings(INT32 current, analog_field_state *analog);
801//-------------------------------------------------
802//  append - append the given device's input ports
803//  to the current list
804//-------------------------------------------------
706805
707/* initialization helpers */
708static void init_port_types(running_machine &machine);
709static void init_port_state(running_machine &machine);
710static void init_autoselect_devices(running_machine &machine, int type1, int type2, int type3, const char *option, const char *ananame);
711static device_field_info *init_field_device_info(const input_field_config *field,const char *device_name);
712static analog_field_state *init_field_analog_state(const input_field_config *field);
806void ioport_list::append(device_t &device, astring &errorbuf)
807{
808   // no constructor, no list
809   ioport_constructor constructor = device.input_ports();
810   if (constructor == NULL)
811      return;
713812
714/* once-per-frame updates */
715static void frame_update_callback(running_machine &machine);
716static void frame_update(running_machine &machine);
717static void frame_update_digital_joysticks(running_machine &machine);
718static void frame_update_analog_field(running_machine &machine, analog_field_state *analog);
719static int frame_get_digital_field_state(const input_field_config *field, int mouse_down);
813   // reset error buffer
814   errorbuf.reset();
720815
721/* tokenization helpers */
722static int token_to_input_field_type(running_machine &machine, const char *string, int *player);
723static const char *input_field_type_to_token(running_machine &machine, int type, int player);
724static int token_to_seq_type(const char *string);
816   // detokenize into the list
817   (*constructor)(device, *this, errorbuf);
725818
726/* settings load */
727static void load_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode);
728static void load_remap_table(running_machine &machine, xml_data_node *parentnode);
729static int load_default_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
730static int load_game_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
819   // collapse fields and sort the list
820   for (ioport_port *port = first(); port != NULL; port = port->next())
821      port->collapse_fields(errorbuf);
822}
731823
732/* settings save */
733static void save_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode);
734static void save_sequence(running_machine &machine, xml_data_node *parentnode, int type, int porttype, const input_seq &seq);
735static int save_this_input_field_type(int type);
736static void save_default_inputs(running_machine &machine, xml_data_node *parentnode);
737static void save_game_inputs(running_machine &machine, xml_data_node *parentnode);
738824
739/* input playback */
740static time_t playback_init(running_machine &machine);
741static void playback_end(running_machine &machine, const char *message);
742static void playback_frame(running_machine &machine, attotime curtime);
743static void playback_port(const input_port_config *port);
744825
745/* input recording */
746static void record_init(running_machine &machine);
747static void record_end(running_machine &machine, const char *message);
748static void record_frame(running_machine &machine, attotime curtime);
749static void record_port(const input_port_config *port);
826//**************************************************************************
827//  INPUT TYPE ENTRY
828//**************************************************************************
750829
830//-------------------------------------------------
831//  input_type_entry - constructors
832//-------------------------------------------------
751833
752
753/***************************************************************************
754    INLINE FUNCTIONS
755***************************************************************************/
756
757/*-------------------------------------------------
758    apply_analog_min_max - clamp the given input
759    value to the appropriate min/max for the
760    analog control
761-------------------------------------------------*/
762
763INLINE INT32 apply_analog_min_max(const analog_field_state *analog, INT32 value)
834input_type_entry::input_type_entry(ioport_type type, ioport_group group, int player, const char *token, const char *name, input_seq standard)
835   : m_next(NULL),
836     m_type(type),
837     m_group(group),
838     m_player(player),
839     m_token(token),
840     m_name(name)
764841{
765   /* take the analog minimum and maximum values and apply the inverse of the */
766   /* sensitivity so that we can clamp against them before applying sensitivity */
767   INT32 adjmin = APPLY_INVERSE_SENSITIVITY(analog->minimum, analog->sensitivity);
768   INT32 adjmax = APPLY_INVERSE_SENSITIVITY(analog->maximum, analog->sensitivity);
769
770   /* for absolute devices, clamp to the bounds absolutely */
771   if (!analog->wraps)
772   {
773      if (value > adjmax)
774         value = adjmax;
775      else if (value < adjmin)
776         value = adjmin;
777   }
778
779   /* for relative devices, wrap around when we go past the edge */
780   else
781   {
782      INT32 range = adjmax - adjmin;
783      /* rolls to other end when 1 position past end. */
784      value = (value - adjmin) % range;
785      if (value < 0)
786         value += range;
787      value += adjmin;
788   }
789
790   return value;
842   m_defseq[SEQ_TYPE_STANDARD] = m_seq[SEQ_TYPE_STANDARD] = standard;
791843}
792844
793
794/*-------------------------------------------------
795    get_port_tag - return a guaranteed tag for
796    a port
797-------------------------------------------------*/
798
799INLINE const char *get_port_tag(const input_port_config *port, char *tempbuffer)
845input_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)
846   : m_next(NULL),
847     m_type(type),
848     m_group(group),
849     m_player(player),
850     m_token(token),
851     m_name(name)
800852{
801   return port->tag();
853   m_defseq[SEQ_TYPE_STANDARD] = m_seq[SEQ_TYPE_STANDARD] = standard;
854   m_defseq[SEQ_TYPE_INCREMENT] = m_seq[SEQ_TYPE_INCREMENT] = increment;
855   m_defseq[SEQ_TYPE_DECREMENT] = m_seq[SEQ_TYPE_DECREMENT] = decrement;
802856}
803857
804858
805/*-------------------------------------------------
806    condition_equal - TRUE if two conditions are
807    equivalent
808-------------------------------------------------*/
859//-------------------------------------------------
860//  configure_osd - set the token and name of an
861//   OSD entry
862//-------------------------------------------------
809863
810INLINE int condition_equal(const input_condition *cond1, const input_condition *cond2)
864void input_type_entry::configure_osd(const char *token, const char *name)
811865{
812   return (cond1->mask == cond2->mask && cond1->value == cond2->value && cond1->condition == cond2->condition && strcmp(cond1->tag, cond2->tag) == 0);
866   assert(m_type >= IPT_OSD_1 && m_type <= IPT_OSD_16);
867   m_token = token;
868   m_name = name;
813869}
814870
815871
872//**************************************************************************
873//  DIGITAL JOYSTICKS
874//**************************************************************************
816875
817/***************************************************************************
818    CORE SYSTEM MANAGEMENT
819***************************************************************************/
876//-------------------------------------------------
877//  digital_joystick - constructor
878//-------------------------------------------------
820879
821/*-------------------------------------------------
822    input_port_init - initialize the input port
823    system
824-------------------------------------------------*/
825
826ioport_manager::ioport_manager(running_machine &machine)
827   : safe_to_read(false),
828     last_frame_time(attotime::zero),
829     last_delta_nsec(0),
830     record_file(NULL),
831     playback_file(NULL),
832     playback_accumulated_speed(0),
833     playback_accumulated_frames(0),
834     codes(NULL),
835     inputx_timer(NULL),
836     queue_chars(NULL),
837     accept_char(NULL),
838     charqueue_empty(NULL),
839     current_rate(attotime::zero),
840     m_machine(machine)
880digital_joystick::digital_joystick(int player, int number)
881   : m_player(player),
882     m_number(number),
883     m_current(0),
884     m_current4way(0),
885     m_previous(0)
841886{
842   memset(type_to_entry, 0, sizeof(type_to_entry));
843   memset(joystick_info, 0, sizeof(joystick_info));
887   memset(m_field, 0, sizeof(m_field));
844888}
845889
846time_t ioport_manager::initialize()
847{
848   /* add an exit callback and a frame callback */
849   machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(input_port_exit), &machine()));
850   machine().add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(frame_update_callback), &machine()));
851890
852   /* initialize the default port info from the OSD */
853   init_port_types(machine());
891//-------------------------------------------------
892//  set_axis - configure a single axis of a
893//  digital joystick
894//-------------------------------------------------
854895
855   /* if we have a token list, proceed */
856   device_iterator iter(machine().root_device());
857   for (device_t *device = iter.first(); device != NULL; device = iter.next())
858   {
859      astring errors;
860      input_port_list_init(*device, m_portlist, errors);
861      if (errors)
862         mame_printf_error("Input port errors:\n%s", errors.cstr());
863   }
864
865   init_port_state(machine());
866   /* register callbacks for when we load configurations */
867   config_register(machine(), "input", config_saveload_delegate(FUNC(load_config_callback), &machine()), config_saveload_delegate(FUNC(save_config_callback), &machine()));
868
869   /* open playback and record files if specified */
870   time_t basetime = playback_init(machine());
871   record_init(machine());
872
873   return basetime;
874}
875
876
877/*-------------------------------------------------
878    input_port_exit - exit callback to ensure
879    we clean up and close our files
880-------------------------------------------------*/
881
882static void input_port_exit(running_machine &machine)
896digital_joystick::direction_t digital_joystick::set_axis(ioport_field &field)
883897{
884   /* close any playback or recording files */
885   playback_end(machine, NULL);
886   record_end(machine, NULL);
898   direction_t direction = direction_t((field.type() - (IPT_DIGITAL_JOYSTICK_FIRST + 1)) % 4);
899   m_field[direction] = &field;
900   return direction;
887901}
888902
889903
904//-------------------------------------------------
905//  frame_update - update the state of digital
906//  joysticks prior to accumulating the results
907//  in a port
908//-------------------------------------------------
890909
891/***************************************************************************
892    PORT CONFIGURATIONS
893***************************************************************************/
894
895/*-------------------------------------------------
896    input_port_list_init - initialize an input
897    port list structure and allocate ports
898    according to the given tokens
899-------------------------------------------------*/
900
901void input_port_list_init(device_t &device, ioport_list &portlist, astring &errorbuf)
910void digital_joystick::frame_update()
902911{
903   /* no constructor, no list */
904   ioport_constructor constructor = device.input_ports();
905   if (constructor == NULL)
906      return;
912   // remember previous state and reset current state
913   m_previous = m_current;
914   m_current = 0;
907915
908   /* reset error buffer */
909   errorbuf.reset();
916   // read all the associated ports
917   running_machine *machine = NULL;
918   for (direction_t direction = JOYDIR_UP; direction < JOYDIR_COUNT; direction++)
919      if (m_field[direction] != NULL)
920      {
921         machine = &m_field[direction]->machine();
922         if (machine->input().seq_pressed(m_field[direction]->seq(SEQ_TYPE_STANDARD)))
923            m_current |= 1 << direction;
924      }
910925
911   /* detokenize into the list */
912   (*constructor)(device, portlist, errorbuf);
926   // lock out opposing directions (left + right or up + down)
927   if ((m_current & (UP_BIT | DOWN_BIT)) == (UP_BIT | DOWN_BIT))
928      m_current &= ~(UP_BIT | DOWN_BIT);
929   if ((m_current & (LEFT_BIT | RIGHT_BIT)) == (LEFT_BIT | RIGHT_BIT))
930      m_current &= ~(LEFT_BIT | RIGHT_BIT);
913931
914   // collapse fields and sort the list
915   for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
916      port->collapse_fields(errorbuf);
917}
932   // only update 4-way case if joystick has moved
933   if (m_current != m_previous)
934   {
935      m_current4way = m_current;
918936
937      //
938      //  If joystick is pointing at a diagonal, acknowledge that the player moved
939      //  the joystick by favoring a direction change.  This minimizes frustration
940      //  when using a keyboard for input, and maximizes responsiveness.
941      //
942      //  For example, if you are holding "left" then switch to "up" (where both left
943      //  and up are briefly pressed at the same time), we'll transition immediately
944      //  to "up."
945      //
946      //  Zero any switches that didn't change from the previous to current state.
947      //
948      if ((m_current4way & (UP_BIT | DOWN_BIT)) &&
949         (m_current4way & (LEFT_BIT | RIGHT_BIT)))
950      {
951         m_current4way ^= m_current4way & m_previous;
952      }
919953
920/*-------------------------------------------------
921    input_field_by_tag_and_mask - return a pointer
922    to the first field that intersects the given
923    mask on the tagged port
924-------------------------------------------------*/
925
926const input_field_config *input_field_by_tag_and_mask(running_machine &machine, const char *tag, input_port_value mask)
927{
928   const input_port_config *port = machine.root_device().ioport(tag);
929
930   /* if we got the port, look for the field */
931   if (port != NULL)
932      for (const input_field_config *field = port->first_field(); field != NULL; field = field->next())
933         if ((field->mask & mask) != 0)
934            return field;
935
936   return NULL;
954      //
955      //  If we are still pointing at a diagonal, we are in an indeterminant state.
956      //
957      //  This could happen if the player moved the joystick from the idle position directly
958      //  to a diagonal, or from one diagonal directly to an extreme diagonal.
959      //
960      //  The chances of this happening with a keyboard are slim, but we still need to
961      //  constrain this case.
962      //
963      //  For now, just resolve randomly.
964      //
965      if ((m_current4way & (UP_BIT | DOWN_BIT)) &&
966         (m_current4way & (LEFT_BIT | RIGHT_BIT)))
967      {
968         if (machine->rand() & 1)
969            m_current4way &= ~(LEFT_BIT | RIGHT_BIT);
970         else
971            m_current4way &= ~(UP_BIT | DOWN_BIT);
972      }
973   }
937974}
938975
939976
940977
941/***************************************************************************
942    ACCESSORS FOR INPUT FIELDS
943***************************************************************************/
978//**************************************************************************
979//  NATURAL KEYBOARD
980//**************************************************************************
944981
945/*-------------------------------------------------
946    input_field_name - return the field name for
947    a given input field
948-------------------------------------------------*/
982//-------------------------------------------------
983//  natural_keyboard - constructor
984//-------------------------------------------------
949985
950const char *input_field_name(const input_field_config *field)
986natural_keyboard::natural_keyboard(running_machine &machine)
987   : m_machine(machine),
988     m_bufbegin(0),
989     m_bufend(0),
990     m_status_keydown(false),
991     m_last_cr(false),
992     m_timer(NULL),
993     m_current_rate(attotime::zero)
951994{
952   /* if we have a non-default name, use that */
953   if ((field->state != NULL) && (field->state->name != NULL))
954      return field->state->name;
955   if (field->name != NULL)
956      return field->name;
995   // reigster debugger commands
996   if (machine.debug_flags & DEBUG_FLAG_ENABLED)
997   {
998      debug_console_register_command(machine, "input", CMDFLAG_NONE, 0, 1, 1, execute_input);
999      debug_console_register_command(machine, "dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd);
1000   }
9571001
958   /* otherwise, return the name associated with the type */
959   return input_type_name(field->machine(), field->type, field->player);
1002   // posting keys directly only makes sense for a computer
1003   if (machine.ioport().has_keyboard())
1004   {
1005      m_buffer.resize(KEY_BUFFER_SIZE);
1006      m_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(natural_keyboard::timer), this));
1007      build_codes(machine.ioport());
1008   }
9601009}
9611010
9621011
963/*-------------------------------------------------
964    input_field_seq - return the input sequence
965    for the given input field
966-------------------------------------------------*/
1012//-------------------------------------------------
1013//  configure - configure callbacks for full-
1014//  featured keyboard support
1015//-------------------------------------------------
9671016
968const input_seq &input_field_seq(const input_field_config *field, input_seq_type seqtype)
1017void natural_keyboard::configure(ioport_queue_chars_delegate queue_chars, ioport_accept_char_delegate accept_char, ioport_charqueue_empty_delegate charqueue_empty)
9691018{
970   /* if the field is disabled, return no key */
971   if (field->flags & FIELD_FLAG_UNUSED)
972      return input_seq::empty_seq;
973
974   /* select either the live or config state depending on whether we have live state */
975   const input_seq &portseq = (field->state == NULL) ? field->seq[seqtype] : field->state->seq[seqtype];
976
977   /* if the portseq is the special default code, return the expanded default value */
978   if (portseq.is_default())
979      return input_type_seq(field->machine(), field->type, field->player, seqtype);
980
981   /* otherwise, return the sequence as-is */
982   return portseq;
1019   // set the callbacks
1020   m_queue_chars = queue_chars;
1021   m_accept_char = accept_char;
1022   m_charqueue_empty = charqueue_empty;
9831023}
9841024
9851025
986/*-------------------------------------------------
987    input_field_get_user_settings - return the current
988    settings for the given input field
989-------------------------------------------------*/
1026//-------------------------------------------------
1027//  post - post a single character
1028//-------------------------------------------------
9901029
991void input_field_get_user_settings(const input_field_config *field, input_field_user_settings *settings)
1030void natural_keyboard::post(unicode_char ch)
9921031{
993   int seqtype;
994
995   /* zap the entire structure */
996   memset(settings, 0, sizeof(*settings));
997
998   /* copy the basics */
999   for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++)
1000      settings->seq[seqtype] = field->state->seq[seqtype];
1001
1002   /* if there's a list of settings or we're an adjuster, copy the current value */
1003   if (field->settinglist().count() != 0 || field->type == IPT_ADJUSTER)
1004      settings->value = field->state->value;
1005
1006   /* if there's analog data, extract the analog settings */
1007   if (field->state->analog != NULL)
1032   // ignore any \n that are preceded by \r
1033   if (m_last_cr && ch == '\n')
10081034   {
1009      settings->sensitivity = field->state->analog->sensitivity;
1010      settings->delta = field->state->analog->delta;
1011      settings->centerdelta = field->state->analog->centerdelta;
1012      settings->reverse = field->state->analog->reverse;
1035      m_last_cr = false;
1036      return;
10131037   }
1014}
10151038
1039   // change all eolns to '\r'
1040   if (ch == '\n')
1041      ch = '\r';
1042   else
1043      m_last_cr = (ch == '\r');
10161044
1017/*-------------------------------------------------
1018    input_field_set_user_settings - modify the current
1019    settings for the given input field
1020-------------------------------------------------*/
1021
1022void input_field_set_user_settings(const input_field_config *field, const input_field_user_settings *settings)
1023{
1024   int seqtype;
1025
1026   /* copy the basics */
1027   for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++)
1045   // logging
1046   if (LOG_NATURAL_KEYBOARD)
10281047   {
1029      const input_seq &defseq = input_type_seq(field->machine(), field->type, field->player, (input_seq_type)seqtype);
1030      if (defseq == settings->seq[seqtype])
1031         field->state->seq[seqtype].set_default();
1032      else
1033         field->state->seq[seqtype] = settings->seq[seqtype];
1048      const keycode_map_entry *code = find_code(ch);
1049      astring tempstr;
1050      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>");
10341051   }
10351052
1036   /* if there's a list of settings or we're an adjuster, copy the current value */
1037   if (field->settinglist().count() != 0 || field->type == IPT_ADJUSTER)
1038      field->state->value = settings->value;
1053   // can we post this key in the queue directly?
1054   if (can_post_directly(ch))
1055      internal_post(ch);
10391056
1040   /* if there's analog data, extract the analog settings */
1041   if (field->state->analog != NULL)
1057   // can we post this key with an alternate representation?
1058   else if (can_post_alternate(ch))
10421059   {
1043      field->state->analog->sensitivity = settings->sensitivity;
1044      field->state->analog->delta = settings->delta;
1045      field->state->analog->centerdelta = settings->centerdelta;
1046      field->state->analog->reverse = settings->reverse;
1060      const char_info *info = char_info::find(ch);
1061      assert(info != NULL && info->alternate != NULL);
1062      const char *altstring = info->alternate;
1063      while (*altstring != 0)
1064      {
1065         altstring += uchar_from_utf8(&ch, altstring, strlen(altstring));
1066         internal_post(ch);
1067      }
10471068   }
10481069}
10491070
10501071
1051/*-------------------------------------------------
1052    input_field_setting_name - return the expanded
1053    setting name for a field
1054-------------------------------------------------*/
1072//-------------------------------------------------
1073//  post - post a unicode encoded string
1074//-------------------------------------------------
10551075
1056const char *input_field_setting_name(const input_field_config *field)
1076void natural_keyboard::post(const unicode_char *text, size_t length, attotime rate)
10571077{
1058   const input_setting_config *setting;
1078   // set the fixed rate
1079   m_current_rate = rate;
1080   
1081   // 0 length means strlen
1082   if (length == 0)
1083      for (const unicode_char *scan = text; *scan != 0; scan++)
1084         length++;
10591085
1060   /* only makes sense if we have settings */
1061   assert(field->settinglist().count() != 0);
1062
1063   /* scan the list of settings looking for a match on the current value */
1064   for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
1065      if (input_condition_true(field->machine(), &setting->condition, field->port().owner()))
1066         if (setting->value == field->state->value)
1067            return setting->name;
1068
1069   return "INVALID";
1086   // iterate over characters or until the buffer is full up
1087   while (length > 0 && !full())
1088   {
1089      // fetch next character
1090      post(*text++);
1091      length--;
1092   }
10701093}
10711094
10721095
1073/*-------------------------------------------------
1074    input_field_has_previous_setting - return TRUE
1075    if the given field has a "previous" setting
1076-------------------------------------------------*/
1096//-------------------------------------------------
1097//  post_utf8 - post a UTF-8 encoded string
1098//-------------------------------------------------
10771099
1078int input_field_has_previous_setting(const input_field_config *field)
1100void natural_keyboard::post_utf8(const char *text, size_t length, attotime rate)
10791101{
1080   const input_setting_config *setting;
1102   // set the fixed rate
1103   m_current_rate = rate;
1104   
1105   // 0-length means strlen   
1106   if (length == 0)
1107      length = strlen(text);
10811108
1082   /* only makes sense if we have settings */
1083   assert(field->settinglist().count() != 0);
1084
1085   /* scan the list of settings looking for a match on the current value */
1086   for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
1087      if (input_condition_true(field->machine(), &setting->condition, field->port().owner()))
1088         return (setting->value != field->state->value);
1089
1090   return FALSE;
1109   // iterate until out of characters
1110   while (length > 0)
1111   {
1112      // decode the next character
1113      unicode_char uc;
1114      int count = uchar_from_utf8(&uc, text, length);
1115      if (count < 0)
1116      {
1117         count = 1;
1118         uc = INVALID_CHAR;
1119      }
1120     
1121      // append to the buffer
1122      post(uc);
1123      text += count;
1124      length -= count;
1125   }
10911126}
10921127
10931128
1094/*-------------------------------------------------
1095    input_field_select_previous_setting - select
1096    the previous item for a DIP switch or
1097    configuration field
1098-------------------------------------------------*/
1129//-------------------------------------------------
1130//  post_coded - post a coded string
1131//-------------------------------------------------
10991132
1100void input_field_select_previous_setting(const input_field_config *field)
1133void natural_keyboard::post_coded(const char *text, size_t length, attotime rate)
11011134{
1102   const input_setting_config *setting, *prevsetting;
1103   int found_match = FALSE;
1135   static const struct
1136   {
1137      const char *key;
1138      unicode_char code;
1139   } codes[] =
1140   {
1141      { "BACKSPACE",   8 },
1142      { "BS",         8 },
1143      { "BKSP",      8 },
1144      { "DEL",      UCHAR_MAMEKEY(DEL) },
1145      { "DELETE",      UCHAR_MAMEKEY(DEL) },
1146      { "END",      UCHAR_MAMEKEY(END) },
1147      { "ENTER",      13 },
1148      { "ESC",      '\033' },
1149      { "HOME",      UCHAR_MAMEKEY(HOME) },
1150      { "INS",      UCHAR_MAMEKEY(INSERT) },
1151      { "INSERT",      UCHAR_MAMEKEY(INSERT) },
1152      { "PGDN",      UCHAR_MAMEKEY(PGDN) },
1153      { "PGUP",      UCHAR_MAMEKEY(PGUP) },
1154      { "SPACE",      32 },
1155      { "TAB",      9 },
1156      { "F1",         UCHAR_MAMEKEY(F1) },
1157      { "F2",         UCHAR_MAMEKEY(F2) },
1158      { "F3",         UCHAR_MAMEKEY(F3) },
1159      { "F4",         UCHAR_MAMEKEY(F4) },
1160      { "F5",         UCHAR_MAMEKEY(F5) },
1161      { "F6",         UCHAR_MAMEKEY(F6) },
1162      { "F7",         UCHAR_MAMEKEY(F7) },
1163      { "F8",         UCHAR_MAMEKEY(F8) },
1164      { "F9",         UCHAR_MAMEKEY(F9) },
1165      { "F10",      UCHAR_MAMEKEY(F10) },
1166      { "F11",      UCHAR_MAMEKEY(F11) },
1167      { "F12",      UCHAR_MAMEKEY(F12) },
1168      { "QUOTE",      '\"' }
1169   };
11041170
1105   /* only makes sense if we have settings */
1106   assert(field->settinglist().count() != 0);
1171   // set the fixed rate
1172   m_current_rate = rate;
1173   
1174   // 0-length means strlen   
1175   if (length == 0)
1176      length = strlen(text);
11071177
1108   /* scan the list of settings looking for a match on the current value */
1109   prevsetting = NULL;
1110   for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
1111      if (input_condition_true(field->machine(), &setting->condition, field->port().owner()))
1112      {
1113         if (setting->value == field->state->value)
1178   // iterate through the source string
1179   size_t curpos = 0;
1180   while (curpos < length)
1181   {
1182      // extract next character
1183      unicode_char ch = text[curpos];
1184      size_t increment = 1;
1185
1186      // look for escape characters
1187      if (ch == '{')
1188         for (int codenum = 0; codenum < ARRAY_LENGTH(codes); codenum++)
11141189         {
1115            found_match = TRUE;
1116            if (prevsetting != NULL)
1117               break;
1190            size_t keylen = strlen(codes[codenum].key);
1191            if (curpos + keylen + 2 <= length)
1192               if (core_strnicmp(codes[codenum].key, &text[curpos + 1], keylen) == 0 && text[curpos + keylen + 1] == '}')
1193               {
1194                  ch = codes[codenum].code;
1195                  increment = keylen + 2;
1196               }
11181197         }
1119         prevsetting = setting;
1120      }
11211198
1122   /* if we didn't find a matching value, select the first */
1123   if (!found_match)
1124   {
1125      for (prevsetting = field->settinglist().first(); prevsetting != NULL; prevsetting = prevsetting->next())
1126         if (input_condition_true(field->machine(), &prevsetting->condition, field->port().owner()))
1127            break;
1199      // if we got a code, post it
1200      if (ch != 0)
1201         post(ch);
1202      curpos += increment;
11281203   }
1129
1130   /* update the value to the previous one */
1131   if (prevsetting != NULL)
1132      field->state->value = prevsetting->value;
11331204}
11341205
11351206
1136/*-------------------------------------------------
1137    input_field_has_next_setting - return TRUE
1138    if the given field has a "next" setting
1139-------------------------------------------------*/
1207//-------------------------------------------------
1208//  build_codes - given an input port table, create
1209//  an input code table useful for mapping unicode
1210//  chars
1211//-------------------------------------------------
11401212
1141int input_field_has_next_setting(const input_field_config *field)
1213void natural_keyboard::build_codes(ioport_manager &manager)
11421214{
1143   const input_setting_config *setting;
1144   int found = FALSE;
1215   // iterate over shift keys
1216   ioport_field *shift[UCHAR_SHIFT_END + 1 - UCHAR_SHIFT_BEGIN] = { 0 };
1217   for (int curshift = 0; curshift <= ARRAY_LENGTH(shift); curshift++)
1218      if (curshift == 0 || shift[curshift - 1] != NULL)
11451219
1146   /* only makes sense if we have settings */
1147   assert(field->settinglist().count() != 0);
1220         // iterate over ports and fields
1221         for (ioport_port *port = manager.first_port(); port != NULL; port = port->next())
1222            for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
1223               if (field->type() == IPT_KEYBOARD)
1224               {
1225                  // fetch the code, ignoring 0
1226                  unicode_char code = field->keyboard_code(curshift);
1227                  if (code == 0)
1228                     continue;
11481229
1149   /* scan the list of settings looking for a match on the current value */
1150   for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
1151      if (input_condition_true(field->machine(), &setting->condition, field->port().owner()))
1152      {
1153         if (found)
1154            return TRUE;
1155         if (setting->value == field->state->value)
1156            found = TRUE;
1157      }
1230                  // is this a shifter key?
1231                  if (code >= UCHAR_SHIFT_BEGIN && code <= UCHAR_SHIFT_END)
1232                     shift[code - UCHAR_SHIFT_BEGIN] = field;
11581233
1159   return FALSE;
1234                  // not a shifter key; record normally
1235                  else
1236                  {
1237                     keycode_map_entry newcode;
1238                     if (curshift == 0)
1239                        newcode.field[0] = field;
1240                     else
1241                     {
1242                        newcode.field[0] = shift[curshift - 1];
1243                        newcode.field[1] = field;
1244                     }
1245                     newcode.ch = code;
1246                     m_keycode_map.append(newcode);
1247
1248                     if (LOG_NATURAL_KEYBOARD)
1249                     {
1250                        astring tempstr;
1251                        logerror("natural_keyboard: code=%i (%s) port=%p field->name='%s'\n", int(code), unicode_to_string(tempstr, code), port, field->name());
1252                     }
1253                  }
1254               }
11601255}
11611256
11621257
1163/*-------------------------------------------------
1164    input_field_select_next_setting - select the
1165    next item for a DIP switch or
1166    configuration field
1167-------------------------------------------------*/
1258//-------------------------------------------------
1259//  can_post_directly - determine if the given
1260//  unicode character can be directly posted
1261//-------------------------------------------------
11681262
1169void input_field_select_next_setting(const input_field_config *field)
1263bool natural_keyboard::can_post_directly(unicode_char ch)
11701264{
1171   const input_setting_config *setting, *nextsetting;
1265   // if we have a queueing callback, then it depends on whether we can accept the character
1266   if (!m_queue_chars.isnull())
1267      return m_accept_char.isnull() ? true : m_accept_char(ch);
11721268
1173   /* only makes sense if we have settings */
1174   assert(field->settinglist().count() != 0);
1175
1176   /* scan the list of settings looking for a match on the current value */
1177   nextsetting = NULL;
1178   for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
1179      if (input_condition_true(field->machine(), &setting->condition, field->port().owner()))
1180         if (setting->value == field->state->value)
1181            break;
1182
1183   /* if we found one, scan forward for the next valid one */
1184   if (setting != NULL)
1185      for (nextsetting = setting->next(); nextsetting != NULL; nextsetting = nextsetting->next())
1186         if (input_condition_true(field->machine(), &nextsetting->condition, field->port().owner()))
1187            break;
1188
1189   /* if we hit the end, search from the beginning */
1190   if (nextsetting == NULL)
1191      for (nextsetting = field->settinglist().first(); nextsetting != NULL; nextsetting = nextsetting->next())
1192         if (input_condition_true(field->machine(), &nextsetting->condition, field->port().owner()))
1193            break;
1194
1195   /* update the value to the previous one */
1196   if (nextsetting != NULL)
1197      field->state->value = nextsetting->value;
1269   // otherwise, it depends on the input codes
1270   const keycode_map_entry *code = find_code(ch);
1271   return (code != NULL && code->field[0] != NULL);
11981272}
11991273
12001274
1275//-------------------------------------------------
1276//  can_post_alternate - determine if the given
1277//  unicode character can be posted via translation
1278//-------------------------------------------------
12011279
1202/***************************************************************************
1203    ACCESSORS FOR INPUT TYPES
1204***************************************************************************/
1205
1206/*-------------------------------------------------
1207    input_type_is_analog - return TRUE if
1208    the given type represents an analog control
1209-------------------------------------------------*/
1210
1211int input_type_is_analog(int type)
1280bool natural_keyboard::can_post_alternate(unicode_char ch)
12121281{
1213   return (type >= __ipt_analog_start && type <= __ipt_analog_end);
1282   const char_info *info = char_info::find(ch);
1283   if (info == NULL)
1284      return false;
1285   
1286   const char *altstring = info->alternate;
1287   if (altstring == NULL)
1288      return false;
1289
1290   while (*altstring != 0)
1291   {
1292      unicode_char uchar;
1293      int count = uchar_from_utf8(&uchar, altstring, strlen(altstring));
1294      if (count <= 0)
1295         return false;
1296      if (!can_post_directly(uchar))
1297         return false;
1298      altstring += count;
1299   }
1300   return true;
12141301}
12151302
12161303
1217/*-------------------------------------------------
1218    input_type_name - return the name
1219    for the given type/player
1220-------------------------------------------------*/
1304//-------------------------------------------------
1305//  choose_delay - determine the delay between
1306//   posting keyboard events
1307//-------------------------------------------------
12211308
1222const char *input_type_name(running_machine &machine, int type, int player)
1309attotime natural_keyboard::choose_delay(unicode_char ch)
12231310{
1224   /* if we have a machine, use the live state and quick lookup */
1225   ioport_manager &portdata = machine.ioport();
1226   input_type_entry *entry = portdata.type_to_entry[type][player];
1227   if (entry != NULL)
1228      return entry->name;
1311   // if we have a live rate, just use that
1312   if (m_current_rate != attotime::zero)
1313      return m_current_rate;
12291314
1230   /* if we find nothing, return an invalid group */
1231   return "???";
1315   // systems with queue_chars can afford a much smaller delay
1316   if (!m_queue_chars.isnull())
1317      return attotime::from_msec(10);
1318
1319   // otherwise, default to constant delay with a longer delay on CR   
1320   return attotime::from_msec((ch == '\r') ? 200 : 50);
12321321}
12331322
12341323
1235/*-------------------------------------------------
1236    input_type_group - return the group
1237    for the given type/player
1238-------------------------------------------------*/
1324//-------------------------------------------------
1325//  internal_post - post a keyboard event
1326//-------------------------------------------------
12391327
1240int input_type_group(running_machine &machine, int type, int player)
1328void natural_keyboard::internal_post(unicode_char ch)
12411329{
1242   ioport_manager &portdata = machine.ioport();
1243   input_type_entry *entry = portdata.type_to_entry[type][player];
1244   if (entry != NULL)
1245      return entry->group;
1330   // need to start up the timer?
1331   if (empty())
1332   {
1333      m_timer->adjust(choose_delay(ch));
1334      m_status_keydown = 0;
1335   }
12461336
1247   /* if we find nothing, return an invalid group */
1248   return IPG_INVALID;
1337   // add to the buffer, resizing if necessary
1338   m_buffer[m_bufend++] = ch;
1339   if ((m_bufend + 1) % m_buffer.count() == m_bufbegin)
1340      m_buffer.resize(m_buffer.count() + KEY_BUFFER_SIZE, true);
1341   m_bufend %= m_buffer.count();
12491342}
12501343
12511344
1252/*-------------------------------------------------
1253    input_type_seq - return the input
1254    sequence for the given type/player
1255-------------------------------------------------*/
1345//-------------------------------------------------
1346//  timer - timer callback to keep things flowing
1347//   when posting a string of characters
1348//-------------------------------------------------
12561349
1257const input_seq &input_type_seq(running_machine &machine, int type, int player, input_seq_type seqtype)
1350void natural_keyboard::timer(void *ptr, int param)
12581351{
1259   assert(type >= 0 && type < __ipt_max);
1260   assert(player >= 0 && player < MAX_PLAYERS);
1352   // the driver has a queue_chars handler
1353   if (!m_queue_chars.isnull())
1354   {
1355      while (!empty() && m_queue_chars(&m_buffer[m_bufbegin], 1))
1356      {
1357         m_bufbegin = (m_bufbegin + 1) % m_buffer.count();
1358         if (m_current_rate != attotime::zero)
1359            break;
1360      }
1361   }
12611362
1262   /* if we have a machine, use the live state and quick lookup */
1263   ioport_manager &portdata = machine.ioport();
1264   input_type_entry *entry = portdata.type_to_entry[type][player];
1265   if (entry != NULL)
1266      return entry->seq[seqtype];
1363   // the driver does not have a queue_chars handler
1364   else
1365   {
1366      if (m_status_keydown)
1367         m_bufbegin = (m_bufbegin + 1) % m_buffer.count();
1368      m_status_keydown = !m_status_keydown;
1369   }
12671370
1268   /* if we find nothing, return an empty sequence */
1269   return input_seq::empty_seq;
1371   // need to make sure timerproc is called again if buffer not empty
1372   if (!empty())
1373      m_timer->adjust(choose_delay(m_buffer[m_bufbegin]));
12701374}
12711375
12721376
1273/*-------------------------------------------------
1274    input_type_set_seq - change the input
1275    sequence for the given type/player
1276-------------------------------------------------*/
1377//-------------------------------------------------
1378//  unicode_to_string - obtain a string
1379//  representation of a given code; used for
1380//  logging and debugging
1381//-------------------------------------------------
12771382
1278void input_type_set_seq(running_machine &machine, int type, int player, input_seq_type seqtype, const input_seq *newseq)
1383const char *natural_keyboard::unicode_to_string(astring &buffer, unicode_char ch)
12791384{
1280   ioport_manager &portdata = machine.ioport();
1281   input_type_entry *entry = portdata.type_to_entry[type][player];
1282   if (entry != NULL)
1283      entry->seq[seqtype] = *newseq;
1284}
1385   buffer.reset();
1386   switch (ch)
1387   {
1388      // check some magic values
1389      case '\0':   buffer.cpy("\\0");      break;
1390      case '\r':   buffer.cpy("\\r");      break;
1391      case '\n':   buffer.cpy("\\n");      break;
1392      case '\t':   buffer.cpy("\\t");      break;
12851393
1394      default:
1395         // seven bit ASCII is easy
1396         if (ch >= 32 && ch < 128)
1397         {
1398            char temp[2] = { char(ch), 0 };
1399            buffer.cpy(temp);
1400         }
1401         else if (ch >= UCHAR_MAMEKEY_BEGIN)
1402         {
1403            // try to obtain a codename with code_name(); this can result in an empty string
1404            input_code code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(ch - UCHAR_MAMEKEY_BEGIN));
1405            machine().input().code_name(buffer, code);
1406         }
12861407
1287/*-------------------------------------------------
1288    input_type_pressed - return TRUE if
1289    the sequence for the given input type/player
1290    is pressed
1291-------------------------------------------------*/
1292
1293int input_type_pressed(running_machine &machine, int type, int player)
1294{
1295   return machine.input().seq_pressed(input_type_seq(machine, type, player, SEQ_TYPE_STANDARD));
1408         // did we fail to resolve? if so, we have a last resort
1409         if (buffer.len() == 0)
1410            buffer.format("U+%04X", unsigned(ch));
1411         break;
1412   }
1413   return buffer;
12961414}
12971415
12981416
1299/*-------------------------------------------------
1300    input_type_list - return the list of types
1301-------------------------------------------------*/
1417//-------------------------------------------------
1418//  find_code - find a code in our lookup table
1419//-------------------------------------------------
13021420
1303const simple_list<input_type_entry> &input_type_list(running_machine &machine)
1421const natural_keyboard::keycode_map_entry *natural_keyboard::find_code(unicode_char ch) const
13041422{
1305   ioport_manager &portdata = machine.ioport();
1306   return portdata.typelist;
1423   for (int code = 0; m_keycode_map[code].ch != 0; code++)
1424      if (m_keycode_map[code].ch == ch)
1425         return &m_keycode_map[code];
1426   return NULL;
13071427}
13081428
13091429
1430//-------------------------------------------------
1431//  frame_update - once per frame update of the
1432//   natural keyboard state
1433//-------------------------------------------------
13101434
1311/***************************************************************************
1312    PORT CHECKING
1313***************************************************************************/
1314
1315
1316/*-------------------------------------------------
1317    input_port_exists - return whether an input
1318    port exists
1319-------------------------------------------------*/
1320
1321bool input_port_exists(running_machine &machine, const char *tag)
1435void natural_keyboard::frame_update(ioport_port &port, ioport_value &digital)
13221436{
1323   return machine.root_device().ioport(tag) != 0;
1437   // is there currently a key down?
1438   if (m_status_keydown && !empty())
1439   {
1440      // loop through this character's component codes
1441      const keycode_map_entry *code = find_code(m_buffer[m_bufbegin]);
1442      if (code != NULL)
1443         for (int fieldnum = 0; fieldnum < ARRAY_LENGTH(code->field) && code->field[fieldnum] != NULL; fieldnum++)
1444            if (&code->field[fieldnum]->port() == &port)
1445               digital |= code->field[fieldnum]->mask();
1446   }
13241447}
13251448
13261449
1327/*-------------------------------------------------
1328    input_port_active - return a bitmask of which
1329    bits of an input port are active (i.e. not
1330    unused or unknown)
1331-------------------------------------------------*/
1450//-------------------------------------------------
1451//  key_name - returns the name of a specific key
1452//-------------------------------------------------
13321453
1333input_port_value input_port_active(running_machine &machine, const char *tag)
1454const char *natural_keyboard::key_name(astring &string, unicode_char ch)
13341455{
1335   const input_port_config *port = machine.root_device().ioport(tag);
1336   if (port == NULL)
1337      fatalerror("Unable to locate input port '%s'", tag);
1338   return port->active;
1339}
1456   // attempt to get the string from the character info table
1457   const char_info *ci = char_info::find(ch);
1458   const char *result = (ci != NULL) ? ci->name : NULL;
1459   if (result != NULL)
1460      string.cpy(result);
13401461
1462   // if that doesn't work, convert to UTF-8
1463   else if (ch > 0x7F || isprint(ch))
1464   {
1465      char buf[10];
1466      int count = utf8_from_uchar(buf, ARRAY_LENGTH(buf), ch);
1467      buf[count] = 0;
1468      string.cpy(buf);
1469   }
13411470
1342/*-------------------------------------------------
1343    input_port_active_safe - return a bitmask of
1344    which bits of an input port are active (i.e.
1345    not unused or unknown), or a default value if
1346    the port does not exist
1347-------------------------------------------------*/
1348
1349input_port_value input_port_active_safe(running_machine &machine, const char *tag, input_port_value defvalue)
1350{
1351   const input_port_config *port = machine.root_device().ioport(tag);
1352   return port == NULL ? defvalue : port->active;
1471   // otherwise, opt for question marks
1472   else
1473      string.cpy("???");
1474   return string;
13531475}
13541476
13551477
1478//-------------------------------------------------
1479//  execute_input - debugger command to enter
1480//  natural keyboard input
1481//-------------------------------------------------
13561482
1357/***************************************************************************
1358    PORT READING
1359***************************************************************************/
1360
1361/*-------------------------------------------------
1362    input_port_read_direct - return the value of
1363    an input port
1364-------------------------------------------------*/
1365
1366input_port_value input_port_read_direct(const input_port_config *port)
1483void natural_keyboard::execute_input(running_machine &machine, int ref, int params, const char *param[])
13671484{
1368   assert(port != NULL);
1485   machine.ioport().natkeyboard().post_coded(param[0]);
1486}
13691487
1370   ioport_manager &portdata = port->machine().ioport();
1371   analog_field_state *analog;
1372   device_field_info *device_field;
1373   input_port_value result;
13741488
1375   assert_always(portdata.safe_to_read, "Input ports cannot be read at init time!");
1489//-------------------------------------------------
1490//  execute_dumpkbd - debugger command to natural
1491//  keyboard codes
1492//-------------------------------------------------
13761493
1377   /* start with the digital */
1378   result = port->state->digital;
1379
1380   /* update read values */
1381   for (device_field = port->state->readdevicelist; device_field != NULL; device_field = device_field->next)
1382      if (input_condition_true(port->machine(), &device_field->field->condition, port->owner()))
1494void natural_keyboard::execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[])
1495{
1496   // was there a file specified?
1497   const char *filename = (params > 0) ? param[0] : NULL;
1498   FILE *file = NULL;
1499   if (filename != NULL)
1500   {
1501      // if so, open it
1502      file = fopen(filename, "w");
1503      if (file == NULL)
13831504      {
1384         /* replace the bits with bits from the device */
1385         input_port_value newval = device_field->field->read(*device_field->field, device_field->field->read_param);
1386         device_field->oldval = newval;
1387         result = (result & ~device_field->field->mask) | ((newval << device_field->shift) & device_field->field->mask);
1505         debug_console_printf(machine, "Cannot open \"%s\"\n", filename);
1506         return;
13881507      }
1508   }
13891509
1390   /* update VBLANK bits */
1391   if (port->state->vblank != 0)
1510   // loop through all codes
1511   natural_keyboard &natkeyboard = machine.ioport().natkeyboard();
1512   dynamic_array<keycode_map_entry> &keycode_map = natkeyboard.m_keycode_map;
1513   astring buffer, tempstr;
1514   const size_t left_column_width = 24;
1515   for (int index = 0; index < keycode_map.count(); index++)
13921516   {
1393      if (port->machine().primary_screen->vblank())
1394         result |= port->state->vblank;
1517      // describe the character code
1518      const keycode_map_entry &code = keycode_map[index];
1519      buffer.printf("%08X (%s) ", code.ch, natkeyboard.unicode_to_string(tempstr, code.ch));
1520
1521      // pad with spaces
1522      while (buffer.len() < left_column_width)
1523         buffer.cat(' ');
1524
1525      // identify the keys used
1526      for (int field = 0; field < ARRAY_LENGTH(code.field) && code.field[field] != 0; field++)
1527         buffer.catprintf("%s'%s'", (field > 0) ? ", " : "", code.field[field]->name());
1528
1529      // and output it as appropriate
1530      if (file != NULL)
1531         fprintf(file, "%s\n", buffer.cstr());
13951532      else
1396         result &= ~port->state->vblank;
1533         debug_console_printf(machine, "%s\n", buffer.cstr());
13971534   }
13981535
1399   /* apply active high/low state to digital, read, and VBLANK inputs */
1400   result ^= port->state->defvalue;
1536   // cleanup
1537   if (file != NULL)
1538      fclose(file);
1539}
14011540
1402   /* merge in analog portions */
1403   for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
1404      if (input_condition_true(port->machine(), &analog->field->condition, port->owner()))
1405      {
1406         /* start with the raw value */
1407         INT32 value = analog->accum;
14081541
1409         /* interpolate if appropriate and if time has passed since the last update */
1410         if (analog->interpolate && !(analog->field->flags & ANALOG_FLAG_RESET) && portdata.last_delta_nsec != 0)
1411         {
1412            attoseconds_t nsec_since_last = (port->machine().time() - portdata.last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
1413            value = analog->previous + ((INT64)(analog->accum - analog->previous) * nsec_since_last / portdata.last_delta_nsec);
1414         }
14151542
1416         /* apply standard analog settings */
1417         value = apply_analog_settings(value, analog);
1543//**************************************************************************
1544//  I/O PORT CONDITION
1545//**************************************************************************
14181546
1419         /* remap the value if needed */
1420         if (analog->field->remap_table != NULL)
1421            value = analog->field->remap_table[value];
1547//-------------------------------------------------
1548//  eval - evaluate condition
1549//-------------------------------------------------
14221550
1423         /* invert bits if needed */
1424         if (analog->field->flags & ANALOG_FLAG_INVERT)
1425            value = ~value;
1551bool ioport_condition::eval(device_t &device) const
1552{
1553   // always condition is always true
1554   if (m_condition == ALWAYS)
1555      return true;
14261556
1427         /* insert into the port */
1428         result = (result & ~analog->field->mask) | ((value << analog->shift) & analog->field->mask);
1429      }
1430
1431   return result;
1557   // otherwise, read the referenced port and switch off the condition type
1558   ioport_value condvalue = device.ioport(m_tag)->read();
1559   switch (m_condition)
1560   {
1561      case ALWAYS:         return true;
1562      case EQUALS:         return ((condvalue & m_mask) == m_value);
1563      case NOTEQUALS:         return ((condvalue & m_mask) != m_value);
1564      case GREATERTHAN:      return ((condvalue & m_mask) > m_value);
1565      case NOTGREATERTHAN:   return ((condvalue & m_mask) <= m_value);
1566      case LESSTHAN:         return ((condvalue & m_mask) < m_value);
1567      case NOTLESSTHAN:      return ((condvalue & m_mask) >= m_value);
1568   }
1569   return true;
14321570}
14331571
14341572
1435/*-------------------------------------------------
1436    input_port_read - return the value of
1437    an input port specified by tag
1438-------------------------------------------------*/
14391573
1440input_port_value input_port_read(running_machine &machine, const char *tag)
1441{
1442   const input_port_config *port = machine.root_device().ioport(tag);
1443   if (port == NULL)
1444      fatalerror("Unable to locate input port '%s'", tag);
1445   return input_port_read_direct(port);
1446}
1574//**************************************************************************
1575//  I/O PORT SETTING
1576//**************************************************************************
14471577
1578//-------------------------------------------------
1579//  ioport_setting - constructor
1580//-------------------------------------------------
14481581
1449/*-------------------------------------------------
1450    input_port_read - return the value of
1451    a device input port specified by tag
1452-------------------------------------------------*/
1453
1454input_port_value input_port_read(device_t &device, const char *tag)
1582ioport_setting::ioport_setting(ioport_field &field, ioport_value _value, const char *_name)
1583   : m_next(NULL),
1584     m_field(field),
1585     m_value(_value),
1586     m_name(_name)
14551587{
1456   const input_port_config *port = device.ioport(tag);
1457   if (port == NULL)
1458      fatalerror("Unable to locate input port '%s'", tag);
1459   return input_port_read_direct(port);
14601588}
14611589
14621590
1463/*-------------------------------------------------
1464    input_port_read_safe - return the value of
1465    an input port specified by tag, or a default
1466    value if the port does not exist
1467-------------------------------------------------*/
14681591
1469input_port_value input_port_read_safe(running_machine &machine, const char *tag, UINT32 defvalue)
1470{
1471   const input_port_config *port = machine.root_device().ioport(tag);
1472   return (port == NULL) ? defvalue : input_port_read_direct(port);
1473}
1592//**************************************************************************
1593//  I/O PORT DIP LOCATION
1594//**************************************************************************
14741595
1596//-------------------------------------------------
1597//  ioport_diplocation - constructor
1598//-------------------------------------------------
14751599
1476/*-------------------------------------------------
1477    input_port_read_crosshair - return the
1478    extracted crosshair values for the given
1479    player
1480-------------------------------------------------*/
1481
1482int input_port_get_crosshair_position(running_machine &machine, int player, float *x, float *y)
1600ioport_diplocation::ioport_diplocation(const char *name, UINT8 swnum, bool invert)
1601   : m_next(NULL),
1602     m_name(name),
1603     m_number(swnum),
1604     m_invert(invert)
14831605{
1484   const input_port_config *port;
1485   const input_field_config *field;
1486   int gotx = FALSE, goty = FALSE;
1606}
14871607
1488   /* read all the lightgun values */
1489   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
1490      for (field = port->first_field(); field != NULL; field = field->next())
1491         if (field->player == player && field->crossaxis != CROSSHAIR_AXIS_NONE)
1492            if (input_condition_true(machine, &field->condition, port->owner()))
1493            {
1494               analog_field_state *analog = field->state->analog;
1495               INT32 rawvalue = apply_analog_settings(analog->accum, analog) & (analog->field->mask >> analog->shift);
1496               float value = (float)(rawvalue - field->state->analog->adjmin) / (float)(field->state->analog->adjmax - field->state->analog->adjmin);
14971608
1498               /* apply the scale and offset */
1499               if (field->crossscale < 0)
1500                  value = -(1.0 - value) * field->crossscale;
1501               else
1502                  value *= field->crossscale;
1503               value += field->crossoffset;
15041609
1505               /* apply custom mapping if necessary */
1506               if (!field->crossmapper.isnull())
1507                  value = field->crossmapper(*field, value);
1610//**************************************************************************
1611//  I/O PORT FIELD
1612//**************************************************************************
15081613
1509               /* handle X axis */
1510               if (field->crossaxis == CROSSHAIR_AXIS_X)
1511               {
1512                  *x = value;
1513                  gotx = TRUE;
1514                  if (field->crossaltaxis != 0)
1515                  {
1516                     *y = field->crossaltaxis;
1517                     goty = TRUE;
1518                  }
1519               }
1614//-------------------------------------------------
1615//  ioport_field - constructor
1616//-------------------------------------------------
15201617
1521               /* handle Y axis */
1522               else
1523               {
1524                  *y = value;
1525                  goty = TRUE;
1526                  if (field->crossaltaxis != 0)
1527                  {
1528                     *x = field->crossaltaxis;
1529                     gotx = TRUE;
1530                  }
1531               }
1532
1533               /* if we got both, stop */
1534               if (gotx && goty)
1535                  break;
1536            }
1537
1538   return (gotx && goty);
1539}
1540
1541
1542/*-------------------------------------------------
1543    input_port_update_defaults - force an update
1544    to the input port values based on current
1545    conditions
1546-------------------------------------------------*/
1547
1548void input_port_update_defaults(running_machine &machine)
1618ioport_field::ioport_field(ioport_port &port, ioport_type type, ioport_value defvalue, ioport_value maskbits, const char *name)
1619   : m_next(NULL),
1620     m_port(port),
1621     m_live(NULL),
1622     m_modcount(port.modcount()),
1623     m_mask(maskbits),
1624     m_defvalue(defvalue & maskbits),
1625     m_type(type),
1626     m_player(0),
1627     m_flags(0),
1628     m_impulse(0),
1629     m_name(name),
1630     m_read_param(NULL),
1631     m_write_param(NULL),
1632     m_min(0),
1633     m_max(maskbits),
1634     m_sensitivity(0),
1635     m_delta(0),
1636     m_centerdelta(0),
1637     m_crosshair_axis(CROSSHAIR_AXIS_NONE),
1638     m_crosshair_scale(1.0),
1639     m_crosshair_offset(0),
1640     m_crosshair_altaxis(0),
1641     m_full_turn_count(0),
1642     m_remap_table(NULL),
1643     m_way(0)
15491644{
1550   int loopnum;
1645   // reset sequences and chars
1646   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
1647      m_seq[seqtype].set_default();
1648   m_chars[0] = m_chars[1] = m_chars[2] = unicode_char(0);
15511649
1552   /* two passes to catch conditionals properly */
1553   for (loopnum = 0; loopnum < 2; loopnum++)
1650   // for DIP switches and configs, look for a default value from the owner
1651   if (type == IPT_DIPSWITCH || type == IPT_CONFIG)
15541652   {
1555      const input_port_config *port;
1556
1557      /* loop over all input ports */
1558      for (port = machine.ioport().first_port(); port != NULL; port = port->next())
1653      const input_device_default *def = device().input_ports_defaults();
1654      if (def != NULL)
15591655      {
1560         const input_field_config *field;
1561
1562         /* only clear on the first pass */
1563         if (loopnum == 0)
1564            port->state->defvalue = 0;
1565
1566         /* first compute the default value for the entire port */
1567         for (field = port->first_field(); field != NULL; field = field->next())
1568            if (input_condition_true(machine, &field->condition, port->owner()))
1569               port->state->defvalue = (port->state->defvalue & ~field->mask) | (field->state->value & field->mask);
1656         const char *fulltag = port.tag();
1657         astring fullpath;
1658         for ( ; def->tag != NULL; def++)
1659            if (device().subtag(fullpath, def->tag) == fulltag && def->mask == m_mask)
1660               m_defvalue = def->defvalue & m_mask;
15701661      }
15711662   }
15721663}
15731664
15741665
1575/*-------------------------------------------------
1576    apply_analog_settings - return the value of
1577    an input port
1578-------------------------------------------------*/
1666//-------------------------------------------------
1667//  ~ioport_field - destructor
1668//-------------------------------------------------
15791669
1580static INT32 apply_analog_settings(INT32 value, analog_field_state *analog)
1670ioport_field::~ioport_field()
15811671{
1582   /* apply the min/max and then the sensitivity */
1583   value = apply_analog_min_max(analog, value);
1584   value = APPLY_SENSITIVITY(value, analog->sensitivity);
1585
1586   /* apply reversal if needed */
1587   if (analog->reverse)
1588      value = analog->reverse_val - value;
1589   else if (analog->single_scale)
1590      /* it's a pedal or the default value is equal to min/max */
1591      /* so we need to adjust the center to the minimum */
1592      value -= INPUT_ABSOLUTE_MIN;
1593
1594   /* map differently for positive and negative values */
1595   if (value >= 0)
1596      value = APPLY_SCALE(value, analog->scalepos);
1597   else
1598      value = APPLY_SCALE(value, analog->scaleneg);
1599   value += analog->adjdefvalue;
1600
1601   return value;
1672   global_free(m_live);
16021673}
16031674
16041675
1605/***************************************************************************
1606    PORT WRITING
1607***************************************************************************/
1676//-------------------------------------------------
1677//  name - return the field name for a given input
1678//  field
1679//-------------------------------------------------
16081680
1609/*-------------------------------------------------
1610    input_port_write_direct - write a value
1611    to a port
1612-------------------------------------------------*/
1613
1614void input_port_write_direct(const input_port_config *port, input_port_value data, input_port_value mem_mask)
1681const char *ioport_field::name() const
16151682{
1616   /* call device line write handlers */
1617   device_field_info *device_field;
1683   // if we have a non-default name, use that
1684   if (m_live != NULL && m_live->name)
1685      return m_live->name;
1686   if (m_name != NULL)
1687      return m_name;
16181688
1619   COMBINE_DATA(&port->state->outputvalue);
1620
1621   for (device_field = port->state->writedevicelist; device_field; device_field = device_field->next)
1622      if (device_field->field->type == IPT_OUTPUT && input_condition_true(port->machine(), &device_field->field->condition, port->owner()))
1623      {
1624         input_port_value newval = ( (port->state->outputvalue ^ device_field->field->defvalue ) & device_field->field->mask) >> device_field->shift;
1625
1626         /* if the bits have write, call the handler */
1627         if (device_field->oldval != newval)
1628         {
1629            device_field->field->write(*device_field->field, device_field->field->write_param, device_field->oldval, newval);
1630
1631            device_field->oldval = newval;
1632         }
1633      }
1689   // otherwise, return the name associated with the type
1690   return machine().ioport().type_name(m_type, m_player);
16341691}
16351692
16361693
1637/*-------------------------------------------------
1638    input_port_write - write a value to a
1639    port specified by tag
1640-------------------------------------------------*/
1694//-------------------------------------------------
1695//  seq - return the input sequence for the given
1696//  input field
1697//-------------------------------------------------
16411698
1642void input_port_write(running_machine &machine, const char *tag, input_port_value value, input_port_value mask)
1699const input_seq &ioport_field::seq(input_seq_type seqtype) const
16431700{
1644   const input_port_config *port = machine.root_device().ioport(tag);
1645   if (port == NULL)
1646      fatalerror("Unable to locate input port '%s'", tag);
1647   input_port_write_direct(port, value, mask);
1648}
1701   // if the field is disabled, return no key
1702   if (m_flags & FIELD_FLAG_UNUSED)
1703      return input_seq::empty_seq;
16491704
1705   // select either the live or config state depending on whether we have live state
1706   const input_seq &portseq = (m_live == NULL) ? m_seq[seqtype] : m_live->seq[seqtype];
16501707
1651/*-------------------------------------------------
1652    input_port_write_safe - write a value to
1653    a port, ignore if the port does not exist
1654-------------------------------------------------*/
1708   // if the portseq is the special default code, return the expanded default value
1709   if (portseq.is_default())
1710      return machine().ioport().type_seq(m_type, m_player, seqtype);
16551711
1656void input_port_write_safe(running_machine &machine, const char *tag, input_port_value value, input_port_value mask)
1657{
1658   const input_port_config *port = machine.root_device().ioport(tag);
1659   if (port != NULL)
1660      input_port_write_direct(port, value, mask);
1712   // otherwise, return the sequence as-is
1713   return portseq;
16611714}
16621715
16631716
1717//-------------------------------------------------
1718//  type_class - return the type class for this
1719//   field
1720//-------------------------------------------------
16641721
1665/***************************************************************************
1666    MISC HELPER FUNCTIONS
1667***************************************************************************/
1668
1669/*-------------------------------------------------
1670    input_condition_true - return the TRUE
1671    if the given condition attached is true
1672-------------------------------------------------*/
1673
1674int input_condition_true(running_machine &machine, const input_condition *condition, device_t &owner)
1722ioport_type_class ioport_field::type_class() const
16751723{
1676   input_port_value condvalue;
1724   ioport_type_class result;
16771725
1678   /* always condition is always true */
1679   if (condition->condition == PORTCOND_ALWAYS)
1680      return TRUE;
1681
1682   /* otherwise, read the referenced port */
1683   astring conditiontag;
1684   owner.subtag(conditiontag, condition->tag);
1685   condvalue = input_port_read(machine, conditiontag.cstr());
1686
1687   /* based on the condition encoded, determine truth */
1688   switch (condition->condition)
1726   switch (m_type)
16891727   {
1690      case PORTCOND_EQUALS:
1691         return ((condvalue & condition->mask) == condition->value);
1728      case IPT_JOYSTICK_UP:
1729      case IPT_JOYSTICK_DOWN:
1730      case IPT_JOYSTICK_LEFT:
1731      case IPT_JOYSTICK_RIGHT:
1732      case IPT_JOYSTICKLEFT_UP:
1733      case IPT_JOYSTICKLEFT_DOWN:
1734      case IPT_JOYSTICKLEFT_LEFT:
1735      case IPT_JOYSTICKLEFT_RIGHT:
1736      case IPT_JOYSTICKRIGHT_UP:
1737      case IPT_JOYSTICKRIGHT_DOWN:
1738      case IPT_JOYSTICKRIGHT_LEFT:
1739      case IPT_JOYSTICKRIGHT_RIGHT:
1740      case IPT_BUTTON1:
1741      case IPT_BUTTON2:
1742      case IPT_BUTTON3:
1743      case IPT_BUTTON4:
1744      case IPT_BUTTON5:
1745      case IPT_BUTTON6:
1746      case IPT_BUTTON7:
1747      case IPT_BUTTON8:
1748      case IPT_BUTTON9:
1749      case IPT_BUTTON10:
1750      case IPT_AD_STICK_X:
1751      case IPT_AD_STICK_Y:
1752      case IPT_AD_STICK_Z:
1753      case IPT_TRACKBALL_X:
1754      case IPT_TRACKBALL_Y:
1755      case IPT_LIGHTGUN_X:
1756      case IPT_LIGHTGUN_Y:
1757      case IPT_MOUSE_X:
1758      case IPT_MOUSE_Y:
1759      case IPT_START:
1760      case IPT_SELECT:
1761         result = INPUT_CLASS_CONTROLLER;
1762         break;
16921763
1693      case PORTCOND_NOTEQUALS:
1694         return ((condvalue & condition->mask) != condition->value);
1764      case IPT_KEYPAD:
1765      case IPT_KEYBOARD:
1766         result = INPUT_CLASS_KEYBOARD;
1767         break;
16951768
1696      case PORTCOND_GREATERTHAN:
1697         return ((condvalue & condition->mask) > condition->value);
1769      case IPT_CONFIG:
1770         result = INPUT_CLASS_CONFIG;
1771         break;
16981772
1699      case PORTCOND_NOTGREATERTHAN:
1700         return ((condvalue & condition->mask) <= condition->value);
1773      case IPT_DIPSWITCH:
1774         result = INPUT_CLASS_DIPSWITCH;
1775         break;
17011776
1702      case PORTCOND_LESSTHAN:
1703         return ((condvalue & condition->mask) < condition->value);
1777      case 0:
1778         if (m_name != NULL && m_name != (const char *)-1)
1779            result = INPUT_CLASS_MISC;
1780         else
1781            result = INPUT_CLASS_INTERNAL;
1782         break;
17041783
1705      case PORTCOND_NOTLESSTHAN:
1706         return ((condvalue & condition->mask) >= condition->value);
1784      default:
1785         result = INPUT_CLASS_INTERNAL;
1786         break;
17071787   }
1708   return TRUE;
1788   return result;
17091789}
17101790
17111791
1712/*-------------------------------------------------
1713    input_port_string_from_token - convert an
1714    input_port_token to a default string
1715-------------------------------------------------*/
1792//-------------------------------------------------
1793//  keyboard_code - accesses a particular keyboard
1794//  code
1795//-------------------------------------------------
17161796
1717const char *input_port_string_from_token(const char *string)
1797unicode_char ioport_field::keyboard_code(int which) const
17181798{
1719   /* 0 is an invalid index */
1720   if (string == NULL)
1721      return NULL;
1799   unicode_char ch = m_chars[which];
17221800
1723   /* if the index is greater than the count, assume it to be a pointer */
1724   if (FPTR(string) >= INPUT_STRING_COUNT)
1725      return string;
1801   // special hack to allow for PORT_CODE('\xA3')
1802   if (ch >= 0xffffff80 && ch <= 0xffffffff)
1803      ch &= 0xff;
1804   return ch;
1805}
17261806
1727#if FALSE // Set TRUE, If you want to take care missing-token or wrong-sorting
17281807
1729   /* otherwise, scan the list for a matching string and return it */
1730   {
1731   int index;
1732   for (index = 0; index < ARRAY_LENGTH(input_port_default_strings); index++)
1733      if (input_port_default_strings[index].id == FPTR(string))
1734         return input_port_default_strings[index].string;
1735   }
1736   return "(Unknown Default)";
1808//-------------------------------------------------
1809//  get_user_settings - return the current
1810//  settings for the given input field
1811//-------------------------------------------------
17371812
1738#else
1813void ioport_field::get_user_settings(user_settings &settings)
1814{
1815   // zap the entire structure
1816   memset(&settings, 0, sizeof(settings));
17391817
1740   return input_port_default_strings[FPTR(string)-1].string;
1818   // copy the basics
1819   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
1820      settings.seq[seqtype] = m_live->seq[seqtype];
17411821
1742#endif
1822   // if there's a list of settings or we're an adjuster, copy the current value
1823   if (first_setting() != NULL || m_type == IPT_ADJUSTER)
1824      settings.value = m_live->value;
1825
1826   // if there's analog data, extract the analog settings
1827   if (m_live->analog != NULL)
1828   {
1829      settings.sensitivity = m_live->analog->sensitivity();
1830      settings.delta = m_live->analog->delta();
1831      settings.centerdelta = m_live->analog->centerdelta();
1832      settings.reverse = m_live->analog->reverse();
1833   }
17431834}
17441835
17451836
1837//-------------------------------------------------
1838//  set_user_settings - modify the current
1839//  settings for the given input field
1840//-------------------------------------------------
17461841
1747/***************************************************************************
1748    INITIALIZATION HELPERS
1749***************************************************************************/
1750
1751/*-------------------------------------------------
1752    init_port_types - initialize the default
1753    type list
1754-------------------------------------------------*/
1755
1756static void init_port_types(running_machine &machine)
1842void ioport_field::set_user_settings(const user_settings &settings)
17571843{
1758   ioport_manager &portdata = machine.ioport();
1844   // copy the basics
1845   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
1846   {
1847      const input_seq &defseq = manager().type_seq(m_type, m_player, input_seq_type(seqtype));
1848      if (defseq == settings.seq[seqtype])
1849         m_live->seq[seqtype].set_default();
1850      else
1851         m_live->seq[seqtype] = settings.seq[seqtype];
1852   }
17591853
1760   /* convert the array into a list of type states that can be modified */
1761   construct_core_types(portdata.typelist);
1854   // if there's a list of settings or we're an adjuster, copy the current value
1855   if (first_setting() != NULL || m_type == IPT_ADJUSTER)
1856      m_live->value = settings.value;
17621857
1763   /* ask the OSD to customize the list */
1764   machine.osd().customize_input_type_list(portdata.typelist);
1765
1766   /* now iterate over the OSD-modified types */
1767   for (input_type_entry *curtype = portdata.typelist.first(); curtype != NULL; curtype = curtype->next())
1858   // if there's analog data, extract the analog settings
1859   if (m_live->analog != NULL)
17681860   {
1769      /* first copy all the OSD-updated sequences into our current state */
1770      for (int seqtype = 0; seqtype < ARRAY_LENGTH(curtype->seq); seqtype++)
1771         curtype->seq[seqtype] = curtype->defseq[seqtype];
1772
1773      /* also make a lookup table mapping type/player to the appropriate type list entry */
1774      portdata.type_to_entry[curtype->type][curtype->player] = curtype;
1861      m_live->analog->m_sensitivity = settings.sensitivity;
1862      m_live->analog->m_delta = settings.delta;
1863      m_live->analog->m_centerdelta = settings.centerdelta;
1864      m_live->analog->m_reverse = settings.reverse;
17751865   }
17761866}
17771867
17781868
1779/*-------------------------------------------------
1780    get_keyboard_code - accesses a particular
1781    keyboard code
1782-------------------------------------------------*/
1869//-------------------------------------------------
1870//  setting_name - return the expanded setting
1871//  name for a field
1872//-------------------------------------------------
17831873
1784static unicode_char get_keyboard_code(const input_field_config *field, int i)
1874const char *ioport_field::setting_name() const
17851875{
1786   unicode_char ch = field->chars[i];
1876   // only makes sense if we have settings
1877   assert(first_setting() != NULL);
17871878
1788   /* special hack to allow for PORT_CODE('\xA3') */
1789   if ((ch >= 0xFFFFFF80) && (ch <= 0xFFFFFFFF))
1790      ch &= 0xFF;
1791   return ch;
1879   // scan the list of settings looking for a match on the current value
1880   for (ioport_setting *setting = first_setting(); setting != NULL; setting = setting->next())
1881      if (setting->enabled())
1882         if (setting->value() == m_live->value)
1883            return setting->name();
1884
1885   return "INVALID";
17921886}
17931887
17941888
1795/***************************************************************************
1796    MISCELLANEOUS
1797***************************************************************************/
1889//-------------------------------------------------
1890//  has_previous_setting - return true if the
1891//  given field has a "previous" setting
1892//-------------------------------------------------
17981893
1799/*-------------------------------------------------
1800    find_charinfo - looks up information about a
1801    particular character
1802-------------------------------------------------*/
1803
1804static const char_info *find_charinfo(unicode_char target_char)
1894bool ioport_field::has_previous_setting() const
18051895{
1806   int low = 0;
1807   int high = ARRAY_LENGTH(charinfo);
1808   int i;
1809   unicode_char ch;
1896   // only makes sense if we have settings
1897   assert(first_setting() != NULL);
18101898
1811   /* perform a simple binary search to find the proper alternate */
1812   while(high > low)
1813   {
1814      i = (high + low) / 2;
1815      ch = charinfo[i].ch;
1816      if (ch < target_char)
1817         low = i + 1;
1818      else if (ch > target_char)
1819         high = i;
1820      else
1821         return &charinfo[i];
1822   }
1823   return NULL;
1899   // scan the list of settings looking for a match on the current value
1900   for (ioport_setting *setting = first_setting(); setting != NULL; setting = setting->next())
1901      if (setting->enabled())
1902         return (setting->value() != m_live->value);
1903
1904   return false;
18241905}
18251906
1826/*-------------------------------------------------
1827    inputx_key_name - returns the name of a
1828    specific key
1829-------------------------------------------------*/
18301907
1831static const char *inputx_key_name(unicode_char ch)
1908//-------------------------------------------------
1909//  select_previous_setting - select the previous
1910//  item for a DIP switch or configuration field
1911//-------------------------------------------------
1912
1913void ioport_field::select_previous_setting()
18321914{
1833   static char buf[UTF8_CHAR_MAX + 1];
1834   const char_info *ci;
1835   const char *result;
1836   int pos;
1915   // only makes sense if we have settings
1916   assert(first_setting() != NULL);
18371917
1838   ci = find_charinfo(ch);
1839   result = ci ? ci->name : NULL;
1840
1841   if (ci && ci->name)
1842   {
1843      result = ci->name;
1844   }
1845   else
1846   {
1847      if ((ch > 0x7F) || isprint(ch))
1918   // scan the list of settings looking for a match on the current value
1919   ioport_setting *prevsetting = NULL;
1920   bool found_match = false;
1921   for (ioport_setting *setting = first_setting(); setting != NULL; setting = setting->next())
1922      if (setting->enabled())
18481923      {
1849         pos = utf8_from_uchar(buf, ARRAY_LENGTH(buf), ch);
1850         buf[pos] = '\0';
1851         result = buf;
1924         if (setting->value() == m_live->value)
1925         {
1926            found_match = true;
1927            if (prevsetting != NULL)
1928               break;
1929         }
1930         prevsetting = setting;
18521931      }
1853      else
1854         result = "???";
1855   }
1856   return result;
1857}
18581932
1859/*-------------------------------------------------
1860    get_keyboard_key_name - builds the name of
1861    a key based on natural keyboard characters
1862-------------------------------------------------*/
1863
1864static astring &get_keyboard_key_name(astring &name, const input_field_config *field)
1865{
1866   int i;
1867   unicode_char ch;
1868
1869   name.reset();
1870   /* loop through each character on the field*/
1871   for (i = 0; i < ARRAY_LENGTH(field->chars) && (field->chars[i] != '\0'); i++)
1933   // if we didn't find a matching value, select the first
1934   if (!found_match)
18721935   {
1873      ch = get_keyboard_code(field, i);
1874      name.catprintf("%-*s ", MAX(SPACE_COUNT - 1, 0), inputx_key_name(ch));
1936      for (prevsetting = first_setting(); prevsetting != NULL; prevsetting = prevsetting->next())
1937         if (prevsetting->enabled())
1938            break;
18751939   }
18761940
1877   /* trim extra spaces */
1878   name.trimspace();
1879
1880   /* special case */
1881   if (name.len() == 0)
1882      name.cpy("Unnamed Key");
1883
1884   return name;
1941   // update the value to the previous one
1942   if (prevsetting != NULL)
1943      m_live->value = prevsetting->value();
18851944}
18861945
1887/*-------------------------------------------------
1888    init_port_state - initialize the live port
1889    states based on the tokens
1890-------------------------------------------------*/
18911946
1892static void init_port_state(running_machine &machine)
1947//-------------------------------------------------
1948//  has_next_setting - return true if the given
1949//  field has a "next" setting
1950//-------------------------------------------------
1951
1952bool ioport_field::has_next_setting() const
18931953{
1894   const char *joystick_map_default = machine.options().joystick_map();
1895   ioport_manager &portdata = machine.ioport();
1896   input_field_config *field;
1897   input_port_config *port;
1954   // only makes sense if we have settings
1955   assert(first_setting() != NULL);
18981956
1899   /* allocate live structures to mirror the configuration */
1900   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
1901   {
1902      analog_field_state **analogstatetail;
1903      device_field_info **readdevicetail;
1904      device_field_info **writedevicetail;
1905      input_port_state *portstate;
1906
1907      /* allocate a new input_port_info structure */
1908      portstate = auto_alloc_clear(machine, input_port_state);
1909      ((input_port_config *)port)->state = portstate;
1910
1911      /* start with tail pointers to all the data */
1912      analogstatetail = &portstate->analoglist;
1913      readdevicetail = &portstate->readdevicelist;
1914      writedevicetail = &portstate->writedevicelist;
1915
1916      /* iterate over fields */
1917      for (field = port->first_field(); field != NULL; field = field->next())
1957   // scan the list of settings looking for a match on the current value
1958   bool found = false;
1959   for (ioport_setting *setting = first_setting(); setting != NULL; setting = setting->next())
1960      if (setting->enabled())
19181961      {
1919         input_field_state *fieldstate;
1920         int seqtype;
1962         if (found)
1963            return true;
1964         if (setting->value() == m_live->value)
1965            found = true;
1966      }
19211967
1922         /* allocate a new input_field_info structure */
1923         fieldstate = auto_alloc_clear(machine, input_field_state);
1924         ((input_field_config *)field)->state = fieldstate;
1968   return false;
1969}
19251970
1926         /* fill in the basic values */
1927         for (seqtype = 0; seqtype < ARRAY_LENGTH(fieldstate->seq); seqtype++)
1928            fieldstate->seq[seqtype] = field->seq[seqtype];
1929         fieldstate->value = field->defvalue;
19301971
1931         /* if this is an analog field, allocate memory for the analog data */
1932         if (field->type >= __ipt_analog_start && field->type <= __ipt_analog_end)
1933         {
1934            *analogstatetail = fieldstate->analog = init_field_analog_state(field);
1935            analogstatetail = &(*analogstatetail)->next;
1936         }
1972//-------------------------------------------------
1973//  select_next_setting - select the next item for
1974//  a DIP switch or configuration field
1975//-------------------------------------------------
19371976
1938         /* if this is a digital joystick field, make a note of it */
1939         if (field->type >= __ipt_digital_joystick_start && field->type <= __ipt_digital_joystick_end)
1940         {
1941            fieldstate->joystick = &portdata.joystick_info[field->player][(field->type - __ipt_digital_joystick_start) / 4];
1942            fieldstate->joydir = (field->type - __ipt_digital_joystick_start) % 4;
1943            fieldstate->joystick->field[fieldstate->joydir] = field;
1944            fieldstate->joystick->inuse = TRUE;
1945         }
1977void ioport_field::select_next_setting()
1978{
1979   // only makes sense if we have settings
1980   assert(first_setting() != NULL);
19461981
1947         /* if this entry has device input, allocate memory for the tracking structure */
1948         astring devicetag;
1949         if (!field->read.isnull())
1950         {
1951            *readdevicetail = init_field_device_info(field, port->owner().subtag(devicetag, field->read_device));
1952            field->read.late_bind(*(*readdevicetail)->device);
1953            if (!field->read.has_object())
1954               fatalerror("Input port %s, unable to find valid device with tag '%s'", port->tag(), devicetag.cstr());
1955            readdevicetail = &(*readdevicetail)->next;
1956         }
1982   // scan the list of settings looking for a match on the current value
1983   ioport_setting *nextsetting = NULL;
1984   ioport_setting *setting;
1985   for (setting = first_setting(); setting != NULL; setting = setting->next())
1986      if (setting->enabled())
1987         if (setting->value() == m_live->value)
1988            break;
19571989
1958         /* if this entry has device output, allocate memory for the tracking structure */
1959         if (!field->write.isnull())
1960         {
1961            *writedevicetail = init_field_device_info(field, port->owner().subtag(devicetag, field->write_device));
1962            field->write.late_bind(*(*writedevicetail)->device);
1963            if (!field->write.has_object())
1964               fatalerror("Input port %s, unable to find valid device with tag '%s'", port->tag(), devicetag.cstr());
1965            writedevicetail = &(*writedevicetail)->next;
1966         }
1990   // if we found one, scan forward for the next valid one
1991   if (setting != NULL)
1992      for (nextsetting = setting->next(); nextsetting != NULL; nextsetting = nextsetting->next())
1993         if (nextsetting->enabled())
1994            break;
19671995
1968         /* if this entry has device output, allocate memory for the tracking structure */
1969         if (!field->crossmapper.isnull())
1970         {
1971            device_t *device = machine.device(port->owner().subtag(devicetag, field->crossmapper_device));
1972            field->crossmapper.late_bind(*device);
1973         }
1996   // if we hit the end, search from the beginning
1997   if (nextsetting == NULL)
1998      for (nextsetting = first_setting(); nextsetting != NULL; nextsetting = nextsetting->next())
1999         if (nextsetting->enabled())
2000            break;
19742001
1975         /* Name keyboard key names */
1976         if ((field->type == IPT_KEYBOARD || field->type == IPT_KEYPAD) && (field->name == NULL))
1977         {
1978            astring name;
1979            field->state->name = auto_strdup(machine, get_keyboard_key_name(name, field));
1980         }
1981      }
1982   }
1983
1984   /* handle autoselection of devices */
1985   init_autoselect_devices(machine, IPT_AD_STICK_X,  IPT_AD_STICK_Y,   IPT_AD_STICK_Z, OPTION_ADSTICK_DEVICE,    "analog joystick");
1986   init_autoselect_devices(machine, IPT_PADDLE,      IPT_PADDLE_V,     0,              OPTION_PADDLE_DEVICE,     "paddle");
1987   init_autoselect_devices(machine, IPT_PEDAL,       IPT_PEDAL2,       IPT_PEDAL3,     OPTION_PEDAL_DEVICE,      "pedal");
1988   init_autoselect_devices(machine, IPT_LIGHTGUN_X,  IPT_LIGHTGUN_Y,   0,              OPTION_LIGHTGUN_DEVICE,   "lightgun");
1989   init_autoselect_devices(machine, IPT_POSITIONAL,  IPT_POSITIONAL_V, 0,              OPTION_POSITIONAL_DEVICE, "positional");
1990   init_autoselect_devices(machine, IPT_DIAL,        IPT_DIAL_V,       0,              OPTION_DIAL_DEVICE,       "dial");
1991   init_autoselect_devices(machine, IPT_TRACKBALL_X, IPT_TRACKBALL_Y,  0,              OPTION_TRACKBALL_DEVICE,  "trackball");
1992   init_autoselect_devices(machine, IPT_MOUSE_X,     IPT_MOUSE_Y,      0,              OPTION_MOUSE_DEVICE,      "mouse");
1993
1994   /* look for 4-way joysticks and change the default map if we find any */
1995   if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0)
1996      for (port = machine.ioport().first_port(); port != NULL; port = port->next())
1997         for (field = port->first_field(); field != NULL; field = field->next())
1998            if (field->state->joystick != NULL && field->way == 4)
1999            {
2000               machine.input().set_global_joystick_map((field->flags & FIELD_FLAG_ROTATED) ? joystick_map_4way_diagonal : joystick_map_4way_sticky);
2001               break;
2002            }
2002   // update the value to the previous one
2003   if (nextsetting != NULL)
2004      m_live->value = nextsetting->value();
20032005}
20042006
20052007
2006/*-------------------------------------------------
2007    init_autoselect_devices - autoselect a single
2008    device based on the input port list passed
2009    in and the corresponding option
2010-------------------------------------------------*/
2008//-------------------------------------------------
2009//  frame_update_digital - get the state of a
2010//  digital field
2011//-------------------------------------------------
20112012
2012static void init_autoselect_devices(running_machine &machine, int type1, int type2, int type3, const char *option, const char *ananame)
2013void ioport_field::frame_update(ioport_value &result, bool mouse_down)
20132014{
2014   const char *stemp = machine.options().value(option);
2015   input_device_class autoenable = DEVICE_CLASS_KEYBOARD;
2016   const char *autostring = "keyboard";
2017   const input_field_config *field;
2018   const input_port_config *port;
2015   // skip if not enabled
2016   if (!enabled())
2017      return;
20192018
2020   /* if nothing specified, ignore the option */
2021   if (stemp[0] == 0)
2019   // handle analog inputs first
2020   if (m_live->analog != NULL)
2021   {
2022      m_live->analog->frame_update(machine());
20222023      return;
2024   }
2025   
2026   // if UI is active, ignore digital inputs
2027   if (ui_is_menu_active())
2028      return;
20232029
2024   /* extract valid strings */
2025   if (strcmp(stemp, "mouse") == 0)
2030   // if the state changed, look for switch down/switch up
2031   bool curstate = mouse_down || machine().input().seq_pressed(seq());
2032   bool changed = false;
2033   if (curstate != m_live->last)
20262034   {
2027      autoenable = DEVICE_CLASS_MOUSE;
2028      autostring = "mouse";
2035      m_live->last = curstate;
2036      changed = true;
20292037   }
2030   else if (strcmp(stemp, "joystick") == 0)
2038
2039   // if we're a keyboard type and using natural keyboard, bail
2040   if (m_type == IPT_KEYBOARD && ui_get_use_natural_keyboard(machine()))
2041      return;
2042
2043   // coin impulse option
2044   int effective_impulse = m_impulse;
2045   int impulse_option_val = machine().options().coin_impulse();
2046   if (impulse_option_val != 0)
20312047   {
2032      autoenable = DEVICE_CLASS_JOYSTICK;
2033      autostring = "joystick";
2048      if (impulse_option_val < 0)
2049         effective_impulse = 0;
2050      else if ((m_type >= IPT_COIN1 && m_type <= IPT_COIN12) || m_impulse != 0)
2051         effective_impulse = impulse_option_val;
20342052   }
2035   else if (strcmp(stemp, "lightgun") == 0)
2053
2054   // if this is a switch-down event, handle impulse and toggle
2055   if (changed && curstate)
20362056   {
2037      autoenable = DEVICE_CLASS_LIGHTGUN;
2038      autostring = "lightgun";
2057      // impluse controls: reset the impulse counter
2058      if (effective_impulse != 0 && m_live->impulse == 0)
2059         m_live->impulse = effective_impulse;
2060
2061      // toggle controls: flip the toggle state or advance to the next setting
2062      if (toggle())
2063      {
2064         if (m_settinglist.count() == 0)
2065            m_live->value ^= m_mask;
2066         else
2067            select_next_setting();
2068      }
20392069   }
2040   else if (strcmp(stemp, "none") == 0)
2070
2071   // update the current state with the impulse state
2072   if (effective_impulse != 0)
20412073   {
2042      /* nothing specified */
2043      return;
2074      curstate = (m_live->impulse != 0);
2075      if (curstate)
2076         m_live->impulse--;
20442077   }
2045   else if (strcmp(stemp, "keyboard") != 0)
2046      mame_printf_error("Invalid %s value %s; reverting to keyboard\n", option, stemp);
20472078
2048   /* only scan the list if we haven't already enabled this class of control */
2049   if (machine.ioport().first_port() != NULL && !machine.input().device_class(autoenable).enabled())
2050      for (port = machine.ioport().first_port(); port != NULL; port = port->next())
2051         for (field = port->first_field(); field != NULL; field = field->next())
2079   // for toggle switches, the current value is folded into the port's default value
2080   // so we always return FALSE here
2081   if (toggle())
2082      curstate = false;
20522083
2053            /* if this port type is in use, apply the autoselect criteria */
2054            if ((type1 != 0 && field->type == type1) ||
2055               (type2 != 0 && field->type == type2) ||
2056               (type3 != 0 && field->type == type3))
2057            {
2058               mame_printf_verbose("Input: Autoenabling %s due to presence of a %s\n", autostring, ananame);
2059               machine.input().device_class(autoenable).enable();
2060               break;
2061            }
2084   // additional logic to restrict digital joysticks
2085   if (curstate && !mouse_down && m_live->joystick != NULL && m_way != 16 && !machine().options().joystick_contradictory())
2086   {
2087      UINT8 mask = (m_way == 4) ? m_live->joystick->current4way() : m_live->joystick->current();
2088      if (!(mask & (1 << m_live->joydir)))
2089         curstate = false;
2090   }
2091
2092   // skip locked-out coin inputs
2093   if (curstate && m_type >= IPT_COIN1 && m_type <= IPT_COIN12 && coin_lockout_get_state(machine(), m_type - IPT_COIN1))
2094   {
2095      bool verbose = machine().options().verbose();
2096#ifdef MAME_DEBUG
2097      verbose = true;
2098#endif
2099      if (machine().options().coin_lockout())
2100      {
2101         if (verbose)
2102            ui_popup_time(3, "Coinlock disabled %s.", name());
2103         curstate = false;
2104      }
2105      else
2106         if (verbose)
2107            ui_popup_time(3, "Coinlock disabled, but broken through %s.", name());
2108   }
2109
2110   // if we're active, set the appropriate bits in the digital state
2111   if (curstate)
2112      result |= m_mask;
20622113}
20632114
20642115
2065/*-------------------------------------------------
2066    init_field_device_info - allocate and populate
2067    information about a device callback
2068-------------------------------------------------*/
2116//-------------------------------------------------
2117//  crosshair_position - compute the crosshair
2118//   position
2119//-------------------------------------------------
20692120
2070static device_field_info *init_field_device_info(const input_field_config *field, const char *device_name)
2121void ioport_field::crosshair_position(float &x, float &y, bool &gotx, bool &goty)
20712122{
2072   device_field_info *info;
2073   input_port_value mask;
2123   float value = m_live->analog->crosshair_read();
20742124
2075   /* allocate memory */
2076   info = auto_alloc_clear(field->machine(), device_field_info);
2125   // apply the scale and offset
2126   if (m_crosshair_scale < 0)
2127      value = -(1.0 - value) * m_crosshair_scale;
2128   else
2129      value *= m_crosshair_scale;
2130   value += m_crosshair_offset;
20772131
2078   /* fill in the data */
2079   info->field = field;
2080   for (mask = field->mask; !(mask & 1); mask >>= 1)
2081      info->shift++;
2132   // apply custom mapping if necessary
2133   if (!m_crosshair_mapper.isnull())
2134      value = m_crosshair_mapper(*this, value);
20822135
2083   info->device = (device_name != NULL) ? field->machine().device(device_name) : &field->port().owner();
2136   // handle X axis
2137   if (m_crosshair_axis == CROSSHAIR_AXIS_X)
2138   {
2139      x = value;
2140      gotx = true;
2141      if (m_crosshair_altaxis != 0)
2142      {
2143         y = m_crosshair_altaxis;
2144         goty = true;
2145      }
2146   }
20842147
2085   info->oldval = field->defvalue >> info->shift;
2086   return info;
2148   // handle Y axis
2149   else
2150   {
2151      y = value;
2152      goty = true;
2153      if (m_crosshair_altaxis != 0)
2154      {
2155         x = m_crosshair_altaxis;
2156         gotx = true;
2157      }
2158   }
20872159}
20882160
20892161
2090/*-------------------------------------------------
2091    init_field_analog_state - allocate and populate
2092    information about an analog port
2093-------------------------------------------------*/
2162//-------------------------------------------------
2163//  expand_diplocation - expand a string-based
2164//  DIP location into a linked list of
2165//  descriptions
2166//-------------------------------------------------
20942167
2095static analog_field_state *init_field_analog_state(const input_field_config *field)
2168void ioport_field::expand_diplocation(const char *location, astring &errorbuf)
20962169{
2097   analog_field_state *state;
2098   input_port_value mask;
2170   // if nothing present, bail
2171   if (location == NULL)
2172      return;
20992173
2100   /* allocate memory */
2101   state = auto_alloc_clear(field->machine(), analog_field_state);
2174   m_diploclist.reset();
21022175
2103   /* compute the shift amount and number of bits */
2104   for (mask = field->mask; !(mask & 1); mask >>= 1)
2105      state->shift++;
2176   // parse the string
2177   astring name; // Don't move this variable inside the loop, lastname's lifetime depends on it being outside
2178   const char *lastname = NULL;
2179   const char *curentry = location;
2180   int entries = 0;
2181   while (*curentry != 0)
2182   {
2183      // find the end of this entry
2184      const char *comma = strchr(curentry, ',');
2185      if (comma == NULL)
2186         comma = curentry + strlen(curentry);
21062187
2107   /* initialize core data */
2108   state->field = field;
2109   state->adjdefvalue = (field->defvalue & field->mask) >> state->shift;
2110   state->adjmin = (field->min & field->mask) >> state->shift;
2111   state->adjmax = (field->max & field->mask) >> state->shift;
2112   state->sensitivity = field->sensitivity;
2113   state->reverse = ((field->flags & ANALOG_FLAG_REVERSE) != 0);
2114   state->delta = field->delta;
2115   state->centerdelta = field->centerdelta;
2116   state->minimum = INPUT_ABSOLUTE_MIN;
2117   state->maximum = INPUT_ABSOLUTE_MAX;
2188      // extract it to tempbuf
2189      astring tempstr;
2190      tempstr.cpy(curentry, comma - curentry);
21182191
2119   /* set basic parameters based on the configured type */
2120   switch (field->type)
2121   {
2122      /* paddles and analog joysticks are absolute and autocenter */
2123      case IPT_AD_STICK_X:
2124      case IPT_AD_STICK_Y:
2125      case IPT_AD_STICK_Z:
2126      case IPT_PADDLE:
2127      case IPT_PADDLE_V:
2128         state->absolute = TRUE;
2129         state->autocenter = TRUE;
2130         state->interpolate = TRUE;
2131         break;
2192      // first extract the switch name if present
2193      const char *number = tempstr;
2194      const char *colon = strchr(tempstr, ':');
21322195
2133      /* pedals start at and autocenter to the min range */
2134      case IPT_PEDAL:
2135      case IPT_PEDAL2:
2136      case IPT_PEDAL3:
2137         state->center = INPUT_ABSOLUTE_MIN;
2138         state->accum = APPLY_INVERSE_SENSITIVITY(state->center, state->sensitivity);
2139         state->absolute = TRUE;
2140         state->autocenter = TRUE;
2141         state->interpolate = TRUE;
2142         break;
2196      // allocate and copy the name if it is present
2197      if (colon != NULL)
2198      {
2199         lastname = name.cpy(number, colon - number);
2200         number = colon + 1;
2201      }
21432202
2144      /* lightguns are absolute as well, but don't autocenter and don't interpolate their values */
2145      case IPT_LIGHTGUN_X:
2146      case IPT_LIGHTGUN_Y:
2147         state->absolute = TRUE;
2148         state->autocenter = FALSE;
2149         state->interpolate = FALSE;
2150         break;
2203      // otherwise, just copy the last name
2204      else
2205      {
2206         if (lastname == NULL)
2207         {
2208            errorbuf.catprintf("Switch location '%s' missing switch name!\n", location);
2209            lastname = (char *)"UNK";
2210         }
2211         name.cpy(lastname);
2212      }
21512213
2152      /* positional devices are absolute, but can also wrap like relative devices */
2153      /* set each position to be 512 units */
2154      case IPT_POSITIONAL:
2155      case IPT_POSITIONAL_V:
2156         state->positionalscale = COMPUTE_SCALE(field->max, INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN);
2157         state->adjmin = 0;
2158         state->adjmax = field->max - 1;
2159         state->wraps = ((field->flags & ANALOG_FLAG_WRAPS) != 0);
2160         state->autocenter = !state->wraps;
2161         break;
2214      // if the number is preceded by a '!' it's active high
2215      bool invert = false;
2216      if (*number == '!')
2217      {
2218         invert = true;
2219         number++;
2220      }
21622221
2163      /* dials, mice and trackballs are relative devices */
2164      /* these have fixed "min" and "max" values based on how many bits are in the port */
2165      /* in addition, we set the wrap around min/max values to 512 * the min/max values */
2166      /* this takes into account the mapping that one mouse unit ~= 512 analog units */
2167      case IPT_DIAL:
2168      case IPT_DIAL_V:
2169      case IPT_TRACKBALL_X:
2170      case IPT_TRACKBALL_Y:
2171      case IPT_MOUSE_X:
2172      case IPT_MOUSE_Y:
2173         state->absolute = FALSE;
2174         state->wraps = TRUE;
2175         state->interpolate = TRUE;
2176         break;
2222      // now scan the switch number
2223      int swnum = -1;
2224      if (sscanf(number, "%d", &swnum) != 1)
2225         errorbuf.catprintf("Switch location '%s' has invalid format!\n", location);
21772226
2178      default:
2179         fatalerror("Unknown analog port type -- don't know if it is absolute or not");
2180         break;
2227      // allocate a new entry
2228      m_diploclist.append(*global_alloc(ioport_diplocation(name, swnum, invert)));
2229      entries++;
2230
2231      // advance to the next item
2232      curentry = comma;
2233      if (*curentry != 0)
2234         curentry++;
21812235   }
21822236
2183   /* further processing for absolute controls */
2184   if (state->absolute)
2185   {
2186      /* if the default value is pegged at the min or max, use a single scale value for the whole axis */
2187      state->single_scale = (state->adjdefvalue == state->adjmin) || (state->adjdefvalue == state->adjmax);
2237   // then verify the number of bits in the mask matches
2238   ioport_value temp;
2239   int bits;
2240   for (bits = 0, temp = m_mask; temp != 0 && bits < 32; bits++)
2241      temp &= temp - 1;
2242   if (bits != entries)
2243      errorbuf.catprintf("Switch location '%s' does not describe enough bits for mask %X\n", location, m_mask);
2244}
21882245
2189      /* if not "single scale", compute separate scales for each side of the default */
2190      if (!state->single_scale)
2191      {
2192         /* unsigned */
2193         state->scalepos = COMPUTE_SCALE(state->adjmax - state->adjdefvalue, INPUT_ABSOLUTE_MAX - 0);
2194         state->scaleneg = COMPUTE_SCALE(state->adjdefvalue - state->adjmin, 0 - INPUT_ABSOLUTE_MIN);
21952246
2196         if (state->adjmin > state->adjmax)
2197            state->scaleneg = -state->scaleneg;
2247//-------------------------------------------------
2248//  init_live_state - create live state structures
2249//-------------------------------------------------
21982250
2199         /* reverse point is at center */
2200         state->reverse_val = 0;
2201      }
2202      else
2203      {
2204         /* single axis that increases from default */
2205         state->scalepos = COMPUTE_SCALE(state->adjmax - state->adjmin, INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN);
2251void ioport_field::init_live_state(analog_field *analog)
2252{
2253   // resolve callbacks
2254   m_read.bind_relative_to(device());
2255   m_write.bind_relative_to(device());
2256   m_crosshair_mapper.bind_relative_to(device());
22062257
2207         /* move from default */
2208         if (state->adjdefvalue == state->adjmax)
2209            state->scalepos = -state->scalepos;
2258   // allocate live state
2259   m_live = global_alloc(ioport_field_live(*this, analog));
2260}
22102261
2211         /* make the scaling the same for easier coding when we need to scale */
2212         state->scaleneg = state->scalepos;
22132262
2214         /* reverse point is at max */
2215         state->reverse_val = state->maximum;
2216      }
2217   }
22182263
2219   /* relative and positional controls all map directly with a 512x scale factor */
2220   else
2221   {
2222      /* The relative code is set up to allow specifing PORT_MINMAX and default values. */
2223      /* The validity checks are purposely set up to not allow you to use anything other */
2224      /* a default of 0 and PORT_MINMAX(0,mask).  This is in case the need arises to use */
2225      /* this feature in the future.  Keeping the code in does not hurt anything. */
2226      if (state->adjmin > state->adjmax)
2227         /* adjust for signed */
2228         state->adjmin = -state->adjmin;
2264//**************************************************************************
2265//  I/O PORT FIELD LIVE
2266//**************************************************************************
22292267
2230      if (state->wraps)
2231         state->adjmax++;
2268//-------------------------------------------------
2269//  ioport_field_live - constructor
2270//-------------------------------------------------
22322271
2233      state->minimum = (state->adjmin - state->adjdefvalue) * INPUT_RELATIVE_PER_PIXEL;
2234      state->maximum = (state->adjmax - state->adjdefvalue) * INPUT_RELATIVE_PER_PIXEL;
2272ioport_field_live::ioport_field_live(ioport_field &field, analog_field *analog)
2273   : analog(analog),
2274     joystick(NULL),
2275     value(field.defvalue()),
2276     impulse(0),
2277     last(0),
2278     joydir(digital_joystick::JOYDIR_COUNT)
2279{
2280   // fill in the basic values
2281   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
2282      seq[seqtype] = field.seq(seqtype);
22352283
2236      /* make the scaling the same for easier coding when we need to scale */
2237      state->scaleneg = state->scalepos = COMPUTE_SCALE(1, INPUT_RELATIVE_PER_PIXEL);
2284   // if this is a digital joystick field, make a note of it
2285   if (field.is_digital_joystick())
2286   {
2287      joystick = &field.manager().digjoystick(field.player(), (field.type() - (IPT_DIGITAL_JOYSTICK_FIRST + 1)) / 4);
2288      joydir = joystick->set_axis(field);
2289   }
22382290
2239      if (field->flags & ANALOG_FLAG_RESET)
2240         /* delta values reverse from center */
2241         state->reverse_val = 0;
2242      else
2291   // Name keyboard key names
2292   if (field.type_class() == INPUT_CLASS_KEYBOARD && field.specific_name() == NULL)
2293   {
2294      // loop through each character on the field
2295      astring tempstr;
2296      for (int which = 0; ; which++)
22432297      {
2244         /* positional controls reverse from their max range */
2245         state->reverse_val = state->maximum + state->minimum;
2246
2247         /* relative controls reverse from 1 past their max range */
2248         if (state->wraps)
2249            state->reverse_val -= INPUT_RELATIVE_PER_PIXEL;
2298         unicode_char ch = field.keyboard_code(which);
2299         if (ch == 0)
2300            break;
2301         name.catprintf("%-*s ", MAX(SPACE_COUNT - 1, 0), field.manager().natkeyboard().key_name(tempstr, ch));
22502302      }
2251   }
22522303
2253   /* compute scale for keypresses */
2254   state->keyscalepos = RECIP_SCALE(state->scalepos);
2255   state->keyscaleneg = RECIP_SCALE(state->scaleneg);
2304      // trim extra spaces
2305      name.trimspace();
22562306
2257   return state;
2307      // special case
2308      if (name.len() == 0)
2309         name.cpy("Unnamed Key");
2310   }
22582311}
22592312
22602313
22612314
2262/***************************************************************************
2263    ONCE-PER-FRAME UPDATES
2264***************************************************************************/
2315//**************************************************************************
2316//  I/O PORT
2317//**************************************************************************
22652318
2266/*-------------------------------------------------
2267    frame_update_callback - system-wide callback to
2268    update the input ports once per frame, but
2269    only if we are not paused
2270-------------------------------------------------*/
2319//-------------------------------------------------
2320//  ioport_port - constructor
2321//-------------------------------------------------
22712322
2272static void frame_update_callback(running_machine &machine)
2323ioport_port::ioport_port(device_t &owner, const char *tag)
2324   : m_next(NULL),
2325     m_device(owner),
2326     m_tag(tag),
2327     m_modcount(0),
2328     m_active(0),
2329     m_live(NULL)
22732330{
2274   /* if we're paused, don't do anything */
2275   if (machine.paused())
2276      return;
2277
2278   /* otherwise, use the common code */
2279   frame_update(machine);
22802331}
22812332
2282static key_buffer *get_buffer(running_machine &machine)
2333
2334//-------------------------------------------------
2335//  ~ioport_port - destructor
2336//-------------------------------------------------
2337
2338ioport_port::~ioport_port()
22832339{
2284   ioport_manager &portdata = machine.ioport();
2285   assert(inputx_can_post(machine));
2286   return (key_buffer *)&portdata.keybuffer;
2340   global_free(m_live);
22872341}
22882342
22892343
2344//-------------------------------------------------
2345//  machine - return a reference to the running
2346//   machine
2347//-------------------------------------------------
22902348
2291static const inputx_code *find_code(inputx_code *codes, unicode_char ch)
2349running_machine &ioport_port::machine() const
22922350{
2293   int i;
2294
2295   assert(codes);
2296   for (i = 0; codes[i].ch; i++)
2297   {
2298      if (codes[i].ch == ch)
2299         return &codes[i];
2300   }
2301   return NULL;
2351   return m_device.machine();
23022352}
23032353
2304/*-------------------------------------------------
2305    input_port_update_hook - hook function
2306    called from core to allow for natural keyboard
2307-------------------------------------------------*/
23082354
2309static void input_port_update_hook(running_machine &machine, const input_port_config *port, input_port_value *digital)
2355//-------------------------------------------------
2356//  manager - return a reference to the
2357//  ioport_manager on the running machine
2358//-------------------------------------------------
2359
2360ioport_manager &ioport_port::manager() const
23102361{
2311   ioport_manager &portdata = machine.ioport();
2312   const key_buffer *keybuf;
2313   const inputx_code *code;
2314   unicode_char ch;
2315   int i;
2316   UINT32 value;
2362   return machine().ioport();
2363}
23172364
2318   if (inputx_can_post(machine))
2319   {
2320      keybuf = get_buffer(machine);
23212365
2322      /* is the key down right now? */
2323      if (keybuf && keybuf->status_keydown && (keybuf->begin_pos != keybuf->end_pos))
2324      {
2325         /* identify the character that is down right now, and its component codes */
2326         ch = keybuf->buffer[keybuf->begin_pos];
2327         code = find_code(portdata.codes, ch);
2366//-------------------------------------------------
2367//  field - return a pointer to the first field
2368//  that intersects the given mask
2369//-------------------------------------------------
23282370
2329         /* loop through this character's component codes */
2330         if (code != NULL)
2331         {
2332            for (i = 0; i < ARRAY_LENGTH(code->field) && (code->field[i] != NULL); i++)
2333            {
2334               if (&code->field[i]->port() == port)
2335               {
2336                  value = code->field[i]->mask;
2337                  *digital |= value;
2338               }
2339            }
2340         }
2341      }
2342   }
2371ioport_field *ioport_port::field(ioport_value mask)
2372{
2373   // if we got the port, look for the field
2374   for (ioport_field *field = first_field(); field != NULL; field = field->next())
2375      if ((field->mask() & mask) != 0)
2376         return field;
2377   return NULL;
23432378}
23442379
23452380
2346/*-------------------------------------------------
2347    frame_update - core logic for per-frame input
2348    port updating
2349-------------------------------------------------*/
2381//-------------------------------------------------
2382//  read - return the value of an I/O port
2383//-------------------------------------------------
23502384
2351static void frame_update(running_machine &machine)
2385ioport_value ioport_port::read()
23522386{
2353   ioport_manager &portdata = machine.ioport();
2354   const input_field_config *mouse_field = NULL;
2355   int ui_visible = ui_is_menu_active();
2356   attotime curtime = machine.time();
2357   const input_port_config *port;
2358   render_target *mouse_target;
2359   INT32 mouse_target_x;
2360   INT32 mouse_target_y;
2361   int mouse_button;
2387   assert_always(manager().safe_to_read(), "Input ports cannot be read at init time!");
23622388
2363g_profiler.start(PROFILER_INPUT);
2389   // start with the digital state
2390   ioport_value result = m_live->digital;
23642391
2365   /* record/playback information about the current frame */
2366   playback_frame(machine, curtime);
2367   record_frame(machine, curtime);
2392   // insert dynamic read values
2393   for (dynamic_field *dynfield = m_live->readlist.first(); dynfield != NULL; dynfield = dynfield->next())
2394      dynfield->read(result);
23682395
2369   /* track the duration of the previous frame */
2370   portdata.last_delta_nsec = (curtime - portdata.last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
2371   portdata.last_frame_time = curtime;
2396   // apply active high/low state to digital and dynamic read inputs
2397   result ^= m_live->defvalue;
23722398
2373   /* update the digital joysticks */
2374   frame_update_digital_joysticks(machine);
2399   // insert analog portions
2400   for (analog_field *analog = m_live->analoglist.first(); analog != NULL; analog = analog->next())
2401      analog->read(result);
23752402
2376   /* compute default values for all the ports */
2377   input_port_update_defaults(machine);
2403   return result;
2404}
23782405
2379   /* perform the mouse hit test */
2380   mouse_target = ui_input_find_mouse(machine, &mouse_target_x, &mouse_target_y, &mouse_button);
2381   if (mouse_button && mouse_target)
2382   {
2383      const char *tag = NULL;
2384      input_port_value mask;
2385      float x, y;
2386      if (mouse_target->map_point_input(mouse_target_x, mouse_target_y, tag, mask, x, y))
2387         mouse_field = input_field_by_tag_and_mask(machine, tag, mask);
2388   }
23892406
2390   /* loop over all input ports */
2391   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
2392   {
2393      const input_field_config *field;
2394      device_field_info *device_field;
2395      input_port_value newvalue;
2407//-------------------------------------------------
2408//  write - write a value to a port
2409//-------------------------------------------------
23962410
2397      /* start with 0 values for the digital and VBLANK bits */
2398      port->state->digital = 0;
2399      port->state->vblank = 0;
2411void ioport_port::write(ioport_value data, ioport_value mem_mask)
2412{
2413   // call device line write handlers
2414   COMBINE_DATA(&m_live->outputvalue);
2415   for (dynamic_field *dynfield = m_live->writelist.first(); dynfield != NULL; dynfield = dynfield->next())
2416      if (dynfield->field().type() == IPT_OUTPUT)
2417         dynfield->write(m_live->outputvalue);
2418}
24002419
2401      /* now loop back and modify based on the inputs */
2402      for (field = port->first_field(); field != NULL; field = field->next())
2403         if (input_condition_true(port->machine(), &field->condition, port->owner()))
2404         {
2405            /* accumulate VBLANK bits */
2406            if (field->type == IPT_VBLANK)
2407               port->state->vblank ^= field->mask;
24082420
2409            /* handle analog inputs */
2410            else if (field->state->analog != NULL)
2411               frame_update_analog_field(machine, field->state->analog);
2421//-------------------------------------------------
2422//  frame_update - once/frame update
2423//-------------------------------------------------
24122424
2413            /* handle non-analog types, but only when the UI isn't visible */
2414            else if (!ui_visible && frame_get_digital_field_state(field, field == mouse_field))
2415               port->state->digital |= field->mask;
2416         }
2425void ioport_port::frame_update(ioport_field *mouse_field)
2426{
2427   // start with 0 values for the digital bits
2428   m_live->digital = 0;
24172429
2418      /* hook for MESS's natural keyboard support */
2419      input_port_update_hook(machine, port, &port->state->digital);
2430   // now loop back and modify based on the inputs
2431   for (ioport_field *field = first_field(); field != NULL; field = field->next())
2432      field->frame_update(m_live->digital, field == mouse_field);
24202433
2421      /* handle playback/record */
2422      playback_port(port);
2423      record_port(port);
2434   // hook for MESS's natural keyboard support
2435   manager().natkeyboard().frame_update(*this, m_live->digital);
24242436
2425      /* call device line write handlers */
2426      newvalue = input_port_read_direct(port);
2427      for (device_field = port->state->writedevicelist; device_field; device_field = device_field->next)
2428         if (device_field->field->type != IPT_OUTPUT && input_condition_true(port->machine(), &device_field->field->condition, port->owner()))
2429         {
2430            input_port_value newval = (newvalue & device_field->field->mask) >> device_field->shift;
2437   // call device line write handlers
2438   ioport_value newvalue = read();
2439   for (dynamic_field *dynfield = m_live->writelist.first(); dynfield != NULL; dynfield = dynfield->next())
2440      if (dynfield->field().type() != IPT_OUTPUT)
2441         dynfield->write(newvalue);
2442}
24312443
2432            /* if the bits have  write, call the handler */
2433            if (device_field->oldval != newval)
2434            {
2435               device_field->field->write(*device_field->field, device_field->field->write_param, device_field->oldval, newval);
24362444
2437               device_field->oldval = newval;
2438            }
2439         }
2440   }
2445//-------------------------------------------------
2446//  collapse_fields - remove any fields that are
2447//   wholly overlapped by other fields
2448//-------------------------------------------------
24412449
2442g_profiler.stop();
2450void ioport_port::collapse_fields(astring &errorbuf)
2451{
2452   ioport_value maskbits = 0;
2453   int lastmodcount = -1;
2454
2455   // remove the whole list and start from scratch
2456   ioport_field *field = m_fieldlist.detach_all();
2457   while (field != NULL)
2458   {
2459      // if this modcount doesn't match, reset
2460      if (field->modcount() != lastmodcount)
2461      {
2462         lastmodcount = field->modcount();
2463         maskbits = 0;
2464      }
2465     
2466      // reinsert this field
2467      ioport_field *current = field;
2468      field = field->next();
2469      insert_field(*current, maskbits, errorbuf);
2470   }
24432471}
24442472
24452473
2446/*-------------------------------------------------
2447    frame_update_digital_joysticks - update the
2448    state of digital joysticks prior to
2449    accumulating the results in a port
2450-------------------------------------------------*/
2474//-------------------------------------------------
2475//  insert_field - insert a new field, checking
2476//   for errors
2477//-------------------------------------------------
24512478
2452static void frame_update_digital_joysticks(running_machine &machine)
2479void ioport_port::insert_field(ioport_field &newfield, ioport_value &disallowedbits, astring &errorbuf)
24532480{
2454   ioport_manager &portdata = machine.ioport();
2455   int player, joyindex;
2481   // verify against the disallowed bits, but only if we are condition-free
2482   if (newfield.condition().none())
2483   {
2484      if ((newfield.mask() & disallowedbits) != 0)
2485         errorbuf.catprintf("INPUT_TOKEN_FIELD specifies duplicate port bits (port=%s mask=%X)\n", tag(), newfield.mask());
2486      disallowedbits |= newfield.mask();
2487   }
24562488
2457   /* loop over all the joysticks */
2458   for (player = 0; player < MAX_PLAYERS; player++)
2459      for (joyindex = 0; joyindex < DIGITAL_JOYSTICKS_PER_PLAYER; joyindex++)
2489   // first modify/nuke any entries that intersect our maskbits
2490   ioport_field *nextfield;
2491   for (ioport_field *field = first_field(); field != NULL; field = nextfield)
2492   {
2493      nextfield = field->next();
2494      if ((field->mask() & newfield.mask()) != 0 &&
2495         (newfield.condition().none() || field->condition().none() || field->condition() == newfield.condition()))
24602496      {
2461         digital_joystick_state *joystick = &portdata.joystick_info[player][joyindex];
2462         if (joystick->inuse)
2463         {
2464            joystick->previous = joystick->current;
2465            joystick->current = 0;
2497         // reduce the mask of the field we found
2498         field->reduce_mask(newfield.mask());
24662499
2467            /* read all the associated ports */
2468            if (joystick->field[JOYDIR_UP] != NULL && machine.input().seq_pressed(input_field_seq(joystick->field[JOYDIR_UP], SEQ_TYPE_STANDARD)))
2469               joystick->current |= JOYDIR_UP_BIT;
2470            if (joystick->field[JOYDIR_DOWN] != NULL && machine.input().seq_pressed(input_field_seq(joystick->field[JOYDIR_DOWN], SEQ_TYPE_STANDARD)))
2471               joystick->current |= JOYDIR_DOWN_BIT;
2472            if (joystick->field[JOYDIR_LEFT] != NULL && machine.input().seq_pressed(input_field_seq(joystick->field[JOYDIR_LEFT], SEQ_TYPE_STANDARD)))
2473               joystick->current |= JOYDIR_LEFT_BIT;
2474            if (joystick->field[JOYDIR_RIGHT] != NULL && machine.input().seq_pressed(input_field_seq(joystick->field[JOYDIR_RIGHT], SEQ_TYPE_STANDARD)))
2475               joystick->current |= JOYDIR_RIGHT_BIT;
2500         // if the new entry fully overrides the previous one, we nuke
2501         if (INPUT_PORT_OVERRIDE_FULLY_NUKES_PREVIOUS || field->mask() == 0)
2502            m_fieldlist.remove(*field);
2503      }
2504   }
24762505
2477            /* lock out opposing directions (left + right or up + down) */
2478            if ((joystick->current & (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT)) == (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT))
2479               joystick->current &= ~(JOYDIR_UP_BIT | JOYDIR_DOWN_BIT);
2480            if ((joystick->current & (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT)) == (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT))
2481               joystick->current &= ~(JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT);
2506   // make a mask of just the low bit
2507   ioport_value lowbit = (newfield.mask() ^ (newfield.mask() - 1)) & newfield.mask();
24822508
2483            /* only update 4-way case if joystick has moved */
2484            if (joystick->current != joystick->previous)
2485            {
2486               joystick->current4way = joystick->current;
2509   // scan forward to find where to insert ourselves
2510   ioport_field *field;
2511   for (field = first_field(); field != NULL; field = field->next())
2512      if (field->mask() > lowbit)
2513         break;
24872514
2488               /*
2489                        If joystick is pointing at a diagonal, acknowledge that the player moved
2490                        the joystick by favoring a direction change.  This minimizes frustration
2491                        when using a keyboard for input, and maximizes responsiveness.
2515   // insert it into the list
2516   m_fieldlist.insert_before(newfield, field);
2517}
24922518
2493                        For example, if you are holding "left" then switch to "up" (where both left
2494                        and up are briefly pressed at the same time), we'll transition immediately
2495                        to "up."
24962519
2497                        Zero any switches that didn't change from the previous to current state.
2498                     */
2499               if ((joystick->current4way & (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT)) &&
2500                  (joystick->current4way & (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT)))
2501               {
2502                  joystick->current4way ^= joystick->current4way & joystick->previous;
2503               }
2520//-------------------------------------------------
2521//  init_live_state - create the live state
2522//-------------------------------------------------
25042523
2505               /*
2506                        If we are still pointing at a diagonal, we are in an indeterminant state.
2524void ioport_port::init_live_state()
2525{
2526   m_live = global_alloc(ioport_port_live(*this));
2527}
25072528
2508                        This could happen if the player moved the joystick from the idle position directly
2509                        to a diagonal, or from one diagonal directly to an extreme diagonal.
25102529
2511                        The chances of this happening with a keyboard are slim, but we still need to
2512                        constrain this case.
25132530
2514                        For now, just resolve randomly.
2515                     */
2516               if ((joystick->current4way & (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT)) &&
2517                  (joystick->current4way & (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT)))
2518               {
2519                  if (machine.rand() & 1)
2520                     joystick->current4way &= ~(JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT);
2521                  else
2522                     joystick->current4way &= ~(JOYDIR_UP_BIT | JOYDIR_DOWN_BIT);
2523               }
2524            }
2525         }
2526      }
2527}
2531//**************************************************************************
2532//  I/O PORT LIVE STATE
2533//**************************************************************************
25282534
2535//-------------------------------------------------
2536//  ioport_port_live - constructor
2537//-------------------------------------------------
25292538
2530/*-------------------------------------------------
2531    frame_update_analog_field - update the
2532    internals of a single analog field
2533-------------------------------------------------*/
2534
2535static void frame_update_analog_field(running_machine &machine, analog_field_state *analog)
2539ioport_port_live::ioport_port_live(ioport_port &port)
2540   : defvalue(0),
2541     digital(0),
2542     outputvalue(0)
25362543{
2537   input_item_class itemclass;
2538   int keypressed = FALSE;
2539   INT64 keyscale;
2540   INT32 rawvalue;
2541   INT32 delta = 0;
2544   // iterate over fields
2545   for (ioport_field *field = port.first_field(); field != NULL; field = field->next())
2546   {
2547      // allocate analog state if it's analog
2548      analog_field *analog = NULL;
2549      if (field->is_analog())
2550         analog = &analoglist.append(*global_alloc(analog_field(*field)));
2551     
2552      // allocate a dynamic field for reading
2553      if (field->has_dynamic_read())
2554         readlist.append(*global_alloc(dynamic_field(*field)));
2555         
2556      // allocate a dynamic field for writing
2557      if (field->has_dynamic_write())
2558         writelist.append(*global_alloc(dynamic_field(*field)));
2559     
2560      // let the field initialize its live state
2561      field->init_live_state(analog);
2562   }
2563}
25422564
2543   /* clamp the previous value to the min/max range and remember it */
2544   analog->previous = analog->accum = apply_analog_min_max(analog, analog->accum);
25452565
2546   /* get the new raw analog value and its type */
2547   rawvalue = machine.input().seq_axis_value(input_field_seq(analog->field, SEQ_TYPE_STANDARD), itemclass);
25482566
2549   /* if we got an absolute input, it overrides everything else */
2550   if (itemclass == ITEM_CLASS_ABSOLUTE)
2551   {
2552      if (analog->previousanalog != rawvalue)
2553      {
2554         /* only update if analog value changed */
2555         analog->previousanalog = rawvalue;
2567//**************************************************************************
2568//  I/O PORT MANAGER
2569//**************************************************************************
25562570
2557         /* apply the inverse of the sensitivity to the raw value so that */
2558         /* it will still cover the full min->max range requested after */
2559         /* we apply the sensitivity adjustment */
2560         if (analog->absolute || (analog->field->flags & ANALOG_FLAG_RESET))
2561         {
2562            /* if port is absolute, then just return the absolute data supplied */
2563            analog->accum = APPLY_INVERSE_SENSITIVITY(rawvalue, analog->sensitivity);
2564         }
2565         else if (analog->positionalscale != 0)
2566         {
2567            /* if port is positional, we will take the full analog control and divide it */
2568            /* into positions, that way as the control is moved full scale, */
2569            /* it moves through all the positions */
2570            rawvalue = APPLY_SCALE(rawvalue - INPUT_ABSOLUTE_MIN, analog->positionalscale) * INPUT_RELATIVE_PER_PIXEL + analog->minimum;
2571//-------------------------------------------------
2572//  ioport_manager - constructor
2573//-------------------------------------------------
25712574
2572            /* clamp the high value so it does not roll over */
2573            rawvalue = MIN(rawvalue, analog->maximum);
2574            analog->accum = APPLY_INVERSE_SENSITIVITY(rawvalue, analog->sensitivity);
2575         }
2576         else
2577            /* if port is relative, we use the value to simulate the speed of relative movement */
2578            /* sensitivity adjustment is allowed for this mode */
2579            analog->accum += rawvalue;
2575ioport_manager::ioport_manager(running_machine &machine)
2576   : m_machine(machine),
2577     m_safe_to_read(false),
2578     m_natkeyboard(machine),
2579     m_last_frame_time(attotime::zero),
2580     m_last_delta_nsec(0),
2581     m_record_file(machine.options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS),
2582     m_playback_file(machine.options().input_directory(), OPEN_FLAG_READ),
2583     m_playback_accumulated_speed(0),
2584     m_playback_accumulated_frames(0)
2585{
2586   memset(m_type_to_entry, 0, sizeof(m_type_to_entry));
2587}
25802588
2581         analog->lastdigital = FALSE;
2582         /* do not bother with other control types if the analog data is changing */
2583         return;
2584      }
2585      else
2586      {
2587         /* we still have to update fake relative from joystick control */
2588         if (!analog->absolute && analog->positionalscale == 0)
2589            analog->accum += rawvalue;
2590      }
2591   }
25922589
2593   /* if we got it from a relative device, use that as the starting delta */
2594   /* also note that the last input was not a digital one */
2595   if (itemclass == ITEM_CLASS_RELATIVE && rawvalue != 0)
2596   {
2597      delta = rawvalue;
2598      analog->lastdigital = FALSE;
2599   }
2590//-------------------------------------------------
2591//  initialize - walk the configured ports and
2592//   create live state information
2593//-------------------------------------------------
26002594
2601   keyscale = (analog->accum >= 0) ? analog->keyscalepos : analog->keyscaleneg;
2595time_t ioport_manager::initialize()
2596{
2597   // add an exit callback and a frame callback
2598   machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ioport_manager::exit), this));
2599   machine().add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(ioport_manager::frame_update), this));
26022600
2603   /* if the decrement code sequence is pressed, add the key delta to */
2604   /* the accumulated delta; also note that the last input was a digital one */
2605   if (machine.input().seq_pressed(input_field_seq(analog->field, SEQ_TYPE_DECREMENT)))
2606   {
2607      keypressed = TRUE;
2608      if (analog->delta != 0)
2609         delta -= APPLY_SCALE(analog->delta, keyscale);
2610      else if (!analog->lastdigital)
2611         /* decrement only once when first pressed */
2612         delta -= APPLY_SCALE(1, keyscale);
2613      analog->lastdigital = TRUE;
2614   }
2601   // initialize the default port info from the OSD
2602   init_port_types();
26152603
2616   /* same for the increment code sequence */
2617   if (machine.input().seq_pressed(input_field_seq(analog->field, SEQ_TYPE_INCREMENT)))
2604   // if we have a token list, proceed
2605   device_iterator iter(machine().root_device());
2606   for (device_t *device = iter.first(); device != NULL; device = iter.next())
26182607   {
2619      keypressed = TRUE;
2620      if (analog->delta)
2621         delta += APPLY_SCALE(analog->delta, keyscale);
2622      else if (!analog->lastdigital)
2623         /* increment only once when first pressed */
2624         delta += APPLY_SCALE(1, keyscale);
2625      analog->lastdigital = TRUE;
2608      astring errors;
2609      m_portlist.append(*device, errors);
2610      if (errors)
2611         mame_printf_error("Input port errors:\n%s", errors.cstr());
26262612   }
26272613
2628   /* if resetting is requested, clear the accumulated position to 0 before */
2629   /* applying the deltas so that we only return this frame's delta */
2630   /* note that centering only works for relative controls */
2631   /* no need to check if absolute here because it is checked by the validity tests */
2632   if (analog->field->flags & ANALOG_FLAG_RESET)
2633      analog->accum = 0;
2614   // allocate live structures to mirror the configuration
2615   for (ioport_port *port = first_port(); port != NULL; port = port->next())
2616      port->init_live_state();
26342617
2635   /* apply the delta to the accumulated value */
2636   analog->accum += delta;
2618   // handle autoselection of devices
2619   init_autoselect_devices(IPT_AD_STICK_X,  IPT_AD_STICK_Y,   IPT_AD_STICK_Z, OPTION_ADSTICK_DEVICE,    "analog joystick");
2620   init_autoselect_devices(IPT_PADDLE,      IPT_PADDLE_V,     0,              OPTION_PADDLE_DEVICE,     "paddle");
2621   init_autoselect_devices(IPT_PEDAL,       IPT_PEDAL2,       IPT_PEDAL3,     OPTION_PEDAL_DEVICE,      "pedal");
2622   init_autoselect_devices(IPT_LIGHTGUN_X,  IPT_LIGHTGUN_Y,   0,              OPTION_LIGHTGUN_DEVICE,   "lightgun");
2623   init_autoselect_devices(IPT_POSITIONAL,  IPT_POSITIONAL_V, 0,              OPTION_POSITIONAL_DEVICE, "positional");
2624   init_autoselect_devices(IPT_DIAL,        IPT_DIAL_V,       0,              OPTION_DIAL_DEVICE,       "dial");
2625   init_autoselect_devices(IPT_TRACKBALL_X, IPT_TRACKBALL_Y,  0,              OPTION_TRACKBALL_DEVICE,  "trackball");
2626   init_autoselect_devices(IPT_MOUSE_X,     IPT_MOUSE_Y,      0,              OPTION_MOUSE_DEVICE,      "mouse");
26372627
2638   /* if our last movement was due to a digital input, and if this control */
2639   /* type autocenters, and if neither the increment nor the decrement seq */
2640   /* was pressed, apply autocentering */
2641   if (analog->autocenter)
2642   {
2643      INT32 center = APPLY_INVERSE_SENSITIVITY(analog->center, analog->sensitivity);
2644      if (analog->lastdigital && !keypressed)
2645      {
2646         /* autocenter from positive values */
2647         if (analog->accum >= center)
2648         {
2649            analog->accum -= APPLY_SCALE(analog->centerdelta, analog->keyscalepos);
2650            if (analog->accum < center)
2628   // look for 4-way joysticks and change the default map if we find any
2629   const char *joystick_map_default = machine().options().joystick_map();
2630   if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0)
2631      for (ioport_port *port = first_port(); port != NULL; port = port->next())
2632         for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
2633            if (field->live().joystick != NULL && field->way() == 4)
26512634            {
2652               analog->accum = center;
2653               analog->lastdigital = FALSE;
2635               machine().input().set_global_joystick_map(field->rotated() ? joystick_map_4way_diagonal : joystick_map_4way_sticky);
2636               break;
26542637            }
2655         }
26562638
2657         /* autocenter from negative values */
2658         else
2659         {
2660            analog->accum += APPLY_SCALE(analog->centerdelta, analog->keyscaleneg);
2661            if (analog->accum > center)
2662            {
2663               analog->accum = center;
2664               analog->lastdigital = FALSE;
2665            }
2666         }
2667      }
2668   }
2669   else if (!keypressed)
2670      analog->lastdigital = FALSE;
2639   // register callbacks for when we load configurations
2640   config_register(machine(), "input", config_saveload_delegate(FUNC(ioport_manager::load_config), this), config_saveload_delegate(FUNC(ioport_manager::save_config), this));
2641
2642   // open playback and record files if specified
2643   time_t basetime = playback_init();
2644   record_init();
2645   return basetime;
26712646}
26722647
26732648
2674/*-------------------------------------------------
2675    frame_get_digital_field_state - get the state
2676    of a digital field
2677-------------------------------------------------*/
2649//-------------------------------------------------
2650//  init_port_types - initialize the default
2651//  type list
2652//-------------------------------------------------
26782653
2679static int frame_get_digital_field_state(const input_field_config *field, int mouse_down)
2654void ioport_manager::init_port_types()
26802655{
2681   int curstate = mouse_down || field->machine().input().seq_pressed(input_field_seq(field, SEQ_TYPE_STANDARD));
2682   int changed = FALSE;
2683   int temp_field_impulse;
2656   // convert the array into a list of type states that can be modified
2657   construct_core_types(m_typelist);
26842658
2685   /* if the state changed, look for switch down/switch up */
2686   if (curstate != field->state->last)
2659   // ask the OSD to customize the list
2660   machine().osd().customize_input_type_list(m_typelist);
2661
2662   // now iterate over the OSD-modified types
2663   for (input_type_entry *curtype = first_type(); curtype != NULL; curtype = curtype->next())
26872664   {
2688      field->state->last = curstate;
2689      changed = TRUE;
2665      // first copy all the OSD-updated sequences into our current state
2666      for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
2667         curtype->m_seq[seqtype] = curtype->defseq(seqtype);
2668
2669      // also make a lookup table mapping type/player to the appropriate type list entry
2670      m_type_to_entry[curtype->type()][curtype->player()] = curtype;
26902671   }
2672}
26912673
2692   if (field->type == IPT_KEYBOARD && ui_get_use_natural_keyboard(field->machine()))
2693      return FALSE;
26942674
2695   /* coin impulse option */
2696   {
2697      int temp_option_impulse = field->machine().options().coin_impulse();
2698      temp_field_impulse = field->impulse;
2699      if ( temp_option_impulse != 0)
2700      {
2701         if (temp_option_impulse < 0)
2702            temp_field_impulse = 0;
2703         else if ((field->type >= IPT_COIN1 && field->type <= IPT_COIN12) || field->impulse != 0)
2704            temp_field_impulse = temp_option_impulse;
2705      }
2706   }
2675//-------------------------------------------------
2676//  init_autoselect_devices - autoselect a single
2677//  device based on the input port list passed
2678//  in and the corresponding option
2679//-------------------------------------------------
27072680
2708   /* if this is a switch-down event, handle impulse and toggle */
2709   if (changed && curstate)
2710   {
2711      /* impluse controls: reset the impulse counter */
2712      if (temp_field_impulse != 0 && field->state->impulse == 0)
2713         field->state->impulse = temp_field_impulse;
2681void ioport_manager::init_autoselect_devices(int type1, int type2, int type3, const char *option, const char *ananame)
2682{
2683   // if nothing specified, ignore the option
2684   const char *stemp = machine().options().value(option);
2685   if (stemp[0] == 0)
2686      return;
27142687
2715      /* toggle controls: flip the toggle state or advance to the next setting */
2716      if (field->flags & FIELD_FLAG_TOGGLE)
2717      {
2718         if (field->settinglist().count() == 0)
2719            field->state->value ^= field->mask;
2720         else
2721            input_field_select_next_setting(field);
2722      }
2688   // extract valid strings
2689   const char *autostring = "keyboard";
2690   input_device_class autoenable = DEVICE_CLASS_KEYBOARD;
2691   if (strcmp(stemp, "mouse") == 0)
2692   {
2693      autoenable = DEVICE_CLASS_MOUSE;
2694      autostring = "mouse";
27232695   }
2724
2725   /* update the current state with the impulse state */
2726   if (temp_field_impulse != 0)
2696   else if (strcmp(stemp, "joystick") == 0)
27272697   {
2728      if (field->state->impulse != 0)
2729      {
2730         field->state->impulse--;
2731         curstate = TRUE;
2732      }
2733      else
2734         curstate = FALSE;
2698      autoenable = DEVICE_CLASS_JOYSTICK;
2699      autostring = "joystick";
27352700   }
2736
2737   /* for toggle switches, the current value is folded into the port's default value */
2738   /* so we always return FALSE here */
2739   if (field->flags & FIELD_FLAG_TOGGLE)
2740      curstate = FALSE;
2741
2742   /* additional logic to restrict digital joysticks */
2743   if (curstate && !mouse_down && field->state->joystick != NULL && field->way != 16 && !field->machine().options().joystick_contradictory())
2701   else if (strcmp(stemp, "lightgun") == 0)
27442702   {
2745      UINT8 mask = (field->way == 4) ? field->state->joystick->current4way : field->state->joystick->current;
2746      if (!(mask & (1 << field->state->joydir)))
2747         curstate = FALSE;
2703      autoenable = DEVICE_CLASS_LIGHTGUN;
2704      autostring = "lightgun";
27482705   }
2749
2750   /* skip locked-out coin inputs */
2751   if (curstate && field->type >= IPT_COIN1 && field->type <= IPT_COIN12 && coin_lockout_get_state(field->machine(), field->type - IPT_COIN1))
2706   else if (strcmp(stemp, "none") == 0)
27522707   {
2753      int verbose = field->machine().options().verbose();
2754#ifdef MAME_DEBUG
2755      verbose = 1;
2756#endif
2757      if (field->machine().options().coin_lockout())
2758      {
2759         if (verbose)
2760            ui_popup_time(3, "Coinlock disabled %s.", input_field_name(field));
2761         return FALSE; /* curstate = FALSE; */
2762      }
2763      else
2764         if (verbose)
2765            ui_popup_time(3, "Coinlock disabled, but broken through %s.", input_field_name(field));
2708      // nothing specified
2709      return;
27662710   }
2711   else if (strcmp(stemp, "keyboard") != 0)
2712      mame_printf_error("Invalid %s value %s; reverting to keyboard\n", option, stemp);
27672713
2768   return curstate;
2714   // only scan the list if we haven't already enabled this class of control
2715   if (first_port() != NULL && !machine().input().device_class(autoenable).enabled())
2716      for (ioport_port *port = first_port(); port != NULL; port = port->next())
2717         for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
2718
2719            // if this port type is in use, apply the autoselect criteria
2720            if ((type1 != 0 && field->type() == type1) || (type2 != 0 && field->type() == type2) || (type3 != 0 && field->type() == type3))
2721            {
2722               mame_printf_verbose("Input: Autoenabling %s due to presence of a %s\n", autostring, ananame);
2723               machine().input().device_class(autoenable).enable();
2724               break;
2725            }
27692726}
27702727
27712728
2729//-------------------------------------------------
2730//  exit - exit callback to ensure we clean up
2731//  and close our files
2732//-------------------------------------------------
27722733
2773/***************************************************************************
2774    PORT CONFIGURATION HELPERS
2775***************************************************************************/
2776
2777/*-------------------------------------------------
2778    port_default_value - updates default value
2779    of port settings according to device settings
2780-------------------------------------------------*/
2781
2782UINT32 port_default_value(const char *fulltag, UINT32 mask, UINT32 defval, device_t &owner)
2734void ioport_manager::exit()
27832735{
2784   const input_device_default *def = owner.input_ports_defaults();
2785   if (def != NULL)
2786   {
2787      astring fullpath;
2788      for ( ; def->tag != NULL; def++)
2789         if (owner.subtag(fullpath, def->tag) == fulltag && def->mask == mask)
2790            return def->defvalue;
2791   }
2792   return defval;
2736   // close any playback or recording files
2737   playback_end();
2738   record_end();
27932739}
27942740
27952741
2796/*-------------------------------------------------
2797    input_port_config - constructor for an
2798    I/O port configuration object
2799-------------------------------------------------*/
2742//-------------------------------------------------
2743//  type_name - return the name for the given
2744//  type/player
2745//-------------------------------------------------
28002746
2801input_port_config::input_port_config(device_t &owner, const char *tag)
2802   : state(NULL),
2803     active(0),
2804     m_next(NULL),
2805     m_owner(owner),
2806     m_tag(tag),
2807     m_modcount(0)
2747const char *ioport_manager::type_name(ioport_type type, UINT8 player)
28082748{
2749   // if we have a machine, use the live state and quick lookup
2750   input_type_entry *entry = m_type_to_entry[type][player];
2751   if (entry != NULL)
2752      return entry->name();
2753
2754   // if we find nothing, return an invalid group
2755   return "???";
28092756}
28102757
28112758
2812running_machine &input_port_config::machine() const
2759//-------------------------------------------------
2760//  type_group - return the group for the given
2761//  type/player
2762//-------------------------------------------------
2763
2764ioport_group ioport_manager::type_group(ioport_type type, int player)
28132765{
2814   return m_owner.machine();
2766   input_type_entry *entry = m_type_to_entry[type][player];
2767   if (entry != NULL)
2768      return entry->group();
2769
2770   // if we find nothing, return an invalid group
2771   return IPG_INVALID;
28152772}
28162773
28172774
2818/*-------------------------------------------------
2819    field_config_alloc - allocate a new input
2820    port field config
2821-------------------------------------------------*/
2775//-------------------------------------------------
2776//  type_seq - return the input sequence for the
2777//  given type/player
2778//-------------------------------------------------
28222779
2823input_field_config::input_field_config(input_port_config &port, int _type, input_port_value _defvalue, input_port_value _maskbits, const char *_name)
2824   : mask(_maskbits),
2825     defvalue(_defvalue & _maskbits),
2826     type(_type),
2827     player(0),
2828     flags(0),
2829     impulse(0),
2830     name(_name),
2831     read_param(NULL),
2832     read_device(DEVICE_SELF),
2833     write_param(NULL),
2834     write_device(DEVICE_SELF),
2835     min(0),
2836     max(_maskbits),
2837     sensitivity(0),
2838     delta(0),
2839     centerdelta(0),
2840     crossaxis(0),
2841     crossscale(0),
2842     crossoffset(0),
2843     crossaltaxis(0),
2844     crossmapper_device(DEVICE_SELF),
2845     full_turn_count(0),
2846     remap_table(NULL),
2847     way(0),
2848     state(NULL),
2849     m_next(NULL),
2850     m_port(port),
2851     m_modcount(port.modcount())
2780const input_seq &ioport_manager::type_seq(ioport_type type, int player, input_seq_type seqtype)
28522781{
2853   memset(&condition, 0, sizeof(condition));
2854   for (int seqtype = 0; seqtype < ARRAY_LENGTH(seq); seqtype++)
2855      seq[seqtype].set_default();
2856   chars[0] = chars[1] = chars[2] = (unicode_char) 0;
2782   assert(type >= 0 && type < IPT_COUNT);
2783   assert(player >= 0 && player < MAX_PLAYERS);
2784
2785   // if we have a machine, use the live state and quick lookup
2786   input_type_entry *entry = m_type_to_entry[type][player];
2787   if (entry != NULL)
2788      return entry->seq(seqtype);
2789
2790   // if we find nothing, return an empty sequence
2791   return input_seq::empty_seq;
28572792}
28582793
28592794
2860input_setting_config::input_setting_config(input_field_config &field, input_port_value _value, const char *_name)
2861   : value(_value),
2862     name(_name),
2863     m_field(field),
2864     m_next(NULL)
2795//-------------------------------------------------
2796//  set_type_seq - change the input sequence for
2797//  the given type/player
2798//-------------------------------------------------
2799
2800void ioport_manager::set_type_seq(ioport_type type, int player, input_seq_type seqtype, const input_seq &newseq)
28652801{
2866   memset(&condition, 0, sizeof(condition));
2802   input_type_entry *entry = m_type_to_entry[type][player];
2803   if (entry != NULL)
2804      entry->m_seq[seqtype] = newseq;
28672805}
28682806
2869input_field_diplocation::input_field_diplocation(const char *string, UINT8 _swnum, bool _invert)
2870   : swname(string),
2871     swnum(_swnum),
2872     invert(_invert)
2807
2808//-------------------------------------------------
2809//  type_pressed - return true if the sequence for
2810//  the given input type/player is pressed
2811//-------------------------------------------------
2812
2813bool ioport_manager::type_pressed(ioport_type type, int player)
28732814{
2815   return machine().input().seq_pressed(type_seq(type, player));
28742816}
28752817
2876/*-------------------------------------------------
2877    field_config_insert - insert an allocated
2878    input port field config, replacing any
2879    intersecting fields already present and
2880    inserting at the correct sorted location
2881-------------------------------------------------*/
28822818
2883void input_port_config::collapse_fields(astring &errorbuf)
2819//-------------------------------------------------
2820//  type_class_present - return true if the given
2821//  ioport_type_class exists in at least one port
2822//-------------------------------------------------
2823
2824bool ioport_manager::type_class_present(ioport_type_class inputclass)
28842825{
2885   input_field_config *list = m_fieldlist.detach_all();
2886   input_port_value maskbits = 0;
2887   int lastmodcount = -1;
2888   while (list != NULL)
2889   {
2890      if (list->modcount() != lastmodcount)
2891      {
2892         lastmodcount = list->modcount();
2893         maskbits = 0;
2894      }
2895      input_field_config *current = list;
2896      list = list->next();
2897      field_config_insert(*current, maskbits, errorbuf);
2898   }
2826   for (ioport_port *port = first_port(); port != NULL; port = port->next())
2827      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
2828         if (field->type_class() == inputclass)
2829            return true;
2830   return false;
28992831}
29002832
2901void field_config_insert(input_field_config &newfield, input_port_value &disallowedbits, astring &errorbuf)
2902{
2903   input_port_value lowbit;
29042833
2905   /* verify against the disallowed bits, but only if we are condition-free */
2906   if (newfield.condition.condition == PORTCOND_ALWAYS)
2907   {
2908      if ((newfield.mask & disallowedbits) != 0)
2909         errorbuf.catprintf("INPUT_TOKEN_FIELD specifies duplicate port bits (port=%s mask=%X)\n", newfield.port().tag(), newfield.mask);
2910      disallowedbits |= newfield.mask;
2911   }
2834//-------------------------------------------------
2835//  has_keyboard - determine if there is a
2836//  keyboard present in the control list
2837//-------------------------------------------------
29122838
2913   /* first modify/nuke any entries that intersect our maskbits */
2914   input_field_config *nextfield;
2915   for (input_field_config *field = newfield.port().fieldlist().first(); field != NULL; field = nextfield)
2916   {
2917      nextfield = field->next();
2918      if ((field->mask & newfield.mask) != 0 && (newfield.condition.condition == PORTCOND_ALWAYS ||
2919                                                 field->condition.condition == PORTCOND_ALWAYS ||
2920                                                 condition_equal(&field->condition, &newfield.condition)))
2839bool ioport_manager::has_keyboard() const
2840{
2841   // iterate over ports and fields
2842   for (ioport_port *port = first_port(); port != NULL; port = port->next())
2843      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
29212844      {
2922         /* reduce the mask of the field we found */
2923         field->mask &= ~newfield.mask;
2845         // if we are at init, check IPT_KEYBOARD
2846         if (!m_safe_to_read && field->type() == IPT_KEYBOARD)
2847            return true;
29242848
2925         /* if the new entry fully overrides the previous one, we nuke */
2926         if (INPUT_PORT_OVERRIDE_FULLY_NUKES_PREVIOUS || field->mask == 0)
2927            newfield.port().fieldlist().remove(*field);
2849         // else, check if there is a keyboard and if such a keyboard is enabled
2850         if (field->type() == IPT_KEYBOARD && field->enabled())
2851            return true;
29282852      }
2929   }
29302853
2931   /* make a mask of just the low bit */
2932   lowbit = (newfield.mask ^ (newfield.mask - 1)) & newfield.mask;
2854   return false;
2855}
29332856
2934   /* scan forward to find where to insert ourselves */
2935   input_field_config *field;
2936   for (field = newfield.port().fieldlist().first(); field != NULL; field = field->next())
2937      if (field->mask > lowbit)
2938         break;
2857//-------------------------------------------------
2858//  count_players - counts the number of active
2859//  players
2860//-------------------------------------------------
29392861
2940   /* insert it into the list */
2941   newfield.port().fieldlist().insert_before(newfield, field);
2862int ioport_manager::count_players() const
2863{
2864   int max_player = 0;
2865   for (ioport_port *port = first_port(); port != NULL; port = port->next())
2866      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
2867         if (field->type_class() == INPUT_CLASS_CONTROLLER && max_player <= field->player() + 1)
2868            max_player = field->player() + 1;
2869
2870   return max_player;
29422871}
29432872
29442873
2945/*-------------------------------------------------
2946    diplocation_expand - expand a string-based
2947    DIP location into a linked list of
2948    descriptions
2949-------------------------------------------------*/
2874//-------------------------------------------------
2875//  crosshair_position - return the extracted
2876//  crosshair values for the given player
2877//-------------------------------------------------
29502878
2951void diplocation_list_alloc(input_field_config &field, const char *location, astring &errorbuf)
2879bool ioport_manager::crosshair_position(int player, float &x, float &y)
29522880{
2953   /* if nothing present, bail */
2954   if (location == NULL)
2955      return;
2881   // read all the lightgun values
2882   bool gotx = false, goty = false;
2883   for (ioport_port *port = first_port(); port != NULL; port = port->next())
2884      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
2885         if (field->player() == player && field->crosshair_axis() != CROSSHAIR_AXIS_NONE && field->enabled())
2886         {
2887            field->crosshair_position(x, y, gotx, goty);
29562888
2957   field.diploclist().reset();
2889            // if we got both, stop
2890            if (gotx && goty)
2891               break;
2892         }
29582893
2959   /* parse the string */
2960   astring name; // Don't move this variable inside the loop, lastname's lifetime depends on it being outside
2961   const char *lastname = NULL;
2962   const char *curentry = location;
2963   int entries = 0;
2964   while (*curentry != 0)
2965   {
2966      /* find the end of this entry */
2967      const char *comma = strchr(curentry, ',');
2968      if (comma == NULL)
2969         comma = curentry + strlen(curentry);
2894   return (gotx && goty);
2895}
29702896
2971      /* extract it to tempbuf */
2972      astring tempstr;
2973      tempstr.cpy(curentry, comma - curentry);
29742897
2975      /* first extract the switch name if present */
2976      const char *number = tempstr;
2977      const char *colon = strchr(tempstr, ':');
2898//-------------------------------------------------
2899//  update_defaults - force an update to the input
2900//  port values based on current conditions
2901//-------------------------------------------------
29782902
2979      /* allocate and copy the name if it is present */
2980      if (colon != NULL)
2903void ioport_manager::update_defaults()
2904{
2905   // two passes to catch conditionals properly
2906   for (int loopnum = 0; loopnum < 2; loopnum++)
2907   {
2908      // loop over all input ports
2909      for (ioport_port *port = first_port(); port != NULL; port = port->next())
29812910      {
2982         lastname = name.cpy(number, colon - number);
2983         number = colon + 1;
2984      }
2911         // only clear on the first pass
2912         if (loopnum == 0)
2913            port->live().defvalue = 0;
29852914
2986      /* otherwise, just copy the last name */
2987      else
2988      {
2989         if (lastname == NULL)
2990         {
2991            errorbuf.catprintf("Switch location '%s' missing switch name!\n", location);
2992            lastname = (char *)"UNK";
2993         }
2994         name.cpy(lastname);
2915         // first compute the default value for the entire port
2916         for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
2917            if (field->enabled())
2918               port->live().defvalue = (port->live().defvalue & ~field->mask()) | (field->live().value & field->mask());
29952919      }
2920   }
2921}
29962922
2997      /* if the number is preceded by a '!' it's active high */
2998      bool invert = false;
2999      if (*number == '!')
3000      {
3001         invert = true;
3002         number++;
3003      }
30042923
3005      /* now scan the switch number */
3006      int swnum = -1;
3007      if (sscanf(number, "%d", &swnum) != 1)
3008         errorbuf.catprintf("Switch location '%s' has invalid format!\n", location);
2924//-------------------------------------------------
2925//  frame_update - core logic for per-frame input
2926//  port updating
2927//-------------------------------------------------
30092928
3010      /* allocate a new entry */
3011      field.diploclist().append(*global_alloc(input_field_diplocation(name, swnum, invert)));
3012      entries++;
2929digital_joystick &ioport_manager::digjoystick(int player, int number)
2930{
2931   // find it in the list
2932   for (digital_joystick *joystick = m_joystick_list.first(); joystick != NULL; joystick = joystick->next())
2933      if (joystick->player() == player && joystick->number() == number)
2934         return *joystick;
2935   
2936   // create a new one
2937   return m_joystick_list.append(*global_alloc(digital_joystick(player, number)));
2938}
30132939
3014      /* advance to the next item */
3015      curentry = comma;
3016      if (*curentry != 0)
3017         curentry++;
3018   }
30192940
3020   /* then verify the number of bits in the mask matches */
3021   input_port_value temp;
3022   int bits;
3023   for (bits = 0, temp = field.mask; temp != 0 && bits < 32; bits++)
3024      temp &= temp - 1;
3025   if (bits != entries)
3026      errorbuf.catprintf("Switch location '%s' does not describe enough bits for mask %X\n", location, field.mask);
3027}
2941//-------------------------------------------------
2942//  frame_update - core logic for per-frame input
2943//  port updating
2944//-------------------------------------------------
30282945
2946void ioport_manager::frame_update()
2947{
2948   // if we're paused, don't do anything
2949   if (machine().paused())
2950      return;
30292951
2952g_profiler.start(PROFILER_INPUT);
30302953
3031/***************************************************************************
3032    TOKENIZATION HELPERS
3033***************************************************************************/
2954   // record/playback information about the current frame
2955   attotime curtime = machine().time();
2956   playback_frame(curtime);
2957   record_frame(curtime);
30342958
3035/*-------------------------------------------------
3036    token_to_input_field_type - convert a string
3037    token to an input field type and player
3038-------------------------------------------------*/
2959   // track the duration of the previous frame
2960   m_last_delta_nsec = (curtime - m_last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
2961   m_last_frame_time = curtime;
30392962
3040static int token_to_input_field_type(running_machine &machine, const char *string, int *player)
3041{
3042   ioport_manager &portdata = machine.ioport();
3043   int ipnum;
2963   // update the digital joysticks
2964   for (digital_joystick *joystick = m_joystick_list.first(); joystick != NULL; joystick = joystick->next())
2965      joystick->frame_update();
30442966
3045   /* check for our failsafe case first */
3046   if (sscanf(string, "TYPE_OTHER(%d,%d)", &ipnum, player) == 2)
3047      return ipnum;
2967   // compute default values for all the ports
2968   update_defaults();
30482969
3049   /* find the token in the list */
3050   for (input_type_entry *entry = portdata.typelist.first(); entry != NULL; entry = entry->next())
3051      if (entry->token != NULL && !strcmp(entry->token, string))
2970   // perform mouse hit testing
2971   INT32 mouse_target_x, mouse_target_y;
2972   int mouse_button;
2973   render_target *mouse_target = ui_input_find_mouse(machine(), &mouse_target_x, &mouse_target_y, &mouse_button);
2974
2975   // if the button is pressed, map the point and determine what was hit
2976   ioport_field *mouse_field = NULL;
2977   if (mouse_button && mouse_target != NULL)
2978   {
2979      const char *tag = NULL;
2980      ioport_value mask;
2981      float x, y;
2982      if (mouse_target->map_point_input(mouse_target_x, mouse_target_y, tag, mask, x, y))
30522983      {
3053         *player = entry->player;
3054         return entry->type;
2984         ioport_port *port = machine().root_device().ioport(tag);
2985         if (port != NULL)
2986            mouse_field = port->field(mask);
30552987      }
2988   }
30562989
3057   /* if we fail, return IPT_UNKNOWN */
3058   *player = 0;
3059   return IPT_UNKNOWN;
3060}
2990   // loop over all input ports
2991   for (ioport_port *port = first_port(); port != NULL; port = port->next())
2992   {
2993      port->frame_update(mouse_field);
30612994
2995      // handle playback/record
2996      playback_port(*port);
2997      record_port(*port);
2998   }
30622999
3063/*-------------------------------------------------
3064    input_field_type_to_token - convert an input
3065    field type and player to a string token
3066-------------------------------------------------*/
3067
3068static const char *input_field_type_to_token(running_machine &machine, int type, int player)
3069{
3070   ioport_manager &portdata = machine.ioport();
3071   static char tempbuf[32];
3072
3073   /* look up the port and return the token */
3074   input_type_entry *entry = portdata.type_to_entry[type][player];
3075   if (entry != NULL)
3076      return entry->token;
3077
3078   /* if that fails, carry on */
3079   sprintf(tempbuf, "TYPE_OTHER(%d,%d)", type, player);
3080   return tempbuf;
3000g_profiler.stop();
30813001}
30823002
30833003
3084/*-------------------------------------------------
3085    token_to_seq_type - convert a string to
3086    a sequence type
3087-------------------------------------------------*/
3004//-------------------------------------------------
3005//  frame_interpolate - interpolate between two
3006//  values based on the time between frames
3007//-------------------------------------------------
30883008
3089static int token_to_seq_type(const char *string)
3009ioport_value ioport_manager::frame_interpolate(ioport_value oldval, ioport_value newval)
30903010{
3091   int seqindex;
3011   // if no last delta, just use new value
3012   if (m_last_delta_nsec == 0)
3013      return newval;
30923014
3093   /* look up the string in the table of possible sequence types and return the index */
3094   for (seqindex = 0; seqindex < ARRAY_LENGTH(seqtypestrings); seqindex++)
3095      if (!mame_stricmp(string, seqtypestrings[seqindex]))
3096         return seqindex;
3097
3098   return -1;
3015   // otherwise, interpolate
3016   attoseconds_t nsec_since_last = (machine().time() - m_last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
3017   return oldval + (INT64(newval - oldval) * nsec_since_last / m_last_delta_nsec);
30993018}
31003019
31013020
3021//-------------------------------------------------
3022//  load_config - callback to extract configuration
3023//  data from the XML nodes
3024//-------------------------------------------------
31023025
3103/***************************************************************************
3104    SETTINGS LOAD
3105***************************************************************************/
3106
3107/*-------------------------------------------------
3108    load_config_callback - callback to extract
3109    configuration data from the XML nodes
3110-------------------------------------------------*/
3111
3112static void load_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode)
3026void ioport_manager::load_config(int config_type, xml_data_node *parentnode)
31133027{
3114   ioport_manager &portdata = machine.ioport();
3115   xml_data_node *portnode;
3116   int seqtype;
3117
3118   /* in the completion phase, we finish the initialization with the final ports */
3028   // in the completion phase, we finish the initialization with the final ports
31193029   if (config_type == CONFIG_TYPE_FINAL)
31203030   {
3121      portdata.safe_to_read = TRUE;
3122      frame_update(machine);
3031      m_safe_to_read = true;
3032      frame_update();
31233033   }
31243034
3125   /* early exit if no data to parse */
3035   // early exit if no data to parse
31263036   if (parentnode == NULL)
31273037      return;
31283038
3129   /* iterate over all the remap nodes for controller configs only */
3039   // iterate over all the remap nodes for controller configs only
31303040   if (config_type == CONFIG_TYPE_CONTROLLER)
3131      load_remap_table(machine, parentnode);
3041      load_remap_table(parentnode);
31323042
3133   /* iterate over all the port nodes */
3134   for (portnode = xml_get_sibling(parentnode->child, "port"); portnode; portnode = xml_get_sibling(portnode->next, "port"))
3043   // iterate over all the port nodes
3044   for (xml_data_node *portnode = xml_get_sibling(parentnode->child, "port"); portnode; portnode = xml_get_sibling(portnode->next, "port"))
31353045   {
3136      input_seq newseq[SEQ_TYPE_TOTAL], tempseq;
3137      xml_data_node *seqnode;
3138      int type, player;
3046      // get the basic port info from the attributes
3047      int player;
3048      int type = token_to_input_type(xml_get_attribute_string(portnode, "type", ""), player);
31393049
3140      /* get the basic port info from the attributes */
3141      type = token_to_input_field_type(machine, xml_get_attribute_string(portnode, "type", ""), &player);
3142
3143      /* initialize sequences to invalid defaults */
3144      for (seqtype = 0; seqtype < ARRAY_LENGTH(newseq); seqtype++)
3050      // initialize sequences to invalid defaults
3051      input_seq newseq[SEQ_TYPE_TOTAL];
3052      for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
31453053         newseq[seqtype].set(INPUT_CODE_INVALID);
31463054
3147      /* loop over new sequences */
3148      for (seqnode = xml_get_sibling(portnode->child, "newseq"); seqnode; seqnode = xml_get_sibling(seqnode->next, "newseq"))
3055      // loop over new sequences
3056      for (xml_data_node *seqnode = xml_get_sibling(portnode->child, "newseq"); seqnode; seqnode = xml_get_sibling(seqnode->next, "newseq"))
31493057      {
3150         /* with a valid type, parse out the new sequence */
3151         seqtype = token_to_seq_type(xml_get_attribute_string(seqnode, "type", ""));
3058         // with a valid type, parse out the new sequence
3059         input_seq_type seqtype = token_to_seq_type(xml_get_attribute_string(seqnode, "type", ""));
31523060         if (seqtype != -1 && seqnode->value != NULL)
31533061         {
31543062            if (strcmp(seqnode->value, "NONE") == 0)
31553063               newseq[seqtype].set();
31563064            else
3157               machine.input().seq_from_tokens(newseq[seqtype], seqnode->value);
3065               machine().input().seq_from_tokens(newseq[seqtype], seqnode->value);
31583066         }
31593067      }
31603068
3161      /* if we're loading default ports, apply to the defaults */
3069      // if we're loading default ports, apply to the defaults
31623070      if (config_type != CONFIG_TYPE_GAME)
3163         load_default_config(machine, portnode, type, player, newseq);
3071         load_default_config(portnode, type, player, newseq);
31643072      else
3165         load_game_config(machine, portnode, type, player, newseq);
3073         load_game_config(portnode, type, player, newseq);
31663074   }
31673075
3168   /* after applying the controller config, push that back into the backup, since that is */
3169   /* what we will diff against */
3076   // after applying the controller config, push that back into the backup, since that is
3077   // what we will diff against
31703078   if (config_type == CONFIG_TYPE_CONTROLLER)
3171      for (input_type_entry *entry = portdata.typelist.first(); entry != NULL; entry = entry->next())
3172         for (seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++)
3173            entry->defseq[seqtype] = entry->seq[seqtype];
3079      for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
3080         for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3081            entry->defseq(seqtype) = entry->seq(seqtype);
31743082}
31753083
31763084
3177/*-------------------------------------------------
3178    load_remap_table - extract and apply the
3179    global remapping table
3180-------------------------------------------------*/
3085//-------------------------------------------------
3086//  load_remap_table - extract and apply the
3087//  global remapping table
3088//-------------------------------------------------
31813089
3182static void load_remap_table(running_machine &machine, xml_data_node *parentnode)
3090void ioport_manager::load_remap_table(xml_data_node *parentnode)
31833091{
3184   ioport_manager &portdata = machine.ioport();
3185   input_code *oldtable, *newtable;
3186   xml_data_node *remapnode;
3187   int count;
3188
3189   /* count items first so we can allocate */
3190   count = 0;
3191   for (remapnode = xml_get_sibling(parentnode->child, "remap"); remapnode != NULL; remapnode = xml_get_sibling(remapnode->next, "remap"))
3092   // count items first so we can allocate
3093   int count = 0;
3094   for (xml_data_node *remapnode = xml_get_sibling(parentnode->child, "remap"); remapnode != NULL; remapnode = xml_get_sibling(remapnode->next, "remap"))
31923095      count++;
31933096
3194   /* if we have some, deal with them */
3097   // if we have some, deal with them
31953098   if (count > 0)
31963099   {
3197      int remapnum;
3100      // allocate tables
3101      dynamic_array<input_code> oldtable(count);
3102      dynamic_array<input_code> newtable(count);
31983103
3199      /* allocate tables */
3200      oldtable = global_alloc_array(input_code, count);
3201      newtable = global_alloc_array(input_code, count);
3202
3203      /* build up the remap table */
3104      // build up the remap table
32043105      count = 0;
3205      for (remapnode = xml_get_sibling(parentnode->child, "remap"); remapnode != NULL; remapnode = xml_get_sibling(remapnode->next, "remap"))
3106      for (xml_data_node *remapnode = xml_get_sibling(parentnode->child, "remap"); remapnode != NULL; remapnode = xml_get_sibling(remapnode->next, "remap"))
32063107      {
3207         input_code origcode = machine.input().code_from_token(xml_get_attribute_string(remapnode, "origcode", ""));
3208         input_code newcode = machine.input().code_from_token(xml_get_attribute_string(remapnode, "newcode", ""));
3108         input_code origcode = machine().input().code_from_token(xml_get_attribute_string(remapnode, "origcode", ""));
3109         input_code newcode = machine().input().code_from_token(xml_get_attribute_string(remapnode, "newcode", ""));
32093110         if (origcode != INPUT_CODE_INVALID && newcode != INPUT_CODE_INVALID)
32103111         {
32113112            oldtable[count] = origcode;
r15082r15083
32143115         }
32153116      }
32163117
3217      /* loop over the remapping table, operating only if something was specified */
3218      for (remapnum = 0; remapnum < count; remapnum++)
3219      {
3220         input_code oldcode = oldtable[remapnum];
3221         input_code newcode = newtable[remapnum];
3222
3223         /* loop over all default ports, remapping the requested keys */
3224         for (input_type_entry *entry = portdata.typelist.first(); entry != NULL; entry = entry->next())
3225         {
3226            /* remap anything in the default sequences */
3227            for (int seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++)
3228               entry->seq[seqtype].replace(oldcode, newcode);
3229         }
3230      }
3231
3232      /* release the tables */
3233      global_free(oldtable);
3234      global_free(newtable);
3118      // loop over the remapping table, then over default ports, replacing old with new
3119      for (int remapnum = 0; remapnum < count; remapnum++)
3120         for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
3121            for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3122               entry->m_seq[seqtype].replace(oldtable[remapnum], newtable[remapnum]);
32353123   }
32363124}
32373125
32383126
3239/*-------------------------------------------------
3240    load_default_config - apply configuration
3241    data to the default mappings
3242-------------------------------------------------*/
3127//-------------------------------------------------
3128//  load_default_config - apply configuration
3129//  data to the default mappings
3130//-------------------------------------------------
32433131
3244static int load_default_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
3132bool ioport_manager::load_default_config(xml_data_node *portnode, int type, int player, const input_seq *newseq)
32453133{
3246   ioport_manager &portdata = machine.ioport();
3247
3248   /* find a matching port in the list */
3249   for (input_type_entry *entry = portdata.typelist.first(); entry != NULL; entry = entry->next())
3250      if (entry->type == type && entry->player == player)
3134   // find a matching port in the list
3135   for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
3136      if (entry->type() == type && entry->player() == player)
32513137      {
3252         for (int seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++)
3138         for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
32533139            if (newseq[seqtype][0] != INPUT_CODE_INVALID)
3254               entry->seq[seqtype] = newseq[seqtype];
3255         return TRUE;
3140               entry->m_seq[seqtype] = newseq[seqtype];
3141         return true;
32563142      }
32573143
3258   return FALSE;
3144   return false;
32593145}
32603146
32613147
3262/*-------------------------------------------------
3263    load_game_config - apply configuration
3264    data to the current set of input ports
3265-------------------------------------------------*/
3148//-------------------------------------------------
3149//  load_game_config - apply configuration
3150//  data to the current set of input ports
3151//-------------------------------------------------
32663152
3267static int load_game_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
3153bool ioport_manager::load_game_config(xml_data_node *portnode, int type, int player, const input_seq *newseq)
32683154{
3269   input_port_value mask, defvalue;
3270   const input_field_config *field;
3271   const input_port_config *port;
3272   char tempbuffer[20];
3273   const char *tag;
3155   // read the mask, index, and defvalue attributes
3156   const char *tag = xml_get_attribute_string(portnode, "tag", NULL);
3157   ioport_value mask = xml_get_attribute_int(portnode, "mask", 0);
3158   ioport_value defvalue = xml_get_attribute_int(portnode, "defvalue", 0);
32743159
3275   /* read the mask, index, and defvalue attributes */
3276   tag = xml_get_attribute_string(portnode, "tag", NULL);
3277   mask = xml_get_attribute_int(portnode, "mask", 0);
3278   defvalue = xml_get_attribute_int(portnode, "defvalue", 0);
3160   // find the port we want; if no tag, search them all
3161   for (ioport_port *port = first_port(); port != NULL; port = port->next())
3162      if (tag == NULL || strcmp(port->tag(), tag) == 0)
3163         for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
32793164
3280   /* find the port we want; if no tag, search them all */
3281   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
3282      if (tag == NULL || strcmp(get_port_tag(port, tempbuffer), tag) == 0)
3283         for (field = port->first_field(); field != NULL; field = field->next())
3284
3285            /* find the matching mask and defvalue */
3286            if (field->type == type && field->player == player &&
3287               field->mask == mask && (field->defvalue & mask) == (defvalue & mask))
3165            // find the matching mask and defvalue
3166            if (field->type() == type && field->player() == player &&
3167               field->mask() == mask && (field->defvalue() & mask) == (defvalue & mask))
32883168            {
3289               const char *revstring;
3290               int seqtype;
3291
3292               /* if a sequence was specified, copy it in */
3293               for (seqtype = 0; seqtype < ARRAY_LENGTH(field->state->seq); seqtype++)
3169               // if a sequence was specified, copy it in
3170               for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
32943171                  if (newseq[seqtype][0] != INPUT_CODE_INVALID)
3295                     field->state->seq[seqtype] = newseq[seqtype];
3172                     field->live().seq[seqtype] = newseq[seqtype];
32963173
3297               /* for non-analog fields, fetch the value */
3298               if (field->state->analog == NULL)
3299                  field->state->value = xml_get_attribute_int(portnode, "value", field->defvalue);
3174               // for non-analog fields, fetch the value
3175               if (field->live().analog == NULL)
3176                  field->live().value = xml_get_attribute_int(portnode, "value", field->defvalue());
33003177
3301               /* for analog fields, fetch configurable analog attributes */
3178               // for analog fields, fetch configurable analog attributes
33023179               else
33033180               {
3304                  /* get base attributes */
3305                  field->state->analog->delta = xml_get_attribute_int(portnode, "keydelta", field->delta);
3306                  field->state->analog->centerdelta = xml_get_attribute_int(portnode, "centerdelta", field->centerdelta);
3307                  field->state->analog->sensitivity = xml_get_attribute_int(portnode, "sensitivity", field->sensitivity);
3181                  // get base attributes
3182                  field->live().analog->m_delta = xml_get_attribute_int(portnode, "keydelta", field->delta());
3183                  field->live().analog->m_centerdelta = xml_get_attribute_int(portnode, "centerdelta", field->centerdelta());
3184                  field->live().analog->m_sensitivity = xml_get_attribute_int(portnode, "sensitivity", field->sensitivity());
33083185
3309                  /* fetch yes/no for reverse setting */
3310                  revstring = xml_get_attribute_string(portnode, "reverse", NULL);
3186                  // fetch yes/no for reverse setting
3187                  const char *revstring = xml_get_attribute_string(portnode, "reverse", NULL);
33113188                  if (revstring != NULL)
3312                     field->state->analog->reverse = (strcmp(revstring, "yes") == 0);
3189                     field->live().analog->m_reverse = (strcmp(revstring, "yes") == 0);
33133190               }
3314               return TRUE;
3191               return true;
33153192            }
33163193
3317   return FALSE;
3194   return false;
33183195}
33193196
33203197
33213198
3322/***************************************************************************
3323    SETTINGS SAVE
3324***************************************************************************/
3199//**************************************************************************
3200//  SETTINGS SAVE
3201//**************************************************************************
33253202
3326/*-------------------------------------------------
3327    save_config_callback - config callback for
3328    saving input port configuration
3329-------------------------------------------------*/
3203//-------------------------------------------------
3204//  save_config - config callback for saving input
3205//  port configuration
3206//-------------------------------------------------
33303207
3331static void save_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode)
3208void ioport_manager::save_config(int config_type, xml_data_node *parentnode)
33323209{
3333   /* if no parentnode, ignore */
3210   // if no parentnode, ignore
33343211   if (parentnode == NULL)
33353212      return;
33363213
3337   /* default ports save differently */
3214   // default ports save differently
33383215   if (config_type == CONFIG_TYPE_DEFAULT)
3339      save_default_inputs(machine, parentnode);
3216      save_default_inputs(parentnode);
33403217   else
3341      save_game_inputs(machine, parentnode);
3218      save_game_inputs(parentnode);
33423219}
33433220
33443221
3345/*-------------------------------------------------
3346    save_sequence - add a node for an input
3347    sequence
3348-------------------------------------------------*/
3222//-------------------------------------------------
3223//  save_sequence - add a node for an input
3224//  sequence
3225//-------------------------------------------------
33493226
3350static void save_sequence(running_machine &machine, xml_data_node *parentnode, int type, int porttype, const input_seq &seq)
3227void ioport_manager::save_sequence(xml_data_node *parentnode, input_seq_type type, ioport_type porttype, const input_seq &seq)
33513228{
3229   // get the string for the sequence
33523230   astring seqstring;
3353   xml_data_node *seqnode;
3354
3355   /* get the string for the sequence */
33563231   if (seq.length() == 0)
33573232      seqstring.cpy("NONE");
33583233   else
3359      machine.input().seq_to_tokens(seqstring, seq);
3234      machine().input().seq_to_tokens(seqstring, seq);
33603235
3361   /* add the new node */
3362   seqnode = xml_add_child(parentnode, "newseq", seqstring);
3236   // add the new node
3237   xml_data_node *seqnode = xml_add_child(parentnode, "newseq", seqstring);
33633238   if (seqnode != NULL)
33643239      xml_set_attribute(seqnode, "type", seqtypestrings[type]);
33653240}
33663241
33673242
3368/*-------------------------------------------------
3369    save_this_input_field_type - determine if the given
3370    port type is worth saving
3371-------------------------------------------------*/
3243//-------------------------------------------------
3244//  save_this_input_field_type - determine if the
3245//  given port type is worth saving
3246//-------------------------------------------------
33723247
3373static int save_this_input_field_type(int type)
3248bool ioport_manager::save_this_input_field_type(ioport_type type)
33743249{
33753250   switch (type)
33763251   {
33773252      case IPT_UNUSED:
33783253      case IPT_END:
33793254      case IPT_PORT:
3380      case IPT_VBLANK:
33813255      case IPT_UNKNOWN:
3382         return FALSE;
3256         return false;
3257     
3258      default:
3259         break;
33833260   }
3384   return TRUE;
3261   return true;
33853262}
33863263
33873264
3388/*-------------------------------------------------
3389    save_default_inputs - add nodes for any default
3390    mappings that have changed
3391-------------------------------------------------*/
3265//-------------------------------------------------
3266//  save_default_inputs - add nodes for any default
3267//  mappings that have changed
3268//-------------------------------------------------
33923269
3393static void save_default_inputs(running_machine &machine, xml_data_node *parentnode)
3270void ioport_manager::save_default_inputs(xml_data_node *parentnode)
33943271{
3395   ioport_manager &portdata = machine.ioport();
3396   input_type_entry *entry;
3397
3398   /* iterate over ports */
3399   for (entry = portdata.typelist.first(); entry != NULL; entry = entry->next())
3272   // iterate over ports
3273   for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
34003274   {
3401      /* only save if this port is a type we save */
3402      if (save_this_input_field_type(entry->type))
3275      // only save if this port is a type we save
3276      if (save_this_input_field_type(entry->type()))
34033277      {
3404         int seqtype;
3405
3406         /* see if any of the sequences have changed */
3407         for (seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++)
3408            if (entry->seq[seqtype] != entry->defseq[seqtype])
3278         // see if any of the sequences have changed
3279         input_seq_type seqtype;
3280         for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3281            if (entry->seq(seqtype) != entry->defseq(seqtype))
34093282               break;
34103283
3411         /* if so, we need to add a node */
3412         if (seqtype < ARRAY_LENGTH(entry->seq))
3284         // if so, we need to add a node
3285         if (seqtype < SEQ_TYPE_TOTAL)
34133286         {
3414            /* add a new port node */
3287            // add a new port node
34153288            xml_data_node *portnode = xml_add_child(parentnode, "port", NULL);
34163289            if (portnode != NULL)
34173290            {
3418               /* add the port information and attributes */
3419               xml_set_attribute(portnode, "type", input_field_type_to_token(machine, entry->type, entry->player));
3291               // add the port information and attributes
3292               astring tempstr;
3293               xml_set_attribute(portnode, "type", input_type_to_token(tempstr, entry->type(), entry->player()));
34203294
3421               /* add only the sequences that have changed from the defaults */
3422               for (seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++)
3423                  if (entry->seq[seqtype] != entry->defseq[seqtype])
3424                     save_sequence(machine, portnode, seqtype, entry->type, entry->seq[seqtype]);
3295               // add only the sequences that have changed from the defaults
3296               for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3297                  if (entry->seq(seqtype) != entry->defseq(seqtype))
3298                     save_sequence(portnode, seqtype, entry->type(), entry->seq(seqtype));
34253299            }
34263300         }
34273301      }
r15082r15083
34293303}
34303304
34313305
3432/*-------------------------------------------------
3433    save_game_inputs - add nodes for any game
3434    mappings that have changed
3435-------------------------------------------------*/
3306//-------------------------------------------------
3307//  save_game_inputs - add nodes for any game
3308//  mappings that have changed
3309//-------------------------------------------------
34363310
3437static void save_game_inputs(running_machine &machine, xml_data_node *parentnode)
3311void ioport_manager::save_game_inputs(xml_data_node *parentnode)
34383312{
3439   const input_field_config *field;
3440   const input_port_config *port;
3441
3442   /* iterate over ports */
3443   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
3444      for (field = port->first_field(); field != NULL; field = field->next())
3445         if (save_this_input_field_type(field->type))
3313   // iterate over ports
3314   for (ioport_port *port = machine().ioport().first_port(); port != NULL; port = port->next())
3315      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
3316         if (save_this_input_field_type(field->type()))
34463317         {
3318            // determine if we changed
34473319            bool changed = false;
3448            int seqtype;
3320            for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3321               changed |= (field->live().seq[seqtype] != field->seq(seqtype));
34493322
3450            /* determine if we changed */
3451            for (seqtype = 0; seqtype < ARRAY_LENGTH(field->state->seq); seqtype++)
3452               changed |= (field->state->seq[seqtype] != field->seq[seqtype]);
3323            // non-analog changes
3324            if (field->live().analog == NULL)
3325               changed |= ((field->live().value & field->mask()) != (field->defvalue() & field->mask()));
34533326
3454            /* non-analog changes */
3455            if (field->state->analog == NULL)
3456               changed |= ((field->state->value & field->mask) != (field->defvalue & field->mask));
3457
3458            /* analog changes */
3327            // analog changes
34593328            else
34603329            {
3461               changed |= (field->state->analog->delta != field->delta);
3462               changed |= (field->state->analog->centerdelta != field->centerdelta);
3463               changed |= (field->state->analog->sensitivity != field->sensitivity);
3464               changed |= (field->state->analog->reverse != ((field->flags & ANALOG_FLAG_REVERSE) != 0));
3330               changed |= (field->live().analog->m_delta != field->delta());
3331               changed |= (field->live().analog->m_centerdelta != field->centerdelta());
3332               changed |= (field->live().analog->m_sensitivity != field->sensitivity());
3333               changed |= (field->live().analog->m_reverse != field->analog_reverse());
34653334            }
34663335
3467            /* if we did change, add a new node */
3336            // if we did change, add a new node
34683337            if (changed)
34693338            {
3470               /* add a new port node */
3339               // add a new port node
34713340               xml_data_node *portnode = xml_add_child(parentnode, "port", NULL);
34723341               if (portnode != NULL)
34733342               {
3474                  char tempbuffer[20];
3343                  // add the identifying information and attributes
3344                  astring tempstr;
3345                  xml_set_attribute(portnode, "tag", port->tag());
3346                  xml_set_attribute(portnode, "type", input_type_to_token(tempstr, field->type(), field->player()));
3347                  xml_set_attribute_int(portnode, "mask", field->mask());
3348                  xml_set_attribute_int(portnode, "defvalue", field->defvalue() & field->mask());
34753349
3476                  /* add the identifying information and attributes */
3477                  xml_set_attribute(portnode, "tag", get_port_tag(port, tempbuffer));
3478                  xml_set_attribute(portnode, "type", input_field_type_to_token(machine, field->type, field->player));
3479                  xml_set_attribute_int(portnode, "mask", field->mask);
3480                  xml_set_attribute_int(portnode, "defvalue", field->defvalue & field->mask);
3350                  // add sequences if changed
3351                  for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3352                     if (field->live().seq[seqtype] != field->seq(seqtype))
3353                        save_sequence(portnode, seqtype, field->type(), field->live().seq[seqtype]);
34813354
3482                  /* add sequences if changed */
3483                  for (seqtype = 0; seqtype < ARRAY_LENGTH(field->state->seq); seqtype++)
3484                     if (field->state->seq[seqtype] != field->seq[seqtype])
3485                        save_sequence(machine, portnode, seqtype, field->type, field->state->seq[seqtype]);
3486
3487                  /* write out non-analog changes */
3488                  if (field->state->analog == NULL)
3355                  // write out non-analog changes
3356                  if (field->live().analog == NULL)
34893357                  {
3490                     if ((field->state->value & field->mask) != (field->defvalue & field->mask))
3491                        xml_set_attribute_int(portnode, "value", field->state->value & field->mask);
3358                     if ((field->live().value & field->mask()) != (field->defvalue() & field->mask()))
3359                        xml_set_attribute_int(portnode, "value", field->live().value & field->mask());
34923360                  }
34933361
3494                  /* write out analog changes */
3362                  // write out analog changes
34953363                  else
34963364                  {
3497                     if (field->state->analog->delta != field->delta)
3498                        xml_set_attribute_int(portnode, "keydelta", field->state->analog->delta);
3499                     if (field->state->analog->centerdelta != field->centerdelta)
3500                        xml_set_attribute_int(portnode, "centerdelta", field->state->analog->centerdelta);
3501                     if (field->state->analog->sensitivity != field->sensitivity)
3502                        xml_set_attribute_int(portnode, "sensitivity", field->state->analog->sensitivity);
3503                     if (field->state->analog->reverse != ((field->flags & ANALOG_FLAG_REVERSE) != 0))
3504                        xml_set_attribute(portnode, "reverse", field->state->analog->reverse ? "yes" : "no");
3365                     if (field->live().analog->m_delta != field->delta())
3366                        xml_set_attribute_int(portnode, "keydelta", field->live().analog->m_delta);
3367                     if (field->live().analog->m_centerdelta != field->centerdelta())
3368                        xml_set_attribute_int(portnode, "centerdelta", field->live().analog->m_centerdelta);
3369                     if (field->live().analog->m_sensitivity != field->sensitivity())
3370                        xml_set_attribute_int(portnode, "sensitivity", field->live().analog->m_sensitivity);
3371                     if (field->live().analog->m_reverse != field->analog_reverse())
3372                        xml_set_attribute(portnode, "reverse", field->live().analog->m_reverse ? "yes" : "no");
35053373                  }
35063374               }
35073375            }
r15082r15083
35103378
35113379
35123380
3513/***************************************************************************
3514    INPUT PLAYBACK
3515***************************************************************************/
3381//**************************************************************************
3382//  INPUT PLAYBACK
3383//**************************************************************************
35163384
3517/*-------------------------------------------------
3518    playback_read_uint8 - read an 8-bit value
3519    from the playback file
3520-------------------------------------------------*/
3385//-------------------------------------------------
3386//  playback_read - read a value from the playback
3387//  file
3388//-------------------------------------------------
35213389
3522static UINT8 playback_read_uint8(running_machine &machine)
3390template<typename _Type>
3391_Type ioport_manager::playback_read(_Type &result)
35233392{
3524   ioport_manager &portdata = machine.ioport();
3525   UINT8 result;
3393   // protect against NULL handles if previous reads fail
3394   if (!m_playback_file.is_open())
3395      result = 0;
35263396
3527   /* protect against NULL handles if previous reads fail */
3528   if (portdata.playback_file == NULL)
3529      return 0;
3530
3531   /* read the value; if we fail, end playback */
3532   if (portdata.playback_file->read(&result, sizeof(result)) != sizeof(result))
3397   // read the value; if we fail, end playback
3398   else if (m_playback_file.read(&result, sizeof(result)) != sizeof(result))
35333399   {
3534      playback_end(machine, "End of file");
3535      return 0;
3400      playback_end("End of file");
3401      result = 0;
35363402   }
35373403
3538   /* return the appropriate value */
3404   // return the appropriate value
3405   else if (sizeof(result) == 8)
3406      result = LITTLE_ENDIANIZE_INT64(result);
3407   else if (sizeof(result) == 4)
3408      result = LITTLE_ENDIANIZE_INT32(result);
3409   else if (sizeof(result) == 2)
3410      result = LITTLE_ENDIANIZE_INT16(result);
35393411   return result;
35403412}
35413413
3542
3543/*-------------------------------------------------
3544    playback_read_uint32 - read a 32-bit value
3545    from the playback file
3546-------------------------------------------------*/
3547
3548static UINT32 playback_read_uint32(running_machine &machine)
3414template<>
3415bool ioport_manager::playback_read<bool>(bool &result)
35493416{
3550   ioport_manager &portdata = machine.ioport();
3551   UINT32 result;
3552
3553   /* protect against NULL handles if previous reads fail */
3554   if (portdata.playback_file == NULL)
3555      return 0;
3556
3557   /* read the value; if we fail, end playback */
3558   if (portdata.playback_file->read(&result, sizeof(result)) != sizeof(result))
3559   {
3560      playback_end(machine, "End of file");
3561      return 0;
3562   }
3563
3564   /* return the appropriate value */
3565   return LITTLE_ENDIANIZE_INT32(result);
3417   UINT8 temp;
3418   playback_read(temp);
3419   return result = bool(temp);
35663420}
35673421
35683422
3569/*-------------------------------------------------
3570    playback_read_uint64 - read a 64-bit value
3571    from the playback file
3572-------------------------------------------------*/
3423//-------------------------------------------------
3424//  playback_init - initialize INP playback
3425//-------------------------------------------------
35733426
3574static UINT64 playback_read_uint64(running_machine &machine)
3427time_t ioport_manager::playback_init()
35753428{
3576   ioport_manager &portdata = machine.ioport();
3577   UINT64 result;
3578
3579   /* protect against NULL handles if previous reads fail */
3580   if (portdata.playback_file == NULL)
3581      return 0;
3582
3583   /* read the value; if we fail, end playback */
3584   if (portdata.playback_file->read(&result, sizeof(result)) != sizeof(result))
3585   {
3586      playback_end(machine, "End of file");
3587      return 0;
3588   }
3589
3590   /* return the appropriate value */
3591   return LITTLE_ENDIANIZE_INT64(result);
3592}
3593
3594
3595/*-------------------------------------------------
3596    playback_init - initialize INP playback
3597-------------------------------------------------*/
3598
3599static time_t playback_init(running_machine &machine)
3600{
3601   const char *filename = machine.options().playback();
3602   ioport_manager &portdata = machine.ioport();
3603   UINT8 header[INP_HEADER_SIZE];
3604   time_t basetime;
3605
3606   /* if no file, nothing to do */
3429   // if no file, nothing to do
3430   const char *filename = machine().options().playback();
36073431   if (filename[0] == 0)
36083432      return 0;
36093433
3610   /* open the playback file */
3611   portdata.playback_file = auto_alloc(machine, emu_file(machine.options().input_directory(), OPEN_FLAG_READ));
3612   file_error filerr = portdata.playback_file->open(filename);
3434   // open the playback file
3435   file_error filerr = m_playback_file.open(filename);
36133436   assert_always(filerr == FILERR_NONE, "Failed to open file for playback");
36143437
3615   /* read the header and verify that it is a modern version; if not, print an error */
3616   if (portdata.playback_file->read(header, sizeof(header)) != sizeof(header))
3438   // read the header and verify that it is a modern version; if not, print an error
3439   UINT8 header[INP_HEADER_SIZE];
3440   if (m_playback_file.read(header, sizeof(header)) != sizeof(header))
36173441      fatalerror("Input file is corrupt or invalid (missing header)");
36183442   if (memcmp(header, "MAMEINP\0", 8) != 0)
36193443      fatalerror("Input file invalid or in an older, unsupported format");
36203444   if (header[0x10] != INP_HEADER_MAJVERSION)
36213445      fatalerror("Input file format version mismatch");
36223446
3623   /* output info to console */
3447   // output info to console
36243448   mame_printf_info("Input file: %s\n", filename);
36253449   mame_printf_info("INP version %d.%d\n", header[0x10], header[0x11]);
3626   basetime = header[0x08] | (header[0x09] << 8) | (header[0x0a] << 16) | (header[0x0b] << 24) |
3627            ((UINT64)header[0x0c] << 32) | ((UINT64)header[0x0d] << 40) | ((UINT64)header[0x0e] << 48) | ((UINT64)header[0x0f] << 56);
3450   time_t basetime = header[0x08] | (header[0x09] << 8) | (header[0x0a] << 16) | (header[0x0b] << 24) |
3451                  ((UINT64)header[0x0c] << 32) | ((UINT64)header[0x0d] << 40) | ((UINT64)header[0x0e] << 48) | ((UINT64)header[0x0f] << 56);
36283452   mame_printf_info("Created %s", ctime(&basetime));
36293453   mame_printf_info("Recorded using %s\n", header + 0x20);
36303454
3631   /* verify the header against the current game */
3632   if (memcmp(machine.system().name, header + 0x14, strlen(machine.system().name) + 1) != 0)
3633      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);
3455   // verify the header against the current game
3456   if (memcmp(machine().system().name, header + 0x14, strlen(machine().system().name) + 1) != 0)
3457      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);
36343458
3635   /* enable compression */
3636   portdata.playback_file->compress(FCOMPRESS_MEDIUM);
3637
3459   // enable compression
3460   m_playback_file.compress(FCOMPRESS_MEDIUM);
36383461   return basetime;
36393462}
36403463
36413464
3642/*-------------------------------------------------
3643    playback_end - end INP playback
3644-------------------------------------------------*/
3465//-------------------------------------------------
3466//  playback_end - end INP playback
3467//-------------------------------------------------
36453468
3646static void playback_end(running_machine &machine, const char *message)
3469void ioport_manager::playback_end(const char *message)
36473470{
3648   ioport_manager &portdata = machine.ioport();
3649
3650   /* only applies if we have a live file */
3651   if (portdata.playback_file != NULL)
3471   // only applies if we have a live file
3472   if (m_playback_file.is_open())
36523473   {
3653      /* close the file */
3654      auto_free(machine, portdata.playback_file);
3655      portdata.playback_file = NULL;
3474      // close the file
3475      m_playback_file.close();
36563476
3657      /* pop a message */
3477      // pop a message
36583478      if (message != NULL)
36593479         popmessage("Playback Ended\nReason: %s", message);
36603480
3661      /* display speed stats */
3662      portdata.playback_accumulated_speed /= portdata.playback_accumulated_frames;
3663      mame_printf_info("Total playback frames: %d\n", (UINT32)portdata.playback_accumulated_frames);
3664      mame_printf_info("Average recorded speed: %d%%\n", (UINT32)((portdata.playback_accumulated_speed * 200 + 1) >> 21));
3481      // display speed stats
3482      m_playback_accumulated_speed /= m_playback_accumulated_frames;
3483      mame_printf_info("Total playback frames: %d\n", UINT32(m_playback_accumulated_frames));
3484      mame_printf_info("Average recorded speed: %d%%\n", UINT32((m_playback_accumulated_speed * 200 + 1) >> 21));
36653485   }
36663486}
36673487
36683488
3669/*-------------------------------------------------
3670    playback_frame - start of frame callback for
3671    playback
3672-------------------------------------------------*/
3489//-------------------------------------------------
3490//  playback_frame - start of frame callback for
3491//  playback
3492//-------------------------------------------------
36733493
3674static void playback_frame(running_machine &machine, attotime curtime)
3494void ioport_manager::playback_frame(attotime curtime)
36753495{
3676   ioport_manager &portdata = machine.ioport();
3677
3678   /* if playing back, fetch the information and verify */
3679   if (portdata.playback_file != NULL)
3496   // if playing back, fetch the information and verify
3497   if (m_playback_file.is_open())
36803498   {
3499      // first the absolute time
36813500      attotime readtime;
3682
3683      /* first the absolute time */
3684      readtime.seconds = playback_read_uint32(machine);
3685      readtime.attoseconds = playback_read_uint64(machine);
3501      playback_read(readtime.seconds);
3502      playback_read(readtime.attoseconds);
36863503      if (readtime != curtime)
3687         playback_end(machine, "Out of sync");
3504         playback_end("Out of sync");
36883505
3689      /* then the speed */
3690      portdata.playback_accumulated_speed += playback_read_uint32(machine);
3691      portdata.playback_accumulated_frames++;
3506      // then the speed
3507      UINT32 curspeed;
3508      m_playback_accumulated_speed += playback_read(curspeed);
3509      m_playback_accumulated_frames++;
36923510   }
36933511}
36943512
36953513
3696/*-------------------------------------------------
3697    playback_port - per-port callback for playback
3698-------------------------------------------------*/
3514//-------------------------------------------------
3515//  playback_port - per-port callback for playback
3516//-------------------------------------------------
36993517
3700static void playback_port(const input_port_config *port)
3518void ioport_manager::playback_port(ioport_port &port)
37013519{
3702   ioport_manager &portdata = port->machine().ioport();
3703
3704   /* if playing back, fetch information about this port */
3705   if (portdata.playback_file != NULL)
3520   // if playing back, fetch information about this port
3521   if (m_playback_file.is_open())
37063522   {
3707      analog_field_state *analog;
3523      // read the default value and the digital state
3524      playback_read(port.live().defvalue);
3525      playback_read(port.live().digital);
37083526
3709      /* read the default value and the digital state */
3710      port->state->defvalue = playback_read_uint32(port->machine());
3711      port->state->digital = playback_read_uint32(port->machine());
3712
3713      /* loop over analog ports and save their data */
3714      for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
3527      // loop over analog ports and save their data
3528      for (analog_field *analog = port.live().analoglist.first(); analog != NULL; analog = analog->next())
37153529      {
3716         /* read current and previous values */
3717         analog->accum = playback_read_uint32(port->machine());
3718         analog->previous = playback_read_uint32(port->machine());
3530         // read current and previous values
3531         playback_read(analog->m_accum);
3532         playback_read(analog->m_previous);
37193533
3720         /* read configuration information */
3721         analog->sensitivity = playback_read_uint32(port->machine());
3722         analog->reverse = playback_read_uint8(port->machine());
3534         // read configuration information
3535         playback_read(analog->m_sensitivity);
3536         playback_read(analog->m_reverse);
37233537      }
37243538   }
37253539}
37263540
37273541
3542//-------------------------------------------------
3543//  record_write - write a value to the record file
3544//-------------------------------------------------
37283545
3729/***************************************************************************
3730    INPUT RECORDING
3731***************************************************************************/
3732
3733/*-------------------------------------------------
3734    record_write_uint8 - write an 8-bit value
3735    to the record file
3736-------------------------------------------------*/
3737
3738static void record_write_uint8(running_machine &machine, UINT8 data)
3546template<typename _Type>
3547void ioport_manager::record_write(_Type value)
37393548{
3740   ioport_manager &portdata = machine.ioport();
3741   UINT8 result = data;
3742
3743   /* protect against NULL handles if previous reads fail */
3744   if (portdata.record_file == NULL)
3549   // protect against NULL handles if previous reads fail
3550   if (!m_record_file.is_open())
37453551      return;
37463552
3747   /* read the value; if we fail, end playback */
3748   if (portdata.record_file->write(&result, sizeof(result)) != sizeof(result))
3749      record_end(machine, "Out of space");
3553   // read the value; if we fail, end playback
3554   if (m_record_file.write(&value, sizeof(value)) != sizeof(value))
3555      record_end("Out of space");
37503556}
37513557
3752
3753/*-------------------------------------------------
3754    record_write_uint32 - write a 32-bit value
3755    to the record file
3756-------------------------------------------------*/
3757
3758static void record_write_uint32(running_machine &machine, UINT32 data)
3558template<>
3559void ioport_manager::record_write<bool>(bool value)
37593560{
3760   ioport_manager &portdata = machine.ioport();
3761   UINT32 result = LITTLE_ENDIANIZE_INT32(data);
3762
3763   /* protect against NULL handles if previous reads fail */
3764   if (portdata.record_file == NULL)
3765      return;
3766
3767   /* read the value; if we fail, end playback */
3768   if (portdata.record_file->write(&result, sizeof(result)) != sizeof(result))
3769      record_end(machine, "Out of space");
3561   UINT8 byte = UINT8(value);
3562   record_write(byte);
37703563}
37713564
37723565
3773/*-------------------------------------------------
3774    record_write_uint64 - write a 64-bit value
3775    to the record file
3776-------------------------------------------------*/
3566//-------------------------------------------------
3567//  record_init - initialize INP recording
3568//-------------------------------------------------
37773569
3778static void record_write_uint64(running_machine &machine, UINT64 data)
3570void ioport_manager::record_init()
37793571{
3780   ioport_manager &portdata = machine.ioport();
3781   UINT64 result = LITTLE_ENDIANIZE_INT64(data);
3782
3783   /* protect against NULL handles if previous reads fail */
3784   if (portdata.record_file == NULL)
3785      return;
3786
3787   /* read the value; if we fail, end playback */
3788   if (portdata.record_file->write(&result, sizeof(result)) != sizeof(result))
3789      record_end(machine, "Out of space");
3790}
3791
3792
3793/*-------------------------------------------------
3794    record_init - initialize INP recording
3795-------------------------------------------------*/
3796
3797static void record_init(running_machine &machine)
3798{
3799   const char *filename = machine.options().record();
3800   ioport_manager &portdata = machine.ioport();
3801   UINT8 header[INP_HEADER_SIZE];
3802   system_time systime;
3803
3804   /* if no file, nothing to do */
3572   // if no file, nothing to do
3573   const char *filename = machine().options().record();
38053574   if (filename[0] == 0)
38063575      return;
38073576
3808   /* open the record file  */
3809   portdata.record_file = auto_alloc(machine, emu_file(machine.options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
3810   file_error filerr = portdata.record_file->open(filename);
3577   // open the record file
3578   file_error filerr = m_record_file.open(filename);
38113579   assert_always(filerr == FILERR_NONE, "Failed to open file for recording");
38123580
3813   /* get the base time */
3814   machine.base_datetime(systime);
3581   // get the base time
3582   system_time systime;
3583   machine().base_datetime(systime);
38153584
3816   /* fill in the header */
3817   memset(header, 0, sizeof(header));
3585   // fill in the header
3586   UINT8 header[INP_HEADER_SIZE] = { 0 };
38183587   memcpy(header, "MAMEINP\0", 8);
38193588   header[0x08] = systime.time >> 0;
38203589   header[0x09] = systime.time >> 8;
r15082r15083
38263595   header[0x0f] = systime.time >> 56;
38273596   header[0x10] = INP_HEADER_MAJVERSION;
38283597   header[0x11] = INP_HEADER_MINVERSION;
3829   strcpy((char *)header + 0x14, machine.system().name);
3598   strcpy((char *)header + 0x14, machine().system().name);
38303599   sprintf((char *)header + 0x20, "%s %s", emulator_info::get_appname(), build_version);
38313600
3832   /* write it */
3833   portdata.record_file->write(header, sizeof(header));
3601   // write it
3602   m_record_file.write(header, sizeof(header));
38343603
3835   /* enable compression */
3836   portdata.record_file->compress(FCOMPRESS_MEDIUM);
3604   // enable compression
3605   m_record_file.compress(FCOMPRESS_MEDIUM);
38373606}
38383607
38393608
3840/*-------------------------------------------------
3841    record_end - end INP recording
3842-------------------------------------------------*/
3609//-------------------------------------------------
3610//  record_end - end INP recording
3611//-------------------------------------------------
38433612
3844static void record_end(running_machine &machine, const char *message)
3613void ioport_manager::record_end(const char *message)
38453614{
3846   ioport_manager &portdata = machine.ioport();
3847
3848   /* only applies if we have a live file */
3849   if (portdata.record_file != NULL)
3615   // only applies if we have a live file
3616   if (m_record_file.is_open())
38503617   {
3851      /* close the file */
3852      auto_free(machine, portdata.record_file);
3853      portdata.record_file = NULL;
3618      // close the file
3619      m_record_file.close();
38543620
3855      /* pop a message */
3621      // pop a message
38563622      if (message != NULL)
38573623         popmessage("Recording Ended\nReason: %s", message);
38583624   }
38593625}
38603626
38613627
3862/*-------------------------------------------------
3863    record_frame - start of frame callback for
3864    recording
3865-------------------------------------------------*/
3628//-------------------------------------------------
3629//  record_frame - start of frame callback for
3630//  recording
3631//-------------------------------------------------
38663632
3867static void record_frame(running_machine &machine, attotime curtime)
3633void ioport_manager::record_frame(attotime curtime)
38683634{
3869   ioport_manager &portdata = machine.ioport();
3870
3871   /* if recording, record information about the current frame */
3872   if (portdata.record_file != NULL)
3635   // if recording, record information about the current frame
3636   if (m_record_file.is_open())
38733637   {
3874      /* first the absolute time */
3875      record_write_uint32(machine, curtime.seconds);
3876      record_write_uint64(machine, curtime.attoseconds);
3638      // first the absolute time
3639      record_write(curtime.seconds);
3640      record_write(curtime.attoseconds);
38773641
3878      /* then the current speed */
3879      record_write_uint32(machine, machine.video().speed_percent() * (double)(1 << 20));
3642      // then the current speed
3643      record_write(UINT32(machine().video().speed_percent() * double(1 << 20)));
38803644   }
38813645}
38823646
38833647
3884/*-------------------------------------------------
3885    record_port - per-port callback for record
3886-------------------------------------------------*/
3648//-------------------------------------------------
3649//  record_port - per-port callback for record
3650//-------------------------------------------------
38873651
3888static void record_port(const input_port_config *port)
3652void ioport_manager::record_port(ioport_port &port)
38893653{
3890   ioport_manager &portdata = port->machine().ioport();
3891
3892   /* if recording, store information about this port */
3893   if (portdata.record_file != NULL)
3654   // if recording, store information about this port
3655   if (m_record_file.is_open())
38943656   {
3895      analog_field_state *analog;
3657      // store the default value and digital state
3658      record_write(port.live().defvalue);
3659      record_write(port.live().digital);
38963660
3897      /* store the default value and digital state */
3898      record_write_uint32(port->machine(), port->state->defvalue);
3899      record_write_uint32(port->machine(), port->state->digital);
3900
3901      /* loop over analog ports and save their data */
3902      for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
3661      // loop over analog ports and save their data
3662      for (analog_field *analog = port.live().analoglist.first(); analog != NULL; analog = analog->next())
39033663      {
3904         /* store current and previous values */
3905         record_write_uint32(port->machine(), analog->accum);
3906         record_write_uint32(port->machine(), analog->previous);
3664         // store current and previous values
3665         record_write(analog->m_accum);
3666         record_write(analog->m_previous);
39073667
3908         /* store configuration information */
3909         record_write_uint32(port->machine(), analog->sensitivity);
3910         record_write_uint8(port->machine(), analog->reverse);
3668         // store configuration information
3669         record_write(analog->m_sensitivity);
3670         record_write(analog->m_reverse);
39113671      }
39123672   }
39133673}
39143674
3915int input_machine_has_keyboard(running_machine &machine)
3916{
3917   int have_keyboard = FALSE;
3918   const input_field_config *field;
3919   const input_port_config *port;
3920   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
3921   {
3922      for (field = port->first_field(); field != NULL; field = field->next())
3923      {
3924         // if we are at init, check IPT_KEYBOARD for inputx_init
3925         if (!port->machine().ioport().safe_to_read && field->type == IPT_KEYBOARD)
3926         {
3927            have_keyboard = TRUE;
3928            break;
3929         }
39303675
3931         // else, check if there is a keyboard and if such a keyboard is enabled
3932         if (field->type == IPT_KEYBOARD && input_condition_true(field->machine(), &field->condition, field->port().owner()))
3933         {
3934            have_keyboard = TRUE;
3935            break;
3936         }
3937      }
3938   }
3939   return have_keyboard;
3676
3677//**************************************************************************
3678//  I/O PORT CONFIGURER
3679//**************************************************************************
3680
3681//-------------------------------------------------
3682//  ioport_configurer - constructor
3683//-------------------------------------------------
3684
3685ioport_configurer::ioport_configurer(device_t &owner, ioport_list &portlist, astring &errorbuf)
3686   : m_owner(owner),
3687     m_portlist(portlist),
3688     m_errorbuf(errorbuf),
3689     m_curport(NULL),
3690     m_curfield(NULL),
3691     m_cursetting(NULL)
3692{
39403693}
39413694
3942/***************************************************************************
3943    CODE ASSEMBLING
3944***************************************************************************/
39453695
3946/*-------------------------------------------------
3947    code_point_string - obtain a string representation of a
3948    given code; used for logging and debugging
3949-------------------------------------------------*/
3696//-------------------------------------------------
3697//  string_from_token - convert an
3698//  ioport_token to a default string
3699//-------------------------------------------------
39503700
3951static const char *code_point_string(running_machine &machine, unicode_char ch)
3701const char *ioport_configurer::string_from_token(const char *string)
39523702{
3953   static char buf[16];
3954   const char *result = buf;
3703   // 0 is an invalid index
3704   if (string == NULL)
3705      return NULL;
39553706
3956   switch(ch)
3957   {
3958      /* check some magic values */
3959      case '\0':   strcpy(buf, "\\0");      break;
3960      case '\r':   strcpy(buf, "\\r");      break;
3961      case '\n':   strcpy(buf, "\\n");      break;
3962      case '\t':   strcpy(buf, "\\t");      break;
3707   // if the index is greater than the count, assume it to be a pointer
3708   if (FPTR(string) >= INPUT_STRING_COUNT)
3709      return string;
39633710
3964      default:
3965         if ((ch >= 32) && (ch < 128))
3966         {
3967            /* seven bit ASCII is easy */
3968            buf[0] = (char) ch;
3969            buf[1] = '\0';
3970         }
3971         else if (ch >= UCHAR_MAMEKEY_BEGIN)
3972         {
3973            /* try to obtain a codename with code_name(); this can result in an empty string */
3974            input_code code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(ch - UCHAR_MAMEKEY_BEGIN));
3975            astring tempstr;
3976            snprintf(buf, ARRAY_LENGTH(buf), "%s", machine.input().code_name(tempstr, code));
3977         }
3978         else
3979         {
3980            /* empty string; resolve later */
3981            buf[0] = '\0';
3982         }
3711#if FALSE // Set TRUE, If you want to take care missing-token or wrong-sorting
39833712
3984         /* did we fail to resolve? if so, we have a last resort */
3985         if (buf[0] == '\0')
3986            snprintf(buf, ARRAY_LENGTH(buf), "U+%04X", (unsigned) ch);
3987         break;
3713   // otherwise, scan the list for a matching string and return it
3714   {
3715   int index;
3716   for (index = 0; index < ARRAY_LENGTH(input_port_default_strings); index++)
3717      if (input_port_default_strings[index].id == FPTR(string))
3718         return input_port_default_strings[index].string;
39883719   }
3989   return result;
3720   return "(Unknown Default)";
3721
3722#else
3723
3724   return input_port_default_strings[FPTR(string)-1].string;
3725
3726#endif
39903727}
39913728
39923729
3993/*-------------------------------------------------
3994    scan_keys - scans through input ports and
3995    sets up natural keyboard input mapping
3996-------------------------------------------------*/
3730//-------------------------------------------------
3731//  port_alloc - allocate a new port
3732//-------------------------------------------------
39973733
3998static 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)
3734void ioport_configurer::port_alloc(const char *tag)
39993735{
4000   int code_count = 0;
4001   const input_port_config *port;
4002   const input_field_config *field;
4003   unicode_char code;
3736   // create the full tag
3737   astring fulltag;
3738   m_owner.subtag(fulltag, tag);
3739   
3740   // add it to the list, and reset current field/setting
3741   m_curport = &m_portlist.append(fulltag, *global_alloc(ioport_port(m_owner, fulltag)));
3742   m_curfield = NULL;
3743   m_cursetting = NULL;
3744}
40043745
4005   assert(keys < NUM_SIMUL_KEYS);
40063746
4007   for (port = portconfig; port != NULL; port = port->next())
4008   {
4009      for (field = port->first_field(); field != NULL; field = field->next())
4010      {
4011         if (field->type == IPT_KEYBOARD)
4012         {
4013            code = get_keyboard_code(field, shift);
4014            if (code != 0)
4015            {
4016               /* is this a shifter key? */
4017               if ((code >= UCHAR_SHIFT_BEGIN) && (code <= UCHAR_SHIFT_END))
4018               {
4019                  shift_ports[keys] = field;
4020                  code_count += scan_keys(machine,
4021                     portconfig,
4022                     codes ? &codes[code_count] : NULL,
4023                     ports,
4024                     shift_ports,
4025                     keys+1,
4026                     code - UCHAR_SHIFT_1 + 1);
4027               }
4028               else
4029               {
4030                  /* not a shifter key; record normally */
4031                  if (codes)
4032                  {
4033                     /* if we have a destination, record the codes used here */
4034                     memcpy((void *) codes[code_count].field, shift_ports, sizeof(shift_ports[0]) * keys);
4035                     codes[code_count].ch = code;
4036                     codes[code_count].field[keys] = field;
4037                  }
3747//-------------------------------------------------
3748//  port_modify - find an existing port and
3749//  modify it
3750//-------------------------------------------------
40383751
4039                  /* increment the count */
4040                  code_count++;
3752void ioport_configurer::port_modify(const char *tag)
3753{
3754   // create the full tag
3755   astring fulltag;
3756   m_owner.subtag(fulltag, tag);
40413757
4042                  if (LOG_INPUTX)
4043                     logerror("inputx: code=%i (%s) port=%p field->name='%s'\n", (int) code, code_point_string(machine, code), port, field->name);
4044               }
4045            }
4046         }
4047      }
4048   }
4049   return code_count;
3758   // find the existing port
3759   m_curport = m_portlist.find(fulltag.cstr());
3760   if (m_curport == NULL)
3761      throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.cstr());
3762   
3763   // bump the modification count, and reset current field/setting
3764   m_curport->m_modcount++;
3765   m_curfield = NULL;
3766   m_cursetting = NULL;
40503767}
40513768
40523769
3770//-------------------------------------------------
3771//  field_alloc - allocate a new field
3772//-------------------------------------------------
40533773
4054/*-------------------------------------------------
4055    build_codes - given an input port table, create
4056    a input code table useful for mapping unicode
4057    chars
4058-------------------------------------------------*/
4059
4060static inputx_code *build_codes(running_machine &machine, const input_port_config *portconfig)
3774void ioport_configurer::field_alloc(ioport_type type, ioport_value defval, ioport_value mask, const char *name)
40613775{
4062   inputx_code *codes = NULL;
4063   const input_port_config *ports[NUM_SIMUL_KEYS];
4064   const input_field_config *fields[NUM_SIMUL_KEYS];
4065   int code_count;
3776   // make sure we have a port
3777   if (m_curport == NULL)
3778      throw emu_fatalerror("alloc_field called with no active port (mask=%X defval=%X)\n", mask, defval); \
40663779
4067   /* first count the number of codes */
4068   code_count = scan_keys(machine, portconfig, NULL, ports, fields, 0, 0);
4069   if (code_count > 0)
4070   {
4071      /* allocate the codes */
4072      codes = auto_alloc_array_clear(machine, inputx_code, code_count + 1);
3780   // append the field
3781   if (type != IPT_UNKNOWN && type != IPT_UNUSED)
3782      m_curport->m_active |= mask;
3783   m_curfield = &m_curport->m_fieldlist.append(*global_alloc(ioport_field(*m_curport, type, defval, mask, string_from_token(name))));
40733784
4074      /* and populate them */
4075      scan_keys(machine, portconfig, codes, ports, fields, 0, 0);
4076   }
4077   return codes;
3785   // reset the current setting
3786   m_cursetting = NULL;
40783787}
40793788
40803789
3790//-------------------------------------------------
3791//  field_add_char - add a character to a field
3792//-------------------------------------------------
40813793
4082/***************************************************************************
4083    VALIDITY CHECKS
4084***************************************************************************/
4085
4086/*-------------------------------------------------
4087    validate_natural_keyboard_statics -
4088    validates natural keyboard static data
4089-------------------------------------------------*/
4090
4091int validate_natural_keyboard_statics(void)
3794void ioport_configurer::field_add_char(unicode_char ch)
40923795{
4093   int i;
4094   int error = FALSE;
4095   unicode_char last_char = 0;
4096   const char_info *ci;
4097
4098   /* check to make sure that charinfo is in order */
4099   for (i = 0; i < ARRAY_LENGTH(charinfo); i++)
4100   {
4101      if (last_char >= charinfo[i].ch)
3796   for (int index = 0; index < ARRAY_LENGTH(m_curfield->m_chars); index++)
3797      if (m_curfield->m_chars[index] == 0)
41023798      {
4103         mame_printf_error("inputx: charinfo is out of order; 0x%08x should be higher than 0x%08x\n", charinfo[i].ch, last_char);
4104         error = TRUE;
3799         m_curfield->m_chars[index] = ch;
3800         break;
41053801      }
4106      last_char = charinfo[i].ch;
4107   }
4108
4109   /* check to make sure that I can look up everything on alternate_charmap */
4110   for (i = 0; i < ARRAY_LENGTH(charinfo); i++)
4111   {
4112      ci = find_charinfo(charinfo[i].ch);
4113      if (ci != &charinfo[i])
4114      {
4115         mame_printf_error("inputx: expected find_charinfo(0x%08x) to work properly\n", charinfo[i].ch);
4116         error = TRUE;
4117      }
4118   }
4119   return error;
41203802}
41213803
41223804
3805//-------------------------------------------------
3806//  field_add_code - add a character to a field
3807//-------------------------------------------------
41233808
4124/***************************************************************************
4125    CORE IMPLEMENTATION
4126***************************************************************************/
3809void ioport_configurer::field_add_code(input_seq_type which, input_code code)
3810{
3811   m_curfield->m_seq[which] |= code;
3812}
41273813
4128static void clear_keybuffer(running_machine &machine)
3814
3815//-------------------------------------------------
3816//  setting_alloc - allocate a new setting
3817//-------------------------------------------------
3818
3819void ioport_configurer::setting_alloc(ioport_value value, const char *name)
41293820{
4130   ioport_manager &portdata = machine.ioport();
4131   portdata.keybuffer.buffer = NULL;
4132   portdata.queue_chars = NULL;
4133   portdata.codes = NULL;
3821   // make sure we have a field
3822   if (m_curfield == NULL)
3823      throw emu_fatalerror("alloc_setting called with no active field (value=%X name=%s)\n", value, name);
3824
3825   // append a new setting
3826   m_curfield->m_settinglist.append(*global_alloc(ioport_setting(*m_curfield, value & m_curfield->mask(), string_from_token(name))));
41343827}
41353828
41363829
3830//-------------------------------------------------
3831//  set_condition - set the condition for either
3832//   the current setting or field
3833//-------------------------------------------------
41373834
4138static void setup_keybuffer(running_machine &machine)
3835void ioport_configurer::set_condition(ioport_condition::condition_t condition, const char *tag, ioport_value mask, ioport_value value)
41393836{
4140   ioport_manager &portdata = machine.ioport();
4141   portdata.inputx_timer = machine.scheduler().timer_alloc(FUNC(inputx_timerproc));
4142   portdata.keybuffer.begin_pos = 0;
4143   portdata.keybuffer.end_pos = 0;
4144   portdata.keybuffer.status_keydown = 0;
4145   portdata.keybuffer.size = KEY_BUFFER_SIZE;
4146   portdata.keybuffer.buffer = auto_alloc_array(machine, unicode_char, portdata.keybuffer.size);
4147   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(clear_keybuffer), &machine));
3837   ioport_condition &target = (m_cursetting != NULL) ? m_cursetting->condition() : m_curfield->condition();
3838   target.set(condition, tag, mask, value);
41483839}
41493840
41503841
3842//-------------------------------------------------
3843//  onoff_alloc - allocate an on/off DIP switch
3844//-------------------------------------------------
41513845
4152void inputx_init(running_machine &machine)
3846void ioport_configurer::onoff_alloc(const char *name, ioport_value defval, ioport_value mask, const char *diplocation)
41533847{
4154   ioport_manager &portdata = machine.ioport();
4155   portdata.inputx_timer = NULL;
4156   portdata.accept_char = NULL;
4157   portdata.charqueue_empty = NULL;
4158   clear_keybuffer(machine);
3848   // allocate a field normally
3849   field_alloc(IPT_DIPSWITCH, defval, mask, name);
41593850
4160   if (machine.debug_flags & DEBUG_FLAG_ENABLED)
3851   // special case service mode
3852   if (name == DEF_STR(Service_Mode))
41613853   {
4162      debug_console_register_command(machine, "input", CMDFLAG_NONE, 0, 1, 1, execute_input);
4163      debug_console_register_command(machine, "dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd);
3854      field_set_toggle();
3855      m_curfield->m_seq[SEQ_TYPE_STANDARD].set(KEYCODE_F2);
41643856   }
3857   
3858   // expand the diplocation
3859   if (diplocation != NULL)
3860      field_set_diplocation(diplocation);
41653861
4166   /* posting keys directly only makes sense for a computer */
4167   if (input_machine_has_keyboard(machine))
3862   // allocate settings
3863   setting_alloc(defval & mask, DEF_STR(Off));
3864   setting_alloc(~defval & mask, DEF_STR(On));
3865}
3866
3867
3868
3869/***************************************************************************
3870    MISCELLANEOUS
3871***************************************************************************/
3872
3873//-------------------------------------------------
3874//  find - look up information about a particular
3875//  character
3876//-------------------------------------------------
3877
3878const char_info *char_info::find(unicode_char target)
3879{
3880   // perform a simple binary search to find the proper alternate
3881   int low = 0;
3882   int high = ARRAY_LENGTH(charinfo);
3883   while (high > low)
41683884   {
4169      portdata.codes = build_codes(machine, machine.ioport().first_port());
4170      setup_keybuffer(machine);
3885      int middle = (high + low) / 2;
3886      unicode_char ch = charinfo[middle].ch;
3887      if (ch < target)
3888         low = middle + 1;
3889      else if (ch > target)
3890         high = middle;
3891      else
3892         return &charinfo[middle];
41713893   }
3894   return NULL;
41723895}
41733896
41743897
3898//-------------------------------------------------
3899//  dynamic_field - constructor
3900//-------------------------------------------------
41753901
4176void inputx_setup_natural_keyboard(
4177   running_machine &machine,
4178   int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len),
4179   int (*accept_char)(running_machine &machine, unicode_char ch),
4180   int (*charqueue_empty)(running_machine &machine))
3902dynamic_field::dynamic_field(ioport_field &field)
3903   : m_next(NULL),
3904     m_field(field),
3905     m_shift(0),
3906     m_oldval(field.defvalue())
41813907{
4182   ioport_manager &portdata = machine.ioport();
4183   portdata.queue_chars = queue_chars;
4184   portdata.accept_char = accept_char;
4185   portdata.charqueue_empty = charqueue_empty;
3908   // fill in the data
3909   for (ioport_value mask = field.mask(); !(mask & 1); mask >>= 1)
3910      m_shift++;
3911   m_oldval >>= m_shift;
41863912}
41873913
4188int inputx_can_post(running_machine &machine)
3914
3915//-------------------------------------------------
3916//  read - read the updated value and merge it
3917//   into the target
3918//-------------------------------------------------
3919
3920void dynamic_field::read(ioport_value &result)
41893921{
4190   ioport_manager &portdata = machine.ioport();
4191   return portdata.queue_chars || portdata.codes;
3922   // skip if not enabled
3923   if (!m_field.enabled())
3924      return;
3925   
3926   // call the callback to read a new value
3927   ioport_value newval = m_field.m_read(m_field, m_field.m_read_param);
3928   m_oldval = newval;
3929   
3930   // merge in the bits (don't invert yet, as all digitals are inverted together)
3931   result = (result & ~m_field.mask()) | ((newval << m_shift) & m_field.mask());
41923932}
41933933
41943934
4195static int can_post_key_directly(running_machine &machine, unicode_char ch)
3935//-------------------------------------------------
3936//  write - track a change to a value and call
3937//   the write callback if there's something new
3938//-------------------------------------------------
3939
3940void dynamic_field::write(ioport_value newval)
41963941{
4197   ioport_manager &portdata = machine.ioport();
4198   int rc = FALSE;
4199   const inputx_code *code;
3942   // skip if not enabled
3943   if (!m_field.enabled())
3944      return;
42003945
4201   if (portdata.queue_chars)
3946   // if the bits have changed, call the handler
3947   newval = ((newval ^ m_field.defvalue()) & m_field.mask()) >> m_shift;
3948   if (m_oldval != newval)
42023949   {
4203      rc = portdata.accept_char ? (*portdata.accept_char)(machine, ch) : TRUE;
3950      m_field.m_write(m_field, m_field.m_write_param, m_oldval, newval);
3951      m_oldval = newval;
42043952   }
4205   else
4206   {
4207      code = find_code(portdata.codes, ch);
4208      if (code)
4209         rc = code->field[0] != NULL;
4210   }
4211   return rc;
42123953}
42133954
42143955
3956//-------------------------------------------------
3957//  analog_field - constructor
3958//-------------------------------------------------
42153959
4216static int can_post_key_alternate(running_machine &machine, unicode_char ch)
3960analog_field::analog_field(ioport_field &field)
3961   : m_next(NULL),
3962     m_field(field),
3963     m_shift(0),
3964     m_adjdefvalue(field.defvalue() & field.mask()),
3965     m_adjmin(field.minval() & field.mask()),
3966     m_adjmax(field.maxval() & field.mask()),
3967     m_sensitivity(field.sensitivity()),
3968     m_reverse(field.analog_reverse()),
3969     m_delta(field.delta()),
3970     m_centerdelta(field.centerdelta()),
3971     m_accum(0),
3972     m_previous(0),
3973     m_previousanalog(0),
3974     m_minimum(INPUT_ABSOLUTE_MIN),
3975     m_maximum(INPUT_ABSOLUTE_MAX),
3976     m_center(0),
3977     m_reverse_val(0),
3978     m_scalepos(0),
3979     m_scaleneg(0),
3980     m_keyscalepos(0),
3981     m_keyscaleneg(0),
3982     m_positionalscale(0),
3983     m_absolute(false),
3984     m_wraps(false),
3985     m_autocenter(false),
3986     m_single_scale(false),
3987     m_interpolate(false),
3988     m_lastdigital(false)
42173989{
4218   const char *s;
4219   const char_info *ci;
4220   unicode_char uchar;
4221   int rc;
3990   // compute the shift amount and number of bits
3991   for (ioport_value mask = field.mask(); !(mask & 1); mask >>= 1)
3992      m_shift++;
42223993
4223   ci = find_charinfo(ch);
4224   s = ci ? ci->alternate : NULL;
4225   if (!s)
4226      return 0;
3994   // initialize core data
3995   m_adjdefvalue >>= m_shift;
3996   m_adjmin >>= m_shift;
3997   m_adjmax >>= m_shift;
42273998
4228   while(*s)
3999   // set basic parameters based on the configured type
4000   switch (field.type())
42294001   {
4230      rc = uchar_from_utf8(&uchar, s, strlen(s));
4231      if (rc <= 0)
4232         return 0;
4233      if (!can_post_key_directly(machine, uchar))
4234         return 0;
4235      s += rc;
4236   }
4237   return 1;
4238}
4002      // paddles and analog joysticks are absolute and autocenter
4003      case IPT_AD_STICK_X:
4004      case IPT_AD_STICK_Y:
4005      case IPT_AD_STICK_Z:
4006      case IPT_PADDLE:
4007      case IPT_PADDLE_V:
4008         m_absolute = true;
4009         m_autocenter = true;
4010         m_interpolate = !field.analog_reset();
4011         break;
42394012
4240static attotime choose_delay(ioport_manager &portdata, unicode_char ch)
4241{
4242   if (portdata.current_rate != attotime::zero)
4243      return portdata.current_rate;
4013      // pedals start at and autocenter to the min range
4014      case IPT_PEDAL:
4015      case IPT_PEDAL2:
4016      case IPT_PEDAL3:
4017         m_center = INPUT_ABSOLUTE_MIN;
4018         m_accum = apply_inverse_sensitivity(m_center);
4019         m_absolute = true;
4020         m_autocenter = true;
4021         m_interpolate = !field.analog_reset();
4022         break;
42444023
4245   attotime delay = attotime::zero;
4246   if (portdata.queue_chars)
4024      // lightguns are absolute as well, but don't autocenter and don't interpolate their values
4025      case IPT_LIGHTGUN_X:
4026      case IPT_LIGHTGUN_Y:
4027         m_absolute = true;
4028         m_autocenter = false;
4029         m_interpolate = false;
4030         break;
4031
4032      // positional devices are absolute, but can also wrap like relative devices
4033      // set each position to be 512 units
4034      case IPT_POSITIONAL:
4035      case IPT_POSITIONAL_V:
4036         m_positionalscale = compute_scale(field.maxval(), INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN);
4037         m_adjmin = 0;
4038         m_adjmax = field.maxval() - 1;
4039         m_wraps = field.analog_wraps();
4040         m_autocenter = !m_wraps;
4041         break;
4042
4043      // dials, mice and trackballs are relative devices
4044      // these have fixed "min" and "max" values based on how many bits are in the port
4045      // in addition, we set the wrap around min/max values to 512 * the min/max values
4046      // this takes into account the mapping that one mouse unit ~= 512 analog units
4047      case IPT_DIAL:
4048      case IPT_DIAL_V:
4049      case IPT_TRACKBALL_X:
4050      case IPT_TRACKBALL_Y:
4051      case IPT_MOUSE_X:
4052      case IPT_MOUSE_Y:
4053         m_absolute = false;
4054         m_wraps = true;
4055         m_interpolate = !field.analog_reset();
4056         break;
4057
4058      default:
4059         fatalerror("Unknown analog port type -- don't know if it is absolute or not");
4060         break;
4061   }
4062
4063   // further processing for absolute controls
4064   if (m_absolute)
42474065   {
4248      /* systems with queue_chars can afford a much smaller delay */
4249      delay = attotime::from_msec(10);
4066      // if the default value is pegged at the min or max, use a single scale value for the whole axis
4067      m_single_scale = (m_adjdefvalue == m_adjmin) || (m_adjdefvalue == m_adjmax);
4068
4069      // if not "single scale", compute separate scales for each side of the default
4070      if (!m_single_scale)
4071      {
4072         // unsigned
4073         m_scalepos = compute_scale(m_adjmax - m_adjdefvalue, INPUT_ABSOLUTE_MAX - 0);
4074         m_scaleneg = compute_scale(m_adjdefvalue - m_adjmin, 0 - INPUT_ABSOLUTE_MIN);
4075
4076         if (m_adjmin > m_adjmax)
4077            m_scaleneg = -m_scaleneg;
4078
4079         // reverse point is at center
4080         m_reverse_val = 0;
4081      }
4082      else
4083      {
4084         // single axis that increases from default
4085         m_scalepos = compute_scale(m_adjmax - m_adjmin, INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN);
4086
4087         // move from default
4088         if (m_adjdefvalue == m_adjmax)
4089            m_scalepos = -m_scalepos;
4090
4091         // make the scaling the same for easier coding when we need to scale
4092         m_scaleneg = m_scalepos;
4093
4094         // reverse point is at max
4095         m_reverse_val = m_maximum;
4096      }
42504097   }
4098
4099   // relative and positional controls all map directly with a 512x scale factor
42514100   else
42524101   {
4253      switch(ch) {
4254      case '\r':
4255         delay = attotime::from_msec(200);
4256         break;
4102      // The relative code is set up to allow specifing PORT_MINMAX and default values.
4103      // The validity checks are purposely set up to not allow you to use anything other
4104      // a default of 0 and PORT_MINMAX(0,mask).  This is in case the need arises to use
4105      // this feature in the future.  Keeping the code in does not hurt anything.
4106      if (m_adjmin > m_adjmax)
4107         // adjust for signed
4108         m_adjmin = -m_adjmin;
42574109
4258      default:
4259         delay = attotime::from_msec(50);
4260         break;
4110      if (m_wraps)
4111         m_adjmax++;
4112
4113      m_minimum = (m_adjmin - m_adjdefvalue) * INPUT_RELATIVE_PER_PIXEL;
4114      m_maximum = (m_adjmax - m_adjdefvalue) * INPUT_RELATIVE_PER_PIXEL;
4115
4116      // make the scaling the same for easier coding when we need to scale
4117      m_scaleneg = m_scalepos = compute_scale(1, INPUT_RELATIVE_PER_PIXEL);
4118
4119      if (m_field.analog_reset())
4120         // delta values reverse from center
4121         m_reverse_val = 0;
4122      else
4123      {
4124         // positional controls reverse from their max range
4125         m_reverse_val = m_maximum + m_minimum;
4126
4127         // relative controls reverse from 1 past their max range
4128         if (m_wraps)
4129            m_reverse_val -= INPUT_RELATIVE_PER_PIXEL;
42614130      }
42624131   }
4263   return delay;
4132
4133   // compute scale for keypresses
4134   m_keyscalepos = recip_scale(m_scalepos);
4135   m_keyscaleneg = recip_scale(m_scaleneg);
42644136}
42654137
42664138
4139//-------------------------------------------------
4140//  apply_min_max - clamp the given input value to
4141//  the appropriate min/max for the analog control
4142//-------------------------------------------------
42674143
4268static void internal_post_key(running_machine &machine, unicode_char ch)
4144inline ioport_value analog_field::apply_min_max(ioport_value value) const
42694145{
4270   ioport_manager &portdata = machine.ioport();
4271   key_buffer *keybuf;
4146   // take the analog minimum and maximum values and apply the inverse of the
4147   // sensitivity so that we can clamp against them before applying sensitivity
4148   INT32 adjmin = apply_inverse_sensitivity(m_minimum);
4149   INT32 adjmax = apply_inverse_sensitivity(m_maximum);
42724150
4273   keybuf = get_buffer(machine);
4274
4275   /* need to start up the timer? */
4276   if (keybuf->begin_pos == keybuf->end_pos)
4151   // for absolute devices, clamp to the bounds absolutely
4152   if (!m_wraps)
42774153   {
4278      portdata.inputx_timer->adjust(choose_delay(portdata, ch));
4279      keybuf->status_keydown = 0;
4154      if (value > adjmax)
4155         value = adjmax;
4156      else if (value < adjmin)
4157         value = adjmin;
42804158   }
42814159
4282   keybuf->buffer[keybuf->end_pos++] = ch;
4283   if ((keybuf->end_pos+1) % keybuf->size == keybuf->begin_pos)
4160   // for relative devices, wrap around when we go past the edge
4161   else
42844162   {
4285      // Buffer full
4286      unicode_char *old_buffer = keybuf->buffer;
4287      keybuf->size = keybuf->size + KEY_BUFFER_SIZE;
4288      keybuf->buffer = auto_alloc_array(machine, unicode_char, keybuf->size);
4289      for( int i = keybuf->begin_pos; i <= keybuf->end_pos; i++ )
4290      {
4291         keybuf->buffer[i] = old_buffer[i];
4292      }
4293      auto_free(machine, old_buffer);
4163      INT32 range = adjmax - adjmin;
4164      // rolls to other end when 1 position past end.
4165      value = (value - adjmin) % range;
4166      if (value < 0)
4167         value += range;
4168      value += adjmin;
42944169   }
4295   keybuf->end_pos %= keybuf->size;
4170
4171   return value;
42964172}
42974173
42984174
4175//-------------------------------------------------
4176//  apply_sensitivity - apply a sensitivity
4177//   adjustment for a current value
4178//-------------------------------------------------
42994179
4300static int buffer_full(running_machine &machine)
4180inline ioport_value analog_field::apply_sensitivity(ioport_value value) const
43014181{
4302   key_buffer *keybuf;
4303   keybuf = get_buffer(machine);
4304   return ((keybuf->end_pos + 1) % keybuf->size) == keybuf->begin_pos;
4182   return INT32((INT64(value) * m_sensitivity) / 100.0 + 0.5);
43054183}
43064184
43074185
4186//-------------------------------------------------
4187//  apply_inverse_sensitivity - reverse-apply the
4188//   sensitivity adjustment for a current value
4189//-------------------------------------------------
43084190
4309static void inputx_postn_rate(running_machine &machine, const unicode_char *text, size_t text_len, attotime rate)
4191inline ioport_value analog_field::apply_inverse_sensitivity(ioport_value value) const
43104192{
4311   ioport_manager &portdata = machine.ioport();
4312   int last_cr = 0;
4313   unicode_char ch;
4314   const char *s;
4315   const char_info *ci;
4316   const inputx_code *code;
4193   return INT32((INT64(value) * 100) / m_sensitivity);
4194}
43174195
4318   portdata.current_rate = rate;
43194196
4320   if (inputx_can_post(machine))
4321   {
4322      while((text_len > 0) && !buffer_full(machine))
4323      {
4324         ch = *(text++);
4325         text_len--;
4197//-------------------------------------------------
4198//  apply_settings - return the value of an
4199//  analog input
4200//-------------------------------------------------
43264201
4327         /* change all eolns to '\r' */
4328         if ((ch != '\n') || !last_cr)
4329         {
4330            if (ch == '\n')
4331               ch = '\r';
4332            else
4333               last_cr = (ch == '\r');
4202ioport_value analog_field::apply_settings(ioport_value value) const
4203{
4204   // apply the min/max and then the sensitivity
4205   value = apply_min_max(value);
4206   value = apply_sensitivity(value);
43344207
4335            if (LOG_INPUTX)
4336            {
4337               code = find_code(portdata.codes, ch);
4338               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>");
4339            }
4208   // apply reversal if needed
4209   if (m_reverse)
4210      value = m_reverse_val - value;
4211   else if (m_single_scale)
4212      // it's a pedal or the default value is equal to min/max
4213      // so we need to adjust the center to the minimum
4214      value -= INPUT_ABSOLUTE_MIN;
43404215
4341            if (can_post_key_directly(machine, ch))
4342            {
4343               /* we can post this key in the queue directly */
4344               internal_post_key(machine, ch);
4345            }
4346            else if (can_post_key_alternate(machine, ch))
4347            {
4348               /* we can post this key with an alternate representation */
4349               ci = find_charinfo(ch);
4350               assert(ci && ci->alternate);
4351               s = ci->alternate;
4352               while(*s)
4353               {
4354                  s += uchar_from_utf8(&ch, s, strlen(s));
4355                  internal_post_key(machine, ch);
4356               }
4357            }
4358         }
4359         else
4360         {
4361            last_cr = 0;
4362         }
4363      }
4364   }
4216   // map differently for positive and negative values
4217   if (value >= 0)
4218      value = apply_scale(value, m_scalepos);
4219   else
4220      value = apply_scale(value, m_scaleneg);
4221   value += m_adjdefvalue;
4222
4223   return value;
43654224}
43664225
43674226
4227//-------------------------------------------------
4228//  frame_update - update the internals of a
4229//  single analog field periodically
4230//-------------------------------------------------
43684231
4369static TIMER_CALLBACK(inputx_timerproc)
4232void analog_field::frame_update(running_machine &machine)
43704233{
4371   ioport_manager &portdata = machine.ioport();
4372   key_buffer *keybuf;
4373   attotime delay;
4234   // clamp the previous value to the min/max range and remember it
4235   m_previous = m_accum = apply_min_max(m_accum);
43744236
4375   keybuf = get_buffer(machine);
4237   // get the new raw analog value and its type
4238   input_item_class itemclass;
4239   INT32 rawvalue = machine.input().seq_axis_value(m_field.seq(SEQ_TYPE_STANDARD), itemclass);
43764240
4377   if (portdata.queue_chars)
4241   // if we got an absolute input, it overrides everything else
4242   if (itemclass == ITEM_CLASS_ABSOLUTE)
43784243   {
4379      /* the driver has a queue_chars handler */
4380      while((keybuf->begin_pos != keybuf->end_pos) && (*portdata.queue_chars)(machine, &keybuf->buffer[keybuf->begin_pos], 1))
4244      if (m_previousanalog != rawvalue)
43814245      {
4382         keybuf->begin_pos++;
4383         keybuf->begin_pos %= keybuf->size;
4246         // only update if analog value changed
4247         m_previousanalog = rawvalue;
43844248
4385         if (portdata.current_rate != attotime::zero)
4386            break;
4249         // apply the inverse of the sensitivity to the raw value so that
4250         // it will still cover the full min->max range requested after
4251         // we apply the sensitivity adjustment
4252         if (m_absolute || m_field.analog_reset())
4253         {
4254            // if port is absolute, then just return the absolute data supplied
4255            m_accum = apply_inverse_sensitivity(rawvalue);
4256         }
4257         else if (m_positionalscale != 0)
4258         {
4259            // if port is positional, we will take the full analog control and divide it
4260            // into positions, that way as the control is moved full scale,
4261            // it moves through all the positions
4262            rawvalue = apply_scale(rawvalue - INPUT_ABSOLUTE_MIN, m_positionalscale) * INPUT_RELATIVE_PER_PIXEL + m_minimum;
4263
4264            // clamp the high value so it does not roll over
4265            rawvalue = MIN(rawvalue, m_maximum);
4266            m_accum = apply_inverse_sensitivity(rawvalue);
4267         }
4268         else
4269            // if port is relative, we use the value to simulate the speed of relative movement
4270            // sensitivity adjustment is allowed for this mode
4271            m_accum += rawvalue;
4272
4273         m_lastdigital = false;
4274         // do not bother with other control types if the analog data is changing
4275         return;
43874276      }
4388   }
4389   else
4390   {
4391      /* the driver does not have a queue_chars handler */
4392      if (keybuf->status_keydown)
4393      {
4394         keybuf->status_keydown = FALSE;
4395         keybuf->begin_pos++;
4396         keybuf->begin_pos %= keybuf->size;
4397      }
43984277      else
43994278      {
4400         keybuf->status_keydown = TRUE;
4279         // we still have to update fake relative from joystick control
4280         if (!m_absolute && m_positionalscale == 0)
4281            m_accum += rawvalue;
44014282      }
44024283   }
44034284
4404   /* need to make sure timerproc is called again if buffer not empty */
4405   if (keybuf->begin_pos != keybuf->end_pos)
4285   // if we got it from a relative device, use that as the starting delta
4286   // also note that the last input was not a digital one
4287   INT32 delta = 0;
4288   if (itemclass == ITEM_CLASS_RELATIVE && rawvalue != 0)
44064289   {
4407      delay = choose_delay(portdata, keybuf->buffer[keybuf->begin_pos]);
4408      portdata.inputx_timer->adjust(delay);
4290      delta = rawvalue;
4291      m_lastdigital = false;
44094292   }
4410}
44114293
4412int inputx_is_posting(running_machine &machine)
4413{
4414   ioport_manager &portdata = machine.ioport();
4415   const key_buffer *keybuf;
4416   keybuf = get_buffer(machine);
4417   return (keybuf->begin_pos != keybuf->end_pos) || (portdata.charqueue_empty && !(*portdata.charqueue_empty)(machine));
4418}
4294   INT64 keyscale = (m_accum >= 0) ? m_keyscalepos : m_keyscaleneg;
44194295
4420/***************************************************************************
4296   // if the decrement code sequence is pressed, add the key delta to
4297   // the accumulated delta; also note that the last input was a digital one
4298   bool keypressed = false;
4299   if (machine.input().seq_pressed(m_field.seq(SEQ_TYPE_DECREMENT)))
4300   {
4301      keypressed = true;
4302      if (m_delta != 0)
4303         delta -= apply_scale(m_delta, keyscale);
4304      else if (!m_lastdigital)
4305         // decrement only once when first pressed
4306         delta -= apply_scale(1, keyscale);
4307      m_lastdigital = true;
4308   }
44214309
4422    Coded input
4310   // same for the increment code sequence
4311   if (machine.input().seq_pressed(m_field.seq(SEQ_TYPE_INCREMENT)))
4312   {
4313      keypressed = true;
4314      if (m_delta)
4315         delta += apply_scale(m_delta, keyscale);
4316      else if (!m_lastdigital)
4317         // increment only once when first pressed
4318         delta += apply_scale(1, keyscale);
4319      m_lastdigital = true;
4320   }
44234321
4424***************************************************************************/
4425static void inputx_postc_rate(running_machine &machine, unicode_char ch, attotime rate);
4322   // if resetting is requested, clear the accumulated position to 0 before
4323   // applying the deltas so that we only return this frame's delta
4324   // note that centering only works for relative controls
4325   // no need to check if absolute here because it is checked by the validity tests
4326   if (m_field.analog_reset())
4327      m_accum = 0;
44264328
4427static void inputx_postn_coded_rate(running_machine &machine, const char *text, size_t text_len, attotime rate)
4428{
4429   size_t i, j, key_len, increment;
4430   unicode_char ch;
4329   // apply the delta to the accumulated value
4330   m_accum += delta;
44314331
4432   static const struct
4332   // if our last movement was due to a digital input, and if this control
4333   // type autocenters, and if neither the increment nor the decrement seq
4334   // was pressed, apply autocentering
4335   if (m_autocenter)
44334336   {
4434      const char *key;
4435      unicode_char code;
4436   } codes[] =
4437   {
4438      { "BACKSPACE",   8 },
4439      { "BS",         8 },
4440      { "BKSP",      8 },
4441      { "DEL",      UCHAR_MAMEKEY(DEL) },
4442      { "DELETE",      UCHAR_MAMEKEY(DEL) },
4443      { "END",      UCHAR_MAMEKEY(END) },
4444      { "ENTER",      13 },
4445      { "ESC",      '\033' },
4446      { "HOME",      UCHAR_MAMEKEY(HOME) },
4447      { "INS",      UCHAR_MAMEKEY(INSERT) },
4448      { "INSERT",      UCHAR_MAMEKEY(INSERT) },
4449      { "PGDN",      UCHAR_MAMEKEY(PGDN) },
4450      { "PGUP",      UCHAR_MAMEKEY(PGUP) },
4451      { "SPACE",      32 },
4452      { "TAB",      9 },
4453      { "F1",         UCHAR_MAMEKEY(F1) },
4454      { "F2",         UCHAR_MAMEKEY(F2) },
4455      { "F3",         UCHAR_MAMEKEY(F3) },
4456      { "F4",         UCHAR_MAMEKEY(F4) },
4457      { "F5",         UCHAR_MAMEKEY(F5) },
4458      { "F6",         UCHAR_MAMEKEY(F6) },
4459      { "F7",         UCHAR_MAMEKEY(F7) },
4460      { "F8",         UCHAR_MAMEKEY(F8) },
4461      { "F9",         UCHAR_MAMEKEY(F9) },
4462      { "F10",      UCHAR_MAMEKEY(F10) },
4463      { "F11",      UCHAR_MAMEKEY(F11) },
4464      { "F12",      UCHAR_MAMEKEY(F12) },
4465      { "QUOTE",      '\"' }
4466   };
4467
4468   i = 0;
4469   while(i < text_len)
4470   {
4471      ch = text[i];
4472      increment = 1;
4473
4474      if (ch == '{')
4337      INT32 center = apply_inverse_sensitivity(m_center);
4338      if (m_lastdigital && !keypressed)
44754339      {
4476         for (j = 0; j < ARRAY_LENGTH(codes); j++)
4340         // autocenter from positive values
4341         if (m_accum >= center)
44774342         {
4478            key_len = strlen(codes[j].key);
4479            if (i + key_len + 2 <= text_len)
4343            m_accum -= apply_scale(m_centerdelta, m_keyscalepos);
4344            if (m_accum < center)
44804345            {
4481               if (!core_strnicmp(codes[j].key, &text[i + 1], key_len) && (text[i + key_len + 1] == '}'))
4482               {
4483                  ch = codes[j].code;
4484                  increment = key_len + 2;
4485               }
4346               m_accum = center;
4347               m_lastdigital = false;
44864348            }
44874349         }
4488      }
44894350
4490      if (ch)
4491         inputx_postc_rate(machine, ch, rate);
4492      i += increment;
4493   }
4494}
4495
4496
4497
4498/***************************************************************************
4499
4500    Alternative calls
4501
4502***************************************************************************/
4503
4504static void inputx_postc_rate(running_machine &machine, unicode_char ch, attotime rate)
4505{
4506   inputx_postn_rate(machine, &ch, 1, rate);
4507}
4508
4509void inputx_postc(running_machine &machine, unicode_char ch)
4510{
4511   inputx_postc_rate(machine, ch, attotime::zero);
4512}
4513
4514static void inputx_postn_utf8_rate(running_machine &machine, const char *text, size_t text_len, attotime rate)
4515{
4516   size_t len = 0;
4517   unicode_char buf[256];
4518   unicode_char c;
4519   int rc;
4520
4521   while(text_len > 0)
4522   {
4523      if (len == ARRAY_LENGTH(buf))
4524      {
4525         inputx_postn_rate(machine, buf, len, attotime::zero);
4526         len = 0;
4351         // autocenter from negative values
4352         else
4353         {
4354            m_accum += apply_scale(m_centerdelta, m_keyscaleneg);
4355            if (m_accum > center)
4356            {
4357               m_accum = center;
4358               m_lastdigital = false;
4359            }
4360         }
45274361      }
4528
4529      rc = uchar_from_utf8(&c, text, text_len);
4530      if (rc < 0)
4531      {
4532         rc = 1;
4533         c = INVALID_CHAR;
4534      }
4535      text += rc;
4536      text_len -= rc;
4537      buf[len++] = c;
45384362   }
4539   inputx_postn_rate(machine, buf, len, rate);
4363   else if (!keypressed)
4364      m_lastdigital = false;
45404365}
45414366
4542void inputx_post_utf8(running_machine &machine, const char *text)
4543{
4544   inputx_postn_utf8_rate(machine, text, strlen(text), attotime::zero);
4545}
45464367
4547void inputx_post_utf8_rate(running_machine &machine, const char *text, attotime rate)
4548{
4549   inputx_postn_utf8_rate(machine, text, strlen(text), rate);
4550}
4368//-------------------------------------------------
4369//  read - read the current value and insert into
4370//   the provided ioport_value
4371//-------------------------------------------------
45514372
4552/***************************************************************************
4553
4554    Other stuff
4555
4556    This stuff is here more out of convienience than anything else
4557***************************************************************************/
4558
4559int input_classify_port(const input_field_config *field)
4373void analog_field::read(ioport_value &result)
45604374{
4561   int result;
4375   // do nothing if we're not enabled
4376   if (!m_field.enabled())
4377      return;
45624378
4563   switch(field->type)
4564   {
4565      case IPT_JOYSTICK_UP:
4566      case IPT_JOYSTICK_DOWN:
4567      case IPT_JOYSTICK_LEFT:
4568      case IPT_JOYSTICK_RIGHT:
4569      case IPT_JOYSTICKLEFT_UP:
4570      case IPT_JOYSTICKLEFT_DOWN:
4571      case IPT_JOYSTICKLEFT_LEFT:
4572      case IPT_JOYSTICKLEFT_RIGHT:
4573      case IPT_JOYSTICKRIGHT_UP:
4574      case IPT_JOYSTICKRIGHT_DOWN:
4575      case IPT_JOYSTICKRIGHT_LEFT:
4576      case IPT_JOYSTICKRIGHT_RIGHT:
4577      case IPT_BUTTON1:
4578      case IPT_BUTTON2:
4579      case IPT_BUTTON3:
4580      case IPT_BUTTON4:
4581      case IPT_BUTTON5:
4582      case IPT_BUTTON6:
4583      case IPT_BUTTON7:
4584      case IPT_BUTTON8:
4585      case IPT_BUTTON9:
4586      case IPT_BUTTON10:
4587      case IPT_AD_STICK_X:
4588      case IPT_AD_STICK_Y:
4589      case IPT_AD_STICK_Z:
4590      case IPT_TRACKBALL_X:
4591      case IPT_TRACKBALL_Y:
4592      case IPT_LIGHTGUN_X:
4593      case IPT_LIGHTGUN_Y:
4594      case IPT_MOUSE_X:
4595      case IPT_MOUSE_Y:
4596      case IPT_START:
4597      case IPT_SELECT:
4598         result = INPUT_CLASS_CONTROLLER;
4599         break;
4379   // start with the raw value
4380   INT32 value = m_accum;
46004381
4601      case IPT_KEYPAD:
4602      case IPT_KEYBOARD:
4603         result = INPUT_CLASS_KEYBOARD;
4604         break;
4382   // interpolate if appropriate and if time has passed since the last update
4383   if (m_interpolate)
4384      value = manager().frame_interpolate(m_previous, m_accum);
46054385
4606      case IPT_CONFIG:
4607         result = INPUT_CLASS_CONFIG;
4608         break;
4386   // apply standard analog settings
4387   value = apply_settings(value);
46094388
4610      case IPT_DIPSWITCH:
4611         result = INPUT_CLASS_DIPSWITCH;
4612         break;
4389   // remap the value if needed
4390   if (m_field.remap_table() != NULL)
4391      value = m_field.remap_table()[value];
46134392
4614      case 0:
4615         if (field->name && (field->name != (const char *) -1))
4616            result = INPUT_CLASS_MISC;
4617         else
4618            result = INPUT_CLASS_INTERNAL;
4619         break;
4393   // invert bits if needed
4394   if (m_field.analog_invert())
4395      value = ~value;
46204396
4621      default:
4622         result = INPUT_CLASS_INTERNAL;
4623         break;
4624   }
4625   return result;
4397   // insert into the port
4398   result = (result & ~m_field.mask()) | ((value << m_shift) & m_field.mask());
46264399}
46274400
46284401
4402//-------------------------------------------------
4403//  crosshair_read - read a value for crosshairs,
4404//   scaled between 0 and 1
4405//-------------------------------------------------
46294406
4630int input_player_number(const input_field_config *port)
4407float analog_field::crosshair_read()
46314408{
4632   return port->player;
4409   INT32 rawvalue = apply_settings(m_accum) & (m_field.mask() >> m_shift);
4410   return float(rawvalue - m_adjmin) / float(m_adjmax - m_adjmin);
46334411}
46344412
46354413
46364414
4637/*-------------------------------------------------
4638    input_has_input_class - checks to see if a
4639    particular input class is present
4640-------------------------------------------------*/
4415/***************************************************************************
4416    TOKENIZATION HELPERS
4417***************************************************************************/
46414418
4642int input_has_input_class(running_machine &machine, int inputclass)
4419//-------------------------------------------------
4420//  token_to_input_type - convert a string token
4421//  to an input field type and player
4422//-------------------------------------------------
4423
4424ioport_type ioport_manager::token_to_input_type(const char *string, int &player) const
46434425{
4644   const input_port_config *port;
4645   const input_field_config *field;
4426   // check for our failsafe case first
4427   int ipnum;
4428   if (sscanf(string, "TYPE_OTHER(%d,%d)", &ipnum, &player) == 2)
4429      return ioport_type(ipnum);
46464430
4647   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
4648   {
4649      for (field = port->first_field(); field != NULL; field = field->next())
4431   // find the token in the list
4432   for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
4433      if (entry->token() != NULL && !strcmp(entry->token(), string))
46504434      {
4651         if (input_classify_port(field) == inputclass)
4652            return TRUE;
4435         player = entry->player();
4436         return entry->type();
46534437      }
4654   }
4655   return FALSE;
4438
4439   // if we fail, return IPT_UNKNOWN
4440   player = 0;
4441   return IPT_UNKNOWN;
46564442}
46574443
46584444
4445//-------------------------------------------------
4446//  input_type_to_token - convert an input field
4447//  type and player to a string token
4448//-------------------------------------------------
46594449
4660/*-------------------------------------------------
4661    input_count_players - counts the number of
4662    active players
4663-------------------------------------------------*/
4664
4665int input_count_players(running_machine &machine)
4450const char *ioport_manager::input_type_to_token(astring &string, ioport_type type, int player)
46664451{
4667   const input_port_config *port;
4668   const input_field_config *field;
4669   int joystick_count;
4452   // look up the port and return the token
4453   input_type_entry *entry = m_type_to_entry[type][player];
4454   if (entry != NULL)
4455      return string.cpy(entry->token());
46704456
4671   joystick_count = 0;
4672   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
4673   {
4674      for (field = port->first_field(); field != NULL; field = field->next())
4675      {
4676         if (input_classify_port(field) == INPUT_CLASS_CONTROLLER)
4677         {
4678            if (joystick_count <= field->player + 1)
4679               joystick_count = field->player + 1;
4680         }
4681      }
4682   }
4683   return joystick_count;
4457   // if that fails, carry on
4458   return string.format("TYPE_OTHER(%d,%d)", type, player);
46844459}
46854460
46864461
4462//-------------------------------------------------
4463//  token_to_seq_type - convert a string to
4464//  a sequence type
4465//-------------------------------------------------
46874466
4688/***************************************************************************
4689    DEBUGGER SUPPORT
4690***************************************************************************/
4691
4692/*-------------------------------------------------
4693    execute_input - debugger command to enter
4694    natural keyboard input
4695-------------------------------------------------*/
4696
4697static void execute_input(running_machine &machine, int ref, int params, const char *param[])
4467input_seq_type ioport_manager::token_to_seq_type(const char *string)
46984468{
4699   inputx_postn_coded_rate(machine, param[0], strlen(param[0]), attotime::zero);
4469   // look up the string in the table of possible sequence types and return the index
4470   for (int seqindex = 0; seqindex < ARRAY_LENGTH(seqtypestrings); seqindex++)
4471      if (!mame_stricmp(string, seqtypestrings[seqindex]))
4472         return input_seq_type(seqindex);
4473   return SEQ_TYPE_INVALID;
47004474}
47014475
47024476
47034477
4704/*-------------------------------------------------
4705    execute_dumpkbd - debugger command to natural
4706    keyboard codes
4707-------------------------------------------------*/
4478//-------------------------------------------------
4479//  validate_natural_keyboard_statics -
4480//  validates natural keyboard static data
4481//-------------------------------------------------
47084482
4709static void execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[])
4483/*
4484int validate_natural_keyboard_statics(void)
47104485{
4711   inputx_code *codes = machine.ioport().codes;
4712   const char *filename;
4713   FILE *file = NULL;
4714   const inputx_code *code;
4715   char buffer[512];
4716   size_t pos;
4717   int i, j;
4718   size_t left_column_width = 24;
4486   int i;
4487   int error = FALSE;
4488   unicode_char last_char = 0;
4489   const char_info *ci;
47194490
4720   /* was there a file specified? */
4721   filename = (params > 0) ? param[0] : NULL;
4722   if (filename != NULL)
4491   // check to make sure that charinfo is in order
4492   for (i = 0; i < ARRAY_LENGTH(charinfo); i++)
47234493   {
4724      /* if so, open it */
4725      file = fopen(filename, "w");
4726      if (file == NULL)
4494      if (last_char >= charinfo[i].ch)
47274495      {
4728         debug_console_printf(machine, "Cannot open \"%s\"\n", filename);
4729         return;
4496         mame_printf_error("inputx: charinfo is out of order; 0x%08x should be higher than 0x%08x\n", charinfo[i].ch, last_char);
4497         error = TRUE;
47304498      }
4499      last_char = charinfo[i].ch;
47314500   }
47324501
4733   if ((codes != NULL) && (codes[0].ch != 0))
4502   // check to make sure that I can look up everything on alternate_charmap
4503   for (i = 0; i < ARRAY_LENGTH(charinfo); i++)
47344504   {
4735      /* loop through all codes */
4736      for (i = 0; codes[i].ch; i++)
4505      ci = char_info::find(charinfo[i].ch);
4506      if (ci != &charinfo[i])
47374507      {
4738         code = &codes[i];
4739         pos = 0;
4740
4741         /* describe the character code */
4742         pos += snprintf(&buffer[pos], ARRAY_LENGTH(buffer) - pos, "%08X (%s) ",
4743            code->ch,
4744            code_point_string(machine, code->ch));
4745
4746         /* pad with spaces */
4747         while(pos < left_column_width)
4748            buffer[pos++] = ' ';
4749         buffer[pos] = '\0';
4750
4751         /* identify the keys used */
4752         for (j = 0; j < ARRAY_LENGTH(code->field) && (code->field[j] != NULL); j++)
4753         {
4754            pos += snprintf(&buffer[pos], ARRAY_LENGTH(buffer) - pos, "%s'%s'",
4755               (j > 0) ? ", " : "",
4756               code->field[j]->name);
4757         }
4758
4759         /* and output it as appropriate */
4760         if (file != NULL)
4761            fprintf(file, "%s\n", buffer);
4762         else
4763            debug_console_printf(machine, "%s\n", buffer);
4508         mame_printf_error("ioport: expected char_info::find(0x%08x) to work properly\n", charinfo[i].ch);
4509         error = TRUE;
47644510      }
47654511   }
4766   else
4767   {
4768      debug_console_printf(machine, "No natural keyboard support\n");
4769   }
4770
4771   /* cleanup */
4772   if (file != NULL)
4773      fclose(file);
4774
4512   return error;
47754513}
4514*/
47764515
47774516
4778
4779input_port_config *ioconfig_alloc_port(ioport_list &portlist, device_t &device, const char *tag)
4780{
4781   astring fulltag;
4782   device.subtag(fulltag, tag);
4783   return &portlist.append(fulltag, *global_alloc(input_port_config(device, fulltag)));
4784}
4785
4786input_port_config *ioconfig_modify_port(ioport_list &portlist, device_t &device, const char *tag)
4787{
4788   astring fulltag;
4789   device.subtag(fulltag, tag);
4790   input_port_config *port = portlist.find(fulltag.cstr());
4791   if (port == NULL)
4792      throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.cstr());
4793   port->bump_modcount();
4794   return port;
4795}
4796
4797input_field_config *ioconfig_alloc_field(input_port_config &port, int type, input_port_value defval, input_port_value mask, const char *name)
4798{
4799   if (&port == NULL)
4800      throw emu_fatalerror("INPUT_TOKEN_FIELD encountered with no active port (mask=%X defval=%X)\n", mask, defval); \
4801   if (type != IPT_UNKNOWN && type != IPT_UNUSED)
4802      port.active |= mask;
4803   if (type == IPT_DIPSWITCH || type == IPT_CONFIG)
4804      defval = port_default_value(port.tag(), mask, defval, port.owner());
4805   return &port.fieldlist().append(*global_alloc(input_field_config(port, type, defval, mask, input_port_string_from_token(name))));
4806}
4807
4808input_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)
4809{
4810   input_field_config *curfield = ioconfig_alloc_field(port, IPT_DIPSWITCH, defval, mask, name);
4811   if (name == DEF_STR(Service_Mode))
4812   {
4813      curfield->flags |= FIELD_FLAG_TOGGLE;
4814      curfield->seq[SEQ_TYPE_STANDARD].set(KEYCODE_F2);
4815   }
4816   if (diplocation != NULL)
4817      diplocation_list_alloc(*curfield, diplocation, errorbuf);
4818   ioconfig_alloc_setting(*curfield, defval & mask, DEF_STR(Off));
4819   ioconfig_alloc_setting(*curfield, ~defval & mask, DEF_STR(On));
4820   return curfield;
4821}
4822
4823input_setting_config *ioconfig_alloc_setting(input_field_config &field, input_port_value value, const char *name)
4824{
4825   return &field.settinglist().append(*global_alloc(input_setting_config(field, value, input_port_string_from_token(name))));
4826}
4827
4828void ioconfig_field_add_char(input_field_config &field, unicode_char ch, astring &errorbuf)
4829{
4830   for (int index = 0; index < ARRAY_LENGTH(field.chars); index++)
4831      if (field.chars[index] == 0)
4832      {
4833         field.chars[index] = ch;
4834         break;
4835      }
4836}
4837
4838void ioconfig_add_code(input_field_config &field, int which, input_code code)
4839{
4840   field.seq[which] |= code;
4841}
4842
4843
4844
4845input_type_entry::input_type_entry(UINT32 _type, ioport_group _group, int _player, const char *_token, const char *_name, input_seq standard)
4846   : type(_type),
4847     group(_group),
4848     player(_player),
4849     token(_token),
4850     name(_name),
4851     m_next(NULL)
4852{
4853   defseq[SEQ_TYPE_STANDARD] = seq[SEQ_TYPE_STANDARD] = standard;
4854}
4855
4856input_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)
4857   : type(_type),
4858     group(_group),
4859     player(_player),
4860     token(_token),
4861     name(_name),
4862     m_next(NULL)
4863{
4864   defseq[SEQ_TYPE_STANDARD] = seq[SEQ_TYPE_STANDARD] = standard;
4865   defseq[SEQ_TYPE_INCREMENT] = seq[SEQ_TYPE_INCREMENT] = increment;
4866   defseq[SEQ_TYPE_DECREMENT] = seq[SEQ_TYPE_DECREMENT] = decrement;
4867}
src/emu/ui.c
r15082r15083
935935         string.cat(" have not been correctly dumped.\n");
936936      }
937937      /* add one line per warning flag */
938      if (input_machine_has_keyboard(machine))
938      if (machine.ioport().has_keyboard())
939939         string.cat("The keyboard emulation may not be 100% accurate.\n");
940940      if (machine.system().flags & GAME_IMPERFECT_COLORS)
941941         string.cat("The colors aren't 100% accurate.\n");
r15082r15083
12131213   {
12141214      /* if this was a UI_EVENT_CHAR event, post it */
12151215      if (event.event_type == UI_EVENT_CHAR)
1216         inputx_postc(machine, event.ch);
1216         machine.ioport().natkeyboard().post(event.ch);
12171217   }
12181218
12191219   /* process natural keyboard keys that don't get UI_EVENT_CHARs */
r15082r15083
12361236         *key_down_ptr |= key_down_mask;
12371237
12381238         /* post the key */
1239         inputx_postc(machine, UCHAR_MAMEKEY_BEGIN + code.item_id());
1239         machine.ioport().natkeyboard().post(UCHAR_MAMEKEY_BEGIN + code.item_id());
12401240      }
12411241      else if (!pressed && (*key_down_ptr & key_down_mask))
12421242      {
r15082r15083
12591259   if (text != NULL)
12601260   {
12611261      /* post the text */
1262      inputx_post_utf8(machine, text);
1262      machine.ioport().natkeyboard().post_utf8(text);
12631263
12641264      /* free the string */
12651265      osd_free(text);
r15082r15083
13171317   }
13181318
13191319   /* determine if we should disable the rest of the UI */
1320   int ui_disabled = (input_machine_has_keyboard(machine) && !machine.ui_active());
1320   int ui_disabled = (machine.ioport().has_keyboard() && !machine.ui_active());
13211321
13221322   /* is ScrLk UI toggling applicable here? */
1323   if (input_machine_has_keyboard(machine))
1323   if (machine.ioport().has_keyboard())
13241324   {
13251325      /* are we toggling the UI with ScrLk? */
13261326      if (ui_input_pressed(machine, IPT_UI_TOGGLE_UI))
r15082r15083
14881488      machine.video().set_throttled(!machine.video().throttled());
14891489
14901490   /* check for fast forward */
1491   if (input_type_pressed(machine, IPT_UI_FAST_FORWARD, 0))
1491   if (machine.ioport().type_pressed(IPT_UI_FAST_FORWARD))
14921492   {
14931493      machine.video().set_fastforward(true);
14941494      ui_show_fps_temp(0.5);
r15082r15083
16401640
16411641static slider_state *slider_init(running_machine &machine)
16421642{
1643   input_field_config *field;
1644   input_port_config *port;
1643   ioport_field *field;
1644   ioport_port *port;
16451645   slider_state *listhead = NULL;
16461646   slider_state **tailptr = &listhead;
16471647   astring string;
r15082r15083
16661666
16671667   /* add analog adjusters */
16681668   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
1669      for (field = port->fieldlist().first(); field != NULL; field = field->next())
1670         if (field->type == IPT_ADJUSTER)
1669      for (field = port->first_field(); field != NULL; field = field->next())
1670         if (field->type() == IPT_ADJUSTER)
16711671         {
16721672            void *param = (void *)field;
1673            *tailptr = slider_alloc(machine, field->name, 0, field->defvalue, 100, 1, slider_adjuster, param);
1673            *tailptr = slider_alloc(machine, field->name(), 0, field->defvalue(), 100, 1, slider_adjuster, param);
16741674            tailptr = &(*tailptr)->next;
16751675         }
16761676
r15082r15083
17721772#ifdef MAME_DEBUG
17731773   /* add crosshair adjusters */
17741774   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
1775      for (field = port->fieldlist().first(); field != NULL; field = field->next())
1776         if (field->crossaxis != CROSSHAIR_AXIS_NONE && field->player == 0)
1775      for (field = port->first_field(); field != NULL; field = field->next())
1776         if (field->crosshair_axis() != CROSSHAIR_AXIS_NONE && field->player() == 0)
17771777         {
17781778            void *param = (void *)field;
1779            string.printf("Crosshair Scale %s", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y");
1779            string.printf("Crosshair Scale %s", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y");
17801780            *tailptr = slider_alloc(machine, string, -3000, 1000, 3000, 100, slider_crossscale, param);
17811781            tailptr = &(*tailptr)->next;
1782            string.printf("Crosshair Offset %s", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y");
1782            string.printf("Crosshair Offset %s", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y");
17831783            *tailptr = slider_alloc(machine, string, -3000, 0, 3000, 100, slider_crossoffset, param);
17841784            tailptr = &(*tailptr)->next;
17851785         }
r15082r15083
18321832
18331833static INT32 slider_adjuster(running_machine &machine, void *arg, astring *string, INT32 newval)
18341834{
1835   const input_field_config *field = (const input_field_config *)arg;
1836   input_field_user_settings settings;
1835   ioport_field *field = (ioport_field *)arg;
1836   ioport_field::user_settings settings;
18371837
1838   input_field_get_user_settings(field, &settings);
1838   field->get_user_settings(settings);
18391839   if (newval != SLIDER_NOCHANGE)
18401840   {
18411841      settings.value = newval;
1842      input_field_set_user_settings(field, &settings);
1842      field->set_user_settings(settings);
18431843   }
18441844   if (string != NULL)
18451845      string->printf("%d%%", settings.value);
r15082r15083
21852185#ifdef MAME_DEBUG
21862186static INT32 slider_crossscale(running_machine &machine, void *arg, astring *string, INT32 newval)
21872187{
2188   input_field_config *field = (input_field_config *)arg;
2188   ioport_field *field = (ioport_field *)arg;
21892189
21902190   if (newval != SLIDER_NOCHANGE)
2191      field->crossscale = (float)newval * 0.001f;
2191      field->set_crosshair_scale(float(newval) * 0.001);
21922192   if (string != NULL)
2193      string->printf("%s %s %1.3f", "Crosshair Scale", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y", (float)newval * 0.001f);
2194   return floor(field->crossscale * 1000.0f + 0.5f);
2193      string->printf("%s %s %1.3f", "Crosshair Scale", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
2194   return floor(field->crosshair_scale() * 1000.0f + 0.5f);
21952195}
21962196#endif
21972197
r15082r15083
22042204#ifdef MAME_DEBUG
22052205static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
22062206{
2207   input_field_config *field = (input_field_config *)arg;
2207   ioport_field *field = (ioport_field *)arg;
22082208
22092209   if (newval != SLIDER_NOCHANGE)
2210      field->crossoffset = (float)newval * 0.001f;
2210      field->set_crosshair_offset(float(newval) * 0.001f);
22112211   if (string != NULL)
2212      string->printf("%s %s %1.3f", "Crosshair Offset", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y", (float)newval * 0.001f);
2213   return field->crossoffset;
2212      string->printf("%s %s %1.3f", "Crosshair Offset", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
2213   return field->crosshair_offset();
22142214}
22152215#endif
22162216
src/emu/crsshair.c
r15082r15083
221221   global.auto_time = CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT;
222222
223223   /* determine who needs crosshairs */
224   for (input_port_config *port = machine.ioport().first_port(); port != NULL; port = port->next())
225      for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
226         if (field->crossaxis != CROSSHAIR_AXIS_NONE)
224   for (ioport_port *port = machine.ioport().first_port(); port != NULL; port = port->next())
225      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
226         if (field->crosshair_axis() != CROSSHAIR_AXIS_NONE)
227227         {
228            int player = field->player;
228            int player = field->player();
229229
230230            assert(player < MAX_PLAYERS);
231231
r15082r15083
347347   {
348348      /* read all the lightgun values */
349349      if (global.used[player])
350         input_port_get_crosshair_position(device.machine(), player, &global.x[player], &global.y[player]);
350         device.machine().ioport().crosshair_position(player, global.x[player], global.y[player]);
351351
352352      /* auto visibility */
353353      if (global.mode[player] == CROSSHAIR_VISIBILITY_AUTO)
src/emu/ioport.h
r15082r15083
44
55    Input/output port handling.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
r15082r15083
2149#include <time.h>
2250
2351
52//**************************************************************************
53//  CONSTANTS
54//**************************************************************************
2455
25/***************************************************************************
26    CONSTANTS
27***************************************************************************/
56// input ports support up to 32 bits each
57typedef UINT32 ioport_value;
2858
29#define MAX_PLAYERS         8
59// active high/low values for input ports
60const ioport_value IP_ACTIVE_HIGH = 0x00000000;
61const ioport_value IP_ACTIVE_LOW = 0xffffffff;
3062
31#define IP_ACTIVE_HIGH      0x00000000
32#define IP_ACTIVE_LOW      0xffffffff
63// maximum number of players supported
64const int MAX_PLAYERS = 8;
3365
66// INP file parameters
67const UINT32 INP_HEADER_SIZE = 64;
68const UINT32 INP_HEADER_MAJVERSION = 3;
69const UINT32 INP_HEADER_MINVERSION = 0;
3470
35/* flags for input_field_configs */
36#define FIELD_FLAG_UNUSED   0x01         /* set if this field is unused but relevant to other games on the same hw */
37#define FIELD_FLAG_COCKTAIL   0x02         /* set if this field is relevant only for cocktail cabinets */
38#define FIELD_FLAG_TOGGLE   0x04         /* set if this field should behave as a toggle */
39#define FIELD_FLAG_ROTATED   0x08         /* set if this field represents a rotated control */
40#define ANALOG_FLAG_REVERSE   0x10         /* analog only: reverse the sense of the axis */
41#define ANALOG_FLAG_RESET   0x20         /* analog only: always preload in->default for relative axes, returning only deltas */
42#define ANALOG_FLAG_WRAPS   0x40         /* analog only: positional count wraps around */
43#define ANALOG_FLAG_INVERT   0x80         /* analog only: bitwise invert bits */
71// unicode constants
72const unicode_char UCHAR_PRIVATE = 0x100000;
73const unicode_char UCHAR_SHIFT_1 = UCHAR_PRIVATE + 0;
74const unicode_char UCHAR_SHIFT_2 = UCHAR_PRIVATE + 1;
75const unicode_char UCHAR_SHIFT_BEGIN = UCHAR_SHIFT_1;
76const unicode_char UCHAR_SHIFT_END = UCHAR_SHIFT_2;
77const unicode_char UCHAR_MAMEKEY_BEGIN = UCHAR_PRIVATE + 2;
4478
4579
46/* INP file information */
47#define INP_HEADER_SIZE         64
48#define INP_HEADER_MAJVERSION   3
49#define INP_HEADER_MINVERSION   0
50
51
52/* sequence types for input_port_seq() call */
53enum _input_seq_type
80// sequence types for input_port_seq() call
81enum input_seq_type
5482{
83   SEQ_TYPE_INVALID = -1,
5584   SEQ_TYPE_STANDARD = 0,
5685   SEQ_TYPE_INCREMENT,
5786   SEQ_TYPE_DECREMENT,
5887   SEQ_TYPE_TOTAL
5988};
60typedef enum _input_seq_type input_seq_type;
6189DECLARE_ENUM_OPERATORS(input_seq_type)
6290
6391
64/* conditions for DIP switches */
65enum
92// crosshair types
93enum crosshair_axis_t
6694{
67   PORTCOND_ALWAYS = 0,
68   PORTCOND_EQUALS,
69   PORTCOND_NOTEQUALS,
70   PORTCOND_GREATERTHAN,
71   PORTCOND_NOTGREATERTHAN,
72   PORTCOND_LESSTHAN,
73   PORTCOND_NOTLESSTHAN
74};
75
76
77/* crosshair types */
78enum
79{
8095   CROSSHAIR_AXIS_NONE = 0,
8196   CROSSHAIR_AXIS_X,
8297   CROSSHAIR_AXIS_Y
8398};
8499
85100
86/* groups for input ports */
101// groups for input ports
87102enum ioport_group
88103{
89104   IPG_UI = 0,
r15082r15083
101116};
102117
103118
104/* various input port types */
105enum
119// various input port types
120enum ioport_type
106121{
107   /* pseudo-port types */
122   // pseudo-port types
108123   IPT_INVALID = 0,
109124   IPT_UNUSED,
110125   IPT_END,
111126   IPT_UNKNOWN,
112127   IPT_PORT,
113128   IPT_DIPSWITCH,
114   IPT_VBLANK,
115129   IPT_CONFIG,
116130
117   /* start buttons */
131   // start buttons
118132   IPT_START1,
119133   IPT_START2,
120134   IPT_START3,
r15082r15083
124138   IPT_START7,
125139   IPT_START8,
126140
127   /* coin slots */
141   // coin slots
128142   IPT_COIN1,
129143   IPT_COIN2,
130144   IPT_COIN3,
r15082r15083
139153   IPT_COIN12,
140154   IPT_BILL1,
141155
142   /* service coin */
156   // service coin
143157   IPT_SERVICE1,
144158   IPT_SERVICE2,
145159   IPT_SERVICE3,
146160   IPT_SERVICE4,
147161
148   /* tilt inputs */
162   // tilt inputs
149163   IPT_TILT1,
150164   IPT_TILT2,
151165   IPT_TILT3,
152166   IPT_TILT4,
153167
154   /* misc other digital inputs */
168   // misc other digital inputs
155169   IPT_SERVICE,
156170   IPT_TILT,
157171   IPT_INTERLOCK,
158172   IPT_VOLUME_UP,
159173   IPT_VOLUME_DOWN,
160   IPT_START,               /* MESS only */
161   IPT_SELECT,               /* MESS only */
162   IPT_KEYPAD,               /* MESS only */
163   IPT_KEYBOARD,            /* MESS only */
174   IPT_START,               // MESS only
175   IPT_SELECT,               // MESS only
176   IPT_KEYPAD,               // MESS only
177   IPT_KEYBOARD,            // MESS only
164178
165#define __ipt_digital_joystick_start IPT_JOYSTICK_UP
166   /* use IPT_JOYSTICK for panels where the player has one single joystick */
167   IPT_JOYSTICK_UP,
168   IPT_JOYSTICK_DOWN,
169   IPT_JOYSTICK_LEFT,
170   IPT_JOYSTICK_RIGHT,
179   // digital joystick inputs
180   IPT_DIGITAL_JOYSTICK_FIRST,
171181
172   /* use IPT_JOYSTICKLEFT and IPT_JOYSTICKRIGHT for dual joystick panels */
173   IPT_JOYSTICKRIGHT_UP,
174   IPT_JOYSTICKRIGHT_DOWN,
175   IPT_JOYSTICKRIGHT_LEFT,
176   IPT_JOYSTICKRIGHT_RIGHT,
177   IPT_JOYSTICKLEFT_UP,
178   IPT_JOYSTICKLEFT_DOWN,
179   IPT_JOYSTICKLEFT_LEFT,
180   IPT_JOYSTICKLEFT_RIGHT,
181#define __ipt_digital_joystick_end IPT_JOYSTICKLEFT_RIGHT
182      // use IPT_JOYSTICK for panels where the player has one single joystick
183      IPT_JOYSTICK_UP = IPT_DIGITAL_JOYSTICK_FIRST,
184      IPT_JOYSTICK_DOWN,
185      IPT_JOYSTICK_LEFT,
186      IPT_JOYSTICK_RIGHT,
182187
183   /* action buttons */
188      // use IPT_JOYSTICKLEFT and IPT_JOYSTICKRIGHT for dual joystick panels
189      IPT_JOYSTICKRIGHT_UP,
190      IPT_JOYSTICKRIGHT_DOWN,
191      IPT_JOYSTICKRIGHT_LEFT,
192      IPT_JOYSTICKRIGHT_RIGHT,
193      IPT_JOYSTICKLEFT_UP,
194      IPT_JOYSTICKLEFT_DOWN,
195      IPT_JOYSTICKLEFT_LEFT,
196      IPT_JOYSTICKLEFT_RIGHT,
197   
198   IPT_DIGITAL_JOYSTICK_LAST,
199
200   // action buttons
184201   IPT_BUTTON1,
185202   IPT_BUTTON2,
186203   IPT_BUTTON3,
r15082r15083
198215   IPT_BUTTON15,
199216   IPT_BUTTON16,
200217
201   /* mahjong inputs */
202#define __ipt_mahjong_start IPT_MAHJONG_A
203   IPT_MAHJONG_A,
204   IPT_MAHJONG_B,
205   IPT_MAHJONG_C,
206   IPT_MAHJONG_D,
207   IPT_MAHJONG_E,
208   IPT_MAHJONG_F,
209   IPT_MAHJONG_G,
210   IPT_MAHJONG_H,
211   IPT_MAHJONG_I,
212   IPT_MAHJONG_J,
213   IPT_MAHJONG_K,
214   IPT_MAHJONG_L,
215   IPT_MAHJONG_M,
216   IPT_MAHJONG_N,
217   IPT_MAHJONG_O,
218   IPT_MAHJONG_P,
219   IPT_MAHJONG_Q,
220   IPT_MAHJONG_KAN,
221   IPT_MAHJONG_PON,
222   IPT_MAHJONG_CHI,
223   IPT_MAHJONG_REACH,   //IPT_MAHJONG_RIICHI,   // REACH is Japanglish
224   IPT_MAHJONG_RON,
225   IPT_MAHJONG_BET,
226   IPT_MAHJONG_LAST_CHANCE,
227   IPT_MAHJONG_SCORE,
228   IPT_MAHJONG_DOUBLE_UP,
229   IPT_MAHJONG_FLIP_FLOP,
230   IPT_MAHJONG_BIG,
231   IPT_MAHJONG_SMALL,
232#define __ipt_mahjong_end IPT_MAHJONG_SMALL
218   // mahjong inputs
219   IPT_MAHJONG_FIRST,
220   
221      IPT_MAHJONG_A,
222      IPT_MAHJONG_B,
223      IPT_MAHJONG_C,
224      IPT_MAHJONG_D,
225      IPT_MAHJONG_E,
226      IPT_MAHJONG_F,
227      IPT_MAHJONG_G,
228      IPT_MAHJONG_H,
229      IPT_MAHJONG_I,
230      IPT_MAHJONG_J,
231      IPT_MAHJONG_K,
232      IPT_MAHJONG_L,
233      IPT_MAHJONG_M,
234      IPT_MAHJONG_N,
235      IPT_MAHJONG_O,
236      IPT_MAHJONG_P,
237      IPT_MAHJONG_Q,
238      IPT_MAHJONG_KAN,
239      IPT_MAHJONG_PON,
240      IPT_MAHJONG_CHI,
241      IPT_MAHJONG_REACH,   //IPT_MAHJONG_RIICHI,   // REACH is Japanglish
242      IPT_MAHJONG_RON,
243      IPT_MAHJONG_BET,
244      IPT_MAHJONG_LAST_CHANCE,
245      IPT_MAHJONG_SCORE,
246      IPT_MAHJONG_DOUBLE_UP,
247      IPT_MAHJONG_FLIP_FLOP,
248      IPT_MAHJONG_BIG,
249      IPT_MAHJONG_SMALL,
250   
251   IPT_MAHJONG_LAST,
233252
234   /* hanafuda inputs */
235#define __ipt_hanafuda_start IPT_HANAFUDA_A
236   IPT_HANAFUDA_A,
237   IPT_HANAFUDA_B,
238   IPT_HANAFUDA_C,
239   IPT_HANAFUDA_D,
240   IPT_HANAFUDA_E,
241   IPT_HANAFUDA_F,
242   IPT_HANAFUDA_G,
243   IPT_HANAFUDA_H,
244   IPT_HANAFUDA_YES,
245   IPT_HANAFUDA_NO,
246#define __ipt_hanafuda_end IPT_HANAFUDA_NO
253   // hanafuda inputs
254   IPT_HANAFUDA_FIRST,
247255
248#define __ipt_gambling_start IPT_GAMBLE_KEYIN
256      IPT_HANAFUDA_A,
257      IPT_HANAFUDA_B,
258      IPT_HANAFUDA_C,
259      IPT_HANAFUDA_D,
260      IPT_HANAFUDA_E,
261      IPT_HANAFUDA_F,
262      IPT_HANAFUDA_G,
263      IPT_HANAFUDA_H,
264      IPT_HANAFUDA_YES,
265      IPT_HANAFUDA_NO,
266   
267   IPT_HANAFUDA_LAST,
249268
250   /* gambling inputs */
251   IPT_GAMBLE_KEYIN,   // attendant
252   IPT_GAMBLE_KEYOUT,   // attendant
253   IPT_GAMBLE_SERVICE,   // attendant
254   IPT_GAMBLE_BOOK,   // attendant
255   IPT_GAMBLE_DOOR,   // attendant
256//  IPT_GAMBLE_DOOR2,   // many gambling games have several doors.
257//  IPT_GAMBLE_DOOR3,
258//  IPT_GAMBLE_DOOR4,
259//  IPT_GAMBLE_DOOR5,
269   // gambling inputs
270   IPT_GAMBLING_FIRST,
260271
261   IPT_GAMBLE_HIGH,   // player
262   IPT_GAMBLE_LOW,      // player
263   IPT_GAMBLE_HALF,   // player
264   IPT_GAMBLE_DEAL,   // player
265   IPT_GAMBLE_D_UP,   // player
266   IPT_GAMBLE_TAKE,   // player
267   IPT_GAMBLE_STAND,   // player
268   IPT_GAMBLE_BET,      // player
269   IPT_GAMBLE_PAYOUT,   // player
270//  IPT_GAMBLE_BUTTON1, // player
271//  IPT_GAMBLE_BUTTON2, // many many gambling games have multi-games and/or multi-function-buttons
272//  IPT_GAMBLE_BUTTON3, // I suggest to eliminate specific names
273//  IPT_GAMBLE_BUTTON4,
274//  IPT_GAMBLE_BUTTON5,
275//  IPT_GAMBLE_BUTTON6,
276//  IPT_GAMBLE_BUTTON7,
277//  IPT_GAMBLE_BUTTON8,
278//  IPT_GAMBLE_BUTTON9,
279//  IPT_GAMBLE_BUTTON10,
280//  IPT_GAMBLE_BUTTON11,
281//  IPT_GAMBLE_BUTTON12,
282//  IPT_GAMBLE_BUTTON13,
283//  IPT_GAMBLE_BUTTON14,
284//  IPT_GAMBLE_BUTTON15,
285//  IPT_GAMBLE_BUTTON16,
272      IPT_GAMBLE_KEYIN,   // attendant
273      IPT_GAMBLE_KEYOUT,   // attendant
274      IPT_GAMBLE_SERVICE,   // attendant
275      IPT_GAMBLE_BOOK,   // attendant
276      IPT_GAMBLE_DOOR,   // attendant
277   //  IPT_GAMBLE_DOOR2,   // many gambling games have several doors.
278   //  IPT_GAMBLE_DOOR3,
279   //  IPT_GAMBLE_DOOR4,
280   //  IPT_GAMBLE_DOOR5,
286281
287   /* poker-specific inputs */
288   IPT_POKER_HOLD1,
289   IPT_POKER_HOLD2,
290   IPT_POKER_HOLD3,
291   IPT_POKER_HOLD4,
292   IPT_POKER_HOLD5,
293   IPT_POKER_CANCEL,
294   IPT_POKER_BET,
282      IPT_GAMBLE_HIGH,   // player
283      IPT_GAMBLE_LOW,      // player
284      IPT_GAMBLE_HALF,   // player
285      IPT_GAMBLE_DEAL,   // player
286      IPT_GAMBLE_D_UP,   // player
287      IPT_GAMBLE_TAKE,   // player
288      IPT_GAMBLE_STAND,   // player
289      IPT_GAMBLE_BET,      // player
290      IPT_GAMBLE_PAYOUT,   // player
291   //  IPT_GAMBLE_BUTTON1, // player
292   //  IPT_GAMBLE_BUTTON2, // many many gambling games have multi-games and/or multi-function-buttons
293   //  IPT_GAMBLE_BUTTON3, // I suggest to eliminate specific names
294   //  IPT_GAMBLE_BUTTON4,
295   //  IPT_GAMBLE_BUTTON5,
296   //  IPT_GAMBLE_BUTTON6,
297   //  IPT_GAMBLE_BUTTON7,
298   //  IPT_GAMBLE_BUTTON8,
299   //  IPT_GAMBLE_BUTTON9,
300   //  IPT_GAMBLE_BUTTON10,
301   //  IPT_GAMBLE_BUTTON11,
302   //  IPT_GAMBLE_BUTTON12,
303   //  IPT_GAMBLE_BUTTON13,
304   //  IPT_GAMBLE_BUTTON14,
305   //  IPT_GAMBLE_BUTTON15,
306   //  IPT_GAMBLE_BUTTON16,
295307
296   /* slot-specific inputs */
297   IPT_SLOT_STOP1,
298   IPT_SLOT_STOP2,
299   IPT_SLOT_STOP3,
300   IPT_SLOT_STOP4,
301   IPT_SLOT_STOP_ALL,
308      // poker-specific inputs
309      IPT_POKER_HOLD1,
310      IPT_POKER_HOLD2,
311      IPT_POKER_HOLD3,
312      IPT_POKER_HOLD4,
313      IPT_POKER_HOLD5,
314      IPT_POKER_CANCEL,
315      IPT_POKER_BET,
302316
303#define __ipt_gambling_end IPT_SLOT_STOP_ALL
317      // slot-specific inputs
318      IPT_SLOT_STOP1,
319      IPT_SLOT_STOP2,
320      IPT_SLOT_STOP3,
321      IPT_SLOT_STOP4,
322      IPT_SLOT_STOP_ALL,
304323
305   /* analog inputs */
306#define __ipt_analog_start IPT_AD_STICK_X
307#define __ipt_analog_absolute_start IPT_AD_STICK_X
308   IPT_AD_STICK_X,      // absolute // autocenter
309   IPT_AD_STICK_Y,      // absolute // autocenter
310   IPT_AD_STICK_Z,      // absolute // autocenter
311   IPT_PADDLE,         // absolute // autocenter
312   IPT_PADDLE_V,      // absolute // autocenter
313   IPT_PEDAL,         // absolute // autocenter
314   IPT_PEDAL2,         // absolute // autocenter
315   IPT_PEDAL3,         // absolute // autocenter
316   IPT_LIGHTGUN_X,      // absolute
317   IPT_LIGHTGUN_Y,      // absolute
318   IPT_POSITIONAL,      // absolute // autocenter if not wraps
319   IPT_POSITIONAL_V,   // absolute // autocenter if not wraps
320#define __ipt_analog_absolute_end IPT_POSITIONAL_V
324   IPT_GAMBLING_LAST,
321325
322   IPT_DIAL,         // relative
323   IPT_DIAL_V,         // relative
324   IPT_TRACKBALL_X,   // relative
325   IPT_TRACKBALL_Y,   // relative
326   IPT_MOUSE_X,      // relative
327   IPT_MOUSE_Y,      // relative
328#define __ipt_analog_end IPT_MOUSE_Y
326   // analog inputs
327   IPT_ANALOG_FIRST,
328   
329      IPT_ANALOG_ABSOLUTE_FIRST,
329330
330   /* analog adjuster support */
331         IPT_AD_STICK_X,      // absolute // autocenter
332         IPT_AD_STICK_Y,      // absolute // autocenter
333         IPT_AD_STICK_Z,      // absolute // autocenter
334         IPT_PADDLE,         // absolute // autocenter
335         IPT_PADDLE_V,      // absolute // autocenter
336         IPT_PEDAL,         // absolute // autocenter
337         IPT_PEDAL2,         // absolute // autocenter
338         IPT_PEDAL3,         // absolute // autocenter
339         IPT_LIGHTGUN_X,      // absolute
340         IPT_LIGHTGUN_Y,      // absolute
341         IPT_POSITIONAL,      // absolute // autocenter if not wraps
342         IPT_POSITIONAL_V,   // absolute // autocenter if not wraps
343     
344      IPT_ANALOG_ABSOLUTE_LAST,
345
346      IPT_DIAL,         // relative
347      IPT_DIAL_V,         // relative
348      IPT_TRACKBALL_X,   // relative
349      IPT_TRACKBALL_Y,   // relative
350      IPT_MOUSE_X,      // relative
351      IPT_MOUSE_Y,      // relative
352   
353   IPT_ANALOG_LAST,
354
355   // analog adjuster support
331356   IPT_ADJUSTER,
332357
333   /* the following are special codes for user interface handling - not to be used by drivers! */
334#define __ipt_ui_start IPT_UI_CONFIGURE
335   IPT_UI_CONFIGURE,
336   IPT_UI_ON_SCREEN_DISPLAY,
337   IPT_UI_DEBUG_BREAK,
338   IPT_UI_PAUSE,
339   IPT_UI_RESET_MACHINE,
340   IPT_UI_SOFT_RESET,
341   IPT_UI_SHOW_GFX,
342   IPT_UI_FRAMESKIP_DEC,
343   IPT_UI_FRAMESKIP_INC,
344   IPT_UI_THROTTLE,
345   IPT_UI_FAST_FORWARD,
346   IPT_UI_SHOW_FPS,
347   IPT_UI_SNAPSHOT,
348   IPT_UI_RECORD_MOVIE,
349   IPT_UI_TOGGLE_CHEAT,
350   IPT_UI_UP,
351   IPT_UI_DOWN,
352   IPT_UI_LEFT,
353   IPT_UI_RIGHT,
354   IPT_UI_HOME,
355   IPT_UI_END,
356   IPT_UI_PAGE_UP,
357   IPT_UI_PAGE_DOWN,
358   IPT_UI_SELECT,
359   IPT_UI_CANCEL,
360   IPT_UI_DISPLAY_COMMENT,
361   IPT_UI_CLEAR,
362   IPT_UI_ZOOM_IN,
363   IPT_UI_ZOOM_OUT,
364   IPT_UI_PREV_GROUP,
365   IPT_UI_NEXT_GROUP,
366   IPT_UI_ROTATE,
367   IPT_UI_SHOW_PROFILER,
368   IPT_UI_TOGGLE_UI,
369   IPT_UI_TOGGLE_DEBUG,
370   IPT_UI_PASTE,
371   IPT_UI_SAVE_STATE,
372   IPT_UI_LOAD_STATE,
358   // the following are special codes for user interface handling - not to be used by drivers!
359   IPT_UI_FIRST,
373360
374   /* additional OSD-specified UI port types (up to 16) */
375   IPT_OSD_1,
376   IPT_OSD_2,
377   IPT_OSD_3,
378   IPT_OSD_4,
379   IPT_OSD_5,
380   IPT_OSD_6,
381   IPT_OSD_7,
382   IPT_OSD_8,
383   IPT_OSD_9,
384   IPT_OSD_10,
385   IPT_OSD_11,
386   IPT_OSD_12,
387   IPT_OSD_13,
388   IPT_OSD_14,
389   IPT_OSD_15,
390   IPT_OSD_16,
391#define __ipt_ui_end IPT_OSD_16
361      IPT_UI_CONFIGURE,
362      IPT_UI_ON_SCREEN_DISPLAY,
363      IPT_UI_DEBUG_BREAK,
364      IPT_UI_PAUSE,
365      IPT_UI_RESET_MACHINE,
366      IPT_UI_SOFT_RESET,
367      IPT_UI_SHOW_GFX,
368      IPT_UI_FRAMESKIP_DEC,
369      IPT_UI_FRAMESKIP_INC,
370      IPT_UI_THROTTLE,
371      IPT_UI_FAST_FORWARD,
372      IPT_UI_SHOW_FPS,
373      IPT_UI_SNAPSHOT,
374      IPT_UI_RECORD_MOVIE,
375      IPT_UI_TOGGLE_CHEAT,
376      IPT_UI_UP,
377      IPT_UI_DOWN,
378      IPT_UI_LEFT,
379      IPT_UI_RIGHT,
380      IPT_UI_HOME,
381      IPT_UI_END,
382      IPT_UI_PAGE_UP,
383      IPT_UI_PAGE_DOWN,
384      IPT_UI_SELECT,
385      IPT_UI_CANCEL,
386      IPT_UI_DISPLAY_COMMENT,
387      IPT_UI_CLEAR,
388      IPT_UI_ZOOM_IN,
389      IPT_UI_ZOOM_OUT,
390      IPT_UI_PREV_GROUP,
391      IPT_UI_NEXT_GROUP,
392      IPT_UI_ROTATE,
393      IPT_UI_SHOW_PROFILER,
394      IPT_UI_TOGGLE_UI,
395      IPT_UI_TOGGLE_DEBUG,
396      IPT_UI_PASTE,
397      IPT_UI_SAVE_STATE,
398      IPT_UI_LOAD_STATE,
392399
393   /* other meaning not mapped to standard defaults */
400      // additional OSD-specified UI port types (up to 16)
401      IPT_OSD_1,
402      IPT_OSD_2,
403      IPT_OSD_3,
404      IPT_OSD_4,
405      IPT_OSD_5,
406      IPT_OSD_6,
407      IPT_OSD_7,
408      IPT_OSD_8,
409      IPT_OSD_9,
410      IPT_OSD_10,
411      IPT_OSD_11,
412      IPT_OSD_12,
413      IPT_OSD_13,
414      IPT_OSD_14,
415      IPT_OSD_15,
416      IPT_OSD_16,
417   
418   IPT_UI_LAST,
419
420   // other meaning not mapped to standard defaults
394421   IPT_OTHER,
395422
396   /* special meaning handled by custom code */
423   // special meaning handled by custom code
397424   IPT_SPECIAL,
425   IPT_CUSTOM,
398426   IPT_OUTPUT,
399427
400   __ipt_max
428   IPT_COUNT
401429};
430DECLARE_ENUM_OPERATORS(ioport_type)
402431
403432
404/* default strings used in port definitions */
433// input type classes
434enum ioport_type_class
435{
436   INPUT_CLASS_INTERNAL,
437   INPUT_CLASS_KEYBOARD,
438   INPUT_CLASS_CONTROLLER,
439   INPUT_CLASS_CONFIG,
440   INPUT_CLASS_DIPSWITCH,
441   INPUT_CLASS_MISC
442};
443
444
445// default strings used in port definitions
405446enum
406447{
407448   INPUT_STRING_Off = 1,
r15082r15083
627668};
628669
629670
630/* input classes */
631enum
632{
633   INPUT_CLASS_INTERNAL,
634   INPUT_CLASS_KEYBOARD,
635   INPUT_CLASS_CONTROLLER,
636   INPUT_CLASS_CONFIG,
637   INPUT_CLASS_DIPSWITCH,
638   INPUT_CLASS_MISC
639};
640671
641#define UCHAR_PRIVATE      (0x100000)
642#define UCHAR_SHIFT_1      (UCHAR_PRIVATE + 0)
643#define UCHAR_SHIFT_2      (UCHAR_PRIVATE + 1)
644#define UCHAR_MAMEKEY_BEGIN   (UCHAR_PRIVATE + 2)
645#define UCHAR_MAMEKEY(code)   (UCHAR_MAMEKEY_BEGIN + ITEM_ID_##code)
672//**************************************************************************
673//  TYPE DEFINITIONS
674//**************************************************************************
646675
647#define UCHAR_SHIFT_BEGIN   (UCHAR_SHIFT_1)
648#define UCHAR_SHIFT_END      (UCHAR_SHIFT_2)
676// opaque types pointing to live state
677struct input_port_state;
678struct input_field_state;
649679
680// forward declarations
681class ioport_list;
682class ioport_port;
683struct ioport_port_live;
684class ioport_field;
685struct ioport_field_live;
686class ioport_manager;
687class emu_timer;
688typedef struct _xml_data_node xml_data_node;
689class analog_field;
650690
651/***************************************************************************
652    TYPE DEFINITIONS
653***************************************************************************/
691// constructor function pointer
692typedef void (*ioport_constructor)(device_t &owner, ioport_list &portlist, astring &errorbuf);
654693
655/* input ports support up to 32 bits each */
656typedef UINT32 input_port_value;
694// I/O port callback function delegates
695typedef device_delegate<ioport_value (ioport_field &, void *)> ioport_field_read_delegate;
696typedef device_delegate<void (ioport_field &, void *, ioport_value, ioport_value)> ioport_field_write_delegate;
697typedef device_delegate<float (ioport_field &, float)> ioport_field_crossmap_delegate;
657698
699// keyboard helper function delegates
700typedef delegate<int (const unicode_char *, size_t)> ioport_queue_chars_delegate;
701typedef delegate<bool (unicode_char)> ioport_accept_char_delegate;
702typedef delegate<bool ()> ioport_charqueue_empty_delegate;
658703
659/* opaque types pointing to live state */
660typedef struct _input_port_state input_port_state;
661typedef struct _input_field_state input_field_state;
662704
705// ======================> inp_header
663706
664/* forward declarations */
665class input_port_config;
666class input_field_config;
667class emu_timer;
707// header at the front of INP files
708struct inp_header
709{
710   char                  header[8];      // +00: 8 byte header - must be "MAMEINP\0"
711   UINT64                  basetime;      // +08: base time of recording
712   UINT8                  majversion;      // +10: major INP version
713   UINT8                  minversion;      // +11: minor INP version
714   UINT8                  reserved[2];   // +12: must be zero
715   char                  gamename[12];   // +14: game name string, NULL-terminated
716   char                  version[32];   // +20: system version string, NULL-terminated
717};
668718
669/* template specializations */
670typedef tagged_list<input_port_config> ioport_list;
671719
720// ======================> input_device_default
672721
673/* read input port callback function */
674typedef delegate<UINT32 (const input_field_config &, void *)> input_field_read_delegate;
722// device defined default input settings
723struct input_device_default
724{
725   const char *         tag;         // tag of port to update
726   ioport_value         mask;         // mask to apply to the port
727   ioport_value         defvalue;      // new default value
728};
675729
676/* input port write callback function */
677typedef delegate<void (const input_field_config &, void *, input_port_value, input_port_value)> input_field_write_delegate;
678730
679/* crosshair mapping function */
680typedef delegate<float (const input_field_config &, float)> input_field_crossmap_delegate;
731// ======================> input_type_entry
681732
733// describes a fundamental input type, including default input sequences
734class input_type_entry
735{
736   friend class simple_list<input_type_entry>;
737   friend class ioport_manager;
682738
683/* encapsulates a condition on a port field or setting */
684typedef struct _input_condition input_condition;
685struct _input_condition
686{
687   const char *            tag;         /* tag of port whose condition is to be tested */
688   input_port_value         mask;         /* mask to apply to the port */
689   input_port_value         value;         /* value to compare against */
690   UINT8                  condition;      /* condition to use */
739public:
740   // construction/destruction
741   input_type_entry(ioport_type type, ioport_group group, int player, const char *token, const char *name, input_seq standard);
742   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);
743
744   // getters
745   input_type_entry *next() const { return m_next; }
746   ioport_type type() const { return m_type; }
747   ioport_group group() const { return m_group; }
748   UINT8 player() const { return m_player; }
749   const char *token() const { return m_token; }
750   const char *name() const { return m_name; }
751   input_seq &defseq(input_seq_type seqtype = SEQ_TYPE_STANDARD) { return m_defseq[seqtype]; }
752   const input_seq &seq(input_seq_type seqtype = SEQ_TYPE_STANDARD) const { return m_seq[seqtype]; }
753   
754   // setters
755   void configure_osd(const char *token, const char *name);
756   
757private:
758   // internal state
759   input_type_entry *   m_next;            // next description in the list
760   ioport_type         m_type;            // IPT_* for this entry
761   ioport_group      m_group;         // which group the port belongs to
762   UINT8            m_player;         // player number (0 is player 1)
763   const char *      m_token;         // token used to store settings
764   const char *      m_name;            // user-friendly name
765   input_seq         m_defseq[SEQ_TYPE_TOTAL];// default input sequence
766   input_seq         m_seq[SEQ_TYPE_TOTAL];// currently configured sequences
691767};
692768
693769
694/* a single setting for a configuration or DIP switch */
695class input_setting_config
770// ======================> digital_joystick
771
772// tracking information about a digital joystick input
773class digital_joystick
696774{
697   DISABLE_COPYING(input_setting_config);
698   friend class simple_list<input_setting_config>;
775   DISABLE_COPYING(digital_joystick);
776   friend class simple_list<digital_joystick>;
699777
700778public:
701   input_setting_config(input_field_config &field, input_port_value value, const char *name);
702   input_setting_config *next() const { return m_next; }
779   // directions
780   enum direction_t
781   {
782      JOYDIR_UP,
783      JOYDIR_DOWN,
784      JOYDIR_LEFT,
785      JOYDIR_RIGHT,
786      JOYDIR_COUNT
787   };
788   
789   // bit constants
790   static const UINT8 UP_BIT = 1 << JOYDIR_UP;
791   static const UINT8 DOWN_BIT = 1 << JOYDIR_DOWN;
792   static const UINT8 LEFT_BIT = 1 << JOYDIR_LEFT;
793   static const UINT8 RIGHT_BIT = 1 << JOYDIR_RIGHT;
703794
704   input_port_value         value;         /* value of the bits in this setting */
705   input_condition            condition;      /* condition under which this setting is valid */
706   const char *            name;         /* user-friendly name to display */
795   // construction/destruction
796   digital_joystick(int player, int number);
797   
798   // getters
799   digital_joystick *next() const { return m_next; }
800   int player() const { return m_player; }
801   int number() const { return m_number; }
802   UINT8 current() const { return m_current; }
803   UINT8 current4way() const { return m_current4way; }
804   
805   // configuration
806   direction_t set_axis(ioport_field &field);
707807
808   // updates
809   void frame_update();
810   
708811private:
709   input_field_config &      m_field;         /* pointer back to the field that owns us */
710   input_setting_config *      m_next;         /* pointer to next setting in sequence */
812   // internal state
813   digital_joystick *   m_next;               // next joystick in the list
814   int               m_player;            // player number represented
815   int               m_number;            // joystick number represented
816   ioport_field *      m_field[JOYDIR_COUNT];   // input field for each direction
817   UINT8            m_current;            // current value
818   UINT8            m_current4way;         // current 4-way value
819   UINT8            m_previous;            // previous value
711820};
821DECLARE_ENUM_OPERATORS(digital_joystick::direction_t)
712822
713823
714/* a mapping from a bit to a physical DIP switch description */
715class input_field_diplocation
824// ======================> natural_keyboard
825
826// buffer to handle copy/paste/insert of keys
827class natural_keyboard
716828{
717   DISABLE_COPYING(input_field_diplocation);
718   friend class simple_list<input_field_diplocation>;
829   DISABLE_COPYING(natural_keyboard);
719830
720831public:
721   input_field_diplocation(const char *string, UINT8 swnum, bool invert);
722   input_field_diplocation *next() const { return m_next; }
832   // construction/destruction
833   natural_keyboard(running_machine &machine);
834   
835   // getters and queries
836   running_machine &machine() const { return m_machine; }
837   bool empty() const { return (m_bufbegin == m_bufend); }
838   bool full() const { return ((m_bufend + 1) % m_buffer.count()) == m_bufbegin; }
839   bool can_post() const { return (!m_queue_chars.isnull() || m_keycode_map.count() == 0); }
840   bool is_posting() const { return (!empty() || (!m_charqueue_empty.isnull() && !m_charqueue_empty())); }
723841
724   astring                  swname;         /* name of the physical DIP switch */
725   UINT8                  swnum;         /* physical switch number */
726   bool                  invert;         /* is this an active-high DIP? */
842   // configuration
843   void configure(ioport_queue_chars_delegate queue_chars, ioport_accept_char_delegate accept_char, ioport_charqueue_empty_delegate charqueue_empty);
727844
845   // posting
846   void post(unicode_char ch);
847   void post(const unicode_char *text, size_t length = 0, attotime rate = attotime::zero);
848   void post_utf8(const char *text, size_t length = 0, attotime rate = attotime::zero);
849   void post_coded(const char *text, size_t length = 0, attotime rate = attotime::zero);
850
851   void frame_update(ioport_port &port, ioport_value &digital);
852   const char *key_name(astring &string, unicode_char ch);
853
728854private:
729   input_field_diplocation *   m_next;         /* pointer to the next bit */
855   // internal keyboard code information
856   struct keycode_map_entry
857   {
858      unicode_char    ch;
859      ioport_field *   field[UCHAR_SHIFT_END + 1 - UCHAR_SHIFT_BEGIN];
860   };
861
862   // internal helpers
863   void build_codes(ioport_manager &manager);
864   bool can_post_directly(unicode_char ch);
865   bool can_post_alternate(unicode_char ch);
866   attotime choose_delay(unicode_char ch);
867   void internal_post(unicode_char ch);
868   void timer(void *ptr, int param);
869   const char *unicode_to_string(astring &buffer, unicode_char ch);
870   const keycode_map_entry *find_code(unicode_char ch) const;
871
872   // debugger helpers
873   static void execute_input(running_machine &machine, int ref, int params, const char *param[]);
874   static void execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[]);
875
876   // internal state
877   running_machine &      m_machine;            // reference to our machine
878   UINT32               m_bufbegin;            // index of starting character
879   UINT32               m_bufend;            // index of ending character
880   dynamic_array<unicode_char> m_buffer;         // actual buffer
881   bool               m_status_keydown;      // current keydown status
882   bool               m_last_cr;            // was the last char a CR?
883   emu_timer *            m_timer;            // timer for posting characters
884   attotime             m_current_rate;         // current rate for posting
885   ioport_queue_chars_delegate m_queue_chars;      // queue characters callback
886   ioport_accept_char_delegate m_accept_char;      // accept character callback
887   ioport_charqueue_empty_delegate m_charqueue_empty; // character queue empty callback
888   dynamic_array<keycode_map_entry> m_keycode_map;   // keycode map
730889};
731890
732891
733/* a single bitfield within an input port */
734class input_field_config
892// ======================> ioport_condition
893
894// encapsulates a condition on a port field or setting
895class ioport_condition
735896{
736   DISABLE_COPYING(input_field_config);
737   friend class simple_list<input_field_config>;
738
739897public:
740   input_field_config(input_port_config &port, int type, input_port_value defvalue, input_port_value maskbits, const char *name = NULL);
898   // condition types
899   enum condition_t
900   {
901      ALWAYS = 0,
902      EQUALS,
903      NOTEQUALS,
904      GREATERTHAN,
905      NOTGREATERTHAN,
906      LESSTHAN,
907      NOTLESSTHAN
908   };
741909
742   input_field_config *next() const { return m_next; }
743   input_port_config &port() const { return m_port; }
744   running_machine &machine() const;
745   simple_list<input_setting_config> &settinglist() { return m_settinglist; }
746   const simple_list<input_setting_config> &settinglist() const { return m_settinglist; }
747   simple_list<input_field_diplocation> &diploclist() { return m_diploclist; }
748   int modcount() const { return m_modcount; }
910   // construction/destruction
911   ioport_condition() { reset(); }
912   ioport_condition(condition_t condition, const char *tag, ioport_value mask, ioport_value value) { set(condition, tag, mask, value); }
749913
750   /* generally-applicable data */
751   input_port_value         mask;         /* mask of bits belonging to the field */
752   input_port_value         defvalue;      /* default value of these bits */
753   input_condition            condition;      /* condition under which this field is relevant */
754   UINT32                  type;         /* IPT_* type for this port */
755   UINT8                  player;         /* player number (0-based) */
756   UINT32                  flags;         /* combination of FIELD_FLAG_* and ANALOG_FLAG_* above */
757   UINT8                  impulse;      /* number of frames before reverting to defvalue */
758   const char *            name;         /* user-friendly name to display */
759   input_seq               seq[SEQ_TYPE_TOTAL];/* sequences of all types */
760   input_field_read_delegate   read;         /* read callback routine */
761   void *                  read_param;      /* parameter for read callback routine */
762   const char *            read_device;   /* parameter for read callback routine */
763   input_field_write_delegate   write;         /* write callback routine */
764   void *                  write_param;   /* parameter for write callback routine */
765   const char *            write_device;   /* parameter for write callback routine */
914   // getters
915   const char *tag() const { return m_tag; }
916   
917   // operators
918   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); }
919   bool eval(device_t &device) const;
920   bool none() const { return (m_condition == ALWAYS); }
766921
767   /* data relevant to analog control types */
768   INT32                  min;         /* minimum value for absolute axes */
769   INT32                  max;         /* maximum value for absolute axes */
770   INT32                  sensitivity;   /* sensitivity (100=normal) */
771   INT32                  delta;         /* delta to apply each frame a digital inc/dec key is pressed */
772   INT32                  centerdelta;   /* delta to apply each frame no digital inputs are pressed */
773   UINT8                  crossaxis;      /* crosshair axis */
774   double                  crossscale;      /* crosshair scale */
775   double                  crossoffset;   /* crosshair offset */
776   double                  crossaltaxis;   /* crosshair alternate axis value */
777   input_field_crossmap_delegate crossmapper;   /* crosshair mapping function */
778   const char *            crossmapper_device;   /* parameter for write callback routine */
779   UINT16                  full_turn_count;/* number of optical counts for 1 full turn of the original control */
780   const input_port_value *   remap_table;   /* pointer to an array that remaps the port value */
922   // configuration
923   void reset() { set(ALWAYS, NULL, 0, 0); }
924   void set(condition_t condition, const char *tag, ioport_value mask, ioport_value value)
925   {
926      m_condition = condition;
927      m_tag = tag;
928      m_mask = mask;
929      m_value = value;
930   }
781931
782   /* data relevant to other specific types */
783   UINT8                  way;         /* digital joystick 2/4/8-way descriptions */
784   unicode_char            chars[3];      /* (MESS-specific) unicode key data */
932private:
933   // internal state
934   condition_t      m_condition;   // condition to use
935   const char *   m_tag;         // tag of port whose condition is to be tested
936   ioport_value   m_mask;         // mask to apply to the port
937   ioport_value   m_value;      // value to compare against
938};
785939
786   /* this field is only valid if the device is live */
787   input_field_state *         state;         /* live state of field (NULL if not live) */
788940
941// ======================> ioport_setting
942
943// a single setting for a configuration or DIP switch
944class ioport_setting
945{
946   DISABLE_COPYING(ioport_setting);
947   friend class simple_list<ioport_setting>;
948
949public:
950   // construction/destruction
951   ioport_setting(ioport_field &field, ioport_value value, const char *name);
952   
953   // getters
954   ioport_setting *next() const { return m_next; }
955   ioport_field &field() const { return m_field; }
956   device_t &device() const;
957   running_machine &machine() const;
958   ioport_value value() const { return m_value; }
959   ioport_condition &condition() { return m_condition; }
960   const char *name() const { return m_name; }
961
962   // helpers
963   bool enabled() { return m_condition.eval(device()); }
964
789965private:
790   input_field_config *      m_next;            /* pointer to next field in sequence */
791   input_port_config &         m_port;            /* pointer back to the port that owns us */
792   int                     m_modcount;
793   simple_list<input_setting_config> m_settinglist;   /* list of input_setting_configs */
794   simple_list<input_field_diplocation> m_diploclist;   /* list of locations for various bits */
966   // internal state
967   ioport_setting *   m_next;            // pointer to next setting in sequence
968   ioport_field &      m_field;         // pointer back to the field that owns us
969   ioport_value      m_value;         // value of the bits in this setting
970   const char *      m_name;            // user-friendly name to display
971   ioport_condition   m_condition;      // condition under which this setting is valid
795972};
796973
797974
798/* user-controllable settings for a field */
799typedef struct _input_field_user_settings input_field_user_settings;
800struct _input_field_user_settings
975// ======================> ioport_diplocation
976
977// a mapping from a bit to a physical DIP switch description
978class ioport_diplocation
801979{
802   input_port_value         value;         /* for DIP switches */
803   input_seq               seq[SEQ_TYPE_TOTAL];/* sequences of all types */
804   INT32                  sensitivity;   /* for analog controls */
805   INT32                  delta;         /* for analog controls */
806   INT32                  centerdelta;   /* for analog controls */
807   UINT8                  reverse;      /* for analog controls */
808};
980   DISABLE_COPYING(ioport_diplocation);
981   friend class simple_list<ioport_diplocation>;
809982
810/* device defined default input settings */
811typedef struct _input_device_default input_device_default;
812struct _input_device_default
813{
814   const char *            tag;         /* tag of port to update */
815   input_port_value         mask;         /* mask to apply to the port */
816   input_port_value         defvalue;      /* new default value */
983public:
984   // construction/destruction
985   ioport_diplocation(const char *name, UINT8 swnum, bool invert);
986   
987   // getters
988   ioport_diplocation *next() const { return m_next; }
989   const char *name() const { return m_name; }
990   UINT8 number() const { return m_number; }
991   bool inverted() const { return m_invert; }
992
993private:
994   ioport_diplocation *   m_next;         // pointer to the next bit
995   astring               m_name;         // name of the physical DIP switch
996   UINT8               m_number;      // physical switch number
997   bool               m_invert;      // is this an active-high DIP?
817998};
818999
819/* a single input port configuration */
820class input_port_config
1000
1001// ======================> ioport_field
1002
1003// a single bitfield within an input port
1004class ioport_field
8211005{
822   DISABLE_COPYING(input_port_config);
823   friend class simple_list<input_port_config>;
1006   DISABLE_COPYING(ioport_field);
1007   friend class simple_list<ioport_field>;
1008   friend class ioport_configurer;
1009   friend class dynamic_field;
8241010
1011   // flags for ioport_fields
1012   static const int FIELD_FLAG_UNUSED = 0x01;      // set if this field is unused but relevant to other games on the same hw
1013   static const int FIELD_FLAG_COCKTAIL = 0x02;   // set if this field is relevant only for cocktail cabinets
1014   static const int FIELD_FLAG_TOGGLE = 0x04;      // set if this field should behave as a toggle
1015   static const int FIELD_FLAG_ROTATED = 0x08;      // set if this field represents a rotated control
1016   static const int ANALOG_FLAG_REVERSE = 0x10;   // analog only: reverse the sense of the axis
1017   static const int ANALOG_FLAG_RESET = 0x20;      // analog only: always preload in->default for relative axes, returning only deltas
1018   static const int ANALOG_FLAG_WRAPS = 0x40;      // analog only: positional count wraps around
1019   static const int ANALOG_FLAG_INVERT = 0x80;      // analog only: bitwise invert bits
1020
8251021public:
8261022   // construction/destruction
827   input_port_config(device_t &owner, const char *tag);
1023   ioport_field(ioport_port &port, ioport_type type, ioport_value defvalue, ioport_value maskbits, const char *name = NULL);
1024   ~ioport_field();
8281025
8291026   // getters
830   input_port_config *next() const { return m_next; }
831   device_t &owner() const { return m_owner; }
1027   ioport_field *next() const { return m_next; }
1028   ioport_port &port() const { return m_port; }
1029   device_t &device() const;
1030   ioport_manager &manager() const;
8321031   running_machine &machine() const;
833   input_field_config *first_field() const { return m_fieldlist.first(); }
834   simple_list<input_field_config> &fieldlist() { return m_fieldlist; }
835   const char *tag() const { return m_tag; }
8361032   int modcount() const { return m_modcount; }
1033   ioport_setting *first_setting() const { return m_settinglist.first(); }
1034   ioport_diplocation *first_diplocation() const { return m_diploclist.first(); }
8371035
838   void bump_modcount() { m_modcount++; }
1036   ioport_value mask() const { return m_mask; }
1037   ioport_value defvalue() const { return m_defvalue; }
1038   ioport_condition &condition() { return m_condition; }
1039   ioport_type type() const { return m_type; }
1040   UINT8 player() const { return m_player + 1; }
8391041
840   void collapse_fields(astring &errorbuf);
1042   bool unused() const { return ((m_flags & FIELD_FLAG_UNUSED) != 0); }
1043   bool cocktail() const { return ((m_flags & FIELD_FLAG_COCKTAIL) != 0); }
1044   bool toggle() const { return ((m_flags & FIELD_FLAG_TOGGLE) != 0); }
1045   bool rotated() const { return ((m_flags & FIELD_FLAG_ROTATED) != 0); }
1046   bool analog_reverse() const { return ((m_flags & ANALOG_FLAG_REVERSE) != 0); }
1047   bool analog_reset() const { return ((m_flags & ANALOG_FLAG_RESET) != 0); }
1048   bool analog_wraps() const { return ((m_flags & ANALOG_FLAG_WRAPS) != 0); }
1049   bool analog_invert() const { return ((m_flags & ANALOG_FLAG_INVERT) != 0); }
8411050
842   /* these fields are only valid if the port is live */
843   input_port_state *         state;         /* live state of port (NULL if not live) */
844   input_port_value         active;         /* mask of active bits in the port */
1051   UINT8 impulse() const { return m_impulse; }
1052   const char *name() const;
1053   const char *specific_name() const { return m_name; }
1054   const input_seq &seq(input_seq_type seqtype = SEQ_TYPE_STANDARD) const;
1055   bool has_dynamic_read() const { return !m_read.isnull(); }
1056   bool has_dynamic_write() const { return !m_write.isnull(); }
1057   
1058   ioport_value minval() const { return m_min; }
1059   ioport_value maxval() const { return m_max; }
1060   INT32 sensitivity() const { return m_sensitivity; }
1061   INT32 delta() const { return m_delta; }
1062   INT32 centerdelta() const { return m_centerdelta; }
1063   crosshair_axis_t crosshair_axis() const { return m_crosshair_axis; }
1064   double crosshair_scale() const { return m_crosshair_scale; }
1065   double crosshair_offset() const { return m_crosshair_offset; }
1066   UINT16 full_turn_count() const { return m_full_turn_count; }
1067   const ioport_value *remap_table() const { return m_remap_table; }
1068   
1069   UINT8 way() const { return m_way; }
1070   unicode_char keyboard_code(int which) const;
1071   ioport_field_live &live() const { assert(m_live != NULL); return *m_live; }
1072   
1073   // setters
1074   void set_crosshair_scale(double scale) { m_crosshair_scale = scale; }
1075   void set_crosshair_offset(double offset) { m_crosshair_offset = offset; }
8451076
846private:
847   input_port_config *         m_next;         /* pointer to next port */
848   device_t &               m_owner;         /* associated device, when appropriate */
849   simple_list<input_field_config> m_fieldlist;      /* list of input_field_configs */
850   astring                  m_tag;         /* pointer to this port's tag */
851   int                     m_modcount;
852};
1077   // derived getters
1078   ioport_type_class type_class() const;
1079   bool is_analog() const { return (m_type > IPT_ANALOG_FIRST && m_type < IPT_ANALOG_LAST); }
1080   bool is_digital_joystick() const { return (m_type > IPT_DIGITAL_JOYSTICK_FIRST && m_type < IPT_DIGITAL_JOYSTICK_LAST); }
8531081
1082   // additional operations
1083   bool enabled() const { return m_condition.eval(device()); }
1084   const char *setting_name() const;
1085   bool has_previous_setting() const;
1086   void select_previous_setting();
1087   bool has_next_setting() const;
1088   void select_next_setting();
1089   void crosshair_position(float &x, float &y, bool &gotx, bool &goty);
1090   void init_live_state(analog_field *analog);
1091   void frame_update(ioport_value &result, bool mouse_down);
1092   void reduce_mask(ioport_value bits_to_remove) { m_mask &= ~bits_to_remove; }
8541093
855/* describes a fundamental input type, including default input sequences */
856class input_type_entry
857{
858   friend class simple_list<input_type_entry>;
1094   // user-controllable settings for a field
1095   struct user_settings
1096   {
1097      ioport_value   value;               // for DIP switches
1098      input_seq      seq[SEQ_TYPE_TOTAL];   // sequences of all types
1099      INT32         sensitivity;         // for analog controls
1100      INT32         delta;               // for analog controls
1101      INT32         centerdelta;         // for analog controls
1102      bool         reverse;            // for analog controls
1103   };
1104   void get_user_settings(user_settings &settings);
1105   void set_user_settings(const user_settings &settings);
8591106
860public:
861   input_type_entry(UINT32 type, ioport_group group, int player, const char *token, const char *name, input_seq standard);
862   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);
1107private:
1108   void expand_diplocation(const char *location, astring &errorbuf);
8631109
864   input_type_entry *next() const { return m_next; }
1110   // internal state
1111   ioport_field *            m_next;            // pointer to next field in sequence
1112   ioport_port &            m_port;            // reference to the port that owns us
1113   ioport_field_live *         m_live;            // live state of field (NULL if not live)
1114   int                     m_modcount;         // modification count
1115   simple_list<ioport_setting> m_settinglist;      // list of input_setting_configs
1116   simple_list<ioport_diplocation> m_diploclist;    // list of locations for various bits
8651117
866   UINT32                  type;         /* IPT_* for this entry */
867   ioport_group            group;         /* which group the port belongs to */
868   UINT8                  player;         /* player number (0 is player 1) */
869   const char *            token;         /* token used to store settings */
870   const char *            name;         /* user-friendly name */
871   input_seq               defseq[SEQ_TYPE_TOTAL];/* default input sequence */
872   input_seq               seq[SEQ_TYPE_TOTAL];/* currently configured sequences */
1118   // generally-applicable data
1119   ioport_value            m_mask;            // mask of bits belonging to the field
1120   ioport_value            m_defvalue;         // default value of these bits
1121   ioport_condition         m_condition;      // condition under which this field is relevant
1122   ioport_type               m_type;            // IPT_* type for this port
1123   UINT8                  m_player;         // player number (0-based)
1124   UINT32                  m_flags;         // combination of FIELD_FLAG_* and ANALOG_FLAG_* above
1125   UINT8                  m_impulse;         // number of frames before reverting to defvalue
1126   const char *            m_name;            // user-friendly name to display
1127   input_seq               m_seq[SEQ_TYPE_TOTAL];// sequences of all types
1128   ioport_field_read_delegate   m_read;            // read callback routine
1129   void *                  m_read_param;      // parameter for read callback routine
1130   ioport_field_write_delegate   m_write;         // write callback routine
1131   void *                  m_write_param;      // parameter for write callback routine
8731132
874private:
875   input_type_entry *         m_next;         /* next description in the list */
1133   // data relevant to analog control types
1134   ioport_value            m_min;            // minimum value for absolute axes
1135   ioport_value            m_max;            // maximum value for absolute axes
1136   INT32                  m_sensitivity;      // sensitivity (100=normal)
1137   INT32                  m_delta;         // delta to apply each frame a digital inc/dec key is pressed
1138   INT32                  m_centerdelta;      // delta to apply each frame no digital inputs are pressed
1139   crosshair_axis_t         m_crosshair_axis;   // crosshair axis
1140   double                  m_crosshair_scale;   // crosshair scale
1141   double                  m_crosshair_offset;   // crosshair offset
1142   double                  m_crosshair_altaxis;// crosshair alternate axis value
1143   ioport_field_crossmap_delegate m_crosshair_mapper; // crosshair mapping function
1144   UINT16                  m_full_turn_count;   // number of optical counts for 1 full turn of the original control
1145   const ioport_value *      m_remap_table;      // pointer to an array that remaps the port value
1146
1147   // data relevant to other specific types
1148   UINT8                  m_way;            // digital joystick 2/4/8-way descriptions
1149   unicode_char            m_chars[4];         // unicode key data
8761150};
8771151
8781152
879/* header at the front of INP files */
880typedef struct _inp_header inp_header;
881struct _inp_header
1153// ======================> ioport_list
1154
1155// class that holds a list of I/O ports
1156class ioport_list : public tagged_list<ioport_port>
8821157{
883   char                  header[8];      /* +00: 8 byte header - must be "MAMEINP\0" */
884   UINT64                  basetime;      /* +08: base time of recording */
885   UINT8                  majversion;      /* +10: major INP version */
886   UINT8                  minversion;      /* +11: minor INP version */
887   UINT8                  reserved[2];   /* +12: must be zero */
888   char                  gamename[12];   /* +14: game name string, NULL-terminated */
889   char                  version[32];   /* +20: system version string, NULL-terminated */
890};
1158   DISABLE_COPYING(ioport_list);
8911159
1160public:
1161   // construction/destruction
1162   ioport_list(resource_pool &pool = global_resource_pool())
1163      : tagged_list<ioport_port>(pool) { }
8921164
893struct digital_joystick_state
894{
895   const input_field_config *   field[4];         /* input field for up, down, left, right respectively */
896   UINT8                  inuse;            /* is this joystick used? */
897   UINT8                  current;         /* current value */
898   UINT8                  current4way;      /* current 4-way value */
899   UINT8                  previous;         /* previous value */
1165   using tagged_list<ioport_port>::append;
1166   void append(device_t &device, astring &errorbuf);
9001167};
9011168
902#define DIGITAL_JOYSTICKS_PER_PLAYER   3
9031169
904#define NUM_SIMUL_KEYS   (UCHAR_SHIFT_END - UCHAR_SHIFT_BEGIN + 1)
905struct inputx_code
1170// ======================> ioport_port
1171
1172// a single input port configuration
1173class ioport_port
9061174{
907   unicode_char ch;
908   const input_field_config * field[NUM_SIMUL_KEYS];
909};
1175   DISABLE_COPYING(ioport_port);
1176   friend class simple_list<ioport_port>;
1177   friend class ioport_configurer;
9101178
911struct key_buffer
912{
913   int begin_pos;
914   int end_pos;
915   unsigned int status_keydown : 1;
916   int size;
917   unicode_char *buffer;
1179public:
1180   // construction/destruction
1181   ioport_port(device_t &owner, const char *tag);
1182   ~ioport_port();
1183
1184   // getters
1185   ioport_port *next() const { return m_next; }
1186   ioport_manager &manager() const;
1187   device_t &device() const { return m_device; }
1188   running_machine &machine() const;
1189   ioport_field *first_field() const { return m_fieldlist.first(); }
1190   const char *tag() const { return m_tag; }
1191   int modcount() const { return m_modcount; }
1192   ioport_value active() const { return m_active; }
1193   ioport_value active_safe(ioport_value defval) const { return (this == NULL) ? defval : active(); }
1194   ioport_port_live &live() const { assert(m_live != NULL); return *m_live; }
1195   
1196   // read/write to the port
1197   ioport_value read();
1198   ioport_value read_safe(ioport_value defval) { return (this == NULL) ? defval : read(); }
1199   void write(ioport_value value, ioport_value mask = ~0);
1200   void write_safe(ioport_value value, ioport_value mask = ~0) { if (this != NULL) write(value, mask); }
1201
1202   // other operations
1203   ioport_field *field(ioport_value mask);
1204   void collapse_fields(astring &errorbuf);
1205   void frame_update(ioport_field *mouse_field);
1206   void init_live_state();
1207
1208private:
1209   void insert_field(ioport_field &newfield, ioport_value &disallowedbits, astring &errorbuf);
1210
1211   // internal state
1212   ioport_port *            m_next;         // pointer to next port
1213   device_t &               m_device;      // associated device
1214   simple_list<ioport_field>    m_fieldlist;   // list of ioport_fields
1215   astring                  m_tag;         // copy of this port's tag
1216   int                     m_modcount;      // modification count
1217   ioport_value            m_active;      // mask of active bits in the port
1218   ioport_port_live *         m_live;         // live state of port (NULL if not live)
9181219};
9191220
920/* private input port state */
1221
1222// ======================> ioport_manager
1223
1224// private input port state
9211225class ioport_manager
9221226{
1227   DISABLE_COPYING(ioport_manager);
9231228   friend class device_t;
1229   friend class ioport_configurer;
9241230
9251231public:
9261232   // construction/destruction
r15082r15083
9291235
9301236   // getters
9311237   running_machine &machine() const { return m_machine; }
932   input_port_config *first_port() const { return m_portlist.first(); }
1238   ioport_port *first_port() const { return m_portlist.first(); }
1239   bool safe_to_read() const { return m_safe_to_read; }
1240   natural_keyboard &natkeyboard() { return m_natkeyboard; }
9331241
934   /* global state */
935   UINT8                  safe_to_read;      /* clear at start; set after state is loaded */
1242   // type helpers
1243   input_type_entry *first_type() const { return m_typelist.first(); }
1244   bool type_pressed(ioport_type type, int player = 0);
1245   const char *type_name(ioport_type type, UINT8 player);
1246   ioport_group type_group(ioport_type type, int player);
1247   const input_seq &type_seq(ioport_type type, int player = 0, input_seq_type seqtype = SEQ_TYPE_STANDARD);
1248   void set_type_seq(ioport_type type, int player, input_seq_type seqtype, const input_seq &newseq);
1249   static bool type_is_analog(ioport_type type) { return (type > IPT_ANALOG_FIRST && type < IPT_ANALOG_LAST); }
1250   bool type_class_present(ioport_type_class inputclass);
9361251
937   /* types */
938   simple_list<input_type_entry> typelist;      /* list of live type states */
939   input_type_entry *         type_to_entry[__ipt_max][MAX_PLAYERS]; /* map from type/player to type state */
1252   // other helpers
1253   digital_joystick &digjoystick(int player, int joysticknum);
1254   int count_players() const;
1255   bool crosshair_position(int player, float &x, float &y);
1256   bool has_keyboard() const;
1257   void setup_natural_keyboard(ioport_queue_chars_delegate queue_chars, ioport_accept_char_delegate accept_char, ioport_charqueue_empty_delegate charqueue_empty);
1258   ioport_value frame_interpolate(ioport_value oldval, ioport_value newval);
1259   ioport_type token_to_input_type(const char *string, int &player) const;
1260   const char *input_type_to_token(astring &string, ioport_type type, int player);
1261   void frame_update();
9401262
941   /* specific special global input states */
942   digital_joystick_state      joystick_info[MAX_PLAYERS][DIGITAL_JOYSTICKS_PER_PLAYER]; /* joystick states */
1263private:
1264   // internal helpers
1265   void init_port_types();
1266   void init_autoselect_devices(int type1, int type2, int type3, const char *option, const char *ananame);
9431267
944   /* frame time tracking */
945   attotime               last_frame_time;   /* time of the last frame callback */
946   attoseconds_t            last_delta_nsec;   /* nanoseconds that passed since the previous callback */
1268   ioport_port *port(const char *tag) const { return m_portlist.find(tag); }
1269   void exit();
1270   input_seq_type token_to_seq_type(const char *string);
1271   void update_defaults();
9471272
948   /* playback/record information */
949   emu_file *               record_file;      /* recording file (NULL if not recording) */
950   emu_file *               playback_file;      /* playback file (NULL if not recording) */
951   UINT64                  playback_accumulated_speed;/* accumulated speed during playback */
952   UINT32                  playback_accumulated_frames;/* accumulated frames during playback */
1273   void load_config(int config_type, xml_data_node *parentnode);
1274   void load_remap_table(xml_data_node *parentnode);
1275   bool load_default_config(xml_data_node *portnode, int type, int player, const input_seq *newseq);
1276   bool load_game_config(xml_data_node *portnode, int type, int player, const input_seq *newseq);
9531277
954   /* inputx */
955   inputx_code *codes;
956   key_buffer keybuffer;
957   emu_timer *inputx_timer;
958   int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len);
959   int (*accept_char)(running_machine &machine, unicode_char ch);
960   int (*charqueue_empty)(running_machine &machine);
961   attotime current_rate;
1278   void save_config(int config_type, xml_data_node *parentnode);
1279   void save_sequence(xml_data_node *parentnode, input_seq_type type, ioport_type porttype, const input_seq &seq);
1280   bool save_this_input_field_type(ioport_type type);
1281   void save_default_inputs(xml_data_node *parentnode);
1282   void save_game_inputs(xml_data_node *parentnode);
9621283
963private:
964   input_port_config *port(const char *tag) const { return m_portlist.find(tag); }
1284   template<typename _Type> _Type playback_read(_Type &result);
1285   time_t playback_init();
1286   void playback_end(const char *message = NULL);
1287   void playback_frame(attotime curtime);
1288   void playback_port(ioport_port &port);
9651289
966   // internals
967   ioport_list            m_portlist;         // points to a list of input port configurations
1290   template<typename _Type> void record_write(_Type value);
1291   void record_init();
1292   void record_end(const char *message = NULL);
1293   void record_frame(attotime curtime);
1294   void record_port(ioport_port &port);
9681295
9691296   // internal state
970   running_machine &      m_machine;
1297   running_machine &      m_machine;            // reference to owning machine
1298   bool               m_safe_to_read;         // clear at start; set after state is loaded
1299   ioport_list            m_portlist;            // list of input port configurations
1300
1301   // types
1302   simple_list<input_type_entry> m_typelist;      // list of live type states
1303   input_type_entry *      m_type_to_entry[IPT_COUNT][MAX_PLAYERS]; // map from type/player to type state
1304
1305   // specific special global input states
1306   simple_list<digital_joystick> m_joystick_list;   // list of digital joysticks
1307   natural_keyboard      m_natkeyboard;         // natural keyboard support
1308
1309   // frame time tracking
1310   attotime            m_last_frame_time;      // time of the last frame callback
1311   attoseconds_t         m_last_delta_nsec;      // nanoseconds that passed since the previous callback
1312
1313   // playback/record information
1314   emu_file            m_record_file;         // recording file (NULL if not recording)
1315   emu_file            m_playback_file;      // playback file (NULL if not recording)
1316   UINT64               m_playback_accumulated_speed; // accumulated speed during playback
1317   UINT32               m_playback_accumulated_frames; // accumulated frames during playback
9711318};
9721319
9731320
974/***************************************************************************
975    MACROS
976***************************************************************************/
1321// ======================> ioport_configurer
9771322
978/* macro for a read callback function (PORT_CUSTOM) */
979#define CUSTOM_INPUT(name)   input_port_value name(device_t &device, const input_field_config &field, void *param)
980#define CUSTOM_INPUT_MEMBER(name)   input_port_value name(const input_field_config &field, void *param)
981#define DECLARE_CUSTOM_INPUT_MEMBER(name)   input_port_value name(const input_field_config &field, void *param)
1323// class to wrap helper functions
1324class ioport_configurer
1325{
1326public:
1327   // construction/destruction
1328   ioport_configurer(device_t &owner, ioport_list &portlist, astring &errorbuf);
9821329
983/* macro for port write callback functions (PORT_CHANGED) */
984#define INPUT_CHANGED(name)   void name(device_t &device, const input_field_config &field, void *param, input_port_value oldval, input_port_value newval)
985#define INPUT_CHANGED_MEMBER(name)   void name(const input_field_config &field, void *param, input_port_value oldval, input_port_value newval)
986#define DECLARE_INPUT_CHANGED_MEMBER(name)   void name(const input_field_config &field, void *param, input_port_value oldval, input_port_value newval)
1330   // static helpers
1331   static const char *string_from_token(const char *string);
9871332
988/* macro for port changed callback functions (PORT_CROSSHAIR_MAPPER) */
989#define CROSSHAIR_MAPPER(name)   float name(device_t &device, const input_field_config &field, float linear_value)
990#define CROSSHAIR_MAPPER_MEMBER(name)   float name(const input_field_config &field, float linear_value)
991#define DECLARE_CROSSHAIR_MAPPER_MEMBER(name)   float name(const input_field_config &field, float linear_value)
1333   // port helpers
1334   void port_alloc(const char *tag);
1335   void port_modify(const char *tag);
9921336
993/* macro for wrapping a default string */
994#define DEF_STR(str_num) ((const char *)INPUT_STRING_##str_num)
1337   // field helpers
1338   void field_alloc(ioport_type type, ioport_value defval, ioport_value mask, const char *name = NULL);
1339   void field_add_char(unicode_char ch);
1340   void field_add_code(input_seq_type which, input_code code);
1341   void field_set_way(int way) const { m_curfield->m_way = way; }
1342   void field_set_rotated() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_ROTATED; }
1343   void field_set_name(const char *name) const { m_curfield->m_name = string_from_token(name); }
1344   void field_set_player(int player) const { m_curfield->m_player = player - 1; }
1345   void field_set_cocktail() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_COCKTAIL; field_set_player(2); }
1346   void field_set_toggle() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_TOGGLE; }
1347   void field_set_impulse(UINT8 impulse) const { m_curfield->m_impulse = impulse; }
1348   void field_set_analog_reverse() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_REVERSE; }
1349   void field_set_analog_reset() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_RESET; }
1350   void field_set_unused() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_UNUSED; }
1351   void field_set_min_max(ioport_value minval, ioport_value maxval) const { m_curfield->m_min = minval; m_curfield->m_max = maxval; }
1352   void field_set_sensitivity(INT32 sensitivity) const { m_curfield->m_sensitivity = sensitivity; }
1353   void field_set_delta(INT32 delta) const { m_curfield->m_centerdelta = m_curfield->m_delta = delta; }
1354   void field_set_centerdelta(INT32 delta) const { m_curfield->m_centerdelta = delta; }
1355   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; }
1356   void field_set_crossmapper(ioport_field_crossmap_delegate callback) const { m_curfield->m_crosshair_mapper = callback; }
1357   void field_set_full_turn_count(UINT16 count) const { m_curfield->m_full_turn_count = count; }
1358   void field_set_analog_wraps() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_WRAPS; }
1359   void field_set_remap_table(const ioport_value *table) { m_curfield->m_remap_table = table; }
1360   void field_set_analog_invert() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_INVERT; }
1361   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; }
1362   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; }
1363   void field_set_diplocation(const char *location) const { m_curfield->expand_diplocation(location, m_errorbuf); }
9951364
1365   // setting helpers
1366   void setting_alloc(ioport_value value, const char *name);
9961367
997template<int (*_FunctionPointer)(device_t *)>
998input_port_value ioport_read_line_wrapper(device_t &device, const input_field_config &field, void *param)
999{
1000   return (*_FunctionPointer)(&device);
1001}
1368   // misc helpers
1369   void set_condition(ioport_condition::condition_t condition, const char *tag, ioport_value mask, ioport_value value);
1370   void onoff_alloc(const char *name, ioport_value defval, ioport_value mask, const char *diplocation);
10021371
1003template<class _FunctionClass, int (_FunctionClass::*_FunctionPointer)()>
1004input_port_value ioport_read_line_wrapper(_FunctionClass &device, const input_field_config &field, void *param)
1005{
1006   return (device.*_FunctionPointer)();
1007}
1372private:
1373   // internal state
1374   device_t &         m_owner;
1375   ioport_list &      m_portlist;
1376   astring &         m_errorbuf;
1377   
1378   ioport_port *      m_curport;
1379   ioport_field *      m_curfield;
1380   ioport_setting *   m_cursetting;
1381};
10081382
1009template<void (*_FunctionPointer)(device_t *, int)>
1010void ioport_write_line_wrapper(device_t &device, const input_field_config &field, void *param, input_port_value oldval, input_port_value newval)
1011{
1012   return (*_FunctionPointer)(&device, newval);
1013}
10141383
1015template<class _FunctionClass, void (_FunctionClass::*_FunctionPointer)(int)>
1016void ioport_write_line_wrapper(_FunctionClass &device, const input_field_config &field, void *param, input_port_value oldval, input_port_value newval)
1017{
1018   return (device.*_FunctionPointer)(newval);
1019}
10201384
1385//**************************************************************************
1386//  MACROS
1387//**************************************************************************
10211388
1389#define UCHAR_MAMEKEY(code)   (UCHAR_MAMEKEY_BEGIN + ITEM_ID_##code)
10221390
1023/***************************************************************************
1024    MACROS FOR BUILDING INPUT PORTS
1025***************************************************************************/
1391// macro for a read callback function (PORT_CUSTOM)
1392#define CUSTOM_INPUT(name)   ioport_value name(device_t &device, ioport_field &field, void *param)
1393#define CUSTOM_INPUT_MEMBER(name)   ioport_value name(ioport_field &field, void *param)
1394#define DECLARE_CUSTOM_INPUT_MEMBER(name)   ioport_value name(ioport_field &field, void *param)
10261395
1027typedef void (*ioport_constructor)(device_t &owner, ioport_list &portlist, astring &errorbuf);
1396// macro for port write callback functions (PORT_CHANGED)
1397#define INPUT_CHANGED(name)   void name(device_t &device, ioport_field &field, void *param, ioport_value oldval, ioport_value newval)
1398#define INPUT_CHANGED_MEMBER(name)   void name(ioport_field &field, void *param, ioport_value oldval, ioport_value newval)
1399#define DECLARE_INPUT_CHANGED_MEMBER(name)   void name(ioport_field &field, void *param, ioport_value oldval, ioport_value newval)
10281400
1029/* so that "0" can be used for unneeded input ports */
1401// macro for port changed callback functions (PORT_CROSSHAIR_MAPPER)
1402#define CROSSHAIR_MAPPER(name)   float name(device_t &device, ioport_field &field, float linear_value)
1403#define CROSSHAIR_MAPPER_MEMBER(name)   float name(ioport_field &field, float linear_value)
1404#define DECLARE_CROSSHAIR_MAPPER_MEMBER(name)   float name(ioport_field &field, float linear_value)
1405
1406// macro for wrapping a default string
1407#define DEF_STR(str_num) ((const char *)INPUT_STRING_##str_num)
1408
1409
1410
1411//**************************************************************************
1412//  MACROS FOR BUILDING INPUT PORTS
1413//**************************************************************************
1414
1415// so that "0" can be used for unneeded input ports
10301416#define construct_ioport_0 NULL
10311417
1032/* name of table */
1418// name of table
10331419#define INPUT_PORTS_NAME(_name) construct_ioport_##_name
10341420
1035/* start of table */
1421// start of table
10361422#define INPUT_PORTS_START(_name) \
10371423ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, astring &errorbuf) \
10381424{ \
1039   astring fulltag; \
1040   input_setting_config *cursetting = NULL; \
1041   input_field_config *curfield = NULL; \
1042   input_port_config *curport = NULL; \
1043   input_port_value maskbits = 0; \
1044   (void)cursetting; (void)curfield; (void)curport; (void)maskbits; \
1425   ioport_configurer configurer(owner, portlist, errorbuf); \
10451426
1046/* end of table */
1427// end of table
10471428#define INPUT_PORTS_END \
10481429}
10491430
1050/* aliasing */
1431// aliasing
10511432#define INPUT_PORTS_EXTERN(_name) \
10521433   extern void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, astring &errorbuf)
10531434
1054/* including */
1435// including
10551436#define PORT_INCLUDE(_name) \
10561437   INPUT_PORTS_NAME(_name)(owner, portlist, errorbuf); \
10571438
1058/* start of a new input port (with included tag) */
1439// start of a new input port (with included tag)
10591440#define PORT_START(_tag) \
1060   curport = ioconfig_alloc_port(portlist, owner, _tag); \
1061   curfield = NULL; \
1062   cursetting = NULL; \
1063   maskbits = 0; \
1441   configurer.port_alloc(_tag); \
10641442
1065/* modify an existing port */
1443// modify an existing port
10661444#define PORT_MODIFY(_tag) \
1067   curport = ioconfig_modify_port(portlist, owner, _tag); \
1068   curfield = NULL; \
1069   cursetting = NULL; \
1070   maskbits = 0; \
1445   configurer.port_modify(_tag); \
10711446
1072/* input bit definition */
1447// input bit definition
10731448#define PORT_BIT(_mask, _default, _type) \
1074   curfield = ioconfig_alloc_field(*curport, (_type), (_default), (_mask)); \
1075   cursetting = NULL;
1449   configurer.field_alloc((_type), (_default), (_mask)); \
10761450
1077#define PORT_SPECIAL_ONOFF(_mask, _default, _strindex) PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, _strindex, NULL)
1451#define PORT_SPECIAL_ONOFF(_mask, _default, _strindex) \
1452   PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, _strindex, NULL)
10781453
10791454#define PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, _strindex, _diploc) \
1080   curfield = ioconfig_alloc_onoff(*curport, DEF_STR(_strindex), _default, _mask, _diploc, errorbuf); \
1081   cursetting = NULL;
1455   configurer.onoff_alloc(DEF_STR(_strindex), _default, _mask, _diploc); \
10821456
1083/* append a code */
1457// append a code
10841458#define PORT_CODE(_code) \
1085   ioconfig_add_code(*curfield, SEQ_TYPE_STANDARD, _code);
1459   configurer.field_add_code(SEQ_TYPE_STANDARD, _code);
10861460
10871461#define PORT_CODE_DEC(_code) \
1088   ioconfig_add_code(*curfield, SEQ_TYPE_DECREMENT, _code);
1462   configurer.field_add_code(SEQ_TYPE_DECREMENT, _code);
10891463
10901464#define PORT_CODE_INC(_code) \
1091   ioconfig_add_code(*curfield, SEQ_TYPE_INCREMENT, _code);
1465   configurer.field_add_code(SEQ_TYPE_INCREMENT, _code);
10921466
1093/* joystick flags */
1467// joystick flags
10941468#define PORT_2WAY \
1095   curfield->way = 2;
1469   configurer.field_set_way(2);
10961470
10971471#define PORT_4WAY \
1098   curfield->way = 4;
1472   configurer.field_set_way(4);
10991473
11001474#define PORT_8WAY \
1101   curfield->way = 8;
1475   configurer.field_set_way(8);
11021476
11031477#define PORT_16WAY \
1104   curfield->way = 16;
1478   configurer.field_set_way(16);
11051479
11061480#define PORT_ROTATED \
1107   curfield->flags |= FIELD_FLAG_ROTATED
1481   configurer.field_set_rotated();
11081482
1109/* general flags */
1483// general flags
11101484#define PORT_NAME(_name) \
1111   curfield->name = input_port_string_from_token(_name);
1485   configurer.field_set_name(_name);
11121486
11131487#define PORT_PLAYER(_player) \
1114   curfield->player = (_player) - 1;
1488   configurer.field_set_player(_player);
11151489
11161490#define PORT_COCKTAIL \
1117   curfield->flags |= FIELD_FLAG_COCKTAIL; \
1118   curfield->player = 1;
1491   configurer.field_set_cocktail();
11191492
11201493#define PORT_TOGGLE \
1121   curfield->flags |= FIELD_FLAG_TOGGLE;
1494   configurer.field_set_toggle();
11221495
11231496#define PORT_IMPULSE(_duration) \
1124   curfield->impulse = _duration;
1497   configurer.field_set_impulse(_duration);
11251498
11261499#define PORT_REVERSE \
1127   curfield->flags |= ANALOG_FLAG_REVERSE;
1500   configurer.field_set_analog_reverse();
11281501
11291502#define PORT_RESET \
1130   curfield->flags |= ANALOG_FLAG_RESET;
1503   configurer.field_set_analog_reset();
11311504
11321505#define PORT_UNUSED \
1133   curfield->flags |= FIELD_FLAG_UNUSED;
1506   configurer.field_set_unused();
11341507
1135/* analog settings */
1136/* if this macro is not used, the minimum defaluts to 0 and maximum defaults to the mask value */
1508// analog settings
1509// if this macro is not used, the minimum defaluts to 0 and maximum defaults to the mask value
11371510#define PORT_MINMAX(_min, _max) \
1138   curfield->min = _min; \
1139   curfield->max = _max;
1511   configurer.field_set_min_max(_min, _max);
11401512
11411513#define PORT_SENSITIVITY(_sensitivity) \
1142   curfield->sensitivity = _sensitivity;
1514   configurer.field_set_sensitivity(_sensitivity);
11431515
11441516#define PORT_KEYDELTA(_delta) \
1145   curfield->delta = curfield->centerdelta = _delta;
1517   configurer.field_set_delta(_delta); \
11461518
1147/* note that PORT_CENTERDELTA must appear after PORT_KEYDELTA */
1519// note that PORT_CENTERDELTA must appear after PORT_KEYDELTA
11481520#define PORT_CENTERDELTA(_delta) \
1149   curfield->centerdelta = _delta;
1521   configurer.field_set_centerdelta(_delta);
11501522
11511523#define PORT_CROSSHAIR(axis, scale, offset, altaxis) \
1152   curfield->crossaxis = CROSSHAIR_AXIS_##axis; \
1153   curfield->crossaltaxis = altaxis; \
1154   curfield->crossscale = scale; \
1155   curfield->crossoffset = offset;
1524   configurer.field_set_crosshair(CROSSHAIR_AXIS_##axis, altaxis, scale, offset);
11561525
11571526#define PORT_CROSSHAIR_MAPPER(_callback) \
1158   curfield->crossmapper = input_field_crossmap_delegate(_callback, #_callback, (device_t *)NULL); \
1159   curfield->crossmapper_device = DEVICE_SELF;
1527   configurer.field_set_crossmapper(ioport_field_crossmap_delegate(_callback, #_callback, DEVICE_SELF, (device_t *)NULL));
11601528
11611529#define PORT_CROSSHAIR_MAPPER_MEMBER(_device, _class, _member) \
1162   curfield->crossmapper = input_field_crossmap_delegate(&_class::_member, #_class "::" #_member, (_class *)NULL); \
1163   curfield->crossmapper_device = _device;
1530   configurer.field_set_crossmapper(ioport_field_crossmap_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)NULL));
11641531
1165/* how many optical counts for 1 full turn of the control */
1532// how many optical counts for 1 full turn of the control
11661533#define PORT_FULL_TURN_COUNT(_count) \
1167   curfield->full_turn_count = _count;
1534   configurer.field_set_full_turn_count(_count);
11681535
1169/* positional controls can be binary or 1 of X */
1170/* 1 of X not completed yet */
1171/* if it is specified as PORT_REMAP_TABLE then it is binary, but remapped */
1172/* otherwise it is binary */
1536// positional controls can be binary or 1 of X
1537// 1 of X not completed yet
1538// if it is specified as PORT_REMAP_TABLE then it is binary, but remapped
1539// otherwise it is binary
11731540#define PORT_POSITIONS(_positions) \
1174   curfield->max = _positions;
1541   configurer.field_set_min_max(0, _positions);
11751542
1176/* positional control wraps at min/max */
1543// positional control wraps at min/max
11771544#define PORT_WRAPS \
1178   curfield->flags |= ANALOG_FLAG_WRAPS;
1545   configurer.field_set_analog_wraps();
11791546
1180/* positional control uses this remap table */
1547// positional control uses this remap table
11811548#define PORT_REMAP_TABLE(_table) \
1182   curfield->remap_table = _table;
1549   configurer.field_set_remap_table(_table);
11831550
1184/* positional control bits are active low */
1551// positional control bits are active low
11851552#define PORT_INVERT \
1186   curfield->flags |= ANALOG_FLAG_INVERT;
1553   configurer.field_set_analog_invert();
11871554
1188/* read callbacks */
1555// read callbacks
11891556#define PORT_CUSTOM(_callback, _param) \
1190   curfield->read = input_field_read_delegate(_callback, #_callback, (device_t *)NULL); \
1191   curfield->read_param = (void *)(_param); \
1192   curfield->read_device = DEVICE_SELF;
1557   configurer.field_set_dynamic_read(ioport_field_read_delegate(_callback, #_callback, DEVICE_SELF, (device_t *)NULL), (void *)(_param));
11931558
11941559#define PORT_CUSTOM_MEMBER(_device, _class, _member, _param) \
1195   curfield->read = input_field_read_delegate(&_class::_member, #_class "::" #_member, (_class *)NULL); \
1196   curfield->read_param = (void *)(_param); \
1197   curfield->read_device = (_device);
1560   configurer.field_set_dynamic_read(ioport_field_read_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)NULL), (void *)(_param));
11981561
1199/* write callbacks */
1562// write callbacks
12001563#define PORT_CHANGED(_callback, _param) \
1201   curfield->write = input_field_write_delegate(_callback, #_callback, (device_t *)NULL); \
1202   curfield->write_param = (void *)(_param); \
1203   curfield->write_device = DEVICE_SELF;
1564   configurer.field_set_dynamic_write(ioport_field_write_delegate(_callback, #_callback, DEVICE_SELF, (device_t *)NULL), (void *)(_param));
12041565
12051566#define PORT_CHANGED_MEMBER(_device, _class, _member, _param) \
1206   curfield->write = input_field_write_delegate(&_class::_member, #_class "::" #_member, (_class *)NULL); \
1207   curfield->write_param = (void *)(_param); \
1208   curfield->write_device = (_device);
1567   configurer.field_set_dynamic_write(ioport_field_write_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)NULL), (void *)(_param));
12091568
1210/* input device handler */
1569// input device handler
12111570#define PORT_READ_LINE_DEVICE(_device, _read_line_device) \
1212   curfield->read = input_field_read_delegate(&ioport_read_line_wrapper<_read_line_device>, #_read_line_device, (device_t *)NULL); \
1213   curfield->read_param = NULL; \
1214   curfield->read_device = _device;
1571   configurer.field_set_dynamic_read(ioport_field_read_delegate(&ioport_read_line_wrapper<_read_line_device>, #_read_line_device, _device, (device_t *)NULL));
12151572
12161573#define PORT_READ_LINE_DEVICE_MEMBER(_device, _class, _member) \
1217   curfield->read = input_field_read_delegate(&ioport_read_line_wrapper<_class, &_class::_member>, #_class "::" #_member, (_class *)NULL); \
1218   curfield->read_param = NULL; \
1219   curfield->read_device = _device;
1574   configurer.field_set_dynamic_read(ioport_field_read_delegate(&ioport_read_line_wrapper<_class, &_class::_member>, #_class "::" #_member, _device, (_class *)NULL));
12201575
1221/* output device handler */
1576// output device handler
12221577#define PORT_WRITE_LINE_DEVICE(_device, _write_line_device) \
1223   curfield->write = input_field_write_delegate(&ioport_write_line_wrapper<_write_line_device>, #_write_line_device, (device_t *)NULL); \
1224   curfield->write_param = NULL; \
1225   curfield->write_device = _device;
1578   configurer.field_set_dynamic_write(ioport_field_write_delegate(&ioport_write_line_wrapper<_write_line_device>, #_write_line_device, _device, (device_t *)NULL));
12261579
12271580#define PORT_WRITE_LINE_DEVICE_MEMBER(_device, _class, _member) \
1228   curfield->write = input_field_write_delegate(&ioport_write_line_wrapper<_class, &_class::_member>, #_class "::" #_member, (_class *)NULL); \
1229   curfield->write_param = NULL; \
1230   curfield->write_device = _device;
1581   configurer.field_set_dynamic_write(ioport_field_write_delegate(&ioport_write_line_wrapper<_class, &_class::_member>, #_class "::" #_member, _device, (_class *)NULL));
12311582
1232/* dip switch definition */
1583// dip switch definition
12331584#define PORT_DIPNAME(_mask, _default, _name) \
1234   curfield = ioconfig_alloc_field(*curport, IPT_DIPSWITCH, (_default), (_mask), (_name)); \
1235   cursetting = NULL;
1585   configurer.field_alloc(IPT_DIPSWITCH, (_default), (_mask), (_name)); \
12361586
12371587#define PORT_DIPSETTING(_default, _name) \
1238   cursetting = ioconfig_alloc_setting(*curfield, (_default) & curfield->mask, (_name));
1588   configurer.setting_alloc((_default), (_name)); \
12391589
1240/* physical location, of the form: name:[!]sw,[name:][!]sw,... */
1241/* note that these are specified LSB-first */
1590// physical location, of the form: name:[!]sw,[name:][!]sw,...
1591// note that these are specified LSB-first
12421592#define PORT_DIPLOCATION(_location) \
1243   diplocation_list_alloc(*curfield, _location, errorbuf);
1593   configurer.field_set_diplocation(_location); \
12441594
1245/* conditionals for dip switch settings */
1595// conditionals for dip switch settings
12461596#define PORT_CONDITION(_tag, _mask, _condition, _value) \
1247{ \
1248   input_condition &condition = (cursetting != NULL) ? cursetting->condition : curfield->condition; \
1249   condition.tag = (_tag); \
1250   condition.mask = (_mask); \
1251   condition.condition = (_condition); \
1252   condition.value = (_value); \
1253}
1597   configurer.set_condition(ioport_condition::_condition, _tag, _mask, _value); \
12541598
1255/* analog adjuster definition */
1599// analog adjuster definition
12561600#define PORT_ADJUSTER(_default, _name) \
1257   curfield = ioconfig_alloc_field(*curport, IPT_ADJUSTER, (_default), 0xff, (_name)); \
1258   cursetting = NULL; \
1601   configurer.field_alloc(IPT_ADJUSTER, (_default), 0xff, (_name)); \
12591602
1260/* config definition */
1603// config definition
12611604#define PORT_CONFNAME(_mask, _default, _name) \
1262   curfield = ioconfig_alloc_field(*curport, IPT_CONFIG, (_default), (_mask), (_name)); \
1263   cursetting = NULL; \
1605   configurer.field_alloc(IPT_CONFIG, (_default), (_mask), (_name)); \
12641606
12651607#define PORT_CONFSETTING(_default, _name) \
1266   cursetting = ioconfig_alloc_setting(*curfield, (_default) & curfield->mask, (_name));
1608   configurer.setting_alloc((_default), (_name));
12671609
1268/* keyboard chars */
1610// keyboard chars
12691611#define PORT_CHAR(_ch) \
1270   ioconfig_field_add_char(*curfield, _ch, errorbuf);
1612   configurer.field_add_char(_ch);
12711613
12721614
1273/* name of table */
1615// name of table
12741616#define DEVICE_INPUT_DEFAULTS_NAME(_name) device_iptdef_##_name
12751617
12761618#define device_iptdef_0 NULL
12771619#define device_iptdef___null NULL
12781620
1279/* start of table */
1621// start of table
12801622#define DEVICE_INPUT_DEFAULTS_START(_name) \
12811623   const input_device_default DEVICE_INPUT_DEFAULTS_NAME(_name)[] = {
12821624
1283/* end of table */
1625// end of table
12841626#define DEVICE_INPUT_DEFAULTS(_tag,_mask,_defval) \
12851627   { _tag ,_mask, _defval }, \
12861628
1287/* end of table */
1629// end of table
12881630#define DEVICE_INPUT_DEFAULTS_END \
12891631   {NULL,0,0} };
12901632
1291/***************************************************************************
1292    HELPER MACROS
1293***************************************************************************/
12941633
1634
1635//**************************************************************************
1636//  HELPER MACROS
1637//**************************************************************************
1638
12951639#define PORT_DIPUNUSED_DIPLOC(_mask, _default, _diploc) \
12961640   PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, Unused, _diploc)
12971641
r15082r15083
13131657#define PORT_SERVICE_NO_TOGGLE(_mask, _default) \
13141658   PORT_BIT( _mask, _mask & _default, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ))
13151659
1660#define PORT_VBLANK(_screen) \
1661   PORT_READ_LINE_DEVICE_MEMBER(_screen, screen_device, vblank_port_read)
13161662
13171663
1318/***************************************************************************
1319    FUNCTION PROTOTYPES
1320***************************************************************************/
13211664
1665//**************************************************************************
1666//  INLINE TEMPLATES
1667//**************************************************************************
13221668
1323/* ----- port configurations ----- */
1669template<int (*_FunctionPointer)(device_t *)>
1670ioport_value ioport_read_line_wrapper(device_t &device, ioport_field &field, void *param)
1671{
1672   return (*_FunctionPointer)(&device);
1673}
13241674
1325/* initialize an input port list structure and allocate ports according to the given tokens */
1326void input_port_list_init(device_t &device, ioport_list &portlist, astring &errorbuf);
1675template<class _FunctionClass, int (_FunctionClass::*_FunctionPointer)()>
1676ioport_value ioport_read_line_wrapper(_FunctionClass &device, ioport_field &field, void *param)
1677{
1678   return (device.*_FunctionPointer)();
1679}
13271680
1328/* return the field that matches the given tag and mask */
1329const input_field_config *input_field_by_tag_and_mask(running_machine &machine, const char *tag, input_port_value mask);
1681template<void (*_FunctionPointer)(device_t *, int)>
1682void ioport_write_line_wrapper(device_t &device, ioport_field &field, void *param, ioport_value oldval, ioport_value newval)
1683{
1684   return (*_FunctionPointer)(&device, newval);
1685}
13301686
1687template<class _FunctionClass, void (_FunctionClass::*_FunctionPointer)(int)>
1688void ioport_write_line_wrapper(_FunctionClass &device, ioport_field &field, void *param, ioport_value oldval, ioport_value newval)
1689{
1690   return (device.*_FunctionPointer)(newval);
1691}
13311692
13321693
1333/* ----- accessors for input types ----- */
13341694
1335/* return TRUE if the given type represents an analog control */
1336int input_type_is_analog(int type);
1695//**************************************************************************
1696//  INLINE FUNCITONS
1697//**************************************************************************
13371698
1338/* return the name for the given type/player */
1339const char *input_type_name(running_machine &machine, int type, int player);
1699inline ioport_manager &ioport_field::manager() const { return m_port.manager(); }
1700inline device_t &ioport_field::device() const { return m_port.device(); }
1701inline running_machine &ioport_field::machine() const { return m_port.machine(); }
13401702
1341/* return the group for the given type/player */
1342int input_type_group(running_machine &machine, int type, int player);
1703inline device_t &ioport_setting::device() const { return m_field.device(); }
1704inline running_machine &ioport_setting::machine() const { return m_field.machine(); }
13431705
1344/* return the global input mapping sequence for the given type/player */
1345const input_seq &input_type_seq(running_machine &machine, int type, int player, input_seq_type seqtype);
13461706
1347/* change the global input sequence for the given type/player */
1348void input_type_set_seq(running_machine &machine, int type, int player, input_seq_type seqtype, const input_seq *newseq);
1349
1350/* return TRUE if the sequence for the given input type/player is pressed */
1351int input_type_pressed(running_machine &machine, int type, int player);
1352
1353/* return the list of default mappings */
1354const simple_list<input_type_entry> &input_type_list(running_machine &machine);
1355
1356
1357
1358/* ----- accessors for input fields ----- */
1359
1360/* return the expanded string name of the field */
1361const char *input_field_name(const input_field_config *field);
1362
1363/* return the input sequence for the given input field */
1364const input_seq &input_field_seq(const input_field_config *field, input_seq_type seqtype);
1365
1366/* return the current settings for the given input field */
1367void input_field_get_user_settings(const input_field_config *field, input_field_user_settings *settings);
1368
1369/* modify the current settings for the given input field */
1370void input_field_set_user_settings(const input_field_config *field, const input_field_user_settings *settings);
1371
1372/* return the expanded setting name for a field */
1373const char *input_field_setting_name(const input_field_config *field);
1374
1375/* return TRUE if the given field has a "previous" setting */
1376int input_field_has_previous_setting(const input_field_config *field);
1377
1378/* select the previous item for a DIP switch or configuration field */
1379void input_field_select_previous_setting(const input_field_config *field);
1380
1381/* return TRUE if the given field has a "next" setting */
1382int input_field_has_next_setting(const input_field_config *field);
1383
1384/* select the next item for a DIP switch or configuration field */
1385void input_field_select_next_setting(const input_field_config *field);
1386
1387
1388/* ----- port checking ----- */
1389
1390/* return whether an input port exists */
1391bool input_port_exists(running_machine &machine, const char *tag);
1392
1393/* return a bitmask of which bits of an input port are active (i.e. not unused or unknown) */
1394input_port_value input_port_active(running_machine &machine, const char *tag);
1395
1396/* 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 */
1397input_port_value input_port_active_safe(running_machine &machine, const char *tag, input_port_value defvalue);
1398
1399
1400/* ----- port reading ----- */
1401
1402/* return the value of an input port */
1403input_port_value input_port_read_direct(const input_port_config *port);
1404
1405/* return the value of an input port specified by tag */
1406input_port_value input_port_read(running_machine &machine, const char *tag);
1407
1408/* return the value of a device input port specified by tag */
1409input_port_value input_port_read(device_t &device, const char *tag);
1410
1411/* return the value of an input port specified by tag, or a default value if the port does not exist */
1412input_port_value input_port_read_safe(running_machine &machine, const char *tag, input_port_value defvalue);
1413
1414/* return the extracted crosshair values for the given player */
1415int input_port_get_crosshair_position(running_machine &machine, int player, float *x, float *y);
1416
1417/* force an update to the input port values based on current conditions */
1418void input_port_update_defaults(running_machine &machine);
1419
1420
1421
1422/* ----- port writing ----- */
1423
1424/* write a value to a port */
1425void input_port_write_direct(const input_port_config *port, input_port_value value, input_port_value mask);
1426
1427/* write a value to a port specified by tag */
1428void input_port_write(running_machine &machine, const char *tag, input_port_value value, input_port_value mask);
1429
1430/* write a value to a port, ignore if the port does not exist */
1431void input_port_write_safe(running_machine &machine, const char *tag, input_port_value value, input_port_value mask);
1432
1433
1434
1435/* ----- misc helper functions ----- */
1436
1437/* return the TRUE if the given condition attached is true */
1438int input_condition_true(running_machine &machine, const input_condition *condition,device_t &owner);
1439
1440/* convert an input_port_token to a default string */
1441const char *input_port_string_from_token(const char *token);
1442
1443/* return TRUE if machine use full keyboard emulation */
1444int input_machine_has_keyboard(running_machine &machine);
1445
1446/* these are called by the core; they should not be called from FEs */
1447void inputx_init(running_machine &machine);
1448
1449/* called by drivers to setup natural keyboard support */
1450void inputx_setup_natural_keyboard(running_machine &machine,
1451   int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len),
1452   int (*accept_char)(running_machine &machine, unicode_char ch),
1453   int (*charqueue_empty)(running_machine &machine));
1454
1455/* validity checks */
1456int validate_natural_keyboard_statics(void);
1457
1458/* these can be called from FEs */
1459int inputx_can_post(running_machine &machine);
1460
1461/* various posting functions; can be called from FEs */
1462void inputx_postc(running_machine &machine, unicode_char ch);
1463void inputx_post_utf8(running_machine &machine, const char *text);
1464void inputx_post_utf8_rate(running_machine &machine, const char *text, attotime rate);
1465int inputx_is_posting(running_machine &machine);
1466
1467/* miscellaneous functions */
1468int input_classify_port(const input_field_config *field);
1469int input_has_input_class(running_machine &machine, int inputclass);
1470int input_player_number(const input_field_config *field);
1471int input_count_players(running_machine &machine);
1472
1473
1474inline running_machine &input_field_config::machine() const
1475{
1476   return m_port.machine();
1477}
1478
1479
1480// temporary construction helpers
1481void field_config_insert(input_field_config &newfield, input_port_value &disallowedbits, astring &errorbuf);
1482void diplocation_list_alloc(input_field_config &field, const char *location, astring &errorbuf);
1483
1484
1485input_port_config *ioconfig_alloc_port(ioport_list &portlist, device_t &device, const char *tag);
1486input_port_config *ioconfig_modify_port(ioport_list &portlist, device_t &device, const char *tag);
1487input_field_config *ioconfig_alloc_field(input_port_config &port, int type, input_port_value defval, input_port_value mask, const char *name = NULL);
1488input_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);
1489input_setting_config *ioconfig_alloc_setting(input_field_config &field, input_port_value value, const char *name);
1490void ioconfig_field_add_char(input_field_config &field, unicode_char ch, astring &errorbuf);
1491void ioconfig_add_code(input_field_config &field, int which, input_code code);
1492
1493#endif   /* __INPTPORT_H__ */
1707#endif   // __INPTPORT_H__ */
src/emu/uimain.c
r15082r15083
109109
110110void ui_menu_main::populate()
111111{
112   input_field_config *field;
113   input_port_config *port;
112   ioport_field *field;
113   ioport_port *port;
114114   int has_configs = false;
115115   int has_analog = false;
116116   int has_dips = false;
r15082r15083
118118   astring menu_text;
119119   /* scan the input port array to see what options we need to enable */
120120   for (port = machine().ioport().first_port(); port != NULL; port = port->next())
121      for (field = port->fieldlist().first(); field != NULL; field = field->next())
121      for (field = port->first_field(); field != NULL; field = field->next())
122122      {
123         if (field->type == IPT_DIPSWITCH)
123         if (field->type() == IPT_DIPSWITCH)
124124            has_dips = true;
125         if (field->type == IPT_CONFIG)
125         if (field->type() == IPT_CONFIG)
126126            has_configs = true;
127         if (input_type_is_analog(field->type))
127         if (field->is_analog())
128128            has_analog = true;
129129      }
130130   device_iterator deviter(machine().root_device());
r15082r15083
192192   }
193193
194194   /* add keyboard mode menu */
195   if (input_machine_has_keyboard(machine()) && inputx_can_post(machine()))
195   if (machine().ioport().has_keyboard() && machine().ioport().natkeyboard().can_post())
196196      item_append("Keyboard Mode", NULL, 0, (void *)KEYBOARD_MODE);
197197
198198   /* add sliders menu */
r15082r15083
671671   suborder[SEQ_TYPE_INCREMENT] = 2;
672672
673673   /* iterate over the input ports and add menu items */
674   for (input_type_entry *entry = input_type_list(machine()).first(); entry != NULL; entry = entry->next())
674   for (input_type_entry *entry = machine().ioport().first_type(); entry != NULL; entry = entry->next())
675675
676676      /* add if we match the group and we have a valid name */
677      if (entry->group == group && entry->name != NULL && entry->name[0] != 0)
677      if (entry->group() == group && entry->name() != NULL && entry->name()[0] != 0)
678678      {
679679         input_seq_type seqtype;
680680
r15082r15083
689689            if(pollingitem && pollingref == entry && pollingseq == seqtype)
690690               pollingitem = item;
691691            item->seqtype = seqtype;
692            item->seq = input_type_seq(machine(), entry->type, entry->player, seqtype);
693            item->defseq = &entry->defseq[seqtype];
692            item->seq = machine().ioport().type_seq(entry->type(), entry->player(), seqtype);
693            item->defseq = &entry->defseq(seqtype);
694694            item->sortorder = sortorder * 4 + suborder[seqtype];
695            item->type = input_type_is_analog(entry->type) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
696            item->name = entry->name;
695            item->type = ioport_manager::type_is_analog(entry->type()) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
696            item->name = entry->name();
697697            item->next = itemlist;
698698            itemlist = item;
699699
r15082r15083
723723void ui_menu_input_specific::populate()
724724{
725725   input_item_data *itemlist = NULL;
726   input_field_config *field;
727   input_port_config *port;
726   ioport_field *field;
727   ioport_port *port;
728728   int suborder[SEQ_TYPE_TOTAL];
729729   astring tempstring;
730730
r15082r15083
735735
736736   /* iterate over the input ports and add menu items */
737737   for (port = machine().ioport().first_port(); port != NULL; port = port->next())
738      for (field = port->fieldlist().first(); field != NULL; field = field->next())
738      for (field = port->first_field(); field != NULL; field = field->next())
739739      {
740         const char *name = input_field_name(field);
740         const char *name = field->name();
741741
742742         /* add if we match the group and we have a valid name */
743         if (name != NULL && input_condition_true(machine(), &field->condition, port->owner()) &&
744            ((field->type == IPT_OTHER && field->name != NULL) || input_type_group(machine(), field->type, field->player) != IPG_INVALID))
743         if (name != NULL && field->enabled() &&
744            ((field->type() == IPT_OTHER && field->name() != NULL) || machine().ioport().type_group(field->type(), field->player()) != IPG_INVALID))
745745         {
746746            input_seq_type seqtype;
747747            UINT16 sortorder;
748748
749749            /* determine the sorting order */
750            if (field->type >= IPT_START1 && field->type <= __ipt_analog_end)
751               sortorder = (field->type << 2) | (field->player << 12);
750            if (field->type() >= IPT_START1 && field->type() < IPT_ANALOG_LAST)
751               sortorder = (field->type() << 2) | (field->player() << 12);
752752            else
753               sortorder = field->type | 0xf000;
753               sortorder = field->type() | 0xf000;
754754
755755            /* loop over all sequence types */
756756            for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
r15082r15083
762762               item->seqtype = seqtype;
763763               if(pollingitem && pollingref == field && pollingseq == seqtype)
764764                  pollingitem = item;
765               item->seq = input_field_seq(field, seqtype);
765               item->seq = field->seq(seqtype);
766766               item->defseq = &get_field_default_seq(field, seqtype);
767767               item->sortorder = sortorder + suborder[seqtype];
768               item->type = input_type_is_analog(field->type) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
768               item->type = field->is_analog() ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
769769               item->name = name;
770770               item->next = itemlist;
771771               itemlist = item;
r15082r15083
820820    to the default sequence for the given field
821821-------------------------------------------------*/
822822
823const input_seq &ui_menu_input::get_field_default_seq(input_field_config *field, input_seq_type seqtype)
823const input_seq &ui_menu_input::get_field_default_seq(ioport_field *field, input_seq_type seqtype)
824824{
825   if (field->seq[seqtype].is_default())
826      return input_type_seq(field->machine(), field->type, field->player, seqtype);
825   if (field->seq(seqtype).is_default())
826      return field->machine().ioport().type_seq(field->type(), field->player(), seqtype);
827827   else
828      return field->seq[seqtype];
828      return field->seq(seqtype);
829829}
830830
831831void ui_menu_input::handle()
r15082r15083
916916void ui_menu_input_general::update_input(struct input_item_data *seqchangeditem)
917917{
918918   const input_type_entry *entry = (const input_type_entry *)seqchangeditem->ref;
919   input_type_set_seq(machine(), entry->type, entry->player, seqchangeditem->seqtype, &seqchangeditem->seq);
919   machine().ioport().set_type_seq(entry->type(), entry->player(), seqchangeditem->seqtype, seqchangeditem->seq);
920920}
921921
922922void ui_menu_input_specific::update_input(struct input_item_data *seqchangeditem)
923923{
924   input_field_user_settings settings;
924   ioport_field::user_settings settings;
925925
926   input_field_get_user_settings((input_field_config *)seqchangeditem->ref, &settings);
926   ((ioport_field *)seqchangeditem->ref)->get_user_settings(settings);
927927   settings.seq[seqchangeditem->seqtype] = seqchangeditem->seq;
928   input_field_set_user_settings((input_field_config *)seqchangeditem->ref, &settings);
928   ((ioport_field *)seqchangeditem->ref)->set_user_settings(settings);
929929}
930930
931931
r15082r15083
10471047   /* handle events */
10481048   if (menu_event != NULL && menu_event->itemref != NULL)
10491049   {
1050      input_field_config *field = (input_field_config *)menu_event->itemref;
1051      input_field_user_settings settings;
1050      ioport_field *field = (ioport_field *)menu_event->itemref;
1051      ioport_field::user_settings settings;
10521052      int changed = false;
10531053
10541054      switch (menu_event->iptkey)
10551055      {
10561056         /* if selected, reset to default value */
10571057         case IPT_UI_SELECT:
1058            input_field_get_user_settings(field, &settings);
1059            settings.value = field->defvalue;
1060            input_field_set_user_settings(field, &settings);
1058            field->get_user_settings(settings);
1059            settings.value = field->defvalue();
1060            field->set_user_settings(settings);
10611061            changed = true;
10621062            break;
10631063
10641064         /* left goes to previous setting */
10651065         case IPT_UI_LEFT:
1066            input_field_select_previous_setting(field);
1066            field->select_previous_setting();
10671067            changed = true;
10681068            break;
10691069
10701070         /* right goes to next setting */
10711071         case IPT_UI_RIGHT:
1072            input_field_select_next_setting(field);
1072            field->select_next_setting();
10731073            changed = true;
10741074            break;
10751075      }
r15082r15083
10931093
10941094void ui_menu_settings::populate()
10951095{
1096   input_field_config *field;
1097   input_port_config *port;
1096   ioport_field *field;
1097   ioport_port *port;
10981098   dip_descriptor **diplist_tailptr;
10991099
11001100   /* reset the dip switch tracking */
r15082r15083
11041104
11051105   /* loop over input ports and set up the current values */
11061106   for (port = machine().ioport().first_port(); port != NULL; port = port->next())
1107      for (field = port->fieldlist().first(); field != NULL; field = field->next())
1108         if (field->type == type && input_condition_true(machine(), &field->condition, port->owner()))
1107      for (field = port->first_field(); field != NULL; field = field->next())
1108         if (field->type() == type && field->enabled())
11091109         {
11101110            UINT32 flags = 0;
11111111
11121112            /* set the left/right flags appropriately */
1113            if (input_field_has_previous_setting(field))
1113            if (field->has_previous_setting())
11141114               flags |= MENU_FLAG_LEFT_ARROW;
1115            if (input_field_has_next_setting(field))
1115            if (field->has_next_setting())
11161116               flags |= MENU_FLAG_RIGHT_ARROW;
11171117
11181118            /* add the menu item */
1119            item_append(input_field_name(field), input_field_setting_name(field), flags, (void *)field);
1119            item_append(field->name(), field->setting_name(), flags, (void *)field);
11201120
11211121            /* for DIP switches, build up the model */
1122            if (type == IPT_DIPSWITCH && field->diploclist().count() != 0)
1122            if (type == IPT_DIPSWITCH && field->first_diplocation() != NULL)
11231123            {
1124               const input_field_diplocation *diploc;
1125               input_field_user_settings settings;
1126               UINT32 accummask = field->mask;
1124               const ioport_diplocation *diploc;
1125               ioport_field::user_settings settings;
1126               UINT32 accummask = field->mask();
11271127
11281128               /* get current settings */
1129               input_field_get_user_settings(field, &settings);
1129               field->get_user_settings(settings);
11301130
11311131               /* iterate over each bit in the field */
1132               for (diploc = field->diploclist().first(); diploc != NULL; diploc = diploc->next())
1132               for (diploc = field->first_diplocation(); diploc != NULL; diploc = diploc->next())
11331133               {
11341134                  UINT32 mask = accummask & ~(accummask - 1);
11351135                  dip_descriptor *dip;
11361136
11371137                  /* find the matching switch name */
11381138                  for (dip = diplist; dip != NULL; dip = dip->next)
1139                     if (strcmp(dip->name, diploc->swname) == 0)
1139                     if (strcmp(dip->name, diploc->name()) == 0)
11401140                        break;
11411141
11421142                  /* allocate new if none */
r15082r15083
11441144                  {
11451145                     dip = (dip_descriptor *)m_pool_alloc(sizeof(*dip));
11461146                     dip->next = NULL;
1147                     dip->name = diploc->swname;
1147                     dip->name = diploc->name();
11481148                     dip->mask = dip->state = 0;
11491149                     *diplist_tailptr = dip;
11501150                     diplist_tailptr = &dip->next;
r15082r15083
11531153                  }
11541154
11551155                  /* apply the bits */
1156                  dip->mask |= 1 << (diploc->swnum - 1);
1157                  if (((settings.value & mask) != 0 && !diploc->invert) || ((settings.value & mask) == 0 && diploc->invert))
1158                     dip->state |= 1 << (diploc->swnum - 1);
1156                  dip->mask |= 1 << (diploc->number() - 1);
1157                  if (((settings.value & mask) != 0 && !diploc->inverted()) || ((settings.value & mask) == 0 && diploc->inverted()))
1158                     dip->state |= 1 << (diploc->number() - 1);
11591159
11601160                  /* clear the relevant bit in the accumulated mask */
11611161                  accummask &= ~mask;
r15082r15083
11771177
11781178void ui_menu_settings_dip_switches::custom_render(void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
11791179{
1180   input_field_config *field = (input_field_config *)selectedref;
1180   ioport_field *field = (ioport_field *)selectedref;
11811181   dip_descriptor *dip;
11821182
11831183   /* add borders */
r15082r15083
11931193   {
11941194      if (mame_stricmp(dip->name, "FAKE") != 0)
11951195      {
1196         const input_field_diplocation *diploc;
1196         const ioport_diplocation *diploc;
11971197         UINT32 selectedmask = 0;
11981198
11991199         /* determine the mask of selected bits */
12001200         if (field != NULL)
1201            for (diploc = field->diploclist().first(); diploc != NULL; diploc = diploc->next())
1202               if (strcmp(dip->name, diploc->swname) == 0)
1203                  selectedmask |= 1 << (diploc->swnum - 1);
1201            for (diploc = field->first_diplocation(); diploc != NULL; diploc = diploc->next())
1202               if (strcmp(dip->name, diploc->name()) == 0)
1203                  selectedmask |= 1 << (diploc->number() - 1);
12041204
12051205         /* draw one switch */
12061206         custom_render_one(x1, y1, x2, y1 + DIP_SWITCH_HEIGHT, dip, selectedmask);
r15082r15083
13221322      /* if things changed, update */
13231323      if (newval != data->cur)
13241324      {
1325         input_field_user_settings settings;
1325         ioport_field::user_settings settings;
13261326
13271327         /* get the settings and set the new value */
1328         input_field_get_user_settings(data->field, &settings);
1328         data->field->get_user_settings(settings);
13291329         switch (data->type)
13301330         {
13311331            case ANALOG_ITEM_KEYSPEED:      settings.delta = newval;      break;
r15082r15083
13331333            case ANALOG_ITEM_REVERSE:      settings.reverse = newval;      break;
13341334            case ANALOG_ITEM_SENSITIVITY:   settings.sensitivity = newval;   break;
13351335         }
1336         input_field_set_user_settings(data->field, &settings);
1336         data->field->set_user_settings(settings);
13371337
13381338         /* rebuild the menu */
13391339         reset(UI_MENU_RESET_REMEMBER_POSITION);
r15082r15083
13531353
13541354void ui_menu_analog::populate()
13551355{
1356   input_field_config *field;
1357   input_port_config *port;
1356   ioport_field *field;
1357   ioport_port *port;
13581358   astring subtext;
13591359   astring text;
13601360
13611361   /* loop over input ports and add the items */
13621362   for (port = machine().ioport().first_port(); port != NULL; port = port->next())
1363      for (field = port->fieldlist().first(); field != NULL; field = field->next())
1364         if (input_type_is_analog(field->type) && input_condition_true(machine(), &field->condition, port->owner()))
1363      for (field = port->first_field(); field != NULL; field = field->next())
1364         if (field->is_analog() && field->enabled())
13651365         {
1366            input_field_user_settings settings;
1366            ioport_field::user_settings settings;
13671367            int use_autocenter = false;
13681368            int type;
13691369
13701370            /* based on the type, determine if we enable autocenter */
1371            switch (field->type)
1371            switch (field->type())
13721372            {
13731373               case IPT_POSITIONAL:
13741374               case IPT_POSITIONAL_V:
1375                  if (field->flags & ANALOG_FLAG_WRAPS)
1375                  if (field->analog_wraps())
13761376                     break;
13771377
13781378               case IPT_AD_STICK_X:
r15082r15083
13851385               case IPT_PEDAL3:
13861386                  use_autocenter = true;
13871387                  break;
1388               
1389               default:
1390                  break;
13881391            }
13891392
13901393            /* get the user settings */
1391            input_field_get_user_settings(field, &settings);
1394            field->get_user_settings(settings);
13921395
13931396            /* iterate over types */
13941397            for (type = 0; type < ANALOG_ITEM_COUNT; type++)
r15082r15083
14071410                  {
14081411                     default:
14091412                     case ANALOG_ITEM_KEYSPEED:
1410                        text.printf("%s Digital Speed", input_field_name(field));
1413                        text.printf("%s Digital Speed", field->name());
14111414                        subtext.printf("%d", settings.delta);
14121415                        data->min = 0;
14131416                        data->max = 255;
14141417                        data->cur = settings.delta;
1415                        data->defvalue = field->delta;
1418                        data->defvalue = field->delta();
14161419                        break;
14171420
14181421                     case ANALOG_ITEM_CENTERSPEED:
1419                        text.printf("%s Autocenter Speed", input_field_name(field));
1422                        text.printf("%s Autocenter Speed", field->name());
14201423                        subtext.printf("%d", settings.centerdelta);
14211424                        data->min = 0;
14221425                        data->max = 255;
14231426                        data->cur = settings.centerdelta;
1424                        data->defvalue = field->centerdelta;
1427                        data->defvalue = field->centerdelta();
14251428                        break;
14261429
14271430                     case ANALOG_ITEM_REVERSE:
1428                        text.printf("%s Reverse", input_field_name(field));
1431                        text.printf("%s Reverse", field->name());
14291432                        subtext.cpy(settings.reverse ? "On" : "Off");
14301433                        data->min = 0;
14311434                        data->max = 1;
14321435                        data->cur = settings.reverse;
1433                        data->defvalue = ((field->flags & ANALOG_FLAG_REVERSE) != 0);
1436                        data->defvalue = field->analog_reverse();
14341437                        break;
14351438
14361439                     case ANALOG_ITEM_SENSITIVITY:
1437                        text.printf("%s Sensitivity", input_field_name(field));
1440                        text.printf("%s Sensitivity", field->name());
14381441                        subtext.printf("%d", settings.sensitivity);
14391442                        data->min = 1;
14401443                        data->max = 255;
14411444                        data->cur = settings.sensitivity;
1442                        data->defvalue = field->sensitivity;
1445                        data->defvalue = field->sensitivity();
14431446                        break;
14441447                  }
14451448
src/emu/validity.c
r15082r15083
7171
7272inline const char *validity_checker::ioport_string_from_index(UINT32 index)
7373{
74   return input_port_string_from_token((const char *)(FPTR)index);
74   return ioport_configurer::string_from_token((const char *)(FPTR)index);
7575}
7676
7777
r15082r15083
808808//  analog input field
809809//-------------------------------------------------
810810
811void validity_checker::validate_analog_input_field(input_field_config &field)
811void validity_checker::validate_analog_input_field(ioport_field &field)
812812{
813813   // analog ports must have a valid sensitivity
814   if (field.sensitivity == 0)
814   if (field.sensitivity() == 0)
815815      mame_printf_error("Analog port with zero sensitivity\n");
816816
817817   // check that the default falls in the bitmask range
818   if (field.defvalue & ~field.mask)
819      mame_printf_error("Analog port with a default value (%X) out of the bitmask range (%X)\n", field.defvalue, field.mask);
818   if (field.defvalue() & ~field.mask())
819      mame_printf_error("Analog port with a default value (%X) out of the bitmask range (%X)\n", field.defvalue(), field.mask());
820820
821821   // tests for positional devices
822   if (field.type == IPT_POSITIONAL || field.type == IPT_POSITIONAL_V)
822   if (field.type() == IPT_POSITIONAL || field.type() == IPT_POSITIONAL_V)
823823   {
824824      int shift;
825      for (shift = 0; shift <= 31 && (~field.mask & (1 << shift)) != 0; shift++) ;
825      for (shift = 0; shift <= 31 && (~field.mask() & (1 << shift)) != 0; shift++) ;
826826
827827      // convert the positional max value to be in the bitmask for testing
828      INT32 analog_max = field.max;
828      INT32 analog_max = field.maxval();
829829      analog_max = (analog_max - 1) << shift;
830830
831831      // positional port size must fit in bits used
832      if ((field.mask >> shift) + 1 < field.max)
832      if ((field.mask() >> shift) + 1 < field.maxval())
833833         mame_printf_error("Analog port with a positional port size bigger then the mask size\n");
834834   }
835835
836836   // tests for absolute devices
837   else if (field.type >= __ipt_analog_absolute_start && field.type <= __ipt_analog_absolute_end)
837   else if (field.type() > IPT_ANALOG_ABSOLUTE_FIRST && field.type() < IPT_ANALOG_ABSOLUTE_LAST)
838838   {
839839      // adjust for signed values
840      INT32 default_value = field.defvalue;
841      INT32 analog_min = field.min;
842      INT32 analog_max = field.max;
840      INT32 default_value = field.defvalue();
841      INT32 analog_min = field.minval();
842      INT32 analog_max = field.maxval();
843843      if (analog_min > analog_max)
844844      {
845845         analog_min = -analog_min;
r15082r15083
849849
850850      // check that the default falls in the MINMAX range
851851      if (default_value < analog_min || default_value > analog_max)
852         mame_printf_error("Analog port with a default value (%X) out of PORT_MINMAX range (%X-%X)\n", field.defvalue, field.min, field.max);
852         mame_printf_error("Analog port with a default value (%X) out of PORT_MINMAX range (%X-%X)\n", field.defvalue(), field.minval(), field.maxval());
853853
854854      // check that the MINMAX falls in the bitmask range
855855      // we use the unadjusted min for testing
856      if (field.min & ~field.mask || analog_max & ~field.mask)
857         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);
856      if (field.minval() & ~field.mask() || analog_max & ~field.mask())
857         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());
858858
859859      // absolute analog ports do not use PORT_RESET
860      if (field.flags & ANALOG_FLAG_RESET)
860      if (field.analog_reset())
861861         mame_printf_error("Absolute analog port using PORT_RESET\n");
862862
863863      // absolute analog ports do not use PORT_WRAPS
864      if (field.flags & ANALOG_FLAG_WRAPS)
864      if (field.analog_wraps())
865865         mame_printf_error("Absolute analog port using PORT_WRAPS\n");
866866   }
867867
r15082r15083
869869   else
870870   {
871871      // relative devices do not use PORT_MINMAX
872      if (field.min != 0 || field.max != field.mask)
872      if (field.minval() != 0 || field.maxval() != field.mask())
873873         mame_printf_error("Relative port using PORT_MINMAX\n");
874874
875875      // relative devices do not use a default value
876876      // the counter is at 0 on power up
877      if (field.defvalue != 0)
877      if (field.defvalue() != 0)
878878         mame_printf_error("Relative port using non-0 default value\n");
879879
880880      // relative analog ports do not use PORT_WRAPS
881      if (field.flags & ANALOG_FLAG_WRAPS)
881      if (field.analog_wraps())
882882         mame_printf_error("Absolute analog port using PORT_WRAPS\n");
883883   }
884884}
r15082r15083
889889//  setting
890890//-------------------------------------------------
891891
892void validity_checker::validate_dip_settings(input_field_config &field)
892void validity_checker::validate_dip_settings(ioport_field &field)
893893{
894894   const char *demo_sounds = ioport_string_from_index(INPUT_STRING_Demo_Sounds);
895895   const char *flipscreen = ioport_string_from_index(INPUT_STRING_Flip_Screen);
r15082r15083
897897   bool coin_error = false;
898898
899899   // iterate through the settings
900   for (const input_setting_config *setting = field.settinglist().first(); setting != NULL; setting = setting->next())
900   for (ioport_setting *setting = field.first_setting(); setting != NULL; setting = setting->next())
901901   {
902902      // note any coinage strings
903      int strindex = get_defstr_index(setting->name);
903      int strindex = get_defstr_index(setting->name());
904904      if (strindex >= __input_string_coinage_start && strindex <= __input_string_coinage_end)
905905         coin_list[strindex - __input_string_coinage_start] = 1;
906906
907907      // make sure demo sounds default to on
908      if (field.name == demo_sounds && strindex == INPUT_STRING_On && field.defvalue != setting->value)
908      if (field.name() == demo_sounds && strindex == INPUT_STRING_On && field.defvalue() != setting->value())
909909         mame_printf_error("Demo Sounds must default to On\n");
910910
911911      // check for bad demo sounds options
912      if (field.name == demo_sounds && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No))
913         mame_printf_error("Demo Sounds option must be Off/On, not %s\n", setting->name);
912      if (field.name() == demo_sounds && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No))
913         mame_printf_error("Demo Sounds option must be Off/On, not %s\n", setting->name());
914914
915915      // check for bad flip screen options
916      if (field.name == flipscreen && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No))
917         mame_printf_error("Flip Screen option must be Off/On, not %s\n", setting->name);
916      if (field.name() == flipscreen && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No))
917         mame_printf_error("Flip Screen option must be Off/On, not %s\n", setting->name());
918918
919919      // if we have a neighbor, compare ourselves to him
920920      if (setting->next() != NULL)
921921      {
922922         // check for inverted off/on dispswitch order
923         int next_strindex = get_defstr_index(setting->next()->name, true);
923         int next_strindex = get_defstr_index(setting->next()->name(), true);
924924         if (strindex == INPUT_STRING_On && next_strindex == INPUT_STRING_Off)
925            mame_printf_error("%s option must have Off/On options in the order: Off, On\n", field.name);
925            mame_printf_error("%s option must have Off/On options in the order: Off, On\n", field.name());
926926
927927         // check for inverted yes/no dispswitch order
928928         else if (strindex == INPUT_STRING_Yes && next_strindex == INPUT_STRING_No)
929            mame_printf_error("%s option must have Yes/No options in the order: No, Yes\n", field.name);
929            mame_printf_error("%s option must have Yes/No options in the order: No, Yes\n", field.name());
930930
931931         // check for inverted upright/cocktail dispswitch order
932932         else if (strindex == INPUT_STRING_Cocktail && next_strindex == INPUT_STRING_Upright)
933            mame_printf_error("%s option must have Upright/Cocktail options in the order: Upright, Cocktail\n", field.name);
933            mame_printf_error("%s option must have Upright/Cocktail options in the order: Upright, Cocktail\n", field.name());
934934
935935         // check for proper coin ordering
936936         else if (strindex >= __input_string_coinage_start && strindex <= __input_string_coinage_end && next_strindex >= __input_string_coinage_start && next_strindex <= __input_string_coinage_end &&
937                strindex >= next_strindex && memcmp(&setting->condition, &setting->next()->condition, sizeof(setting->condition)) == 0)
937                strindex >= next_strindex && setting->condition() == setting->next()->condition())
938938         {
939            mame_printf_error("%s option has unsorted coinage %s > %s\n", field.name, setting->name, setting->next()->name);
939            mame_printf_error("%s option has unsorted coinage %s > %s\n", field.name(), setting->name(), setting->next()->name());
940940            coin_error = true;
941941         }
942942      }
r15082r15083
958958//  stored within an ioport field or setting
959959//-------------------------------------------------
960960
961void validity_checker::validate_condition(input_condition &condition, device_t &device, int_map &port_map)
961void validity_checker::validate_condition(ioport_condition &condition, device_t &device, int_map &port_map)
962962{
963963   // resolve the tag
964964   astring porttag;
965   device.subtag(porttag, condition.tag);
965   device.subtag(porttag, condition.tag());
966966
967967   // then find a matching port
968968   if (port_map.find(porttag) == 0)
969      mame_printf_error("Condition referencing non-existent ioport tag '%s'\n", condition.tag);
969      mame_printf_error("Condition referencing non-existent ioport tag '%s'\n", condition.tag());
970970}
971971
972972
r15082r15083
992992      // allocate the input ports
993993      ioport_list portlist;
994994      astring errorbuf;
995      input_port_list_init(*device, portlist, errorbuf);
995      portlist.append(*device, errorbuf);
996996
997997      // report any errors during construction
998998      if (errorbuf)
999999         mame_printf_error("I/O port error during construction:\n%s\n", errorbuf.cstr());
10001000
10011001      // do a first pass over ports to add their names and find duplicates
1002      for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
1002      for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
10031003         if (port_map.add(port->tag(), 1, false) == TMERR_DUPLICATE)
10041004            mame_printf_error("Multiple I/O ports with the same tag '%s' defined\n", port->tag());
10051005
10061006      // iterate over ports
1007      for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
1007      for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
10081008      {
10091009         m_current_ioport = port->tag();
10101010
10111011         // iterate through the fields on this port
1012         for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
1012         for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
10131013         {
10141014            // verify analog inputs
1015            if (input_type_is_analog(field->type))
1015            if (field->is_analog())
10161016               validate_analog_input_field(*field);
10171017
10181018            // look for invalid (0) types which should be mapped to IPT_OTHER
1019            if (field->type == IPT_INVALID)
1019            if (field->type() == IPT_INVALID)
10201020               mame_printf_error("Field has an invalid type (0); use IPT_OTHER instead\n");
10211021
10221022            // verify dip switches
1023            if (field->type == IPT_DIPSWITCH)
1023            if (field->type() == IPT_DIPSWITCH)
10241024            {
10251025               // dip switch fields must have a name
1026               if (field->name == NULL)
1026               if (field->name() == NULL)
10271027                  mame_printf_error("DIP switch has a NULL name\n");
10281028
10291029               // verify the settings list
r15082r15083
10311031            }
10321032
10331033            // verify names
1034            if (field->name != NULL)
1034            const char *name = field->specific_name();
1035            if (name != NULL)
10351036            {
10361037               // check for empty string
1037               if (field->name[0] == 0)
1038               if (name[0] == 0)
10381039                  mame_printf_error("Field name is an empty string\n");
10391040
10401041               // check for trailing spaces
1041               if (field->name[0] != 0 && field->name[strlen(field->name) - 1] == ' ')
1042                  mame_printf_error("Field '%s' has trailing spaces\n", field->name);
1042               if (name[0] != 0 && name[strlen(name) - 1] == ' ')
1043                  mame_printf_error("Field '%s' has trailing spaces\n", name);
10431044
10441045               // check for invalid UTF-8
1045               if (!utf8_is_valid_string(field->name))
1046                  mame_printf_error("Field '%s' has invalid characters\n", field->name);
1046               if (!utf8_is_valid_string(name))
1047                  mame_printf_error("Field '%s' has invalid characters\n", name);
10471048
10481049               // look up the string and print an error if default strings are not used
1049               /*strindex =get_defstr_index(defstr_map, field->name, driver, &error);*/
1050               /*strindex =get_defstr_index(defstr_map, name, driver, &error);*/
10501051            }
10511052
10521053            // verify conditions on the field
1053            if (field->condition.tag != NULL)
1054               validate_condition(field->condition, *device, port_map);
1054            if (!field->condition().none())
1055               validate_condition(field->condition(), *device, port_map);
10551056
10561057            // verify conditions on the settings
1057            for (input_setting_config *setting = field->settinglist().first(); setting != NULL; setting = setting->next())
1058               if (setting->condition.tag != NULL)
1059                  validate_condition(setting->condition, *device, port_map);
1058            for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next())
1059               if (!setting->condition().none())
1060                  validate_condition(setting->condition(), *device, port_map);
10601061         }
10611062
10621063         // done with this port
src/emu/uimain.h
r15082r15083
121121   void populate_and_sort(struct input_item_data *itemlist);
122122   virtual void update_input(struct input_item_data *seqchangeditem) = 0;
123123   void toggle_none_default(input_seq &selected_seq, input_seq &original_seq, const input_seq &selected_defseq);
124   const input_seq &get_field_default_seq(input_field_config *field, input_seq_type seqtype);
124   const input_seq &get_field_default_seq(ioport_field *field, input_seq_type seqtype);
125125
126126protected:
127127   const void *      pollingref;
r15082r15083
212212
213213   /* internal analog menu item data */
214214   struct analog_item_data {
215      input_field_config *field;
215      ioport_field *field;
216216      int               type;
217217      int               min, max;
218218      int               cur;
src/emu/validity.h
r15082r15083
9393   void validate_roms();
9494   void validate_display();
9595   void validate_gfx();
96   void validate_analog_input_field(input_field_config &field);
97   void validate_dip_settings(input_field_config &field);
98   void validate_condition(input_condition &condition, device_t &device, int_map &port_map);
96   void validate_analog_input_field(ioport_field &field);
97   void validate_dip_settings(ioport_field &field);
98   void validate_condition(ioport_condition &condition, device_t &device, int_map &port_map);
9999   void validate_inputs();
100100   void validate_devices();
101101
src/emu/info.c
r15082r15083
267267   astring errors;
268268   device_iterator iter(config.root_device());
269269   for (device_t *device = iter.first(); device != NULL; device = iter.next())
270      input_port_list_init(*device, portlist, errors);
270      portlist.append(*device, errors);
271271
272272   // print the header and the game name
273273   fprintf(m_output, "\t<%s",emulator_info::get_xml_top());
r15082r15083
352352   astring errors;
353353   device_iterator iptiter(device);
354354   for (device_t *dev = iptiter.first(); dev != NULL; dev = iptiter.next())
355      input_port_list_init(*dev, portlist, errors);
355      portlist.append(*dev, errors);
356356   // check if the device adds player inputs (other than dsw and configs) to the system
357   for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
358      for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
359         if (field->type >= IPT_START1 && field->type < __ipt_ui_start)
357   for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
358      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
359         if (field->type() >= IPT_START1 && field->type() < IPT_UI_FIRST)
360360         {
361361            has_input = TRUE;
362362            break;
r15082r15083
830830   bool gambling = false;
831831
832832   // iterate over the ports
833   for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
834      for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
833   for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
834      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
835835      {
836836         int analogtype = -1;
837837
838838         // track the highest player number
839         if (nplayer < field->player + 1)
840            nplayer = field->player + 1;
839         if (nplayer < field->player() + 1)
840            nplayer = field->player() + 1;
841841
842842         // switch off of the type
843         switch (field->type)
843         switch (field->type())
844844         {
845845            // map which joystick directions are present
846            case IPT_JOYSTICK_UP:         joytype[0] |= DIR_UP | ((field->way == 4) ? DIR_4WAY : 0);      break;
847            case IPT_JOYSTICK_DOWN:         joytype[0] |= DIR_DOWN | ((field->way == 4) ? DIR_4WAY : 0);   break;
848            case IPT_JOYSTICK_LEFT:         joytype[0] |= DIR_LEFT | ((field->way == 4) ? DIR_4WAY : 0);   break;
849            case IPT_JOYSTICK_RIGHT:      joytype[0] |= DIR_RIGHT | ((field->way == 4) ? DIR_4WAY : 0);   break;
846            case IPT_JOYSTICK_UP:         joytype[0] |= DIR_UP | ((field->way() == 4) ? DIR_4WAY : 0);      break;
847            case IPT_JOYSTICK_DOWN:         joytype[0] |= DIR_DOWN | ((field->way() == 4) ? DIR_4WAY : 0);   break;
848            case IPT_JOYSTICK_LEFT:         joytype[0] |= DIR_LEFT | ((field->way() == 4) ? DIR_4WAY : 0);   break;
849            case IPT_JOYSTICK_RIGHT:      joytype[0] |= DIR_RIGHT | ((field->way() == 4) ? DIR_4WAY : 0);   break;
850850
851            case IPT_JOYSTICKLEFT_UP:      joytype[1] |= DIR_UP | ((field->way == 4) ? DIR_4WAY : 0);      break;
852            case IPT_JOYSTICKLEFT_DOWN:      joytype[1] |= DIR_DOWN | ((field->way == 4) ? DIR_4WAY : 0);   break;
853            case IPT_JOYSTICKLEFT_LEFT:      joytype[1] |= DIR_LEFT | ((field->way == 4) ? DIR_4WAY : 0);   break;
854            case IPT_JOYSTICKLEFT_RIGHT:   joytype[1] |= DIR_RIGHT | ((field->way == 4) ? DIR_4WAY : 0);   break;
851            case IPT_JOYSTICKLEFT_UP:      joytype[1] |= DIR_UP | ((field->way() == 4) ? DIR_4WAY : 0);      break;
852            case IPT_JOYSTICKLEFT_DOWN:      joytype[1] |= DIR_DOWN | ((field->way() == 4) ? DIR_4WAY : 0);   break;
853            case IPT_JOYSTICKLEFT_LEFT:      joytype[1] |= DIR_LEFT | ((field->way() == 4) ? DIR_4WAY : 0);   break;
854            case IPT_JOYSTICKLEFT_RIGHT:   joytype[1] |= DIR_RIGHT | ((field->way() == 4) ? DIR_4WAY : 0);   break;
855855
856            case IPT_JOYSTICKRIGHT_UP:      joytype[2] |= DIR_UP | ((field->way == 4) ? DIR_4WAY : 0);      break;
857            case IPT_JOYSTICKRIGHT_DOWN:   joytype[2] |= DIR_DOWN | ((field->way == 4) ? DIR_4WAY : 0);   break;
858            case IPT_JOYSTICKRIGHT_LEFT:   joytype[2] |= DIR_LEFT | ((field->way == 4) ? DIR_4WAY : 0);   break;
859            case IPT_JOYSTICKRIGHT_RIGHT:   joytype[2] |= DIR_RIGHT | ((field->way == 4) ? DIR_4WAY : 0);   break;
856            case IPT_JOYSTICKRIGHT_UP:      joytype[2] |= DIR_UP | ((field->way() == 4) ? DIR_4WAY : 0);      break;
857            case IPT_JOYSTICKRIGHT_DOWN:   joytype[2] |= DIR_DOWN | ((field->way() == 4) ? DIR_4WAY : 0);   break;
858            case IPT_JOYSTICKRIGHT_LEFT:   joytype[2] |= DIR_LEFT | ((field->way() == 4) ? DIR_4WAY : 0);   break;
859            case IPT_JOYSTICKRIGHT_RIGHT:   joytype[2] |= DIR_RIGHT | ((field->way() == 4) ? DIR_4WAY : 0);   break;
860860
861861            // mark as an analog input, and get analog stats after switch
862862            case IPT_AD_STICK_X:
r15082r15083
918918            case IPT_BUTTON14:
919919            case IPT_BUTTON15:
920920            case IPT_BUTTON16:
921               nbutton = MAX(nbutton, field->type - IPT_BUTTON1 + 1);
921               nbutton = MAX(nbutton, field->type() - IPT_BUTTON1 + 1);
922922               break;
923923
924924            // track maximum coin index
r15082r15083
930930            case IPT_COIN6:
931931            case IPT_COIN7:
932932            case IPT_COIN8:
933               ncoin = MAX(ncoin, field->type - IPT_COIN1 + 1);
933               ncoin = MAX(ncoin, field->type() - IPT_COIN1 + 1);
934934               break;
935935
936936            // track presence of these guys
r15082r15083
952952               break;
953953
954954            default:
955               if (field->type >= __ipt_mahjong_start && field->type <= __ipt_mahjong_end)
955               if (field->type() > IPT_MAHJONG_FIRST && field->type() < IPT_MAHJONG_LAST)
956956                  mahjong = true;
957               else if (field->type >= __ipt_hanafuda_start && field->type <= __ipt_hanafuda_end)
957               else if (field->type() > IPT_HANAFUDA_FIRST && field->type() < IPT_HANAFUDA_LAST)
958958                  hanafuda = true;
959               else if (field->type >= __ipt_gambling_start && field->type <= __ipt_gambling_end)
959               else if (field->type() > IPT_GAMBLING_FIRST && field->type() < IPT_GAMBLING_LAST)
960960                  gambling = true;
961961               break;
962962         }
r15082r15083
964964         // get the analog stats
965965         if (analogtype != -1)
966966         {
967            if (field->min != 0)
968               control_info[analogtype].min = field->min;
969            if (field->max != 0)
970               control_info[analogtype].max = field->max;
971            if (field->sensitivity != 0)
972               control_info[analogtype].sensitivity = field->sensitivity;
973            if (field->delta != 0)
974               control_info[analogtype].keydelta = field->delta;
975            if ((field->flags & ANALOG_FLAG_REVERSE) != 0)
967            if (field->minval() != 0)
968               control_info[analogtype].min = field->minval();
969            if (field->maxval() != 0)
970               control_info[analogtype].max = field->maxval();
971            if (field->sensitivity() != 0)
972               control_info[analogtype].sensitivity = field->sensitivity();
973            if (field->delta() != 0)
974               control_info[analogtype].keydelta = field->delta();
975            if (field->analog_reverse() != 0)
976976               control_info[analogtype].reverse = true;
977977         }
978978      }
r15082r15083
10801080void info_xml_creator::output_switches(const ioport_list &portlist, const char *root_tag, int type, const char *outertag, const char *innertag)
10811081{
10821082   // iterate looking for DIP switches
1083   for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
1084      for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
1085         if (field->type == type)
1083   for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
1084      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
1085         if (field->type() == type)
10861086         {
1087            astring newtag(field->port().tag()), oldtag(":");
1087            astring newtag(port->tag()), oldtag(":");
10881088            newtag.substr(newtag.find(oldtag.cat(root_tag)) + oldtag.len());
10891089
10901090            // output the switch name information
1091            fprintf(m_output, "\t\t<%s name=\"%s\"", outertag, xml_normalize_string(input_field_name(field)));
1091            fprintf(m_output, "\t\t<%s name=\"%s\"", outertag, xml_normalize_string(field->name()));
10921092            fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag));
1093            fprintf(m_output, " mask=\"%u\"", field->mask);
1093            fprintf(m_output, " mask=\"%u\"", field->mask());
10941094            fprintf(m_output, ">\n");
10951095
10961096            // loop over settings
1097            for (input_setting_config *setting = field->settinglist().first(); setting != NULL; setting = setting->next())
1097            for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next())
10981098            {
1099               fprintf(m_output, "\t\t\t<%s name=\"%s\"", innertag, xml_normalize_string(setting->name));
1100               fprintf(m_output, " value=\"%u\"", setting->value);
1101               if (setting->value == field->defvalue)
1099               fprintf(m_output, "\t\t\t<%s name=\"%s\"", innertag, xml_normalize_string(setting->name()));
1100               fprintf(m_output, " value=\"%u\"", setting->value());
1101               if (setting->value() == field->defvalue())
11021102                  fprintf(m_output, " default=\"yes\"");
11031103               fprintf(m_output, "/>\n");
11041104            }
r15082r15083
11171117void info_xml_creator::output_adjusters(const ioport_list &portlist)
11181118{
11191119   // iterate looking for Adjusters
1120   for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
1121      for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
1122         if (field->type == IPT_ADJUSTER)
1123            fprintf(m_output, "\t\t<adjuster name=\"%s\" default=\"%d\"/>\n", xml_normalize_string(input_field_name(field)), field->defvalue);
1120   for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
1121      for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
1122         if (field->type() == IPT_ADJUSTER)
1123            fprintf(m_output, "\t\t<adjuster name=\"%s\" default=\"%d\"/>\n", xml_normalize_string(field->name()), field->defvalue());
11241124}
11251125
11261126
src/emu/uiinput.c
r15082r15083
3737struct _ui_input_private
3838{
3939   /* pressed states; retrieved with ui_input_pressed() */
40   osd_ticks_t               next_repeat[__ipt_max];
41   UINT8                  seqpressed[__ipt_max];
40   osd_ticks_t               next_repeat[IPT_COUNT];
41   UINT8                  seqpressed[IPT_COUNT];
4242
4343   /* mouse position/info */
4444   render_target *            current_mouse_target;
r15082r15083
9797void ui_input_frame_update(running_machine &machine)
9898{
9999   ui_input_private *uidata = machine.ui_input_data;
100   int code;
101100
102101   /* update the state of all the UI keys */
103   for (code = __ipt_ui_start; code <= __ipt_ui_end; code++)
102   for (ioport_type code = ioport_type(IPT_UI_FIRST + 1); code < IPT_UI_LAST; code++)
104103   {
105      int pressed = machine.input().seq_pressed(input_type_seq(machine, code, 0, SEQ_TYPE_STANDARD));
104      bool pressed = machine.ioport().type_pressed(code);
106105      if (!pressed || uidata->seqpressed[code] != SEQ_PRESSED_RESET)
107106         uidata->seqpressed[code] = pressed;
108107   }
r15082r15083
199198
200199   uidata->events_start = 0;
201200   uidata->events_end = 0;
202   for (code = __ipt_ui_start; code <= __ipt_ui_end; code++)
201   for (code = IPT_UI_FIRST + 1; code < IPT_UI_LAST; code++)
203202   {
204203      uidata->seqpressed[code] = SEQ_PRESSED_RESET;
205204      uidata->next_repeat[code] = 0;
src/emu/device.c
r15082r15083
239239//  object for a given port name
240240//-------------------------------------------------
241241
242input_port_config *device_t::ioport(const char *tag) const
242ioport_port *device_t::ioport(const char *tag) const
243243{
244244   // safety first
245245   if (this == NULL)
src/emu/device.h
r15082r15083
9595struct rom_entry;
9696class machine_config;
9797class emu_timer;
98typedef struct _input_device_default input_device_default;
98struct input_device_default;
9999
100100
101101
r15082r15083
188188   memory_region *memregion(const char *tag) const;
189189   memory_share *memshare(const char *tag) const;
190190   memory_bank *membank(const char *tag) const;
191   input_port_config *ioport(const char *tag) const;
191   ioport_port *ioport(const char *tag) const;
192192   device_t *subdevice(const char *tag) const;
193193   device_t *siblingdevice(const char *tag) const;
194194   template<class _DeviceClass> inline _DeviceClass *subdevice(const char *tag) const { return downcast<_DeviceClass *>(subdevice(tag)); }
r15082r15083
506506
507507// device finder template
508508template<bool _Required>
509class device_t::ioport_finder : public device_t::object_finder_base<input_port_config>
509class device_t::ioport_finder : public device_t::object_finder_base<ioport_port>
510510{
511511public:
512512   // construction/destruction
513513   ioport_finder(device_t &base, const char *tag)
514      : object_finder_base<input_port_config>(base, tag) { }
514      : object_finder_base<ioport_port>(base, tag) { }
515515
516516   // finder
517517   virtual bool findit()
r15082r15083
927927};
928928
929929
930// ======================> device_delegate
931930
932// device_delegate is a delegate that wraps with a device tag and can be easily
933// late bound without replicating logic everywhere
934template<typename _Signature>
935class device_delegate : public delegate<_Signature>
936{
937   typedef delegate<_Signature> basetype;
938
939public:
940   // provide same set of constructors as the base class, with additional device name
941   // parameter
942   device_delegate() : basetype(), m_device_name(NULL) { }
943   device_delegate(const basetype &src) : basetype(src), m_device_name(src.m_device_name) { }
944   device_delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object), m_device_name(src.m_device_name) { }
945   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) { }
946   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) { }
947   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) { }
948   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) { }
949   device_delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; m_device_name = src.m_device_name; return *this; }
950
951   // perform the binding
952   void bind_relative_to(device_t &search_root);
953
954private:
955   // internal state
956   const char *m_device_name;
957};
958
959
960
961931//**************************************************************************
962932//  INLINE FUNCTIONS
963933//**************************************************************************
src/emu/memory.c
r15082r15083
397397   void set_legacy_func(device_t &device, read64_device_func func, const char *name, UINT64 mask = 0);
398398
399399   // configure I/O port access
400   void set_ioport(const input_port_config &ioport);
400   void set_ioport(ioport_port &ioport);
401401
402402   // read via the underlying delegates
403403   UINT8 read8(address_space &space, offs_t offset, UINT8 mask) const { return m_read.r8(space, offset, mask); }
r15082r15083
419419
420420   // stubs for reading I/O ports
421421   template<typename _UintType>
422   _UintType read_stub_ioport(address_space &space, offs_t offset, _UintType mask) { return input_port_read_direct(m_ioport); }
422   _UintType read_stub_ioport(address_space &space, offs_t offset, _UintType mask) { return m_ioport->read(); }
423423
424424   // internal helper
425425   virtual void remove_subunit(int entry);
r15082r15083
427427   // internal state
428428   access_handler            m_read;
429429   access_handler            m_subread[8];
430   const input_port_config *   m_ioport;
430   ioport_port *   m_ioport;
431431
432432   bool m_sub_is_legacy[8];
433433   legacy_info m_legacy_info;
r15082r15083
504504   void set_legacy_func(device_t &device, write64_device_func func, const char *name, UINT64 mask = 0);
505505
506506   // configure I/O port access
507   void set_ioport(const input_port_config &ioport);
507   void set_ioport(ioport_port &ioport);
508508
509509   // write via the underlying delegates
510510   void write8(address_space &space, offs_t offset, UINT8 data, UINT8 mask) const { m_write.w8(space, offset, data, mask); }
r15082r15083
526526
527527   // stubs for writing I/O ports
528528   template<typename _UintType>
529   void write_stub_ioport(address_space &space, offs_t offset, _UintType data, _UintType mask) { input_port_write_direct(m_ioport, data, mask); }
529   void write_stub_ioport(address_space &space, offs_t offset, _UintType data, _UintType mask) { m_ioport->write(data, mask); }
530530
531531   // internal helper
532532   virtual void remove_subunit(int entry);
r15082r15083
534534   // internal state
535535   access_handler            m_write;
536536   access_handler            m_subwrite[8];
537   const input_port_config *   m_ioport;
537   ioport_port *   m_ioport;
538538
539539   bool m_sub_is_legacy[8];
540540   legacy_info m_legacy_info;
r15082r15083
571571   }
572572
573573   // forward I/O port access configuration
574   void set_ioport(const input_port_config &ioport) const {
574   void set_ioport(ioport_port &ioport) const {
575575      for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); i++)
576576         (*i)->set_ioport(ioport);
577577   }
r15082r15083
23232323   {
23242324      // find the port
23252325      astring fulltag;
2326      input_port_config *port = machine().root_device().ioport(device().siblingtag(fulltag, rtag));
2326      ioport_port *port = machine().root_device().ioport(device().siblingtag(fulltag, rtag));
23272327      if (port == NULL)
23282328         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());
23292329
r15082r15083
23352335   {
23362336      // find the port
23372337      astring fulltag;
2338      input_port_config *port = machine().root_device().ioport(device().siblingtag(fulltag, wtag));
2338      ioport_port *port = machine().root_device().ioport(device().siblingtag(fulltag, wtag));
23392339      if (port == NULL)
23402340         fatalerror("Attempted to map non-existent port '%s' for write in space %s of device '%s'\n", wtag, m_name, m_device.tag());
23412341
r15082r15083
49584958//  of the appropriate size
49594959//-------------------------------------------------
49604960
4961void handler_entry_read::set_ioport(const input_port_config &ioport)
4961void handler_entry_read::set_ioport(ioport_port &ioport)
49624962{
49634963   m_ioport = &ioport;
49644964   if (m_datawidth == 8)
r15082r15083
54135413//  of the appropriate size
54145414//-------------------------------------------------
54155415
5416void handler_entry_write::set_ioport(const input_port_config &ioport)
5416void handler_entry_write::set_ioport(ioport_port &ioport)
54175417{
54185418   m_ioport = &ioport;
54195419   if (m_datawidth == 8)
src/emu/machine/generic.c
r15082r15083
528528CUSTOM_INPUT_MEMBER( driver_device::custom_port_read )
529529{
530530   const char *tag = (const char *)param;
531   return input_port_read(machine(), tag);
531   return ioport(tag)->read();
532532}
533533
534534
src/emu/machine/jvsdev.c
r15082r15083
249249   case 2: jvs_outputs ^=  m;  break;
250250   }
251251
252   input_port_write_safe(machine(), tag, jvs_outputs, m);
252   machine().root_device().ioport(tag)->write_safe(jvs_outputs, m);
253253}
254254
src/emu/machine/microtch.c
r15082r15083
8282
8383void microtouch_device::send_touch_packet()
8484{
85   int tx = input_port_read(*this, "TOUCH_X");
86   int ty = input_port_read(*this, "TOUCH_Y");
85   int tx = ioport("TOUCH_X")->read();
86   int ty = ioport("TOUCH_Y")->read();
8787
8888   if ( m_out_touch_cb == NULL ||
8989       m_out_touch_cb( &tx, &ty ) != 0 )
r15082r15083
127127   }
128128
129129   // send format tablet packet
130   if ( input_port_read(*this, "TOUCH") & 0x01 )
130   if ( ioport("TOUCH")->read() & 0x01 )
131131   {
132132      send_touch_packet();
133133   }
src/emu/machine/i8155.c
r15082r15083
159159{
160160   UINT8 data = 0;
161161
162   switch (port)
162   switch (get_port_mode(port))
163163   {
164   case PORT_A:
165   case PORT_B:
166      switch (get_port_mode(port))
167      {
168      case PORT_MODE_INPUT:
169         data = m_in_port_func[port](0);
170         break;
164   case PORT_MODE_INPUT:
165      data = m_in_port_func[port](0);
166      break;
171167
172      case PORT_MODE_OUTPUT:
173         data = m_output[port];
174         break;
175      }
168   case PORT_MODE_OUTPUT:
169      data = m_output[port];
176170      break;
177171
178   case PORT_C:
179      switch (get_port_mode(PORT_C))
180      {
181      case PORT_MODE_INPUT:
182         data = m_in_port_func[port](0) & 0x3f;
183         break;
184
185      case PORT_MODE_OUTPUT:
186         data = m_output[port] & 0x3f;
187         break;
188
189      default:
190         logerror("8155 '%s' Unsupported Port C mode!\n", tag());
191      }
172   default:
173      // strobed mode not implemented yet
174      logerror("8155 '%s' Unsupported Port C mode!\n", tag());
192175      break;
193176   }
194177
r15082r15083
386369{
387370   UINT8 data = 0;
388371
389   switch (offset & 0x03)
372   switch (offset & 0x07)
390373   {
391374   case REGISTER_STATUS:
392375      data = m_status;
r15082r15083
404387      break;
405388
406389   case REGISTER_PORT_C:
407      data = read_port(PORT_C);
390      data = read_port(PORT_C) | 0xc0;
408391      break;
392
393   case REGISTER_TIMER_LOW:
394      data = m_counter & 0xff;
395      break;
396
397   case REGISTER_TIMER_HIGH:
398      data = (m_counter >> 8 & 0x3f) | get_timer_mode();
399      break;
409400   }
410401
411402   return data;
r15082r15083
477468         else
478469         {
479470            // load mode and CNT length and start immediately after loading (if timer is not running)
480            m_counter = m_count_length;
471            m_counter = m_count_length & 0x3fff;
481472            m_timer->adjust(attotime::zero, 0, attotime::from_hz(clock()));
482473         }
483474         break;
r15082r15083
493484      break;
494485
495486   case REGISTER_PORT_C:
496      write_port(PORT_C, data);
487      write_port(PORT_C, data & 0x3f);
497488      break;
498489
499490   case REGISTER_TIMER_LOW:
src/emu/screen.c
r15082r15083
782782
783783
784784//-------------------------------------------------
785//  vblank_port_read - custom port handler to
786//   return a VBLANK state
787//-------------------------------------------------
788
789int screen_device::vblank_port_read()
790{
791   return vblank();
792}
793
794
795//-------------------------------------------------
785796//  vblank_begin - call any external callbacks to
786797//  signal the VBLANK period has begun
787798//-------------------------------------------------
src/emu/screen.h
r15082r15083
227227   // additional helpers
228228   void register_vblank_callback(vblank_state_delegate vblank_callback);
229229   void register_screen_bitmap(bitmap_t &bitmap);
230   int vblank_port_read();
230231
231232   // internal to the video system
232233   bool update_quads();
src/emu/driver.c
r15082r15083
712712WRITE32_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_dword_be_w ) { palette_16bit_dword_be_w<5,5,5, 10,5,0>(space, offset, data, mem_mask); }
713713WRITE32_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_dword_le_w ) { palette_16bit_dword_le_w<5,5,5, 10,5,0>(space, offset, data, mem_mask); }
714714
715WRITE8_MEMBER( driver_device::paletteram_xGGGGGRRRRRBBBBB_byte_le_w ) { palette_16bit_byte_le_w<5,5,5, 5,10,0>(space, offset, data, mem_mask); }
716
715717WRITE16_MEMBER( driver_device::paletteram_xGGGGGRRRRRBBBBB_word_w ) { palette_16bit_word_w<5,5,5, 5,10,0>(space, offset, data, mem_mask); }
716718WRITE16_MEMBER( driver_device::paletteram_xGGGGGBBBBBRRRRR_word_w ) { palette_16bit_word_w<5,5,5, 0,10,5>(space, offset, data, mem_mask); }
717719WRITE16_MEMBER( driver_device::paletteram_RRRRRGGGGGBBBBBx_word_w ) { palette_16bit_word_w<5,5,5, 11,6,1>(space, offset, data, mem_mask); }
src/emu/driver.h
r15082r15083
339339   DECLARE_WRITE32_MEMBER( paletteram_xRRRRRGGGGGBBBBB_dword_be_w );
340340   DECLARE_WRITE32_MEMBER( paletteram_xRRRRRGGGGGBBBBB_dword_le_w );
341341
342   DECLARE_WRITE8_MEMBER( paletteram_xGGGGGRRRRRBBBBB_byte_le_w );
343
342344   DECLARE_WRITE16_MEMBER( paletteram_xGGGGGRRRRRBBBBB_word_w );
343345   DECLARE_WRITE16_MEMBER( paletteram_xGGGGGBBBBBRRRRR_word_w );
344346   DECLARE_WRITE16_MEMBER( paletteram_RRRRRGGGGGBBBBBx_word_w );
src/mess/machine/keyboard.c
r15082r15083
6666   UINT8 code;
6767   UINT8 key_code = 0;
6868   UINT8 retVal = 0;
69   UINT8 shift = BIT(input_port_read(*this, "TERM_LINEC"), 1);
70   UINT8 caps  = BIT(input_port_read(*this, "TERM_LINEC"), 2);
71   UINT8 ctrl  = BIT(input_port_read(*this, "TERM_LINEC"), 0);
69   UINT8 shift = BIT(ioport("TERM_LINEC")->read(), 1);
70   UINT8 caps  = BIT(ioport("TERM_LINEC")->read(), 2);
71   UINT8 ctrl  = BIT(ioport("TERM_LINEC")->read(), 0);
7272   i = *scan_line;
7373   {
74      code =   input_port_read(*this, keynames[i]);
74      code =   ioport(keynames[i])->read();
7575      if (code != 0)
7676      {
7777         if (i==0 && shift==0) {
src/mess/machine/dgn_beta.c
r15082r15083
586586   {
587587      for(Idx=0; Idx<NoKeyrows; Idx++)
588588      {
589         state->m_Keyboard[Idx] = input_port_read(device->machine(), keynames[Idx]);
589         state->m_Keyboard[Idx] = device->machine().root_device().ioport(keynames[Idx])->read();
590590
591591         if(state->m_Keyboard[Idx] != 0x7F)
592592            state->m_KAny_next = 1;
r15082r15083
10051005   for(Idx=0; Idx<NoKeyrows; Idx++)
10061006   {
10071007      if (Idx < 10)
1008         Row = input_port_read(machine, keynames[Idx]);
1008         Row = machine.root_device().ioport(keynames[Idx])->read();
10091009
10101010      else
10111011         Row = 0x7f;
src/mess/machine/s100_wunderbus.c
r15082r15083
329329
330330UINT8 s100_wunderbus_device::s100_sinp_r(offs_t offset)
331331{
332   UINT8 address = (input_port_read(*this, "7C") & 0x3e) << 2;
332   UINT8 address = (ioport("7C")->read() & 0x3e) << 2;
333333   if ((offset & 0xf8) != address) return 0;
334334
335335   UINT8 data = 0;
r15082r15083
374374
375375                */
376376
377            data = BITSWAP8(input_port_read(*this, "10A"),0,1,2,3,4,5,6,7) & 0xfc;
377            data = BITSWAP8(ioport("10A")->read(),0,1,2,3,4,5,6,7) & 0xfc;
378378            break;
379379
380380         case 2: // R.T. Clock IN/RESET CLK. Int.
r15082r15083
438438
439439void s100_wunderbus_device::s100_sout_w(offs_t offset, UINT8 data)
440440{
441   UINT8 address = (input_port_read(*this, "7C") & 0x3e) << 2;
441   UINT8 address = (ioport("7C")->read() & 0x3e) << 2;
442442   if ((offset & 0xf8) != address) return;
443443
444444   if ((offset & 0x07) == 7)
src/mess/machine/dai.c
r15082r15083
5757   for (i = 0; i < 8; i++)
5858   {
5959      if (state->m_keyboard_scan_mask & (1 << i))
60         data |= input_port_read(device->machine(), keynames[i]);
60         data |= device->machine().root_device().ioport(keynames[i])->read();
6161   }
6262   return data;
6363}
r15082r15083
139139static TIMER_CALLBACK( dai_timer )
140140{
141141   dai_state *state = machine.driver_data<dai_state>();
142   tms5501_set_pio_bit_7 (state->m_tms5501, (input_port_read(machine, "IN8") & 0x04) ? 1:0);
142   tms5501_set_pio_bit_7 (state->m_tms5501, (machine.root_device().ioport("IN8")->read() & 0x04) ? 1:0);
143143}
144144
145145MACHINE_START( dai )
r15082r15083
194194
195195   switch(offset & 0x000f) {
196196   case 0x00:
197      data = input_port_read(machine(), "IN8");
197      data = ioport("IN8")->read();
198198      data |= 0x08;         // serial ready
199199      if (machine().rand()&0x01)
200200         data |= 0x40;      // random number generator
src/mess/machine/cbmb.c
r15082r15083
152152   cbmb_state *state = device->machine().driver_data<cbmb_state>();
153153   int data = 0;
154154   if (!(state->m_keyline_c & 0x01))
155      data |= input_port_read(device->machine(), "ROW0");
155      data |= device->machine().root_device().ioport("ROW0")->read();
156156
157157   if (!(state->m_keyline_c & 0x02))
158      data |= input_port_read(device->machine(), "ROW2");
158      data |= device->machine().root_device().ioport("ROW2")->read();
159159
160160   if (!(state->m_keyline_c & 0x04))
161      data |= input_port_read(device->machine(), "ROW4");
161      data |= device->machine().root_device().ioport("ROW4")->read();
162162
163163   if (!(state->m_keyline_c & 0x08))
164      data |= input_port_read(device->machine(), "ROW6");
164      data |= device->machine().root_device().ioport("ROW6")->read();
165165
166166   if (!(state->m_keyline_c & 0x10))
167      data |= input_port_read(device->machine(), "ROW8");
167      data |= device->machine().root_device().ioport("ROW8")->read();
168168
169169   if (!(state->m_keyline_c & 0x20))
170      data |= input_port_read(device->machine(), "ROW10");
170      data |= state->ioport("ROW10")->read();
171171
172172   return data ^0xff;
173173}
r15082r15083
177177   cbmb_state *state = device->machine().driver_data<cbmb_state>();
178178   int data = 0;
179179   if (!(state->m_keyline_c & 0x01))
180      data |= input_port_read(device->machine(), "ROW1");
180      data |= device->machine().root_device().ioport("ROW1")->read();
181181
182182   if (!(state->m_keyline_c & 0x02))
183      data |= input_port_read(device->machine(), "ROW3");
183      data |= device->machine().root_device().ioport("ROW3")->read();
184184
185185   if (!(state->m_keyline_c & 0x04))
186      data |= input_port_read(device->machine(), "ROW5");
186      data |= device->machine().root_device().ioport("ROW5")->read();
187187
188188   if (!(state->m_keyline_c & 0x08))
189      data |= input_port_read(device->machine(), "ROW7");
189      data |= device->machine().root_device().ioport("ROW7")->read();
190190
191191   if (!(state->m_keyline_c & 0x10))
192      data |= input_port_read(device->machine(), "ROW9") | ((input_port_read(device->machine(), "SPECIAL") & 0x04) ? 1 : 0 );
192      data |= device->machine().root_device().ioport("ROW9")->read() | ((device->machine().root_device().ioport("SPECIAL")->read() & 0x04) ? 1 : 0 );
193193
194194   if (!(state->m_keyline_c & 0x20))
195      data |= input_port_read(device->machine(), "ROW11");
195      data |= state->ioport("ROW11")->read();
196196
197197   return data ^0xff;
198198}
r15082r15083
201201{
202202   int data = 0;
203203   cbmb_state *state = device->machine().driver_data<cbmb_state>();
204   if ((input_port_read(device->machine(), "ROW0") & ~state->m_keyline_a) ||
205            (input_port_read(device->machine(), "ROW1") & ~state->m_keyline_b))
204   if ((device->machine().root_device().ioport("ROW0")->read() & ~state->m_keyline_a) ||
205            (device->machine().root_device().ioport("ROW1")->read() & ~state->m_keyline_b))
206206       data |= 0x01;
207207
208   if ((input_port_read(device->machine(), "ROW2") & ~state->m_keyline_a) ||
209            (input_port_read(device->machine(), "ROW3") & ~state->m_keyline_b))
208   if ((device->machine().root_device().ioport("ROW2")->read() & ~state->m_keyline_a) ||
209            (device->machine().root_device().ioport("ROW3")->read() & ~state->m_keyline_b))
210210       data |= 0x02;
211211
212   if ((input_port_read(device->machine(), "ROW4") & ~state->m_keyline_a) ||
213            (input_port_read(device->machine(), "ROW5") & ~state->m_keyline_b))
212   if ((device->machine().root_device().ioport("ROW4")->read() & ~state->m_keyline_a) ||
213            (device->machine().root_device().ioport("ROW5")->read() & ~state->m_keyline_b))
214214       data |= 0x04;
215215
216   if ((input_port_read(device->machine(), "ROW6") & ~state->m_keyline_a) ||
217            (input_port_read(device->machine(), "ROW7") & ~state->m_keyline_b))
216   if ((device->machine().root_device().ioport("ROW6")->read() & ~state->m_keyline_a) ||
217            (device->machine().root_device().ioport("ROW7")->read() & ~state->m_keyline_b))
218218       data |= 0x08;
219219
220   if ((input_port_read(device->machine(), "ROW8") & ~state->m_keyline_a) ||
221            ((input_port_read(device->machine(), "ROW9") | ((input_port_read(device->machine(), "SPECIAL") & 0x04) ? 1 : 0)) & ~state->m_keyline_b))
220   if ((device->machine().root_device().ioport("ROW8")->read() & ~state->m_keyline_a) ||
221            ((device->machine().root_device().ioport("ROW9")->read() | ((device->machine().root_device().ioport("SPECIAL")->read() & 0x04) ? 1 : 0)) & ~state->m_keyline_b))
222222       data |= 0x10;
223223
224   if ((input_port_read(device->machine(), "ROW10") & ~state->m_keyline_a) ||
225            (input_port_read(device->machine(), "ROW11") & ~state->m_keyline_b))
224   if ((device->machine().root_device().ioport("ROW10")->read() & ~state->m_keyline_a) ||
225            (state->ioport("ROW11")->read() & ~state->m_keyline_b))
226226       data |= 0x20;
227227
228228   if (!state->m_p500)
r15082r15083
341341
342342static TIMER_CALLBACK( p500_lightpen_tick )
343343{
344   if ((input_port_read_safe(machine, "CTRLSEL", 0x00) & 0x07) == 0x04)
344   if ((machine.root_device().ioport("CTRLSEL")->read_safe(0x00) & 0x07) == 0x04)
345345   {
346346      /* enable lightpen crosshair */
347347      crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_ALL);
r15082r15083
359359   device_t *tpi_0 = machine.device("tpi6525_0");
360360
361361#if 0
362   int controller1 = input_port_read(machine, "CTRLSEL") & 0x07;
363   int controller2 = input_port_read(machine, "CTRLSEL") & 0x70;
362   int controller1 = machine.root_device().ioport("CTRLSEL")->read() & 0x07;
363   int controller2 = machine.root_device().ioport("CTRLSEL")->read() & 0x70;
364364#endif
365365
366366   tpi6525_i0_w(tpi_0, state->m_irq_level);
r15082r15083
372372   switch (controller1)
373373   {
374374      case 0x00:
375         value &= ~input_port_read(machine, "JOY1_1B");         /* Joy1 Directions + Button 1 */
375         value &= ~machine.root_device().ioport("JOY1_1B")->read();         /* Joy1 Directions + Button 1 */
376376         break;
377377
378378      case 0x01:
379         if (input_port_read(machine, "OTHER") & 0x40)         /* Paddle2 Button */
379         if (machine.root_device().ioport("OTHER")->read() & 0x40)         /* Paddle2 Button */
380380            value &= ~0x08;
381         if (input_port_read(machine, "OTHER") & 0x80)         /* Paddle1 Button */
381         if (machine.root_device().ioport("OTHER")->read() & 0x80)         /* Paddle1 Button */
382382            value &= ~0x04;
383383         break;
384384
385385      case 0x02:
386         if (input_port_read(machine, "OTHER") & 0x02)         /* Mouse Button Left */
386         if (machine.root_device().ioport("OTHER")->read() & 0x02)         /* Mouse Button Left */
387387            value &= ~0x10;
388         if (input_port_read(machine, "OTHER") & 0x01)         /* Mouse Button Right */
388         if (machine.root_device().ioport("OTHER")->read() & 0x01)         /* Mouse Button Right */
389389            value &= ~0x01;
390390         break;
391391
392392      case 0x03:
393         value &= ~(input_port_read(machine, "JOY1_2B") & 0x1f);   /* Joy1 Directions + Button 1 */
393         value &= ~(machine.root_device().ioport("JOY1_2B")->read() & 0x1f);   /* Joy1 Directions + Button 1 */
394394         break;
395395
396396      case 0x04:
397397/* was there any input on the lightpen? where is it mapped? */
398//          if (input_port_read(machine, "OTHER") & 0x04)           /* Lightpen Signal */
398//          if (machine.root_device().ioport("OTHER")->read() & 0x04)           /* Lightpen Signal */
399399//              value &= ?? ;
400400         break;
401401
r15082r15083
414414   switch (controller2)
415415   {
416416      case 0x00:
417         value &= ~input_port_read(machine, "JOY2_1B");         /* Joy2 Directions + Button 1 */
417         value &= ~machine.root_device().ioport("JOY2_1B")->read();         /* Joy2 Directions + Button 1 */
418418         break;
419419
420420      case 0x10:
421         if (input_port_read(machine, "OTHER") & 0x10)         /* Paddle4 Button */
421         if (machine.root_device().ioport("OTHER")->read() & 0x10)         /* Paddle4 Button */
422422            value &= ~0x08;
423         if (input_port_read(machine, "OTHER") & 0x20)         /* Paddle3 Button */
423         if (machine.root_device().ioport("OTHER")->read() & 0x20)         /* Paddle3 Button */
424424            value &= ~0x04;
425425         break;
426426
427427      case 0x20:
428         if (input_port_read(machine, "OTHER") & 0x02)         /* Mouse Button Left */
428         if (machine.root_device().ioport("OTHER")->read() & 0x02)         /* Mouse Button Left */
429429            value &= ~0x10;
430         if (input_port_read(machine, "OTHER") & 0x01)         /* Mouse Button Right */
430         if (machine.root_device().ioport("OTHER")->read() & 0x01)         /* Mouse Button Right */
431431            value &= ~0x01;
432432         break;
433433
434434      case 0x30:
435         value &= ~(input_port_read(machine, "JOY2_2B") & 0x1f);   /* Joy2 Directions + Button 1 */
435         value &= ~(machine.root_device().ioport("JOY2_2B")->read() & 0x1f);   /* Joy2 Directions + Button 1 */
436436         break;
437437
438438      case 0x40:
439439/* was there any input on the lightpen? where is it mapped? */
440//          if (input_port_read(machine, "OTHER") & 0x04)           /* Lightpen Signal */
440//          if (machine.root_device().ioport("OTHER")->read() & 0x04)           /* Lightpen Signal */
441441//              value &= ?? ;
442442         break;
443443
r15082r15083
458458   /* for p500, check if lightpen has been chosen as input: if so, enable crosshair (but c64-like inputs for p500 are not working atm) */
459459   machine.scheduler().timer_set(attotime::zero, FUNC(p500_lightpen_tick));
460460
461   set_led_status(machine, 1, input_port_read(machine, "SPECIAL") & 0x04 ? 1 : 0);      /* Shift Lock */
461   set_led_status(machine, 1, machine.root_device().ioport("SPECIAL")->read() & 0x04 ? 1 : 0);      /* Shift Lock */
462462}
463463
464464
src/mess/machine/mbee.c
r15082r15083
152152   for (i = 0; i < 15; i++)
153153   {
154154      sprintf(kbdrow,"X%d",i);
155      pressed[i] = (input_port_read(machine, kbdrow));
155      pressed[i] = (machine.root_device().ioport(kbdrow)->read());
156156   }
157157
158158   /* find what has changed */
r15082r15083
772772   device_t *cpu = image.device().machine().device("maincpu");
773773   address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
774774   UINT16 i, j;
775   UINT8 data, sw = input_port_read(image.device().machine(), "CONFIG") & 1;   /* reading the dipswitch: 1 = autorun */
775   UINT8 data, sw = image.device().machine().root_device().ioport("CONFIG")->read() & 1;   /* reading the dipswitch: 1 = autorun */
776776
777777   if (!mame_stricmp(image.filetype(), "mwb"))
778778   {
src/mess/machine/pc1350.c
r15082r15083
3232   int t = pc1350_keyboard_line_r(machine);
3333
3434   if (t & 0x01)
35      data |= input_port_read(machine, "KEY0");
35      data |= machine.root_device().ioport("KEY0")->read();
3636
3737   if (t & 0x02)
38      data |= input_port_read(machine, "KEY1");
38      data |= machine.root_device().ioport("KEY1")->read();
3939
4040   if (t & 0x04)
41      data |= input_port_read(machine, "KEY2");
41      data |= machine.root_device().ioport("KEY2")->read();
4242
4343   if (t & 0x08)
44      data |= input_port_read(machine, "KEY3");
44      data |= machine.root_device().ioport("KEY3")->read();
4545
4646   if (t & 0x10)
47      data |= input_port_read(machine, "KEY4");
47      data |= machine.root_device().ioport("KEY4")->read();
4848
4949   if (t & 0x20)
50      data |= input_port_read(machine, "KEY5");
50      data |= machine.root_device().ioport("KEY5")->read();
5151
5252   if (state->m_outa & 0x01)
53      data |= input_port_read(machine, "KEY6");
53      data |= machine.root_device().ioport("KEY6")->read();
5454
5555   if (state->m_outa & 0x02)
56      data |= input_port_read(machine, "KEY7");
56      data |= machine.root_device().ioport("KEY7")->read();
5757
5858   if (state->m_outa & 0x04)
5959   {
60      data |= input_port_read(machine, "KEY8");
60      data |= machine.root_device().ioport("KEY8")->read();
6161
6262      /* At Power Up we fake a 'CLS' pressure */
6363      if (state->m_power)
r15082r15083
6565   }
6666
6767   if (state->m_outa & 0x08)
68      data |= input_port_read(machine, "KEY9");
68      data |= machine.root_device().ioport("KEY9")->read();
6969
7070   if (state->m_outa & 0x10)
71      data |= input_port_read(machine, "KEY10");
71      data |= machine.root_device().ioport("KEY10")->read();
7272
7373   if (state->m_outa & 0xc0)
74      data |= input_port_read(machine, "KEY11");
74      data |= machine.root_device().ioport("KEY11")->read();
7575
7676   // missing lshift
7777
r15082r15083
8787
8888int pc1350_brk(device_t *device)
8989{
90   return (input_port_read(device->machine(), "EXTRA") & 0x01);
90   return (device->machine().root_device().ioport("EXTRA")->read() & 0x01);
9191}
9292
9393static TIMER_CALLBACK(pc1350_power_up)
src/mess/machine/pokemini.c
r15082r15083
13541354
13551355   switch( offset )
13561356   {
1357   case 0x52:   return input_port_read(device->machine(), "INPUTS");
1357   case 0x52:   return state->ioport("INPUTS")->read();
13581358   case 0x61:
13591359      if ( ! ( state->m_pm_reg[0x60] & 0x04 ) )
13601360      {
r15082r15083
15511551      }
15521552
15531553      /* Set possible input irqs */
1554      state->m_pm_reg[0x29] |= ~ input_port_read( machine, "INPUTS" );
1554      state->m_pm_reg[0x29] |= ~ machine.root_device().ioport( "INPUTS" )->read();
15551555   }
15561556}
15571557
src/mess/machine/gamecom.c
r15082r15083
4848
4949   if ( column == 0 )
5050   {
51      if ( !BIT( input_port_read(machine(), "IN2"), 2) )
51      if ( !BIT( ioport("IN2")->read(), 2) )
5252      {
53         m_stylus_x = input_port_read(machine(), "STYX") >> 4;
54         m_stylus_y = input_port_read(machine(), "STYY") >> 4;
53         m_stylus_x = ioport("STYX")->read() >> 4;
54         m_stylus_y = ioport("STYY")->read() >> 4;
5555      }
5656      else
5757      {
r15082r15083
140140                  /* P0 bit 7 cleared => 8B (button A) */
141141                  /* P1 bit 0 cleared => 8C (button B) */
142142                  /* P1 bit 1 cleared => 8D (button C) */
143               m_p_ram[SM8521_P0] = input_port_read(machine(), "IN0");
144               m_p_ram[SM8521_P1] = (m_p_ram[SM8521_P1] & 0xFC) | ( input_port_read(machine(), "IN1") & 3 );
143               m_p_ram[SM8521_P0] = ioport("IN0")->read();
144               m_p_ram[SM8521_P1] = (m_p_ram[SM8521_P1] & 0xFC) | ( ioport("IN1")->read() & 3 );
145145               break;
146146            case 0xFFFF:   /* keys #2 */
147147                  /* P0 bit 0 cleared => 88 (power) */
r15082r15083
154154                  /* P0 bit 7 cleared => A0 */
155155                  /* P1 bit 0 cleared => A0 */
156156                  /* P1 bit 1 cleared => A0 */
157               m_p_ram[SM8521_P0] = (m_p_ram[SM8521_P0] & 0xFC) | ( input_port_read(machine(), "IN2") & 3 );
157               m_p_ram[SM8521_P0] = (m_p_ram[SM8521_P0] & 0xFC) | ( ioport("IN2")->read() & 3 );
158158               m_p_ram[SM8521_P1] = 0xFF;
159159               break;
160160            }
r15082r15083
345345void gamecom_handle_dma( device_t *device, int cycles )
346346{
347347   gamecom_state *state = device->machine().driver_data<gamecom_state>();
348   UINT8 * RAM = device->machine().root_device().memregion("maincpu")->base();
348   UINT8 * RAM = state->memregion("maincpu")->base();
349349   UINT8 data = RAM[SM8521_DMC];
350350   state->m_dma.overwrite_mode = data & 0x01;
351351   state->m_dma.transfer_mode = data & 0x06;
src/mess/machine/coco_pak.c
r15082r15083
9898   if (m_cart->exists()) {
9999      cococart_line_value cart_line;
100100
101      cart_line = input_port_read_safe(machine(), CART_AUTOSTART_TAG, 0x01)
101      cart_line = ioport(CART_AUTOSTART_TAG)->read_safe(0x01)
102102         ? COCOCART_LINE_VALUE_Q
103103         : COCOCART_LINE_VALUE_CLEAR;
104104
src/mess/machine/pmd85.c
r15082r15083
251251      "KEY8", "KEY9", "KEY10", "KEY11", "KEY12", "KEY13", "KEY14", "KEY15"
252252   };
253253
254   return input_port_read(device->machine(), keynames[(state->m_ppi_port_outputs[0][0] & 0x0f)]) & input_port_read(device->machine(), "KEY15");
254   return device->machine().root_device().ioport(keynames[(state->m_ppi_port_outputs[0][0] & 0x0f)])->read() & device->machine().root_device().ioport("KEY15")->read();
255255}
256256
257257static  READ8_DEVICE_HANDLER ( pmd85_ppi_0_portc_r )
r15082r15083
297297   for (i = 0; i < 8; i++)
298298   {
299299      if (!BIT(state->m_ppi_port_outputs[0][0], i))
300         data &= input_port_read(device->machine(), keynames[i]);
300         data &= device->machine().root_device().ioport(keynames[i])->read();
301301   }
302302   return data;
303303}
304304
305305static  READ8_DEVICE_HANDLER ( mato_ppi_0_portc_r )
306306{
307   return input_port_read(device->machine(), "KEY8") | 0x8f;
307   return device->machine().root_device().ioport("KEY8")->read() | 0x8f;
308308}
309309
310310static WRITE8_DEVICE_HANDLER ( mato_ppi_0_portc_w )
r15082r15083
459459static READ8_DEVICE_HANDLER ( pmd85_ppi_3_porta_r )
460460{
461461   pmd85_state *state = device->machine().driver_data<pmd85_state>();
462   if (device->machine().root_device().memregion("user1")->base() != NULL)
462   if (state->memregion("user1")->base() != NULL)
463463      return state->memregion("user1")->base()[state->m_ppi_port_outputs[3][1] | (state->m_ppi_port_outputs[3][2] << 8)];
464464   else
465465      return 0;
r15082r15083
796796   int data;
797797   int current_level;
798798
799   if (!(input_port_read(machine, "DSW0") & 0x02))   /* V.24 / Tape Switch */
799   if (!(machine.root_device().ioport("DSW0")->read() & 0x02))   /* V.24 / Tape Switch */
800800   {
801801      /* tape reading */
802802      if (machine.device<cassette_image_device>(CASSETTE_TAG)->get_state()&CASSETTE_PLAY)
r15082r15083
864864
865865DIRECT_UPDATE_MEMBER(pmd85_state::pmd85_opbaseoverride)
866866{
867   if (input_port_read(machine(), "RESET") & 0x01)
867   if (ioport("RESET")->read() & 0x01)
868868      machine().scheduler().timer_set(attotime::from_usec(10), FUNC(pmd_reset));
869869   return address;
870870}
r15082r15083
949949      case PMD85_2A:
950950      case PMD85_3:
951951      case C2717:
952         state->m_rom_module_present = (input_port_read(machine, "DSW0") & 0x01) ? 1 : 0;
952         state->m_rom_module_present = (machine.root_device().ioport("DSW0")->read() & 0x01) ? 1 : 0;
953953         break;
954954      case ALFA:
955955      case MATO:
src/mess/machine/kramermc.c
r15082r15083
2222   kramermc_state *state = device->machine().driver_data<kramermc_state>();
2323   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
2424
25   return input_port_read(device->machine(), keynames[state->m_key_row]);
25   return device->machine().root_device().ioport(keynames[state->m_key_row])->read();
2626}
2727
2828static WRITE8_DEVICE_HANDLER (kramermc_port_a_w)
src/mess/machine/c64_4ksa.c
r15082r15083
8585 
8686UINT8 c64_4ksa_device::c64_pb_r(address_space &space, offs_t offset)
8787{
88   return input_port_read(*this, "PB");
88   return ioport("PB")->read();
8989}
9090 
9191 
r15082r15083
9595 
9696int c64_4ksa_device::c64_pa2_r()
9797{
98   return BIT(input_port_read(*this, "PA2"), 0);
98   return BIT(ioport("PA2")->read(), 0);
9999}
100100 
101101 
src/mess/machine/ay3600.c
r15082r15083
3939static TIMER_CALLBACK(AY3600_poll);
4040
4141static int AY3600_keyboard_queue_chars(running_machine &machine, const unicode_char *text, size_t text_len);
42static int AY3600_keyboard_accept_char(running_machine &machine, unicode_char ch);
43
42static bool AY3600_keyboard_accept_char(running_machine &machine, unicode_char ch);
43static bool AY3600_keyboard_charqueue_empty(running_machine &machine);
4444static const unsigned char ay3600_key_remap_2[9*8][4] =
4545{
4646/*        norm ctrl shft both */
r15082r15083
303303INLINE int a2_no_ctrl_reset(running_machine &machine)
304304{
305305   return ((a2_has_repeat(machine) && !a2_has_reset_dip(machine)) ||
306         (a2_has_reset_dip(machine) && !input_port_read(machine, "reset_dip")));
306         (a2_has_reset_dip(machine) && !machine.root_device().ioport("reset_dip")->read()));
307307}
308308
309309
r15082r15083
333333   state->m_last_key_unmodified = 0xff;   /* necessary for special repeat key behaviour */
334334   state->m_time_until_repeat = MAGIC_KEY_REPEAT_NUMBER;
335335
336   inputx_setup_natural_keyboard(machine,
337      AY3600_keyboard_queue_chars,
338      AY3600_keyboard_accept_char,
339      NULL);
336   machine.ioport().natkeyboard().configure(
337      ioport_queue_chars_delegate(FUNC(AY3600_keyboard_queue_chars), &machine),
338      ioport_accept_char_delegate(FUNC(AY3600_keyboard_accept_char), &machine),
339      ioport_charqueue_empty_delegate(FUNC(AY3600_keyboard_charqueue_empty), &machine));
340340
341341   return 0;
342342}
r15082r15083
367367
368368   /* only repeat keys on a 2/2+ if special REPT key is pressed */
369369   if (a2_has_repeat(machine))
370      state->m_time_until_repeat = input_port_read(machine, "keyb_repeat") & 0x01 ? 0 : ~0;
370      state->m_time_until_repeat = machine.root_device().ioport("keyb_repeat")->read() & 0x01 ? 0 : ~0;
371371
372372   /* check caps lock and set LED here */
373373   if (apple2_pressed_specialkey(machine, SPECIALKEY_CAPSLOCK))
r15082r15083
453453
454454   for (port = 0; port < num_ports; port++)
455455   {
456      data = input_port_read(machine, portnames[port]);
456      data = machine.root_device().ioport(portnames[port])->read();
457457
458458      for (bit = 0; bit < 8; bit++)
459459      {
r15082r15083
615615
616616
617617
618static int AY3600_keyboard_accept_char(running_machine &machine, unicode_char ch)
618static bool AY3600_keyboard_accept_char(running_machine &machine, unicode_char ch)
619619{
620620   return AY3600_get_keycode(ch) != 0;
621621}
622622
623static bool AY3600_keyboard_charqueue_empty(running_machine &machine)
624{
625   return true;
626}
627
628 
629
src/mess/machine/p2000t.c
r15082r15083
4949   if (m_port_101f & P2000M_101F_KEYINT)
5050   {
5151      return (
52      input_port_read(machine(), "KEY0") & input_port_read(machine(), "KEY1") &
53      input_port_read(machine(), "KEY2") & input_port_read(machine(), "KEY3") &
54      input_port_read(machine(), "KEY4") & input_port_read(machine(), "KEY5") &
55      input_port_read(machine(), "KEY6") & input_port_read(machine(), "KEY7") &
56      input_port_read(machine(), "KEY8") & input_port_read(machine(), "KEY9"));
52      ioport("KEY0")->read() & ioport("KEY1")->read() &
53      ioport("KEY2")->read() & ioport("KEY3")->read() &
54      ioport("KEY4")->read() & ioport("KEY5")->read() &
55      ioport("KEY6")->read() & ioport("KEY7")->read() &
56      ioport("KEY8")->read() & ioport("KEY9")->read());
5757   }
5858   else
5959   if (offset < 10)
6060   {
61      return (input_port_read(machine(), keynames[offset]));
61      return (ioport(keynames[offset])->read());
6262   }
6363   else
6464      return 0xff;
src/mess/machine/c16.c
r15082r15083
515515   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
516516   c16_state *state = space->machine().driver_data<c16_state>();
517517
518   if (input_port_read_safe(machine, "SID", 0x00) & 0x02)
518   if (machine.root_device().ioport("SID")->read_safe(0x00) & 0x02)
519519   {
520520      if (state->m_pal)
521521         space->install_legacy_write_handler(0xd400, 0xd41f, FUNC(c16_sidcart_16k));
r15082r15083
534534   c16_state *state = machine.driver_data<c16_state>();
535535   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
536536
537   if (input_port_read_safe(machine, "SID", 0x00) & 0x01)
537   if (machine.root_device().ioport("SID")->read_safe(0x00) & 0x01)
538538      space->install_legacy_readwrite_handler(*state->m_sid, 0xfe80, 0xfe9f, FUNC(sid6581_r), FUNC(sid6581_w));
539539   else
540540      space->install_legacy_readwrite_handler(*state->m_sid, 0xfd40, 0xfd5f, FUNC(sid6581_r), FUNC(sid6581_w));
r15082r15083
550550   for (i = 0; i < 8; i++)
551551   {
552552      value = 0xff;
553      value &= ~input_port_read(device->machine(), c16ports[i]);
553      value &= ~device->machine().root_device().ioport(c16ports[i])->read();
554554
555555      /* Shift Lock is mapped on Left/Right Shift */
556      if ((i == 1) && (input_port_read(device->machine(), "SPECIAL") & 0x80))
556      if ((i == 1) && (device->machine().root_device().ioport("SPECIAL")->read() & 0x80))
557557         value &= ~0x80;
558558
559559      state->m_keyline[i] = value;
560560   }
561561
562   if (input_port_read(device->machine(), "CTRLSEL") & 0x01)
562   if (device->machine().root_device().ioport("CTRLSEL")->read() & 0x01)
563563   {
564564      value = 0xff;
565      if (input_port_read(device->machine(), "JOY0") & 0x10)         /* Joypad1_Button */
565      if (device->machine().root_device().ioport("JOY0")->read() & 0x10)         /* Joypad1_Button */
566566         {
567            if (input_port_read(device->machine(), "SPECIAL") & 0x40)
567            if (device->machine().root_device().ioport("SPECIAL")->read() & 0x40)
568568               value &= ~0x80;
569569            else
570570               value &= ~0x40;
571571         }
572572
573      value &= ~(input_port_read(device->machine(), "JOY0") & 0x0f);   /* Other Inputs Joypad1 */
573      value &= ~(device->machine().root_device().ioport("JOY0")->read() & 0x0f);   /* Other Inputs Joypad1 */
574574
575      if (input_port_read(device->machine(), "SPECIAL") & 0x40)
575      if (device->machine().root_device().ioport("SPECIAL")->read() & 0x40)
576576         state->m_keyline[9] = value;
577577      else
578578         state->m_keyline[8] = value;
579579   }
580580
581   if (input_port_read(device->machine(), "CTRLSEL") & 0x10)
581   if (device->machine().root_device().ioport("CTRLSEL")->read() & 0x10)
582582   {
583583      value = 0xff;
584      if (input_port_read(device->machine(), "JOY1") & 0x10)         /* Joypad2_Button */
584      if (device->machine().root_device().ioport("JOY1")->read() & 0x10)         /* Joypad2_Button */
585585         {
586            if (input_port_read(device->machine(), "SPECIAL") & 0x40)
586            if (device->machine().root_device().ioport("SPECIAL")->read() & 0x40)
587587               value &= ~0x40;
588588            else
589589               value &= ~0x80;
590590         }
591591
592      value &= ~(input_port_read(device->machine(), "JOY1") & 0x0f);   /* Other Inputs Joypad2 */
592      value &= ~(device->machine().root_device().ioport("JOY1")->read() & 0x0f);   /* Other Inputs Joypad2 */
593593
594      if (input_port_read(device->machine(), "SPECIAL") & 0x40)
594      if (device->machine().root_device().ioport("SPECIAL")->read() & 0x40)
595595         state->m_keyline[8] = value;
596596      else
597597         state->m_keyline[9] = value;
r15082r15083
609609#endif
610610   }
611611
612   set_led_status(device->machine(), 1, input_port_read(device->machine(), "SPECIAL") & 0x80 ? 1 : 0);      /* Shift Lock */
613   set_led_status(device->machine(), 0, input_port_read(device->machine(), "SPECIAL") & 0x40 ? 1 : 0);      /* Joystick Swap */
612   set_led_status(device->machine(), 1, device->machine().root_device().ioport("SPECIAL")->read() & 0x80 ? 1 : 0);      /* Shift Lock */
613   set_led_status(device->machine(), 0, device->machine().root_device().ioport("SPECIAL")->read() & 0x40 ? 1 : 0);      /* Joystick Swap */
614614}
615615
616616
src/mess/machine/trs80m2kb.c
r15082r15083
311311 
312312   switch (m_y)
313313   {
314      case 0: data &= input_port_read(*this, "X0"); break;
315      case 1: data &= input_port_read(*this, "X1"); break;
316      case 2: data &= input_port_read(*this, "X2"); break;
317      case 3: data &= input_port_read(*this, "X3"); break;
318      case 4: data &= input_port_read(*this, "X4"); break;
319      case 5: data &= input_port_read(*this, "X5"); break;
320      case 6: data &= input_port_read(*this, "X6"); break;
321      case 7: data &= input_port_read(*this, "X7"); break;
322      case 8: data &= input_port_read(*this, "X8"); break;
323      case 9: data &= input_port_read(*this, "X9"); break;
324      case 0xa: data &= input_port_read(*this, "XA"); break;
325      case 0xb: data &= input_port_read(*this, "XB"); break;
314      case 0: data &= ioport("X0")->read(); break;
315      case 1: data &= ioport("X1")->read(); break;
316      case 2: data &= ioport("X2")->read(); break;
317      case 3: data &= ioport("X3")->read(); break;
318      case 4: data &= ioport("X4")->read(); break;
319      case 5: data &= ioport("X5")->read(); break;
320      case 6: data &= ioport("X6")->read(); break;
321      case 7: data &= ioport("X7")->read(); break;
322      case 8: data &= ioport("X8")->read(); break;
323      case 9: data &= ioport("X9")->read(); break;
324      case 0xa: data &= ioport("XA")->read(); break;
325      case 0xb: data &= ioport("XB")->read(); break;
326326   }
327327 
328328   return data;
src/mess/machine/c64_sfx_sound_expander.c
r15082r15083
245245      {
246246         switch (offset & 0x07)
247247         {
248         case 0: data |= input_port_read(*this, "KB0"); break;
249         case 1: data |= input_port_read(*this, "KB1"); break;
250         case 2: data |= input_port_read(*this, "KB2"); break;
251         case 3: data |= input_port_read(*this, "KB3"); break;
252         case 4: data |= input_port_read(*this, "KB4"); break;
253         case 5: data |= input_port_read(*this, "KB5"); break;
254         case 6: data |= input_port_read(*this, "KB6"); break;
255         case 7: data |= input_port_read(*this, "KB7"); break;
248         case 0: data |= ioport("KB0")->read(); break;
249         case 1: data |= ioport("KB1")->read(); break;
250         case 2: data |= ioport("KB2")->read(); break;
251         case 3: data |= ioport("KB3")->read(); break;
252         case 4: data |= ioport("KB4")->read(); break;
253         case 5: data |= ioport("KB5")->read(); break;
254         case 6: data |= ioport("KB6")->read(); break;
255         case 7: data |= ioport("KB7")->read(); break;
256256         }
257257      }
258258      else if (BIT(offset, 5))
src/mess/machine/electron.c
r15082r15083
127127   for( i = 0; i < 14; i++ )
128128   {
129129      if( !(offset & 1) )
130         data |= input_port_read(machine(), keynames[i]) & 0x0f;
130         data |= ioport(keynames[i])->read() & 0x0f;
131131
132132      offset = offset >> 1;
133133   }
src/mess/machine/cbmipt.c
r15082r15083
178178   PORT_CONFSETTING( 0x07, "Off" )
179179
180180   PORT_START("JOY1_1B")
181   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
182   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
183   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
184   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
185   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
181   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
182   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
183   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
184   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
185   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
186186   PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED )
187187
188188   PORT_START("JOY2_1B")
189   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_HOME) PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
190   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_END) PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
191   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_DEL) PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
192   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_PGDN) PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
193   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_INSERT) PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
189   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_HOME) PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
190   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_END) PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
191   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_DEL) PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
192   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_PGDN) PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
193   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_INSERT) PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
194194   PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED )
195195
196196   /* Mouse Commodore 1350 was basically working as a Joystick */
197197   PORT_START("JOY1_2B")
198   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("Mouse 1350 Up") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
199   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("Mouse 1350 Down") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
200   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("Mouse 1350 Left") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
201   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("Mouse 1350 Right") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
202   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Mouse 1350 Button 1") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
203   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Mouse 1350 Button 2") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
198   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("Mouse 1350 Up") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
199   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("Mouse 1350 Down") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
200   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("Mouse 1350 Left") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
201   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("Mouse 1350 Right") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
202   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Mouse 1350 Button 1") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
203   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Mouse 1350 Button 2") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
204204   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
205205
206206   /* Still to verify how many mices you were able to plug into a c64 */
r15082r15083
208208   PORT_START("JOY2_2B")
209209   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
210210/*  PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_HOME) PORT_CODE(JOYCODE_Y_UP_SWITCH)
211    PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_END) PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x30)
212    PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_DEL) PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x30)
213    PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_PGDN) PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x30)
214    PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_INSERT) PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x30)
215    PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_PGUP) PORT_CODE(JOYCODE_BUTTON2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x30)
211    PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_END) PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x30)
212    PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_DEL) PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x30)
213    PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CODE(KEYCODE_PGDN) PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x30)
214    PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_INSERT) PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x30)
215    PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_PGUP) PORT_CODE(JOYCODE_BUTTON2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x30)
216216    PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
217217*/
218218   PORT_START("PADDLE1")
219   PORT_BIT( 0xff, 128, IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
219   PORT_BIT( 0xff, 128, IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
220220
221221   PORT_START("PADDLE2")
222   PORT_BIT( 0xff, 128, IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_DOWN) PORT_CODE_INC(KEYCODE_UP) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
222   PORT_BIT( 0xff, 128, IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_DOWN) PORT_CODE_INC(KEYCODE_UP) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
223223
224224   PORT_START("PADDLE3")
225   PORT_BIT( 0xff, 128, IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_HOME) PORT_CODE_INC(KEYCODE_PGUP) PORT_PLAYER(3) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
225   PORT_BIT( 0xff, 128, IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_HOME) PORT_CODE_INC(KEYCODE_PGUP) PORT_PLAYER(3) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
226226
227227   PORT_START("PADDLE4")
228   PORT_BIT( 0xff, 128, IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_END) PORT_CODE_INC(KEYCODE_PGDN) PORT_PLAYER(4) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
228   PORT_BIT( 0xff, 128, IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CENTERDELTA(0) PORT_CODE_DEC(KEYCODE_END) PORT_CODE_INC(KEYCODE_PGDN) PORT_PLAYER(4) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
229229
230230   PORT_START("TRACKX")
231   PORT_BIT( 0x7e, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
231   PORT_BIT( 0x7e, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
232232
233233   PORT_START("TRACKY")
234   PORT_BIT( 0x7e, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
234   PORT_BIT( 0x7e, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
235235
236236   PORT_START("LIGHTX")
237   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_NAME("Lightpen X Axis") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x04)
237   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_NAME("Lightpen X Axis") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x04)
238238
239239   PORT_START("LIGHTY")
240   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_NAME("Lightpen Y Axis") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x04)
240   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_NAME("Lightpen Y Axis") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x04)
241241
242242   PORT_START("OTHER")
243   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Paddle 1 Button") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
244   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Paddle 2 Button") PORT_CODE(KEYCODE_LALT) PORT_CODE(JOYCODE_BUTTON2) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
245   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Paddle 3 Button") PORT_CODE(KEYCODE_INSERT) PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
246   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Paddle 4 Button") PORT_CODE(KEYCODE_DEL) PORT_CODE(JOYCODE_BUTTON2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
247   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightpen Signal") PORT_CODE(KEYCODE_LCONTROL) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x04)
248   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button Left") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
249   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Mouse Button Right") PORT_CODE(KEYCODE_LALT) PORT_CODE(JOYCODE_BUTTON2) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
243   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Paddle 1 Button") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
244   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Paddle 2 Button") PORT_CODE(KEYCODE_LALT) PORT_CODE(JOYCODE_BUTTON2) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
245   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Paddle 3 Button") PORT_CODE(KEYCODE_INSERT) PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
246   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Paddle 4 Button") PORT_CODE(KEYCODE_DEL) PORT_CODE(JOYCODE_BUTTON2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
247   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightpen Signal") PORT_CODE(KEYCODE_LCONTROL) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x04)
248   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button Left") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
249   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Mouse Button Right") PORT_CODE(KEYCODE_LALT) PORT_CODE(JOYCODE_BUTTON2) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
250250INPUT_PORTS_END
251251
252252
r15082r15083
346346   PORT_CONFSETTING( 0x10, "No Device Connected" )
347347
348348   PORT_START("JOY0")
349   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_NAME("P1 Up") PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
350   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_NAME("P1 Down") PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
351   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_NAME("P1 Left") PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
352   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_NAME("P1 Right") PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
353   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P1 Button") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
349   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_NAME("P1 Up") PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
350   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_NAME("P1 Down") PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
351   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_NAME("P1 Left") PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
352   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_NAME("P1 Right") PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
353   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P1 Button") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
354354
355355   PORT_START("JOY1")
356   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_NAME("P2 Up") PORT_CODE(KEYCODE_HOME) PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
357   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_NAME("P2 Down") PORT_CODE(KEYCODE_END) PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
358   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_NAME("P2 Left") PORT_CODE(KEYCODE_DEL) PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
359   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_NAME("P2 Right") PORT_CODE(KEYCODE_PGDN) PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
360   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P2 Button") PORT_CODE(KEYCODE_LALT) PORT_CODE(JOYCODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
356   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_NAME("P2 Up") PORT_CODE(KEYCODE_HOME) PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
357   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_NAME("P2 Down") PORT_CODE(KEYCODE_END) PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
358   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_NAME("P2 Left") PORT_CODE(KEYCODE_DEL) PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
359   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_NAME("P2 Right") PORT_CODE(KEYCODE_PGDN) PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
360   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P2 Button") PORT_CODE(KEYCODE_LALT) PORT_CODE(JOYCODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
361361INPUT_PORTS_END
362362
363363
r15082r15083
10561056   int bit_mask = (FPTR)param;
10571057   UINT8 port = 0;
10581058
1059   if ((input_port_read(field.machine(), "CTRLSEL") & 0xf0) == 0x10)
1060      port |= (input_port_read(field.machine(), "FAKE0") & bit_mask) ? 1 : 0;
1059   if ((field.machine().root_device().ioport("CTRLSEL")->read() & 0xf0) == 0x10)
1060      port |= (field.machine().root_device().ioport("FAKE0")->read() & bit_mask) ? 1 : 0;
10611061
1062   if ((input_port_read(field.machine(), "CTRLSEL") & 0xf0) == 0x00)
1063      port |= (input_port_read(field.machine(), "FAKE1") & bit_mask) ? 1 : 0;
1062   if ((field.machine().root_device().ioport("CTRLSEL")->read() & 0xf0) == 0x00)
1063      port |= (field.machine().root_device().ioport("FAKE1")->read() & bit_mask) ? 1 : 0;
10641064
10651065   return port;
10661066}
r15082r15083
10741074
10751075   PORT_START( "JOY" )
10761076   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vic_custom_inputs, (void *)0x02)
1077   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Lightpen Signal") PORT_CODE(KEYCODE_LALT) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1077   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Lightpen Signal") PORT_CODE(KEYCODE_LALT) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
10781078   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vic_custom_inputs, (void *)0x01)
1079   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
1080   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
1081   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
1079   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
1080   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
1081   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
10821082
10831083   PORT_START( "FAKE0" )
1084   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Paddle 2 Button") PORT_CODE(KEYCODE_DEL) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1085   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Paddle 1 Button") PORT_CODE(KEYCODE_INSERT) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1084   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Paddle 2 Button") PORT_CODE(KEYCODE_DEL) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
1085   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Paddle 1 Button") PORT_CODE(KEYCODE_INSERT) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
10861086
10871087   PORT_START( "FAKE1" )
1088   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
1089   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
1088   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
1089   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
10901090
10911091   PORT_START( "PADDLE0" )
1092   PORT_BIT( 0xff,128,IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CODE_DEC(KEYCODE_HOME) PORT_CODE_INC(KEYCODE_PGUP) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1092   PORT_BIT( 0xff,128,IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CODE_DEC(KEYCODE_HOME) PORT_CODE_INC(KEYCODE_PGUP) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
10931093
10941094   PORT_START( "PADDLE1" )
1095   PORT_BIT( 0xff,128,IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CODE_DEC(KEYCODE_END) PORT_CODE_INC(KEYCODE_PGDN) PORT_PLAYER(2) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1095   PORT_BIT( 0xff,128,IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CODE_DEC(KEYCODE_END) PORT_CODE_INC(KEYCODE_PGDN) PORT_PLAYER(2) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
10961096INPUT_PORTS_END
10971097
10981098SLOT_INTERFACE_START( cbm_iec_devices )
src/mess/machine/irisha.c
r15082r15083
7070{
7171   UINT8 keycode;
7272   if (m_keyboard_cnt!=0 && m_keyboard_cnt<11) {
73      keycode = input_port_read(machine(), keynames[m_keyboard_cnt-1]) ^ 0xff;
73      keycode = ioport(keynames[m_keyboard_cnt-1])->read() ^ 0xff;
7474   } else {
7575      keycode = 0xff;
7676   }
src/mess/machine/c64_4dxh.c
r15082r15083
8585 
8686UINT8 c64_4dxh_device::c64_pb_r(address_space &space, offs_t offset)
8787{
88   return input_port_read(*this, "PB");
88   return ioport("PB")->read();
8989}
9090 
9191 
r15082r15083
9595 
9696int c64_4dxh_device::c64_pa2_r()
9797{
98   return BIT(input_port_read(*this, "PA2"), 0);
98   return BIT(ioport("PA2")->read(), 0);
9999}
100100 
101101 
src/mess/machine/pc1512kb.c
r15082r15083
391391
392392   UINT8 data = 0xff;
393393
394   if (!BIT(m_kb_y, 0)) data &= input_port_read(*this, "Y1");
395   if (!BIT(m_kb_y, 1)) data &= input_port_read(*this, "Y2");
396   if (!BIT(m_kb_y, 2)) data &= input_port_read(*this, "Y3");
397   if (!BIT(m_kb_y, 3)) data &= input_port_read(*this, "Y4");
398   if (!BIT(m_kb_y, 4)) data &= input_port_read(*this, "Y5");
399   if (!BIT(m_kb_y, 5)) data &= input_port_read(*this, "Y6");
400   if (!BIT(m_kb_y, 6)) data &= input_port_read(*this, "Y7");
401   if (!BIT(m_kb_y, 7)) data &= input_port_read(*this, "Y8");
402   if (!BIT(m_kb_y, 8)) data &= input_port_read(*this, "Y9");
403   if (!BIT(m_kb_y, 9)) data &= input_port_read(*this, "Y10");
404   if (!BIT(m_kb_y, 10)) data &= input_port_read(*this, "Y11");
405   if (!m_joy_com) data &= input_port_read(*this, "COM");
394   if (!BIT(m_kb_y, 0)) data &= ioport("Y1")->read();
395   if (!BIT(m_kb_y, 1)) data &= ioport("Y2")->read();
396   if (!BIT(m_kb_y, 2)) data &= ioport("Y3")->read();
397   if (!BIT(m_kb_y, 3)) data &= ioport("Y4")->read();
398   if (!BIT(m_kb_y, 4)) data &= ioport("Y5")->read();
399   if (!BIT(m_kb_y, 5)) data &= ioport("Y6")->read();
400   if (!BIT(m_kb_y, 6)) data &= ioport("Y7")->read();
401   if (!BIT(m_kb_y, 7)) data &= ioport("Y8")->read();
402   if (!BIT(m_kb_y, 8)) data &= ioport("Y9")->read();
403   if (!BIT(m_kb_y, 9)) data &= ioport("Y10")->read();
404   if (!BIT(m_kb_y, 10)) data &= ioport("Y11")->read();
405   if (!m_joy_com) data &= ioport("COM")->read();
406406
407407   return data;
408408}
src/mess/machine/a7800.c
r15082r15083
4040
4141static READ8_DEVICE_HANDLER( riot_joystick_r )
4242{
43   return input_port_read(device->machine(), "joysticks");
43   return device->machine().root_device().ioport("joysticks")->read();
4444}
4545
4646static READ8_DEVICE_HANDLER( riot_console_button_r )
4747{
48   return input_port_read(device->machine(), "console_buttons");
48   return device->machine().root_device().ioport("console_buttons")->read();
4949}
5050
5151static WRITE8_DEVICE_HANDLER( riot_button_pullup_w )
r15082r15083
482482           still return a reasonable value */
483483         return 0x00;
484484      case 0x08:
485           return((input_port_read(machine(), "buttons") & 0x02) << 6);
485           return((ioport("buttons")->read() & 0x02) << 6);
486486      case 0x09:
487           return((input_port_read(machine(), "buttons") & 0x08) << 4);
487           return((ioport("buttons")->read() & 0x08) << 4);
488488      case 0x0A:
489           return((input_port_read(machine(), "buttons") & 0x01) << 7);
489           return((ioport("buttons")->read() & 0x01) << 7);
490490      case 0x0B:
491           return((input_port_read(machine(), "buttons") & 0x04) << 5);
491           return((ioport("buttons")->read() & 0x04) << 5);
492492      case 0x0c:
493         if(((input_port_read(machine(), "buttons") & 0x08) ||(input_port_read(machine(), "buttons") & 0x02)) && m_p1_one_button)
493         if(((ioport("buttons")->read() & 0x08) ||(ioport("buttons")->read() & 0x02)) && m_p1_one_button)
494494            return 0x00;
495495         else
496496            return 0x80;
497497      case 0x0d:
498         if(((input_port_read(machine(), "buttons") & 0x01) ||(input_port_read(machine(), "buttons") & 0x04)) && m_p2_one_button)
498         if(((ioport("buttons")->read() & 0x01) ||(ioport("buttons")->read() & 0x04)) && m_p2_one_button)
499499            return 0x00;
500500         else
501501            return 0x80;
src/mess/machine/amigakbd.c
r15082r15083
6262static INPUT_CHANGED( kbd_update )
6363{
6464   int   index = (int)(FPTR)param, i;
65   UINT32   oldvalue = oldval * field.mask, newvalue = newval * field.mask;
65   UINT32   oldvalue = oldval * field.mask(), newvalue = newval * field.mask();
6666   UINT32   delta = oldvalue ^ newvalue;
6767
6868   /* Special case Page UP, which we will use as Action Replay button */
src/mess/machine/nascom1.c
r15082r15083
104104   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7", "KEY8" };
105105
106106   if (m_portstat.stat_count < 9)
107      return (input_port_read(machine(), keynames[m_portstat.stat_count]) | ~0x7f);
107      return (ioport(keynames[m_portstat.stat_count])->read() | ~0x7f);
108108
109109   return (0xff);
110110}
src/mess/machine/microtan.c
r15082r15083
134134   {
135135      case MACHINE_PHASE_RESET:
136136      case MACHINE_PHASE_RUNNING:
137         result = input_port_read(machine, "DSW");
137         result = machine.root_device().ioport("DSW")->read();
138138         break;
139139
140140      default:
r15082r15083
163163 **************************************************************/
164164static READ8_DEVICE_HANDLER (via_0_in_a )
165165{
166    int data = input_port_read(device->machine(), "JOY");
166    int data = device->machine().root_device().ioport("JOY")->read();
167167    LOG(("microtan_via_0_in_a %02X\n", data));
168168    return data;
169169}
r15082r15083
439439
440440
441441    row = 9;
442    newvar = input_port_read(device->machine(), "ROW8");
442    newvar = device->machine().root_device().ioport("ROW8")->read();
443443    chg = state->m_keyrows[--row] ^ newvar;
444444
445445   while ( !chg && row > 0)
446446   {
447      newvar = input_port_read(device->machine(), keynames[row - 1]);
447      newvar = device->machine().root_device().ioport(keynames[row - 1])->read();
448448      chg = state->m_keyrows[--row] ^ newvar;
449449   }
450450    if (!chg)
r15082r15083
579579
580580   for (i = 1; i < 10;  i++)
581581   {
582      state->m_keyrows[i] = input_port_read(machine, keynames[i-1]);
582      state->m_keyrows[i] = machine.root_device().ioport(keynames[i-1])->read();
583583   }
584584   set_led_status(machine, 1, (state->m_keyrows[3] & 0x80) ? 0 : 1);
585585}
src/mess/machine/poly88.c
r15082r15083
4747   int i;
4848   UINT8 code;
4949   UINT8 key_code = 0;
50   UINT8 shift = input_port_read(machine, "LINEC") & 0x02 ? 1 : 0;
51   UINT8 ctrl =  input_port_read(machine, "LINEC") & 0x01 ? 1 : 0;
50   UINT8 shift = machine.root_device().ioport("LINEC")->read() & 0x02 ? 1 : 0;
51   UINT8 ctrl =  machine.root_device().ioport("LINEC")->read() & 0x01 ? 1 : 0;
5252
5353   for(i = 0; i < 7; i++)
5454   {
5555
56      code =   input_port_read(machine, keynames[i]);
56      code =   machine.root_device().ioport(keynames[i])->read();
5757      if (code != 0)
5858      {
5959         if (i==0 && shift==0) {
r15082r15083
139139   i8251_device *uart = machine.device<i8251_device>("uart");
140140   serial_source_device *ser = machine.device<serial_source_device>("sercas");
141141
142//  if (!(input_port_read(machine, "DSW0") & 0x02)) /* V.24 / Tape Switch */
142//  if (!(machine.root_device().ioport("DSW0")->read() & 0x02)) /* V.24 / Tape Switch */
143143   //{
144144      /* tape reading */
145145      if (machine.device<cassette_image_device>(CASSETTE_TAG)->get_state()&CASSETTE_PLAY)
src/mess/machine/samcoupe.c
r15082r15083
196196   if (state->m_mouse_index == 2)
197197   {
198198      /* update values */
199      int mouse_x = input_port_read(machine, "mouse_x");
200      int mouse_y = input_port_read(machine, "mouse_y");
199      int mouse_x = machine.root_device().ioport("mouse_x")->read();
200      int mouse_y = machine.root_device().ioport("mouse_y")->read();
201201
202202      int mouse_dx = state->m_mouse_x - mouse_x;
203203      int mouse_dy = state->m_mouse_y - mouse_y;
r15082r15083
206206      state->m_mouse_y = mouse_y;
207207
208208      /* button state */
209      state->m_mouse_data[2] = input_port_read(machine, "mouse_buttons");
209      state->m_mouse_data[2] = machine.root_device().ioport("mouse_buttons")->read();
210210
211211      /* y-axis */
212212      state->m_mouse_data[3] = (mouse_dy & 0xf00) >> 8;
r15082r15083
261261   state->m_mouse_data[0] = 0xff;
262262   state->m_mouse_data[1] = 0xff;
263263
264   if (input_port_read(machine, "config") & 0x01)
264   if (machine.root_device().ioport("config")->read() & 0x01)
265265   {
266266      /* install RTC */
267267      device_t *rtc = machine.device("sambus_clock");
src/mess/machine/trs80.c
r15082r15083
703703READ8_MEMBER( trs80_state::trs80_wd179x_r )
704704{
705705   UINT8 data = 0xff;
706   if (BIT(input_port_read(machine(), "CONFIG"), 7))
706   if (BIT(ioport("CONFIG")->read(), 7))
707707      data = wd17xx_status_r(m_fdc, offset);
708708
709709   return data;
r15082r15083
823823   UINT8 result = 0;
824824
825825   if (offset & 1)
826      result |= input_port_read(machine(), "LINE0");
826      result |= ioport("LINE0")->read();
827827   if (offset & 2)
828      result |= input_port_read(machine(), "LINE1");
828      result |= ioport("LINE1")->read();
829829   if (offset & 4)
830      result |= input_port_read(machine(), "LINE2");
830      result |= ioport("LINE2")->read();
831831   if (offset & 8)
832      result |= input_port_read(machine(), "LINE3");
832      result |= ioport("LINE3")->read();
833833   if (offset & 16)
834      result |= input_port_read(machine(), "LINE4");
834      result |= ioport("LINE4")->read();
835835   if (offset & 32)
836      result |= input_port_read(machine(), "LINE5");
836      result |= ioport("LINE5")->read();
837837   if (offset & 64)
838      result |= input_port_read(machine(), "LINE6");
838      result |= ioport("LINE6")->read();
839839   if (offset & 128)
840      result |= input_port_read(machine(), "LINE7");
840      result |= ioport("LINE7")->read();
841841
842842   return result;
843843}
src/mess/machine/primo.c
r15082r15083
9494   data |= ((machine().device<cassette_image_device>(CASSETTE_TAG))->input() < 0.1) ? 0x04 : 0x00;
9595
9696   // bit 1 - reset button
97   data |= (input_port_read(machine(), "RESET")) ? 0x02 : 0x00;
97   data |= (ioport("RESET")->read()) ? 0x02 : 0x00;
9898
9999   // bit 0 - keyboard
100   data |= (input_port_read(machine(), portnames[(offset & 0x0030) >> 4]) >> (offset&0x000f)) & 0x0001 ? 0x01 : 0x00;
100   data |= (ioport(portnames[(offset & 0x0030) >> 4])->read() >> (offset&0x000f)) & 0x0001 ? 0x01 : 0x00;
101101
102102   return data;
103103}
r15082r15083
195195
196196WRITE8_MEMBER(primo_state::primo_FD_w)
197197{
198   if (!input_port_read(machine(), "MEMORY_EXPANSION"))
198   if (!ioport("MEMORY_EXPANSION")->read())
199199   {
200200      m_port_FD = data;
201201      primo_update_memory(machine());
r15082r15083
243243static void primo_common_machine_init (running_machine &machine)
244244{
245245   primo_state *state = machine.driver_data<primo_state>();
246   if (input_port_read(machine, "MEMORY_EXPANSION"))
246   if (machine.root_device().ioport("MEMORY_EXPANSION")->read())
247247      state->m_port_FD = 0x00;
248248   primo_update_memory(machine);
249   machine.device("maincpu")->set_clock_scale(input_port_read(machine, "CPU_CLOCK") ? 1.5 : 1.0);
249   machine.device("maincpu")->set_clock_scale(machine.root_device().ioport("CPU_CLOCK")->read() ? 1.5 : 1.0);
250250}
251251
252252MACHINE_RESET( primoa )
src/mess/machine/mface2.c
r15082r15083
8383   t.cat(":multiface");
8484   if (m_multiface_ram!=NULL)
8585   {
86      if ((input_port_read(machine(), t) & 0x01)!=0)
86      if ((ioport(t)->read() & 0x01)!=0)
8787      {
8888         return 1;
8989      }
r15082r15083
135135      return;
136136   t.cat(":multiface");
137137   // TODO: reset button
138   if (input_port_read(machine(), t) & 0x02)
138   if (ioport(t)->read() & 0x02)
139139   {
140140      multiface_stop();
141141   }
src/mess/machine/svi318.c
r15082r15083
152152      data |= 0x80;
153153   if (!svi318_cassette_present(device->machine(), 0))
154154      data |= 0x40;
155   data |= input_port_read(device->machine(), "BUTTONS") & 0x30;
155   data |= device->machine().root_device().ioport("BUTTONS")->read() & 0x30;
156156
157157   return data;
158158}
r15082r15083
181181
182182   row = state->m_svi.keyboard_row;
183183   if (row <= 10)
184      return input_port_read(device->machine(), keynames[row]);
184      return device->machine().root_device().ioport(keynames[row])->read();
185185
186186   return 0xff;
187187}
r15082r15083
258258
259259READ8_MEMBER(svi318_state::svi318_psg_port_a_r)
260260{
261   return input_port_read(machine(), "JOYSTICKS");
261   return ioport("JOYSTICKS")->read();
262262}
263263
264264/*
src/mess/machine/amstr_pc.c
r15082r15083
205205   UINT8 data = pc_lpt_r(lpt, offset);
206206
207207   if (offset == 1)
208      data = (data & ~7) | (input_port_read(space->machine(), "DSW0") & 7);
208      data = (data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
209209   if (offset == 2)
210      data = (data & ~0xe0) | (input_port_read(space->machine(), "DSW0") & 0xc0);
210      data = (data & ~0xe0) | (space->machine().root_device().ioport("DSW0")->read() & 0xc0);
211211
212212   return data;
213213}
r15082r15083
218218   UINT8 data = pc_lpt_r(lpt, offset);
219219
220220   if (offset == 1)
221      data = (data & ~7) | (input_port_read(space->machine(), "DSW0") & 7);
221      data = (data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
222222   if (offset == 2)
223      data = (data & ~0xe0) | (input_port_read(space->machine(), "DSW0") & 0xc0);
223      data = (data & ~0xe0) | (space->machine().root_device().ioport("DSW0")->read() & 0xc0);
224224
225225   return data;
226226}
r15082r15083
232232    UINT8 data = pc_lpt_r(lpt, offset);
233233
234234   if (offset == 1)
235      data=(data & ~7) | (input_port_read(space->machine(), "DSW0") & 7);
235      data=(data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
236236   if (offset == 2)
237237   {
238238      switch (pc1640.dipstate)
239239      {
240240      case 0:
241         data = (data&~0xe0) | (input_port_read(space->machine(), "DSW0") & 0xe0);
241         data = (data&~0xe0) | (space->machine().root_device().ioport("DSW0")->read() & 0xe0);
242242         break;
243243      case 1:
244         data = (data&~0xe0) | ((input_port_read(space->machine(), "DSW0") & 0xe000)>>8);
244         data = (data&~0xe0) | ((space->machine().root_device().ioport("DSW0")->read() & 0xe000)>>8);
245245         break;
246246      case 2:
247         data = (data&~0xe0) | ((input_port_read(space->machine(), "DSW0") & 0xe00)>>4);
247         data = (data&~0xe0) | ((space->machine().root_device().ioport("DSW0")->read() & 0xe00)>>4);
248248         break;
249249
250250      }
r15082r15083
274274
275275static READ8_HANDLER( pc1640_mouse_x_r )
276276{
277   return pc1640.mouse.x - input_port_read(space->machine(), "pc_mouse_x");
277   return pc1640.mouse.x - space->machine().root_device().ioport("pc_mouse_x")->read();
278278}
279279
280280static READ8_HANDLER( pc1640_mouse_y_r )
281281{
282   return pc1640.mouse.y - input_port_read(space->machine(), "pc_mouse_y");
282   return pc1640.mouse.y - space->machine().root_device().ioport("pc_mouse_y")->read();
283283}
284284
285285static WRITE8_HANDLER( pc1640_mouse_x_w )
286286{
287   pc1640.mouse.x = data + input_port_read(space->machine(), "pc_mouse_x");
287   pc1640.mouse.x = data + space->machine().root_device().ioport("pc_mouse_x")->read();
288288}
289289
290290static WRITE8_HANDLER( pc1640_mouse_y_w )
291291{
292   pc1640.mouse.y = data + input_port_read(space->machine(), "pc_mouse_y");
292   pc1640.mouse.y = data + space->machine().root_device().ioport("pc_mouse_y")->read();
293293}
294294
295295READ16_HANDLER( pc1640_16le_mouse_x_r )    { return read16le_with_read8_handler(pc1640_mouse_x_r, space, offset, mem_mask); }
src/mess/machine/wswan.c
r15082r15083
957957         switch( data )
958958         {
959959            case 0x10:   /* Read Y cursors: Y1 - Y2 - Y3 - Y4 */
960               input = input_port_read(machine(), "CURSY");
960               input = ioport("CURSY")->read();
961961               if (state->m_rotate) // reorient controls if the console is rotated
962962               {
963963                  if (input & 0x01) data |= 0x02;
r15082r15083
969969                  data = data | input;
970970            break;
971971            case 0x20:   /* Read X cursors: X1 - X2 - X3 - X4 */
972               input = input_port_read(machine(), "CURSX");
972               input = ioport("CURSX")->read();
973973               if (state->m_rotate) // reorient controls if the console is rotated
974974               {
975975                  if (input & 0x01) data |= 0x02;
r15082r15083
981981                  data = data | input;
982982            break;
983983            case 0x40:   /* Read buttons: START - A - B */
984               data = data | input_port_read(machine(), "BUTTONS");
984               data = data | ioport("BUTTONS")->read();
985985            break;
986986         }
987987         break;
src/mess/machine/cbm.c
r15082r15083
2727
2828static TIMER_CALLBACK( lightpen_tick )
2929{
30   if (((input_port_read(machine, "CTRLSEL") & 0x07) == 0x04) || ((input_port_read(machine, "CTRLSEL") & 0x07) == 0x06))
30   if (((machine.root_device().ioport("CTRLSEL")->read() & 0x07) == 0x04) || ((machine.root_device().ioport("CTRLSEL")->read() & 0x07) == 0x06))
3131   {
3232      /* enable lightpen crosshair */
3333      crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_ALL);
r15082r15083
4242void cbm_common_interrupt( device_t *device )
4343{
4444   int value, i;
45   int controller1 = input_port_read(device->machine(), "CTRLSEL") & 0x07;
46   int controller2 = input_port_read(device->machine(), "CTRLSEL") & 0x70;
45   int controller1 = device->machine().root_device().ioport("CTRLSEL")->read() & 0x07;
46   int controller2 = device->machine().root_device().ioport("CTRLSEL")->read() & 0x70;
4747   static const char *const c64ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
4848
4949   /* Lines 0-7 : common keyboard */
5050   for (i = 0; i < 8; i++)
5151   {
5252      value = 0xff;
53      value &= ~input_port_read(device->machine(), c64ports[i]);
53      value &= ~device->machine().root_device().ioport(c64ports[i])->read();
5454
5555      /* Shift Lock is mapped on Left Shift */
56      if ((i == 1) && (input_port_read(device->machine(), "SPECIAL") & 0x40))
56      if ((i == 1) && (device->machine().root_device().ioport("SPECIAL")->read() & 0x40))
5757         value &= ~0x80;
5858
5959      c64_keyline[i] = value;
r15082r15083
6464   switch(controller1)
6565   {
6666      case 0x00:
67         value &= ~input_port_read(device->machine(), "JOY1_1B");         /* Joy1 Directions + Button 1 */
67         value &= ~device->machine().root_device().ioport("JOY1_1B")->read();         /* Joy1 Directions + Button 1 */
6868         break;
6969
7070      case 0x01:
71         if (input_port_read(device->machine(), "OTHER") & 0x40)         /* Paddle2 Button */
71         if (device->machine().root_device().ioport("OTHER")->read() & 0x40)         /* Paddle2 Button */
7272            value &= ~0x08;
73         if (input_port_read(device->machine(), "OTHER") & 0x80)         /* Paddle1 Button */
73         if (device->machine().root_device().ioport("OTHER")->read() & 0x80)         /* Paddle1 Button */
7474            value &= ~0x04;
7575         break;
7676
7777      case 0x02:
78         if (input_port_read(device->machine(), "OTHER") & 0x02)         /* Mouse Button Left */
78         if (device->machine().root_device().ioport("OTHER")->read() & 0x02)         /* Mouse Button Left */
7979            value &= ~0x10;
80         if (input_port_read(device->machine(), "OTHER") & 0x01)         /* Mouse Button Right */
80         if (device->machine().root_device().ioport("OTHER")->read() & 0x01)         /* Mouse Button Right */
8181            value &= ~0x01;
8282         break;
8383
8484      case 0x03:
85         value &= ~(input_port_read(device->machine(), "JOY1_2B") & 0x1f);   /* Joy1 Directions + Button 1 */
85         value &= ~(device->machine().root_device().ioport("JOY1_2B")->read() & 0x1f);   /* Joy1 Directions + Button 1 */
8686         break;
8787
8888      case 0x04:
8989/* was there any input on the lightpen? where is it mapped? */
90//          if (input_port_read(device->machine(), "OTHER") & 0x04)           /* Lightpen Signal */
90//          if (device->machine().root_device().ioport("OTHER")->read() & 0x04)           /* Lightpen Signal */
9191//              value &= ?? ;
9292         break;
9393
r15082r15083
106106   switch(controller2)
107107   {
108108      case 0x00:
109         value &= ~input_port_read(device->machine(), "JOY2_1B");         /* Joy2 Directions + Button 1 */
109         value &= ~device->machine().root_device().ioport("JOY2_1B")->read();         /* Joy2 Directions + Button 1 */
110110         break;
111111
112112      case 0x10:
113         if (input_port_read(device->machine(), "OTHER") & 0x10)         /* Paddle4 Button */
113         if (device->machine().root_device().ioport("OTHER")->read() & 0x10)         /* Paddle4 Button */
114114            value &= ~0x08;
115         if (input_port_read(device->machine(), "OTHER") & 0x20)         /* Paddle3 Button */
115         if (device->machine().root_device().ioport("OTHER")->read() & 0x20)         /* Paddle3 Button */
116116            value &= ~0x04;
117117         break;
118118
119119      case 0x20:
120         if (input_port_read(device->machine(), "OTHER") & 0x02)         /* Mouse Button Left */
120         if (device->machine().root_device().ioport("OTHER")->read() & 0x02)         /* Mouse Button Left */
121121            value &= ~0x10;
122         if (input_port_read(device->machine(), "OTHER") & 0x01)         /* Mouse Button Right */
122         if (device->machine().root_device().ioport("OTHER")->read() & 0x01)         /* Mouse Button Right */
123123            value &= ~0x01;
124124         break;
125125
126126      case 0x30:
127         value &= ~(input_port_read(device->machine(), "JOY2_2B") & 0x1f);   /* Joy2 Directions + Button 1 */
127         value &= ~(device->machine().root_device().ioport("JOY2_2B")->read() & 0x1f);   /* Joy2 Directions + Button 1 */
128128         break;
129129
130130      case 0x40:
131131/* was there any input on the lightpen? where is it mapped? */
132//          if (input_port_read(device->machine(), "OTHER") & 0x04)           /* Lightpen Signal */
132//          if (device->machine().root_device().ioport("OTHER")->read() & 0x04)           /* Lightpen Signal */
133133//              value &= ?? ;
134134         break;
135135
r15082r15083
149149   /* check if lightpen has been chosen as input: if so, enable crosshair */
150150   device->machine().scheduler().timer_set(attotime::zero, FUNC(lightpen_tick));
151151
152   set_led_status (device->machine(), 1, input_port_read(device->machine(), "SPECIAL") & 0x40 ? 1 : 0);      /* Shift Lock */
153   set_led_status (device->machine(), 0, input_port_read(device->machine(), "CTRLSEL") & 0x80 ? 1 : 0);      /* Joystick Swap */
152   set_led_status (device->machine(), 1, device->machine().root_device().ioport("SPECIAL")->read() & 0x40 ? 1 : 0);      /* Shift Lock */
153   set_led_status (device->machine(), 0, device->machine().root_device().ioport("CTRLSEL")->read() & 0x80 ? 1 : 0);      /* Joystick Swap */
154154}
155155
156156
r15082r15083
297297      value &= t;
298298   }
299299
300   if ( input_port_read(device->machine(), "CTRLSEL") & 0x80 )
300   if ( device->machine().root_device().ioport("CTRLSEL")->read() & 0x80 )
301301      value &= c64_keyline[8];
302302   else
303303      value &= c64_keyline[9];
r15082r15083
318318   if (!(output_a & 0x02)) value &= c64_keyline[1];
319319   if (!(output_a & 0x01)) value &= c64_keyline[0];
320320
321   if ( input_port_read(device->machine(), "CTRLSEL") & 0x80 )
321   if ( device->machine().root_device().ioport("CTRLSEL")->read() & 0x80 )
322322      value &= c64_keyline[9];
323323   else
324324      value &= c64_keyline[8];
src/mess/machine/z80ne.c
r15082r15083
149149   if ( --state->m_lx383_downsampler == 0 )
150150   {
151151      state->m_lx383_downsampler = LX383_DOWNSAMPLING;
152      key_bits = (input_port_read(machine, "ROW1") << 8) | input_port_read(machine, "ROW0");
153//      rst = input_port_read(machine, "RST");
154      ctrl = input_port_read(machine, "CTRL");
152      key_bits = (machine.root_device().ioport("ROW1")->read() << 8) | machine.root_device().ioport("ROW0")->read();
153//      rst = machine.root_device().ioport("RST")->read();
154      ctrl = machine.root_device().ioport("CTRL")->read();
155155
156156      for ( i = 0; i<LX383_KEYS; i++)
157157      {
r15082r15083
232232   address_space *space = machine.device("z80ne")->memory().space(AS_PROGRAM);
233233   state->m_reset_delay_counter = 0;
234234
235   switch (input_port_read(machine, "CONFIG") & 0x07) {
235   switch (machine.root_device().ioport("CONFIG")->read() & 0x07) {
236236   case 0x01: /* EP382 Hex Monitor */
237237      if (VERBOSE)
238238         logerror("reset_lx390_banking: banking ep382\n");
r15082r15083
301301    state->m_lx383_downsampler = LX383_DOWNSAMPLING;
302302
303303   /* Initialize cassette interface */
304   switch(input_port_read(machine, "LX.385") & 0x07)
304   switch(machine.root_device().ioport("LX.385")->read() & 0x07)
305305   {
306306   case 0x01:
307307      state->m_cass_data.speed = TAPE_300BPS;
r15082r15083
333333   ay31015_set_input_pin( state->m_ay31015, AY31015_NB2, 1 );
334334   ay31015_set_input_pin( state->m_ay31015, AY31015_TSB, 1 );
335335   ay31015_set_input_pin( state->m_ay31015, AY31015_EPS, 1 );
336   ay31015_set_input_pin( state->m_ay31015, AY31015_NP, input_port_read(machine, "LX.385") & 0x80 ? 1 : 0 );
336   ay31015_set_input_pin( state->m_ay31015, AY31015_NP, machine.root_device().ioport("LX.385")->read() & 0x80 ? 1 : 0 );
337337   ay31015_set_input_pin( state->m_ay31015, AY31015_CS, 1 );
338338   ay31015_set_receiver_clock( state->m_ay31015, state->m_cass_data.speed * 16.0);
339339   ay31015_set_transmitter_clock( state->m_ay31015, state->m_cass_data.speed * 16.0);
r15082r15083
375375INPUT_CHANGED( z80ne_reset )
376376{
377377   UINT8 rst;
378   rst = input_port_read(field.machine(), "RST");
378   rst = field.machine().root_device().ioport("RST")->read();
379379
380380   if ( ! BIT(rst, 0))
381381   {
r15082r15083
387387INPUT_CHANGED( z80ne_nmi )
388388{
389389   UINT8 nmi;
390   nmi = input_port_read(field.machine(), "LX388_BRK");
390   nmi = field.machine().root_device().ioport("LX388_BRK")->read();
391391
392392   if ( ! BIT(nmi, 0))
393393   {
src/mess/machine/apollo_kbd.c
r15082r15083
247247   }
248248   else
249249   {
250      int b = input_port_read(m_device->machine(), "mouse1");
251      int x = input_port_read(m_device->machine(), "mouse2");
252      int y = input_port_read(m_device->machine(), "mouse3");
250      int b = m_device->machine().root_device().ioport("mouse1")->read();
251      int x = m_device->machine().root_device().ioport("mouse2")->read();
252      int y = m_device->machine().root_device().ioport("mouse3")->read();
253253
254254      if (m_last_b < 0)
255255      {
r15082r15083
686686{
687687   int n_chars = 0;
688688   UINT16 key_code = 0;
689   UINT8 caps = BIT(input_port_read(machine(), "keyboard4"),0);
690   UINT8 shift = BIT(input_port_read(machine(), "keyboard4"),1) | BIT(input_port_read(machine(), "keyboard4"),5);
691   UINT8 ctrl = BIT(input_port_read(machine(), "keyboard4"),2);
692   UINT8 numlock = BIT(input_port_read(machine(), "keyboard4"),6);
689   UINT8 caps = BIT(ioport("keyboard4")->read(),0);
690   UINT8 shift = BIT(ioport("keyboard4")->read(),1) | BIT(ioport("keyboard4")->read(),5);
691   UINT8 ctrl = BIT(ioport("keyboard4")->read(),2);
692   UINT8 numlock = BIT(ioport("keyboard4")->read(),6);
693693   UINT16 index;
694694
695695   if (keyboard_is_german())
r15082r15083
803803
804804   for (x = 0; x < 0x80; x++)
805805   {
806      if (!(input_port_read(machine(), keynames[x / 32]) & (1 << (x % 32))))
806      if (!(ioport(keynames[x / 32])->read() & (1 << (x % 32))))
807807      {
808808         // no key pressed
809809         if (m_keyon[x] != 0)
src/mess/machine/apple2gs.c
r15082r15083
694694   /* read mouse values */
695695   if ((state->m_adb_kmstatus & 0x80) == 0x00)
696696   {
697      new_mouse_x = input_port_read(machine, "adb_mouse_x");
698      new_mouse_y = input_port_read(machine, "adb_mouse_y");
697      new_mouse_x = machine.root_device().ioport("adb_mouse_x")->read();
698      new_mouse_y = machine.root_device().ioport("adb_mouse_y")->read();
699699
700700      if ((state->m_mouse_x != new_mouse_x) || (state->m_mouse_y != new_mouse_y))
701701      {
src/mess/machine/lux4105.c
r15082r15083
225225
226226void luxor_4105_device::abc1600bus_cs(UINT8 data)
227227{
228   m_cs = (data == input_port_read(*this, "5E"));
228   m_cs = (data == ioport("5E")->read());
229229}
230230
231231
r15082r15083
296296   {
297297      if (scsi_bsy_r(m_sasibus))
298298      {
299         input_port_read(*this, "1E");
299         ioport("1E")->read();
300300      }
301301      else
302302      {
src/mess/machine/ac1.c
r15082r15083
2626
2727static READ8_DEVICE_HANDLER (ac1_port_a_r)
2828{
29   UINT8 line0 = input_port_read(device->machine(), "LINE0");
30   UINT8 line1 = input_port_read(device->machine(), "LINE1");
31   UINT8 line2 = input_port_read(device->machine(), "LINE2");
32   UINT8 line3 = input_port_read(device->machine(), "LINE3");
33   UINT8 line4 = input_port_read(device->machine(), "LINE4");
34   UINT8 line5 = input_port_read(device->machine(), "LINE5");
35   UINT8 line6 = input_port_read(device->machine(), "LINE6");
29   UINT8 line0 = device->machine().root_device().ioport("LINE0")->read();
30   UINT8 line1 = device->machine().root_device().ioport("LINE1")->read();
31   UINT8 line2 = device->machine().root_device().ioport("LINE2")->read();
32   UINT8 line3 = device->machine().root_device().ioport("LINE3")->read();
33   UINT8 line4 = device->machine().root_device().ioport("LINE4")->read();
34   UINT8 line5 = device->machine().root_device().ioport("LINE5")->read();
35   UINT8 line6 = device->machine().root_device().ioport("LINE6")->read();
3636
3737   UINT8 SH    = BNOT(BIT(line6,0));
3838   UINT8 CTRL  = BNOT(BIT(line6,1));
src/mess/machine/macadb.c
r15082r15083
4040
4141   for (i = 0; i < 6; i++)
4242   {
43      keybuf = input_port_read(machine(), keynames[i]);
43      keybuf = ioport(keynames[i])->read();
4444
4545      // any changes in this row?
4646      if ((keybuf != m_key_matrix[i]) && (report < 2))
r15082r15083
168168      return 0;
169169   }
170170
171   NewButton = input_port_read(machine(), "MOUSE0") & 0x01;
172   NewX = input_port_read(machine(), "MOUSE2");
173   NewY = input_port_read(machine(), "MOUSE1");
171   NewButton = ioport("MOUSE0")->read() & 0x01;
172   NewX = ioport("MOUSE2")->read();
173   NewY = ioport("MOUSE1")->read();
174174
175175   if ((NewX != m_adb_lastmousex) || (NewY != m_adb_lastmousey) || (NewButton != m_adb_lastbutton))
176176   {
r15082r15083
185185   int MouseCountX = 0, MouseCountY = 0;
186186   int NewX, NewY;
187187
188   NewX = input_port_read(machine(), "MOUSE2");
189   NewY = input_port_read(machine(), "MOUSE1");
188   NewX = ioport("MOUSE2")->read();
189   NewY = ioport("MOUSE1")->read();
190190
191191   /* see if it moved in the x coord */
192192   if (NewX != m_adb_lastmousex)
r15082r15083
218218      m_adb_lastmousey = NewY;
219219   }
220220
221   m_adb_lastbutton = input_port_read(machine(), "MOUSE0") & 0x01;
221   m_adb_lastbutton = ioport("MOUSE0")->read() & 0x01;
222222
223223   *MouseX = (UINT8)MouseCountX;
224224   *MouseY = (UINT8)MouseCountY;
src/mess/machine/nes.c
r15082r15083
333333
334334READ8_MEMBER(nes_state::nes_IN0_r)
335335{
336   int cfg = input_port_read(machine(), "CTRLSEL");
336   int cfg = ioport("CTRLSEL")->read();
337337   int ret;
338338
339339   if ((cfg & 0x000f) >= 0x07)   // for now we treat the FC keyboard separately from other inputs!
r15082r15083
388388static UINT8 nes_read_fc_keyboard_line( running_machine &machine, UINT8 scan, UINT8 mode )
389389{
390390   static const char *const fc_keyport_names[] = { "FCKEY0", "FCKEY1", "FCKEY2", "FCKEY3", "FCKEY4", "FCKEY5", "FCKEY6", "FCKEY7", "FCKEY8" };
391   return ((input_port_read(machine, fc_keyport_names[scan]) >> (mode * 4)) & 0x0f) << 1;
391   return ((machine.root_device().ioport(fc_keyport_names[scan])->read() >> (mode * 4)) & 0x0f) << 1;
392392}
393393
394394static UINT8 nes_read_subor_keyboard_line( running_machine &machine, UINT8 scan, UINT8 mode )
395395{
396396   static const char *const sub_keyport_names[] = { "SUBKEY0", "SUBKEY1", "SUBKEY2", "SUBKEY3", "SUBKEY4",
397397      "SUBKEY5", "SUBKEY6", "SUBKEY7", "SUBKEY8", "SUBKEY9", "SUBKEY10", "SUBKEY11", "SUBKEY12" };
398   return ((input_port_read(machine, sub_keyport_names[scan]) >> (mode * 4)) & 0x0f) << 1;
398   return ((machine.root_device().ioport(sub_keyport_names[scan])->read() >> (mode * 4)) & 0x0f) << 1;
399399}
400400
401401READ8_MEMBER(nes_state::nes_IN1_r)
402402{
403   int cfg = input_port_read(machine(), "CTRLSEL");
403   int cfg = ioport("CTRLSEL")->read();
404404   int ret;
405405
406406   if ((cfg & 0x000f) == 0x07)   // for now we treat the FC keyboard separately from other inputs!
r15082r15083
489489   {
490490      case 0x01:   /* gamepad */
491491         if (pad_port >= 0)
492            vals->i0 = input_port_read(machine, padnames[pad_port]);
492            vals->i0 = machine.root_device().ioport(padnames[pad_port])->read();
493493         break;
494494
495495      case 0x02:   /* zapper 1 */
496496         if (supports_zapper)
497497         {
498            vals->i0 = input_port_read(machine, "ZAPPER1_T");
499            vals->i1 = input_port_read(machine, "ZAPPER1_X");
500            vals->i2 = input_port_read(machine, "ZAPPER1_Y");
498            vals->i0 = machine.root_device().ioport("ZAPPER1_T")->read();
499            vals->i1 = machine.root_device().ioport("ZAPPER1_X")->read();
500            vals->i2 = machine.root_device().ioport("ZAPPER1_Y")->read();
501501         }
502502         break;
503503
504504      case 0x03:   /* zapper 2 */
505505         if (supports_zapper)
506506         {
507            vals->i0 = input_port_read(machine, "ZAPPER2_T");
508            vals->i1 = input_port_read(machine, "ZAPPER2_X");
509            vals->i2 = input_port_read(machine, "ZAPPER2_Y");
507            vals->i0 = machine.root_device().ioport("ZAPPER2_T")->read();
508            vals->i1 = machine.root_device().ioport("ZAPPER2_X")->read();
509            vals->i2 = machine.root_device().ioport("ZAPPER2_Y")->read();
510510         }
511511         break;
512512
513513      case 0x04:   /* arkanoid paddle */
514514         if (pad_port == 1)
515            vals->i0 = (UINT8) ((UINT8) input_port_read(machine, "PADDLE") + (UINT8)0x52) ^ 0xff;
515            vals->i0 = (UINT8) ((UINT8) machine.root_device().ioport("PADDLE")->read() + (UINT8)0x52) ^ 0xff;
516516         break;
517517
518518      case 0x06:   /* crazy climber controller */
519519         if (pad_port == 0)
520520         {
521            state->m_in_0.i0 = input_port_read(machine, padnames[4]);
522            state->m_in_1.i0 = input_port_read(machine, padnames[5]);
521            state->m_in_0.i0 = machine.root_device().ioport(padnames[4])->read();
522            state->m_in_1.i0 = machine.root_device().ioport(padnames[5])->read();
523523         }
524524         break;
525525   }
r15082r15083
528528
529529static TIMER_CALLBACK( lightgun_tick )
530530{
531   if ((input_port_read(machine, "CTRLSEL") & 0x000f) == 0x0002)
531   if ((machine.root_device().ioport("CTRLSEL")->read() & 0x000f) == 0x0002)
532532   {
533533      /* enable lightpen crosshair */
534534      crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_ALL);
r15082r15083
539539      crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_NONE);
540540   }
541541
542   if ((input_port_read(machine, "CTRLSEL") & 0x00f0) == 0x0030)
542   if ((machine.root_device().ioport("CTRLSEL")->read() & 0x00f0) == 0x0030)
543543   {
544544      /* enable lightpen crosshair */
545545      crosshair_set_screen(machine, 1, CROSSHAIR_SCREEN_ALL);
r15082r15083
553553
554554WRITE8_MEMBER(nes_state::nes_IN0_w)
555555{
556   int cfg = input_port_read(machine(), "CTRLSEL");
556   int cfg = ioport("CTRLSEL")->read();
557557
558558   /* Check if lightgun has been chosen as input: if so, enable crosshair */
559559   machine().scheduler().timer_set(attotime::zero, FUNC(lightgun_tick));
src/mess/machine/lux21046.c
r15082r15083
276276INPUT_PORTS_START( luxor_55_21046 )
277277   PORT_START("SW1")
278278   // ABC 838
279   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
280   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) ) PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
279   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2e)
280   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) ) PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2e)
281281   // ABC 830
282   PORT_DIPNAME( 0x01, 0x00, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
282   PORT_DIPNAME( 0x01, 0x00, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2d)
283283   PORT_DIPSETTING(    0x00, DEF_STR( Single ) )
284284   PORT_DIPSETTING(    0x01, "Double" )
285   PORT_DIPNAME( 0x02, 0x00, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
285   PORT_DIPNAME( 0x02, 0x00, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2d)
286286   PORT_DIPSETTING(    0x00, DEF_STR( Single ) )
287287   PORT_DIPSETTING(    0x02, "Double" )
288   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Density" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
288   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Density" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2d)
289289   PORT_DIPSETTING(    0x00, DEF_STR( Single ) )
290290   PORT_DIPSETTING(    0x04, "Double" )
291   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Density" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
291   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Density" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2d)
292292   PORT_DIPSETTING(    0x00, DEF_STR( Single ) )
293293   PORT_DIPSETTING(    0x08, "Double" )
294294   // ABC 832/834/850
295   PORT_DIPNAME( 0x01, 0x01, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
295   PORT_DIPNAME( 0x01, 0x01, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2c)
296296   PORT_DIPSETTING(    0x00, DEF_STR( Single ) )
297297   PORT_DIPSETTING(    0x01, "Double" )
298   PORT_DIPNAME( 0x02, 0x02, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
298   PORT_DIPNAME( 0x02, 0x02, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2c)
299299   PORT_DIPSETTING(    0x00, DEF_STR( Single ) )
300300   PORT_DIPSETTING(    0x02, "Double" )
301   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Tracks" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
301   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Tracks" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2c)
302302   PORT_DIPSETTING(    0x00, "80" )
303303   PORT_DIPSETTING(    0x04, "40" )
304   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Tracks" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
304   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Tracks" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2c)
305305   PORT_DIPSETTING(    0x00, "80" )
306306   PORT_DIPSETTING(    0x08, "40" )
307307
308308   PORT_START("SW2")
309309   PORT_DIPNAME( 0x0f, 0x01, "Drive Type" ) PORT_DIPLOCATION("SW2:1,2,3,4")
310   PORT_DIPSETTING(    0x01, "TEAC FD55F (ABC 834)" ) PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 230 7802-01
311   PORT_DIPSETTING(    0x02, "BASF 6138 (ABC 850)" ) PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 230 8440-15
312   PORT_DIPSETTING(    0x03, "Micropolis 1015F (ABC 832)" ) PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-15
313   PORT_DIPSETTING(    0x04, "BASF 6118 (ABC 832)" ) PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-16
314   PORT_DIPSETTING(    0x05, "Micropolis 1115F (ABC 832)" ) PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-17
315   PORT_DIPSETTING(    0x08, "BASF 6106/08 (ABC 830)" ) PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2d) // 190 9206-16
316   PORT_DIPSETTING(    0x09, "MPI 51 (ABC 830)" ) PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2d) // 190 9206-16
317   PORT_DIPSETTING(    0x0e, "BASF 6105 (ABC 838)" ) PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
318   PORT_DIPSETTING(    0x0f, "BASF 6106 (ABC 838)" ) PORT_CONDITION("SW3", 0x7f, PORTCOND_EQUALS, 0x2e) // 230 8838-15
310   PORT_DIPSETTING(    0x01, "TEAC FD55F (ABC 834)" ) PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2c) // 230 7802-01
311   PORT_DIPSETTING(    0x02, "BASF 6138 (ABC 850)" ) PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2c) // 230 8440-15
312   PORT_DIPSETTING(    0x03, "Micropolis 1015F (ABC 832)" ) PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2c) // 190 9711-15
313   PORT_DIPSETTING(    0x04, "BASF 6118 (ABC 832)" ) PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2c) // 190 9711-16
314   PORT_DIPSETTING(    0x05, "Micropolis 1115F (ABC 832)" ) PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2c) // 190 9711-17
315   PORT_DIPSETTING(    0x08, "BASF 6106/08 (ABC 830)" ) PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2d) // 190 9206-16
316   PORT_DIPSETTING(    0x09, "MPI 51 (ABC 830)" ) PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2d) // 190 9206-16
317   PORT_DIPSETTING(    0x0e, "BASF 6105 (ABC 838)" ) PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2e)
318   PORT_DIPSETTING(    0x0f, "BASF 6106 (ABC 838)" ) PORT_CONDITION("SW3", 0x7f, EQUALS, 0x2e) // 230 8838-15
319319
320320   PORT_START("SW3")
321321   PORT_DIPNAME( 0x7f, 0x2c, "Card Address" ) PORT_DIPLOCATION("SW3:1,2,3,4,5,6,7")
r15082r15083
428428
429429void luxor_55_21046_device::abcbus_cs(UINT8 data)
430430{
431   m_cs = (data == input_port_read(*this, "SW3"));
431   m_cs = (data == ioport("SW3")->read());
432432}
433433
434434
r15082r15083
685685   data |= m_busy;
686686
687687   // SW1
688   UINT8 sw1 = input_port_read(*this, "SW1") & 0x0f;
688   UINT8 sw1 = ioport("SW1")->read() & 0x0f;
689689
690690   data |= sw1 << 4;
691691
692692   // SW2
693   UINT8 sw2 = input_port_read(*this, "SW2") & 0x0f;
693   UINT8 sw2 = ioport("SW2")->read() & 0x0f;
694694
695695   // TTL inputs float high so DIP switch in off position equals 1
696696   int sw2_1 = BIT(sw2, 0) ? 1 : BIT(offset, 8);
src/mess/machine/kc_keyb.c
r15082r15083
544544         // scan all lines (excluding shift)
545545         for (int i=0; i<8; i++)
546546         {
547            UINT8 keyboard_line_data = input_port_read(*this, keynames[i]);
547            UINT8 keyboard_line_data = ioport(keynames[i])->read();
548548
549549            // scan through each bit
550550            for (int b=0; b<8; b++)
r15082r15083
615615   add_pulse_to_transmit_buffer(1);
616616
617617   // state of shift key
618   add_bit((input_port_read(*this, "SHIFT") & 0x01)^0x01);
618   add_bit((ioport("SHIFT")->read() & 0x01)^0x01);
619619
620620   for (int i=0; i<6; i++)
621621   {
src/mess/machine/pc_joy.c
r15082r15083
1919   UINT8 data = 0xf;
2020   int delta;
2121   attotime new_time = space->machine().time();
22   const input_port_config *joystick_port = space->machine().root_device().ioport("pc_joy");
22   ioport_port *joystick_port = space->machine().root_device().ioport("pc_joy");
2323   delta = ((new_time - JOY_time) * 256 * 1000).seconds;
2424
2525   if (joystick_port != NULL)
2626   {
27      data = input_port_read_direct(joystick_port) ^ 0xf0;
27      data = joystick_port->read() ^ 0xf0;
2828
2929      /* timer overflow? Nope, otherwise some HWs can't verify the port properly */
3030      //if ((new_time - JOY_time) > attotime::from_msec(10))
r15082r15083
3333      //}
3434      //else
3535      {
36         if (input_port_read(space->machine(), "pc_joy_1") < delta) data &= ~0x01;
37         if (input_port_read(space->machine(), "pc_joy_2") < delta) data &= ~0x02;
38         if (input_port_read(space->machine(), "pc_joy_3") < delta) data &= ~0x04;
39         if (input_port_read(space->machine(), "pc_joy_4") < delta) data &= ~0x08;
36         if (space->machine().root_device().ioport("pc_joy_1")->read() < delta) data &= ~0x01;
37         if (space->machine().root_device().ioport("pc_joy_2")->read() < delta) data &= ~0x02;
38         if (space->machine().root_device().ioport("pc_joy_3")->read() < delta) data &= ~0x04;
39         if (space->machine().root_device().ioport("pc_joy_4")->read() < delta) data &= ~0x08;
4040      }
4141   }
4242   else
src/mess/machine/apollo.c
r15082r15083
143143{
144144   DLOG1(("reset apollo_config"));
145145   // load configuration
146   config = input_port_read(device->machine(), "apollo_config");
146   config = device->machine().root_device().ioport("apollo_config")->read();
147147}
148148
149149/*-------------------------------------------------
src/mess/machine/sym1.c
r15082r15083
8686   int data = 0x7f;
8787
8888   /* scan keypad rows */
89   if (!(state->m_riot_port_a & 0x80)) data &= input_port_read(device->machine(), "ROW-0");
90   if (!(state->m_riot_port_b & 0x01)) data &= input_port_read(device->machine(), "ROW-1");
91   if (!(state->m_riot_port_b & 0x02)) data &= input_port_read(device->machine(), "ROW-2");
92   if (!(state->m_riot_port_b & 0x04)) data &= input_port_read(device->machine(), "ROW-3");
89   if (!(state->m_riot_port_a & 0x80)) data &= device->machine().root_device().ioport("ROW-0")->read();
90   if (!(state->m_riot_port_b & 0x01)) data &= device->machine().root_device().ioport("ROW-1")->read();
91   if (!(state->m_riot_port_b & 0x02)) data &= device->machine().root_device().ioport("ROW-2")->read();
92   if (!(state->m_riot_port_b & 0x04)) data &= device->machine().root_device().ioport("ROW-3")->read();
9393
9494   /* determine column */
95   if ( ((state->m_riot_port_a ^ 0xff) & (input_port_read(device->machine(), "ROW-0") ^ 0xff)) & 0x7f )
95   if ( ((state->m_riot_port_a ^ 0xff) & (state->ioport("ROW-0")->read() ^ 0xff)) & 0x7f )
9696      data &= ~0x80;
9797
9898   return data;
r15082r15083
105105   int data = 0xff;
106106
107107   /* determine column */
108   if ( ((state->m_riot_port_a ^ 0xff) & (input_port_read(device->machine(), "ROW-1") ^ 0xff)) & 0x7f )
108   if ( ((state->m_riot_port_a ^ 0xff) & (device->machine().root_device().ioport("ROW-1")->read() ^ 0xff)) & 0x7f )
109109      data &= ~0x01;
110110
111   if ( ((state->m_riot_port_a ^ 0xff) & (input_port_read(device->machine(), "ROW-2") ^ 0xff)) & 0x3f )
111   if ( ((state->m_riot_port_a ^ 0xff) & (device->machine().root_device().ioport("ROW-2")->read() ^ 0xff)) & 0x3f )
112112      data &= ~0x02;
113113
114   if ( ((state->m_riot_port_a ^ 0xff) & (input_port_read(device->machine(), "ROW-3") ^ 0xff)) & 0x1f )
114   if ( ((state->m_riot_port_a ^ 0xff) & (state->ioport("ROW-3")->read() ^ 0xff)) & 0x1f )
115115      data &= ~0x04;
116116
117117   data &= ~0x80; // else hangs 8b02
r15082r15083
201201
202202   logerror("SYM1 VIA2 W 0x%02x\n", data);
203203
204   if ((input_port_read(device->machine(), "WP") & 0x01) && !(data & 0x01)) {
204   if ((device->machine().root_device().ioport("WP")->read() & 0x01) && !(data & 0x01)) {
205205      cpu0space->nop_write(0xa600, 0xa67f);
206206   } else {
207207      cpu0space->install_write_bank(0xa600, 0xa67f, "bank5");
208208   }
209   if ((input_port_read(device->machine(), "WP") & 0x02) && !(data & 0x02)) {
209   if ((device->machine().root_device().ioport("WP")->read() & 0x02) && !(data & 0x02)) {
210210      cpu0space->nop_write(0x0400, 0x07ff);
211211   } else {
212212      cpu0space->install_write_bank(0x0400, 0x07ff, "bank2");
213213   }
214   if ((input_port_read(device->machine(), "WP") & 0x04) && !(data & 0x04)) {
214   if ((device->machine().root_device().ioport("WP")->read() & 0x04) && !(data & 0x04)) {
215215      cpu0space->nop_write(0x0800, 0x0bff);
216216   } else {
217217      cpu0space->install_write_bank(0x0800, 0x0bff, "bank3");
218218   }
219   if ((input_port_read(device->machine(), "WP") & 0x08) && !(data & 0x08)) {
219   if ((device->machine().root_device().ioport("WP")->read() & 0x08) && !(data & 0x08)) {
220220      cpu0space->nop_write(0x0c00, 0x0fff);
221221   } else {
222222      cpu0space->install_write_bank(0x0c00, 0x0fff, "bank4");
src/mess/machine/nextkbd.c
r15082r15083
153153   case 0: case 1: case 2: {
154154      int index;
155155      for(index=0; index < 32; index++)
156         if(field.mask & (1 << index))
156         if(field.mask() & (1 << index))
157157            break;
158158      assert(index != 32);
159159      index += bank*32;
r15082r15083
174174
175175   case 3:
176176      if(newval)
177         modifiers_state |= field.mask;
177         modifiers_state |= field.mask();
178178      else
179         modifiers_state &= ~field.mask;
179         modifiers_state &= ~field.mask();
180180      fifo_push(modifiers_state | (1<<28));
181181      send();
182182      break;
183183
184184   case 4:
185      if(field.mask & 1)
185      if(field.mask() & 1)
186186         int_power_cb(newval & 1);
187187      break;
188188   }
src/mess/machine/ondra.c
r15082r15083
3232   if (ondra_keyboard_line > 9) {
3333      retVal |= 0x1f;
3434   } else {
35      retVal |= input_port_read(machine(), keynames[ondra_keyboard_line]);
35      retVal |= ioport(keynames[ondra_keyboard_line])->read();
3636   }
3737   return retVal;
3838}
r15082r15083
7777
7878static TIMER_CALLBACK(nmi_check_callback)
7979{
80   if ((input_port_read(machine, "NMI") & 1) == 1)
80   if ((machine.root_device().ioport("NMI")->read() & 1) == 1)
8181   {
8282      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
8383   }
src/mess/machine/isa_sblaster.c
r15082r15083
400400   attotime new_time = machine().time();
401401
402402   {
403      data = input_port_read(*this, "pc_joy") | 0x0f;
403      data = ioport("pc_joy")->read() | 0x0f;
404404
405405      {
406406         delta = ((new_time - m_joy_time) * 256 * 1000).seconds;
407407
408         if (input_port_read(*this, "pc_joy_1") < delta) data &= ~0x01;
409         if (input_port_read(*this, "pc_joy_2") < delta) data &= ~0x02;
408         if (ioport("pc_joy_1")->read() < delta) data &= ~0x01;
409         if (ioport("pc_joy_2")->read() < delta) data &= ~0x02;
410410      }
411411   }
412412
src/mess/machine/apricotkb.c
r15082r15083
293293{
294294   UINT8 data = 0xff;
295295
296   if (!BIT(m_kb_y, 0)) data &= input_port_read(machine(), "Y0");
297   if (!BIT(m_kb_y, 1)) data &= input_port_read(machine(), "Y1");
298   if (!BIT(m_kb_y, 2)) data &= input_port_read(machine(), "Y2");
299   if (!BIT(m_kb_y, 3)) data &= input_port_read(machine(), "Y3");
300   if (!BIT(m_kb_y, 4)) data &= input_port_read(machine(), "Y4");
301   if (!BIT(m_kb_y, 5)) data &= input_port_read(machine(), "Y5");
302   if (!BIT(m_kb_y, 6)) data &= input_port_read(machine(), "Y6");
303   if (!BIT(m_kb_y, 7)) data &= input_port_read(machine(), "Y7");
304   if (!BIT(m_kb_y, 8)) data &= input_port_read(machine(), "Y8");
305   if (!BIT(m_kb_y, 9)) data &= input_port_read(machine(), "Y9");
306   if (!BIT(m_kb_y, 10)) data &= input_port_read(machine(), "YA");
307   if (!BIT(m_kb_y, 11)) data &= input_port_read(machine(), "YB");
308   if (!BIT(m_kb_y, 12)) data &= input_port_read(machine(), "YC");
296   if (!BIT(m_kb_y, 0)) data &= ioport("Y0")->read();
297   if (!BIT(m_kb_y, 1)) data &= ioport("Y1")->read();
298   if (!BIT(m_kb_y, 2)) data &= ioport("Y2")->read();
299   if (!BIT(m_kb_y, 3)) data &= ioport("Y3")->read();
300   if (!BIT(m_kb_y, 4)) data &= ioport("Y4")->read();
301   if (!BIT(m_kb_y, 5)) data &= ioport("Y5")->read();
302   if (!BIT(m_kb_y, 6)) data &= ioport("Y6")->read();
303   if (!BIT(m_kb_y, 7)) data &= ioport("Y7")->read();
304   if (!BIT(m_kb_y, 8)) data &= ioport("Y8")->read();
305   if (!BIT(m_kb_y, 9)) data &= ioport("Y9")->read();
306   if (!BIT(m_kb_y, 10)) data &= ioport("YA")->read();
307   if (!BIT(m_kb_y, 11)) data &= ioport("YB")->read();
308   if (!BIT(m_kb_y, 12)) data &= ioport("YC")->read();
309309
310310   return data;
311311}
r15082r15083
347347
348348    */
349349
350   UINT8 modifiers = input_port_read(machine(), "MODIFIERS");
350   UINT8 modifiers = ioport("MODIFIERS")->read();
351351
352352   return modifiers << 1;
353353}
src/mess/machine/tandy2kb.c
r15082r15083
322322 
323323   UINT8 data = 0xff;
324324 
325   if (!BIT(m_keylatch, 0)) data &= input_port_read(machine(), "Y0");
326   if (!BIT(m_keylatch, 1)) data &= input_port_read(machine(), "Y1");
327   if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "Y2");
328   if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "Y3");
329   if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "Y4");
330   if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "Y5");
331   if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "Y6");
332   if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "Y7");
333   if (!BIT(m_keylatch, 8)) data &= input_port_read(machine(), "Y8");
334   if (!BIT(m_keylatch, 9)) data &= input_port_read(machine(), "Y9");
335   if (!BIT(m_keylatch, 10)) data &= input_port_read(machine(), "Y10");
336   if (!BIT(m_keylatch, 11)) data &= input_port_read(machine(), "Y11");
325   if (!BIT(m_keylatch, 0)) data &= ioport("Y0")->read();
326   if (!BIT(m_keylatch, 1)) data &= ioport("Y1")->read();
327   if (!BIT(m_keylatch, 2)) data &= ioport("Y2")->read();
328   if (!BIT(m_keylatch, 3)) data &= ioport("Y3")->read();
329   if (!BIT(m_keylatch, 4)) data &= ioport("Y4")->read();
330   if (!BIT(m_keylatch, 5)) data &= ioport("Y5")->read();
331   if (!BIT(m_keylatch, 6)) data &= ioport("Y6")->read();
332   if (!BIT(m_keylatch, 7)) data &= ioport("Y7")->read();
333   if (!BIT(m_keylatch, 8)) data &= ioport("Y8")->read();
334   if (!BIT(m_keylatch, 9)) data &= ioport("Y9")->read();
335   if (!BIT(m_keylatch, 10)) data &= ioport("Y10")->read();
336   if (!BIT(m_keylatch, 11)) data &= ioport("Y11")->read();
337337 
338338   return ~data;
339339}
src/mess/machine/pc_lpt.c
r15082r15083
333333
334334void isa8_lpt_device::device_reset()
335335{
336   m_is_primary = (input_port_read(*this, "DSW") & 1) ? false : true;
336   m_is_primary = (ioport("DSW")->read() & 1) ? false : true;
337337   if (m_is_primary) {
338338      m_isa->install_device(subdevice("lpt"), 0x0378, 0x037b, 0, 0, FUNC(pc_lpt_r), FUNC(pc_lpt_w) );
339339   } else {
src/mess/machine/coleco.c
r15082r15083
33
44UINT8 coleco_scan_paddles(running_machine &machine, UINT8 *joy_status0, UINT8 *joy_status1)
55{
6   UINT8 ctrl_sel = input_port_read_safe(machine, "CTRLSEL", 0);
6   UINT8 ctrl_sel = machine.root_device().ioport("CTRLSEL")->read_safe(0);
77
88   /* which controller shall we read? */
99   if ((ctrl_sel & 0x07) == 0x02)         // Super Action Controller P1
10      *joy_status0 = input_port_read_safe(machine, "SAC_SLIDE1", 0);
10      *joy_status0 = machine.root_device().ioport("SAC_SLIDE1")->read_safe(0);
1111   else if ((ctrl_sel & 0x07) == 0x03)      // Driving Controller P1
12      *joy_status0 = input_port_read_safe(machine, "DRIV_WHEEL1", 0);
12      *joy_status0 = machine.root_device().ioport("DRIV_WHEEL1")->read_safe(0);
1313
1414   if ((ctrl_sel & 0x70) == 0x20)         // Super Action Controller P2
15      *joy_status1 = input_port_read_safe(machine, "SAC_SLIDE2", 0);
15      *joy_status1 = machine.root_device().ioport("SAC_SLIDE2")->read_safe(0);
1616   else if ((ctrl_sel & 0x70) == 0x30)      // Driving Controller P2
17      *joy_status1 = input_port_read_safe(machine, "DRIV_WHEEL2", 0);
17      *joy_status1 = machine.root_device().ioport("DRIV_WHEEL2")->read_safe(0);
1818
1919   /* In principle, even if not supported by any game, I guess we could have two Super
2020       Action Controllers plugged into the Roller controller ports. Since I found no info
r15082r15083
2222       the Roller trackball inputs and actually use the latter ones, when both are selected. */
2323   if (ctrl_sel & 0x80)               // Roller controller
2424   {
25      *joy_status0 = input_port_read_safe(machine, "ROLLER_X", 0);
26      *joy_status1 = input_port_read_safe(machine, "ROLLER_Y", 0);
25      *joy_status0 = machine.root_device().ioport("ROLLER_X")->read_safe(0);
26      *joy_status1 = machine.root_device().ioport("ROLLER_Y")->read_safe(0);
2727   }
2828
2929   return *joy_status0 | *joy_status1;
r15082r15083
3232
3333UINT8 coleco_paddle_read(running_machine &machine, int port, int joy_mode, UINT8 joy_status)
3434{
35   UINT8 ctrl_sel = input_port_read_safe(machine, "CTRLSEL", 0);
35   UINT8 ctrl_sel = machine.root_device().ioport("CTRLSEL")->read_safe(0);
3636   UINT8 ctrl_extra = ctrl_sel & 0x80;
3737   ctrl_sel = ctrl_sel >> (port*4) & 7;
3838
r15082r15083
4444      UINT16 ipt = 0xffff;
4545
4646      if (ctrl_sel == 0)         // ColecoVision Controller
47         ipt = input_port_read(machine, port ? "STD_KEYPAD2" : "STD_KEYPAD1");
47         ipt = machine.root_device().ioport(port ? "STD_KEYPAD2" : "STD_KEYPAD1")->read();
4848      else if (ctrl_sel == 2)      // Super Action Controller
49         ipt = input_port_read(machine, port ? "SAC_KEYPAD2" : "SAC_KEYPAD1");
49         ipt = machine.root_device().ioport(port ? "SAC_KEYPAD2" : "SAC_KEYPAD1")->read();
5050
5151      /* Numeric pad buttons are not independent on a real ColecoVision, if you push more
5252           than one, a real ColecoVision think that it is a third button, so we are going to emulate
r15082r15083
7575      UINT8 data = 0x7f;
7676
7777      if (ctrl_sel == 0)         // ColecoVision Controller
78         data = input_port_read(machine, port ? "STD_JOY2" : "STD_JOY1");
78         data = machine.root_device().ioport(port ? "STD_JOY2" : "STD_JOY1")->read();
7979      else if (ctrl_sel == 2)      // Super Action Controller
80         data = input_port_read(machine, port ? "SAC_JOY2" : "SAC_JOY1");
80         data = machine.root_device().ioport(port ? "SAC_JOY2" : "SAC_JOY1")->read();
8181      else if (ctrl_sel == 3)      // Driving Controller
82         data = input_port_read(machine, port ? "DRIV_PEDAL2" : "DRIV_PEDAL1");
82         data = machine.root_device().ioport(port ? "DRIV_PEDAL2" : "DRIV_PEDAL1")->read();
8383
8484      /* If any extra analog contoller enabled */
8585      if (ctrl_extra || ctrl_sel == 2 || ctrl_sel == 3)
r15082r15083
9696// ColecoVision Controller
9797static INPUT_PORTS_START( ctrl1 )
9898   PORT_START("STD_KEYPAD1")
99   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("0 (pad 1)") PORT_CODE(KEYCODE_0_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
100   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("1 (pad 1)") PORT_CODE(KEYCODE_1_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
101   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("2 (pad 1)") PORT_CODE(KEYCODE_2_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
102   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("3 (pad 1)") PORT_CODE(KEYCODE_3_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
103   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("4 (pad 1)") PORT_CODE(KEYCODE_4_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
104   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("5 (pad 1)") PORT_CODE(KEYCODE_5_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
105   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("6 (pad 1)") PORT_CODE(KEYCODE_6_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
106   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("7 (pad 1)") PORT_CODE(KEYCODE_7_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
107   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("8 (pad 1)") PORT_CODE(KEYCODE_8_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
108   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("9 (pad 1)") PORT_CODE(KEYCODE_9_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
109   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("# (pad 1)") PORT_CODE(KEYCODE_MINUS_PAD)   PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
110   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME(". (pad 1)") PORT_CODE(KEYCODE_PLUS_PAD)   PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
111   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)                              PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
112   PORT_BIT( 0xb000, IP_ACTIVE_LOW, IPT_UNKNOWN )                                          PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
99   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("0 (pad 1)") PORT_CODE(KEYCODE_0_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
100   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("1 (pad 1)") PORT_CODE(KEYCODE_1_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
101   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("2 (pad 1)") PORT_CODE(KEYCODE_2_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
102   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("3 (pad 1)") PORT_CODE(KEYCODE_3_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
103   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("4 (pad 1)") PORT_CODE(KEYCODE_4_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
104   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("5 (pad 1)") PORT_CODE(KEYCODE_5_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
105   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("6 (pad 1)") PORT_CODE(KEYCODE_6_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
106   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("7 (pad 1)") PORT_CODE(KEYCODE_7_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
107   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("8 (pad 1)") PORT_CODE(KEYCODE_8_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
108   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("9 (pad 1)") PORT_CODE(KEYCODE_9_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
109   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("# (pad 1)") PORT_CODE(KEYCODE_MINUS_PAD)   PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
110   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME(". (pad 1)") PORT_CODE(KEYCODE_PLUS_PAD)   PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
111   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)                              PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
112   PORT_BIT( 0xb000, IP_ACTIVE_LOW, IPT_UNKNOWN )                                          PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
113113
114114   PORT_START("STD_JOY1")
115   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
116   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
117   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
118   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
119   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)         PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
120   PORT_BIT( 0xb0, IP_ACTIVE_LOW, IPT_UNKNOWN )                  PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x00)
115   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
116   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
117   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
118   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
119   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)         PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
120   PORT_BIT( 0xb0, IP_ACTIVE_LOW, IPT_UNKNOWN )                  PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x00)
121121INPUT_PORTS_END
122122
123123static INPUT_PORTS_START( ctrl2 )
124124   PORT_START("STD_KEYPAD2")
125   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("0 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
126   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("1 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
127   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("2 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
128   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("3 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
129   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("4 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
130   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("5 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
131   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("6 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
132   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("7 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
133   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("8 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
134   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("9 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
135   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("# (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
136   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME(". (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
137   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)         PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
138   PORT_BIT( 0xb000, IP_ACTIVE_LOW, IPT_UNKNOWN )                     PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
125   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("0 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
126   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("1 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
127   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("2 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
128   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("3 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
129   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("4 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
130   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("5 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
131   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("6 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
132   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("7 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
133   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("8 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
134   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("9 (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
135   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("# (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
136   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME(". (pad 2)")   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
137   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)         PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
138   PORT_BIT( 0xb000, IP_ACTIVE_LOW, IPT_UNKNOWN )                     PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
139139
140140   PORT_START("STD_JOY2")
141   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)      PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
142   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
143   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
144   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
145   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)         PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
146   PORT_BIT( 0xb0, IP_ACTIVE_LOW, IPT_UNKNOWN )                  PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x00)
141   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)      PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
142   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
143   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
144   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
145   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)         PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
146   PORT_BIT( 0xb0, IP_ACTIVE_LOW, IPT_UNKNOWN )                  PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x00)
147147INPUT_PORTS_END
148148
149149
150150// Super Action Controller
151151static INPUT_PORTS_START( sac1 )
152152   PORT_START("SAC_KEYPAD1")
153   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("0 (SAC pad 1)") PORT_CODE(KEYCODE_0_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
154   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("1 (SAC pad 1)") PORT_CODE(KEYCODE_1_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
155   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("2 (SAC pad 1)") PORT_CODE(KEYCODE_2_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
156   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("3 (SAC pad 1)") PORT_CODE(KEYCODE_3_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
157   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("4 (SAC pad 1)") PORT_CODE(KEYCODE_4_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
158   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("5 (SAC pad 1)") PORT_CODE(KEYCODE_5_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
159   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("6 (SAC pad 1)") PORT_CODE(KEYCODE_6_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
160   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("7 (SAC pad 1)") PORT_CODE(KEYCODE_7_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
161   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("8 (SAC pad 1)") PORT_CODE(KEYCODE_8_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
162   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("9 (SAC pad 1)") PORT_CODE(KEYCODE_9_PAD)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
163   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("# (SAC pad 1)") PORT_CODE(KEYCODE_MINUS_PAD)   PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
164   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME(". (SAC pad 1)") PORT_CODE(KEYCODE_PLUS_PAD)   PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
165   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Blue Action Button P1") PORT_PLAYER(1)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
166   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Purple Action Button P1") PORT_PLAYER(1)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
167   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Orange Action Button P1") PORT_PLAYER(1)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
168   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )                                             PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
153   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("0 (SAC pad 1)") PORT_CODE(KEYCODE_0_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
154   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("1 (SAC pad 1)") PORT_CODE(KEYCODE_1_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
155   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("2 (SAC pad 1)") PORT_CODE(KEYCODE_2_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
156   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("3 (SAC pad 1)") PORT_CODE(KEYCODE_3_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
157   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("4 (SAC pad 1)") PORT_CODE(KEYCODE_4_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
158   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("5 (SAC pad 1)") PORT_CODE(KEYCODE_5_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
159   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("6 (SAC pad 1)") PORT_CODE(KEYCODE_6_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
160   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("7 (SAC pad 1)") PORT_CODE(KEYCODE_7_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
161   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("8 (SAC pad 1)") PORT_CODE(KEYCODE_8_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
162   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("9 (SAC pad 1)") PORT_CODE(KEYCODE_9_PAD)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
163   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("# (SAC pad 1)") PORT_CODE(KEYCODE_MINUS_PAD)   PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
164   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME(". (SAC pad 1)") PORT_CODE(KEYCODE_PLUS_PAD)   PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
165   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Blue Action Button P1") PORT_PLAYER(1)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
166   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Purple Action Button P1") PORT_PLAYER(1)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
167   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Orange Action Button P1") PORT_PLAYER(1)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
168   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )                                             PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
169169
170170   PORT_START("SAC_JOY1")
171   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)      PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
172   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
173   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
174   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
175   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Yellow Action Button P1") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
176   PORT_BIT( 0xb0, IP_ACTIVE_LOW, IPT_UNKNOWN )                  PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
171   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)      PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
172   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
173   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
174   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
175   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Yellow Action Button P1") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
176   PORT_BIT( 0xb0, IP_ACTIVE_LOW, IPT_UNKNOWN )                  PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
177177
178178   PORT_START("SAC_SLIDE1")   // SAC P1 slider
179   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_J) PORT_CODE_INC(KEYCODE_L) PORT_REVERSE PORT_RESET PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x02)
179   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_J) PORT_CODE_INC(KEYCODE_L) PORT_REVERSE PORT_RESET PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x02)
180180INPUT_PORTS_END
181181
182182static INPUT_PORTS_START( sac2 )
183183   PORT_START("SAC_KEYPAD2")
184   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("0 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
185   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("1 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
186   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("2 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
187   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("3 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
188   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("4 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
189   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("5 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
190   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("6 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
191   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("7 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
192   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("8 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
193   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("9 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
194   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("# (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
195   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME(". (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
196   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Blue Action Button P2") PORT_PLAYER(2)      PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
197   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Purple Action Button P2") PORT_PLAYER(2)      PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
198   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Orange Action Button P2") PORT_PLAYER(2)      PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
199   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )                                             PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
184   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("0 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
185   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("1 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
186   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("2 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
187   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("3 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
188   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("4 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
189   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("5 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
190   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("6 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
191   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("7 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
192   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("8 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
193   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("9 (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
194   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("# (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
195   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME(". (SAC pad 2)")                        PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
196   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Blue Action Button P2") PORT_PLAYER(2)      PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
197   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Purple Action Button P2") PORT_PLAYER(2)      PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
198   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Orange Action Button P2") PORT_PLAYER(2)      PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
199   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )                                             PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
200200
201201   PORT_START("SAC_JOY2")
202   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)      PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
203   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
204   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
205   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
206   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Yellow Action Button P2") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
207   PORT_BIT( 0xb0, IP_ACTIVE_LOW, IPT_UNKNOWN )                  PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
202   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)      PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
203   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
204   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
205   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
206   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Yellow Action Button P2") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
207   PORT_BIT( 0xb0, IP_ACTIVE_LOW, IPT_UNKNOWN )                  PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
208208
209209   PORT_START("SAC_SLIDE2")   // SAC P2 slider
210   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_I) PORT_CODE_INC(KEYCODE_K) PORT_RESET PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x20)
210   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_I) PORT_CODE_INC(KEYCODE_K) PORT_RESET PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x20)
211211INPUT_PORTS_END
212212
213213
214214// Driving Controller
215215static INPUT_PORTS_START( driv1 )
216216   PORT_START("DRIV_WHEEL1")
217   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_J) PORT_CODE_INC(KEYCODE_L) PORT_REVERSE PORT_RESET PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x03)
217   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_J) PORT_CODE_INC(KEYCODE_L) PORT_REVERSE PORT_RESET PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x03)
218218
219219   PORT_START("DRIV_PEDAL1")
220   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)         PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x03)
221   PORT_BIT( 0xbf, IP_ACTIVE_LOW, IPT_UNUSED )                     PORT_CONDITION("CTRLSEL", 0x07, PORTCOND_EQUALS, 0x03)
220   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)         PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x03)
221   PORT_BIT( 0xbf, IP_ACTIVE_LOW, IPT_UNUSED )                     PORT_CONDITION("CTRLSEL", 0x07, EQUALS, 0x03)
222222INPUT_PORTS_END
223223
224224static INPUT_PORTS_START( driv2 )
225225   PORT_START("DRIV_WHEEL2")
226   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_I) PORT_CODE_INC(KEYCODE_K) PORT_RESET PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x30)
226   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_I) PORT_CODE_INC(KEYCODE_K) PORT_RESET PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x30)
227227
228228   PORT_START("DRIV_PEDAL2")
229   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)         PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x30)
230   PORT_BIT( 0xbf, IP_ACTIVE_LOW, IPT_UNUSED )                     PORT_CONDITION("CTRLSEL", 0x70, PORTCOND_EQUALS, 0x30)
229   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)         PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x30)
230   PORT_BIT( 0xbf, IP_ACTIVE_LOW, IPT_UNUSED )                     PORT_CONDITION("CTRLSEL", 0x70, EQUALS, 0x30)
231231INPUT_PORTS_END
232232
233233
234234// Roller Controller
235235static INPUT_PORTS_START( roller )
236236   PORT_START("ROLLER_X")   // Roller Controller X Axis
237   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_J) PORT_CODE_INC(KEYCODE_L) PORT_REVERSE PORT_RESET PORT_CONDITION("CTRLSEL", 0x80, PORTCOND_EQUALS, 0x80)
237   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_J) PORT_CODE_INC(KEYCODE_L) PORT_REVERSE PORT_RESET PORT_CONDITION("CTRLSEL", 0x80, EQUALS, 0x80)
238238
239239   PORT_START("ROLLER_Y")   // Roller Controller Y Axis
240   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_I) PORT_CODE_INC(KEYCODE_K) PORT_RESET PORT_CONDITION("CTRLSEL", 0x80, PORTCOND_EQUALS, 0x80)
240   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_I) PORT_CODE_INC(KEYCODE_K) PORT_RESET PORT_CONDITION("CTRLSEL", 0x80, EQUALS, 0x80)
241241INPUT_PORTS_END
242242
243243
src/mess/machine/a2ssc.c
r15082r15083
179179    switch (offset)
180180    {
181181        case 1:
182            return input_port_read(device(), "DSW1");
182            return device().ioport("DSW1")->read();
183183        case 2:
184            return input_port_read(device(), "DSW2");
184            return device().ioport("DSW2")->read();
185185
186186        case 8:
187187        case 9:
src/mess/machine/hec2hrp.c
r15082r15083
242242   if (offset ==7) /* Only when joy reading*/
243243   {
244244      /* Read special key for analog joystick emulation only (button and pot are analog signal!) and the reset */
245      data=input_port_read(machine(), keynames[8]);
245      data=ioport(keynames[8])->read();
246246
247247      if (data & 0x01) /* Reset machine ! (on ESC key)*/
248248      {
r15082r15083
301301   }
302302
303303   /* in all case return the request value*/
304   return input_port_read(machine(), keynames[offset]);
304   return ioport(keynames[offset])->read();
305305}
306306
307307WRITE8_MEMBER(hec2hrp_state::hector_sn_2000_w)
src/mess/machine/intv.c
r15082r15083
4848      switch (offset)
4949      {
5050         case 0x000:
51            rv = input_port_read(machine(), "TEST") & 0x80;
51            rv = ioport("TEST")->read() & 0x80;
5252            logerror("TAPE: Read %02x from 0x40%02x - XOR Data?\n",rv,offset);
5353            break;
5454         case 0x001:
55            rv = (input_port_read(machine(), "TEST") & 0x40) << 1;
55            rv = (ioport("TEST")->read() & 0x40) << 1;
5656            logerror("TAPE: Read %02x from 0x40%02x - Sense 1?\n",rv,offset);
5757            break;
5858         case 0x002:
59            rv = (input_port_read(machine(), "TEST") & 0x20) << 2;
59            rv = (ioport("TEST")->read() & 0x20) << 2;
6060            logerror("TAPE: Read %02x from 0x40%02x - Sense 2?\n",rv,offset);
6161            break;
6262         case 0x003:
63            rv = (input_port_read(machine(), "TEST") & 0x10) << 3;
63            rv = (ioport("TEST")->read() & 0x10) << 3;
6464            logerror("TAPE: Read %02x from 0x40%02x - Tape Present\n",rv,offset);
6565            break;
6666         case 0x004:
67            rv = (input_port_read(machine(), "TEST") & 0x08) << 4;
67            rv = (ioport("TEST")->read() & 0x08) << 4;
6868            logerror("TAPE: Read %02x from 0x40%02x - Comp (339/1)\n",rv,offset);
6969            break;
7070         case 0x005:
71            rv = (input_port_read(machine(), "TEST") & 0x04) << 5;
71            rv = (ioport("TEST")->read() & 0x04) << 5;
7272            logerror("TAPE: Read %02x from 0x40%02x - Clocked Comp (339/13)\n",rv,offset);
7373            break;
7474         case 0x006:
r15082r15083
8888         case 0x060:   /* Keyboard Read */
8989            rv = 0xff;
9090            if (m_intvkbd_keyboard_col == 0)
91               rv = input_port_read(machine(), "ROW0");
91               rv = ioport("ROW0")->read();
9292            if (m_intvkbd_keyboard_col == 1)
93               rv = input_port_read(machine(), "ROW1");
93               rv = ioport("ROW1")->read();
9494            if (m_intvkbd_keyboard_col == 2)
95               rv = input_port_read(machine(), "ROW2");
95               rv = ioport("ROW2")->read();
9696            if (m_intvkbd_keyboard_col == 3)
97               rv = input_port_read(machine(), "ROW3");
97               rv = ioport("ROW3")->read();
9898            if (m_intvkbd_keyboard_col == 4)
99               rv = input_port_read(machine(), "ROW4");
99               rv = ioport("ROW4")->read();
100100            if (m_intvkbd_keyboard_col == 5)
101               rv = input_port_read(machine(), "ROW5");
101               rv = ioport("ROW5")->read();
102102            if (m_intvkbd_keyboard_col == 6)
103               rv = input_port_read(machine(), "ROW6");
103               rv = ioport("ROW6")->read();
104104            if (m_intvkbd_keyboard_col == 7)
105               rv = input_port_read(machine(), "ROW7");
105               rv = ioport("ROW7")->read();
106106            if (m_intvkbd_keyboard_col == 8)
107               rv = input_port_read(machine(), "ROW8");
107               rv = ioport("ROW8")->read();
108108            if (m_intvkbd_keyboard_col == 9)
109               rv = input_port_read(machine(), "ROW9");
109               rv = ioport("ROW9")->read();
110110            break;
111111         case 0x80:
112112            rv = 0x00;
r15082r15083
729729   UINT8 rv = 0xFF;
730730
731731   /* keypad */
732   x = input_port_read(space->machine(), keypad_name[hand]);
732   x = space->machine().root_device().ioport(keypad_name[hand])->read();
733733   for (y = 0; y < 16; y++)
734734   {
735735      if (x & (1 << y))
r15082r15083
738738      }
739739   }
740740
741   switch ((input_port_read(space->machine(), "OPTIONS") >> hand) & 1)
741   switch ((space->machine().root_device().ioport("OPTIONS")->read() >> hand) & 1)
742742   {
743743      case 0: /* disc == digital */
744744      default:
745745
746         x = input_port_read(space->machine(), disc_name[hand]);
746         x = space->machine().root_device().ioport(disc_name[hand])->read();
747747         for (y = 0; y < 16; y++)
748748         {
749749            if (x & (1 << y))
r15082r15083
755755
756756      case 1: /* disc == _fake_ analog */
757757
758         x = input_port_read(space->machine(), discx_name[hand]);
759         y = input_port_read(space->machine(), discy_name[hand]);
758         x = space->machine().root_device().ioport(discx_name[hand])->read();
759         y = space->machine().root_device().ioport(discy_name[hand])->read();
760760         rv &= discyx_table[y / 32][x / 32];
761761   }
762762
r15082r15083
775775
776776READ8_MEMBER( intv_state::intv_ecs_porta_r )
777777{
778   if (input_port_read(machine(), "ECS_CNTRLSEL") == 0)
778   if (ioport("ECS_CNTRLSEL")->read() == 0)
779779      return intv_control_r(&space, 2);
780780   else
781781      return 0xff; // not sure what to return here, maybe it should be last output?
r15082r15083
783783
784784READ8_MEMBER( intv_state::intv_ecs_portb_r )
785785{
786   switch (input_port_read(machine(), "ECS_CNTRLSEL"))
786   switch (ioport("ECS_CNTRLSEL")->read())
787787   {
788788      case 0x00: // hand controller
789789      {
r15082r15083
797797         for (int i=0; i<7; i++)
798798         {
799799         if (m_ecs_psg_porta & (1<<i))
800            rv &= input_port_read(machine(), ecs_synth_rows[i]);
800            rv &= ioport(ecs_synth_rows[i])->read();
801801         }
802802         return rv;
803803      }
r15082r15083
809809         for (int i=0; i<7; i++)
810810         {
811811         if (m_ecs_psg_porta & (1<<i))
812            rv &= input_port_read(machine(), ecs_keyboard_rows[i]);
812            rv &= ioport(ecs_keyboard_rows[i])->read();
813813         }
814814         return rv;
815815      }
src/mess/machine/c64_ide64.c
r15082r15083
133133 
134134   m_enable = 1;
135135 
136   m_wp = input_port_read(*this, "JP1");
136   m_wp = ioport("JP1")->read();
137137   m_game = !m_wp;
138138   m_exrom = !m_wp;
139139}
src/mess/machine/comx_joy.c
r15082r15083
9494
9595   if (offset == 2)
9696   {
97      data = input_port_read(*this, "JOY1");
97      data = ioport("JOY1")->read();
9898   }
9999   else if (offset == 4)
100100   {
101      data = input_port_read(*this, "JOY2");
101      data = ioport("JOY2")->read();
102102   }
103103
104104   return data;
src/mess/machine/mikro80.c
r15082r15083
3535READ8_MEMBER(mikro80_state::mikro80_8255_portb_r)
3636{
3737   UINT8 key = 0xff;
38   if ((m_keyboard_mask & 0x01)!=0) { key &= input_port_read(machine(),"LINE0"); }
39   if ((m_keyboard_mask & 0x02)!=0) { key &= input_port_read(machine(),"LINE1"); }
40   if ((m_keyboard_mask & 0x04)!=0) { key &= input_port_read(machine(),"LINE2"); }
41   if ((m_keyboard_mask & 0x08)!=0) { key &= input_port_read(machine(),"LINE3"); }
42   if ((m_keyboard_mask & 0x10)!=0) { key &= input_port_read(machine(),"LINE4"); }
43   if ((m_keyboard_mask & 0x20)!=0) { key &= input_port_read(machine(),"LINE5"); }
44   if ((m_keyboard_mask & 0x40)!=0) { key &= input_port_read(machine(),"LINE6"); }
45   if ((m_keyboard_mask & 0x80)!=0) { key &= input_port_read(machine(),"LINE7"); }
38   if ((m_keyboard_mask & 0x01)!=0) { key &= ioport("LINE0")->read(); }
39   if ((m_keyboard_mask & 0x02)!=0) { key &= ioport("LINE1")->read(); }
40   if ((m_keyboard_mask & 0x04)!=0) { key &= ioport("LINE2")->read(); }
41   if ((m_keyboard_mask & 0x08)!=0) { key &= ioport("LINE3")->read(); }
42   if ((m_keyboard_mask & 0x10)!=0) { key &= ioport("LINE4")->read(); }
43   if ((m_keyboard_mask & 0x20)!=0) { key &= ioport("LINE5")->read(); }
44   if ((m_keyboard_mask & 0x40)!=0) { key &= ioport("LINE6")->read(); }
45   if ((m_keyboard_mask & 0x80)!=0) { key &= ioport("LINE7")->read(); }
4646   return key & m_key_mask;
4747}
4848
4949READ8_MEMBER(mikro80_state::mikro80_8255_portc_r)
5050{
51   return input_port_read(machine(), "LINE8");
51   return ioport("LINE8")->read();
5252}
5353
5454WRITE8_MEMBER(mikro80_state::mikro80_8255_porta_w)
src/mess/machine/mz80.c
r15082r15083
3131   if (m_mz80k_keyboard_line > 9)
3232      return 0xff;
3333   else
34      return input_port_read(machine(), kbdrow);
34      return ioport(kbdrow)->read();
3535}
3636
3737READ8_MEMBER( mz80_state::mz80k_8255_portc_r )
src/mess/machine/abc77.c
r15082r15083
323323   PORT_DIPNAME( 0x04, 0x04, "External Encoding PROM" ) // @ Z14
324324   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
325325   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
326   PORT_DIPNAME( 0x18, 0x18, "Keyboard Language" ) PORT_CONDITION("DSW", 0x04, PORTCOND_EQUALS, 0x00)
326   PORT_DIPNAME( 0x18, 0x18, "Keyboard Language" ) PORT_CONDITION("DSW", 0x04, EQUALS, 0x00)
327327   PORT_DIPSETTING(    0x00, "Danish" )
328328   PORT_DIPSETTING(    0x10, DEF_STR( French ) )
329329   PORT_DIPSETTING(    0x08, DEF_STR( German ) )
r15082r15083
438438void abc77_device::device_reset()
439439{
440440   int t = 1.1 * RES_K(100) * CAP_N(100) * 1000; // t = 1.1 * R1 * C1
441   int ea = BIT(input_port_read(*this, "DSW"), 7);
441   int ea = BIT(ioport("DSW")->read(), 7);
442442
443443   // trigger reset
444444   device_set_input_line(m_maincpu, INPUT_LINE_RESET, ASSERT_LINE);
r15082r15083
493493
494494   if (m_stb && m_keylatch < 12)
495495   {
496      data = input_port_read(*this, keynames[m_keylatch]);
496      data = ioport(keynames[m_keylatch])->read();
497497   }
498498
499499   return data;
src/mess/machine/ut88.c
r15082r15083
3535      if (BIT(m_keyboard_mask, i))
3636      {
3737         sprintf(kbdrow,"LINE%d", i);
38         data &= input_port_read(machine(), kbdrow);
38         data &= ioport(kbdrow)->read();
3939      }
4040   }
4141   return data;
r15082r15083
4343
4444READ8_MEMBER( ut88_state::ut88_8255_portc_r )
4545{
46   return input_port_read(machine(), "LINE8");
46   return ioport("LINE8")->read();
4747}
4848
4949WRITE8_MEMBER( ut88_state::ut88_8255_porta_w )
r15082r15083
106106   UINT8 *keyrom1 = memregion("proms")->base();
107107   UINT8 *keyrom2 = memregion("proms")->base()+100;
108108
109   UINT8 key = keyrom2[input_port_read(machine(), "LINE1")];
109   UINT8 key = keyrom2[ioport("LINE1")->read()];
110110
111111   // if keyboard 2nd part returned 0 on 4th bit, output from
112112   // first part is used
113113
114114   if (!BIT(key, 3))
115      key = keyrom1[input_port_read(machine(), "LINE0")];
115      key = keyrom1[ioport("LINE0")->read()];
116116
117117   // for delete key there is special key producing code 0x80
118118
119   key = (BIT(input_port_read(machine(), "LINE2"), 7)) ? key : 0x80;
119   key = (BIT(ioport("LINE2")->read(), 7)) ? key : 0x80;
120120
121121   // If key 0 is pressed its value is 0x10 this is done by additional
122122   // discrete logic
123123
124   key = (BIT(input_port_read(machine(), "LINE0"), 0)) ? key : 0x10;
124   key = (BIT(ioport("LINE0")->read(), 0)) ? key : 0x10;
125125   return key;
126126}
127127
src/mess/machine/tf20.c
r15082r15083
8585{
8686   logerror("%s: tf20_dip_r\n", space->machine().describe_context());
8787
88   return input_port_read(space->machine(), "tf20_dip");
88   return space->machine().root_device().ioport("tf20_dip")->read();
8989}
9090
9191static TIMER_CALLBACK( tf20_upd765_tc_reset )
src/mess/machine/c64.c
r15082r15083
5353   device_t *cia_1 = machine.device("cia_1");
5454   int cia1irq = mos6526_irq_r(cia_1);
5555
56   if (state->m_nmilevel != (input_port_read(machine, "SPECIAL") & 0x80) || cia1irq)   /* KEY_RESTORE */
56   if (state->m_nmilevel != (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq)   /* KEY_RESTORE */
5757   {
58      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, (input_port_read(machine, "SPECIAL") & 0x80) || cia1irq);
58      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq);
5959
60      state->m_nmilevel = (input_port_read(machine, "SPECIAL") & 0x80) || cia1irq;
60      state->m_nmilevel = (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq;
6161   }
6262}
6363
r15082r15083
309309   else if (offset < 0xd00)
310310      {
311311         if (offset & 1)
312            cia_set_port_mask_value(cia_0, 1, input_port_read(space->machine(), "CTRLSEL") & 0x80 ? c64_keyline[9] : c64_keyline[8] );
312            cia_set_port_mask_value(cia_0, 1, space->machine().root_device().ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[9] : c64_keyline[8] );
313313         else
314            cia_set_port_mask_value(cia_0, 0, input_port_read(space->machine(), "CTRLSEL") & 0x80 ? c64_keyline[8] : c64_keyline[9] );
314            cia_set_port_mask_value(cia_0, 0, state->ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[8] : c64_keyline[9] );
315315
316316         return mos6526_r(cia_0, offset);
317317      }
r15082r15083
620620   running_machine &machine = device->machine();
621621   int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp;
622622   UINT8 cia0porta = mos6526_pa_r(machine.device("cia_0"), 0);
623   int controller1 = input_port_read(machine, "CTRLSEL") & 0x07;
624   int controller2 = input_port_read(machine, "CTRLSEL") & 0x70;
623   int controller1 = machine.root_device().ioport("CTRLSEL")->read() & 0x07;
624   int controller2 = machine.root_device().ioport("CTRLSEL")->read() & 0x70;
625625   /* Notice that only a single input is defined for Mouse & Lightpen in both ports */
626626   switch (controller1)
627627   {
628628      case 0x01:
629629         if (which)
630            pot2 = input_port_read(machine, "PADDLE2");
630            pot2 = machine.root_device().ioport("PADDLE2")->read();
631631         else
632            pot1 = input_port_read(machine, "PADDLE1");
632            pot1 = machine.root_device().ioport("PADDLE1")->read();
633633         break;
634634
635635      case 0x02:
636636         if (which)
637            pot2 = input_port_read(machine, "TRACKY");
637            pot2 = machine.root_device().ioport("TRACKY")->read();
638638         else
639            pot1 = input_port_read(machine, "TRACKX");
639            pot1 = machine.root_device().ioport("TRACKX")->read();
640640         break;
641641
642642      case 0x03:
643         if (which && (input_port_read(machine, "JOY1_2B") & 0x20))   /* Joy1 Button 2 */
643         if (which && (machine.root_device().ioport("JOY1_2B")->read() & 0x20))   /* Joy1 Button 2 */
644644            pot1 = 0x00;
645645         break;
646646
647647      case 0x04:
648648         if (which)
649            pot2 = input_port_read(machine, "LIGHTY");
649            pot2 = machine.root_device().ioport("LIGHTY")->read();
650650         else
651            pot1 = input_port_read(machine, "LIGHTX");
651            pot1 = machine.root_device().ioport("LIGHTX")->read();
652652         break;
653653
654654      case 0x06:
655         if (which && (input_port_read(machine, "OTHER") & 0x04))   /* Lightpen Signal */
655         if (which && (machine.root_device().ioport("OTHER")->read() & 0x04))   /* Lightpen Signal */
656656            pot2 = 0x00;
657657         break;
658658
r15082r15083
669669   {
670670      case 0x10:
671671         if (which)
672            pot4 = input_port_read(machine, "PADDLE4");
672            pot4 = machine.root_device().ioport("PADDLE4")->read();
673673         else
674            pot3 = input_port_read(machine, "PADDLE3");
674            pot3 = machine.root_device().ioport("PADDLE3")->read();
675675         break;
676676
677677      case 0x20:
678678         if (which)
679            pot4 = input_port_read(machine, "TRACKY");
679            pot4 = machine.root_device().ioport("TRACKY")->read();
680680         else
681            pot3 = input_port_read(machine, "TRACKX");
681            pot3 = machine.root_device().ioport("TRACKX")->read();
682682         break;
683683
684684      case 0x30:
685         if (which && (input_port_read(machine, "JOY2_2B") & 0x20))   /* Joy2 Button 2 */
685         if (which && (machine.root_device().ioport("JOY2_2B")->read() & 0x20))   /* Joy2 Button 2 */
686686            pot4 = 0x00;
687687         break;
688688
689689      case 0x40:
690690         if (which)
691            pot4 = input_port_read(machine, "LIGHTY");
691            pot4 = machine.root_device().ioport("LIGHTY")->read();
692692         else
693            pot3 = input_port_read(machine, "LIGHTX");
693            pot3 = machine.root_device().ioport("LIGHTX")->read();
694694         break;
695695
696696      case 0x60:
697         if (which && (input_port_read(machine, "OTHER") & 0x04))   /* Lightpen Signal */
697         if (which && (machine.root_device().ioport("OTHER")->read() & 0x04))   /* Lightpen Signal */
698698            pot4 = 0x00;
699699         break;
700700
r15082r15083
707707         break;
708708   }
709709
710   if (input_port_read(machine, "CTRLSEL") & 0x80)      /* Swap */
710   if (machine.root_device().ioport("CTRLSEL")->read() & 0x80)      /* Swap */
711711   {
712712      temp = pot1; pot1 = pot3; pot3 = temp;
713713      temp = pot2; pot2 = pot4; pot4 = temp;
src/mess/machine/pc.c
r15082r15083
679679         *      01 - color 40x25
680680         * 6-7  The number of floppy disk drives
681681         */
682      data = input_port_read(device->machine(), "DSW0");
682      data = device->machine().root_device().ioport("DSW0")->read();
683683   }
684684   else
685685   {
r15082r15083
704704   if (st->m_ppi_portc_switch_high)
705705   {
706706      /* read hi nibble of S2 */
707      data = (data & 0xf0) | ((input_port_read(device->machine(), "DSW0") >> 4) & 0x0f);
707      data = (data & 0xf0) | ((device->machine().root_device().ioport("DSW0")->read() >> 4) & 0x0f);
708708      PIO_LOG(1,"PIO_C_r (hi)",("$%02x\n", data));
709709   }
710710   else
711711   {
712712      /* read lo nibble of S2 */
713      data = (data & 0xf0) | (input_port_read(device->machine(), "DSW0") & 0x0f);
713      data = (data & 0xf0) | (device->machine().root_device().ioport("DSW0")->read() & 0x0f);
714714      PIO_LOG(1,"PIO_C_r (lo)",("$%02x\n", data));
715715   }
716716
r15082r15083
779779         *      01 - color 40x25
780780         * 6-7  The number of floppy disk drives
781781         */
782      data = input_port_read(device->machine(), "DSW0");
782      data = device->machine().root_device().ioport("DSW0")->read();
783783   }
784784   else
785785   {
r15082r15083
10891089   mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, pcjr_set_keyb_int, pc_set_irq_line);
10901090}
10911091
1092static READ8_HANDLER( input_port_0_r ) { return input_port_read(space->machine(), "IN0"); }
1092static READ8_HANDLER( input_port_0_r ) { return space->machine().root_device().ioport("IN0")->read(); }
10931093
10941094DRIVER_INIT( pc1640 )
10951095{
src/mess/machine/pecom.c
r15082r15083
109109   UINT16 addr = cpu_get_reg(machine().device(CDP1802_TAG), COSMAC_R0 + cpu_get_reg(machine().device(CDP1802_TAG), COSMAC_X));
110110   /* just in case somone is reading non existing ports */
111111   if (addr<0x7cca || addr>0x7ce3) return 0;
112   return input_port_read(machine(), keynames[addr - 0x7cca]) & 0x03;
112   return ioport(keynames[addr - 0x7cca])->read() & 0x03;
113113}
114114
115115/* CDP1802 Interface */
r15082r15083
123123
124124static READ_LINE_DEVICE_HANDLER( ef2_r )
125125{
126   int shift = BIT(input_port_read(device->machine(), "CNT"), 1);
126   int shift = BIT(device->machine().root_device().ioport("CNT")->read(), 1);
127127   double cas = dynamic_cast<cassette_image_device *>(device)->input();
128128
129129   return (cas > 0.0) | shift;
r15082r15083
134134{
135135    int flags = 0x0f;
136136    double valcas = (cassette_device_image(device->machine()));->input()
137    UINT8 val = input_port_read(device->machine(), "CNT");
137    UINT8 val = device->machine().root_device().ioport("CNT")->read();
138138
139139    if ((val & 0x04)==0x04 && pecom_prev_caps_state==0)
140140    {
src/mess/machine/pce.c
r15082r15083
295295
296296   /* Note: Arcade Card BIOS contents are the same as System 3, only internal HW differs.
297297       We use a category to select between modes (some games can be run in either S-CD or A-CD modes) */
298   state->m_acard = input_port_read(machine, "A_CARD") & 1;
298   state->m_acard = machine.root_device().ioport("A_CARD")->read() & 1;
299299}
300300
301301/* todo: how many input ports does the PCE have? */
302302WRITE8_MEMBER(pce_state::mess_pce_joystick_w)
303303{
304304   int joy_i;
305   UINT8 joy_type = input_port_read(machine(),"JOY_TYPE");
305   UINT8 joy_type = ioport("JOY_TYPE")->read();
306306
307307   h6280io_set_buffer(&space.device(), data);
308308
r15082r15083
336336      { "JOY6B_P1", "JOY6B_P2", "JOY6B_P3", "JOY6B_P4", "JOY6B_P5" },
337337      { }
338338   };
339   UINT8 joy_type = input_port_read(machine(), "JOY_TYPE");
339   UINT8 joy_type = ioport("JOY_TYPE")->read();
340340   UINT8 ret, data;
341341
342342   if (m_joystick_port_select <= 4)
r15082r15083
344344      switch((joy_type >> (m_joystick_port_select*2)) & 3)
345345      {
346346         case 0: //2-buttons pad
347            data = input_port_read(machine(), joyname[0][m_joystick_port_select]);
347            data = ioport(joyname[0][m_joystick_port_select])->read();
348348            break;
349349         case 2: //6-buttons pad
350350            /*
r15082r15083
354354                Note that six buttons pad just doesn't work with (almost?) every single 2-button-only games, it's really just an after-thought and it is like this
355355                on real HW.
356356                */
357            data = input_port_read(machine(), joyname[2][m_joystick_port_select]) >> (m_joy_6b_packet[m_joystick_port_select]*8);
357            data = ioport(joyname[2][m_joystick_port_select])->read() >> (m_joy_6b_packet[m_joystick_port_select]*8);
358358            break;
359359         default:
360360            data = 0xff;
src/mess/machine/vic1110.c
r15082r15083
9191UINT8 vic1110_device::vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3)
9292{
9393   UINT8 data = 0;
94   UINT8 sw = input_port_read(*this, "SW");
94   UINT8 sw = ioport("SW")->read();
9595
9696   if ((!blk1 && (sw == BLK1)) || (!blk2 && (sw == BLK2)) || (!blk3 && (sw == BLK3)) || (!blk5 && (sw == BLK5)))
9797   {
r15082r15083
108108
109109void vic1110_device::vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3)
110110{
111   UINT8 sw = input_port_read(*this, "SW");
111   UINT8 sw = ioport("SW")->read();
112112
113113   if ((!blk1 && (sw == BLK1)) || (!blk2 && (sw == BLK2)) || (!blk3 && (sw == BLK3)) || (!blk5 && (sw == BLK5)))
114114   {
src/mess/machine/bbc.c
r15082r15083
751751         /* KBD IC4 8 input NAND gate */
752752         /* set the value of via_system ca2, by checking for any keys
753753                 being pressed on the selected state->m_column */
754         if ((input_port_read(device->machine(), colnames[state->m_column]) | 0x01) != 0xff)
754         if ((device->machine().root_device().ioport(colnames[state->m_column])->read() | 0x01) != 0xff)
755755         {
756756            via_0->write_ca2(1);
757757         }
r15082r15083
792792         /* KBD IC4 8 input NAND gate */
793793         /* set the value of via_system ca2, by checking for any keys
794794                 being pressed on the selected state->m_column */
795         if ((input_port_read(device->machine(), colnames[state->m_column]) | 0x01) != 0xff)
795         if ((device->machine().root_device().ioport(colnames[state->m_column])->read() | 0x01) != 0xff)
796796         {
797797            via_0->write_ca2(1);
798798         }
r15082r15083
830830
831831   if (state->m_column < 10)
832832   {
833      res = input_port_read(space->machine(), colnames[state->m_column]);
833      res = space->machine().root_device().ioport(colnames[state->m_column])->read();
834834   }
835835   else
836836   {
r15082r15083
11471147{
11481148   TMSint=(!status)&1;
11491149   TMSrdy=(!tms5220_readyq_r())&1;
1150   via_0_portb_w(0,(0xf | input_port_read(machine, "IN0")|(TMSint<<6)|(TMSrdy<<7)));
1150   via_0_portb_w(0,(0xf | machine.root_device().ioport("IN0")->read()|(TMSint<<6)|(TMSrdy<<7)));
11511151}
11521152#endif
11531153
r15082r15083
11591159
11601160   //logerror("SYSTEM read portb %d\n",0xf | input_port(machine, "IN0")|(TMSint<<6)|(TMSrdy<<7));
11611161
1162   return (0xf | input_port_read(device->machine(), "IN0")|(TMSint<<6)|(TMSrdy<<7));
1162   return (0xf | device->machine().root_device().ioport("IN0")->read()|(TMSint<<6)|(TMSrdy<<7));
11631163}
11641164
11651165
r15082r15083
12731273   switch(channel_number)
12741274   {
12751275      case 0:
1276         return ((0xff-input_port_read(device->machine(), "JOY0"))<<8);
1276         return ((0xff-device->machine().root_device().ioport("JOY0")->read())<<8);
12771277      case 1:
1278         return ((0xff-input_port_read(device->machine(), "JOY1"))<<8);
1278         return ((0xff-device->machine().root_device().ioport("JOY1")->read())<<8);
12791279      case 2:
1280         return ((0xff-input_port_read(device->machine(), "JOY2"))<<8);
1280         return ((0xff-device->machine().root_device().ioport("JOY2")->read())<<8);
12811281      case 3:
1282         return ((0xff-input_port_read(device->machine(), "JOY3"))<<8);
1282         return ((0xff-device->machine().root_device().ioport("JOY3")->read())<<8);
12831283   }
12841284
12851285   return 0;
r15082r15083
20202020   state->m_mc6850_clock = 0;
20212021   //removed from here because MACHINE_START can no longer read DIP swiches.
20222022   //put in MACHINE_RESET instead.
2023   //state->m_DFSType=  (input_port_read(machine, "BBCCONFIG")>>0)&0x07;
2024   //state->m_SWRAMtype=(input_port_read(machine, "BBCCONFIG")>>3)&0x03;
2025   //state->m_RAMSize=  (input_port_read(machine, "BBCCONFIG")>>5)&0x01;
2023   //state->m_DFSType=  (machine.root_device().ioport("BBCCONFIG")->read()>>0)&0x07;
2024   //state->m_SWRAMtype=(machine.root_device().ioport("BBCCONFIG")->read()>>3)&0x03;
2025   //state->m_RAMSize=  (machine.root_device().ioport("BBCCONFIG")->read()>>5)&0x01;
20262026
20272027   /*set up the required disc controller*/
20282028   //switch (state->m_DFSType) {
r15082r15083
20392039{
20402040   bbc_state *state = machine.driver_data<bbc_state>();
20412041   UINT8 *ram = state->memregion("maincpu")->base();
2042   state->m_DFSType=    (input_port_read(machine, "BBCCONFIG") >> 0) & 0x07;
2043   state->m_SWRAMtype = (input_port_read(machine, "BBCCONFIG") >> 3) & 0x03;
2044   state->m_RAMSize=    (input_port_read(machine, "BBCCONFIG") >> 5) & 0x01;
2042   state->m_DFSType=    (machine.root_device().ioport("BBCCONFIG")->read() >> 0) & 0x07;
2043   state->m_SWRAMtype = (machine.root_device().ioport("BBCCONFIG")->read() >> 3) & 0x03;
2044   state->m_RAMSize=    (machine.root_device().ioport("BBCCONFIG")->read() >> 5) & 0x01;
20452045
20462046   state->membank("bank1")->set_base(ram);
20472047   if (state->m_RAMSize)
src/mess/machine/kr2376.c
r15082r15083
163163
164164   static const char *const keynames[] = { "X0", "X1", "X2", "X3", "X4", "X5", "X6", "X7" };
165165
166   if (input_port_read(device->machine(), keynames[kr2376->ring8]) == (1 << kr2376->ring11))
166   if (device->machine().root_device().ioport(keynames[kr2376->ring8])->read() == (1 << kr2376->ring11))
167167   {
168      kr2376->modifiers = input_port_read(device->machine(), "MODIFIERS");
168      kr2376->modifiers = device->machine().root_device().ioport("MODIFIERS")->read();
169169
170170      kr2376->strobe = 1;
171171      /*  strobe 0->1 transition, encode char and update parity */
src/mess/machine/comxpl80.c
r15082r15083
241241   else
242242   {
243243      // read data from font ROM
244      int font_rom = (input_port_read(*this, "FONT") & 0x03) * 0x2000;
244      int font_rom = (ioport("FONT")->read() & 0x03) * 0x2000;
245245
246246      m_plotter_data = memregion("gfx2")->base()[font_rom | m_font_addr];
247247   }
r15082r15083
255255   if (BIT(data, 7))
256256   {
257257      // read switches
258      m_plotter_data = input_port_read(*this, "SW");
258      m_plotter_data = ioport("SW")->read();
259259   }
260260}
261261
src/mess/machine/hp48.c
r15082r15083
261261   int in = 0;
262262
263263   /* regular keys */
264   if ( (state->m_out >> 0) & 1 ) in |= input_port_read( machine, "LINE0" );
265   if ( (state->m_out >> 1) & 1 ) in |= input_port_read( machine, "LINE1" );
266   if ( (state->m_out >> 2) & 1 ) in |= input_port_read( machine, "LINE2" );
267   if ( (state->m_out >> 3) & 1 ) in |= input_port_read( machine, "LINE3" );
268   if ( (state->m_out >> 4) & 1 ) in |= input_port_read( machine, "LINE4" );
269   if ( (state->m_out >> 5) & 1 ) in |= input_port_read( machine, "LINE5" );
270   if ( (state->m_out >> 6) & 1 ) in |= input_port_read( machine, "LINE6" );
271   if ( (state->m_out >> 7) & 1 ) in |= input_port_read( machine, "LINE7" );
272   if ( (state->m_out >> 8) & 1 ) in |= input_port_read( machine, "LINE8" );
264   if ( (state->m_out >> 0) & 1 ) in |= machine.root_device().ioport( "LINE0" )->read();
265   if ( (state->m_out >> 1) & 1 ) in |= machine.root_device().ioport( "LINE1" )->read();
266   if ( (state->m_out >> 2) & 1 ) in |= machine.root_device().ioport( "LINE2" )->read();
267   if ( (state->m_out >> 3) & 1 ) in |= machine.root_device().ioport( "LINE3" )->read();
268   if ( (state->m_out >> 4) & 1 ) in |= machine.root_device().ioport( "LINE4" )->read();
269   if ( (state->m_out >> 5) & 1 ) in |= machine.root_device().ioport( "LINE5" )->read();
270   if ( (state->m_out >> 6) & 1 ) in |= machine.root_device().ioport( "LINE6" )->read();
271   if ( (state->m_out >> 7) & 1 ) in |= machine.root_device().ioport( "LINE7" )->read();
272   if ( (state->m_out >> 8) & 1 ) in |= machine.root_device().ioport( "LINE8" )->read();
273273
274274   /* on key */
275   in |= input_port_read( machine, "ON" );
275   in |= machine.root_device().ioport( "ON" )->read();
276276
277277   return in;
278278}
r15082r15083
309309{
310310   hp48_state *state = machine.driver_data<hp48_state>();
311311   /* NMI for ON key */
312   if ( input_port_read( machine, "ON" ) )
312   if ( machine.root_device().ioport( "ON" )->read() )
313313   {
314314      LOG(( "%f hp48_kbd_cb: keyboard interrupt, on key\n",
315315            machine.time().as_double() ));
r15082r15083
504504               bit 3: battery in port 2
505505               bit 2: battery in port 1
506506             */
507         switch ( input_port_read( space->machine(), "BATTERY" ) )
507         switch ( state->ioport( "BATTERY" )->read() )
508508         {
509509         case 1: data = 2; break; /* low */
510510         case 2: data = 3; break; /* low | critical */
src/mess/machine/wangpckb.c
r15082r15083
453453 
454454   switch (m_y & 0x0f)
455455   {
456      case 0: data &= input_port_read(*this, "Y0"); break;
457      case 1: data &= input_port_read(*this, "Y1"); break;
458      case 2: data &= input_port_read(*this, "Y2"); break;
459      case 3: data &= input_port_read(*this, "Y3"); break;
460      case 4: data &= input_port_read(*this, "Y4"); break;
461      case 5: data &= input_port_read(*this, "Y5"); break;
462      case 6: data &= input_port_read(*this, "Y6"); break;
463      case 7: data &= input_port_read(*this, "Y7"); break;
464      case 8: data &= input_port_read(*this, "Y8"); break;
465      case 9: data &= input_port_read(*this, "Y9"); break;
466      case 0xa: data &= input_port_read(*this, "YA"); break;
467      case 0xb: data &= input_port_read(*this, "YB"); break;
468      case 0xc: data &= input_port_read(*this, "YC"); break;
469      case 0xd: data &= input_port_read(*this, "YD"); break;
470      case 0xe: data &= input_port_read(*this, "YE"); break; // SW1?
471      case 0xf: data &= input_port_read(*this, "YF"); break; // SW2?
456      case 0: data &= ioport("Y0")->read(); break;
457      case 1: data &= ioport("Y1")->read(); break;
458      case 2: data &= ioport("Y2")->read(); break;
459      case 3: data &= ioport("Y3")->read(); break;
460      case 4: data &= ioport("Y4")->read(); break;
461      case 5: data &= ioport("Y5")->read(); break;
462      case 6: data &= ioport("Y6")->read(); break;
463      case 7: data &= ioport("Y7")->read(); break;
464      case 8: data &= ioport("Y8")->read(); break;
465      case 9: data &= ioport("Y9")->read(); break;
466      case 0xa: data &= ioport("YA")->read(); break;
467      case 0xb: data &= ioport("YB")->read(); break;
468      case 0xc: data &= ioport("YC")->read(); break;
469      case 0xd: data &= ioport("YD")->read(); break;
470      case 0xe: data &= ioport("YE")->read(); break; // SW1?
471      case 0xf: data &= ioport("YF")->read(); break; // SW2?
472472   }
473473 
474474   return data;
src/mess/machine/c65.c
r15082r15083
4545   device_t *cia_1 = machine.device("cia_1");
4646   int cia1irq = mos6526_irq_r(cia_1);
4747
48   if (state->m_nmilevel != (input_port_read(machine, "SPECIAL") & 0x80) || cia1irq)   /* KEY_RESTORE */
48   if (state->m_nmilevel != (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq)   /* KEY_RESTORE */
4949   {
50      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, (input_port_read(machine, "SPECIAL") & 0x80) || cia1irq);
50      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq);
5151
52      state->m_nmilevel = (input_port_read(machine, "SPECIAL") & 0x80) || cia1irq;
52      state->m_nmilevel = (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq;
5353   }
5454}
5555
r15082r15083
412412
413413   if (offset == 7)
414414   {
415      if (input_port_read(machine, "SPECIAL") & 0x20)
415      if (machine.root_device().ioport("SPECIAL")->read() & 0x20)
416416         data &= ~1;
417417   }
418418   DBG_LOG(machine, 2, "r6511 read", ("%.2x\n", offset));
r15082r15083
10651065   /* c65 specific: function keys input ports */
10661066   value = 0xff;
10671067
1068   value &= ~input_port_read(device->machine(), "FUNCT");
1068   value &= ~state->ioport("FUNCT")->read();
10691069   state->m_keyline = value;
10701070}
src/mess/machine/isa_ide.c
r15082r15083
9696
9797void isa16_ide_device::device_reset()
9898{
99   m_is_primary = (input_port_read(*this, "DSW") & 1) ? false : true;
99   m_is_primary = (ioport("DSW")->read() & 1) ? false : true;
100100   if (m_is_primary) {
101101      m_isa->install16_device(subdevice("ide"), 0x01f0, 0x01f7, 0, 0, FUNC(ide16_r), FUNC(ide16_w) );
102102   } else {
src/mess/machine/isa_ide_cd.c
r15082r15083
470470   astring tempstring;
471471   if (m_inserted_cdrom) SCSIDeleteInstance(m_inserted_cdrom);
472472   SCSIAllocInstance( machine(), &SCSIClassCr589, &m_inserted_cdrom, subtag(tempstring, "cdrom"));
473   m_is_primary = (input_port_read(*this, "DSW") & 1) ? false : true;
473   m_is_primary = (ioport("DSW")->read() & 1) ? false : true;
474474   if (m_is_primary) {
475475      m_isa->install16_device(0x01f0, 0x01f7, 0, 0, read16_delegate(FUNC(isa16_ide_cd_device::atapi_r), this), write16_delegate(FUNC(isa16_ide_cd_device::atapi_w), this));
476476      //m_isa->install16_device(0x03f0, 0x03f7, 0, 0, read16_delegate(FUNC(isa16_ide_cd_device::atapi_status_r), this), write16_delegate(FUNC(isa16_ide_cd_device::atapi_cmd_w), this));
src/mess/machine/ti99/gromport.c
r15082r15083
961961   if (m_type==PCB_GKRACKER)
962962   {
963963      cartridge_pcb_gramkracker_device* pcb = static_cast<cartridge_pcb_gramkracker_device*>(m_pcb);
964      pcb->m_gk_switch[1] = input_port_read(*owner(), GKSWITCH1_TAG);
965      pcb->m_gk_switch[2] = input_port_read(*owner(), GKSWITCH2_TAG);
966      pcb->m_gk_switch[3] = input_port_read(*owner(), GKSWITCH3_TAG);
967      pcb->m_gk_switch[4] = input_port_read(*owner(), GKSWITCH4_TAG);
968      pcb->m_gk_switch[5] = input_port_read(*owner(), GKSWITCH5_TAG);
964      pcb->m_gk_switch[1] = owner()->ioport(GKSWITCH1_TAG)->read();
965      pcb->m_gk_switch[2] = owner()->ioport(GKSWITCH2_TAG)->read();
966      pcb->m_gk_switch[3] = owner()->ioport(GKSWITCH3_TAG)->read();
967      pcb->m_gk_switch[4] = owner()->ioport(GKSWITCH4_TAG)->read();
968      pcb->m_gk_switch[5] = owner()->ioport(GKSWITCH5_TAG)->read();
969969   }
970970}
971971
r15082r15083
14301430   // source of confusion when the GRAMKracker is plugged in, but the switch
14311431   // is not set.
14321432   // The check for the presence of the GK using the index is safer.
1433   if ((m_gk_slot != -1) /*&& (input_port_read(*this, "CARTSLOT")==CART_GK) */)
1433   if ((m_gk_slot != -1) /*&& (ioport("CARTSLOT")==CART_GK) */)
14341434   {
14351435      m_cartridge[m_gk_slot]->readz(space, offset, value, mem_mask);
14361436      return;
r15082r15083
14681468WRITE8_MEMBER(gromport_device::write)
14691469{
14701470   // GRAMKracker support
1471   if ((m_gk_slot != -1) /*&& (input_port_read(*this, "CARTSLOT")==CART_GK)*/)
1471   if ((m_gk_slot != -1) /*&& (ioport("CARTSLOT")==CART_GK)*/)
14721472   {
14731473      m_cartridge[m_gk_slot]->write(space, offset, data, mem_mask);
14741474      return;
r15082r15083
15121512void gromport_device::crureadz(offs_t offset, UINT8 *value)
15131513{
15141514   // GRAMKracker support
1515   if ((m_gk_slot != -1) /* && (input_port_read(*this, "CARTSLOT")==CART_GK)*/)
1515   if ((m_gk_slot != -1) /* && (ioport("CARTSLOT")==CART_GK)*/)
15161516   {
15171517      m_cartridge[m_gk_slot]->crureadz(offset, value);
15181518      return;
r15082r15083
15331533void gromport_device::cruwrite(offs_t offset, UINT8 data)
15341534{
15351535   // GRAMKracker support
1536   if ((m_gk_slot != -1) /*&& (input_port_read(*this, "CARTSLOT")==CART_GK)*/)
1536   if ((m_gk_slot != -1) /*&& (ioport("CARTSLOT")==CART_GK)*/)
15371537   {
15381538      m_cartridge[m_gk_slot]->cruwrite(offset, data);
15391539      return;
r15082r15083
15861586void gromport_device::device_reset(void)
15871587{
15881588   m_active_slot = 0;
1589   m_fixed_slot = input_port_read(*this, "CARTSLOT") - 1;
1589   m_fixed_slot = ioport("CARTSLOT")->read() - 1;
15901590}
15911591
15921592INPUT_CHANGED_MEMBER( gromport_device::gk_changed )
r15082r15083
16091609      PORT_DIPSETTING(    0x0f, "GRAM Kracker" )
16101610
16111611   PORT_START( GKSWITCH1_TAG )
1612   PORT_DIPNAME( 0x01, 0x01, "GK switch 1" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f ) PORT_CHANGED_MEMBER(DEVICE_SELF, gromport_device, gk_changed, 1)
1612   PORT_DIPNAME( 0x01, 0x01, "GK switch 1" ) PORT_CONDITION( "CARTSLOT", 0x0f, EQUALS, 0x0f ) PORT_CHANGED_MEMBER(DEVICE_SELF, gromport_device, gk_changed, 1)
16131613      PORT_DIPSETTING(    0x00, "GK Off" )
16141614      PORT_DIPSETTING(    0x01, DEF_STR( Normal ) )
16151615
16161616   PORT_START( GKSWITCH2_TAG )
1617   PORT_DIPNAME( 0x01, 0x01, "GK switch 2" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f ) PORT_CHANGED_MEMBER(DEVICE_SELF, gromport_device, gk_changed, 2)
1617   PORT_DIPNAME( 0x01, 0x01, "GK switch 2" ) PORT_CONDITION( "CARTSLOT", 0x0f, EQUALS, 0x0f ) PORT_CHANGED_MEMBER(DEVICE_SELF, gromport_device, gk_changed, 2)
16181618      PORT_DIPSETTING(    0x00, "GRAM 0" )
16191619      PORT_DIPSETTING(    0x01, "Op Sys" )
16201620
16211621   PORT_START( GKSWITCH3_TAG )
1622   PORT_DIPNAME( 0x01, 0x01, "GK switch 3" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f ) PORT_CHANGED_MEMBER(DEVICE_SELF, gromport_device, gk_changed, 3)
1622   PORT_DIPNAME( 0x01, 0x01, "GK switch 3" ) PORT_CONDITION( "CARTSLOT", 0x0f, EQUALS, 0x0f ) PORT_CHANGED_MEMBER(DEVICE_SELF, gromport_device, gk_changed, 3)
16231623      PORT_DIPSETTING(    0x00, "GRAM 1-2" )
16241624      PORT_DIPSETTING(    0x01, "TI BASIC" )
16251625
16261626   PORT_START( GKSWITCH4_TAG )
1627   PORT_DIPNAME( 0x03, 0x01, "GK switch 4" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f ) PORT_CHANGED_MEMBER(DEVICE_SELF, gromport_device, gk_changed, 4)
1627   PORT_DIPNAME( 0x03, 0x01, "GK switch 4" ) PORT_CONDITION( "CARTSLOT", 0x0f, EQUALS, 0x0f ) PORT_CHANGED_MEMBER(DEVICE_SELF, gromport_device, gk_changed, 4)
16281628      PORT_DIPSETTING(    0x00, "Bank 1" )
16291629      PORT_DIPSETTING(    0x01, "W/P" )
16301630      PORT_DIPSETTING(    0x02, "Bank 2" )
16311631
16321632   PORT_START( GKSWITCH5_TAG )
1633   PORT_DIPNAME( 0x01, 0x00, "GK switch 5" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f ) PORT_CHANGED_MEMBER(DEVICE_SELF, gromport_device, gk_changed, 5)
1633   PORT_DIPNAME( 0x01, 0x00, "GK switch 5" ) PORT_CONDITION( "CARTSLOT", 0x0f, EQUALS, 0x0f ) PORT_CHANGED_MEMBER(DEVICE_SELF, gromport_device, gk_changed, 5)
16341634      PORT_DIPSETTING(    0x00, "Loader On" )
16351635      PORT_DIPSETTING(    0x01, "Loader Off" )
16361636INPUT_PORTS_END
src/mess/machine/ti99/hsgpl.c
r15082r15083
576576   m_led_on = false;
577577   m_mbx_enabled = false;
578578   m_ram_enabled = false;
579   m_flash_mode = (input_port_read(*this, "HSGPLMODE")==0);
579   m_flash_mode = (ioport("HSGPLMODE")->read()==0);
580580
581581   m_current_grom_port = 0;
582582   m_current_bank = 0;
src/mess/machine/ti99/genboard.c
r15082r15083
851851
852852   m_genmod = false;
853853
854   if (input_port_read(machine(), "MODE")==0)
854   if (ioport("MODE")->read()==0)
855855   {
856      switch (input_port_read(machine(), "BOOTROM"))
856      switch (ioport("BOOTROM")->read())
857857      {
858858      case GENEVE_098:
859859         if (VERBOSE>0) LOG("geneve: Using 0.98 boot eprom\n");
r15082r15083
874874         fatalerror("genboard: GenMod boot rom missing.\n");
875875      }
876876      m_genmod = true;
877      m_turbo = ((input_port_read(machine(), "GENMODDIPS") & GM_TURBO)!=0);
878      m_timode = ((input_port_read(machine(), "GENMODDIPS") & GM_TIM)!=0);
877      m_turbo = ((ioport("GENMODDIPS")->read() & GM_TURBO)!=0);
878      m_timode = ((ioport("GENMODDIPS")->read() & GM_TIM)!=0);
879879   }
880880
881   switch (input_port_read(machine(), "SRAM"))
881   switch (ioport("SRAM")->read())
882882   {
883883/*  1 100. .... .... .... .... on-board sram (128K) -+
884884    1 101. .... .... .... .... on-board sram (128K) -+-- maximum SRAM expansion
r15082r15083
968968   /* Poll keyboard */
969969   for (i = 0; (i < 4) && (m_key_queue_length <= (KEYQUEUESIZE-MAXKEYMSGLENGTH)); i++)
970970   {
971      keystate = input_port_read(*this, KEYNAMES[2*i]) | (input_port_read(*this, KEYNAMES[2*i + 1]) << 16);
971      keystate = ioport(KEYNAMES[2*i])->read() | (ioport(KEYNAMES[2*i + 1])->read() << 16);
972972      key_transitions = keystate ^ m_key_state_save[i];
973973      if (key_transitions)
974974      {
r15082r15083
14011401
14021402line_state geneve_mouse_device::left_button()
14031403{
1404   return ((input_port_read(*this, "MOUSE0") & 0x04)!=0)? ASSERT_LINE : CLEAR_LINE;
1404   return ((ioport("MOUSE0")->read() & 0x04)!=0)? ASSERT_LINE : CLEAR_LINE;
14051405}
14061406
14071407void geneve_mouse_device::poll()
r15082r15083
14091409   int new_mx, new_my;
14101410   int delta_x, delta_y, buttons;
14111411
1412   buttons = input_port_read(*this, "MOUSE0");
1413   new_mx = input_port_read(*this, "MOUSEX");
1414   new_my = input_port_read(*this, "MOUSEY");
1412   buttons = ioport("MOUSE0")->read();
1413   new_mx = ioport("MOUSEX")->read();
1414   new_my = ioport("MOUSEY")->read();
14151415
14161416   /* compute x delta */
14171417   delta_x = new_mx - m_last_mx;
src/mess/machine/ti99/p_code.c
r15082r15083
266266   m_bank_select = 1;
267267   m_selected = false;
268268
269   m_switch = input_port_read(*this, ACTIVE_TAG);
269   m_switch = ioport(ACTIVE_TAG)->read();
270270}
271271
272272void ti_pcode_card_device::device_config_complete()
src/mess/machine/ti99/tn_usbsm.c
r15082r15083
291291   }
292292   m_selected = false;
293293
294   m_cru_base = input_port_read(*this, "CRUUSBSM");
294   m_cru_base = ioport("CRUUSBSM")->read();
295295}
296296
297297ROM_START( tn_usbsm )
src/mess/machine/ti99/evpc.c
r15082r15083
242242   {
243243      if ((offset & 0x00f0)==0) // offset 0 delivers bits 0-7 (address 00-0f)
244244      {
245         *value = ~(input_port_read(*this, "EVPC-SW1") | (input_port_read(*this, "EVPC-SW3")<<2)
246            | (input_port_read(*this, "EVPC-SW4")<<3) | (input_port_read(*this, "EVPC-SW8")<<7));
245         *value = ~(ioport("EVPC-SW1")->read() | (ioport("EVPC-SW3")->read()<<2)
246            | (ioport("EVPC-SW4")->read()<<3) | (ioport("EVPC-SW8")->read()<<7));
247247      }
248248   }
249249}
r15082r15083
334334*/
335335INPUT_PORTS_START( ti99_evpc )
336336   PORT_START( "EVPC-SW1" )
337   PORT_DIPNAME( 0x01, 0x00, "EVPC video mode" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 )
337   PORT_DIPNAME( 0x01, 0x00, "EVPC video mode" ) PORT_CONDITION( "EVPC-SW8", 0x01, EQUALS, 0x00 )
338338      PORT_DIPSETTING(    0x00, "PAL" )
339339      PORT_DIPSETTING(    0x01, "NTSC" )
340340
341341   PORT_START( "EVPC-SW3" )
342   PORT_DIPNAME( 0x01, 0x00, "EVPC charset" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 )
342   PORT_DIPNAME( 0x01, 0x00, "EVPC charset" ) PORT_CONDITION( "EVPC-SW8", 0x01, EQUALS, 0x00 )
343343      PORT_DIPSETTING(    0x00, DEF_STR( International ))
344344      PORT_DIPSETTING(    0x01, DEF_STR( German ))
345345
346346   PORT_START( "EVPC-SW4" )
347   PORT_DIPNAME( 0x01, 0x00, "EVPC VDP RAM" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 )
347   PORT_DIPNAME( 0x01, 0x00, "EVPC VDP RAM" ) PORT_CONDITION( "EVPC-SW8", 0x01, EQUALS, 0x00 )
348348      PORT_DIPSETTING(    0x00, "shifted" )
349349      PORT_DIPSETTING(    0x01, "not shifted" )
350350
src/mess/machine/ti99/tn_ide.c
r15082r15083
323323   }
324324   m_selected = false;
325325
326   m_cru_base = input_port_read(*this, "CRUIDE");
326   m_cru_base = ioport("CRUIDE")->read();
327327   m_clk_irq = false;
328328
329329   m_tms9995_mode =  false; // (device->type()==TMS9995);
src/mess/machine/ti99/datamux.c
r15082r15083
254254   m_space = m_cpu->memory().space(AS_PROGRAM);
255255
256256   m_devices.reset(); // clear the list
257   m_use32k = (input_port_read(machine(), "RAM")==1)? TRUE : FALSE;
257   m_use32k = (ioport("RAM")->read()==1)? TRUE : FALSE;
258258
259259   // better use a region?
260260   if (m_ram16b==NULL) m_ram16b = (UINT16*)malloc(32768);
r15082r15083
278278            bool active_device = true;
279279            if (list[i].setting!=NULL)
280280            {
281               set = input_port_read(machine(), list[i].setting);
281               set = ioport(list[i].setting)->read();
282282               active_device = ((set & list[i].set)==list[i].set) && ((set & list[i].unset)==0);
283283            }
284284            if (active_device)
src/mess/machine/ti99/hfdc.c
r15082r15083
174174            // MZ: 00 should not be used since there is a bug in the
175175            // DSR of the HFDC which causes problems with SD disks
176176            // (controller tries DD and then fails to fall back to SD) */
177            reply = ~(input_port_read(*this, "HFDCDIP"));
177            reply = ~(ioport("HFDCDIP")->read());
178178         }
179179         else
180180         {
r15082r15083
520520      m_select_value = 0x74000;
521521   }
522522
523   m_cru_base = input_port_read(*this, "CRUHFDC");
523   m_cru_base = ioport("CRUHFDC")->read();
524524
525525   // Resetting values
526526   m_rom_page = 0;
r15082r15083
545545   m_harddisk_unit[1] = m_slot->get_drive(MFMHD_1);
546546   m_harddisk_unit[2] = m_slot->get_drive(MFMHD_2);
547547
548   if (input_port_read(*this, "HFDCDIP")&0x55)
548   if (ioport("HFDCDIP")->read()&0x55)
549549      ti99_set_80_track_drives(TRUE);
550550   else
551551      ti99_set_80_track_drives(FALSE);
552552
553   m_hdc9234->set_timing(input_port_read(*this, "DRVSPD")!=0);
553   m_hdc9234->set_timing(ioport("DRVSPD")->read()!=0);
554554
555555   floppy_type_t floptype = FLOPPY_STANDARD_5_25_DSHD;
556556   // Again, need to re-adjust the floppy geometries
src/mess/machine/ti99/ti_rs232.c
r15082r15083
517517UINT8 ti_rs232_pio_device::map_lines_out(int uartind, UINT8 value)
518518{
519519   UINT8 ret = 0;
520   int mapping = input_port_read(*this, "SERIALMAP");
520   int mapping = ioport("SERIALMAP")->read();
521521
522522   //    00ab cdef = setting line RTS=a, CTS=b, DSR=c, DCD=d, DTR=e, RI=f
523523
r15082r15083
589589UINT8 ti_rs232_pio_device::map_lines_in(int uartind, UINT8 value)
590590{
591591   UINT8 ret = 0;
592   int mapping = input_port_read(*this, "SERIALMAP");
592   int mapping = ioport("SERIALMAP")->read();
593593
594594   //    00ab cdef = setting line RTS=a, CTS=b, DSR=c, DCD=d, DTR=e, RI=f
595595
r15082r15083
10621062   m_space = machine().device("maincpu")->memory().space(AS_IO);
10631063   m_selected = false;
10641064
1065   m_cru_base = (input_port_read(*this, "CRURS232")==0)? 0x1300 : 0x1500;
1065   m_cru_base = (ioport("CRURS232")->read()==0)? 0x1300 : 0x1500;
10661066
10671067   m_time_hold[0] = m_time_hold[1] = 0.0;
10681068
r15082r15083
10701070      // All peripheral cards need to be manually modified to properly decode
10711071      // the wider address. The next lines perform this soldering job
10721072      // automagically.
1073      /* if (input_port_read(device->machine(), "MODE")==GENMOD)
1073      /* if (device->machine().root_device().ioport("MODE")->read()==GENMOD)
10741074        {
10751075            // GenMod card modification
10761076            card->select_mask = 0x1fe000;
src/mess/machine/ti99/myarcmem.c
r15082r15083
189189void myarc_memory_expansion_device::device_reset()
190190{
191191   if (VERBOSE>5) LOG("myarc memexp: reset\n");
192   m_size = input_port_read(*this, "SIZE");
192   m_size = ioport("SIZE")->read();
193193
194194   // Resetting values
195195   m_bank = 0;
src/mess/machine/ti99/memex.c
r15082r15083
120120
121121void geneve_memex_device::device_reset()
122122{
123   UINT8 dips = input_port_read(*this, "MEMEXDIPS");
123   UINT8 dips = ioport("MEMEXDIPS")->read();
124124   if (VERBOSE>5) LOG("geneve: memex dips = %02x\n", dips);
125125   for (int i=0; i < 8; i++)
126126   {
src/mess/machine/ti99/mecmouse.c
r15082r15083
107107   int new_mx, new_my;
108108   int delta_x, delta_y;
109109
110   new_mx = input_port_read(machine(), "MOUSEX");
111   new_my = input_port_read(machine(), "MOUSEY");
110   new_mx = ioport("MOUSEX")->read();
111   new_my = ioport("MOUSEY")->read();
112112
113113   /* compute x delta */
114114   delta_x = new_mx - m_last_mx;
r15082r15083
145145int mecmouse_device::get_values()
146146{
147147   int answer;
148   int buttons = input_port_read(machine(), "MOUSE0") & 3;
148   int buttons = ioport("MOUSE0")->read() & 3;
149149   answer = (m_read_y ? m_y_buf : m_x_buf) << 4;
150150
151151   if ((buttons & 1)==0)
r15082r15083
163163int mecmouse_device::get_values8(int mode)
164164{
165165   int answer;
166   int buttons = input_port_read(machine(), "MOUSE0") & 3;
166   int buttons = ioport("MOUSE0")->read() & 3;
167167
168168   if (mode == 0)
169169   {
src/mess/machine/ti99/bwg.c
r15082r15083
417417   m_rtc_enabled = false;
418418   m_selected = false;
419419
420   m_dip1 = input_port_read(*this, "BWGDIP1");
421   m_dip2 = input_port_read(*this, "BWGDIP2");
422   m_dip34 = input_port_read(*this, "BWGDIP34");
420   m_dip1 = ioport("BWGDIP1")->read();
421   m_dip2 = ioport("BWGDIP2")->read();
422   m_dip34 = ioport("BWGDIP34")->read();
423423
424424   m_rom_page = 0;
425425   m_ram_page = 0;
src/mess/machine/ti99/handset.c
r15082r15083
132132   int i;
133133
134134   /* read current key state */
135   key_buf = (input_port_read(machine(), keynames[num]) | (input_port_read(machine(), keynames[num + 1]) << 16) ) >> (4*num);
135   key_buf = (ioport(keynames[num])->read() | (ioport(keynames[num + 1])->read() << 16) ) >> (4*num);
136136
137137   // If a key was previously pressed, this key was not shift, and this key is
138138   // still down, then don't change the current key press.
r15082r15083
203203   int current_joy_x, current_joy_y;
204204   int message;
205205   /* read joystick position */
206   current_joy_x = input_port_read(machine(), joynames[0][num]);
207   current_joy_y = input_port_read(machine(), joynames[1][num]);
206   current_joy_x = ioport(joynames[0][num])->read();
207   current_joy_y = ioport(joynames[1][num])->read();
208208
209209   /* compare with last saved position */
210210   current_joy = current_joy_x | (current_joy_y << 4);
src/mess/machine/ti99/horizon.c
r15082r15083
7676 
7777int horizon_ramdisk_device::get_size()
7878{
79   int size = 8192 + 2097152*(1 << input_port_read(*this, "HORIZONSIZE"));
79   int size = 8192 + 2097152*(1 << ioport("HORIZONSIZE")->read());
8080   if (VERBOSE>2) LOG("horizon: size = %d\n", size);
8181   return size;
8282}
r15082r15083
263263 
264264void horizon_ramdisk_device::cruwrite(offs_t offset, UINT8 data)
265265{
266   int size = input_port_read(*this, "HORIZONSIZE");
266   int size = ioport("HORIZONSIZE")->read();
267267   int split_bit = size + 10;
268268   int splitpagebit = 0x0200 << size;
269269 
r15082r15083
356356   }
357357 
358358   m_ros = m_nvram + get_size()-8192;
359   m_cru_horizon = input_port_read(*this, "CRUHOR");
360   m_cru_phoenix = input_port_read(*this, "CRUPHOE");
359   m_cru_horizon = ioport("CRUHOR")->read();
360   m_cru_phoenix = ioport("CRUPHOE")->read();
361361 
362   m_32k_installed = (input_port_read(*this, "HORIZON32")!=0);
362   m_32k_installed = (ioport("HORIZON32")->read()!=0);
363363 
364   m_split_mode = (input_port_read(*this, "HORIZONDUAL")!=0);
365   m_timode = (input_port_read(*this, "HORIZONDUAL")==1);
364   m_split_mode = (ioport("HORIZONDUAL")->read()!=0);
365   m_timode = (ioport("HORIZONDUAL")->read()==1);
366366 
367367   m_rambo_mode = false;
368   m_killswitch = (input_port_read(*this, "HORIZONACT")!=0);
368   m_killswitch = (ioport("HORIZONACT")->read()!=0);
369369 
370   m_use_rambo = (input_port_read(*this, "RAMBO")!=0);
370   m_use_rambo = (ioport("RAMBO")->read()!=0);
371371 
372372   m_page = 0;
373373}
src/mess/machine/coco.c
r15082r15083
721721{
722722   assert((index == 0) || (index == 1));
723723   return (m_joystick_type_control != NULL)
724      ? (joystick_type_t) ((input_port_read_direct(m_joystick_type_control) >> (index * 4)) & 0x0F)
724      ? (joystick_type_t) ((m_joystick_type_control->read() >> (index * 4)) & 0x0F)
725725      : JOYSTICK_NONE;
726726}
727727
r15082r15083
734734coco_state::hires_type_t coco_state::hires_interface_type(void)
735735{
736736   return (m_joystick_hires_control != NULL)
737      ? (hires_type_t) input_port_read_direct(m_joystick_hires_control)
737      ? (hires_type_t) m_joystick_hires_control->read()
738738      : HIRES_NONE;
739739}
740740
r15082r15083
865865   /* poll the keyboard, and update PA6-PA0 accordingly*/
866866   for (int i = 0; i < sizeof(m_keyboard) / sizeof(m_keyboard[0]); i++)
867867   {
868      input_port_value value = input_port_read_direct(m_keyboard[i]);
868      int value = m_keyboard[i]->read();
869869      if ((value | pia0_pb) != 0xFF)
870870      {
871871         pia0_pa &= ~(0x01 << i);
src/mess/machine/s100_dj2db.c
r15082r15083
8282{
8383   if (state) m_s100->rdy_w(CLEAR_LINE);
8484
85   switch (input_port_read(*this, "J1A"))
85   switch (ioport("J1A")->read())
8686   {
8787   case 0: m_s100->vi0_w(state); break;
8888   case 1: m_s100->vi1_w(state); break;
r15082r15083
137137
138138static INPUT_PORTS_START( dj2db )
139139   PORT_START("SW1")
140   PORT_DIPNAME( 0xf8, 0xf8, "Power-On Jump Address" ) PORT_DIPLOCATION("SW1:1,2,3,4,5") PORT_CONDITION("SW1", 0x01, PORTCOND_EQUALS, 0x00)
140   PORT_DIPNAME( 0xf8, 0xf8, "Power-On Jump Address" ) PORT_DIPLOCATION("SW1:1,2,3,4,5") PORT_CONDITION("SW1", 0x01, EQUALS, 0x00)
141141   PORT_DIPSETTING(    0xf8, "F800H" )
142142   PORT_DIPSETTING(    0xf0, "F000H" )
143143   PORT_DIPSETTING(    0xe8, "E800H" )
r15082r15083
192192   PORT_DIPNAME( 0x20, 0x20, "Stop Bit Count" ) PORT_DIPLOCATION("SW2:6")
193193   PORT_DIPSETTING(    0x20, "2 Stop Bits" )
194194   PORT_DIPSETTING(    0x00, "1 Stop Bit" )
195   PORT_DIPNAME( 0x40, 0x40, "Parity" ) PORT_DIPLOCATION("SW2:7") PORT_CONDITION("SW2", 0x80, PORTCOND_EQUALS, 0x00)
195   PORT_DIPNAME( 0x40, 0x40, "Parity" ) PORT_DIPLOCATION("SW2:7") PORT_CONDITION("SW2", 0x80, EQUALS, 0x00)
196196   PORT_DIPSETTING(    0x40, "Even Parity" )
197197   PORT_DIPSETTING(    0x00, "Odd Parity" )
198198   PORT_DIPNAME( 0x80, 0x80, "Parity" ) PORT_DIPLOCATION("SW2:8")
r15082r15083
296296
297297void s100_dj2db_device::device_reset()
298298{
299   m_board_enbl = input_port_read(*this, "J4");
299   m_board_enbl = ioport("J4")->read();
300300}
301301
302302
r15082r15083
486486{
487487   if (offset == 0x41)
488488   {
489      m_board_enbl = (data & input_port_read(*this, "J3A")) ? 1 : 0;
489      m_board_enbl = (data & ioport("J3A")->read()) ? 1 : 0;
490490   }
491491}
492492
r15082r15083
497497
498498void s100_dj2db_device::s100_phantom_w(int state)
499499{
500   if (!BIT(input_port_read(*this, "SW1"), 2))
500   if (!BIT(ioport("SW1")->read(), 2))
501501   {
502502      m_phantom = state;
503503   }
src/mess/machine/gb.c
r15082r15083
789789   case 0x00:                  /* JOYP - Joypad */
790790      JOYPAD = 0xCF | data;
791791      if (!(data & 0x20))
792         JOYPAD &= (input_port_read(machine(), "INPUTS") >> 4) | 0xF0;
792         JOYPAD &= (ioport("INPUTS")->read() >> 4) | 0xF0;
793793      if (!(data & 0x10))
794         JOYPAD &= input_port_read(machine(), "INPUTS") | 0xF0;
794         JOYPAD &= ioport("INPUTS")->read() | 0xF0;
795795      return;
796796   case 0x01:                  /* SB - Serial transfer data */
797797      break;
r15082r15083
914914            m_sgb_bitcount = 0;
915915            m_sgb_start = 1;
916916            m_sgb_rest = 0;
917            JOYPAD = 0x0F & ((input_port_read(machine(), "INPUTS") >> 4) | input_port_read(machine(), "INPUTS") | 0xF0);
917            JOYPAD = 0x0F & ((ioport("INPUTS")->read() >> 4) | ioport("INPUTS")->read() | 0xF0);
918918            break;
919919         case 0x10:               /* data true */
920920            if (m_sgb_rest)
r15082r15083
938938               }
939939               m_sgb_rest = 0;
940940            }
941            JOYPAD = 0x1F & ((input_port_read(machine(), "INPUTS") >> 4) | 0xF0);
941            JOYPAD = 0x1F & ((ioport("INPUTS")->read() >> 4) | 0xF0);
942942            break;
943943         case 0x20:            /* data false */
944944            if (m_sgb_rest)
r15082r15083
13651365               }
13661366               m_sgb_rest = 0;
13671367            }
1368            JOYPAD = 0x2F & (input_port_read(machine(), "INPUTS") | 0xF0);
1368            JOYPAD = 0x2F & (ioport("INPUTS")->read() | 0xF0);
13691369            break;
13701370         case 0x30:               /* rest condition */
13711371            if (m_sgb_start)
src/mess/machine/c64_sw8k.c
r15082r15083
9494 
9595void c64_switchable_8k_cartridge_device::device_reset()
9696{
97   m_bank = input_port_read(*this, "SW");
97   m_bank = ioport("SW")->read();
9898}
9999 
100100 
src/mess/machine/radio86.c
r15082r15083
4747{
4848   radio86_state *state = device->machine().driver_data<radio86_state>();
4949   UINT8 key = 0xff;
50   if ((state->m_keyboard_mask & 0x01)!=0) { key &= input_port_read(device->machine(),"LINE0"); }
51   if ((state->m_keyboard_mask & 0x02)!=0) { key &= input_port_read(device->machine(),"LINE1"); }
52   if ((state->m_keyboard_mask & 0x04)!=0) { key &= input_port_read(device->machine(),"LINE2"); }
53   if ((state->m_keyboard_mask & 0x08)!=0) { key &= input_port_read(device->machine(),"LINE3"); }
54   if ((state->m_keyboard_mask & 0x10)!=0) { key &= input_port_read(device->machine(),"LINE4"); }
55   if ((state->m_keyboard_mask & 0x20)!=0) { key &= input_port_read(device->machine(),"LINE5"); }
56   if ((state->m_keyboard_mask & 0x40)!=0) { key &= input_port_read(device->machine(),"LINE6"); }
57   if ((state->m_keyboard_mask & 0x80)!=0) { key &= input_port_read(device->machine(),"LINE7"); }
50   if ((state->m_keyboard_mask & 0x01)!=0) { key &= state->ioport("LINE0")->read(); }
51   if ((state->m_keyboard_mask & 0x02)!=0) { key &= device->machine().root_device().ioport("LINE1")->read(); }
52   if ((state->m_keyboard_mask & 0x04)!=0) { key &= device->machine().root_device().ioport("LINE2")->read(); }
53   if ((state->m_keyboard_mask & 0x08)!=0) { key &= device->machine().root_device().ioport("LINE3")->read(); }
54   if ((state->m_keyboard_mask & 0x10)!=0) { key &= device->machine().root_device().ioport("LINE4")->read(); }
55   if ((state->m_keyboard_mask & 0x20)!=0) { key &= device->machine().root_device().ioport("LINE5")->read(); }
56   if ((state->m_keyboard_mask & 0x40)!=0) { key &= device->machine().root_device().ioport("LINE6")->read(); }
57   if ((state->m_keyboard_mask & 0x80)!=0) { key &= device->machine().root_device().ioport("LINE7")->read(); }
5858   return key;
5959}
6060
r15082r15083
6262{
6363   radio86_state *state = device->machine().driver_data<radio86_state>();
6464   double level = (device->machine().device<cassette_image_device>(CASSETTE_TAG)->input());
65   UINT8 dat = input_port_read(device->machine(), "LINE8");
65   UINT8 dat = state->ioport("LINE8")->read();
6666   if (level <  0) {
6767      dat ^= state->m_tape_value;
6868   }
r15082r15083
108108   radio86_state *state = device->machine().driver_data<radio86_state>();
109109   double level = (device->machine().device<cassette_image_device>(CASSETTE_TAG)->input());
110110   UINT8 key = 0xff;
111   if ((state->m_keyboard_mask & 0x01)!=0) { key &= input_port_read(device->machine(),"CLINE0"); }
112   if ((state->m_keyboard_mask & 0x02)!=0) { key &= input_port_read(device->machine(),"CLINE1"); }
113   if ((state->m_keyboard_mask & 0x04)!=0) { key &= input_port_read(device->machine(),"CLINE2"); }
114   if ((state->m_keyboard_mask & 0x08)!=0) { key &= input_port_read(device->machine(),"CLINE3"); }
115   if ((state->m_keyboard_mask & 0x10)!=0) { key &= input_port_read(device->machine(),"CLINE4"); }
116   if ((state->m_keyboard_mask & 0x20)!=0) { key &= input_port_read(device->machine(),"CLINE5"); }
117   if ((state->m_keyboard_mask & 0x40)!=0) { key &= input_port_read(device->machine(),"CLINE6"); }
118   if ((state->m_keyboard_mask & 0x80)!=0) { key &= input_port_read(device->machine(),"CLINE7"); }
111   if ((state->m_keyboard_mask & 0x01)!=0) { key &= state->ioport("CLINE0")->read(); }
112   if ((state->m_keyboard_mask & 0x02)!=0) { key &= device->machine().root_device().ioport("CLINE1")->read(); }
113   if ((state->m_keyboard_mask & 0x04)!=0) { key &= device->machine().root_device().ioport("CLINE2")->read(); }
114   if ((state->m_keyboard_mask & 0x08)!=0) { key &= device->machine().root_device().ioport("CLINE3")->read(); }
115   if ((state->m_keyboard_mask & 0x10)!=0) { key &= device->machine().root_device().ioport("CLINE4")->read(); }
116   if ((state->m_keyboard_mask & 0x20)!=0) { key &= device->machine().root_device().ioport("CLINE5")->read(); }
117   if ((state->m_keyboard_mask & 0x40)!=0) { key &= device->machine().root_device().ioport("CLINE6")->read(); }
118   if ((state->m_keyboard_mask & 0x80)!=0) { key &= device->machine().root_device().ioport("CLINE7")->read(); }
119119   key &= 0xe0;
120120   if (level <  0) {
121121      key ^= state->m_tape_value;
src/mess/machine/advision.c
r15082r15083
163163READ8_MEMBER( advision_state::controller_r )
164164{
165165   // Get joystick switches
166   UINT8 in = input_port_read(machine(), "joystick");
166   UINT8 in = ioport("joystick")->read();
167167   UINT8 data = in | 0x0f;
168168
169169   // Get buttons
src/mess/machine/b2m.c
r15082r15083
2323{
2424   UINT8 key = 0x00;
2525   if (offset < 0x100) {
26      if ((offset & 0x01)!=0) { key |= input_port_read(machine(),"LINE0"); }
27      if ((offset & 0x02)!=0) { key |= input_port_read(machine(),"LINE1"); }
28      if ((offset & 0x04)!=0) { key |= input_port_read(machine(),"LINE2"); }
29      if ((offset & 0x08)!=0) { key |= input_port_read(machine(),"LINE3"); }
30      if ((offset & 0x10)!=0) { key |= input_port_read(machine(),"LINE4"); }
31      if ((offset & 0x20)!=0) { key |= input_port_read(machine(),"LINE5"); }
32      if ((offset & 0x40)!=0) { key |= input_port_read(machine(),"LINE6"); }
33      if ((offset & 0x80)!=0) { key |= input_port_read(machine(),"LINE7"); }
26      if ((offset & 0x01)!=0) { key |= ioport("LINE0")->read(); }
27      if ((offset & 0x02)!=0) { key |= ioport("LINE1")->read(); }
28      if ((offset & 0x04)!=0) { key |= ioport("LINE2")->read(); }
29      if ((offset & 0x08)!=0) { key |= ioport("LINE3")->read(); }
30      if ((offset & 0x10)!=0) { key |= ioport("LINE4")->read(); }
31      if ((offset & 0x20)!=0) { key |= ioport("LINE5")->read(); }
32      if ((offset & 0x40)!=0) { key |= ioport("LINE6")->read(); }
33      if ((offset & 0x80)!=0) { key |= ioport("LINE7")->read(); }
3434   } else {
35      if ((offset & 0x01)!=0) { key |= input_port_read(machine(),"LINE8"); }
36      if ((offset & 0x02)!=0) { key |= input_port_read(machine(),"LINE9"); }
37      if ((offset & 0x04)!=0) { key |= input_port_read(machine(),"LINE10"); }
35      if ((offset & 0x01)!=0) { key |= ioport("LINE8")->read(); }
36      if ((offset & 0x02)!=0) { key |= ioport("LINE9")->read(); }
37      if ((offset & 0x04)!=0) { key |= ioport("LINE10")->read(); }
3838   }
3939   return key;
4040}
r15082r15083
294294
295295   m_b2m_color[offset & 3] = data;
296296
297   if (input_port_read(machine(),"MONITOR")==1) {
297   if (ioport("MONITOR")->read()==1) {
298298      palette_set_color_rgb(machine(),offset, r, g, b);
299299   } else {
300300      palette_set_color_rgb(machine(),offset, bw, bw, bw);
src/mess/machine/aim65.c
r15082r15083
120120   for (row = 0; row < 8; row++)
121121   {
122122      if (!BIT(m_riot_port_a, row))
123         data &= input_port_read(machine(), keynames[row]);
123         data &= ioport(keynames[row])->read();
124124   }
125125
126126   return data;
r15082r15083
212212    d3 = kb/tty switch
213213*/
214214
215   UINT8 data = input_port_read(machine(), "switches");
215   UINT8 data = ioport("switches")->read();
216216   data |= (m_cass1->input() > +0.03) ? 0x80 : 0;
217217   data |= 0x40; // TTY must be H if not used.
218218   data |= m_pb_save & 0x37;
src/mess/machine/kc_d002.c
r15082r15083
165165   {
166166      UINT8 slot_id = (offset>>8) & 0xff;
167167
168      if ((slot_id & 0xf0) == input_port_read(*this, "ID") && !(slot_id & 0x03))
168      if ((slot_id & 0xf0) == ioport("ID")->read() && !(slot_id & 0x03))
169169         data = m_expansions[(slot_id>>2) & 3]->module_id_r();
170170      else
171171         m_expansions[4]->io_read(offset, data);
r15082r15083
187187   {
188188      UINT8 slot_id = (offset>>8) & 0xff;
189189
190      if ((slot_id & 0xf0) == input_port_read(*this, "ID") && !(slot_id & 0x03))
190      if ((slot_id & 0xf0) == ioport("ID")->read() && !(slot_id & 0x03))
191191         m_expansions[(slot_id>>2) & 3]->control_w(data);
192192      else
193193         m_expansions[4]->io_write(offset, data);
src/mess/machine/thomson.c
r15082r15083
519519
520520static READ8_DEVICE_HANDLER ( to7_timer_port_in )
521521{
522   int lightpen = (input_port_read(device->machine(), "lightpen_button") & 1) ? 2 : 0;
522   int lightpen = (device->machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0;
523523   int cass = to7_get_cassette(device->machine()) ? 0x80 : 0;
524524   return lightpen | cass;
525525}
r15082r15083
626626      for ( i = 0; i < 8; i++ )
627627      {
628628         if ( ! (keyline & (1 << i)) )
629            val &= input_port_read(device->machine(), keynames[i]);
629            val &= device->machine().root_device().ioport(keynames[i])->read();
630630      }
631631      return val;
632632   }
r15082r15083
932932
933933READ8_HANDLER ( to7_modem_mea8000_r )
934934{
935   if ( input_port_read(space->machine(), "mconfig") & 1 )
935   if ( space->machine().root_device().ioport("mconfig")->read() & 1 )
936936   {
937937      device_t* device = space->machine().device("mea8000" );
938938      return mea8000_r( device, offset );
r15082r15083
952952
953953WRITE8_HANDLER ( to7_modem_mea8000_w )
954954{
955   if ( input_port_read(space->machine(), "mconfig") & 1 )
955   if ( space->machine().root_device().ioport("mconfig")->read() & 1 )
956956   {
957957      device_t* device = space->machine().device("mea8000" );
958958      mea8000_w( device, offset, data );
r15082r15083
10041004static UINT8 to7_get_mouse_signal( running_machine &machine )
10051005{
10061006   UINT8 xa, xb, ya, yb;
1007   UINT16 dx = input_port_read(machine, "mouse_x"); /* x axis */
1008   UINT16 dy = input_port_read(machine, "mouse_y"); /* y axis */
1007   UINT16 dx = machine.root_device().ioport("mouse_x")->read(); /* x axis */
1008   UINT16 dy = machine.root_device().ioport("mouse_y")->read(); /* y axis */
10091009   xa = ((dx + 1) & 3) <= 1;
10101010   xb = (dx & 3) <= 1;
10111011   ya = ((dy + 1) & 3) <= 1;
r15082r15083
10251025static READ8_DEVICE_HANDLER ( to7_game_porta_in )
10261026{
10271027   UINT8 data;
1028   if ( input_port_read(device->machine(), "config") & 1 )
1028   if ( device->machine().root_device().ioport("config")->read() & 1 )
10291029   {
10301030      /* mouse */
10311031      data = to7_get_mouse_signal(device->machine()) & 0x0c;             /* XB, YB */
1032      data |= input_port_read(device->machine(), "mouse_button") & 3; /* buttons */
1032      data |= device->machine().root_device().ioport("mouse_button")->read() & 3; /* buttons */
10331033   }
10341034   else
10351035   {
10361036      /* joystick */
1037      data = input_port_read(device->machine(), "game_port_directions");
1037      data = device->machine().root_device().ioport("game_port_directions")->read();
10381038      /* bit 0=0 => P1 up      bit 4=0 => P2 up
10391039           bit 1=0 => P1 down    bit 5=0 => P2 down
10401040           bit 2=0 => P1 left    bit 6=0 => P2 left
r15082r15083
10661066static READ8_DEVICE_HANDLER ( to7_game_portb_in )
10671067{
10681068   UINT8 data;
1069   if ( input_port_read(device->machine(), "config") & 1 )
1069   if ( device->machine().root_device().ioport("config")->read() & 1 )
10701070   {
10711071      /* mouse */
10721072      UINT8 mouse =  to7_get_mouse_signal(device->machine());
r15082r15083
10831083      /* bits 2-3: action buttons B (0=pressed) */
10841084      /* bits 4-5: unused (ouput) */
10851085      /* bits 0-1: unknown! */
1086      data = input_port_read(device->machine(), "game_port_buttons");
1086      data = device->machine().root_device().ioport("game_port_buttons")->read();
10871087   }
10881088   return data;
10891089}
r15082r15083
11301130{
11311131   pia6821_device *game_pia = machine.device<pia6821_device>(THOM_PIA_GAME);
11321132
1133   if ( input_port_read(machine, "config") & 1 )
1133   if ( machine.root_device().ioport("config")->read() & 1 )
11341134   {
11351135      /* mouse */
11361136      UINT8 mouse = to7_get_mouse_signal(machine);
r15082r15083
11401140   else
11411141   {
11421142      /* joystick */
1143      UINT8 in = input_port_read(machine, "game_port_buttons");
1143      UINT8 in = machine.root_device().ioport("game_port_buttons")->read();
11441144      game_pia->cb2_w( (in & 0x80) ? 1 : 0 ); /* P2 action A */
11451145      game_pia->ca2_w( (in & 0x40) ? 1 : 0 ); /* P1 action A */
11461146      game_pia->cb1_w( (in & 0x08) ? 1 : 0 ); /* P2 action B */
r15082r15083
15451545   };
15461546   int keyline = downcast<pia6821_device *>(device)->b_output() & 7;
15471547
1548   return input_port_read(device->machine(), keynames[7 - keyline]);
1548   return device->machine().root_device().ioport(keynames[7 - keyline])->read();
15491549}
15501550
15511551
r15082r15083
18351835{
18361836   return
18371837      (mo5_get_cassette(device->machine()) ? 0x80 : 0) |     /* bit 7: cassette input */
1838      ((input_port_read(device->machine(), "lightpen_button") & 1) ? 0x20 : 0)
1838      ((device->machine().root_device().ioport("lightpen_button")->read() & 1) ? 0x20 : 0)
18391839      /* bit 5: lightpen button */;
18401840}
18411841
r15082r15083
18581858      "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7"
18591859   };
18601860
1861   return ( input_port_read(device->machine(), keynames[lin]) & (1 << col) ) ? 0x80 : 0;
1861   return ( device->machine().root_device().ioport(keynames[lin])->read() & (1 << col) ) ? 0x80 : 0;
18621862}
18631863
18641864
r15082r15083
25332533
25342534   for ( line = 0; line < 10; line++ )
25352535   {
2536      port = input_port_read(machine, keynames[line]);
2536      port = machine.root_device().ioport(keynames[line])->read();
25372537
25382538      if ( line == 7 || line == 9 )
25392539         port |= 1; /* shift & control */
r15082r15083
27582758/* returns the ASCII code for the key, or 0 for no key */
27592759static int to9_kbd_get_key( running_machine &machine )
27602760{
2761   int control = ! (input_port_read(machine, "keyboard_7") & 1);
2762   int shift   = ! (input_port_read(machine, "keyboard_9") & 1);
2761   int control = ! (machine.root_device().ioport("keyboard_7")->read() & 1);
2762   int shift   = ! (machine.root_device().ioport("keyboard_9")->read() & 1);
27632763   int key = -1, line, bit;
27642764   UINT8 port;
27652765   static const char *const keynames[] = {
r15082r15083
27692769
27702770   for ( line = 0; line < 10; line++ )
27712771   {
2772      port = input_port_read(machine, keynames[line]);
2772      port = machine.root_device().ioport(keynames[line])->read();
27732773
27742774      if ( line == 7 || line == 9 )
27752775         port |= 1; /* shift & control */
r15082r15083
28602860
28612861      case 1: /* x axis */
28622862      {
2863         int newx = input_port_read(machine, "mouse_x");
2863         int newx = machine.root_device().ioport("mouse_x")->read();
28642864         UINT8 data = ( (newx - to9_mouse_x) & 0xf ) - 8;
28652865         to9_kbd_send( machine, data, 1 );
28662866         to9_mouse_x = newx;
r15082r15083
28692869
28702870      case 2: /* y axis */
28712871      {
2872         int newy = input_port_read(machine, "mouse_y");
2872         int newy = machine.root_device().ioport("mouse_y")->read();
28732873         UINT8 data = ( (newy - to9_mouse_y) & 0xf ) - 8;
28742874         to9_kbd_send( machine, data, 1 );
28752875         to9_mouse_y = newy;
r15082r15083
28782878
28792879      case 3: /* axis overflow & buttons */
28802880      {
2881         int b = input_port_read(machine, "mouse_button");
2881         int b = machine.root_device().ioport("mouse_button")->read();
28822882         UINT8 data = 0;
28832883         if ( b & 1 ) data |= 1;
28842884         if ( b & 2 ) data |= 4;
r15082r15083
31693169      "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9"
31703170   };
31713171
3172   if ( input_port_read(machine, "config") & 2 )
3172   if ( machine.root_device().ioport("config")->read() & 2 )
31733173      return 0; /* disabled */
31743174
31753175   for ( line = 0; line < 10; line++ )
31763176   {
3177      port = input_port_read(machine, keynames[line]);
3177      port = machine.root_device().ioport(keynames[line])->read();
31783178
31793179      if ( line == 7 || line == 9 )
31803180         port |= 1; /* shift & control */
r15082r15083
31943194/* keyboard scan & return keycode (or -1) */
31953195static int to8_kbd_get_key( running_machine &machine )
31963196{
3197   int control = (input_port_read(machine, "keyboard_7") & 1) ? 0 : 0x100;
3198   int shift   = (input_port_read(machine, "keyboard_9") & 1) ? 0 : 0x080;
3197   int control = (machine.root_device().ioport("keyboard_7")->read() & 1) ? 0 : 0x100;
3198   int shift   = (machine.root_device().ioport("keyboard_9")->read() & 1) ? 0 : 0x080;
31993199   int key = -1, line, bit;
32003200   UINT8 port;
32013201   static const char *const keynames[] = {
r15082r15083
32033203      "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9"
32043204   };
32053205
3206   if ( input_port_read(machine, "config") & 2 )
3206   if ( machine.root_device().ioport("config")->read() & 2 )
32073207      return -1; /* disabled */
32083208
32093209   for ( line = 0; line < 10; line++ )
32103210   {
3211      port = input_port_read(machine, keynames[line]);
3211      port = machine.root_device().ioport(keynames[line])->read();
32123212
32133213      if ( line == 7 || line == 9 )
32143214         port |= 1; /* shift & control */
r15082r15083
39483948static READ8_DEVICE_HANDLER ( to8_timer_port_in )
39493949{
39503950   centronics_device *printer = device->machine().device<centronics_device>("centronics");
3951   int lightpen = (input_port_read(device->machine(), "lightpen_button") & 1) ? 2 : 0;
3951   int lightpen = (device->machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0;
39523952   int cass = to7_get_cassette(device->machine()) ? 0x80 : 0;
39533953   int dtr = printer->busy_r() << 6;
39543954   int lock = to8_kbd_caps ? 0 : 8; /* undocumented! */
r15082r15083
41484148static READ8_DEVICE_HANDLER ( to9p_timer_port_in )
41494149{
41504150   centronics_device *printer = device->machine().device<centronics_device>("centronics");
4151   int lightpen = (input_port_read(device->machine(), "lightpen_button") & 1) ? 2 : 0;
4151   int lightpen = (device->machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0;
41524152   int cass = to7_get_cassette(device->machine()) ? 0x80 : 0;
41534153   int dtr = printer->busy_r() << 6;
41544154   return lightpen | cass | dtr;
r15082r15083
45124512   pia6821_device *game_pia = machine.device<pia6821_device>(THOM_PIA_GAME);
45134513
45144514   /* unlike the TO8, CB1 & CB2 are not connected to buttons */
4515   if ( input_port_read(machine, "config") & 1 )
4515   if ( machine.root_device().ioport("config")->read() & 1 )
45164516   {
45174517      UINT8 mouse = to7_get_mouse_signal(machine);
45184518      game_pia->ca1_w( BIT(mouse, 0) ); /* XA */
r15082r15083
45214521   else
45224522   {
45234523      /* joystick */
4524      UINT8 in = input_port_read(machine, "game_port_buttons");
4524      UINT8 in = machine.root_device().ioport("game_port_buttons")->read();
45254525      game_pia->ca1_w( BIT(in, 2) ); /* P1 action B */
45264526      game_pia->ca2_w( BIT(in, 6) ); /* P1 action A */
45274527   }
r15082r15083
45614561   return
45624562      (mo5_get_cassette(device->machine()) ? 0x80 : 0) |     /* bit 7: cassette input */
45634563      8 |                                   /* bit 3: kbd-line float up to 1 */
4564      ((input_port_read(device->machine(), "lightpen_button") & 1) ? 2 : 0);
4564      ((device->machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0);
45654565   /* bit 1: lightpen button */;
45664566}
45674567
r15082r15083
45834583      lin = 8;     /* A bit 3: 9-th kbd line select */
45844584
45854585   return
4586      ( input_port_read(device->machine(), keynames[lin]) & (1 << col) ) ?  0x80 : 0;
4586      ( device->machine().root_device().ioport(keynames[lin])->read() & (1 << col) ) ?  0x80 : 0;
45874587   /* bit 7: key up */
45884588}
45894589
r15082r15083
49824982      "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7"
49834983   };
49844984
4985   return ( input_port_read(device->machine(), keynames[lin]) & (1 << col) ) ? 0x80 : 0;
4985   return ( device->machine().root_device().ioport(keynames[lin])->read() & (1 << col) ) ? 0x80 : 0;
49864986   /* bit 7: key up */
49874987}
49884988
src/mess/machine/coco_fdc.c
r15082r15083
116116
117117coco_rtc_type_t coco_fdc_device::real_time_clock()
118118{
119   coco_rtc_type_t result = (coco_rtc_type_t) input_port_read_safe(machine(), "real_time_clock", RTC_NONE);
119   coco_rtc_type_t result = (coco_rtc_type_t) ioport("real_time_clock")->read_safe(RTC_NONE);
120120
121121   /* check to make sure we don't have any invalid values */
122122   if (((result == RTC_DISTO) && (m_disto_msm6242 == NULL))
src/mess/machine/kay_kbd.c
r15082r15083
322322   }
323323
324324   row = 9;
325   newval = input_port_read(device->machine(), "ROW9");
325   newval = device->machine().root_device().ioport("ROW9")->read();
326326   chg = keyrows[row] ^ newval;
327327
328   if (!chg) { newval = input_port_read(device->machine(), "ROW8"); chg = keyrows[--row] ^ newval; }
329   if (!chg) { newval = input_port_read(device->machine(), "ROW7"); chg = keyrows[--row] ^ newval; }
330   if (!chg) { newval = input_port_read(device->machine(), "ROW6"); chg = keyrows[--row] ^ newval; }
331   if (!chg) { newval = input_port_read(device->machine(), "ROW5"); chg = keyrows[--row] ^ newval; }
332   if (!chg) { newval = input_port_read(device->machine(), "ROW4"); chg = keyrows[--row] ^ newval; }
333   if (!chg) { newval = input_port_read(device->machine(), "ROW3"); chg = keyrows[--row] ^ newval; }
334   if (!chg) { newval = input_port_read(device->machine(), "ROW2"); chg = keyrows[--row] ^ newval; }
335   if (!chg) { newval = input_port_read(device->machine(), "ROW1"); chg = keyrows[--row] ^ newval; }
336   if (!chg) { newval = input_port_read(device->machine(), "ROW0"); chg = keyrows[--row] ^ newval; }
328   if (!chg) { newval = device->machine().root_device().ioport("ROW8")->read(); chg = keyrows[--row] ^ newval; }
329   if (!chg) { newval = device->machine().root_device().ioport("ROW7")->read(); chg = keyrows[--row] ^ newval; }
330   if (!chg) { newval = device->machine().root_device().ioport("ROW6")->read(); chg = keyrows[--row] ^ newval; }
331   if (!chg) { newval = device->machine().root_device().ioport("ROW5")->read(); chg = keyrows[--row] ^ newval; }
332   if (!chg) { newval = device->machine().root_device().ioport("ROW4")->read(); chg = keyrows[--row] ^ newval; }
333   if (!chg) { newval = device->machine().root_device().ioport("ROW3")->read(); chg = keyrows[--row] ^ newval; }
334   if (!chg) { newval = device->machine().root_device().ioport("ROW2")->read(); chg = keyrows[--row] ^ newval; }
335   if (!chg) { newval = device->machine().root_device().ioport("ROW1")->read(); chg = keyrows[--row] ^ newval; }
336   if (!chg) { newval = device->machine().root_device().ioport("ROW0")->read(); chg = keyrows[--row] ^ newval; }
337337   if (!chg) --row;
338338
339339   if (row >= 0)
src/mess/machine/c128.c
r15082r15083
9494   device_t *cia_1 = machine.device("cia_1");
9595   int cia1irq = mos6526_irq_r(cia_1);
9696
97   if (state->m_nmilevel != (input_port_read(machine, "SPECIAL") & 0x80) || cia1irq)   /* KEY_RESTORE */
97   if (state->m_nmilevel != (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq)   /* KEY_RESTORE */
9898   {
9999      if (1) // this was never valid, there is no active CPU during a timer firing!  cpu_getactivecpu() == 0)
100100      {
101101         /* z80 */
102         cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, (input_port_read(machine, "SPECIAL") & 0x80) || cia1irq);
102         cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq);
103103      }
104104      else
105105      {
106         cputag_set_input_line(machine, "m8502", INPUT_LINE_NMI, (input_port_read(machine, "SPECIAL") & 0x80) || cia1irq);
106         cputag_set_input_line(machine, "m8502", INPUT_LINE_NMI, (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq);
107107      }
108108
109      state->m_nmilevel = (input_port_read(machine, "SPECIAL") & 0x80) || cia1irq;
109      state->m_nmilevel = (machine.root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq;
110110   }
111111}
112112
r15082r15083
460460      return state->m_colorram[offset & 0x3ff];
461461   else if (offset == 0xc00)
462462      {
463         cia_set_port_mask_value(cia_0, 0, input_port_read(space->machine(), "CTRLSEL") & 0x80 ? c64_keyline[8] : c64_keyline[9] );
463         cia_set_port_mask_value(cia_0, 0, state->ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[8] : c64_keyline[9] );
464464         return mos6526_r(cia_0, offset);
465465      }
466466   else if (offset == 0xc01)
467467      {
468         cia_set_port_mask_value(cia_0, 1, input_port_read(space->machine(), "CTRLSEL") & 0x80 ? c64_keyline[9] : c64_keyline[8] );
468         cia_set_port_mask_value(cia_0, 1, space->machine().root_device().ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[9] : c64_keyline[8] );
469469         return mos6526_r(cia_0, offset);
470470      }
471471   else if (offset < 0xd00)
r15082r15083
558558#if 1
559559    state->membank("bank10")->set_base(state->m_z80);
560560    state->membank("bank11")->set_base(state->m_ram + 0x1000);
561    if ( (( (input_port_read(machine, "SPECIAL") & 0x06) == 0x02 ) && (MMU_RAM_ADDR >= 0x40000))
562        || (( (input_port_read(machine, "SPECIAL") & 0x06) == 0x00) && (MMU_RAM_ADDR >= 0x20000)) )
561    if ( (( (machine.root_device().ioport("SPECIAL")->read() & 0x06) == 0x02 ) && (MMU_RAM_ADDR >= 0x40000))
562        || (( (machine.root_device().ioport("SPECIAL")->read() & 0x06) == 0x00) && (MMU_RAM_ADDR >= 0x20000)) )
563563       state->m_ram = NULL;
564564#else
565565    if (MMU_BOTTOM)
r15082r15083
609609    else
610610      state->membank("bank9")->set_base(state->m_memory + 0xff05);
611611
612    if ( (( (input_port_read(machine, "SPECIAL") & 0x06) == 0x02 ) && (MMU_RAM_ADDR >= 0x40000))
613        || (( (input_port_read(machine, "SPECIAL") & 0x06) == 0x00) && (MMU_RAM_ADDR >= 0x20000)) )
612    if ( (( (machine.root_device().ioport("SPECIAL")->read() & 0x06) == 0x02 ) && (MMU_RAM_ADDR >= 0x40000))
613        || (( (machine.root_device().ioport("SPECIAL")->read() & 0x06) == 0x00) && (MMU_RAM_ADDR >= 0x20000)) )
614614       state->m_ram = NULL;
615615#endif
616616}
r15082r15083
775775         state->membank("bank16")->set_base(state->m_external_function + 0x3f05);
776776      }
777777
778      if ( (( (input_port_read(machine, "SPECIAL") & 0x06) == 0x02 ) && (MMU_RAM_ADDR >= 0x40000))
779            || (( (input_port_read(machine, "SPECIAL") & 0x06) == 0x00) && (MMU_RAM_ADDR >= 0x20000)) )
778      if ( (( (machine.root_device().ioport("SPECIAL")->read() & 0x06) == 0x02 ) && (MMU_RAM_ADDR >= 0x40000))
779            || (( (machine.root_device().ioport("SPECIAL")->read() & 0x06) == 0x00) && (MMU_RAM_ADDR >= 0x20000)) )
780780         state->m_ram = NULL;
781781   }
782782}
r15082r15083
902902         data &= ~0x10;
903903      if (!state->m_exrom)
904904         data &= ~0x20;
905      if (input_port_read(space->machine(), "SPECIAL") & 0x10)
905      if (space->machine().root_device().ioport("SPECIAL")->read() & 0x10)
906906         data &= ~0x80;
907907      break;
908908   case 0xb:
909909      /* hinybble number of 64 kb memory blocks */
910      if ((input_port_read(space->machine(), "SPECIAL") & 0x06) == 0x02)      // 256KB RAM
910      if ((space->machine().root_device().ioport("SPECIAL")->read() & 0x06) == 0x02)      // 256KB RAM
911911         data = 0x4f;
912      else if ((input_port_read(space->machine(), "SPECIAL") & 0x06) == 0x04)   //  1MB
912      else if ((state->ioport("SPECIAL")->read() & 0x06) == 0x04)   //  1MB
913913         data = 0xf;
914914      else
915915         data = 0x2f;
r15082r15083
11281128   else
11291129      data |=  0x10;
11301130
1131   if (input_port_read(device->machine(), "SPECIAL") & 0x20)      /* Check Caps Lock */
1131   if (state->ioport("SPECIAL")->read() & 0x20)      /* Check Caps Lock */
11321132      data &= ~0x40;
11331133   else
11341134      data |=  0x40;
r15082r15083
12591259
12601260   c128_nmi(device->machine());
12611261
1262   if ((input_port_read(device->machine(), "SPECIAL") & 0x08) != state->m_monitor)
1262   if ((device->machine().root_device().ioport("SPECIAL")->read() & 0x08) != state->m_monitor)
12631263   {
1264      if (input_port_read(device->machine(), "SPECIAL") & 0x08)
1264      if (device->machine().root_device().ioport("SPECIAL")->read() & 0x08)
12651265      {
12661266         vic2_set_rastering(vic2e, 0);
12671267         vdc8563_set_rastering(vdc8563, 1);
r15082r15083
12761276         else
12771277            device->machine().primary_screen->set_visible_area(0, VIC6567_VISIBLECOLUMNS - 1, 0, VIC6567_VISIBLELINES - 1);
12781278      }
1279      state->m_monitor = input_port_read(device->machine(), "SPECIAL") & 0x08;
1279      state->m_monitor = device->machine().root_device().ioport("SPECIAL")->read() & 0x08;
12801280   }
12811281
12821282
r15082r15083
12851285
12861286   /* Fix Me! Currently, neither left Shift nor Shift Lock work in c128, but reading the correspondent input produces a bug!
12871287    Hence, we overwrite the actual reading as it never happens */
1288   if ((input_port_read(device->machine(), "SPECIAL") & 0x40))   //
1288   if ((device->machine().root_device().ioport("SPECIAL")->read() & 0x40))   //
12891289      c64_keyline[1] |= 0x80;
12901290
12911291   /* c128 specific: keypad input ports */
12921292   for (i = 0; i < 3; i++)
12931293   {
12941294      value = 0xff;
1295      value &= ~input_port_read(device->machine(), c128ports[i]);
1295      value &= ~device->machine().root_device().ioport(c128ports[i])->read();
12961296      state->m_keyline[i] = value;
12971297   }
12981298}
src/mess/machine/thomflop.c
r15082r15083
17161716   if ( offset == 8 )
17171717   {
17181718      /* network ID of the computer */
1719      UINT8 id = input_port_read(space->machine(), "fconfig") >> 3;
1719      UINT8 id = space->machine().root_device().ioport("fconfig")->read() >> 3;
17201720      VLOG(( "%f $%04x to7_network_r: read id $%02X\n", space->machine().time().as_double(), cpu_get_previouspc(space->machine().device("maincpu")), id ));
17211721      return id;
17221722   }
r15082r15083
17741774
17751775void to7_floppy_reset ( running_machine &machine )
17761776{
1777   to7_controller_type = (input_port_read(machine, "fconfig") ) & 7;
1777   to7_controller_type = (machine.root_device().ioport("fconfig")->read() ) & 7;
17781778
17791779   switch ( to7_controller_type )
17801780   {
src/mess/machine/pet.c
r15082r15083
132132
133133   if (state->m_keyline_select < 10)
134134   {
135      data = input_port_read(device->machine(), keynames[state->m_keyline_select]);
135      data = device->machine().root_device().ioport(keynames[state->m_keyline_select])->read();
136136      /* Check for left-shift lock */
137      if ((state->m_keyline_select == 8) && (input_port_read(device->machine(), "SPECIAL") & 0x80))
137      if ((state->m_keyline_select == 8) && (device->machine().root_device().ioport("SPECIAL")->read() & 0x80))
138138         data &= 0xfe;
139139   }
140140   return data;
r15082r15083
152152
153153   if (state->m_keyline_select < 10)
154154   {
155      data = input_port_read(device->machine(), keynames[state->m_keyline_select]);
155      data = device->machine().root_device().ioport(keynames[state->m_keyline_select])->read();
156156      /* Check for left-shift lock */
157157      /* 2008-05 FP: For some reason, superpet read it in the opposite way!! */
158158      /* While waiting for confirmation from docs, we add a workaround here. */
159159      if (state->m_superpet)
160160      {
161         if ((state->m_keyline_select == 6) && !(input_port_read(device->machine(), "SPECIAL") & 0x80))
161         if ((state->m_keyline_select == 6) && !(device->machine().root_device().ioport("SPECIAL")->read() & 0x80))
162162            data &= 0xfe;
163163      }
164164      else
165165      {
166         if ((state->m_keyline_select == 6) && (input_port_read(device->machine(), "SPECIAL") & 0x80))
166         if ((state->m_keyline_select == 6) && (device->machine().root_device().ioport("SPECIAL")->read() & 0x80))
167167            data &= 0xfe;
168168      }
169169   }
r15082r15083
730730   if (state->m_superpet)
731731   {
732732      state->m_spet.rom = 0;
733      if (input_port_read(machine, "CFG") & 0x04)
733      if (machine.root_device().ioport("CFG")->read() & 0x04)
734734      {
735735         cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, 1);
736736         cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, 0);
r15082r15083
746746
747747   if (state->m_cbm8096)
748748   {
749      if (input_port_read(machine, "CFG") & 0x08)
749      if (machine.root_device().ioport("CFG")->read() & 0x08)
750750      {
751751         machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfff0, 0xfff0, FUNC(cbm8096_w));
752752      }
r15082r15083
757757      cbm8096_w(machine.device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
758758   }
759759
760//removed   cbm_drive_0_config (input_port_read(machine, "CFG") & 2 ? IEEE : 0, 8);
761//removed   cbm_drive_1_config (input_port_read(machine, "CFG") & 1 ? IEEE : 0, 9);
760//removed   cbm_drive_0_config (machine.root_device().ioport("CFG")->read() & 2 ? IEEE : 0, 8);
761//removed   cbm_drive_1_config (machine.root_device().ioport("CFG")->read() & 1 ? IEEE : 0, 9);
762762   machine.device("maincpu")->reset();
763763
764764   state->m_ieee->ren_w(0);
r15082r15083
772772   pet_state *state = device->machine().driver_data<pet_state>();
773773   if (state->m_superpet)
774774   {
775      if (input_port_read(device->machine(), "CFG") & 0x04)
775      if (state->ioport("CFG")->read() & 0x04)
776776      {
777777         device_set_input_line(device, INPUT_LINE_HALT, 1);
778778         device_set_input_line(device, INPUT_LINE_HALT, 0);
r15082r15083
786786      }
787787   }
788788
789   set_led_status (device->machine(),1, input_port_read(device->machine(), "SPECIAL") & 0x80 ? 1 : 0);      /* Shift Lock */
789   set_led_status (device->machine(),1, device->machine().root_device().ioport("SPECIAL")->read() & 0x80 ? 1 : 0);      /* Shift Lock */
790790}
791791
792792
src/mess/machine/oric.c
r15082r15083
5858      /* oric 1 or oric atmos */
5959
6060      /* if floppy disc hardware is disabled, do not allow interrupts from it */
61      if ((input_port_read(machine, "FLOPPY") & 0x07) == ORIC_FLOPPY_INTERFACE_NONE)
61      if ((machine.root_device().ioport("FLOPPY")->read() & 0x07) == ORIC_FLOPPY_INTERFACE_NONE)
6262         state->m_irqs &=~(1<<1);
6363   }
6464
r15082r15083
9393   int input_port_data;
9494   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
9595
96   input_port_data = input_port_read(machine, keynames[state->m_keyboard_line]);
96   input_port_data = machine.root_device().ioport(keynames[state->m_keyboard_line])->read();
9797
9898   /* go through all bits in line */
9999   for (i=0; i<8; i++)
r15082r15083
271271    to the via cb1 input. Interrupts can be generated from the vertical
272272    sync, and flicker free games can be produced */
273273
274   input_port_9 = input_port_read(machine, "FLOPPY");
274   input_port_9 = machine.root_device().ioport("FLOPPY")->read();
275275   /* cable is enabled? */
276276   if ((input_port_9 & 0x08)!=0)
277277   {
r15082r15083
10021002
10031003static WRITE_LINE_DEVICE_HANDLER( oric_wd179x_intrq_w )
10041004{
1005   if ((input_port_read(device->machine(), "FLOPPY") & 0x07) == ORIC_FLOPPY_INTERFACE_MICRODISC)
1005   if ((device->machine().root_device().ioport("FLOPPY")->read() & 0x07) == ORIC_FLOPPY_INTERFACE_MICRODISC)
10061006      oric_microdisc_wd179x_intrq_w(device, state);
10071007}
10081008
10091009static WRITE_LINE_DEVICE_HANDLER( oric_wd179x_drq_w )
10101010{
1011   switch (input_port_read(device->machine(), "FLOPPY") &  0x07)
1011   switch (device->machine().root_device().ioport("FLOPPY")->read() &  0x07)
10121012   {
10131013      default:
10141014      case ORIC_FLOPPY_INTERFACE_NONE:
r15082r15083
10661066MACHINE_RESET( oric )
10671067{
10681068   oric_state *state = machine.driver_data<oric_state>();
1069   int disc_interface_id = input_port_read(machine, "FLOPPY") & 0x07;
1069   int disc_interface_id = machine.root_device().ioport("FLOPPY")->read() & 0x07;
10701070   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
10711071   if (state->m_is_telestrat)
10721072      return;
r15082r15083
11301130READ8_MEMBER(oric_state::oric_IO_r)
11311131{
11321132   via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
1133   switch (input_port_read(machine(), "FLOPPY") & 0x07)
1133   switch (ioport("FLOPPY")->read() & 0x07)
11341134   {
11351135      default:
11361136      case ORIC_FLOPPY_INTERFACE_NONE:
r15082r15083
11621162WRITE8_MEMBER(oric_state::oric_IO_w)
11631163{
11641164   via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
1165   switch (input_port_read(machine(), "FLOPPY") & 0x07)
1165   switch (ioport("FLOPPY")->read() & 0x07)
11661166   {
11671167      default:
11681168      case ORIC_FLOPPY_INTERFACE_NONE:
r15082r15083
13121312   /* left joystick selected? */
13131313   if (state->m_telestrat_via2_port_b_data & (1<<6))
13141314   {
1315      data &= input_port_read(device->machine(), "JOY0");
1315      data &= state->ioport("JOY0")->read();
13161316   }
13171317
13181318   /* right joystick selected? */
13191319   if (state->m_telestrat_via2_port_b_data & (1<<7))
13201320   {
1321      data &= input_port_read(device->machine(), "JOY1");
1321      data &= device->machine().root_device().ioport("JOY1")->read();
13221322   }
13231323
13241324   data |= state->m_telestrat_via2_port_b_data & ((1<<7) | (1<<6) | (1<<5));
src/mess/machine/genpc.c
r15082r15083
340340         *      01 - color 40x25
341341         * 6-7  The number of floppy disk drives
342342         */
343      data = input_port_read(*this, "DSW0");
343      data = ioport("DSW0")->read();
344344   }
345345   else
346346   {
r15082r15083
362362   if (m_ppi_portc_switch_high)
363363   {
364364      /* read hi nibble of S2 */
365      data = (data & 0xf0) | ((input_port_read(*this, "DSW0") >> 4) & 0x0f);
365      data = (data & 0xf0) | ((ioport("DSW0")->read() >> 4) & 0x0f);
366366      PIO_LOG(1,"PIO_C_r (hi)",("$%02x\n", data));
367367   }
368368   else
369369   {
370370      /* read lo nibble of S2 */
371      data = (data & 0xf0) | (input_port_read(*this, "DSW0") & 0x0f);
371      data = (data & 0xf0) | (ioport("DSW0")->read() & 0x0f);
372372      PIO_LOG(1,"PIO_C_r (lo)",("$%02x\n", data));
373373   }
374374
r15082r15083
745745         *      01 - color 40x25
746746         * 6-7  The number of floppy disk drives
747747         */
748      data = input_port_read(*this, "DSW0") & 0xF3;
748      data = ioport("DSW0")->read() & 0xF3;
749749      switch ( machine().device<ram_device>(RAM_TAG)->size() )
750750      {
751751      case 16 * 1024:
r15082r15083
810810   else
811811   {
812812      /* read lo nibble of S2 */
813      data = (data & 0xf0) | (input_port_read(*this, "DSW0") & 0x0f);
813      data = (data & 0xf0) | (ioport("DSW0")->read() & 0x0f);
814814      PIO_LOG(1,"PIO_C_r (lo)",("$%02x\n", data));
815815   }
816816
src/mess/machine/orao.c
r15082r15083
3636
3737    switch(offset) {
3838      /* Keyboard*/
39      case 0x07FC : return input_port_read(machine(), "LINE0");
40      case 0x07FD : return input_port_read(machine(), "LINE1");
41      case 0x07FA : return input_port_read(machine(), "LINE2");
42      case 0x07FB : return input_port_read(machine(), "LINE3");
43      case 0x07F6 : return input_port_read(machine(), "LINE4");
44      case 0x07F7 : return input_port_read(machine(), "LINE5");
45      case 0x07EE : return input_port_read(machine(), "LINE6");
46      case 0x07EF : return input_port_read(machine(), "LINE7");
47      case 0x07DE : return input_port_read(machine(), "LINE8");
48      case 0x07DF : return input_port_read(machine(), "LINE9");
49      case 0x07BE : return input_port_read(machine(), "LINE10");
50      case 0x07BF : return input_port_read(machine(), "LINE11");
51      case 0x077E : return input_port_read(machine(), "LINE12");
52      case 0x077F : return input_port_read(machine(), "LINE13");
53      case 0x06FE : return input_port_read(machine(), "LINE14");
54      case 0x06FF : return input_port_read(machine(), "LINE15");
55      case 0x05FE : return input_port_read(machine(), "LINE16");
56      case 0x05FF : return input_port_read(machine(), "LINE17");
57      case 0x03FE : return input_port_read(machine(), "LINE18");
58      case 0x03FF : return input_port_read(machine(), "LINE19");
39      case 0x07FC : return ioport("LINE0")->read();
40      case 0x07FD : return ioport("LINE1")->read();
41      case 0x07FA : return ioport("LINE2")->read();
42      case 0x07FB : return ioport("LINE3")->read();
43      case 0x07F6 : return ioport("LINE4")->read();
44      case 0x07F7 : return ioport("LINE5")->read();
45      case 0x07EE : return ioport("LINE6")->read();
46      case 0x07EF : return ioport("LINE7")->read();
47      case 0x07DE : return ioport("LINE8")->read();
48      case 0x07DF : return ioport("LINE9")->read();
49      case 0x07BE : return ioport("LINE10")->read();
50      case 0x07BF : return ioport("LINE11")->read();
51      case 0x077E : return ioport("LINE12")->read();
52      case 0x077F : return ioport("LINE13")->read();
53      case 0x06FE : return ioport("LINE14")->read();
54      case 0x06FF : return ioport("LINE15")->read();
55      case 0x05FE : return ioport("LINE16")->read();
56      case 0x05FF : return ioport("LINE17")->read();
57      case 0x03FE : return ioport("LINE18")->read();
58      case 0x03FF : return ioport("LINE19")->read();
5959      /* Tape */
6060      case 0x07FF :
6161               level = (machine().device<cassette_image_device>(CASSETTE_TAG)->input());
src/mess/machine/c64_4tba.c
r15082r15083
8585 
8686UINT8 c64_4tba_device::c64_pb_r(address_space &space, offs_t offset)
8787{
88   return input_port_read(*this, "PB");
88   return ioport("PB")->read();
8989}
9090 
9191 
r15082r15083
9595 
9696int c64_4tba_device::c64_pa2_r()
9797{
98   return BIT(input_port_read(*this, "PA2"), 0);
98   return BIT(ioport("PA2")->read(), 0);
9999}
100100 
101101 
src/mess/machine/vector06.c
r15082r15083
1313READ8_MEMBER( vector06_state::vector06_8255_portb_r )
1414{
1515   UINT8 key = 0xff;
16   if (BIT(m_keyboard_mask, 0)) key &= input_port_read(machine(),"LINE0");
17   if (BIT(m_keyboard_mask, 1)) key &= input_port_read(machine(),"LINE1");
18   if (BIT(m_keyboard_mask, 2)) key &= input_port_read(machine(),"LINE2");
19   if (BIT(m_keyboard_mask, 3)) key &= input_port_read(machine(),"LINE3");
20   if (BIT(m_keyboard_mask, 4)) key &= input_port_read(machine(),"LINE4");
21   if (BIT(m_keyboard_mask, 5)) key &= input_port_read(machine(),"LINE5");
22   if (BIT(m_keyboard_mask, 6)) key &= input_port_read(machine(),"LINE6");
23   if (BIT(m_keyboard_mask, 7)) key &= input_port_read(machine(),"LINE7");
16   if (BIT(m_keyboard_mask, 0)) key &= ioport("LINE0")->read();
17   if (BIT(m_keyboard_mask, 1)) key &= ioport("LINE1")->read();
18   if (BIT(m_keyboard_mask, 2)) key &= ioport("LINE2")->read();
19   if (BIT(m_keyboard_mask, 3)) key &= ioport("LINE3")->read();
20   if (BIT(m_keyboard_mask, 4)) key &= ioport("LINE4")->read();
21   if (BIT(m_keyboard_mask, 5)) key &= ioport("LINE5")->read();
22   if (BIT(m_keyboard_mask, 6)) key &= ioport("LINE6")->read();
23   if (BIT(m_keyboard_mask, 7)) key &= ioport("LINE7")->read();
2424   return key;
2525}
2626
2727READ8_MEMBER( vector06_state::vector06_8255_portc_r )
2828{
29   UINT8 ret = input_port_read(machine(), "LINE8");
29   UINT8 ret = ioport("LINE8")->read();
3030
3131   if (m_cass->input() > 0)
3232      ret |= 0x10;
r15082r15083
140140static TIMER_CALLBACK( reset_check_callback )
141141{
142142   vector06_state *state = machine.driver_data<vector06_state>();
143   UINT8 val = input_port_read(machine, "RESET");
143   UINT8 val = machine.root_device().ioport("RESET")->read();
144144
145145   if (BIT(val, 0))
146146   {
src/mess/machine/sorcerer.c
r15082r15083
176176      m_serial_timer->adjust(attotime::zero);
177177#endif
178178
179      UINT8 sound = input_port_read(machine(), "CONFIG") & 8;
179      UINT8 sound = ioport("CONFIG")->read() & 8;
180180
181181      m_cass1->change_state(
182182         ((BIT(data,4)) && (sound)) ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED, CASSETTE_MASK_SPEAKER);
r15082r15083
216216WRITE8_MEMBER(sorcerer_state::sorcerer_ff_w)
217217{
218218   /* reading the config switch */
219   switch (input_port_read(machine(), "CONFIG") & 0x06)
219   switch (ioport("CONFIG")->read() & 0x06)
220220   {
221221      case 0: /* speaker */
222222         dac_data_w(m_dac, data);
r15082r15083
275275   };
276276
277277   /* bit 5 - vsync (inverted) */
278   data |= (((~input_port_read(machine(), "VS")) & 0x01)<<5);
278   data |= (((~ioport("VS")->read()) & 0x01)<<5);
279279
280280   /* bits 4..0 - keyboard data */
281   data |= (input_port_read(machine(), keynames[m_keyboard_line]) & 0x1f);
281   data |= (ioport(keynames[m_keyboard_line])->read() & 0x1f);
282282
283283   return data;
284284}
src/mess/machine/kb_keytro.c
r15082r15083
472472      case 0x0e:
473473         break;
474474      case 0x0f:
475         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_0f");
475         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_0f")->read();
476476         break;
477477      case 0x30:
478         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_30_0");
478         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_30_0")->read();
479479         break;
480480      case 0x31:
481         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_31_0");
481         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_31_0")->read();
482482         break;
483483      case 0x32:
484         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_32_0");
484         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_32_0")->read();
485485         break;
486486      case 0x33:
487         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_33_0");
487         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_33_0")->read();
488488         break;
489489      case 0x34:
490         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_34_0");
490         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_34_0")->read();
491491         break;
492492      case 0x35:
493         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_35_0");
493         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_35_0")->read();
494494         break;
495495      case 0x36:
496         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_36_0");
496         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_36_0")->read();
497497         break;
498498      case 0x37:
499         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_37_0") | (input_port_read(space->machine(), "kb_keytronic_36_0") & 0x01);
499         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_37_0")->read() | (space->machine().root_device().ioport("kb_keytronic_36_0")->read() & 0x01);
500500         break;
501501      case 0x38:
502         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_38_0");
502         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_38_0")->read();
503503         break;
504504      case 0x39:
505         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_39_0");
505         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_39_0")->read();
506506         break;
507507      case 0x3a:
508         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_3a_0");
508         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_3a_0")->read();
509509         break;
510510      case 0x3b:
511         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_3b_0");
511         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_3b_0")->read();
512512         break;
513513      }
514514   }
r15082r15083
519519      switch (keytronic->p1)
520520      {
521521      case 0x0b:
522         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_0b");
522         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_0b")->read();
523523         break;
524524      case 0x30:
525         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_30_1");
525         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_30_1")->read();
526526         break;
527527      case 0x31:
528         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_31_1");
528         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_31_1")->read();
529529         break;
530530      case 0x32:
531         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_32_1");
531         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_32_1")->read();
532532         break;
533533      case 0x33:
534         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_33_1");
534         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_33_1")->read();
535535         break;
536536      case 0x34:
537         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_34_1");
537         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_34_1")->read();
538538         break;
539539      case 0x35:
540         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_35_1");
540         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_35_1")->read();
541541         break;
542542      case 0x36:
543         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_36_1");
543         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_36_1")->read();
544544         break;
545545      case 0x37:
546         keytronic->p1_data = input_port_read(space->machine(), "kb_keytronic_37_1");
546         keytronic->p1_data = space->machine().root_device().ioport("kb_keytronic_37_1")->read();
547547         break;
548548      case 0x38:
549549         keytronic->p1_data = 0xff;
src/mess/machine/bk.c
r15082r15083
2424
2525   for(i = 1; i < 12; i++)
2626   {
27      code =   input_port_read(machine, keynames[i-1]);
27      code =   machine.root_device().ioport(keynames[i-1])->read();
2828      if (code != 0)
2929      {
3030         for(j = 0; j < 8; j++)
r15082r15083
3535               break;
3636            }
3737         }
38         if ((input_port_read(machine, "LINE0") & 4) == 4)
38         if ((machine.root_device().ioport("LINE0")->read() & 4) == 4)
3939         {
4040            if (i==6 || i==7)
4141            {
r15082r15083
4343            }
4444
4545         }
46         if ((input_port_read(machine, "LINE0") & 4) == 4)
46         if ((machine.root_device().ioport("LINE0")->read() & 4) == 4)
4747         {
4848            if (i>=8 && i<=11)
4949            {
r15082r15083
5151            }
5252         }
5353         state->m_key_pressed = 0x40;
54         if ((input_port_read(machine, "LINE0") & 2) == 0)
54         if ((machine.root_device().ioport("LINE0")->read() & 2) == 0)
5555         {
5656            state->m_key_irq_vector = 0x30;
5757         }
src/mess/machine/ser_mouse.c
r15082r15083
7777   /* Do not get deltas or send packets if queue is not empty (Prevents drifting) */
7878   if (m_head==m_tail)
7979   {
80      nx = input_port_read(*this, "ser_mouse_x");
80      nx = ioport("ser_mouse_x")->read();
8181
8282      dx = nx - ox;
8383      if (dx<=-0x800) dx = nx + 0x1000 - ox; /* Prevent jumping */
8484      if (dx>=0x800) dx = nx - 0x1000 - ox;
8585      ox = nx;
8686
87      ny = input_port_read(*this, "ser_mouse_y");
87      ny = ioport("ser_mouse_y")->read();
8888
8989      dy = ny - oy;
9090      if (dy<=-0x800) dy = ny + 0x1000 - oy;
9191      if (dy>=0x800) dy = ny - 0x1000 - oy;
9292      oy = ny;
9393
94      nb = input_port_read(*this, "ser_mouse_btn");
94      nb = ioport("ser_mouse_btn")->read();
9595      mbc = nb^m_mb;
9696      m_mb = nb;
9797
src/mess/machine/terminal.c
r15082r15083
224224***************************************************************************/
225225UINT32 generic_terminal_device::update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect)
226226{
227   UINT8 options = input_port_read(*this, "TERM_CONF");
227   UINT8 options = ioport("TERM_CONF")->read();
228228   UINT16 cursor = m_y_pos * TERMINAL_WIDTH + m_x_pos;
229229   UINT8 y,ra,chr,gfx;
230230   UINT16 sy=0,ma=0,x;
r15082r15083
307307   UINT8 code;
308308   UINT8 key_code = 0;
309309   UINT8 retVal = 0;
310   UINT8 shift = BIT(input_port_read(*this, "TERM_LINEC"), 1);
311   UINT8 caps  = BIT(input_port_read(*this, "TERM_LINEC"), 2);
312   UINT8 ctrl  = BIT(input_port_read(*this, "TERM_LINEC"), 0);
310   UINT8 shift = BIT(ioport("TERM_LINEC")->read(), 1);
311   UINT8 caps  = BIT(ioport("TERM_LINEC")->read(), 2);
312   UINT8 ctrl  = BIT(ioport("TERM_LINEC")->read(), 0);
313313   i = *scan_line;
314314   {
315      code =   input_port_read(*this, keynames[i]);
315      code =   ioport(keynames[i])->read();
316316      if (code != 0)
317317      {
318318         if (i==0 && shift==0) {
src/mess/machine/sapi1.c
r15082r15083
2727READ8_MEMBER( sapi1_state::sapi1_keyboard_r )
2828{
2929   UINT8 key = 0xff;
30   if (BIT(m_keyboard_mask, 0)) { key &= input_port_read(machine(),"LINE0"); }
31   if (BIT(m_keyboard_mask, 1)) { key &= input_port_read(machine(),"LINE1"); }
32   if (BIT(m_keyboard_mask, 2)) { key &= input_port_read(machine(),"LINE2"); }
33   if (BIT(m_keyboard_mask, 3)) { key &= input_port_read(machine(),"LINE3"); }
34   if (BIT(m_keyboard_mask, 4)) { key &= input_port_read(machine(),"LINE4"); }
30   if (BIT(m_keyboard_mask, 0)) { key &= ioport("LINE0")->read(); }
31   if (BIT(m_keyboard_mask, 1)) { key &= ioport("LINE1")->read(); }
32   if (BIT(m_keyboard_mask, 2)) { key &= ioport("LINE2")->read(); }
33   if (BIT(m_keyboard_mask, 3)) { key &= ioport("LINE3")->read(); }
34   if (BIT(m_keyboard_mask, 4)) { key &= ioport("LINE4")->read(); }
3535   return key;
3636}
3737
src/mess/machine/osborne1.c
r15082r15083
5151         break;
5252      case 0x200:   /* Keyboard */
5353         /* Row 0 */
54         if ( offset & 0x01 )   data &= input_port_read(machine(), "ROW0");
54         if ( offset & 0x01 )   data &= ioport("ROW0")->read();
5555         /* Row 1 */
56         if ( offset & 0x02 )   data &= input_port_read(machine(), "ROW1");
56         if ( offset & 0x02 )   data &= ioport("ROW1")->read();
5757         /* Row 2 */
58         if ( offset & 0x04 )   data &= input_port_read(machine(), "ROW3");
58         if ( offset & 0x04 )   data &= ioport("ROW3")->read();
5959         /* Row 3 */
60         if ( offset & 0x08 )   data &= input_port_read(machine(), "ROW4");
60         if ( offset & 0x08 )   data &= ioport("ROW4")->read();
6161         /* Row 4 */
62         if ( offset & 0x10 )   data &= input_port_read(machine(), "ROW5");
62         if ( offset & 0x10 )   data &= ioport("ROW5")->read();
6363         /* Row 5 */
64         if ( offset & 0x20 )   data &= input_port_read(machine(), "ROW2");
64         if ( offset & 0x20 )   data &= ioport("ROW2")->read();
6565         /* Row 6 */
66         if ( offset & 0x40 )   data &= input_port_read(machine(), "ROW6");
66         if ( offset & 0x40 )   data &= ioport("ROW6")->read();
6767         /* Row 7 */
68         if ( offset & 0x80 )   data &= input_port_read(machine(), "ROW7");
68         if ( offset & 0x80 )   data &= ioport("ROW7")->read();
6969         break;
7070      case 0x900:   /* IEEE488 PIA */
7171         data = m_pia0->read(space, offset & 0x03 );
src/mess/machine/amstrad.c
r15082r15083
15171517   // Analogue ports
15181518   if(offset == 0x0808)
15191519   {
1520      return (input_port_read(machine(), "analog1") & 0x3f);
1520      return (ioport("analog1")->read() & 0x3f);
15211521   }
15221522   if(offset == 0x0809)
15231523   {
1524      return (input_port_read(machine(), "analog2") & 0x3f);
1524      return (ioport("analog2")->read() & 0x3f);
15251525   }
15261526   if(offset == 0x080a)
15271527   {
1528      return (input_port_read(machine(), "analog3") & 0x3f);
1528      return (ioport("analog3")->read() & 0x3f);
15291529   }
15301530   if(offset == 0x080b)
15311531   {
1532      return (input_port_read(machine(), "analog4") & 0x3f);
1532      return (ioport("analog4")->read() & 0x3f);
15331533   }
15341534   if(offset == 0x080c || offset == 0x080e)
15351535   {
r15082r15083
18451845//  m6845_personality_t crtc_type;
18461846   int page;
18471847
1848//  crtc_type = input_port_read_safe(machine(), "crtc", 0);
1848//  crtc_type = ioport("crtc"->read_safe(0));
18491849//  m6845_set_personality(crtc_type);
18501850
18511851   if(m_aleste_mode & 0x04)
r15082r15083
22962296   amstrad_GateArray_write(machine, 0x0c0);
22972297
22982298   // Get manufacturer name and TV refresh rate from PCB link (dipswitch for mess emulation)
2299   state->m_ppi_port_inputs[amstrad_ppi_PortB] = (((input_port_read(machine, "solder_links")&MANUFACTURER_NAME)<<1) | (input_port_read(machine, "solder_links")&TV_REFRESH_RATE));
2299   state->m_ppi_port_inputs[amstrad_ppi_PortB] = (((machine.root_device().ioport("solder_links")->read()&MANUFACTURER_NAME)<<1) | (machine.root_device().ioport("solder_links")->read()&TV_REFRESH_RATE));
23002300
23012301   if ( state->m_system_type == SYSTEM_PLUS || state->m_system_type == SYSTEM_GX4000 )
23022302      memset(state->m_asic.ram,0,16384);  // clear ASIC RAM
r15082r15083
26452645      if(m_aleste_mode == 0x08 && ( m_ppi_port_outputs[amstrad_ppi_PortC] & 0x0F ) == 10)
26462646         return 0xff;
26472647
2648      return input_port_read_safe(machine(), keynames[m_ppi_port_outputs[amstrad_ppi_PortC] & 0x0F], 0) & 0xFF;
2648      return machine().root_device().ioport(keynames[m_ppi_port_outputs[amstrad_ppi_PortC] & 0x0F])->read_safe(0) & 0xFF;
26492649   }
26502650}
26512651
r15082r15083
28912891   attoseconds_t refresh;
28922892   int height;
28932893
2894   if ( input_port_read( machine, "solder_links" ) & 0x10 )
2894   if ( machine.root_device().ioport( "solder_links" )->read() & 0x10 )
28952895   {
28962896      /* PAL */
28972897      visarea.set(0, 64 + 640 + 64 - 1, 34, 34 + 15 + 242 + 15 - 1);
src/mess/machine/c64_easyflash.c
r15082r15083
235235 
236236int c64_easyflash_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
237237{
238   return !(BIT(m_mode, 0) | !(BIT(m_mode, 2) | input_port_read(device(), "JP1")));
238   return !(BIT(m_mode, 0) | !(BIT(m_mode, 2) | device().ioport("JP1")->read()));
239239}
src/mess/machine/sms.c
r15082r15083
239239   switch (offset)
240240   {
241241   case 0:
242      switch (input_port_read_safe(machine(), "CTRLSEL", 0x00) & 0x0f)
242      switch (ioport("CTRLSEL")->read_safe(0x00) & 0x0f)
243243      {
244244      case 0x04:   /* Sports Pad */
245245         if (data != m_sports_pad_last_data_1)
r15082r15083
250250            if (cpu_cycles - m_last_sports_pad_time_1 > 512)
251251            {
252252               m_sports_pad_state_1 = 3;
253               m_sports_pad_1_x = input_port_read(machine(), "SPORT0");
254               m_sports_pad_1_y = input_port_read(machine(), "SPORT1");
253               m_sports_pad_1_x = ioport("SPORT0")->read();
254               m_sports_pad_1_y = ioport("SPORT1")->read();
255255            }
256256            m_last_sports_pad_time_1 = cpu_cycles;
257257            m_sports_pad_state_1 = (m_sports_pad_state_1 + 1) & 3;
r15082r15083
261261      break;
262262
263263   case 1:
264      switch (input_port_read_safe(machine(), "CTRLSEL", 0x00) & 0xf0)
264      switch (ioport("CTRLSEL")->read_safe(0x00) & 0xf0)
265265      {
266266      case 0x40:   /* Sports Pad */
267267         if (data != m_sports_pad_last_data_2)
r15082r15083
272272            if (cpu_cycles - m_last_sports_pad_time_2 > 2048)
273273            {
274274               m_sports_pad_state_2 = 3;
275               m_sports_pad_2_x = input_port_read(machine(), "SPORT2");
276               m_sports_pad_2_y = input_port_read(machine(), "SPORT3");
275               m_sports_pad_2_x = ioport("SPORT2")->read();
276               m_sports_pad_2_y = ioport("SPORT3")->read();
277277            }
278278            m_last_sports_pad_time_2 = cpu_cycles;
279279            m_sports_pad_state_2 = (m_sports_pad_state_2 + 1) & 3;
r15082r15083
455455static void lphaser1_sensor_check( running_machine &machine )
456456{
457457   sms_state *state = machine.driver_data<sms_state>();
458   const int x = screen_hpos_nonscaled(*machine.first_screen(), input_port_read(machine, "LPHASER0"));
459   const int y = screen_vpos_nonscaled(*machine.first_screen(), input_port_read(machine, "LPHASER1"));
458   const int x = screen_hpos_nonscaled(*machine.first_screen(), machine.root_device().ioport("LPHASER0")->read());
459   const int y = screen_vpos_nonscaled(*machine.first_screen(), machine.root_device().ioport("LPHASER1")->read());
460460
461461   if (lgun_bright_aim_area(machine, state->m_lphaser_1_timer, x, y))
462462   {
r15082r15083
471471static void lphaser2_sensor_check( running_machine &machine )
472472{
473473   sms_state *state = machine.driver_data<sms_state>();
474   const int x = screen_hpos_nonscaled(*machine.first_screen(), input_port_read(machine, "LPHASER2"));
475   const int y = screen_vpos_nonscaled(*machine.first_screen(), input_port_read(machine, "LPHASER3"));
474   const int x = screen_hpos_nonscaled(*machine.first_screen(), machine.root_device().ioport("LPHASER2")->read());
475   const int y = screen_vpos_nonscaled(*machine.first_screen(), machine.root_device().ioport("LPHASER3")->read());
476476
477477   if (lgun_bright_aim_area(machine, state->m_lphaser_2_timer, x, y))
478478   {
r15082r15083
491491{
492492   sms_state *state = machine.driver_data<sms_state>();
493493
494   if ((input_port_read_safe(machine, "CTRLSEL", 0x00) & 0x0f) == 0x01)
494   if ((state->ioport("CTRLSEL")->read_safe(0x00) & 0x0f) == 0x01)
495495   {
496496      /* enable crosshair */
497497      crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_ALL);
r15082r15083
505505      state->m_lphaser_1_timer->enable(0);
506506   }
507507
508   if ((input_port_read_safe(machine, "CTRLSEL", 0x00) & 0xf0) == 0x10)
508   if ((state->ioport("CTRLSEL")->read_safe(0x00) & 0xf0) == 0x10)
509509   {
510510      /* enable crosshair */
511511      crosshair_set_screen(machine, 1, CROSSHAIR_SCREEN_ALL);
r15082r15083
537537{
538538   sms_state *state = field.machine().driver_data<sms_state>();
539539   if (!state->m_lphaser_1_timer ||
540      (input_port_read_safe(field.machine(), "CTRLSEL", 0x00) & 0x0f) != 0x01)
540      (field.machine().root_device().ioport("CTRLSEL")->read_safe(0x00) & 0x0f) != 0x01)
541541      return;
542542
543543   if (newval != oldval)
r15082r15083
548548{
549549   sms_state *state = field.machine().driver_data<sms_state>();
550550   if (!state->m_lphaser_2_timer ||
551      (input_port_read_safe(field.machine(), "CTRLSEL", 0x00) & 0xf0) != 0x10)
551      (field.machine().root_device().ioport("CTRLSEL")->read_safe(0x00) & 0xf0) != 0x10)
552552      return;
553553
554554   if (newval != oldval)
r15082r15083
576576   machine.scheduler().timer_set(attotime::zero, FUNC(lightgun_tick));
577577
578578   /* Player 1 */
579   switch (input_port_read_safe(machine, "CTRLSEL", 0x00) & 0x0f)
579   switch (machine.root_device().ioport("CTRLSEL")->read_safe(0x00) & 0x0f)
580580   {
581581   case 0x00:  /* Joystick */
582      data = input_port_read(machine, "PORT_DC");
582      data = machine.root_device().ioport("PORT_DC")->read();
583583      /* Check Rapid Fire setting for Button A */
584      if (!(data & 0x10) && (input_port_read(machine, "RFU") & 0x01))
584      if (!(data & 0x10) && (machine.root_device().ioport("RFU")->read() & 0x01))
585585         data |= state->m_rapid_fire_state_1 & 0x10;
586586
587587      /* Check Rapid Fire setting for Button B */
588      if (!(data & 0x20) && (input_port_read(machine, "RFU") & 0x02))
588      if (!(data & 0x20) && (machine.root_device().ioport("RFU")->read() & 0x02))
589589         data |= state->m_rapid_fire_state_1 & 0x20;
590590
591591      state->m_input_port0 = (state->m_input_port0 & 0xc0) | (data & 0x3f);
592592      break;
593593
594594   case 0x01:  /* Light Phaser */
595      data = (input_port_read(machine, "CTRLIPT") & 0x01) << 4;
595      data = (machine.root_device().ioport("CTRLIPT")->read() & 0x01) << 4;
596596      if (!(data & 0x10))
597597      {
598         if (input_port_read(machine, "RFU") & 0x01)
598         if (machine.root_device().ioport("RFU")->read() & 0x01)
599599            data |= state->m_rapid_fire_state_1 & 0x10;
600600      }
601601      /* just consider the button (trigger) bit */
r15082r15083
605605
606606   case 0x02:  /* Paddle Control */
607607      /* Get button A state */
608      data = input_port_read(machine, "PADDLE0");
608      data = machine.root_device().ioport("PADDLE0")->read();
609609
610610      if (state->m_paddle_read_state)
611611         data = data >> 4;
612612
613613      state->m_input_port0 = (state->m_input_port0 & 0xc0) | (data & 0x0f) | (state->m_paddle_read_state & 0x20)
614                      | ((input_port_read(machine, "CTRLIPT") & 0x02) << 3);
614                      | ((machine.root_device().ioport("CTRLIPT")->read() & 0x02) << 3);
615615      break;
616616
617617   case 0x04:   /* Sega Sports Pad */
r15082r15083
630630         data = state->m_sports_pad_1_y & 0x0f;
631631         break;
632632      }
633      state->m_input_port0 = (state->m_input_port0 & 0xc0) | data | ((input_port_read(machine, "CTRLIPT") & 0x0c) << 2);
633      state->m_input_port0 = (state->m_input_port0 & 0xc0) | data | ((machine.root_device().ioport("CTRLIPT")->read() & 0x0c) << 2);
634634      break;
635635   }
636636
637637   /* Player 2 */
638   switch (input_port_read_safe(machine, "CTRLSEL", 0x00)  & 0xf0)
638   switch (machine.root_device().ioport("CTRLSEL")->read_safe(0x00)  & 0xf0)
639639   {
640640   case 0x00:   /* Joystick */
641      data = input_port_read(machine, "PORT_DC");
641      data = machine.root_device().ioport("PORT_DC")->read();
642642      state->m_input_port0 = (state->m_input_port0 & 0x3f) | (data & 0xc0);
643643
644      data = input_port_read(machine, "PORT_DD");
644      data = machine.root_device().ioport("PORT_DD")->read();
645645      /* Check Rapid Fire setting for Button A */
646      if (!(data & 0x04) && (input_port_read(machine, "RFU") & 0x04))
646      if (!(data & 0x04) && (machine.root_device().ioport("RFU")->read() & 0x04))
647647         data |= state->m_rapid_fire_state_2 & 0x04;
648648
649649      /* Check Rapid Fire setting for Button B */
650      if (!(data & 0x08) && (input_port_read(machine, "RFU") & 0x08))
650      if (!(data & 0x08) && (machine.root_device().ioport("RFU")->read() & 0x08))
651651         data |= state->m_rapid_fire_state_2 & 0x08;
652652
653653      state->m_input_port1 = (state->m_input_port1 & 0xf0) | (data & 0x0f);
654654      break;
655655
656656   case 0x10:   /* Light Phaser */
657      data = (input_port_read(machine, "CTRLIPT") & 0x10) >> 2;
657      data = (machine.root_device().ioport("CTRLIPT")->read() & 0x10) >> 2;
658658      if (!(data & 0x04))
659659      {
660         if (input_port_read(machine, "RFU") & 0x04)
660         if (machine.root_device().ioport("RFU")->read() & 0x04)
661661            data |= state->m_rapid_fire_state_2 & 0x04;
662662      }
663663      /* just consider the button (trigger) bit */
r15082r15083
667667
668668   case 0x20:   /* Paddle Control */
669669      /* Get button A state */
670      data = input_port_read(machine, "PADDLE1");
670      data = machine.root_device().ioport("PADDLE1")->read();
671671      if (state->m_paddle_read_state)
672672         data = data >> 4;
673673
674674      state->m_input_port0 = (state->m_input_port0 & 0x3f) | ((data & 0x03) << 6);
675675      state->m_input_port1 = (state->m_input_port1 & 0xf0) | ((data & 0x0c) >> 2) | (state->m_paddle_read_state & 0x08)
676                      | ((input_port_read(machine, "CTRLIPT") & 0x20) >> 3);
676                      | ((machine.root_device().ioport("CTRLIPT")->read() & 0x20) >> 3);
677677      break;
678678
679679   case 0x40:   /* Sega Sports Pad */
r15082r15083
693693         break;
694694      }
695695      state->m_input_port0 = (state->m_input_port0 & 0x3f) | ((data & 0x03) << 6);
696      state->m_input_port1 = (state->m_input_port1 & 0xf0) | (data >> 2) | ((input_port_read(machine, "CTRLIPT") & 0xc0) >> 4);
696      state->m_input_port1 = (state->m_input_port1 & 0xf0) | (data >> 2) | ((machine.root_device().ioport("CTRLIPT")->read() & 0xc0) >> 4);
697697      break;
698698   }
699699}
r15082r15083
781781   if (driver_state->m_is_gamegear && !(driver_state->m_cartridge[driver_state->m_current_cartridge].features & CF_GG_SMS_MODE))
782782      return;
783783
784   if (!(input_port_read(device->machine(), driver_state->m_is_gamegear ? "START" : "PAUSE") & 0x80))
784   if (!(driver_state->ioport(driver_state->m_is_gamegear ? "START" : "PAUSE")->read() & 0x80))
785785   {
786786      if (!driver_state->m_paused)
787787      {
r15082r15083
823823   sms_get_inputs(&space);
824824
825825   /* Reset Button */
826   m_input_port1 = (m_input_port1 & 0xef) | (input_port_read_safe(machine(), "RESET", 0x01) & 0x01) << 4;
826   m_input_port1 = (m_input_port1 & 0xef) | (ioport("RESET")->read_safe(0x01) & 0x01) << 4;
827827
828828   /* Do region detection if TH of ports A and B are set to output (0) */
829829   if (!(m_ctrl_reg & 0x0a))
r15082r15083
877877READ8_MEMBER(sms_state::gg_input_port_2_r)
878878{
879879
880   //logerror("joy 2 read, val: %02x, pc: %04x\n", ((m_is_region_japan ? 0x00 : 0x40) | (input_port_read(machine, "START") & 0x80)), activecpu_get_pc());
881   return ((m_is_region_japan ? 0x00 : 0x40) | (input_port_read(machine(), "START") & 0x80));
880   //logerror("joy 2 read, val: %02x, pc: %04x\n", ((m_is_region_japan ? 0x00 : 0x40) | (machine.root_device().ioport("START")->read() & 0x80)), activecpu_get_pc());
881   return ((m_is_region_japan ? 0x00 : 0x40) | (ioport("START")->read() & 0x80));
882882}
883883
884884
r15082r15083
903903/* The following code comes from sg1000.c. We should eventually merge these TV Draw implementations */
904904WRITE8_MEMBER(sms_state::sms_tvdraw_axis_w)
905905{
906   UINT8 tvboard_on = input_port_read_safe(machine(), "TVDRAW", 0x00);
906   UINT8 tvboard_on = ioport("TVDRAW")->read_safe(0x00);
907907
908908   if (data & 0x01)
909909   {
910      m_cartridge[m_current_cartridge].m_tvdraw_data = tvboard_on ? input_port_read(machine(), "TVDRAW_X") : 0x80;
910      m_cartridge[m_current_cartridge].m_tvdraw_data = tvboard_on ? ioport("TVDRAW_X")->read() : 0x80;
911911
912912      if (m_cartridge[m_current_cartridge].m_tvdraw_data < 4) m_cartridge[m_current_cartridge].m_tvdraw_data = 4;
913913      if (m_cartridge[m_current_cartridge].m_tvdraw_data > 251) m_cartridge[m_current_cartridge].m_tvdraw_data = 251;
914914   }
915915   else
916916   {
917      m_cartridge[m_current_cartridge].m_tvdraw_data = tvboard_on ? input_port_read(machine(), "TVDRAW_Y") + 0x20 : 0x80;
917      m_cartridge[m_current_cartridge].m_tvdraw_data = tvboard_on ? ioport("TVDRAW_Y")->read() + 0x20 : 0x80;
918918   }
919919}
920920
921921READ8_MEMBER(sms_state::sms_tvdraw_status_r)
922922{
923   UINT8 tvboard_on = input_port_read_safe(machine(), "TVDRAW", 0x00);
924   return tvboard_on ? input_port_read(machine(), "TVDRAW_PEN") : 0x01;
923   UINT8 tvboard_on = ioport("TVDRAW")->read_safe(0x00);
924   return tvboard_on ? ioport("TVDRAW_PEN")->read() : 0x01;
925925}
926926
927927READ8_MEMBER(sms_state::sms_tvdraw_data_r)
r15082r15083
22022202
22032203   if (&screen != state->m_main_scr)
22042204   {
2205      sscope = input_port_read_safe(screen.machine(), "SEGASCOPE", 0x00);
2205      sscope = screen.machine().root_device().ioport("SEGASCOPE")->read_safe(0x00);
22062206      if (!sscope)
22072207      {
22082208         occluded_view = 1;
r15082r15083
22292229      // save a copy of current bitmap for the binocular hack
22302230      if (sscope)
22312231      {
2232         sscope_binocular_hack = input_port_read_safe(screen.machine(), "SSCOPE_BINOCULAR", 0x00);
2232         sscope_binocular_hack = screen.machine().root_device().ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
22332233
22342234         if (&screen == state->m_left_lcd)
22352235         {
r15082r15083
22492249      // use the copied bitmap for the binocular hack
22502250      if (sscope)
22512251      {
2252         sscope_binocular_hack = input_port_read_safe(screen.machine(), "SSCOPE_BINOCULAR", 0x00);
2252         sscope_binocular_hack = screen.machine().root_device().ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
22532253
22542254         if (&screen == state->m_left_lcd)
22552255         {
src/mess/machine/nes_pcb.c
r15082r15083
1092710927{
1092810928   nes_state *state = space->machine().driver_data<nes_state>();
1092910929   LOG_MMC(("bmc_vt5201_r, offset: %04x\n", offset));
10930   //  state->m_mmc_dipsetting = input_port_read(space->machine(), "CARTDIPS");
10930   //  state->m_mmc_dipsetting = state->ioport("CARTDIPS")->read();
1093110931
1093210932   if (state->m_mmc_latch1)
1093310933      return state->m_mmc_dipsetting; // cart mode, depending on the Dip Switches (always zero atm, given we have no way to add cart-based DIPs)
r15082r15083
1096210962   nes_state *state = space->machine().driver_data<nes_state>();
1096310963   UINT8 bs5_helper = (offset & 0xc00) >> 10;
1096410964   LOG_MMC(("bmc_bs5_w, offset: %04x, data: %02x\n", offset, data));
10965//  state->m_mmc_dipsetting = input_port_read(space->machine(), "CARTDIPS");
10965//  state->m_mmc_dipsetting = state->ioport("CARTDIPS")->read();
1096610966
1096710967   switch (offset & 0x7000)
1096810968   {
r15082r15083
1107211072{
1107311073   nes_state *state = space->machine().driver_data<nes_state>();
1107411074   LOG_MMC(("bmc_gb63_r, offset: %04x\n", offset));
11075   //  state->m_mmc_dipsetting = input_port_read(space->machine(), "CARTDIPS");
11075   //  state->m_mmc_dipsetting = state->ioport("CARTDIPS")->read();
1107611076
1107711077   if (state->m_mmc_latch1 == 1)
1107811078      return 0xff;   // open bus
src/mess/machine/llc.c
r15082r15083
7575
7676   for(i = 0; i < 12; i++)
7777   {
78      c = input_port_read(machine, keynames[i]);
78      c = machine.root_device().ioport(keynames[i])->read();
7979      if (c != 0)
8080      {
8181         for(j = 0; j < 8; j++)
r15082r15083
181181{
182182   UINT8 *k7659 = device->machine().root_device().memregion("k7659")->base();
183183   UINT8 retVal = 0;
184   UINT8 a1 = input_port_read(device->machine(), "A1");
185   UINT8 a2 = input_port_read(device->machine(), "A2");
186   UINT8 a3 = input_port_read(device->machine(), "A3");
187   UINT8 a4 = input_port_read(device->machine(), "A4");
188   UINT8 a5 = input_port_read(device->machine(), "A5");
189   UINT8 a6 = input_port_read(device->machine(), "A6");
190   UINT8 a7 = input_port_read(device->machine(), "A7");
191   UINT8 a8 = input_port_read(device->machine(), "A8");
192   UINT8 a9 = input_port_read(device->machine(), "A9");
193   UINT8 a10 = input_port_read(device->machine(), "A10");
194   UINT8 a11 = input_port_read(device->machine(), "A11");
195   UINT8 a12 = input_port_read(device->machine(), "A12");
184   UINT8 a1 = device->machine().root_device().ioport("A1")->read();
185   UINT8 a2 = device->machine().root_device().ioport("A2")->read();
186   UINT8 a3 = device->machine().root_device().ioport("A3")->read();
187   UINT8 a4 = device->machine().root_device().ioport("A4")->read();
188   UINT8 a5 = device->machine().root_device().ioport("A5")->read();
189   UINT8 a6 = device->machine().root_device().ioport("A6")->read();
190   UINT8 a7 = device->machine().root_device().ioport("A7")->read();
191   UINT8 a8 = device->machine().root_device().ioport("A8")->read();
192   UINT8 a9 = device->machine().root_device().ioport("A9")->read();
193   UINT8 a10 = device->machine().root_device().ioport("A10")->read();
194   UINT8 a11 = device->machine().root_device().ioport("A11")->read();
195   UINT8 a12 = device->machine().root_device().ioport("A12")->read();
196196   UINT16 code = 0;
197197   if (a1!=0) {
198198      code = 0x10 + key_pos(a1);
src/mess/machine/odyssey2.c
r15082r15083
170170   {
171171      if ((m_p2 & P2_KEYBOARD_SELECT_MASK) <= 5)  /* read keyboard */
172172      {
173         h &= input_port_read(machine(), keynames[m_p2 & P2_KEYBOARD_SELECT_MASK]);
173         h &= ioport(keynames[m_p2 & P2_KEYBOARD_SELECT_MASK])->read();
174174      }
175175
176176      for (i= 0x80, j = 0; i > 0; i >>= 1, j++)
r15082r15083
207207    UINT8 data = 0xff;
208208
209209    if ((m_p2 & P2_KEYBOARD_SELECT_MASK) == 1)
210      data &= input_port_read(machine(), "JOY0");       /* read joystick 1 */
210      data &= ioport("JOY0")->read();       /* read joystick 1 */
211211
212212    if ((m_p2 & P2_KEYBOARD_SELECT_MASK) == 0)
213      data &= input_port_read(machine(), "JOY1");       /* read joystick 2 */
213      data &= ioport("JOY1")->read();       /* read joystick 2 */
214214
215215    logerror("%.6f bus read %.2x\n", machine().time().as_double(), data);
216216    return data;
src/mess/machine/ti85.c
r15082r15083
1818static TIMER_CALLBACK(ti85_timer_callback)
1919{
2020   ti85_state *state = machine.driver_data<ti85_state>();
21   if (input_port_read(machine, "ON") & 0x01)
21   if (machine.root_device().ioport("ON")->read() & 0x01)
2222   {
2323      if (state->m_ON_interrupt_mask && !state->m_ON_pressed)
2424      {
r15082r15083
246246      {
247247         for (port = 0; port < 8; port++)
248248         {
249            data ^= input_port_read(machine(), bitnames[port]) & (0x01<<bit) ? 0x01<<port : 0x00;
249            data ^= ioport(bitnames[port])->read() & (0x01<<bit) ? 0x01<<port : 0x00;
250250         }
251251      }
252252   }
src/mess/machine/s100_mm65k16s.c
r15082r15083
118118   PORT_DIPSETTING(    0x00, "Bank Select" )
119119
120120   PORT_START("1C")
121   PORT_DIPNAME( 0xff, 0x00, "Extended Addressing" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x01)
121   PORT_DIPNAME( 0xff, 0x00, "Extended Addressing" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x01)
122122   PORT_DIPSETTING(    0x00, "000000H" )
123123   // ...
124124   PORT_DIPSETTING(    0xff, "FF0000H" )
125   PORT_DIPNAME( 0xff, 0x40, "Bank Select Port" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
125   PORT_DIPNAME( 0xff, 0x40, "Bank Select Port" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
126126   PORT_DIPSETTING(    0x00, "00H" )
127127   // ...
128128   PORT_DIPSETTING(    0x40, "40H" )
r15082r15083
130130   PORT_DIPSETTING(    0xff, "FFH" )
131131
132132   PORT_START("A0A7")
133   PORT_DIPNAME( 0x01, 0x01, "Bank Select Data Bit A0" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
133   PORT_DIPNAME( 0x01, 0x01, "Bank Select Data Bit A0" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
134134   PORT_DIPSETTING(    0x00, "0" )
135135   PORT_DIPSETTING(    0x01, "1" )
136   PORT_DIPNAME( 0x02, 0x00, "Bank Select Data Bit A1" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
136   PORT_DIPNAME( 0x02, 0x00, "Bank Select Data Bit A1" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
137137   PORT_DIPSETTING(    0x00, "0" )
138138   PORT_DIPSETTING(    0x02, "1" )
139   PORT_DIPNAME( 0x04, 0x00, "Bank Select Data Bit A2" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
139   PORT_DIPNAME( 0x04, 0x00, "Bank Select Data Bit A2" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
140140   PORT_DIPSETTING(    0x00, "0" )
141141   PORT_DIPSETTING(    0x04, "1" )
142   PORT_DIPNAME( 0x08, 0x00, "Bank Select Data Bit A3" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
142   PORT_DIPNAME( 0x08, 0x00, "Bank Select Data Bit A3" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
143143   PORT_DIPSETTING(    0x00, "0" )
144144   PORT_DIPSETTING(    0x08, "1" )
145   PORT_DIPNAME( 0x10, 0x00, "Bank Select Data Bit A4" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
145   PORT_DIPNAME( 0x10, 0x00, "Bank Select Data Bit A4" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
146146   PORT_DIPSETTING(    0x00, "0" )
147147   PORT_DIPSETTING(    0x10, "1" )
148   PORT_DIPNAME( 0x20, 0x00, "Bank Select Data Bit A5" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
148   PORT_DIPNAME( 0x20, 0x00, "Bank Select Data Bit A5" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
149149   PORT_DIPSETTING(    0x00, "0" )
150150   PORT_DIPSETTING(    0x20, "1" )
151   PORT_DIPNAME( 0x40, 0x00, "Bank Select Data Bit A6" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
151   PORT_DIPNAME( 0x40, 0x00, "Bank Select Data Bit A6" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
152152   PORT_DIPSETTING(    0x00, "0" )
153153   PORT_DIPSETTING(    0x40, "1" )
154   PORT_DIPNAME( 0x80, 0x00, "Bank Select Data Bit A7" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
154   PORT_DIPNAME( 0x80, 0x00, "Bank Select Data Bit A7" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
155155   PORT_DIPSETTING(    0x00, "0" )
156156   PORT_DIPSETTING(    0x80, "1" )
157157
158158   PORT_START("0B7B")
159   PORT_DIPNAME( 0x01, 0x00, "Bank Select Data Bit 0B" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
159   PORT_DIPNAME( 0x01, 0x00, "Bank Select Data Bit 0B" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
160160   PORT_DIPSETTING(    0x00, "0" )
161161   PORT_DIPSETTING(    0x01, "1" )
162   PORT_DIPNAME( 0x02, 0x00, "Bank Select Data Bit 1B" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
162   PORT_DIPNAME( 0x02, 0x00, "Bank Select Data Bit 1B" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
163163   PORT_DIPSETTING(    0x00, "0" )
164164   PORT_DIPSETTING(    0x02, "1" )
165   PORT_DIPNAME( 0x04, 0x00, "Bank Select Data Bit 2B" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
165   PORT_DIPNAME( 0x04, 0x00, "Bank Select Data Bit 2B" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
166166   PORT_DIPSETTING(    0x00, "0" )
167167   PORT_DIPSETTING(    0x04, "1" )
168   PORT_DIPNAME( 0x08, 0x00, "Bank Select Data Bit 3B" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
168   PORT_DIPNAME( 0x08, 0x00, "Bank Select Data Bit 3B" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
169169   PORT_DIPSETTING(    0x00, "0" )
170170   PORT_DIPSETTING(    0x08, "1" )
171   PORT_DIPNAME( 0x10, 0x00, "Bank Select Data Bit 4B" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
171   PORT_DIPNAME( 0x10, 0x00, "Bank Select Data Bit 4B" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
172172   PORT_DIPSETTING(    0x00, "0" )
173173   PORT_DIPSETTING(    0x10, "1" )
174   PORT_DIPNAME( 0x20, 0x00, "Bank Select Data Bit 5B" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
174   PORT_DIPNAME( 0x20, 0x00, "Bank Select Data Bit 5B" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
175175   PORT_DIPSETTING(    0x00, "0" )
176176   PORT_DIPSETTING(    0x20, "1" )
177   PORT_DIPNAME( 0x40, 0x00, "Bank Select Data Bit 6B" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
177   PORT_DIPNAME( 0x40, 0x00, "Bank Select Data Bit 6B" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
178178   PORT_DIPSETTING(    0x00, "0" )
179179   PORT_DIPSETTING(    0x40, "1" )
180   PORT_DIPNAME( 0x80, 0x00, "Bank Select Data Bit 7B" ) PORT_CONDITION("J3", 0x01, PORTCOND_EQUALS, 0x00)
180   PORT_DIPNAME( 0x80, 0x00, "Bank Select Data Bit 7B" ) PORT_CONDITION("J3", 0x01, EQUALS, 0x00)
181181   PORT_DIPSETTING(    0x00, "0" )
182182   PORT_DIPSETTING(    0x80, "1" )
183183INPUT_PORTS_END
src/mess/machine/galaxy.c
r15082r15083
2828   }
2929   else
3030   {
31      return input_port_read(machine(), keynames[(offset>>3) & 0x07]) & (0x01<<(offset & 0x07)) ? 0xfe : 0xff;
31      return ioport(keynames[(offset>>3) & 0x07])->read() & (0x01<<(offset & 0x07)) ? 0xfe : 0xff;
3232   }
3333}
3434
r15082r15083
176176   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
177177
178178   /* ROM 2 enable/disable */
179   if (input_port_read(machine, "ROM2")) {
179   if (machine.root_device().ioport("ROM2")->read()) {
180180      space->install_read_bank(0x1000, 0x1fff, "bank10");
181181   } else {
182182      space->nop_read(0x1000, 0x1fff);
183183   }
184184   space->nop_write(0x1000, 0x1fff);
185185
186   if (input_port_read(machine, "ROM2"))
186   if (machine.root_device().ioport("ROM2")->read())
187187      state->membank("bank10")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1000);
188188
189189   device_set_irq_callback(machine.device("maincpu"), galaxy_irq_callback);
src/mess/machine/gamepock.c
r15082r15083
119119
120120   if ( m_port_a & 0x80 )
121121   {
122      data &= input_port_read(machine(), "IN0");
122      data &= ioport("IN0")->read();
123123   }
124124
125125   if ( m_port_a & 0x40 )
126126   {
127      data &= input_port_read(machine(), "IN1");
127      data &= ioport("IN1")->read();
128128   }
129129
130130   return data;
src/mess/machine/v1050kb.c
r15082r15083
303303 
304304   switch (m_y)
305305   {
306      case 0: data &= input_port_read(*this, "X0"); break;
307      case 1: data &= input_port_read(*this, "X1"); break;
308      case 2: data &= input_port_read(*this, "X2"); break;
309      case 3: data &= input_port_read(*this, "X3"); break;
310      case 4: data &= input_port_read(*this, "X4"); break;
311      case 5: data &= input_port_read(*this, "X5"); break;
312      case 6: data &= input_port_read(*this, "X6"); break;
313      case 7: data &= input_port_read(*this, "X7"); break;
314      case 8: data &= input_port_read(*this, "X8"); break;
315      case 9: data &= input_port_read(*this, "X9"); break;
316      case 0xa: data &= input_port_read(*this, "XA"); break;
317      case 0xb: data &= input_port_read(*this, "XB"); break;
306      case 0: data &= ioport("X0")->read(); break;
307      case 1: data &= ioport("X1")->read(); break;
308      case 2: data &= ioport("X2")->read(); break;
309      case 3: data &= ioport("X3")->read(); break;
310      case 4: data &= ioport("X4")->read(); break;
311      case 5: data &= ioport("X5")->read(); break;
312      case 6: data &= ioport("X6")->read(); break;
313      case 7: data &= ioport("X7")->read(); break;
314      case 8: data &= ioport("X8")->read(); break;
315      case 9: data &= ioport("X9")->read(); break;
316      case 0xa: data &= ioport("XA")->read(); break;
317      case 0xb: data &= ioport("XB")->read(); break;
318318   }
319319 
320320   return data;
src/mess/machine/compis.c
r15082r15083
107107
108108   for (irow = 0; irow < 6; irow++)
109109   {
110      data = input_port_read(machine, rownames[irow]);
110      data = machine.root_device().ioport(rownames[irow])->read();
111111      if (data != 0)
112112      {
113113         ibit = 1;
r15082r15083
171171void compis_state::compis_fdc_tc(int state)
172172{
173173   /* Terminal count if iSBX-218A has DMA enabled */
174   if (input_port_read(machine(), "DSW1"))
174   if (ioport("DSW1")->read())
175175   {
176176      upd765_tc_w(m_fdc, state);
177177   }
r15082r15083
180180WRITE_LINE_MEMBER( compis_state::compis_fdc_int )
181181{
182182   /* No interrupt requests if iSBX-218A has DMA enabled */
183   if (!input_port_read(machine(), "DSW1") && state)
183   if (!ioport("DSW1")->read() && state)
184184   {
185185      if (m_8259m)
186186      {
r15082r15083
193193WRITE_LINE_MEMBER( compis_state::compis_fdc_dma_drq )
194194{
195195   /* DMA requst if iSBX-218A has DMA enabled */
196   if (input_port_read(machine(), "DSW1") && state)
196   if (ioport("DSW1")->read() && state)
197197   {
198198      //compis_dma_drq(state, read);
199199   }
r15082r15083
213213   UINT16 data;
214214   data = 0xffff;
215215   /* DMA acknowledge if iSBX-218A has DMA enabled */
216   if (input_port_read(machine(), "DSW1"))
216   if (ioport("DSW1")->read())
217217   {
218218      data = upd765_dack_r(m_fdc, 0);
219219   }
r15082r15083
271271   UINT8 data;
272272
273273   /* DIP switch - Test mode */
274   data = input_port_read(machine(), "DSW0");
274   data = ioport("DSW0")->read();
275275
276276   /* Centronics busy */
277277   data |= m_centronics->busy_r() << 5;
src/mess/machine/vtech2.c
r15082r15083
211211   {
212212      if( (offs & 0x0300) == 0x0000 ) /* keyboard row A */
213213      {
214         if( input_port_read(machine, "ROWA") != state->m_row_a )
214         if( machine.root_device().ioport("ROWA")->read() != state->m_row_a )
215215         {
216            state->m_row_a = input_port_read(machine, "ROWA");
216            state->m_row_a = machine.root_device().ioport("ROWA")->read();
217217            data &= state->m_row_a;
218218         }
219219      }
220220      if( (offs & 0x0300) == 0x0100 ) /* keyboard row B */
221221      {
222         if( input_port_read(machine, "ROWB") != state->m_row_b )
222         if( machine.root_device().ioport("ROWB")->read() != state->m_row_b )
223223         {
224            state->m_row_b = input_port_read(machine, "ROWB");
224            state->m_row_b = machine.root_device().ioport("ROWB")->read();
225225            data &= state->m_row_b;
226226         }
227227      }
228228      if( (offs & 0x0300) == 0x0200 ) /* keyboard row C */
229229      {
230         if( input_port_read(machine, "ROWC") != state->m_row_c )
230         if( machine.root_device().ioport("ROWC")->read() != state->m_row_c )
231231         {
232            state->m_row_c = input_port_read(machine, "ROWC");
232            state->m_row_c = machine.root_device().ioport("ROWC")->read();
233233            data &= state->m_row_c;
234234         }
235235      }
236236      if( (offs & 0x0300) == 0x0300 ) /* keyboard row D */
237237      {
238         if( input_port_read(machine, "ROWD") != state->m_row_d )
238         if( machine.root_device().ioport("ROWD")->read() != state->m_row_d )
239239         {
240            state->m_row_d = input_port_read(machine, "ROWD");
240            state->m_row_d = machine.root_device().ioport("ROWD")->read();
241241            data &= state->m_row_d;
242242         }
243243      }
r15082r15083
246246   {
247247      /* All Lasers keyboard rows 0 through 7 */
248248        if( !(offs & 0x01) )
249         data &= input_port_read(machine, "ROW0");
249         data &= machine.root_device().ioport("ROW0")->read();
250250      if( !(offs & 0x02) )
251         data &= input_port_read(machine, "ROW1");
251         data &= machine.root_device().ioport("ROW1")->read();
252252      if( !(offs & 0x04) )
253         data &= input_port_read(machine, "ROW2");
253         data &= machine.root_device().ioport("ROW2")->read();
254254      if( !(offs & 0x08) )
255         data &= input_port_read(machine, "ROW3");
255         data &= machine.root_device().ioport("ROW3")->read();
256256      if( !(offs & 0x10) )
257         data &= input_port_read(machine, "ROW4");
257         data &= machine.root_device().ioport("ROW4")->read();
258258      if( !(offs & 0x20) )
259         data &= input_port_read(machine, "ROW5");
259         data &= machine.root_device().ioport("ROW5")->read();
260260      if( !(offs & 0x40) )
261         data &= input_port_read(machine, "ROW6");
261         data &= machine.root_device().ioport("ROW6")->read();
262262      if( !(offs & 0x80) )
263         data &= input_port_read(machine, "ROW7");
263         data &= machine.root_device().ioport("ROW7")->read();
264264   }
265265
266266    /* what's bit 7 good for? tape input maybe? */
src/mess/machine/zx.c
r15082r15083
111111   if (offs == 0xfe)
112112   {
113113      if ((offset & 0x0100) == 0)
114         data &= input_port_read(machine(), "ROW0");
114         data &= ioport("ROW0")->read();
115115      if ((offset & 0x0200) == 0)
116         data &= input_port_read(machine(), "ROW1");
116         data &= ioport("ROW1")->read();
117117      if ((offset & 0x0400) == 0)
118         data &= input_port_read(machine(), "ROW2");
118         data &= ioport("ROW2")->read();
119119      if ((offset & 0x0800) == 0)
120         data &= input_port_read(machine(), "ROW3");
120         data &= ioport("ROW3")->read();
121121      if ((offset & 0x1000) == 0)
122         data &= input_port_read(machine(), "ROW4");
122         data &= ioport("ROW4")->read();
123123      if ((offset & 0x2000) == 0)
124         data &= input_port_read(machine(), "ROW5");
124         data &= ioport("ROW5")->read();
125125      if ((offset & 0x4000) == 0)
126         data &= input_port_read(machine(), "ROW6");
126         data &= ioport("ROW6")->read();
127127      if ((offset & 0x8000) == 0)
128         data &= input_port_read(machine(), "ROW7");
128         data &= ioport("ROW7")->read();
129129
130      if (!input_port_read(machine(), "CONFIG"))
130      if (!ioport("CONFIG")->read())
131131         data &= ~0x40;
132132
133133      machine().device<cassette_image_device>(CASSETTE_TAG)->output(+1.0);
r15082r15083
168168   if (offs == 0xfe)
169169   {
170170      if ((offset & 0x0100) == 0)
171         data &= input_port_read(machine(), "ROW0");
171         data &= ioport("ROW0")->read();
172172      if ((offset & 0x0200) == 0)
173         data &= input_port_read(machine(), "ROW1");
173         data &= ioport("ROW1")->read();
174174      if ((offset & 0x0400) == 0)
175         data &= input_port_read(machine(), "ROW2");
175         data &= ioport("ROW2")->read();
176176      if ((offset & 0x0800) == 0)
177         data &= input_port_read(machine(), "ROW3");
177         data &= ioport("ROW3")->read();
178178      if ((offset & 0x1000) == 0)
179         data &= input_port_read(machine(), "ROW4");
179         data &= ioport("ROW4")->read();
180180      if ((offset & 0x2000) == 0)
181         data &= input_port_read(machine(), "ROW5");
181         data &= ioport("ROW5")->read();
182182      if ((offset & 0x4000) == 0)
183         data &= input_port_read(machine(), "ROW6");
183         data &= ioport("ROW6")->read();
184184      if ((offset & 0x8000) == 0)
185         data &= input_port_read(machine(), "ROW7");
185         data &= ioport("ROW7")->read();
186186
187      if (!input_port_read(machine(), "CONFIG"))
187      if (!ioport("CONFIG")->read())
188188         data &= ~0x40;
189189
190190      machine().device<cassette_image_device>(CASSETTE_TAG)->output(+1.0);
r15082r15083
235235   if (offs == 0xfe)
236236   {
237237      if ((offset & 0x0100) == 0)
238         data &= input_port_read(machine(), "ROW0");
238         data &= ioport("ROW0")->read();
239239      if ((offset & 0x0200) == 0)
240         data &= input_port_read(machine(), "ROW1");
240         data &= ioport("ROW1")->read();
241241      if ((offset & 0x0400) == 0)
242         data &= input_port_read(machine(), "ROW2");
242         data &= ioport("ROW2")->read();
243243      if ((offset & 0x0800) == 0)
244         data &= input_port_read(machine(), "ROW3");
244         data &= ioport("ROW3")->read();
245245      if ((offset & 0x1000) == 0)
246         data &= input_port_read(machine(), "ROW4");
246         data &= ioport("ROW4")->read();
247247      if ((offset & 0x2000) == 0)
248         data &= input_port_read(machine(), "ROW5");
248         data &= ioport("ROW5")->read();
249249      if ((offset & 0x4000) == 0)
250         data &= input_port_read(machine(), "ROW6");
250         data &= ioport("ROW6")->read();
251251      if ((offset & 0x8000) == 0)
252         data &= input_port_read(machine(), "ROW7");
252         data &= ioport("ROW7")->read();
253253
254254      machine().device<cassette_image_device>(CASSETTE_TAG)->output(+1.0);
255255
r15082r15083
292292
293293   if (offs == 0x7e)
294294   {
295      data = (input_port_read(machine(), "CONFIG"));
295      data = (ioport("CONFIG")->read());
296296   }
297297   else
298298   if (offs == 0xf5)
r15082r15083
304304   if (offs == 0xfe)
305305   {
306306      if ((offset & 0x0100) == 0)
307         data &= input_port_read(machine(), "ROW0");
307         data &= ioport("ROW0")->read();
308308      if ((offset & 0x0200) == 0)
309         data &= input_port_read(machine(), "ROW1");
309         data &= ioport("ROW1")->read();
310310      if ((offset & 0x0400) == 0)
311         data &= input_port_read(machine(), "ROW2");
311         data &= ioport("ROW2")->read();
312312      if ((offset & 0x0800) == 0)
313         data &= input_port_read(machine(), "ROW3");
313         data &= ioport("ROW3")->read();
314314      if ((offset & 0x1000) == 0)
315         data &= input_port_read(machine(), "ROW4");
315         data &= ioport("ROW4")->read();
316316      if ((offset & 0x2000) == 0)
317         data &= input_port_read(machine(), "ROW5");
317         data &= ioport("ROW5")->read();
318318      if ((offset & 0x4000) == 0)
319         data &= input_port_read(machine(), "ROW6");
319         data &= ioport("ROW6")->read();
320320      if ((offset & 0x8000) == 0)
321         data &= input_port_read(machine(), "ROW7");
321         data &= ioport("ROW7")->read();
322322
323323      machine().device<cassette_image_device>(CASSETTE_TAG)->output(+1.0);
324324
src/mess/machine/abc99.c
r15082r15083
693693
694694    */
695695
696   UINT8 data = input_port_read(*this, "Z14") << 5;
696   UINT8 data = ioport("Z14")->read() << 5;
697697
698698   return data;
699699}
r15082r15083
743743   UINT8 data = 0;
744744
745745   // mouse buttons
746   data |= (input_port_read(*this, "MOUSEB") & 0x07) << 4;
746   data |= (ioport("MOUSEB")->read() & 0x07) << 4;
747747
748748   // serial input
749749   data |= m_si << 7;
src/mess/machine/pc1401.c
r15082r15083
4646   int data = state->m_outa;
4747
4848   if (state->m_outb & 0x01)
49      data |= input_port_read(device->machine(), "KEY0");
49      data |= device->machine().root_device().ioport("KEY0")->read();
5050
5151   if (state->m_outb & 0x02)
52      data |= input_port_read(device->machine(), "KEY1");
52      data |= device->machine().root_device().ioport("KEY1")->read();
5353
5454   if (state->m_outb & 0x04)
55      data |= input_port_read(device->machine(), "KEY2");
55      data |= device->machine().root_device().ioport("KEY2")->read();
5656
5757   if (state->m_outb & 0x08)
58      data |= input_port_read(device->machine(), "KEY3");
58      data |= device->machine().root_device().ioport("KEY3")->read();
5959
6060   if (state->m_outb & 0x10)
61      data |= input_port_read(device->machine(), "KEY4");
61      data |= device->machine().root_device().ioport("KEY4")->read();
6262
6363   if (state->m_outb & 0x20)
6464   {
65      data |= input_port_read(device->machine(), "KEY5");
65      data |= state->ioport("KEY5")->read();
6666
6767      /* At Power Up we fake a 'C-CE' pressure */
6868      if (state->m_power)
r15082r15083
7070   }
7171
7272   if (state->m_outa & 0x01)
73      data |= input_port_read(device->machine(), "KEY6");
73      data |= device->machine().root_device().ioport("KEY6")->read();
7474
7575   if (state->m_outa & 0x02)
76      data |= input_port_read(device->machine(), "KEY7");
76      data |= device->machine().root_device().ioport("KEY7")->read();
7777
7878   if (state->m_outa & 0x04)
79      data |= input_port_read(device->machine(), "KEY8");
79      data |= device->machine().root_device().ioport("KEY8")->read();
8080
8181   if (state->m_outa & 0x08)
82      data |= input_port_read(device->machine(), "KEY9");
82      data |= device->machine().root_device().ioport("KEY9")->read();
8383
8484   if (state->m_outa & 0x10)
85      data |= input_port_read(device->machine(), "KEY10");
85      data |= device->machine().root_device().ioport("KEY10")->read();
8686
8787   if (state->m_outa & 0x20)
88      data |= input_port_read(device->machine(), "KEY11");
88      data |= device->machine().root_device().ioport("KEY11")->read();
8989
9090   if (state->m_outa & 0x40)
91      data |= input_port_read(device->machine(), "KEY12");
91      data |= device->machine().root_device().ioport("KEY12")->read();
9292
9393   return data;
9494}
r15082r15083
9898   pc1401_state *state = device->machine().driver_data<pc1401_state>();
9999   int data=state->m_outb;
100100
101   if (input_port_read(device->machine(), "EXTRA") & 0x04)
101   if (state->ioport("EXTRA")->read() & 0x04)
102102      data |= 0x01;
103103
104104   return data;
r15082r15083
106106
107107int pc1401_brk(device_t *device)
108108{
109   return (input_port_read(device->machine(), "EXTRA") & 0x01);
109   return (device->machine().root_device().ioport("EXTRA")->read() & 0x01);
110110}
111111
112112int pc1401_reset(device_t *device)
113113{
114   return (input_port_read(device->machine(), "EXTRA") & 0x02);
114   return (device->machine().root_device().ioport("EXTRA")->read() & 0x02);
115115}
116116
117117MACHINE_START( pc1401 )
src/mess/machine/isa_gus.c
r15082r15083
14281428      attotime new_time = machine().time();
14291429
14301430      {
1431         data = input_port_read(*this, "gus_joy") | 0x0f;
1431         data = ioport("gus_joy")->read() | 0x0f;
14321432
14331433         {
14341434            delta = ((new_time - m_joy_time) * 256 * 1000).seconds;
14351435
1436            if (input_port_read(*this, "gus_joy_1") < delta) data &= ~0x01;
1437            if (input_port_read(*this, "gus_joy_2") < delta) data &= ~0x02;
1436            if (ioport("gus_joy_1")->read() < delta) data &= ~0x01;
1437            if (ioport("gus_joy_2")->read() < delta) data &= ~0x02;
14381438         }
14391439      }
14401440      return data;
src/mess/machine/mac.c
r15082r15083
585585
586586   for (i=0; i<7; i++)
587587   {
588      keybuf = input_port_read(machine, keynames[i]);
588      keybuf = machine.root_device().ioport(keynames[i])->read();
589589
590590      if (keybuf != mac->m_key_matrix[i])
591591      {
r15082r15083
856856   int      x_needs_update = 0, y_needs_update = 0;
857857   mac_state *mac = machine().driver_data<mac_state>();
858858
859   new_mx = input_port_read(machine(), "MOUSE1");
860   new_my = input_port_read(machine(), "MOUSE2");
859   new_mx = ioport("MOUSE1")->read();
860   new_my = ioport("MOUSE2")->read();
861861
862862   /* see if it moved in the x coord */
863863   if (new_mx != last_mx)
r15082r15083
13801380            val |= 0x20;
13811381         if (mac->m_mouse_bit_x)   /* Mouse X2 */
13821382            val |= 0x10;
1383         if ((input_port_read(device->machine(), "MOUSE0") & 0x01) == 0)
1383         if ((device->machine().root_device().ioport("MOUSE0")->read() & 0x01) == 0)
13841384            val |= 0x08;
13851385      }
13861386      if (mac->m_rtc_data_out)
src/mess/machine/abc800kb.c
r15082r15083
444444 
445445    if (m_stb && m_row < 12)
446446    {
447        data = input_port_read(*this, ABC800_KEY_ROW[m_row]);
447        data = ioport(ABC800_KEY_ROW[m_row])->read();
448448    }
449449 
450450    return data;
src/mess/machine/concept.c
r15082r15083
156156
157157   for(i = 0; (i < /*4*/3) && (state->m_KeyQueueLen <= (KeyQueueSize-MaxKeyMessageLen)); i++)
158158   {
159      keystate = input_port_read(machine, keynames[2*i]) | (input_port_read(machine, keynames[2*i + 1]) << 16);
159      keystate = machine.root_device().ioport(keynames[2*i])->read() | (machine.root_device().ioport(keynames[2*i + 1])->read() << 16);
160160      key_transitions = keystate ^ state->m_KeyStateSave[i];
161161      if(key_transitions)
162162      {
r15082r15083
229229{
230230   UINT8 status;
231231
232   status = ((input_port_read(device->machine(), "DSW0") & 0x80) >> 1) | ((input_port_read(device->machine(), "DSW0") & 0x40) << 1);
232   status = ((device->machine().root_device().ioport("DSW0")->read() & 0x80) >> 1) | ((device->machine().root_device().ioport("DSW0")->read() & 0x40) << 1);
233233   LOG(("via_in_b: VIA port B (DIP switches, Video, Comm Rate) - status: 0x%2.2x\n", status));
234234   return status;
235235}
src/mess/machine/mboard.c
r15082r15083
315315
316316/* check click on border pieces */
317317   i=0;
318   port_input=input_port_read(machine, "B_BLACK");
318   port_input=machine.root_device().ioport("B_BLACK")->read();
319319   if (port_input)
320320   {
321321      i=get_first_bit(port_input)+6;
322322      click_on_border_piece=TRUE;
323323   }
324324
325   port_input=input_port_read(machine, "B_WHITE");
325   port_input=machine.root_device().ioport("B_WHITE")->read();
326326   if (port_input)
327327   {
328328      i=get_first_bit(port_input);
r15082r15083
359359
360360
361361/* check click on board */
362   data = input_port_read_safe(machine, keynames[board_row], 0xff);
362   data = machine.root_device().ioport(keynames[board_row])->read_safe(0xff);
363363
364364   if ((data != 0xff) && (!mouse_down) )
365365   {
r15082r15083
406406      mouse_down = 0;
407407
408408/* check click on border - remove selected piece*/
409   if (input_port_read_safe(machine, "LINE10", 0x01))
409   if (machine.root_device().ioport("LINE10")->read_safe(0x01))
410410   {
411411      if (mouse_hold.piece)
412412      {
r15082r15083
427427   if (data == 0xff)
428428   {
429429
430      port_input=input_port_read(machine, "B_BUTTONS");
430      port_input=machine.root_device().ioport("B_BUTTONS")->read();
431431      if (port_input==0x01)
432432      {
433433         clear_board();
src/mess/machine/msx.c
r15082r15083
530530TIMER_DEVICE_CALLBACK( msx2_interrupt )
531531{
532532   msx_state *state = timer.machine().driver_data<msx_state>();
533   state->m_v9938->set_sprite_limit(input_port_read(timer.machine(), "DSW") & 0x20);
534   state->m_v9938->set_resolution(input_port_read(timer.machine(), "DSW") & 0x03);
533   state->m_v9938->set_sprite_limit(timer.machine().root_device().ioport("DSW")->read() & 0x20);
534   state->m_v9938->set_resolution(timer.machine().root_device().ioport("DSW")->read() & 0x03);
535535   state->m_v9938->interrupt();
536536}
537537
r15082r15083
542542
543543   for (i=0; i<2; i++)
544544   {
545      state->m_mouse[i] = input_port_read(device->machine(), i ? "MOUSE1" : "MOUSE0");
545      state->m_mouse[i] = state->ioport(i ? "MOUSE1" : "MOUSE0")->read();
546546      state->m_mouse_stat[i] = -1;
547547   }
548548}
r15082r15083
558558
559559   data = (m_cass->input() > 0.0038 ? 0x80 : 0);
560560
561   if ( (m_psg_b ^ input_port_read(machine(), "DSW") ) & 0x40)
561   if ( (m_psg_b ^ ioport("DSW")->read() ) & 0x40)
562562   {
563563      /* game port 2 */
564      UINT8 inp = input_port_read(machine(), "JOY1");
564      UINT8 inp = ioport("JOY1")->read();
565565      if ( !(inp & 0x80) )
566566      {
567567         /* joystick */
r15082r15083
580580   else
581581   {
582582      /* game port 1 */
583      UINT8 inp = input_port_read(machine(), "JOY0");
583      UINT8 inp = ioport("JOY0")->read();
584584      if ( !(inp & 0x80) )
585585      {
586586         /* joystick */
r15082r15083
634634
635635WRITE8_DEVICE_HANDLER( msx_printer_data_w )
636636{
637   if (input_port_read(device->machine(), "DSW") & 0x80)
637   if (device->machine().root_device().ioport("DSW")->read() & 0x80)
638638      /* SIMPL emulation */
639639      dac_signed_data_w(device->machine().device("dac"), data);
640640   else
r15082r15083
645645{
646646   UINT8 result = 0xfd;
647647
648   if (input_port_read(device->machine(), "DSW") & 0x80)
648   if (device->machine().root_device().ioport("DSW")->read() & 0x80)
649649      return 0xff;
650650
651651   result |= device->machine().device<centronics_device>("centronics")->busy_r() << 1;
r15082r15083
798798   row = keylatch;
799799   if (row <= 10)
800800   {
801      data = input_port_read(machine(), keynames[row / 2]);
801      data = ioport(keynames[row / 2])->read();
802802
803803      if (BIT(row, 0))
804804         data >>= 8;
src/mess/machine/mz700.c
r15082r15083
127127   UINT8 data = 0;
128128
129129   data |= m_other_timer;
130   data |= input_port_read(machine(), "JOY");
130   data |= ioport("JOY")->read();
131131   data |= machine().primary_screen->hblank() << 7;
132132
133133   LOG(1, "mz700_e008_r", ("%02X\n", data), machine());
r15082r15083
443443
444444   switch (key_line)
445445   {
446   case 1 << 0: return input_port_read(device->machine(), "ROW0");
447   case 1 << 1: return input_port_read(device->machine(), "ROW1");
448   case 1 << 2: return input_port_read(device->machine(), "ROW2");
449   case 1 << 3: return input_port_read(device->machine(), "ROW3");
450   case 1 << 4: return input_port_read(device->machine(), "ROW4");
451   case 1 << 5: return input_port_read(device->machine(), "ROW5");
452   case 1 << 6: return input_port_read(device->machine(), "ROW6");
453   case 1 << 7: return input_port_read(device->machine(), "ROW7");
454   case 1 << 8: return input_port_read(device->machine(), "ROW8");
455   case 1 << 9: return input_port_read(device->machine(), "ROW9");
446   case 1 << 0: return device->machine().root_device().ioport("ROW0")->read();
447   case 1 << 1: return device->machine().root_device().ioport("ROW1")->read();
448   case 1 << 2: return device->machine().root_device().ioport("ROW2")->read();
449   case 1 << 3: return device->machine().root_device().ioport("ROW3")->read();
450   case 1 << 4: return device->machine().root_device().ioport("ROW4")->read();
451   case 1 << 5: return device->machine().root_device().ioport("ROW5")->read();
452   case 1 << 6: return device->machine().root_device().ioport("ROW6")->read();
453   case 1 << 7: return device->machine().root_device().ioport("ROW7")->read();
454   case 1 << 8: return device->machine().root_device().ioport("ROW8")->read();
455   case 1 << 9: return device->machine().root_device().ioport("ROW9")->read();
456456   }
457457
458458   /* should never reach this */
src/mess/machine/lisa.c
r15082r15083
315315   if (! state->m_COPS_force_unplug)
316316      for (i=0; i<8; i++)
317317      {
318         keybuf = input_port_read(machine, keynames[i]);
318         keybuf = machine.root_device().ioport(keynames[i])->read();
319319
320320         if (keybuf != state->m_key_matrix[i])
321321         {   /* if state has changed, find first bit which has changed */
r15082r15083
361361      return;   /* ???? */
362362#endif
363363
364   new_mx = input_port_read(machine, "MOUSE_X");
365   new_my = input_port_read(machine, "MOUSE_Y");
364   new_mx = machine.root_device().ioport("MOUSE_X")->read();
365   new_my = machine.root_device().ioport("MOUSE_Y")->read();
366366
367367   /* see if it moved in the x coord */
368368   if (new_mx != state->m_last_mx)
src/mess/machine/lynx.c
r15082r15083
10041004            value |= 0x01;
10051005         break;
10061006      case JOYSTICK:
1007         input = input_port_read(machine(), "JOY");
1007         input = ioport("JOY")->read();
10081008         switch (m_rotate)
10091009         {
10101010            case 1:
r15082r15083
10361036            value = input;
10371037         break;
10381038      case SWITCHES:
1039         value = input_port_read(machine(), "PAUSE");
1039         value = ioport("PAUSE")->read();
10401040         break;
10411041      case RCART:
10421042         value = *(machine().root_device().memregion("user1")->base() + (m_suzy.high * m_granularity) + m_suzy.low);
src/mess/machine/cgenie.c
r15082r15083
7171   /* wipe out font RAM */
7272   memset(&ROM[0x0f400], 0xff, 0x0400);
7373
74   if( input_port_read(machine, "DSW0") & 0x80 )
74   if( machine.root_device().ioport("DSW0")->read() & 0x80 )
7575   {
7676      logerror("cgenie floppy discs enabled\n");
7777   }
r15082r15083
8181   }
8282
8383   /* copy DOS ROM, if enabled or wipe out that memory area */
84   if( input_port_read(machine, "DSW0") & 0x40 )
84   if( machine.root_device().ioport("DSW0")->read() & 0x40 )
8585   {
86      if ( input_port_read(machine, "DSW0") & 0x80 )
86      if ( machine.root_device().ioport("DSW0")->read() & 0x80 )
8787      {
8888         space->install_read_bank(0xc000, 0xdfff, "bank10");
8989         space->nop_write(0xc000, 0xdfff);
r15082r15083
105105   }
106106
107107   /* copy EXT ROM, if enabled or wipe out that memory area */
108   if( input_port_read(machine, "DSW0") & 0x20 )
108   if( machine.root_device().ioport("DSW0")->read() & 0x20 )
109109   {
110110      space->install_rom(0xe000, 0xefff, 0); // mess 0135u3 need to check
111111      logerror("cgenie EXT enabled\n");
r15082r15083
282282      /* comparator value */
283283      state->m_psg_b_inp = 0x00;
284284
285      if( input_port_read(space->machine(), "JOY0") > state->m_psg_a_out )
285      if( space->machine().root_device().ioport("JOY0")->read() > state->m_psg_a_out )
286286         state->m_psg_b_inp |= 0x80;
287287
288      if( input_port_read(space->machine(), "JOY1") > state->m_psg_a_out )
288      if( space->machine().root_device().ioport("JOY1")->read() > state->m_psg_a_out )
289289         state->m_psg_b_inp |= 0x40;
290290
291      if( input_port_read(space->machine(), "JOY2") > state->m_psg_a_out )
291      if( space->machine().root_device().ioport("JOY2")->read() > state->m_psg_a_out )
292292         state->m_psg_b_inp |= 0x20;
293293
294      if( input_port_read(space->machine(), "JOY3") > state->m_psg_a_out )
294      if( state->ioport("JOY3")->read() > state->m_psg_a_out )
295295         state->m_psg_b_inp |= 0x10;
296296   }
297297   else
r15082r15083
300300      state->m_psg_b_inp = 0xFF;
301301
302302      if( !(state->m_psg_a_out & 0x01) )
303         state->m_psg_b_inp &= ~input_port_read(space->machine(), "KP0");
303         state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP0")->read();
304304
305305      if( !(state->m_psg_a_out & 0x02) )
306         state->m_psg_b_inp &= ~input_port_read(space->machine(), "KP1");
306         state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP1")->read();
307307
308308      if( !(state->m_psg_a_out & 0x04) )
309         state->m_psg_b_inp &= ~input_port_read(space->machine(), "KP2");
309         state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP2")->read();
310310
311311      if( !(state->m_psg_a_out & 0x08) )
312         state->m_psg_b_inp &= ~input_port_read(space->machine(), "KP3");
312         state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP3")->read();
313313
314314      if( !(state->m_psg_a_out & 0x10) )
315         state->m_psg_b_inp &= ~input_port_read(space->machine(), "KP4");
315         state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP4")->read();
316316
317317      if( !(state->m_psg_a_out & 0x20) )
318         state->m_psg_b_inp &= ~input_port_read(space->machine(), "KP5");
318         state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP5")->read();
319319   }
320320   return state->m_psg_b_inp;
321321}
r15082r15083
336336{
337337   device_t *fdc = space->machine().device("wd179x");
338338   /* If the floppy isn't emulated, return 0 */
339   if( (input_port_read(space->machine(), "DSW0") & 0x80) == 0 )
339   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
340340      return 0;
341341   return wd17xx_status_r(fdc, offset);
342342}
r15082r15083
345345{
346346   device_t *fdc = space->machine().device("wd179x");
347347   /* If the floppy isn't emulated, return 0xff */
348   if( (input_port_read(space->machine(), "DSW0") & 0x80) == 0 )
348   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
349349      return 0xff;
350350   return wd17xx_track_r(fdc, offset);
351351}
r15082r15083
354354{
355355   device_t *fdc = space->machine().device("wd179x");
356356   /* If the floppy isn't emulated, return 0xff */
357   if( (input_port_read(space->machine(), "DSW0") & 0x80) == 0 )
357   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
358358      return 0xff;
359359   return wd17xx_sector_r(fdc, offset);
360360}
r15082r15083
363363{
364364   device_t *fdc = space->machine().device("wd179x");
365365   /* If the floppy isn't emulated, return 0xff */
366   if( (input_port_read(space->machine(), "DSW0") & 0x80) == 0 )
366   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
367367      return 0xff;
368368   return wd17xx_data_r(fdc, offset);
369369}
r15082r15083
372372{
373373   device_t *fdc = space->machine().device("wd179x");
374374   /* If the floppy isn't emulated, return immediately */
375   if( (input_port_read(space->machine(), "DSW0") & 0x80) == 0 )
375   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
376376      return;
377377   wd17xx_command_w(fdc, offset, data);
378378}
r15082r15083
381381{
382382   device_t *fdc = space->machine().device("wd179x");
383383   /* If the floppy isn't emulated, ignore the write */
384   if( (input_port_read(space->machine(), "DSW0") & 0x80) == 0 )
384   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
385385      return;
386386   wd17xx_track_w(fdc, offset, data);
387387}
r15082r15083
390390{
391391   device_t *fdc = space->machine().device("wd179x");
392392   /* If the floppy isn't emulated, ignore the write */
393   if( (input_port_read(space->machine(), "DSW0") & 0x80) == 0 )
393   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
394394      return;
395395   wd17xx_sector_w(fdc, offset, data);
396396}
r15082r15083
399399{
400400   device_t *fdc = space->machine().device("wd179x");
401401   /* If the floppy isn't emulated, ignore the write */
402   if( (input_port_read(space->machine(), "DSW0") & 0x80) == 0 )
402   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
403403      return;
404404   wd17xx_data_w(fdc, offset, data);
405405}
r15082r15083
427427{
428428   cgenie_state *drvstate = device->machine().driver_data<cgenie_state>();
429429   /* if disc hardware is not enabled, do not cause an int */
430   if (!( input_port_read(device->machine(), "DSW0") & 0x80 ))
430   if (!( drvstate->ioport("DSW0")->read() & 0x80 ))
431431      return;
432432
433433   if (state)
r15082r15083
490490   int result = 0;
491491
492492   if( offset & 0x01 )
493      result |= input_port_read(space->machine(), "ROW0");
493      result |= space->machine().root_device().ioport("ROW0")->read();
494494
495495   if( offset & 0x02 )
496      result |= input_port_read(space->machine(), "ROW1");
496      result |= space->machine().root_device().ioport("ROW1")->read();
497497
498498   if( offset & 0x04 )
499      result |= input_port_read(space->machine(), "ROW2");
499      result |= space->machine().root_device().ioport("ROW2")->read();
500500
501501   if( offset & 0x08 )
502      result |= input_port_read(space->machine(), "ROW3");
502      result |= space->machine().root_device().ioport("ROW3")->read();
503503
504504   if( offset & 0x10 )
505      result |= input_port_read(space->machine(), "ROW4");
505      result |= space->machine().root_device().ioport("ROW4")->read();
506506
507507   if( offset & 0x20 )
508      result |= input_port_read(space->machine(), "ROW5");
508      result |= space->machine().root_device().ioport("ROW5")->read();
509509
510510   if( offset & 0x40 )
511      result |= input_port_read(space->machine(), "ROW6");
511      result |= space->machine().root_device().ioport("ROW6")->read();
512512
513513   if( offset & 0x80 )
514      result |= input_port_read(space->machine(), "ROW7");
514      result |= space->machine().root_device().ioport("ROW7")->read();
515515
516516   return result;
517517}
r15082r15083
596596INTERRUPT_GEN( cgenie_frame_interrupt )
597597{
598598   cgenie_state *state = device->machine().driver_data<cgenie_state>();
599   if( state->m_tv_mode != (input_port_read(device->machine(), "DSW0") & 0x10) )
599   if( state->m_tv_mode != (device->machine().root_device().ioport("DSW0")->read() & 0x10) )
600600   {
601      state->m_tv_mode = input_port_read(device->machine(), "DSW0") & 0x10;
601      state->m_tv_mode = state->ioport("DSW0")->read() & 0x10;
602602      /* force setting of background color */
603603      state->m_port_ff ^= FF_BGD0;
604604      cgenie_port_ff_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, state->m_port_ff ^ FF_BGD0);
src/mess/machine/super80.c
r15082r15083
2222   for (i = 0; i < 8; i++)
2323   {
2424      sprintf(kbdrow,"X%d",i);
25      if (!BIT(state->m_keylatch, i)) data &= input_port_read(device->machine(), kbdrow);
25      if (!BIT(state->m_keylatch, i)) data &= state->ioport(kbdrow)->read();
2626   }
2727
2828   return data;
r15082r15083
5151      state->m_cass->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
5252
5353   /* does user want to hear the sound? */
54   if BIT(input_port_read(machine, "CONFIG"), 3)
54   if BIT(machine.root_device().ioport("CONFIG")->read(), 3)
5555      state->m_cass->change_state(CASSETTE_SPEAKER_ENABLED,CASSETTE_MASK_SPEAKER);
5656   else
5757      state->m_cass->change_state(CASSETTE_SPEAKER_MUTED,CASSETTE_MASK_SPEAKER);
r15082r15083
108108{
109109   UINT8 go_fast = 0;
110110   super80_state *state = machine.driver_data<super80_state>();
111   if ( (!BIT(state->m_shared, 2)) | (!BIT(input_port_read(machine, "CONFIG"), 1)) )   /* bit 2 of port F0 is low, OR user turned on config switch */
111   if ( (!BIT(state->m_shared, 2)) | (!BIT(machine.root_device().ioport("CONFIG")->read(), 1)) )   /* bit 2 of port F0 is low, OR user turned on config switch */
112112      go_fast++;
113113
114114   /* code to slow down computer to 1 MHz by halting cpu on every second frame */
r15082r15083
160160
161161READ8_MEMBER( super80_state::super80_f2_r )
162162{
163   UINT8 data = input_port_read(machine(), "DSW") & 0xf0;   // dip switches on pcb
163   UINT8 data = ioport("DSW")->read() & 0xf0;   // dip switches on pcb
164164   data |= m_cass_data[2];         // bit 0 = output of U1, bit 1 = MDS cass state, bit 2 = current wave_state
165165   data |= 0x08;            // bit 3 - not used
166166   return data;
src/mess/machine/pc_turbo.c
r15082r15083
2727   struct pc_turbo_info *ti = (struct pc_turbo_info *) ptr;
2828   int val;
2929
30   val = input_port_read(machine, ti->port) & ti->mask;
30   val = machine.root_device().ioport(ti->port)->read() & ti->mask;
3131
3232   if (val != ti->cur_val)
3333   {
src/mess/machine/lviv.c
r15082r15083
4848
4949DIRECT_UPDATE_MEMBER(lviv_state::lviv_directoverride)
5050{
51   if (input_port_read(machine(), "RESET") & 0x01)
51   if (ioport("RESET")->read() & 0x01)
5252      machine().scheduler().timer_set(attotime::from_usec(10), FUNC(lviv_reset));
5353   return address;
5454}
r15082r15083
6969   UINT8 data = state->m_ppi_port_outputs[0][2] & 0x0f;
7070   if (device->machine().device<cassette_image_device>(CASSETTE_TAG)->input() > 0.038)
7171      data |= 0x10;
72   if (state->m_ppi_port_outputs[0][0] & input_port_read(device->machine(), "JOY"))
72   if (state->m_ppi_port_outputs[0][0] & state->ioport("JOY")->read())
7373      data |= 0x80;
7474   return data;
7575}
r15082r15083
106106static READ8_DEVICE_HANDLER ( lviv_ppi_1_portb_r )   /* keyboard reading */
107107{
108108   lviv_state *state = device->machine().driver_data<lviv_state>();
109   return   ((state->m_ppi_port_outputs[1][0] & 0x01) ? 0xff : input_port_read(device->machine(), "KEY0")) &
110      ((state->m_ppi_port_outputs[1][0] & 0x02) ? 0xff : input_port_read(device->machine(), "KEY1")) &
111      ((state->m_ppi_port_outputs[1][0] & 0x04) ? 0xff : input_port_read(device->machine(), "KEY2")) &
112      ((state->m_ppi_port_outputs[1][0] & 0x08) ? 0xff : input_port_read(device->machine(), "KEY3")) &
113      ((state->m_ppi_port_outputs[1][0] & 0x10) ? 0xff : input_port_read(device->machine(), "KEY4")) &
114      ((state->m_ppi_port_outputs[1][0] & 0x20) ? 0xff : input_port_read(device->machine(), "KEY5")) &
115      ((state->m_ppi_port_outputs[1][0] & 0x40) ? 0xff : input_port_read(device->machine(), "KEY6")) &
116      ((state->m_ppi_port_outputs[1][0] & 0x80) ? 0xff : input_port_read(device->machine(), "KEY7"));
109   return   ((state->m_ppi_port_outputs[1][0] & 0x01) ? 0xff : device->machine().root_device().ioport("KEY0")->read()) &
110      ((state->m_ppi_port_outputs[1][0] & 0x02) ? 0xff : device->machine().root_device().ioport("KEY1")->read()) &
111      ((state->m_ppi_port_outputs[1][0] & 0x04) ? 0xff : device->machine().root_device().ioport("KEY2")->read()) &
112      ((state->m_ppi_port_outputs[1][0] & 0x08) ? 0xff : device->machine().root_device().ioport("KEY3")->read()) &
113      ((state->m_ppi_port_outputs[1][0] & 0x10) ? 0xff : device->machine().root_device().ioport("KEY4")->read()) &
114      ((state->m_ppi_port_outputs[1][0] & 0x20) ? 0xff : device->machine().root_device().ioport("KEY5")->read()) &
115      ((state->m_ppi_port_outputs[1][0] & 0x40) ? 0xff : device->machine().root_device().ioport("KEY6")->read()) &
116      ((state->m_ppi_port_outputs[1][0] & 0x80) ? 0xff : state->ioport("KEY7")->read());
117117}
118118
119119static READ8_DEVICE_HANDLER ( lviv_ppi_1_portc_r )     /* keyboard reading */
120120{
121121   lviv_state *state = device->machine().driver_data<lviv_state>();
122   return   ((state->m_ppi_port_outputs[1][2] & 0x01) ? 0xff : input_port_read(device->machine(), "KEY8")) &
123      ((state->m_ppi_port_outputs[1][2] & 0x02) ? 0xff : input_port_read(device->machine(), "KEY9" )) &
124      ((state->m_ppi_port_outputs[1][2] & 0x04) ? 0xff : input_port_read(device->machine(), "KEY10")) &
125      ((state->m_ppi_port_outputs[1][2] & 0x08) ? 0xff : input_port_read(device->machine(), "KEY11"));
122   return   ((state->m_ppi_port_outputs[1][2] & 0x01) ? 0xff : device->machine().root_device().ioport("KEY8")->read()) &
123      ((state->m_ppi_port_outputs[1][2] & 0x02) ? 0xff : device->machine().root_device().ioport("KEY9" )->read()) &
124      ((state->m_ppi_port_outputs[1][2] & 0x04) ? 0xff : device->machine().root_device().ioport("KEY10")->read()) &
125      ((state->m_ppi_port_outputs[1][2] & 0x08) ? 0xff : state->ioport("KEY11")->read());
126126}
127127
128128static WRITE8_DEVICE_HANDLER ( lviv_ppi_1_porta_w )   /* kayboard scaning */
src/mess/machine/mbc55x.c
r15082r15083
261261
262262   // First read shift, control and graph
263263
264   state->m_keyboard.key_special = input_port_read(machine, KEY_SPECIAL_TAG);
264   state->m_keyboard.key_special = machine.root_device().ioport(KEY_SPECIAL_TAG)->read();
265265
266266   for(row=0; row<MBC55X_KEYROWS; row++)
267267   {
268      keyrow = input_port_read(machine, keynames[row]);
268      keyrow = machine.root_device().ioport(keynames[row])->read();
269269
270270      for(mask=0x80, bitno=7;mask>0;mask=mask>>1, bitno-=1)
271271      {
src/mess/machine/pc1403.c
r15082r15083
6161    UINT8 data=state->m_outa;
6262
6363    if (state->m_asic[3] & 0x01)
64      data |= input_port_read(device->machine(), "KEY0");
64      data |= device->machine().root_device().ioport("KEY0")->read();
6565
6666    if (state->m_asic[3] & 0x02)
67      data |= input_port_read(device->machine(), "KEY1");
67      data |= device->machine().root_device().ioport("KEY1")->read();
6868
6969    if (state->m_asic[3] & 0x04)
70      data |= input_port_read(device->machine(), "KEY2");
70      data |= device->machine().root_device().ioport("KEY2")->read();
7171
7272    if (state->m_asic[3] & 0x08)
73      data |= input_port_read(device->machine(), "KEY3");
73      data |= device->machine().root_device().ioport("KEY3")->read();
7474
7575    if (state->m_asic[3] & 0x10)
76      data |= input_port_read(device->machine(), "KEY4");
76      data |= device->machine().root_device().ioport("KEY4")->read();
7777
7878    if (state->m_asic[3] & 0x20)
79      data |= input_port_read(device->machine(), "KEY5");
79      data |= device->machine().root_device().ioport("KEY5")->read();
8080
8181    if (state->m_asic[3] & 0x40)
82      data |= input_port_read(device->machine(), "KEY6");
82      data |= device->machine().root_device().ioport("KEY6")->read();
8383
8484    if (state->m_outa & 0x01)
8585   {
86      data |= input_port_read(device->machine(), "KEY7");
86      data |= state->ioport("KEY7")->read();
8787
8888      /* At Power Up we fake a 'C-CE' pressure */
8989      if (state->m_power)
r15082r15083
9191   }
9292
9393    if (state->m_outa & 0x02)
94      data |= input_port_read(device->machine(), "KEY8");
94      data |= device->machine().root_device().ioport("KEY8")->read();
9595
9696    if (state->m_outa & 0x04)
97      data |= input_port_read(device->machine(), "KEY9");
97      data |= device->machine().root_device().ioport("KEY9")->read();
9898
9999    if (state->m_outa & 0x08)
100      data |= input_port_read(device->machine(), "KEY10");
100      data |= device->machine().root_device().ioport("KEY10")->read();
101101
102102    if (state->m_outa & 0x10)
103      data |= input_port_read(device->machine(), "KEY11");
103      data |= device->machine().root_device().ioport("KEY11")->read();
104104
105105    if (state->m_outa & 0x20)
106      data |= input_port_read(device->machine(), "KEY12");
106      data |= device->machine().root_device().ioport("KEY12")->read();
107107
108108    if (state->m_outa & 0x40)
109      data |= input_port_read(device->machine(), "KEY13");
109      data |= device->machine().root_device().ioport("KEY13")->read();
110110
111111    return data;
112112}
r15082r15083
117117   pc1403_state *state = machine.driver_data<pc140_state>();
118118   int data = state->m_outb;
119119
120   if (input_port_read(machine, "KEY13"))
120   if (machine.root_device().ioport("KEY13")->read())
121121      data |= 1;
122122
123123   return data;
r15082r15083
134134
135135int pc1403_brk(device_t *device)
136136{
137   return (input_port_read(device->machine(), "EXTRA") & 0x01);
137   return (device->machine().root_device().ioport("EXTRA")->read() & 0x01);
138138}
139139
140140int pc1403_reset(device_t *device)
141141{
142   return (input_port_read(device->machine(), "EXTRA") & 0x02);
142   return (device->machine().root_device().ioport("EXTRA")->read() & 0x02);
143143}
144144
145145MACHINE_START( pc1403 )
src/mess/machine/apple1.c
r15082r15083
293293   /* First we check the RESET and CLEAR SCREEN pushbutton switches. */
294294
295295   /* The RESET switch resets the CPU and the 6820 PIA. */
296   if (input_port_read(machine, "KEY5") & 0x0001)
296   if (machine.root_device().ioport("KEY5")->read() & 0x0001)
297297   {
298298      if (!state->m_reset_flag) {
299299         state->m_reset_flag = 1;
r15082r15083
309309   }
310310
311311   /* The CLEAR SCREEN switch clears the video hardware. */
312   if (input_port_read(machine, "KEY5") & 0x0002)
312   if (machine.root_device().ioport("KEY5")->read() & 0x0002)
313313   {
314314      if (!state->m_vh_clrscrn_pressed)
315315      {
r15082r15083
334334   /* The keyboard strobe line should always be low when a scan starts. */
335335   pia->ca1_w(0);
336336
337   shiftkeys = input_port_read(machine, "KEY4") & 0x0003;
338   ctrlkeys = input_port_read(machine, "KEY4") & 0x000c;
337   shiftkeys = machine.root_device().ioport("KEY4")->read() & 0x0003;
338   ctrlkeys = machine.root_device().ioport("KEY4")->read() & 0x000c;
339339
340340   for (port = 0; port < 4; port++)
341341   {
342342      UINT32 portval, newkeys;
343343
344      portval = input_port_read(machine, keynames[port]);
344      portval = machine.root_device().ioport(keynames[port])->read();
345345      newkeys = portval & ~(state->m_kbd_last_scan[port]);
346346
347347      if (newkeys)
src/mess/machine/mtx.c
r15082r15083
204204
205205   UINT8 data = 0xff;
206206
207   if (!(m_key_sense & 0x01)) data &= input_port_read(machine(), "ROW0");
208   if (!(m_key_sense & 0x02)) data &= input_port_read(machine(), "ROW1");
209   if (!(m_key_sense & 0x04)) data &= input_port_read(machine(), "ROW2");
210   if (!(m_key_sense & 0x08)) data &= input_port_read(machine(), "ROW3");
211   if (!(m_key_sense & 0x10)) data &= input_port_read(machine(), "ROW4");
212   if (!(m_key_sense & 0x20)) data &= input_port_read(machine(), "ROW5");
213   if (!(m_key_sense & 0x40)) data &= input_port_read(machine(), "ROW6");
214   if (!(m_key_sense & 0x80)) data &= input_port_read(machine(), "ROW7");
207   if (!(m_key_sense & 0x01)) data &= ioport("ROW0")->read();
208   if (!(m_key_sense & 0x02)) data &= ioport("ROW1")->read();
209   if (!(m_key_sense & 0x04)) data &= ioport("ROW2")->read();
210   if (!(m_key_sense & 0x08)) data &= ioport("ROW3")->read();
211   if (!(m_key_sense & 0x10)) data &= ioport("ROW4")->read();
212   if (!(m_key_sense & 0x20)) data &= ioport("ROW5")->read();
213   if (!(m_key_sense & 0x40)) data &= ioport("ROW6")->read();
214   if (!(m_key_sense & 0x80)) data &= ioport("ROW7")->read();
215215
216216   return data;
217217}
r15082r15083
223223READ8_MEMBER(mtx_state::mtx_key_hi_r)
224224{
225225
226   UINT8 data = input_port_read(machine(), "country_code");
226   UINT8 data = ioport("country_code")->read();
227227
228   if (!(m_key_sense & 0x01)) data &= input_port_read(machine(), "ROW0") >> 8;
229   if (!(m_key_sense & 0x02)) data &= input_port_read(machine(), "ROW1") >> 8;
230   if (!(m_key_sense & 0x04)) data &= input_port_read(machine(), "ROW2") >> 8;
231   if (!(m_key_sense & 0x08)) data &= input_port_read(machine(), "ROW3") >> 8;
232   if (!(m_key_sense & 0x10)) data &= input_port_read(machine(), "ROW4") >> 8;
233   if (!(m_key_sense & 0x20)) data &= input_port_read(machine(), "ROW5") >> 8;
234   if (!(m_key_sense & 0x40)) data &= input_port_read(machine(), "ROW6") >> 8;
235   if (!(m_key_sense & 0x80)) data &= input_port_read(machine(), "ROW7") >> 8;
228   if (!(m_key_sense & 0x01)) data &= ioport("ROW0")->read() >> 8;
229   if (!(m_key_sense & 0x02)) data &= ioport("ROW1")->read() >> 8;
230   if (!(m_key_sense & 0x04)) data &= ioport("ROW2")->read() >> 8;
231   if (!(m_key_sense & 0x08)) data &= ioport("ROW3")->read() >> 8;
232   if (!(m_key_sense & 0x10)) data &= ioport("ROW4")->read() >> 8;
233   if (!(m_key_sense & 0x20)) data &= ioport("ROW5")->read() >> 8;
234   if (!(m_key_sense & 0x40)) data &= ioport("ROW6")->read() >> 8;
235   if (!(m_key_sense & 0x80)) data &= ioport("ROW7")->read() >> 8;
236236
237237   return data;
238238}
src/mess/machine/lux10828.c
r15082r15083
221221   UINT8 data = 0x04;
222222
223223   // single/double sided drive
224   UINT8 sw1 = input_port_read(*this, "SW1") & 0x0f;
224   UINT8 sw1 = ioport("SW1")->read() & 0x0f;
225225   int ds0 = m_sel0 ? BIT(sw1, 0) : 1;
226226   int ds1 = m_sel1 ? BIT(sw1, 1) : 1;
227227   data |= !(ds0 & ds1);
r15082r15083
460460
461461void luxor_55_10828_device::abcbus_cs(UINT8 data)
462462{
463   UINT8 address = 0x2c | BIT(input_port_read(*this, "S1"), 0);
463   UINT8 address = 0x2c | BIT(ioport("S1")->read(), 0);
464464
465465   m_cs = (data == address);
466466}
src/mess/machine/victor9kb.c
r15082r15083
303303 
304304   switch (m_y)
305305   {
306      case 0: data &= input_port_read(*this, "Y0"); break;
307      case 1: data &= input_port_read(*this, "Y1"); break;
308      case 2: data &= input_port_read(*this, "Y2"); break;
309      case 3: data &= input_port_read(*this, "Y3"); break;
310      case 4: data &= input_port_read(*this, "Y4"); break;
311      case 5: data &= input_port_read(*this, "Y5"); break;
312      case 6: data &= input_port_read(*this, "Y6"); break;
313      case 7: data &= input_port_read(*this, "Y7"); break;
314      case 8: data &= input_port_read(*this, "Y8"); break;
315      case 9: data &= input_port_read(*this, "Y9"); break;
316      case 0xa: data &= input_port_read(*this, "YA"); break;
317      case 0xb: data &= input_port_read(*this, "YB"); break;
318      case 0xc: data &= input_port_read(*this, "YC"); break;
306      case 0: data &= ioport("Y0")->read(); break;
307      case 1: data &= ioport("Y1")->read(); break;
308      case 2: data &= ioport("Y2")->read(); break;
309      case 3: data &= ioport("Y3")->read(); break;
310      case 4: data &= ioport("Y4")->read(); break;
311      case 5: data &= ioport("Y5")->read(); break;
312      case 6: data &= ioport("Y6")->read(); break;
313      case 7: data &= ioport("Y7")->read(); break;
314      case 8: data &= ioport("Y8")->read(); break;
315      case 9: data &= ioport("Y9")->read(); break;
316      case 0xa: data &= ioport("YA")->read(); break;
317      case 0xb: data &= ioport("YB")->read(); break;
318      case 0xc: data &= ioport("YC")->read(); break;
319319   }
320320 
321321   return data;
src/mess/machine/special.c
r15082r15083
2525
2626READ8_MEMBER( special_state::specialist_8255_porta_r )
2727{
28   if (input_port_read(machine(), "LINE0")!=0xff) return 0xfe;
29   if (input_port_read(machine(), "LINE1")!=0xff) return 0xfd;
30   if (input_port_read(machine(), "LINE2")!=0xff) return 0xfb;
31   if (input_port_read(machine(), "LINE3")!=0xff) return 0xf7;
32   if (input_port_read(machine(), "LINE4")!=0xff) return 0xef;
33   if (input_port_read(machine(), "LINE5")!=0xff) return 0xdf;
34   if (input_port_read(machine(), "LINE6")!=0xff) return 0xbf;
35   if (input_port_read(machine(), "LINE7")!=0xff) return 0x7f;
28   if (ioport("LINE0")->read()!=0xff) return 0xfe;
29   if (ioport("LINE1")->read()!=0xff) return 0xfd;
30   if (ioport("LINE2")->read()!=0xff) return 0xfb;
31   if (ioport("LINE3")->read()!=0xff) return 0xf7;
32   if (ioport("LINE4")->read()!=0xff) return 0xef;
33   if (ioport("LINE5")->read()!=0xff) return 0xdf;
34   if (ioport("LINE6")->read()!=0xff) return 0xbf;
35   if (ioport("LINE7")->read()!=0xff) return 0x7f;
3636   return 0xff;
3737}
3838
r15082r15083
4141   UINT8 dat = 0;
4242   double level;
4343
44   if ((m_specialist_8255_porta & 0x01)==0) dat ^= (input_port_read(machine(), "LINE0") ^ 0xff);
45   if ((m_specialist_8255_porta & 0x02)==0) dat ^= (input_port_read(machine(), "LINE1") ^ 0xff);
46   if ((m_specialist_8255_porta & 0x04)==0) dat ^= (input_port_read(machine(), "LINE2") ^ 0xff);
47   if ((m_specialist_8255_porta & 0x08)==0) dat ^= (input_port_read(machine(), "LINE3") ^ 0xff);
48   if ((m_specialist_8255_porta & 0x10)==0) dat ^= (input_port_read(machine(), "LINE4") ^ 0xff);
49   if ((m_specialist_8255_porta & 0x20)==0) dat ^= (input_port_read(machine(), "LINE5") ^ 0xff);
50   if ((m_specialist_8255_porta & 0x40)==0) dat ^= (input_port_read(machine(), "LINE6") ^ 0xff);
51   if ((m_specialist_8255_porta & 0x80)==0) dat ^= (input_port_read(machine(), "LINE7") ^ 0xff);
52   if ((m_specialist_8255_portc & 0x01)==0) dat ^= (input_port_read(machine(), "LINE8") ^ 0xff);
53   if ((m_specialist_8255_portc & 0x02)==0) dat ^= (input_port_read(machine(), "LINE9") ^ 0xff);
54   if ((m_specialist_8255_portc & 0x04)==0) dat ^= (input_port_read(machine(), "LINE10") ^ 0xff);
55   if ((m_specialist_8255_portc & 0x08)==0) dat ^= (input_port_read(machine(), "LINE11") ^ 0xff);
44   if ((m_specialist_8255_porta & 0x01)==0) dat ^= (ioport("LINE0")->read() ^ 0xff);
45   if ((m_specialist_8255_porta & 0x02)==0) dat ^= (ioport("LINE1")->read() ^ 0xff);
46   if ((m_specialist_8255_porta & 0x04)==0) dat ^= (ioport("LINE2")->read() ^ 0xff);
47   if ((m_specialist_8255_porta & 0x08)==0) dat ^= (ioport("LINE3")->read() ^ 0xff);
48   if ((m_specialist_8255_porta & 0x10)==0) dat ^= (ioport("LINE4")->read() ^ 0xff);
49   if ((m_specialist_8255_porta & 0x20)==0) dat ^= (ioport("LINE5")->read() ^ 0xff);
50   if ((m_specialist_8255_porta & 0x40)==0) dat ^= (ioport("LINE6")->read() ^ 0xff);
51   if ((m_specialist_8255_porta & 0x80)==0) dat ^= (ioport("LINE7")->read() ^ 0xff);
52   if ((m_specialist_8255_portc & 0x01)==0) dat ^= (ioport("LINE8")->read() ^ 0xff);
53   if ((m_specialist_8255_portc & 0x02)==0) dat ^= (ioport("LINE9")->read() ^ 0xff);
54   if ((m_specialist_8255_portc & 0x04)==0) dat ^= (ioport("LINE10")->read() ^ 0xff);
55   if ((m_specialist_8255_portc & 0x08)==0) dat ^= (ioport("LINE11")->read() ^ 0xff);
5656
5757   dat = (dat  << 2) ^0xff;
58   if (input_port_read(machine(), "LINE12")!=0xff) dat ^= 0x02;
58   if (ioport("LINE12")->read()!=0xff) dat ^= 0x02;
5959
6060   level = m_cass->input();
6161   if (level >=  0)
r15082r15083
6666
6767READ8_MEMBER( special_state::specialist_8255_portc_r )
6868{
69   if (input_port_read(machine(), "LINE8")!=0xff) return 0x0e;
70   if (input_port_read(machine(), "LINE9")!=0xff) return 0x0d;
71   if (input_port_read(machine(), "LINE10")!=0xff) return 0x0b;
72   if (input_port_read(machine(), "LINE11")!=0xff) return 0x07;
69   if (ioport("LINE8")->read()!=0xff) return 0x0e;
70   if (ioport("LINE9")->read()!=0xff) return 0x0d;
71   if (ioport("LINE10")->read()!=0xff) return 0x0b;
72   if (ioport("LINE11")->read()!=0xff) return 0x07;
7373   return 0x0f;
7474}
7575
src/mess/machine/jupiter.c
r15082r15083
3535   unsigned char jupiter_repeat, jupiter_byte, loop;
3636   int done=0, jupiter_index=0x2000;
3737
38   if (input_port_read(space->machine(), "CFG")==0)
38   if (space->machine().root_device().ioport("CFG")->read()==0)
3939   {
4040      image.seterror(IMAGE_ERROR_INVALIDIMAGE, "At least 16KB RAM expansion required");
4141      image.message("At least 16KB RAM expansion required");
src/mess/machine/rmnimbus.c
r15082r15083
21622162
21632163    for(row=0;row<NIMBUS_KEYROWS;row++)
21642164    {
2165        keyrow=input_port_read(machine, keynames[row]);
2165        keyrow=machine.root_device().ioport(keynames[row])->read();
21662166
21672167        for(mask=0x80, bitno=7;mask>0;mask=mask>>1, bitno-=1)
21682168        {
r15082r15083
28462846    _mouse_joy_state *state = &drvstate->m_nimbus_mouse;
28472847
28482848
2849   state->m_reg0a4 = input_port_read(machine, MOUSE_BUTTON_TAG) | 0xC0;
2850   x = input_port_read(machine, MOUSEX_TAG);
2851    y = input_port_read(machine, MOUSEY_TAG);
2849   state->m_reg0a4 = machine.root_device().ioport(MOUSE_BUTTON_TAG)->read() | 0xC0;
2850   x = machine.root_device().ioport(MOUSEX_TAG)->read();
2851    y = machine.root_device().ioport(MOUSEY_TAG)->read();
28522852
28532853    UINT8   mxa;
28542854    UINT8   mxb;
r15082r15083
29852985   //int pc=cpu_get_pc(machine().device(MAINCPU_TAG));
29862986   _mouse_joy_state *state = &m_nimbus_mouse;
29872987
2988   if (input_port_read(machine(), "config") & 0x01)
2988   if (ioport("config")->read() & 0x01)
29892989   {
29902990      result=state->m_reg0a4;
29912991      //logerror("mouse_js_r: pc=%05X, result=%02X\n",pc,result);
29922992   }
29932993   else
29942994   {
2995      result=input_port_read_safe(machine(), JOYSTICK0_TAG, 0xff);
2995      result=ioport(JOYSTICK0_TAG)->read_safe(0xff);
29962996   }
29972997
29982998   return result;
src/mess/machine/cybiko.c
r15082r15083
387387   for (UINT8 i = 0; i < 15; i++)
388388   {
389389      if (!BIT(offset, i))
390         data &= ~input_port_read_safe(machine(), keynames[i], 0);
390         data &= ~ioport(keynames[i])->read_safe(0);
391391   }
392392   if (data != 0xFFFF)
393393   {
r15082r15083
423423      // keyboard
424424      case H8S_IO_PORT1 :
425425      {
426         if (!BIT(input_port_read(machine(), "A1"), 1))
426         if (!BIT(ioport("A1")->read(), 1))
427427            data |= (1 << 3); // "esc" key
428428      }
429429      break;
r15082r15083
469469      // keyboard
470470      case H8S_IO_PORT1 :
471471      {
472         if (!BIT(input_port_read(machine(), "A1"), 1))
472         if (!BIT(ioport("A1")->read(), 1))
473473            data |= (1 << 3); // "esc" key
474474      }
475475      break;
src/mess/machine/pp01.c
r15082r15083
205205      "LINE8", "LINE9", "LINEA", "LINEB", "LINEC", "LINED", "LINEE", "LINEF"
206206   };
207207
208   return (input_port_read(device->machine(),keynames[state->m_key_line]) & 0x3F) | (input_port_read(device->machine(),"LINEALL") & 0xC0);
208   return (device->machine().root_device().ioport(keynames[state->m_key_line])->read() & 0x3F) | (device->machine().root_device().ioport("LINEALL")->read() & 0xC0);
209209}
210210static WRITE8_DEVICE_HANDLER (pp01_8255_portb_w )
211211{
src/mess/machine/apple2.c
r15082r15083
15651565
15661566      if (offset == 0)
15671567      {
1568         m_joystick_x1_time = space.machine().time().as_double() + x_calibration * input_port_read(space.machine(), "joystick_1_x");
1569         m_joystick_y1_time = space.machine().time().as_double() + y_calibration * input_port_read(space.machine(), "joystick_1_y");
1570         m_joystick_x2_time = space.machine().time().as_double() + x_calibration * input_port_read(space.machine(), "joystick_2_x");
1571         m_joystick_y2_time = space.machine().time().as_double() + y_calibration * input_port_read(space.machine(), "joystick_2_y");
1568         m_joystick_x1_time = space.machine().time().as_double() + x_calibration * space.machine().root_device().ioport("joystick_1_x")->read();
1569         m_joystick_y1_time = space.machine().time().as_double() + y_calibration * space.machine().root_device().ioport("joystick_1_y")->read();
1570         m_joystick_x2_time = space.machine().time().as_double() + x_calibration * space.machine().root_device().ioport("joystick_2_x")->read();
1571         m_joystick_y2_time = space.machine().time().as_double() + y_calibration * space.machine().root_device().ioport("joystick_2_y")->read();
15721572      }
15731573   }
15741574   return 0;
r15082r15083
18321832
18331833int apple2_pressed_specialkey(running_machine &machine, UINT8 key)
18341834{
1835   return (input_port_read(machine, "keyb_special") & key)
1836      || (input_port_read_safe(machine, "joystick_buttons", 0x00) & key);
1835   return (machine.root_device().ioport("keyb_special")->read() & key)
1836      || (machine.root_device().ioport("joystick_buttons")->read_safe(0x00) & key);
18371837}
src/mess/machine/c64_4cga.c
r15082r15083
8787 
8888UINT8 c64_4cga_device::c64_pb_r(address_space &space, offs_t offset)
8989{
90   UINT8 data = input_port_read(*this, "FIRE");
90   UINT8 data = ioport("FIRE")->read();
9191 
9292   if (m_port)
9393   {
94      data &= input_port_read(*this, "JOY3");
94      data &= ioport("JOY3")->read();
9595   }
9696   else
9797   {
98      data &= input_port_read(*this, "JOY4");
98      data &= ioport("JOY4")->read();
9999   }
100100 
101101   return data;
src/mess/machine/ecb_grip.c
r15082r15083
787787
788788void grip_device::device_reset()
789789{
790   m_base = input_port_read(*this, "J7");
790   m_base = ioport("J7")->read();
791791}
792792
793793
r15082r15083
871871   int js0 = 0, js1 = 0;
872872
873873   // JS0
874   switch (input_port_read(*this, "J3A"))
874   switch (ioport("J3A")->read())
875875   {
876876   case 0: js0 = 0; break;
877877   case 1: js0 = 1; break;
r15082r15083
883883   data |= js0 << 4;
884884
885885   // JS1
886   switch (input_port_read(*this, "J3B"))
886   switch (ioport("J3B")->read())
887887   {
888888   case 0: js1 = 0; break;
889889   case 1: js1 = 1; break;
r15082r15083
10841084   int table = 0, row, col;
10851085   int keydata = -1;
10861086
1087   if (input_port_read(*this, "ROW9") & 0x07)
1087   if (ioport("ROW9")->read() & 0x07)
10881088   {
10891089      // shift, upper case
10901090      table = 1;
10911091   }
10921092
1093   if (input_port_read(*this, "ROW9") & 0x18)
1093   if (ioport("ROW9")->read() & 0x18)
10941094   {
10951095      // ctrl
10961096      table = 2;
r15082r15083
10991099   // scan keyboard
11001100   for (row = 0; row < 9; row++)
11011101   {
1102      UINT8 data = input_port_read(*this, keynames[row]);
1102      UINT8 data = ioport(keynames[row])->read();
11031103
11041104      for (col = 0; col < 8; col++)
11051105      {
src/mess/machine/pc1251.c
r15082r15083
3232
3333   if (state->m_outb & 0x01)
3434   {
35      data |= input_port_read(machine, "KEY0");
35      data |= machine.root_device().ioport("KEY0")->read();
3636
3737      /* At Power Up we fake a 'CL' pressure */
3838      if (state->m_power)
r15082r15083
4040   }
4141
4242   if (state->m_outb & 0x02)
43      data |= input_port_read(machine, "KEY1");
43      data |= machine.root_device().ioport("KEY1")->read();
4444
4545   if (state->m_outb & 0x04)
46      data |= input_port_read(machine, "KEY2");
46      data |= machine.root_device().ioport("KEY2")->read();
4747
4848   if (state->m_outa & 0x01)
49      data |= input_port_read(machine, "KEY3");
49      data |= machine.root_device().ioport("KEY3")->read();
5050
5151   if (state->m_outa & 0x02)
52      data |= input_port_read(machine, "KEY4");
52      data |= machine.root_device().ioport("KEY4")->read();
5353
5454   if (state->m_outa & 0x04)
55      data |= input_port_read(machine, "KEY5");
55      data |= machine.root_device().ioport("KEY5")->read();
5656
5757   if (state->m_outa & 0x08)
58      data |= input_port_read(machine, "KEY6");
58      data |= machine.root_device().ioport("KEY6")->read();
5959
6060   if (state->m_outa & 0x10)
61      data |= input_port_read(machine, "KEY7");
61      data |= machine.root_device().ioport("KEY7")->read();
6262
6363   if (state->m_outa & 0x20)
64      data |= input_port_read(machine, "KEY8");
64      data |= machine.root_device().ioport("KEY8")->read();
6565
6666   if (state->m_outa & 0x40)
67      data |= input_port_read(machine, "KEY9");
67      data |= machine.root_device().ioport("KEY9")->read();
6868
6969   return data;
7070}
r15082r15083
7575   int data = state->m_outb;
7676
7777   if (state->m_outb & 0x08)
78      data |= (input_port_read(device->machine(), "MODE") & 0x07);
78      data |= (state->ioport("MODE")->read() & 0x07);
7979
8080   return data;
8181}
8282
8383int pc1251_brk(device_t *device)
8484{
85   return (input_port_read(device->machine(), "EXTRA") & 0x01);
85   return (device->machine().root_device().ioport("EXTRA")->read() & 0x01);
8686}
8787
8888int pc1251_reset(device_t *device)
8989{
90   return (input_port_read(device->machine(), "EXTRA") & 0x02);
90   return (device->machine().root_device().ioport("EXTRA")->read() & 0x02);
9191}
9292
9393MACHINE_START( pc1251 )
src/mess/machine/pk8020.c
r15082r15083
2828   UINT8 line = 0;
2929   if (offset & 0x100)  line=8;
3030
31   if (offset & 0x0001) retVal|=input_port_read(machine(),keynames[line]);
31   if (offset & 0x0001) retVal|=ioport(keynames[line])->read();
3232   line++;
33   if (offset & 0x0002) retVal|=input_port_read(machine(),keynames[line]);
33   if (offset & 0x0002) retVal|=ioport(keynames[line])->read();
3434   line++;
35   if (offset & 0x0004) retVal|=input_port_read(machine(),keynames[line]);
35   if (offset & 0x0004) retVal|=ioport(keynames[line])->read();
3636   line++;
37   if (offset & 0x0008) retVal|=input_port_read(machine(),keynames[line]);
37   if (offset & 0x0008) retVal|=ioport(keynames[line])->read();
3838   line++;
39   if (offset & 0x0010) retVal|=input_port_read(machine(),keynames[line]);
39   if (offset & 0x0010) retVal|=ioport(keynames[line])->read();
4040   line++;
41   if (offset & 0x0020) retVal|=input_port_read(machine(),keynames[line]);
41   if (offset & 0x0020) retVal|=ioport(keynames[line])->read();
4242   line++;
43   if (offset & 0x0040) retVal|=input_port_read(machine(),keynames[line]);
43   if (offset & 0x0040) retVal|=ioport(keynames[line])->read();
4444   line++;
45   if (offset & 0x0080) retVal|=input_port_read(machine(),keynames[line]);
45   if (offset & 0x0080) retVal|=ioport(keynames[line])->read();
4646   line++;
4747
4848   return retVal;
src/mess/includes/pc1401.h
r15082r15083
1111
1212#include "machine/nvram.h"
1313
14#define CONTRAST (input_port_read(machine, "DSW0") & 0x07)
14#define CONTRAST (machine.root_device().ioport("DSW0")->read() & 0x07)
1515
1616
1717class pc1401_state : public driver_device
src/mess/includes/pc1350.h
r15082r15083
1111
1212#include "machine/nvram.h"
1313
14#define PC1350_CONTRAST (input_port_read(machine, "DSW0") & 0x07)
14#define PC1350_CONTRAST (machine.root_device().ioport("DSW0")->read() & 0x07)
1515
1616
1717class pc1350_state : public driver_device
src/mess/includes/coco.h
r15082r15083
191191
192192   typedef struct
193193   {
194      const input_port_config *m_input[2][2];
195      const input_port_config *m_buttons;
194      ioport_port *m_input[2][2];
195      ioport_port *m_buttons;
196196
197      UINT8 input(int joystick, int axis) const { return m_input[joystick][axis] ? input_port_read_direct(m_input[joystick][axis]) : 0x00; }
198      UINT8 buttons(void) const { return m_buttons ? input_port_read_direct(m_buttons) : 0x00; }
197      UINT8 input(int joystick, int axis) const { return m_input[joystick][axis] ? m_input[joystick][axis]->read() : 0x00; }
198      UINT8 buttons(void) const { return m_buttons ? m_buttons->read() : 0x00; }
199199   } analog_input_t;
200200
201201   void analog_port_start(analog_input_t *analog, const char *rx_tag, const char *ry_tag, const char *lx_tag, const char *ly_tag, const char *buttons_tag);
r15082r15083
233233   static offs_t dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
234234
235235   /* input ports */
236   const input_port_config *m_keyboard[7];
237   const input_port_config *m_joystick_type_control;
238   const input_port_config *m_joystick_hires_control;
236   ioport_port *m_keyboard[7];
237   ioport_port *m_joystick_type_control;
238   ioport_port *m_joystick_hires_control;
239239   analog_input_t m_joystick;
240240   analog_input_t m_rat_mouse;
241241   analog_input_t m_diecom_lightgun;
src/mess/includes/pc1403.h
r15082r15083
1111
1212#include "machine/nvram.h"
1313
14#define CONTRAST (input_port_read(machine, "DSW0") & 0x07)
14#define CONTRAST (machine.root_device().ioport("DSW0")->read() & 0x07)
1515
1616
1717class pc1403_state : public driver_device
src/mess/includes/amstr_pc.h
r15082r15083
88#define AMSTR_PC_H_
99
1010
11#define PC200_MODE (input_port_read(machine, "DSW0") & 0x30)
11#define PC200_MODE (machine.root_device().ioport("DSW0")->read() & 0x30)
1212#define PC200_MDA 0x30
1313
1414
src/mess/includes/pc1251.h
r15082r15083
1111
1212#include "machine/nvram.h"
1313
14#define PC1251_CONTRAST (input_port_read(machine, "DSW0") & 0x07)
14#define PC1251_CONTRAST (machine.root_device().ioport("DSW0")->read() & 0x07)
1515
1616
1717class pc1251_state : public driver_device
src/mess/video/911_vdt.c
r15082r15083
591591   /* read current key state */
592592   for (i = 0; i < 6; i++)
593593   {
594      key_buf[i] = input_port_read(device->machine(), keynames[i]);
594      key_buf[i] = device->machine().root_device().ioport(keynames[i])->read();
595595   }
596596
597597   /* parse modifier keys */
src/mess/video/mac.c
r15082r15083
251251   visarea.min_x = 0;
252252   visarea.min_y = 0;
253253   view = 0;
254   mac->m_rbv_montype = input_port_read_safe(machine, "MONTYPE", 2);
254   mac->m_rbv_montype = machine.root_device().ioport("MONTYPE")->read_safe(2);
255255   switch (mac->m_rbv_montype)
256256   {
257257      case 1:   // 15" portrait display
r15082r15083
308308   visarea.min_x = 0;
309309   visarea.min_y = 0;
310310
311   mac->m_rbv_montype = input_port_read_safe(machine, "MONTYPE", 2);
311   mac->m_rbv_montype = machine.root_device().ioport("MONTYPE")->read_safe(2);
312312   switch (mac->m_rbv_montype)
313313   {
314314      case 1:   // 15" portrait display
src/mess/video/mbee.c
r15082r15083
215215   UINT8 port = (offs >> 7) & 7;
216216   UINT8 bit = (offs >> 4) & 7;
217217   sprintf(kbdrow,"X%d",port);
218   UINT8 data = (input_port_read(machine(), kbdrow) >> bit) & 1;
218   UINT8 data = (ioport(kbdrow)->read() >> bit) & 1;
219219
220220   if ((data | m_is_premium) == 0)
221221   {
222      UINT8 extra = input_port_read(machine(), "EXTRA");
222      UINT8 extra = ioport("EXTRA")->read();
223223
224224      if( extra & 0x01 )   /* extra: cursor up */
225225      {
src/mess/video/pc1512.c
r15082r15083
400400
401401offs_t pc1512_state::get_char_rom_offset()
402402{
403   return ((input_port_read(machine(), "LK") >> 5) & 0x03) << 11;
403   return ((ioport("LK")->read() >> 5) & 0x03) << 11;
404404}
405405
406406void pc1512_state::draw_alpha(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
src/mess/video/isa_svga_cirrus.c
r15082r15083
5858//-------------------------------------------------
5959//  device_start - device-specific startup
6060//-------------------------------------------------
61static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return input_port_read(space->machine(), "IN0"); }
61static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
6262
6363void isa8_svga_cirrus_device::device_start()
6464{
src/mess/video/nes.c
r15082r15083
5050   if (state->m_disk_expansion && state->m_pcb_id == NO_BOARD)
5151   {
5252      // latch this input so it doesn't go at warp speed
53      if ((input_port_read(screen.machine(), "FLIPDISK") & 0x01) && (!state->m_last_frame_flip))
53      if ((screen.machine().root_device().ioport("FLIPDISK")->read() & 0x01) && (!state->m_last_frame_flip))
5454      {
5555         state->m_last_frame_flip = 1;
5656         state->m_fds_current_side++;
r15082r15083
6363            popmessage("Disk set to side %d", state->m_fds_current_side);
6464      }
6565
66      if (!(input_port_read(screen.machine(), "FLIPDISK") & 0x01))
66      if (!(screen.machine().root_device().ioport("FLIPDISK")->read() & 0x01))
6767         state->m_last_frame_flip = 0;
6868   }
6969   return 0;
src/mess/video/isa_cga.c
r15082r15083
144144
145145
146146/* Dipswitch for font selection */
147#define CGA_FONT        (input_port_read(*this, "cga_config") & m_font_selection_mask)
147#define CGA_FONT        (ioport("cga_config")->read() & m_font_selection_mask)
148148
149149/* Dipswitch for monitor selection */
150#define CGA_MONITOR     (input_port_read(*this, "cga_config")&0x1C)
150#define CGA_MONITOR     (ioport("cga_config")->read()&0x1C)
151151#define CGA_MONITOR_RGB         0x00    /* Colour RGB */
152152#define CGA_MONITOR_MONO        0x04    /* Greyscale RGB */
153153#define CGA_MONITOR_COMPOSITE   0x08    /* Colour composite */
r15082r15083
157157
158158/* Dipswitch for chipset selection */
159159/* TODO: Get rid of this; these should be handled by separate classes */
160#define CGA_CHIPSET     (input_port_read(*this, "cga_config") & 0xE0)
160#define CGA_CHIPSET     (ioport("cga_config")->read() & 0xE0)
161161#define CGA_CHIPSET_IBM         0x00    /* Original IBM CGA */
162162#define CGA_CHIPSET_PC1512      0x20    /* PC1512 CGA subset */
163163#define CGA_CHIPSET_PC200       0x40    /* PC200 in CGA mode */
src/mess/video/isa_ega.c
r15082r15083
980980   /* Feature Read */
981981   case 2:
982982      {
983         UINT8 dips = input_port_read(*this, "config" );
983         UINT8 dips = ioport("config")->read();
984984
985985         data = ( data & 0x0f );
986986         data |= ( ( m_feature_control & 0x03 ) << 5 );
src/mess/video/pc1640.c
r15082r15083
128128        */
129129
130130      // switch sense
131      data |= BIT(input_port_read(machine(), "SW"), ((m_egc_ctrl >> 2) & 0x03) ^ 0x03);
131      data |= BIT(ioport("SW")->read(), ((m_egc_ctrl >> 2) & 0x03) ^ 0x03);
132132      break;
133133
134134   case 0x15: // Sequencer Data Register
src/mess/video/arcadia.c
r15082r15083
316316   switch (offset)
317317   {
318318   case 0xff: data=m_charline|0xf0;break;
319   case 0x100: data=input_port_read(machine(), "controller1_col1");break;
320   case 0x101: data=input_port_read(machine(), "controller1_col2");break;
321   case 0x102: data=input_port_read(machine(), "controller1_col3");break;
322   case 0x103: data=input_port_read(machine(), "controller1_extra");break;
323   case 0x104: data=input_port_read(machine(), "controller2_col1");break;
324   case 0x105: data=input_port_read(machine(), "controller2_col2");break;
325   case 0x106: data=input_port_read(machine(), "controller2_col3");break;
326   case 0x107: data=input_port_read(machine(), "controller2_extra");break;
327   case 0x108: data=input_port_read(machine(), "panel");break;
319   case 0x100: data=ioport("controller1_col1")->read();break;
320   case 0x101: data=ioport("controller1_col2")->read();break;
321   case 0x102: data=ioport("controller1_col3")->read();break;
322   case 0x103: data=ioport("controller1_extra")->read();break;
323   case 0x104: data=ioport("controller2_col1")->read();break;
324   case 0x105: data=ioport("controller2_col2")->read();break;
325   case 0x106: data=ioport("controller2_col3")->read();break;
326   case 0x107: data=ioport("controller2_extra")->read();break;
327   case 0x108: data=ioport("panel")->read();break;
328328#if 0
329329   case 0x1fe:
330330      if (m_ad_select)
331         data=input_port_read(machine(), "controller1_joy_y")<<3;
331         data=ioport("controller1_joy_y")->read()<<3;
332332      else
333         data=input_port_read(machine(), "controller1_joy_x")<<3;
333         data=ioport("controller1_joy_x")->read()<<3;
334334      break;
335335   case 0x1ff:
336336      if (m_ad_select)
337         data=input_port_read(machine(), "controller2_joy_y")<<3;
337         data=ioport("controller2_joy_y")->read()<<3;
338338      else
339         data=input_port_read(machine(), "controller2_joy_x")<<3;
339         data=ioport("controller2_joy_x")->read()<<3;
340340      break;
341341#else
342342   case 0x1fe:
343343      data = 0x80;
344344      if (m_ad_select)
345345      {
346         if (input_port_read(machine(), "joysticks")&0x10) data=0;
347         if (input_port_read(machine(), "joysticks")&0x20) data=0xff;
346         if (ioport("joysticks")->read()&0x10) data=0;
347         if (ioport("joysticks")->read()&0x20) data=0xff;
348348      }
349349      else
350350      {
351         if (input_port_read(machine(), "joysticks")&0x40) data=0xff;
352         if (input_port_read(machine(), "joysticks")&0x80) data=0;
351         if (ioport("joysticks")->read()&0x40) data=0xff;
352         if (ioport("joysticks")->read()&0x80) data=0;
353353      }
354354      break;
355355   case 0x1ff:
356356      data = 0x6f; // 0x7f too big for alien invaders (move right)
357357      if (m_ad_select)
358358      {
359         if (input_port_read(machine(), "joysticks")&0x1) data=0;
360         if (input_port_read(machine(), "joysticks")&0x2) data=0xff;
359         if (ioport("joysticks")->read()&0x1) data=0;
360         if (ioport("joysticks")->read()&0x2) data=0xff;
361361      }
362362      else
363363      {
364         if (input_port_read(machine(), "joysticks")&0x4) data=0xff;
365         if (input_port_read(machine(), "joysticks")&0x8) data=0;
364         if (ioport("joysticks")->read()&0x4) data=0xff;
365         if (ioport("joysticks")->read()&0x8) data=0;
366366      }
367367      break;
368368#endif
src/mess/video/thomson.c
r15082r15083
5454{
5555   screen_device *screen = machine.first_screen();
5656   const rectangle &visarea = screen->visible_area();
57   UINT8 p = input_port_read(machine, "vconfig");
57   UINT8 p = machine.root_device().ioport("vconfig")->read();
5858   int new_w, new_h, changed = 0;
5959
6060   switch ( p & 3 )
r15082r15083
135135
136136static void thom_get_lightpen_pos( running_machine &machine, int*x, int* y )
137137{
138   *x = input_port_read(machine, "lightpen_x");
139   *y = input_port_read(machine, "lightpen_y");
138   *x = machine.root_device().ioport("lightpen_x")->read();
139   *y = machine.root_device().ioport("lightpen_y")->read();
140140
141141   if ( *x < 0 )
142142      *x = 0;
src/mess/video/isa_svga_tseng.c
r15082r15083
5757//-------------------------------------------------
5858//  device_start - device-specific startup
5959//-------------------------------------------------
60static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return input_port_read(space->machine(), "IN0"); }
60static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
6161
6262void isa8_svga_et4k_device::device_start()
6363{
src/mess/video/x68k.c
r15082r15083
195195            state->m_scanline_timer->adjust(hsync_time);
196196            if(scan != 0)
197197            {
198               if((input_port_read(machine, "options") & 0x04))
198               if((machine.root_device().ioport("options")->read() & 0x04))
199199               {
200200                  machine.primary_screen->update_partial(scan);
201201               }
r15082r15083
210210            state->m_scanline_timer->adjust(hsync_time);
211211            if(scan != 0)
212212            {
213               if((input_port_read(machine, "options") & 0x04))
213               if((machine.root_device().ioport("options")->read() & 0x04))
214214               {
215215                  machine.primary_screen->update_partial(scan);
216216               }
r15082r15083
249249         state->m_scanline_timer->adjust(hsync_time);
250250         if(scan != 0)
251251         {
252            if((input_port_read(machine, "options") & 0x04))
252            if((machine.root_device().ioport("options")->read() & 0x04))
253253            {
254254               machine.primary_screen->update_partial(scan);
255255            }
src/mess/video/super80.c
r15082r15083
7777   {
7878      super80_state *state = screen.machine().driver_data<super80_state>();
7979      /* if we chose another palette or colour mode, enable it */
80      UINT8 chosen_palette = (input_port_read(screen.machine(), "CONFIG") & 0x60)>>5;            // read colour dipswitches
80      UINT8 chosen_palette = (screen.machine().root_device().ioport("CONFIG")->read() & 0x60)>>5;            // read colour dipswitches
8181
8282      if (chosen_palette != state->m_current_palette)                  // any changes?
8383      {
r15082r15083
9999
100100   output_set_value("cass_led",(state->m_shared & 0x20) ? 1 : 0);
101101
102   if ((state->m_shared & 4) || (!(input_port_read(screen.machine(), "CONFIG") & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
102   if ((state->m_shared & 4) || (!(screen.machine().root_device().ioport("CONFIG")->read() & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
103103      screen_on++;
104104
105105   for (y = 0; y < 16; y++)
r15082r15083
141141
142142   output_set_value("cass_led",(state->m_shared & 0x20) ? 1 : 0);
143143
144   if ((state->m_shared & 4) || (!(input_port_read(screen.machine(), "CONFIG") & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
144   if ((state->m_shared & 4) || (!(screen.machine().root_device().ioport("CONFIG")->read() & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
145145      screen_on++;
146146
147147   for (y = 0; y < 16; y++)
r15082r15083
183183
184184   output_set_value("cass_led",(state->m_shared & 0x20) ? 1 : 0);
185185
186   if ((state->m_shared & 4) || (!(input_port_read(screen.machine(), "CONFIG") & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
186   if ((state->m_shared & 4) || (!(screen.machine().root_device().ioport("CONFIG")->read() & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
187187      screen_on++;
188188
189189   for (y = 0; y < 16; y++)
r15082r15083
221221   super80_state *state = screen.machine().driver_data<super80_state>();
222222   UINT8 y,ra,chr=32,gfx,screen_on=0;
223223   UINT16 sy=0,ma=state->m_vidpg,x;
224   UINT8 col, bg=0, fg=0, options=input_port_read(screen.machine(), "CONFIG");
224   UINT8 col, bg=0, fg=0, options=screen.machine().root_device().ioport("CONFIG")->read();
225225   UINT8 *RAM = state->memregion("maincpu")->base();
226226
227227   /* get selected character generator */
r15082r15083
392392   state->m_framecnt++;
393393   state->m_speed = state->m_mc6845_reg[10]&0x20, state->m_flash = state->m_mc6845_reg[10]&0x40; // cursor modes
394394   state->m_cursor = (state->m_mc6845_reg[14]<<8) | state->m_mc6845_reg[15]; // get cursor position
395   state->m_s_options=input_port_read(screen.machine(), "CONFIG");
395   state->m_s_options=screen.machine().root_device().ioport("CONFIG")->read();
396396   output_set_value("cass_led",(state->m_shared & 0x20) ? 1 : 0);
397397   state->m_6845->screen_update(screen, bitmap, cliprect);
398398   return 0;
src/mess/video/mc6847.h
r15082r15083
212212 
213213      // artifacting config
214214      void setup_config(device_t *device);
215      void poll_config(void) { m_artifacting = m_config ? input_port_read_direct(m_config) : 0; }
215      void poll_config(void) { m_artifacting = (m_config!=NULL) ? m_config->read() : 0; }
216216 
217217      // artifacting application
218218      template<int xscale>
r15082r15083
252252      }
253253 
254254   private:
255      const input_port_config *m_config;
256      input_port_value m_artifacting;
257      input_port_value m_saved_artifacting;
255      ioport_port *m_config;
256      ioport_value m_artifacting;
257      ioport_value m_saved_artifacting;
258258      pixel_t m_saved_c0, m_saved_c1;
259259      pixel_t m_expanded_colors[128];
260260 
src/mess/video/pc_aga.c
r15082r15083
1313#include "video/cgapal.h"
1414
1515
16#define CGA_MONITOR      (input_port_read(space->machine(), "VIDEO") & 0x1C)
16#define CGA_MONITOR      (space->machine().root_device().ioport("VIDEO")->read() & 0x1C)
1717#define CGA_MONITOR_RGB         0x00   /* Colour RGB */
1818#define CGA_MONITOR_MONO      0x04   /* Greyscale RGB */
1919#define CGA_MONITOR_COMPOSITE   0x08   /* Colour composite */
r15082r15083
507507         data = mc6845->register_r(*space, offset);
508508         break;
509509      case 10:
510         data = (input_port_read(space->machine(), "IN0") & 0x80 ) | 0x08 | aga.mda_status;
510         data = (space->machine().root_device().ioport("IN0")->read() & 0x80 ) | 0x08 | aga.mda_status;
511511         aga.mda_status ^= 0x01;
512512         break;
513513      /* 12, 13, 14  are the LPT1 ports */
r15082r15083
884884   case 0xe:
885885      // 0x20 low cga
886886      // 0x10 low special
887      result = input_port_read(space->machine(), "DSW0") & 0x38;
887      result = space->machine().root_device().ioport("DSW0")->read() & 0x38;
888888      break;
889889
890890   default:
src/mess/video/ssystem3.c
r15082r15083
206206   ssystem3_draw_led(bitmap, state->m_lcd.data[3]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '3');
207207   ssystem3_draw_led(bitmap, state->m_lcd.data[4]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '4');
208208
209   if (input_port_read(screen.machine(), "Configuration")&1) { // playfield(optional device)
209   if (screen.machine().root_device().ioport("Configuration")->read()&1) { // playfield(optional device)
210210      static const int lcd_signs_on[]={
211211         0, // empty
212212         1, // bauer
src/mess/video/isa_svga_s3.c
r15082r15083
5858//-------------------------------------------------
5959//  device_start - device-specific startup
6060//-------------------------------------------------
61static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return input_port_read(space->machine(), "IN0"); }
61static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
6262
6363void isa8_svga_s3_device::device_start()
6464{
src/mess/video/vc4000.c
r15082r15083
116116
117117#ifndef ANALOG_HACK
118118   case 0xcc:
119      if (!activecpu_get_reg(S2650_FO)) data=input_port_read(machine(), "JOY1_X");
120      else data=input_port_read(machine(), "JOY1_Y");
119      if (!activecpu_get_reg(S2650_FO)) data=ioport("JOY1_X")->read();
120      else data=ioport("JOY1_Y")->read();
121121      break;
122122   case 0xcd:
123      if (!activecpu_get_reg(S2650_FO)) data=input_port_read(machine(), "JOY2_X");
124      else data=input_port_read(machine(), "JOY2_Y");
123      if (!activecpu_get_reg(S2650_FO)) data=ioport("JOY2_X")->read();
124      else data=ioport("JOY2_Y")->read();
125125      break;
126126#else
127127
128128   case 0xcc:      /* left joystick */
129      if (input_port_read(machine(), "CONFIG")&1)
129      if (ioport("CONFIG")->read()&1)
130130      {      /* paddle */
131131         if (!cpu_get_reg(machine().device("maincpu"), S2650_FO))
132132         {
133            data = input_port_read(machine(), "JOYS") & 0x03;
133            data = ioport("JOYS")->read() & 0x03;
134134            switch (data)
135135            {
136136            case 0x01:
r15082r15083
148148         }
149149         else
150150         {
151            data = input_port_read(machine(), "JOYS") & 0x0c;
151            data = ioport("JOYS")->read() & 0x0c;
152152            switch (data)
153153            {
154154            case 0x08:
r15082r15083
169169      {      /* buttons */
170170         if (!cpu_get_reg(machine().device("maincpu"), S2650_FO))
171171         {
172            data = input_port_read(machine(), "JOYS") & 0x03;
172            data = ioport("JOYS")->read() & 0x03;
173173            switch (data)
174174            {
175175            case 0x01:
r15082r15083
185185         }
186186         else
187187         {
188            data = input_port_read(machine(), "JOYS") & 0x0c;
188            data = ioport("JOYS")->read() & 0x0c;
189189            switch (data)
190190            {
191191            case 0x08:
r15082r15083
203203      break;
204204
205205   case 0xcd:      /* right joystick */
206      if (input_port_read(machine(), "CONFIG")&1)
206      if (ioport("CONFIG")->read()&1)
207207      {
208208         if (!cpu_get_reg(machine().device("maincpu"), S2650_FO))
209209         {
210            data = input_port_read(machine(), "JOYS") & 0x30;
210            data = ioport("JOYS")->read() & 0x30;
211211            switch (data)
212212            {
213213            case 0x10:
r15082r15083
225225         }
226226         else
227227         {
228            data = input_port_read(machine(), "JOYS") & 0xc0;
228            data = ioport("JOYS")->read() & 0xc0;
229229            switch (data)
230230            {
231231            case 0x80:
r15082r15083
246246      {
247247         if (!cpu_get_reg(machine().device("maincpu"), S2650_FO))
248248         {
249            data = input_port_read(machine(), "JOYS") & 0x30;
249            data = ioport("JOYS")->read() & 0x30;
250250            switch (data)
251251            {
252252            case 0x10:
r15082r15083
262262         }
263263         else
264264         {
265            data = input_port_read(machine(), "JOYS") & 0xc0;
265            data = ioport("JOYS")->read() & 0xc0;
266266            switch (data)
267267            {
268268            case 0x80:
src/mess/video/733_asr.c
r15082r15083
664664   /* for (i = 0; i < 6; i++) */
665665   for (i = 0; i < 4; i++)
666666   {
667      key_buf[i] = input_port_read(device->machine(), keynames[i]);
667      key_buf[i] = device->machine().root_device().ioport(keynames[i])->read();
668668   }
669669
670670   /* process key modifiers */
src/mess/formats/z80bin.c
r15082r15083
9393   if (exec_addr != 0xffff)
9494   {
9595      /* check to see if autorun is on (I hate how this works) */
96      autorun = input_port_read_safe(image.device().machine(), "CONFIG", 0xFF) & 1;
96      autorun = image.device().machine().root_device().ioport("CONFIG")->read_safe(0xFF) & 1;
9797
9898      if (autorun)
9999         cpu_set_reg(image.device().machine().device("maincpu"), STATE_GENPC, exec_addr);
r15082r15083
119119   if (execute_address != 0xffff)
120120   {
121121      /* check to see if autorun is on (I hate how this works) */
122      autorun = input_port_read_safe(image.device().machine(), "CONFIG", 0xFF) & 1;
122      autorun = image.device().machine().root_device().ioport("CONFIG")->read_safe(0xFF) & 1;
123123
124124      device_t *cpu = image.device().machine().device("maincpu");
125125      address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
r15082r15083
156156   if (execute_address != 0xffff)
157157   {
158158      /* check to see if autorun is on (I hate how this works) */
159      autorun = input_port_read_safe(image.device().machine(), "CONFIG", 0xFF) & 1;
159      autorun = image.device().machine().root_device().ioport("CONFIG")->read_safe(0xFF) & 1;
160160
161161      address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
162162
src/mess/drivers/vip.c
r15082r15083
438438
439439UINT32 vip_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
440440{
441   switch (input_port_read(machine(), "VIDEO"))
441   switch (ioport("VIDEO")->read())
442442   {
443443   case VIDEO_CDP1861:
444444      m_vdc->screen_update(screen, bitmap, cliprect);
r15082r15083
456456
457457READ_LINE_MEMBER( vip_state::clear_r )
458458{
459   return BIT(input_port_read(machine(), "RUN"), 0);
459   return BIT(ioport("RUN")->read(), 0);
460460}
461461
462462READ_LINE_MEMBER( vip_state::ef2_r )
r15082r15083
468468
469469READ_LINE_MEMBER( vip_state::ef3_r )
470470{
471   return BIT(input_port_read(machine(), "KEYPAD"), m_keylatch);
471   return BIT(ioport("KEYPAD")->read(), m_keylatch);
472472}
473473
474474READ_LINE_MEMBER( vip_state::ef4_r )
475475{
476   switch (input_port_read(machine(), "KEYBOARD"))
476   switch (ioport("KEYBOARD")->read())
477477   {
478478   case KEYBOARD_VP580:
479      return BIT(input_port_read(machine(), "VP-580"), m_keylatch);
479      return BIT(ioport("VP-580")->read(), m_keylatch);
480480   }
481481
482482   return 0;
r15082r15083
486486{
487487   vip_state *state = device->machine().driver_data<vip_state>();
488488
489   switch (input_port_read(device->machine(), "SOUND"))
489   switch (state->ioport("SOUND")->read())
490490   {
491491   case SOUND_VP550:
492492      state->m_vp550->sc1_w(BIT(sc, 1));
r15082r15083
501501WRITE_LINE_MEMBER( vip_state::q_w )
502502{
503503   // sound output
504   switch (input_port_read(machine(), "SOUND"))
504   switch (ioport("SOUND")->read())
505505   {
506506   case SOUND_SPEAKER:
507507      discrete_sound_w(m_beeper, NODE_01, state);
r15082r15083
532532
533533WRITE8_MEMBER( vip_state::dma_w )
534534{
535   switch (input_port_read(machine(), "VIDEO"))
535   switch (ioport("VIDEO")->read())
536536   {
537537   case VIDEO_CDP1861:
538538      m_vdc->dma_w(space, offset, data);
r15082r15083
617617   m_vp551->reset();
618618
619619   /* configure video */
620   switch (input_port_read(machine(), "VIDEO"))
620   switch (ioport("VIDEO")->read())
621621   {
622622   case VIDEO_CDP1861:
623623      io->unmap_write(0x05, 0x05);
r15082r15083
631631   }
632632
633633   /* configure audio */
634   switch (input_port_read(machine(), "SOUND"))
634   switch (ioport("SOUND")->read())
635635   {
636636   case SOUND_SPEAKER:
637637      m_vp595->install_write_handlers(io, false);
src/mess/drivers/plan80.c
r15082r15083
5353   UINT8 data = 0xff;
5454
5555   if (m_kbd_row == 0xfe)
56      data = input_port_read(machine(), "LINE0");
56      data = ioport("LINE0")->read();
5757   else
5858   if (m_kbd_row == 0xfd)
59      data = input_port_read(machine(), "LINE1");
59      data = ioport("LINE1")->read();
6060   else
6161   if (m_kbd_row == 0xfb)
62      data = input_port_read(machine(), "LINE2");
62      data = ioport("LINE2")->read();
6363   else
6464   if (m_kbd_row == 0xf7)
65      data = input_port_read(machine(), "LINE3");
65      data = ioport("LINE3")->read();
6666   else
6767   if (m_kbd_row == 0xef)
68      data = input_port_read(machine(), "LINE4");
68      data = ioport("LINE4")->read();
6969
7070   return data;
7171}
src/mess/drivers/pb1000.c
r15082r15083
336336
337337UINT16 pb1000_state::read_touchscreen(running_machine &machine, UINT8 line)
338338{
339   UINT8 x = input_port_read(machine, "POSX")/0x40;
340   UINT8 y = input_port_read(machine, "POSY")/0x40;
339   UINT8 x = machine.root_device().ioport("POSX")->read()/0x40;
340   UINT8 y = machine.root_device().ioport("POSY")->read()/0x40;
341341
342   if (input_port_read(machine, "TOUCH"))
342   if (machine.root_device().ioport("TOUCH")->read())
343343   {
344344      if (x == line-7)
345345         return (0x1000<<y);
r15082r15083
359359      //Read all the input lines
360360      for (int line = 1; line <= 12; line++)
361361      {
362         data |= input_port_read(machine, bitnames[line]);
362         data |= machine.root_device().ioport(bitnames[line])->read();
363363         data |= read_touchscreen(machine, line);
364364      }
365365
366366   }
367367   else
368368   {
369      data = input_port_read(machine, bitnames[m_kb_matrix & 0x0f]);
369      data = machine.root_device().ioport(bitnames[m_kb_matrix & 0x0f])->read();
370370      data |= read_touchscreen(machine, m_kb_matrix & 0x0f);
371371   }
372372
r15082r15083
383383      //Read all the input lines
384384      for (int line = 1; line <= 12; line++)
385385      {
386         data |= input_port_read(machine, bitnames[line]);
386         data |= machine.root_device().ioport(bitnames[line])->read();
387387      }
388388
389389   }
390390   else
391391   {
392      data = input_port_read(machine, bitnames[m_kb_matrix & 0x0f]);
392      data = machine.root_device().ioport(bitnames[m_kb_matrix & 0x0f])->read();
393393   }
394394
395395   return data;
src/mess/drivers/pdp1.c
r15082r15083
495495   pdp1_state *state = machine.driver_data<pdp1_state>();
496496   int cfg;
497497
498   cfg = input_port_read(machine, "CFG");
498   cfg = machine.root_device().ioport("CFG")->read();
499499   pdp1_reset_param.extend_support = (cfg >> pdp1_config_extend_bit) & pdp1_config_extend_mask;
500500   pdp1_reset_param.hw_mul_div = (cfg >> pdp1_config_hw_mul_div_bit) & pdp1_config_hw_mul_div_mask;
501501   pdp1_reset_param.type_20_sbs = (cfg >> pdp1_config_type_20_sbs_bit) & pdp1_config_type_20_sbs_mask;
r15082r15083
16331633*/
16341634static void iot_011(device_t *device, int op2, int nac, int mb, int *io, int ac)
16351635{
1636   int key_state = input_port_read(device->machine(), "SPACEWAR");
1636   int key_state = device->machine().root_device().ioport("SPACEWAR")->read();
16371637   int reply;
16381638
16391639
r15082r15083
17221722
17231723   for (i=0; i<4; i++)
17241724   {
1725      typewriter_keys[i] = input_port_read(machine, twrnames[i]);
1725      typewriter_keys[i] = machine.root_device().ioport(twrnames[i])->read();
17261726   }
17271727
17281728   for (i=0; i<4; i++)
r15082r15083
17531753   int x_delta, y_delta;
17541754   int current_state;
17551755
1756   state->m_lightpen.active = (input_port_read(machine, "CFG") >> pdp1_config_lightpen_bit) & pdp1_config_lightpen_mask;
1756   state->m_lightpen.active = (machine.root_device().ioport("CFG")->read() >> pdp1_config_lightpen_bit) & pdp1_config_lightpen_mask;
17571757
1758   current_state = input_port_read(machine, "LIGHTPEN");
1758   current_state = machine.root_device().ioport("LIGHTPEN")->read();
17591759
17601760   /* update pen down state */
17611761   state->m_lightpen.down = state->m_lightpen.active && (current_state & pdp1_lightpen_down);
r15082r15083
17771777   state->m_old_lightpen = current_state;
17781778
17791779   /* update pen position */
1780   x_delta = input_port_read(machine, "LIGHTX");
1781   y_delta = input_port_read(machine, "LIGHTY");
1780   x_delta = machine.root_device().ioport("LIGHTX")->read();
1781   y_delta = machine.root_device().ioport("LIGHTY")->read();
17821782
17831783   if (x_delta >= 0x80)
17841784      x_delta -= 0x100;
r15082r15083
18161816   int ta_transitions;
18171817
18181818
1819   cpu_set_reg(device, PDP1_SS, input_port_read(device->machine(), "SENSE"));
1819   cpu_set_reg(device, PDP1_SS, device->machine().root_device().ioport("SENSE")->read());
18201820
18211821   /* read new state of control keys */
1822   control_keys = input_port_read(device->machine(), "CSW");
1822   control_keys = state->ioport("CSW")->read();
18231823
18241824   if (control_keys & pdp1_control)
18251825   {
r15082r15083
19111911
19121912
19131913      /* handle test word keys */
1914      tw_keys = (input_port_read(machine, "TWDMSB") << 16) | input_port_read(machine, "TWDLSB");
1914      tw_keys = (machine.root_device().ioport("TWDMSB")->read() << 16) | machine.root_device().ioport("TWDLSB")->read();
19151915
19161916      /* compute transitions */
19171917      tw_transitions = tw_keys & (~ state->m_old_tw_keys);
r15082r15083
19241924
19251925
19261926      /* handle address keys */
1927      ta_keys = input_port_read(machine, "TSTADD");
1927      ta_keys = machine.root_device().ioport("TSTADD")->read();
19281928
19291929      /* compute transitions */
19301930      ta_transitions = ta_keys & (~ state->m_old_ta_keys);
src/mess/drivers/elf.c
r15082r15083
1616#include "elf2.lh"
1717
1818#define RUN   \
19   BIT(input_port_read(machine(), "SPECIAL"), 0)
19   BIT(ioport("SPECIAL")->read(), 0)
2020
2121#define LOAD \
22   BIT(input_port_read(machine(), "SPECIAL"), 1)
22   BIT(ioport("SPECIAL")->read(), 1)
2323
2424#define MEMORY_PROTECT \
25   BIT(input_port_read(machine(), "SPECIAL"), 2)
25   BIT(ioport("SPECIAL")->read(), 2)
2626
2727#define INPUT \
28   BIT(input_port_read(machine(), "SPECIAL"), 3)
28   BIT(ioport("SPECIAL")->read(), 3)
2929
3030/* Read/Write Handlers */
3131
src/mess/drivers/dectalk.c
r15082r15083
208208   dectalk_state *state = device->machine().driver_data<dectalk_state>();
209209   UINT8 data = 0;
210210   data |= state->m_duart_inport&0xF;
211   data |= (input_port_read(device->machine(), "duart_in")&0xF0);
212   if ((state->m_hack_self_test == 1) && (input_port_read(device->machine(), "hacks")&0x01)) data |= 0x10; // hack to prevent hang if selftest disable bit is kept low past the first read; i suppose the proper use of this bit was an incremental switch, or perhaps its expecting an interrupt later from serial in or tone in? added a dipswitch to disable the hack for testing
211   data |= (device->machine().root_device().ioport("duart_in")->read()&0xF0);
212   if ((state->m_hack_self_test == 1) && (state->ioport("hacks")->read()&0x01)) data |= 0x10; // hack to prevent hang if selftest disable bit is kept low past the first read; i suppose the proper use of this bit was an incremental switch, or perhaps its expecting an interrupt later from serial in or tone in? added a dipswitch to disable the hack for testing
213213      state->m_hack_self_test = 1;
214214   return data;
215215}
src/mess/drivers/homelab.c
r15082r15083
5959      if (!BIT(offset, i))
6060      {
6161         sprintf(kbdrow,"LINE%d", i);
62         data &= input_port_read(machine(), kbdrow);
62         data &= ioport(kbdrow)->read();
6363      }
6464   }
6565
src/mess/drivers/bob85.c
r15082r15083
3737READ8_MEMBER(bob85_state::bob85_keyboard_r)
3838{
3939   UINT8 retVal = 0;
40   UINT8 line0 = input_port_read(machine(), "LINE0");
41   UINT8 line1 = input_port_read(machine(), "LINE1");
42   UINT8 line2 = input_port_read(machine(), "LINE2");
40   UINT8 line0 = ioport("LINE0")->read();
41   UINT8 line1 = ioport("LINE1")->read();
42   UINT8 line2 = ioport("LINE2")->read();
4343
4444   if (line0)
4545   {
src/mess/drivers/pc8401a.c
r15082r15083
4242   /* scan keyboard */
4343   for (row = 0; row < 10; row++)
4444   {
45      UINT8 data = input_port_read(machine(), keynames[row]);
45      UINT8 data = ioport(keynames[row])->read();
4646
4747      if (data != 0xff)
4848      {
src/mess/drivers/pc100.c
r15082r15083
152152READ8_MEMBER( pc100_state::pc100_key_r )
153153{
154154   if(offset)
155      return input_port_read(machine(), "DSW"); // bit 5: horizontal/vertical monitor dsw
155      return ioport("DSW")->read(); // bit 5: horizontal/vertical monitor dsw
156156
157157   return 0;
158158}
src/mess/drivers/pc9801.c
r15082r15083
22042204*
22052205****************************************/
22062206
2207static READ8_DEVICE_HANDLER( ppi_sys_porta_r ) { return input_port_read(device->machine(),"DSW2"); }
2208static READ8_DEVICE_HANDLER( ppi_sys_portb_r ) { return input_port_read(device->machine(),"DSW1") & 0xff; }
2209static READ8_DEVICE_HANDLER( ppi_prn_portb_r ) { return input_port_read(device->machine(),"DSW1") >> 8; }
2207static READ8_DEVICE_HANDLER( ppi_sys_porta_r ) { return device->machine().root_device().ioport("DSW2")->read(); }
2208static READ8_DEVICE_HANDLER( ppi_sys_portb_r ) { return device->machine().root_device().ioport("DSW1")->read() & 0xff; }
2209static READ8_DEVICE_HANDLER( ppi_prn_portb_r ) { return device->machine().root_device().ioport("DSW1")->read() >> 8; }
22102210
22112211static WRITE8_DEVICE_HANDLER( ppi_sys_portc_w )
22122212{
r15082r15083
24402440      int i;
24412441
24422442      ROM = machine.root_device().memregion("fdc_bios_2dd")->base();
2443      op_mode = (input_port_read(machine, "ROM_LOAD") & 2) >> 1;
2443      op_mode = (machine.root_device().ioport("ROM_LOAD")->read() & 2) >> 1;
24442444
24452445      for(i=0;i<0x1000;i++)
24462446         ROM[i] = PRG[i+op_mode*0x8000];
24472447
24482448      ROM = machine.root_device().memregion("fdc_bios_2hd")->base();
2449      op_mode = input_port_read(machine, "ROM_LOAD") & 1;
2449      op_mode = machine.root_device().ioport("ROM_LOAD")->read() & 1;
24502450
24512451      for(i=0;i<0x1000;i++)
24522452         ROM[i] = PRG[i+op_mode*0x8000+0x10000];
src/mess/drivers/nakajies.c
r15082r15083
483483   static const char *const bitnames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4",
484484                                 "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" };
485485
486   return (m_matrix > 0x00) ? input_port_read(machine(), bitnames[m_matrix - 1]) : 0;
486   return (m_matrix > 0x00) ? ioport(bitnames[m_matrix - 1])->read() : 0;
487487}
488488
489489
r15082r15083
501501static INPUT_CHANGED( trigger_irq )
502502{
503503   nakajies_state *state = field.machine().driver_data<nakajies_state>();
504   UINT8 irqs = input_port_read( field.machine(), "debug" );
504   UINT8 irqs = field.machine().root_device().ioport( "debug" )->read();
505505
506506   state->m_irq_active |= irqs;
507507   state->nakajies_update_irqs(field.machine());
src/mess/drivers/mz2000.c
r15082r15083
507507   beep_set_frequency(machine.device(BEEPER_TAG),4096);
508508   beep_set_state(machine.device(BEEPER_TAG),0);
509509
510   state->m_color_mode = input_port_read(machine,"CONFIG") & 1;
511   state->m_has_fdc = (input_port_read(machine,"CONFIG") & 2) >> 1;
512   state->m_hi_mode = (input_port_read(machine,"CONFIG") & 4) >> 2;
510   state->m_color_mode = machine.root_device().ioport("CONFIG")->read() & 1;
511   state->m_has_fdc = (machine.root_device().ioport("CONFIG")->read() & 2) >> 1;
512   state->m_hi_mode = (machine.root_device().ioport("CONFIG")->read() & 4) >> 2;
513513
514514   {
515515      int i;
r15082r15083
672672
673673      res = 0xff;
674674      for(i=0;i<0xe;i++)
675         res &= input_port_read(device->machine(), keynames[i]);
675         res &= device->machine().root_device().ioport(keynames[i])->read();
676676
677677      state->m_pio_latchb = res;
678678
679679      return res;
680680   }
681681
682   state->m_pio_latchb = input_port_read(device->machine(), keynames[state->m_key_mux & 0xf]);
682   state->m_pio_latchb = device->machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
683683
684   return input_port_read(device->machine(), keynames[state->m_key_mux & 0xf]);
684   return device->machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
685685}
686686
687687static Z80PIO_INTERFACE( mz2000_pio1_intf )
src/mess/drivers/osbexec.c
r15082r15083
156156   UINT8 data = 0xFF;
157157
158158   if ( offset & 0x0100 )
159      data &= input_port_read( machine(), "ROW0" );
159      data &= ioport( "ROW0" )->read();
160160
161161   if ( offset & 0x0200 )
162      data &= input_port_read( machine(), "ROW1" );
162      data &= ioport( "ROW1" )->read();
163163
164164   if ( offset & 0x0400 )
165      data &= input_port_read( machine(), "ROW2" );
165      data &= ioport( "ROW2" )->read();
166166
167167   if ( offset & 0x0800 )
168      data &= input_port_read( machine(), "ROW3" );
168      data &= ioport( "ROW3" )->read();
169169
170170   if ( offset & 0x1000 )
171      data &= input_port_read( machine(), "ROW4" );
171      data &= ioport( "ROW4" )->read();
172172
173173   if ( offset & 0x2000 )
174      data &= input_port_read( machine(), "ROW5" );
174      data &= ioport( "ROW5" )->read();
175175
176176   if ( offset & 0x4000 )
177      data &= input_port_read( machine(), "ROW6" );
177      data &= ioport( "ROW6" )->read();
178178
179179   if ( offset & 0x8000 )
180      data &= input_port_read( machine(), "ROW7" );
180      data &= ioport( "ROW7" )->read();
181181
182182   return data;
183183}
src/mess/drivers/z100.c
r15082r15083
758758   //z100_state *state = machine.driver_data<z100_state>();
759759   int i;
760760
761   if(input_port_read(machine,"CONFIG") & 1)
761   if(machine.root_device().ioport("CONFIG")->read() & 1)
762762   {
763763      for(i=0;i<8;i++)
764764         palette_set_color_rgb(machine, i,pal1bit(i >> 1),pal1bit(i >> 2),pal1bit(i >> 0));
src/mess/drivers/tec1.c
r15082r15083
189189READ8_MEMBER( tec1_state::tec1_kbd_r )
190190{
191191   cputag_set_input_line(machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
192   return m_kbd | input_port_read(machine(), "SHIFT");
192   return m_kbd | ioport("SHIFT")->read();
193193}
194194
195195UINT8 tec1_state::tec1_convert_col_to_bin( UINT8 col, UINT8 row )
r15082r15083
239239
240240    // 74C923 4 by 5 key encoder.
241241    // if previous key is still held, bail out
242   if (input_port_read(machine, keynames[state->m_kbd_row]))
243      if (state->tec1_convert_col_to_bin(input_port_read(machine, keynames[state->m_kbd_row]), state->m_kbd_row) == state->m_kbd)
242   if (machine.root_device().ioport(keynames[state->m_kbd_row])->read())
243      if (state->tec1_convert_col_to_bin(machine.root_device().ioport(keynames[state->m_kbd_row])->read(), state->m_kbd_row) == state->m_kbd)
244244         return;
245245
246246   state->m_kbd_row++;
247247   state->m_kbd_row &= 3;
248248
249249   /* see if a key pressed */
250   if (input_port_read(machine, keynames[state->m_kbd_row]))
250   if (machine.root_device().ioport(keynames[state->m_kbd_row])->read())
251251   {
252      state->m_kbd = state->tec1_convert_col_to_bin(input_port_read(machine, keynames[state->m_kbd_row]), state->m_kbd_row);
252      state->m_kbd = state->tec1_convert_col_to_bin(machine.root_device().ioport(keynames[state->m_kbd_row])->read(), state->m_kbd_row);
253253      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, HOLD_LINE);
254254      state->m_key_pressed = TRUE;
255255   }
src/mess/drivers/c65.c
r15082r15083
221221
222222static UINT8 c65_lightpen_x_cb( running_machine &machine )
223223{
224   return input_port_read(machine, "LIGHTX") & ~0x01;
224   return machine.root_device().ioport("LIGHTX")->read() & ~0x01;
225225}
226226
227227static UINT8 c65_lightpen_y_cb( running_machine &machine )
228228{
229   return input_port_read(machine, "LIGHTY") & ~0x01;
229   return machine.root_device().ioport("LIGHTY")->read() & ~0x01;
230230}
231231
232232static UINT8 c65_lightpen_button_cb( running_machine &machine )
233233{
234   return input_port_read(machine, "OTHER") & 0x04;
234   return machine.root_device().ioport("OTHER")->read() & 0x04;
235235}
236236
237237static UINT8 c65_c64_mem_r( running_machine &machine, int offset )
src/mess/drivers/dai.c
r15082r15083
162162      PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
163163      PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
164164   PORT_START("IN8") /* [8] */
165      PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_VBLANK)
165      PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
166166      PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1)
167167      PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(2)
168168      PORT_BIT(0xcb, IP_ACTIVE_HIGH, IPT_UNUSED)
src/mess/drivers/mmd1.c
r15082r15083
210210// keyboard has a keydown and a keyup code. Keyup = last keydown + bit 7 set
211211READ8_MEMBER( mmd1_state::mmd1_keyboard_r )
212212{
213   UINT8 line1 = input_port_read(machine(),"LINE1");
214   UINT8 line2 = input_port_read(machine(),"LINE2");
213   UINT8 line1 = ioport("LINE1")->read();
214   UINT8 line2 = ioport("LINE2")->read();
215215   UINT8 i, data = 0xff;
216216
217217
r15082r15083
375375{
376376   // need to add cassin, ttyin bits
377377   UINT8 data = 0x87;
378   data |= input_port_read(machine(),"DSW");
378   data |= ioport("DSW")->read();
379379   return data;
380380}
381381
r15082r15083
398398   {
399399      char kbdrow[6];
400400      sprintf(kbdrow,"X%X",m_digit);
401      data = input_port_read(machine(), kbdrow);
401      data = ioport(kbdrow)->read();
402402   }
403403   return data;
404404}
src/mess/drivers/mc1000.c
r15082r15083
287287
288288   if (!BIT(m_keylatch, 0))
289289   {
290      data &= input_port_read(machine(), "ROW0");
291      if (input_port_read(machine(), "JOYBKEYMAP")) data &= input_port_read(machine(), "JOYB");
290      data &= ioport("ROW0")->read();
291      if (ioport("JOYBKEYMAP")->read()) data &= ioport("JOYB")->read();
292292   }
293293   if (!BIT(m_keylatch, 1))
294294   {
295      data &= input_port_read(machine(), "ROW1");
296      if (input_port_read(machine(), "JOYAKEYMAP")) data &= input_port_read(machine(), "JOYA");
295      data &= ioport("ROW1")->read();
296      if (ioport("JOYAKEYMAP")->read()) data &= ioport("JOYA")->read();
297297   }
298   if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "ROW2");
299   if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "ROW3");
300   if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "ROW4");
301   if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "ROW5");
302   if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "ROW6");
303   if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "ROW7");
298   if (!BIT(m_keylatch, 2)) data &= ioport("ROW2")->read();
299   if (!BIT(m_keylatch, 3)) data &= ioport("ROW3")->read();
300   if (!BIT(m_keylatch, 4)) data &= ioport("ROW4")->read();
301   if (!BIT(m_keylatch, 5)) data &= ioport("ROW5")->read();
302   if (!BIT(m_keylatch, 6)) data &= ioport("ROW6")->read();
303   if (!BIT(m_keylatch, 7)) data &= ioport("ROW7")->read();
304304
305   data = (input_port_read(machine(), "MODIFIERS") & 0xc0) | (data & 0x3f);
305   data = (ioport("MODIFIERS")->read() & 0xc0) | (data & 0x3f);
306306
307307   if (m_cassette->input() < +0.0)   data &= 0x7f;
308308
src/mess/drivers/adam.c
r15082r15083
605605
606606   UINT8 data = 0xff;
607607
608   if (!BIT(m_key_y, 0)) data &= input_port_read(machine(), "Y0");
609   if (!BIT(m_key_y, 1)) data &= input_port_read(machine(), "Y1");
610   if (!BIT(m_key_y, 2)) data &= input_port_read(machine(), "Y2");
611   if (!BIT(m_key_y, 3)) data &= input_port_read(machine(), "Y3");
612   if (!BIT(m_key_y, 4)) data &= input_port_read(machine(), "Y4");
613   if (!BIT(m_key_y, 5)) data &= input_port_read(machine(), "Y5");
614   if (!BIT(m_key_y, 6)) data &= input_port_read(machine(), "Y6");
615   if (!BIT(m_key_y, 7)) data &= input_port_read(machine(), "Y7");
616   if (!BIT(m_key_y, 8)) data &= input_port_read(machine(), "Y8");
617   if (!BIT(m_key_y, 9)) data &= input_port_read(machine(), "Y9");
618   if (!BIT(m_key_y, 10)) data &= input_port_read(machine(), "Y10");
619   if (!BIT(m_key_y, 11)) data &= input_port_read(machine(), "Y11");
620   if (!BIT(m_key_y, 12)) data &= input_port_read(machine(), "Y12");
608   if (!BIT(m_key_y, 0)) data &= ioport("Y0")->read();
609   if (!BIT(m_key_y, 1)) data &= ioport("Y1")->read();
610   if (!BIT(m_key_y, 2)) data &= ioport("Y2")->read();
611   if (!BIT(m_key_y, 3)) data &= ioport("Y3")->read();
612   if (!BIT(m_key_y, 4)) data &= ioport("Y4")->read();
613   if (!BIT(m_key_y, 5)) data &= ioport("Y5")->read();
614   if (!BIT(m_key_y, 6)) data &= ioport("Y6")->read();
615   if (!BIT(m_key_y, 7)) data &= ioport("Y7")->read();
616   if (!BIT(m_key_y, 8)) data &= ioport("Y8")->read();
617   if (!BIT(m_key_y, 9)) data &= ioport("Y9")->read();
618   if (!BIT(m_key_y, 10)) data &= ioport("Y10")->read();
619   if (!BIT(m_key_y, 11)) data &= ioport("Y11")->read();
620   if (!BIT(m_key_y, 12)) data &= ioport("Y12")->read();
621621
622622   return data;
623623}
src/mess/drivers/cbmb.c
r15082r15083
346346
347347READ8_MEMBER( cbmb_state::vic_lightpen_x_cb )
348348{
349   return input_port_read(machine(), "LIGHTX") & ~0x01;
349   return ioport("LIGHTX")->read() & ~0x01;
350350}
351351
352352READ8_MEMBER( cbmb_state::vic_lightpen_y_cb )
353353{
354   return input_port_read(machine(), "LIGHTY") & ~0x01;
354   return ioport("LIGHTY")->read() & ~0x01;
355355}
356356
357357READ8_MEMBER( cbmb_state::vic_lightpen_button_cb )
358358{
359   return input_port_read(machine(), "OTHER") & 0x04;
359   return ioport("OTHER")->read() & 0x04;
360360}
361361
362362READ8_MEMBER( cbmb_state::vic_dma_read )
r15082r15083
374374
375375READ8_MEMBER( cbmb_state::vic_rdy_cb )
376376{
377   return input_port_read(machine(), "CTRLSEL") & 0x08;
377   return ioport("CTRLSEL")->read() & 0x08;
378378}
379379
380380
src/mess/drivers/cfx9850.c
r15082r15083
7272      if (BIT(m_ko, i))
7373      {
7474         sprintf(kbdrow,"KO%d", i+1);
75         data |= input_port_read(machine(), kbdrow);
75         data |= ioport(kbdrow)->read();
7676      }
7777   }
7878
src/mess/drivers/mini2440.c
r15082r15083
146146   UINT32 data = 0;
147147   switch (offset)
148148   {
149      case 2 + 0 : data = input_port_read( device->machine(), "PENX"); break;
150      case 2 + 1 : data = 915 - input_port_read( device->machine(), "PENY") + 90; break;
149      case 2 + 0 : data = device->machine().root_device().ioport( "PENX")->read(); break;
150      case 2 + 1 : data = 915 - device->machine().root_device().ioport( "PENY")->read() + 90; break;
151151   }
152152   verboselog( device->machine(), 5,  "s3c2440_adc_data_r %08X\n", data);
153153   return data;
src/mess/drivers/mc80.c
r15082r15083
136136   for (i = 1; i < 8; i++)
137137   {
138138      sprintf(kbdrow,"X%X", i);
139      mem->write_word(0xd20+i, input_port_read(timer.machine(), kbdrow));
139      mem->write_word(0xd20+i, timer.machine().root_device().ioport(kbdrow)->read());
140140   }
141141}
142142
src/mess/drivers/pc88va.c
r15082r15083
857857   UINT8 vrtc,sw1;
858858   vrtc = (machine().primary_screen->vpos() < 200) ? 0x20 : 0x00; // vblank
859859
860   sw1 = (input_port_read(machine(), "DSW") & 1) ? 2 : 0;
860   sw1 = (ioport("DSW")->read() & 1) ? 2 : 0;
861861
862862   return vrtc | sw1 | 0xc0;
863863}
r15082r15083
913913                                           "KEY8", "KEY9", "KEYA", "KEYB",
914914                                           "KEYC", "KEYD", "KEYE", "KEYF" };
915915
916   return input_port_read(machine(), keynames[offset]);
916   return ioport(keynames[offset])->read();
917917}
918918
919919WRITE16_MEMBER(pc88va_state::backupram_wp_1_w)
r15082r15083
10151015{
10161016   UINT8 sys_op;
10171017
1018   sys_op = input_port_read(machine(), "SYSOP_SW") & 3;
1018   sys_op = ioport("SYSOP_SW")->read() & 3;
10191019
10201020   return 0xfffc | sys_op; // docs says all the other bits are high
10211021}
r15082r15083
14401440{
14411441   UINT8 sw5, sw4, sw3, sw2,speed_sw;
14421442
1443   speed_sw = (input_port_read(device->machine(), "SPEED_SW") & 1) ? 0x20 : 0x00;
1444   sw5 = (input_port_read(device->machine(), "DSW") & 0x10);
1445   sw4 = (input_port_read(device->machine(), "DSW") & 0x08);
1446   sw3 = (input_port_read(device->machine(), "DSW") & 0x04);
1447   sw2 = (input_port_read(device->machine(), "DSW") & 0x02);
1443   speed_sw = (device->machine().root_device().ioport("SPEED_SW")->read() & 1) ? 0x20 : 0x00;
1444   sw5 = (device->machine().root_device().ioport("DSW")->read() & 0x10);
1445   sw4 = (device->machine().root_device().ioport("DSW")->read() & 0x08);
1446   sw3 = (device->machine().root_device().ioport("DSW")->read() & 0x04);
1447   sw2 = (device->machine().root_device().ioport("DSW")->read() & 0x02);
14481448
14491449   return 0xc1 | sw5 | sw4 | sw3 | sw2 | speed_sw;
14501450}
r15082r15083
14531453{
14541454   UINT8 xsw1;
14551455
1456   xsw1 = (input_port_read(device->machine(), "DSW") & 1) ? 0 : 8;
1456   xsw1 = (device->machine().root_device().ioport("DSW")->read() & 1) ? 0 : 8;
14571457
14581458   return 0xf7 | xsw1;
14591459}
src/mess/drivers/pc6001.c
r15082r15083
265265      { 0, 5, 2, 7 }, //Pink / Green
266266      { 0, 2, 5, 7 }, //Green / Pink
267267   };
268   col_setting = input_port_read(machine,"MODE4_DSW") & 7;
268   col_setting = machine.root_device().ioport("MODE4_DSW")->read() & 7;
269269
270270   for(y=0;y<192;y++)
271271   {
r15082r15083
19081908   UINT8 shift_pressed,caps_lock;
19091909   scancode = 0;
19101910
1911   shift_pressed = (input_port_read(machine,"key_modifiers") & 2)>>1;
1912   caps_lock = (input_port_read(machine,"key_modifiers") & 8)>>3;
1911   shift_pressed = (machine.root_device().ioport("key_modifiers")->read() & 2)>>1;
1912   caps_lock = (machine.root_device().ioport("key_modifiers")->read() & 8)>>3;
19131913
19141914   for(port_i=0;port_i<3;port_i++)
19151915   {
19161916      for(i=0;i<32;i++)
19171917      {
1918         if((input_port_read(machine,portnames[port_i])>>i) & 1)
1918         if((machine.root_device().ioport(portnames[port_i])->read()>>i) & 1)
19191919         {
19201920            if((shift_pressed != caps_lock) && scancode >= 0x41 && scancode <= 0x5f)
19211921               scancode+=0x20;
r15082r15083
19431943
19441944static UINT8 check_joy_press(running_machine &machine)
19451945{
1946   UINT8 p1_key = input_port_read(machine,"P1") ^ 0xff;
1947   UINT8 shift_key = input_port_read(machine,"key_modifiers") & 0x02;
1948   UINT8 space_key = input_port_read(machine,"key2") & 0x01;
1946   UINT8 p1_key = machine.root_device().ioport("P1")->read() ^ 0xff;
1947   UINT8 shift_key = machine.root_device().ioport("key_modifiers")->read() & 0x02;
1948   UINT8 space_key = machine.root_device().ioport("key2")->read() & 0x01;
19491949   UINT8 joy_press;
19501950
19511951      /*
r15082r15083
20282028{
20292029   pc6001_state *state = timer.machine().driver_data<pc6001_state>();
20302030   address_space *space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
2031   UINT32 key1 = input_port_read(timer.machine(),"key1");
2032   UINT32 key2 = input_port_read(timer.machine(),"key2");
2033   UINT32 key3 = input_port_read(timer.machine(),"key3");
2034//  UINT8 p1_key = input_port_read(timer.machine(), "P1");
2031   UINT32 key1 = timer.machine().root_device().ioport("key1")->read();
2032   UINT32 key2 = timer.machine().root_device().ioport("key2")->read();
2033   UINT32 key3 = timer.machine().root_device().ioport("key3")->read();
2034//  UINT8 p1_key = timer.machine().root_device().ioport("P1")->read();
20352035
20362036   if(state->m_cas_switch == 0)
20372037   {
src/mess/drivers/pc1512.c
r15082r15083
319319
320320        */
321321
322      data |= input_port_read(machine(), "LK") & 0x07;
322      data |= ioport("LK")->read() & 0x07;
323323
324324      data |= m_centronics->fault_r() << 3;
325325      data |= m_centronics->vcc_r() << 4;
r15082r15083
404404        */
405405      data = m_printer_control;
406406      data |= m_opt << 5;
407      data |= (input_port_read(machine(), "SW") & 0x60) << 1;
407      data |= (ioport("SW")->read() & 0x60) << 1;
408408      break;
409409
410410   default:
r15082r15083
571571   }
572572   else if (!BIT(offset, 7))
573573   {
574      UINT16 sw = input_port_read(machine(), "SW");
574      UINT16 sw = ioport("SW")->read();
575575
576576      if (!BIT(offset, 14))
577577      {
r15082r15083
781781   PORT_DIPSETTING(   0x00, "Diagnostic Mode" )
782782
783783   PORT_START("SW")
784   PORT_DIPNAME( 0x0f, 0x09, "Initial Display Mode" ) PORT_DIPLOCATION("SW:1,2,3,4") PORT_CONDITION("SW", 0x200, PORTCOND_EQUALS, 0x200)
784   PORT_DIPNAME( 0x0f, 0x09, "Initial Display Mode" ) PORT_DIPLOCATION("SW:1,2,3,4") PORT_CONDITION("SW", 0x200, EQUALS, 0x200)
785785   PORT_DIPSETTING(   0x0b, "Internal MD, External CGA80" )
786786   PORT_DIPSETTING(   0x0a, "Internal MD, External CGA40" )
787787   PORT_DIPSETTING(   0x09, "Internal ECD350, External MDA/HERC" )
r15082r15083
794794   PORT_DIPSETTING(   0x02, "External MDA/HERC, Internal ECD200" )
795795   PORT_DIPSETTING(   0x01, "External MDA/HERC, Internal CD80" )
796796   PORT_DIPSETTING(   0x00, "External MDA/HERC, Internal CD40" )
797   PORT_DIPNAME( 0x10, 0x10, "MC6845 Mode" ) PORT_DIPLOCATION("SW:5") PORT_CONDITION("SW", 0x200, PORTCOND_EQUALS, 0x200)
797   PORT_DIPNAME( 0x10, 0x10, "MC6845 Mode" ) PORT_DIPLOCATION("SW:5") PORT_CONDITION("SW", 0x200, EQUALS, 0x200)
798798   PORT_DIPSETTING(   0x10, "EGA" )
799799   PORT_DIPSETTING(   0x00, "CGA/MDA/HERC" )
800   PORT_DIPNAME( 0x60, 0x00, "Font" ) PORT_DIPLOCATION("SW:6,7") PORT_CONDITION("SW", 0x300, PORTCOND_EQUALS, 0x300)
800   PORT_DIPNAME( 0x60, 0x00, "Font" ) PORT_DIPLOCATION("SW:6,7") PORT_CONDITION("SW", 0x300, EQUALS, 0x300)
801801   PORT_DIPSETTING(   0x00, DEF_STR( English ) )
802802   PORT_DIPSETTING(   0x60, "Danish" )
803803   PORT_DIPSETTING(   0x40, "Portuguese" )
804804   PORT_DIPSETTING(   0x20, "Greek" )
805   PORT_DIPNAME( 0x60, 0x60, "Default Display Mode" ) PORT_DIPLOCATION("SW:6,7") PORT_CONDITION("SW", 0x200, PORTCOND_EQUALS, 0x000)
805   PORT_DIPNAME( 0x60, 0x60, "Default Display Mode" ) PORT_DIPLOCATION("SW:6,7") PORT_CONDITION("SW", 0x200, EQUALS, 0x000)
806806   PORT_DIPSETTING(   0x60, "External EGA" )
807807   PORT_DIPSETTING(   0x40, "External CGA in 40 Column Mode" )
808808   PORT_DIPSETTING(   0x20, "External CGA in 80 Column Mode" )
809809   PORT_DIPSETTING(   0x00, "External Monochrome Adapter" )
810   PORT_DIPNAME( 0x80, 0x00, "Monitor" ) PORT_DIPLOCATION("SW:8") PORT_CONDITION("SW", 0x200, PORTCOND_EQUALS, 0x200)
810   PORT_DIPNAME( 0x80, 0x00, "Monitor" ) PORT_DIPLOCATION("SW:8") PORT_CONDITION("SW", 0x200, EQUALS, 0x200)
811811   PORT_DIPSETTING(   0x80, "CD (Standard RGB)" )
812812   PORT_DIPSETTING(   0x00, "ECD (Enhanced RGB)" )
813   PORT_DIPNAME( 0x100, 0x100, "Foreign Fonts" ) PORT_DIPLOCATION("SW:9") PORT_CONDITION("SW", 0x200, PORTCOND_EQUALS, 0x200)
813   PORT_DIPNAME( 0x100, 0x100, "Foreign Fonts" ) PORT_DIPLOCATION("SW:9") PORT_CONDITION("SW", 0x200, EQUALS, 0x200)
814814   PORT_DIPSETTING(    0x100, "Enabled" )
815815   PORT_DIPSETTING(    0x000, "Disabled" )
816816   PORT_DIPNAME( 0x200, 0x200, "Internal Graphics Adapter" ) PORT_DIPLOCATION("SW:10")
src/mess/drivers/mycom.c
r15082r15083
499499   UINT8 x, y, scancode = 0;
500500   UINT16 pressed[9];
501501   char kbdrow[3];
502   UINT8 modifiers = input_port_read(timer.machine(), "XX");
502   UINT8 modifiers = timer.machine().root_device().ioport("XX")->read();
503503   UINT8 shift_pressed = (modifiers & 2) >> 1;
504504   state->m_keyb_press_flag = 0;
505505
r15082r15083
507507   for (x = 0; x < 9; x++)
508508   {
509509      sprintf(kbdrow,"X%d",x);
510      pressed[x] = (input_port_read(timer.machine(), kbdrow));
510      pressed[x] = (timer.machine().root_device().ioport(kbdrow)->read());
511511   }
512512
513513   /* find what has changed */
src/mess/drivers/ti99_8.c
r15082r15083
506506      }
507507      else
508508      {
509         answer = (input_port_read(machine(), keynames8[m_keyboard_column]) << 6) & 0xC0;
509         answer = (ioport(keynames8[m_keyboard_column])->read() << 6) & 0xC0;
510510      }
511511      break;
512512
r15082r15083
523523      }
524524      else
525525      {
526         answer = (input_port_read(machine(), keynames8[m_keyboard_column]) >> 2) & 0x07;
526         answer = (ioport(keynames8[m_keyboard_column])->read() >> 2) & 0x07;
527527      }
528528      break;
529529
r15082r15083
806806{
807807   ti99_8 *driver = machine.driver_data<ti99_8>();
808808
809   if (input_port_read(machine, "MECMOUSE")==0x01)
809   if (machine.root_device().ioport("MECMOUSE")->read()==0x01)
810810      driver->m_mecmouse = static_cast<mecmouse_device*>(machine.device(MECMOUSE_TAG));
811811   else
812812      driver->m_mecmouse = NULL;
src/mess/drivers/spc1000.c
r15082r15083
9494      "LINE0", "LINE1", "LINE2", "LINE3", "LINE4",
9595      "LINE5", "LINE6", "LINE7", "LINE8", "LINE9"
9696   };
97   return input_port_read(machine(), keynames[offset]);
97   return ioport(keynames[offset])->read();
9898}
9999
100100static WRITE8_DEVICE_HANDLER(spc1000_gmode_w)
src/mess/drivers/sc1.c
r15082r15083
9797   UINT8 data = 0;
9898
9999   if (m_matrix & 0x01)
100      data |= input_port_read(machine(), "LINE1");
100      data |= ioport("LINE1")->read();
101101   if (m_matrix & 0x02)
102      data |= input_port_read(machine(), "LINE2");
102      data |= ioport("LINE2")->read();
103103   if (m_matrix & 0x04)
104      data |= input_port_read(machine(), "LINE3");
104      data |= ioport("LINE3")->read();
105105   if (m_matrix & 0x08)
106      data |= input_port_read(machine(), "LINE4");
106      data |= ioport("LINE4")->read();
107107   if (m_matrix & 0x10)
108      data |= input_port_read(machine(), "LINE5");
108      data |= ioport("LINE5")->read();
109109   if (m_matrix & 0x20)
110      data |= input_port_read(machine(), "LINE6");
110      data |= ioport("LINE6")->read();
111111   if (m_matrix & 0x40)
112      data |= input_port_read(machine(), "LINE7");
112      data |= ioport("LINE7")->read();
113113   if (m_matrix & 0x80)
114      data |= input_port_read(machine(), "LINE8");
114      data |= ioport("LINE8")->read();
115115
116116   return data;
117117}
src/mess/drivers/vii.c
r15082r15083
583583   {
584584      if(index == 0)
585585      {
586         UINT16 temp = input_port_read(machine(), "P1");
586         UINT16 temp = ioport("P1")->read();
587587         what |= (temp & 0x0001) ? 0x8000 : 0;
588588         what |= (temp & 0x0002) ? 0x4000 : 0;
589589         what |= (temp & 0x0004) ? 0x2000 : 0;
r15082r15083
10231023   UINT32 z = device->machine().rand() & 0x3ff;
10241024
10251025
1026   state->m_controller_input[0] = input_port_read(device->machine(), "P1");
1026   state->m_controller_input[0] = state->ioport("P1")->read();
10271027   state->m_controller_input[1] = (UINT8)x;
10281028   state->m_controller_input[2] = (UINT8)y;
10291029   state->m_controller_input[3] = (UINT8)z;
src/mess/drivers/x1.c
r15082r15083
568568{
569569   static const char *const portnames[3] = { "key1","key2","key3" };
570570   int i,port_i,scancode;
571   UINT8 keymod = input_port_read(machine(),"key_modifiers") & 0x1f;
572   UINT32 pad = input_port_read(machine(),"tenkey");
573   UINT32 f_key = input_port_read(machine(), "f_keys");
571   UINT8 keymod = ioport("key_modifiers")->read() & 0x1f;
572   UINT32 pad = ioport("tenkey")->read();
573   UINT32 f_key = ioport("f_keys")->read();
574574   scancode = 0;
575575
576576   for(port_i=0;port_i<3;port_i++)
577577   {
578578      for(i=0;i<32;i++)
579579      {
580         if((input_port_read(machine(), portnames[port_i])>>i) & 1)
580         if((ioport(portnames[port_i])->read()>>i) & 1)
581581         {
582582            //key_flag = 1;
583583            if(keymod & 0x02)  // shift not pressed
r15082r15083
643643    ---- ---x CTRL ON
644644    */
645645
646   val |= input_port_read(machine(), "key_modifiers") & 0x1f;
646   val |= ioport("key_modifiers")->read() & 0x1f;
647647
648648   if(check_keyboard_press() != 0)
649649      val &= ~0x40;
r15082r15083
666666
667667   if (port == 0)
668668   {
669      UINT32 key3 = input_port_read(machine(), "key3");
669      UINT32 key3 = ioport("key3")->read();
670670      if(key3 & 0x00020000) ret |= 0x80;  // Q
671671      if(key3 & 0x00800000) ret |= 0x40;  // W
672672      if(key3 & 0x00000020) ret |= 0x20;  // E
r15082r15083
679679   else
680680   if (port == 1)
681681   {
682      UINT32 pad = input_port_read(machine(), "tenkey");
682      UINT32 pad = ioport("tenkey")->read();
683683      if(pad & 0x00000080) ret |= 0x80;  // Tenkey 7
684684      if(pad & 0x00000010) ret |= 0x40;  // Tenkey 4
685685      if(pad & 0x00000002) ret |= 0x20;  // Tenkey 1
r15082r15083
692692   else
693693   if (port == 2)
694694   {
695      UINT32 key1 = input_port_read(machine(), "key1");
696      UINT32 key2 = input_port_read(machine(), "key2");
697      UINT32 pad = input_port_read(machine(), "tenkey");
695      UINT32 key1 = ioport("key1")->read();
696      UINT32 key2 = ioport("key2")->read();
697      UINT32 pad = ioport("tenkey")->read();
698698      if(key1 & 0x08000000) ret |= 0x80;  // ESC
699699      if(key2 & 0x00020000) ret |= 0x40;  // 1
700700      if(pad & 0x00000400) ret |= 0x20;  // Tenkey -
r15082r15083
16851685   m_io_bank_mode = 0; //any read disables the extended mode.
16861686
16871687   // a * at the end states devices used on plain X1 too
1688   if(offset == 0x0700)                     { return (ym2151_r(machine().device("ym"), offset-0x0700) & 0x7f) | (input_port_read(machine(), "SOUND_SW") & 0x80); }
1688   if(offset == 0x0700)                     { return (ym2151_r(machine().device("ym"), offset-0x0700) & 0x7f) | (ioport("SOUND_SW")->read() & 0x80); }
16891689   else if(offset == 0x0701)                      { return ym2151_r(machine().device("ym"), offset-0x0700); }
16901690   //0x704 is FM sound detection port on X1 turboZ
16911691   else if(offset >= 0x0704 && offset <= 0x0707)   { return z80ctc_r(m_ctc, offset-0x0704); }
r15082r15083
17151715   else if(offset == 0x1fc5)                  { return x1turbo_gfxpal_r(space,0); } // Z only!
17161716//  else if(offset >= 0x1fd0 && offset <= 0x1fdf)   { return x1_scrn_r(space,offset-0x1fd0); } //Z only
17171717   else if(offset == 0x1fe0)                  { return x1turboz_blackclip_r(space,0); }
1718   else if(offset == 0x1ff0)                  { return input_port_read(machine(), "X1TURBO_DSW"); }
1718   else if(offset == 0x1ff0)                  { return ioport("X1TURBO_DSW")->read(); }
17191719   else if(offset >= 0x2000 && offset <= 0x2fff)   { return m_avram[offset & 0x7ff]; }
17201720   else if(offset >= 0x3000 && offset <= 0x37ff)   { return m_tvram[offset & 0x7ff]; }
17211721   else if(offset >= 0x3800 && offset <= 0x3fff)   { return m_kvram[offset & 0x7ff]; }
r15082r15083
24102410{
24112411   x1_state *state = timer.machine().driver_data<x1_state>();
24122412   address_space *space = timer.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
2413   UINT32 key1 = input_port_read(timer.machine(),"key1");
2414   UINT32 key2 = input_port_read(timer.machine(),"key2");
2415   UINT32 key3 = input_port_read(timer.machine(),"key3");
2416   UINT32 key4 = input_port_read(timer.machine(),"tenkey");
2417   UINT32 f_key = input_port_read(timer.machine(), "f_keys");
2413   UINT32 key1 = timer.machine().root_device().ioport("key1")->read();
2414   UINT32 key2 = timer.machine().root_device().ioport("key2")->read();
2415   UINT32 key3 = timer.machine().root_device().ioport("key3")->read();
2416   UINT32 key4 = timer.machine().root_device().ioport("tenkey")->read();
2417   UINT32 f_key = timer.machine().root_device().ioport("f_keys")->read();
24182418
24192419   if(state->m_key_irq_vector)
24202420   {
src/mess/drivers/mk1.c
r15082r15083
6767
6868   if ( offset == 0 )
6969   {
70      if (BIT(data, 0)) data |= input_port_read(machine(), "LINE1");
71      if (BIT(data, 1)) data |= input_port_read(machine(), "LINE2");
72      if (BIT(data, 2)) data |= input_port_read(machine(), "LINE3");
73      if (BIT(data, 3)) data |= input_port_read(machine(), "LINE4");
70      if (BIT(data, 0)) data |= ioport("LINE1")->read();
71      if (BIT(data, 1)) data |= ioport("LINE2")->read();
72      if (BIT(data, 2)) data |= ioport("LINE3")->read();
73      if (BIT(data, 3)) data |= ioport("LINE4")->read();
7474
7575      for (i = 4; i < 8; i++)
7676      {
7777         if (BIT(data, i))
7878         {
79            if (BIT(input_port_read(machine(), "LINE1"), i)) data |= 1;
80            if (BIT(input_port_read(machine(), "LINE2"), i)) data |= 2;
81            if (BIT(input_port_read(machine(), "LINE3"), i)) data |= 4;
82            if (BIT(input_port_read(machine(), "LINE4"), i)) data |= 8;
79            if (BIT(ioport("LINE1")->read(), i)) data |= 1;
80            if (BIT(ioport("LINE2")->read(), i)) data |= 2;
81            if (BIT(ioport("LINE3")->read(), i)) data |= 4;
82            if (BIT(ioport("LINE4")->read(), i)) data |= 8;
8383         }
8484      }
8585   }
src/mess/drivers/palm.c
r15082r15083
5252
5353static INPUT_CHANGED( pen_check )
5454{
55   UINT8 button = input_port_read(field.machine(), "PENB");
55   UINT8 button = field.machine().root_device().ioport("PENB")->read();
5656   palm_state *state = field.machine().driver_data<palm_state>();
5757
5858   if(button)
r15082r15083
6363
6464static INPUT_CHANGED( button_check )
6565{
66   UINT8 button_state = input_port_read(field.machine(), "PORTD");
66   UINT8 button_state = field.machine().root_device().ioport("PORTD")->read();
6767   palm_state *state = field.machine().driver_data<palm_state>();
6868
6969   mc68328_set_port_d_lines(state->m_lsi, button_state, (int)(FPTR)param);
r15082r15083
101101static void palm_spim_exchange( device_t *device )
102102{
103103   palm_state *state = device->machine().driver_data<palm_state>();
104   UINT8 x = input_port_read(device->machine(), "PENX");
105   UINT8 y = input_port_read(device->machine(), "PENY");
104   UINT8 x = device->machine().root_device().ioport("PENX")->read();
105   UINT8 y = state->ioport("PENY")->read();
106106
107107   switch( state->m_port_f_latch & 0x0f )
108108   {
src/mess/drivers/chessmst.c
r15082r15083
225225   }
226226
227227   if (m_matrix & 0x100)
228      data |= input_port_read(machine(), "BUTTONS");
228      data |= ioport("BUTTONS")->read();
229229
230230   return data;
231231}
src/mess/drivers/dolphin.c
r15082r15083
8080{
8181   UINT8 keyin, i, data = 0xff;
8282
83   keyin = input_port_read(machine(), "X0");
83   keyin = ioport("X0")->read();
8484   if (keyin != 0xff)
8585      for (i = 0; i < 8; i++)
8686         if BIT(~keyin, i)
r15082r15083
8989            break;
9090         }
9191
92   keyin = input_port_read(machine(), "X1");
92   keyin = ioport("X1")->read();
9393   if (keyin != 0xff)
9494      for (i = 0; i < 8; i++)
9595         if BIT(~keyin, i)
r15082r15083
9898            break;
9999         }
100100
101   data &= input_port_read(machine(), "X2");
101   data &= ioport("X2")->read();
102102
103103   return data;
104104}
src/mess/drivers/kim1.c
r15082r15083
197197   switch( ( m_u2_port_b >> 1 ) & 0x0f )
198198   {
199199   case 0:
200      data = input_port_read(machine(), "LINE0");
200      data = ioport("LINE0")->read();
201201      break;
202202   case 1:
203      data = input_port_read(machine(), "LINE1");
203      data = ioport("LINE1")->read();
204204      break;
205205   case 2:
206      data = input_port_read(machine(), "LINE2");
206      data = ioport("LINE2")->read();
207207      break;
208208   }
209209   return data;
src/mess/drivers/d6800.c
r15082r15083
164164
165165READ_LINE_MEMBER( d6800_state::d6800_keydown_r )
166166{
167   UINT8 data = input_port_read(machine(), "LINE0")
168              & input_port_read(machine(), "LINE1")
169              & input_port_read(machine(), "LINE2")
170              & input_port_read(machine(), "LINE3");
167   UINT8 data = ioport("LINE0")->read()
168              & ioport("LINE1")->read()
169              & ioport("LINE2")->read()
170              & ioport("LINE3")->read();
171171
172172   return (data==0xff) ? 0 : 1;
173173}
174174
175175READ_LINE_MEMBER( d6800_state::d6800_fn_key_r )
176176{
177   return input_port_read(machine(), "SPECIAL");
177   return ioport("SPECIAL")->read();
178178}
179179
180180WRITE_LINE_MEMBER( d6800_state::d6800_screen_w )
r15082r15083
209209{
210210   UINT8 data = 15;
211211
212   if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "LINE0");
213   if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "LINE1");
214   if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "LINE2");
215   if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "LINE3");
212   if (!BIT(m_keylatch, 4)) data &= ioport("LINE0")->read();
213   if (!BIT(m_keylatch, 5)) data &= ioport("LINE1")->read();
214   if (!BIT(m_keylatch, 6)) data &= ioport("LINE2")->read();
215   if (!BIT(m_keylatch, 7)) data &= ioport("LINE3")->read();
216216
217217   return data | m_keylatch;
218218}
src/mess/drivers/glasgow.c
r15082r15083
119119   /* See if any keys pressed */
120120   data = 3;
121121
122   if (mboard_key_select == input_port_read(machine(), "LINE0"))
122   if (mboard_key_select == ioport("LINE0")->read())
123123      data &= 1;
124124
125   if (mboard_key_select == input_port_read(machine(), "LINE1"))
125   if (mboard_key_select == ioport("LINE1")->read())
126126      data &= 2;
127127
128128   return data << 8;
r15082r15083
181181   UINT16 data;
182182
183183   if (mboard_key_selector == 0)
184      data = input_port_read(machine(), "LINE0");
184      data = ioport("LINE0")->read();
185185   else
186      data = input_port_read(machine(), "LINE1");
186      data = ioport("LINE1")->read();
187187
188188   logerror("read Keyboard Offset = %x Data = %x Select = %x \n", offset, data, mboard_key_selector);
189189   data <<= 8;
r15082r15083
244244   UINT32 data;
245245
246246   if (mboard_key_selector == 0)
247      data = input_port_read(machine(), "LINE0");
247      data = ioport("LINE0")->read();
248248   else
249      data = input_port_read(machine(), "LINE1");
250   //if (mboard_key_selector == 1) data = input_port_read(machine, "LINE0"); else data = 0;
249      data = ioport("LINE1")->read();
250   //if (mboard_key_selector == 1) data = machine.root_device().ioport("LINE0")->read(); else data = 0;
251251   if(data)
252252      logerror("read Keyboard Offset = %x Data = %x\n", offset, data);
253253   data <<= 24;
src/mess/drivers/fp1100.c
r15082r15083
361361
362362   for(i=0;i<8;i++)
363363   {
364      slot_type = (input_port_read(machine, "SLOTS") >> i*2) & 3;
364      slot_type = (machine.root_device().ioport("SLOTS")->read() >> i*2) & 3;
365365      state->m_slot[i].id = id_type[slot_type];
366366   }
367367}
src/mess/drivers/beehive.c
r15082r15083
5050   {
5151      char kbdrow[6];
5252      sprintf(kbdrow,"X%d", m_keyline&15);
53      return input_port_read(machine(), kbdrow);
53      return ioport(kbdrow)->read();
5454   }
5555   else
5656      return 0xff;
src/mess/drivers/tmc600.c
r15082r15083
196196
197197READ_LINE_MEMBER( tmc600_state::clear_r )
198198{
199   return BIT(input_port_read(machine(), "RUN"), 0);
199   return BIT(ioport("RUN")->read(), 0);
200200}
201201
202202READ_LINE_MEMBER( tmc600_state::ef2_r )
r15082r15083
207207READ_LINE_MEMBER( tmc600_state::ef3_r )
208208{
209209   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
210   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
210   UINT8 data = ~ioport(keynames[m_keylatch / 8])->read();
211211
212212   return BIT(data, m_keylatch % 8);
213213}
src/mess/drivers/vic20.c
r15082r15083
446446   data |= m_iec->data_r() << 1;
447447
448448   // joystick
449   data &= ~(input_port_read(machine(), "JOY") & 0x3c);
449   data &= ~(ioport("JOY")->read() & 0x3c);
450450
451451   // cassette switch
452452   if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED)
r15082r15083
571571
572572   UINT8 data = 0xff;
573573
574   if (!BIT(m_key_col, 0)) data &= input_port_read(machine(), "ROW0");
575   if (!BIT(m_key_col, 1)) data &= input_port_read(machine(), "ROW1");
576   if (!BIT(m_key_col, 2)) data &= input_port_read(machine(), "ROW2");
577   if (!BIT(m_key_col, 3)) data &= input_port_read(machine(), "ROW3");
578   if (!BIT(m_key_col, 4)) data &= input_port_read(machine(), "ROW4");
579   if (!BIT(m_key_col, 5)) data &= input_port_read(machine(), "ROW5");
580   if (!BIT(m_key_col, 6)) data &= input_port_read(machine(), "ROW6");
581   if (!BIT(m_key_col, 7)) data &= input_port_read(machine(), "ROW7");
574   if (!BIT(m_key_col, 0)) data &= ioport("ROW0")->read();
575   if (!BIT(m_key_col, 1)) data &= ioport("ROW1")->read();
576   if (!BIT(m_key_col, 2)) data &= ioport("ROW2")->read();
577   if (!BIT(m_key_col, 3)) data &= ioport("ROW3")->read();
578   if (!BIT(m_key_col, 4)) data &= ioport("ROW4")->read();
579   if (!BIT(m_key_col, 5)) data &= ioport("ROW5")->read();
580   if (!BIT(m_key_col, 6)) data &= ioport("ROW6")->read();
581   if (!BIT(m_key_col, 7)) data &= ioport("ROW7")->read();
582582
583583   return data;
584584}
r15082r15083
603603   UINT8 data = 0xff;
604604
605605   // joystick
606   data &= ~(input_port_read(machine(), "JOY") & 0x80);
606   data &= ~(ioport("JOY")->read() & 0x80);
607607
608608   return data;
609609}
r15082r15083
714714
715715static UINT8 vic20_lightx_cb( running_machine &machine )
716716{
717   return (input_port_read_safe(machine, "LIGHTX", 0) & ~0x01);
717   return (machine.root_device().ioport("LIGHTX")->read_safe(0) & ~0x01);
718718}
719719
720720static UINT8 vic20_lighty_cb( running_machine &machine )
721721{
722   return (input_port_read_safe(machine, "LIGHTY", 0) & ~0x01);
722   return (machine.root_device().ioport("LIGHTY")->read_safe(0) & ~0x01);
723723}
724724
725725static UINT8 vic20_lightbut_cb( running_machine &machine )
726726{
727   return (((input_port_read(machine, "CTRLSEL") & 0xf0) == 0x20) && (input_port_read(machine, "JOY") & 0x40));
727   return (((machine.root_device().ioport("CTRLSEL")->read() & 0xf0) == 0x20) && (machine.root_device().ioport("JOY")->read() & 0x40));
728728}
729729
730730static UINT8 vic20_paddle0_cb( running_machine &machine )
731731{
732   return input_port_read(machine, "PADDLE0");
732   return machine.root_device().ioport("PADDLE0")->read();
733733}
734734
735735static UINT8 vic20_paddle1_cb( running_machine &machine )
736736{
737   return input_port_read(machine, "PADDLE1");
737   return machine.root_device().ioport("PADDLE1")->read();
738738}
739739
740740static const mos6560_interface vic_ntsc_intf =
src/mess/drivers/tm990189.c
r15082r15083
310310
311311      /* keyboard read */
312312      if (m_digitsel < 9)
313         data |= input_port_read(machine(), keynames[m_digitsel]) << 1;
313         data |= ioport(keynames[m_digitsel])->read() << 1;
314314
315315      /* tape input */
316316      if (m_cass->input() > 0.0)
r15082r15083
606606
607607READ8_MEMBER( tm990189_state::video_joy_r )
608608{
609   UINT8 data = input_port_read(machine(), "BUTTONS");
609   UINT8 data = ioport("BUTTONS")->read();
610610
611611   if (m_joy1x_timer->remaining() < attotime::zero)
612612      data |= 0x01;
r15082r15083
625625
626626WRITE8_MEMBER( tm990189_state::video_joy_w )
627627{
628   m_joy1x_timer->reset(attotime::from_usec(input_port_read(machine(), "JOY1_X")*28+28));
629   m_joy1y_timer->reset(attotime::from_usec(input_port_read(machine(), "JOY1_Y")*28+28));
630   m_joy2x_timer->reset(attotime::from_usec(input_port_read(machine(), "JOY2_X")*28+28));
631   m_joy2y_timer->reset(attotime::from_usec(input_port_read(machine(), "JOY2_Y")*28+28));
628   m_joy1x_timer->reset(attotime::from_usec(ioport("JOY1_X")->read()*28+28));
629   m_joy1y_timer->reset(attotime::from_usec(ioport("JOY1_Y")->read()*28+28));
630   m_joy2x_timer->reset(attotime::from_usec(ioport("JOY2_X")->read()*28+28));
631   m_joy2y_timer->reset(attotime::from_usec(ioport("JOY2_Y")->read()*28+28));
632632}
633633
634634/* user tms9901 setup */
src/mess/drivers/selz80.c
r15082r15083
128128   {
129129      char kbdrow[6];
130130      sprintf(kbdrow,"X%X",m_digit);
131      data = input_port_read(machine(), kbdrow);
131      data = ioport(kbdrow)->read();
132132   }
133133   return data;
134134}
src/mess/drivers/lcmate2.c
r15082r15083
7575      if (BIT(offset, i)==0)
7676      {
7777         sprintf(kbdrow,"LINE%d", i);
78         data &= input_port_read(machine(), kbdrow);
78         data &= ioport(kbdrow)->read();
7979      }
8080   }
8181
src/mess/drivers/smc777.c
r15082r15083
508508READ8_MEMBER(smc777_state::smc777_joystick_r)
509509{
510510
511   return input_port_read(machine(), "JOY_1P");
511   return ioport("JOY_1P")->read();
512512}
513513
514514WRITE8_MEMBER(smc777_state::smc777_color_mode_w)
r15082r15083
927927   smc777_state *state = timer.machine().driver_data<smc777_state>();
928928   static const char *const portnames[11] = { "key0","key1","key2","key3","key4","key5","key6","key7", "key8", "key9", "keya" };
929929   int i,port_i,scancode;
930   UINT8 shift_mod = input_port_read(timer.machine(),"key_mod") & 1;
931   UINT8 kana_mod = input_port_read(timer.machine(),"key_mod") & 0x10;
930   UINT8 shift_mod = timer.machine().root_device().ioport("key_mod")->read() & 1;
931   UINT8 kana_mod = timer.machine().root_device().ioport("key_mod")->read() & 0x10;
932932   scancode = 0;
933933
934934   for(port_i=0;port_i<11;port_i++)
935935   {
936936      for(i=0;i<8;i++)
937937      {
938         if((input_port_read(timer.machine(),portnames[port_i])>>i) & 1)
938         if((timer.machine().root_device().ioport(portnames[port_i])->read()>>i) & 1)
939939         {
940940            state->m_keyb_press = smc777_keytable[shift_mod & 1][scancode];
941941            if(kana_mod) { state->m_keyb_press|=0x80; }
src/mess/drivers/ace.c
r15082r15083
7070{
7171   UINT8 data = 0xff;
7272
73   if (!BIT(offset, 8)) data &= input_port_read(machine(), "A8");
74   if (!BIT(offset, 9)) data &= input_port_read(machine(), "A9");
75   if (!BIT(offset, 10)) data &= input_port_read(machine(), "A10");
76   if (!BIT(offset, 11)) data &= input_port_read(machine(), "A11");
77   if (!BIT(offset, 12)) data &= input_port_read(machine(), "A12");
78   if (!BIT(offset, 13)) data &= input_port_read(machine(), "A13");
79   if (!BIT(offset, 14)) data &= input_port_read(machine(), "A14");
73   if (!BIT(offset, 8)) data &= ioport("A8")->read();
74   if (!BIT(offset, 9)) data &= ioport("A9")->read();
75   if (!BIT(offset, 10)) data &= ioport("A10")->read();
76   if (!BIT(offset, 11)) data &= ioport("A11")->read();
77   if (!BIT(offset, 12)) data &= ioport("A12")->read();
78   if (!BIT(offset, 13)) data &= ioport("A13")->read();
79   if (!BIT(offset, 14)) data &= ioport("A14")->read();
8080
8181   if (!BIT(offset, 15))
8282   {
83      data &= input_port_read(machine(), "A15");
83      data &= ioport("A15")->read();
8484
8585      m_cassette->output(-1);
8686      speaker_level_w(m_speaker, 0);
src/mess/drivers/bcs3.c
r15082r15083
4141   UINT8 data = 0;
4242
4343   if (~offset & 0x01)
44      data |= input_port_read(machine(), "LINE0");
44      data |= ioport("LINE0")->read();
4545   if (~offset & 0x02)
46      data |= input_port_read(machine(), "LINE1");
46      data |= ioport("LINE1")->read();
4747   if (~offset & 0x04)
48      data |= input_port_read(machine(), "LINE2");
48      data |= ioport("LINE2")->read();
4949   if (~offset & 0x08)
50      data |= input_port_read(machine(), "LINE3");
50      data |= ioport("LINE3")->read();
5151   if (~offset & 0x10)
52      data |= input_port_read(machine(), "LINE4");
52      data |= ioport("LINE4")->read();
5353   if (~offset & 0x20)
54      data |= input_port_read(machine(), "LINE5");
54      data |= ioport("LINE5")->read();
5555   if (~offset & 0x40)
56      data |= input_port_read(machine(), "LINE6");
56      data |= ioport("LINE6")->read();
5757   if (~offset & 0x80)
58      data |= input_port_read(machine(), "LINE7");
58      data |= ioport("LINE7")->read();
5959   if (~offset & 0x100)
60      data |= input_port_read(machine(), "LINE8");
60      data |= ioport("LINE8")->read();
6161
6262   return data;
6363}
src/mess/drivers/scorpion.c
r15082r15083
273273{
274274   spectrum_state *state = timer.machine().driver_data<spectrum_state>();
275275
276   if ((input_port_read(timer.machine(), "NMI") & 1)==1)
276   if ((timer.machine().root_device().ioport("NMI")->read() & 1)==1)
277277   {
278278      state->m_port_1ffd_data |= 0x02;
279279      scorpion_update_memory(timer.machine());
src/mess/drivers/abc80.c
r15082r15083
274274   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6" };
275275   int table = 0, row, col;
276276
277   if (input_port_read(machine, "ROW7") & 0x07)
277   if (machine.root_device().ioport("ROW7")->read() & 0x07)
278278   {
279279      /* shift, upper case */
280280      table |= 0x01;
281281   }
282282
283   if (input_port_read(machine, "ROW7") & 0x08)
283   if (machine.root_device().ioport("ROW7")->read() & 0x08)
284284   {
285285      /* ctrl */
286286      table |= 0x02;
r15082r15083
292292   /* scan keyboard */
293293   for (row = 0; row < 7; row++)
294294   {
295      UINT8 data = input_port_read(machine, keynames[row]);
295      UINT8 data = machine.root_device().ioport(keynames[row])->read();
296296
297297      for (col = 0; col < 8; col++)
298298      {
src/mess/drivers/spectrum.c
r15082r15083
340340   int lines = offset >> 8;
341341   int data = 0xff;
342342
343   int cs_extra1 = input_port_read_safe(machine(), "PLUS0", 0xff) & 0x1f;
344   int cs_extra2 = input_port_read_safe(machine(), "PLUS1", 0xff) & 0x1f;
345   int cs_extra3 = input_port_read_safe(machine(), "PLUS2", 0xff) & 0x1f;
346   int ss_extra1 = input_port_read_safe(machine(), "PLUS3", 0xff) & 0x1f;
347   int ss_extra2 = input_port_read_safe(machine(), "PLUS4", 0xff) & 0x1f;
343   int cs_extra1 = ioport("PLUS0")->read_safe(0xff) & 0x1f;
344   int cs_extra2 = ioport("PLUS1")->read_safe(0xff) & 0x1f;
345   int cs_extra3 = ioport("PLUS2")->read_safe(0xff) & 0x1f;
346   int ss_extra1 = ioport("PLUS3")->read_safe(0xff) & 0x1f;
347   int ss_extra2 = ioport("PLUS4")->read_safe(0xff) & 0x1f;
348348
349349   /* Caps - V */
350350   if ((lines & 1) == 0)
351351   {
352      data &= input_port_read(machine(), "LINE0");
352      data &= ioport("LINE0")->read();
353353      /* CAPS for extra keys */
354354      if (cs_extra1 != 0x1f || cs_extra2 != 0x1f || cs_extra3 != 0x1f)
355355         data &= ~0x01;
r15082r15083
357357
358358   /* A - G */
359359   if ((lines & 2) == 0)
360      data &= input_port_read(machine(), "LINE1");
360      data &= ioport("LINE1")->read();
361361
362362   /* Q - T */
363363   if ((lines & 4) == 0)
364      data &= input_port_read(machine(), "LINE2");
364      data &= ioport("LINE2")->read();
365365
366366   /* 1 - 5 */
367367   if ((lines & 8) == 0)
368      data &= input_port_read(machine(), "LINE3") & cs_extra1;
368      data &= ioport("LINE3")->read() & cs_extra1;
369369
370370   /* 6 - 0 */
371371   if ((lines & 16) == 0)
372      data &= input_port_read(machine(), "LINE4") & cs_extra2;
372      data &= ioport("LINE4")->read() & cs_extra2;
373373
374374   /* Y - P */
375375   if ((lines & 32) == 0)
376      data &= input_port_read(machine(), "LINE5") & ss_extra1;
376      data &= ioport("LINE5")->read() & ss_extra1;
377377
378378   /* H - Enter */
379379   if ((lines & 64) == 0)
380      data &= input_port_read(machine(), "LINE6");
380      data &= ioport("LINE6")->read();
381381
382382      /* B - Space */
383383   if ((lines & 128) == 0)
384384   {
385      data &= input_port_read(machine(), "LINE7") & cs_extra3 & ss_extra2;
385      data &= ioport("LINE7")->read() & cs_extra3 & ss_extra2;
386386      /* SYMBOL SHIFT for extra keys */
387387      if (ss_extra1 != 0x1f || ss_extra2 != 0x1f)
388388         data &= ~0x02;
r15082r15083
398398
399399   /* Issue 2 Spectrums default to having bits 5, 6 & 7 set.
400400    Issue 3 Spectrums default to having bits 5 & 7 set and bit 6 reset. */
401   if (input_port_read(machine(), "CONFIG") & 0x80)
401   if (ioport("CONFIG")->read() & 0x80)
402402      data ^= (0x40);
403403
404404   return data;
r15082r15083
407407/* kempston joystick interface */
408408READ8_MEMBER(spectrum_state::spectrum_port_1f_r)
409409{
410   return input_port_read(machine(), "KEMPSTON") & 0x1f;
410   return ioport("KEMPSTON")->read() & 0x1f;
411411}
412412
413413/* fuller joystick interface */
414414READ8_MEMBER(spectrum_state::spectrum_port_7f_r)
415415{
416   return input_port_read(machine(), "FULLER") | (0xff^0x8f);
416   return ioport("FULLER")->read() | (0xff^0x8f);
417417}
418418
419419/* mikrogen joystick interface */
420420READ8_MEMBER(spectrum_state::spectrum_port_df_r)
421421{
422   return input_port_read(machine(), "MIKROGEN") | (0xff^0x1f);
422   return ioport("MIKROGEN")->read() | (0xff^0x1f);
423423}
424424
425425READ8_MEMBER(spectrum_state::spectrum_port_ula_r)
r15082r15083
461461   PORT_CONFSETTING(  0x03, "Mikrogen" )
462462
463463   PORT_START("KEMPSTON") /* Kempston joystick interface */
464   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P1 Joystick Right (Kempston)") PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x01)
465   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P1 Joystick Left (Kempston)") PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x01)
466   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P1 Joystick Down (Kempston)") PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x01)
467   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P1 Joystick Up (Kempston)") PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x01)
468   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P1 Joystick Fire (Kempston)") PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x01)
464   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P1 Joystick Right (Kempston)") PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x01)
465   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P1 Joystick Left (Kempston)") PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x01)
466   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P1 Joystick Down (Kempston)") PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x01)
467   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P1 Joystick Up (Kempston)") PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x01)
468   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P1 Joystick Fire (Kempston)") PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x01)
469469
470470   PORT_START("FULLER") /* Fuller joystick interface */
471   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Up (Fuller)") PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x02)
472   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Down (Fuller)") PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x02)
473   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Left (Fuller)") PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x02)
474   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Right (Fuller)") PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x02)
475   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Fire (Fuller)") PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x02)
471   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Up (Fuller)") PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x02)
472   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Down (Fuller)") PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x02)
473   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Left (Fuller)") PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x02)
474   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Right (Fuller)") PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x02)
475   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Fire (Fuller)") PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x02)
476476
477477   PORT_START("MIKROGEN") /* Mikrogen joystick interface */
478   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Up (Mikrogen)") PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x03)
479   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Down (Mikrogen)") PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x03)
480   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Right (Mikrogen)") PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x03)
481   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Left (Mikrogen)") PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x03)
482   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Fire (Mikrogen)") PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("JOY_INTF", 0x0f, PORTCOND_EQUALS, 0x03)
478   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Up (Mikrogen)") PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x03)
479   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Down (Mikrogen)") PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x03)
480   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Right (Mikrogen)") PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x03)
481   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Left (Mikrogen)") PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x03)
482   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P1 Joystick Fire (Mikrogen)") PORT_CODE(JOYCODE_BUTTON1) PORT_CONDITION("JOY_INTF", 0x0f, EQUALS, 0x03)
483483INPUT_PORTS_END
484484
485485/*
src/mess/drivers/mpf1.c
r15082r15083
220220   UINT8 data = 0x7f;
221221
222222   /* bit 0 to 5, keyboard rows 0 to 5 */
223   if (!BIT(m_lednum, 0)) data &= input_port_read(machine(), "PC0");
224   if (!BIT(m_lednum, 1)) data &= input_port_read(machine(), "PC1");
225   if (!BIT(m_lednum, 2)) data &= input_port_read(machine(), "PC2");
226   if (!BIT(m_lednum, 3)) data &= input_port_read(machine(), "PC3");
227   if (!BIT(m_lednum, 4)) data &= input_port_read(machine(), "PC4");
228   if (!BIT(m_lednum, 5)) data &= input_port_read(machine(), "PC5");
223   if (!BIT(m_lednum, 0)) data &= ioport("PC0")->read();
224   if (!BIT(m_lednum, 1)) data &= ioport("PC1")->read();
225   if (!BIT(m_lednum, 2)) data &= ioport("PC2")->read();
226   if (!BIT(m_lednum, 3)) data &= ioport("PC3")->read();
227   if (!BIT(m_lednum, 4)) data &= ioport("PC4")->read();
228   if (!BIT(m_lednum, 5)) data &= ioport("PC5")->read();
229229
230230   /* bit 6, user key */
231   data &= input_port_read(machine(), "SPECIAL") & 1 ? 0xff : 0xbf;
231   data &= ioport("SPECIAL")->read() & 1 ? 0xff : 0xbf;
232232
233233   /* bit 7, tape input */
234234   data |= ((m_cassette)->input() > 0 ? 1 : 0) << 7;
src/mess/drivers/astrocde.c
r15082r15083
336336
337337void get_ram_expansion_settings(address_space *space, int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end)
338338{
339    if (input_port_read(space->machine(), "PROTECT") == 0x01)
339    if (space->machine().root_device().ioport("PROTECT")->read() == 0x01)
340340        write_protect_on = 1;
341341    else
342342        write_protect_on = 0;
343343
344344    ram_expansion_installed = 1;
345345
346    switch(input_port_read(space->machine(), "CFG"))  // check RAM expansion configuration and set address ranges
346    switch(space->machine().root_device().ioport("CFG")->read())  // check RAM expansion configuration and set address ranges
347347    {
348348        case 0x00:  // No RAM Expansion
349349             ram_expansion_installed = 0;
src/mess/drivers/atarist.c
r15082r15083
428428
429429    */
430430
431   UINT8 x = input_port_read_safe(machine(), "IKBD_MOUSEX", 0x00);
432   UINT8 y = input_port_read_safe(machine(), "IKBD_MOUSEY", 0x00);
431   UINT8 x = ioport("IKBD_MOUSEX")->read_safe(0x00);
432   UINT8 y = ioport("IKBD_MOUSEY")->read_safe(0x00);
433433
434434   if (m_ikbd_mouse_pc == 0)
435435   {
r15082r15083
511511   UINT8 data = 0xff;
512512
513513   // keyboard data
514   if (!BIT(m_ikbd_keylatch, 1)) data &= input_port_read(machine(), "P31");
515   if (!BIT(m_ikbd_keylatch, 2)) data &= input_port_read(machine(), "P32");
516   if (!BIT(m_ikbd_keylatch, 3)) data &= input_port_read(machine(), "P33");
517   if (!BIT(m_ikbd_keylatch, 4)) data &= input_port_read(machine(), "P34");
518   if (!BIT(m_ikbd_keylatch, 5)) data &= input_port_read(machine(), "P35");
519   if (!BIT(m_ikbd_keylatch, 6)) data &= input_port_read(machine(), "P36");
520   if (!BIT(m_ikbd_keylatch, 7)) data &= input_port_read(machine(), "P37");
521   if (!BIT(m_ikbd_keylatch, 8)) data &= input_port_read(machine(), "P40");
522   if (!BIT(m_ikbd_keylatch, 9)) data &= input_port_read(machine(), "P41");
523   if (!BIT(m_ikbd_keylatch, 10)) data &= input_port_read(machine(), "P42");
524   if (!BIT(m_ikbd_keylatch, 11)) data &= input_port_read(machine(), "P43");
525   if (!BIT(m_ikbd_keylatch, 12)) data &= input_port_read(machine(), "P44");
526   if (!BIT(m_ikbd_keylatch, 13)) data &= input_port_read(machine(), "P45");
527   if (!BIT(m_ikbd_keylatch, 14)) data &= input_port_read(machine(), "P46");
528   if (!BIT(m_ikbd_keylatch, 15)) data &= input_port_read(machine(), "P47");
514   if (!BIT(m_ikbd_keylatch, 1)) data &= ioport("P31")->read();
515   if (!BIT(m_ikbd_keylatch, 2)) data &= ioport("P32")->read();
516   if (!BIT(m_ikbd_keylatch, 3)) data &= ioport("P33")->read();
517   if (!BIT(m_ikbd_keylatch, 4)) data &= ioport("P34")->read();
518   if (!BIT(m_ikbd_keylatch, 5)) data &= ioport("P35")->read();
519   if (!BIT(m_ikbd_keylatch, 6)) data &= ioport("P36")->read();
520   if (!BIT(m_ikbd_keylatch, 7)) data &= ioport("P37")->read();
521   if (!BIT(m_ikbd_keylatch, 8)) data &= ioport("P40")->read();
522   if (!BIT(m_ikbd_keylatch, 9)) data &= ioport("P41")->read();
523   if (!BIT(m_ikbd_keylatch, 10)) data &= ioport("P42")->read();
524   if (!BIT(m_ikbd_keylatch, 11)) data &= ioport("P43")->read();
525   if (!BIT(m_ikbd_keylatch, 12)) data &= ioport("P44")->read();
526   if (!BIT(m_ikbd_keylatch, 13)) data &= ioport("P45")->read();
527   if (!BIT(m_ikbd_keylatch, 14)) data &= ioport("P46")->read();
528   if (!BIT(m_ikbd_keylatch, 15)) data &= ioport("P47")->read();
529529
530530   return data;
531531}
r15082r15083
549549
550550    */
551551
552   UINT8 data = input_port_read_safe(machine(), "IKBD_JOY1", 0xff) & 0x06;
552   UINT8 data = ioport("IKBD_JOY1")->read_safe(0xff) & 0x06;
553553
554554   // serial receive
555555   data |= m_ikbd_tx << 3;
r15082r15083
636636
637637   if (m_ikbd_joy) return 0xff;
638638
639   UINT8 data = input_port_read_safe(machine(), "IKBD_JOY0", 0xff);
639   UINT8 data = ioport("IKBD_JOY0")->read_safe(0xff);
640640
641   if ((input_port_read(machine(), "config") & 0x01) == 0)
641   if ((ioport("config")->read() & 0x01) == 0)
642642   {
643643      data = (data & 0xf0) | m_ikbd_mouse;
644644   }
r15082r15083
11431143
11441144    */
11451145
1146   return (input_port_read(machine(), "SW400") << 8) | 0xff;
1146   return (ioport("SW400")->read() << 8) | 0xff;
11471147}
11481148
11491149
r15082r15083
15731573   PORT_INCLUDE( ikbd )
15741574
15751575   PORT_START("IKBD_JOY0")
1576   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("config", 0x01, PORTCOND_EQUALS, 0x01) // XB
1577   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("config", 0x01, PORTCOND_EQUALS, 0x01) // XA
1578   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("config", 0x01, PORTCOND_EQUALS, 0x01) // YA
1579   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("config", 0x01, PORTCOND_EQUALS, 0x01) // YB
1576   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("config", 0x01, EQUALS, 0x01) // XB
1577   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("config", 0x01, EQUALS, 0x01) // XA
1578   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("config", 0x01, EQUALS, 0x01) // YA
1579   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("config", 0x01, EQUALS, 0x01) // YB
15801580   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_PLAYER(1) PORT_8WAY
15811581   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_PLAYER(1) PORT_8WAY
15821582   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_PLAYER(1) PORT_8WAY
15831583   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY
15841584
15851585   PORT_START("IKBD_JOY1")
1586   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("config", 0x01, PORTCOND_EQUALS, 0x01)
1586   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("config", 0x01, EQUALS, 0x01)
15871587   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
15881588   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
15891589
15901590   PORT_START("IKBD_MOUSEX")
1591   PORT_BIT( 0xff, 0x00, IPT_MOUSE_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1) PORT_CONDITION("config", 0x01, PORTCOND_EQUALS, 0x00)
1591   PORT_BIT( 0xff, 0x00, IPT_MOUSE_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1) PORT_CONDITION("config", 0x01, EQUALS, 0x00)
15921592
15931593   PORT_START("IKBD_MOUSEY")
1594   PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1) PORT_CONDITION("config", 0x01, PORTCOND_EQUALS, 0x00)
1594   PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1) PORT_CONDITION("config", 0x01, EQUALS, 0x00)
15951595INPUT_PORTS_END
15961596
15971597
r15082r15083
19251925   // ring indicator
19261926
19271927   // monochrome monitor detect
1928   data |= input_port_read(machine(), "config") & 0x80;
1928   data |= ioport("config")->read() & 0x80;
19291929
19301930   return data;
19311931}
r15082r15083
19951995   // ring indicator
19961996
19971997   // monochrome monitor detect, DMA sound active
1998   data |= (input_port_read(machine(), "config") & 0x80) ^ (m_dmasnd_active << 7);
1998   data |= (ioport("config")->read() & 0x80) ^ (m_dmasnd_active << 7);
19991999
20002000   return data;
20012001}
src/mess/drivers/cat.c
r15082r15083
108108   UINT16 retVal = 0;
109109   // Read country code
110110   if (m_pr_cont == 0x0900)
111      retVal = input_port_read(machine(), "DIPSW1");
111      retVal = ioport("DIPSW1")->read();
112112
113113   // Regular keyboard read
114114   if (m_pr_cont == 0x0800 || m_pr_cont == 0x0a00)
r15082r15083
116116      retVal=0xff00;
117117      switch(m_keyboard_line)
118118      {
119         case 0x01: retVal = input_port_read(machine(), "LINE0") << 8; break;
120         case 0x02: retVal = input_port_read(machine(), "LINE1") << 8; break;
121         case 0x04: retVal = input_port_read(machine(), "LINE2") << 8; break;
122         case 0x08: retVal = input_port_read(machine(), "LINE3") << 8; break;
123         case 0x10: retVal = input_port_read(machine(), "LINE4") << 8; break;
124         case 0x20: retVal = input_port_read(machine(), "LINE5") << 8; break;
125         case 0x40: retVal = input_port_read(machine(), "LINE6") << 8; break;
126         case 0x80: retVal = input_port_read(machine(), "LINE7") << 8; break;
119         case 0x01: retVal = ioport("LINE0")->read() << 8; break;
120         case 0x02: retVal = ioport("LINE1")->read() << 8; break;
121         case 0x04: retVal = ioport("LINE2")->read() << 8; break;
122         case 0x08: retVal = ioport("LINE3")->read() << 8; break;
123         case 0x10: retVal = ioport("LINE4")->read() << 8; break;
124         case 0x20: retVal = ioport("LINE5")->read() << 8; break;
125         case 0x40: retVal = ioport("LINE6")->read() << 8; break;
126         case 0x80: retVal = ioport("LINE7")->read() << 8; break;
127127      }
128128   }
129129   return retVal;
src/mess/drivers/sg1000.c
r15082r15083
111111{
112112   if (data & 0x01)
113113   {
114      m_tvdraw_data = input_port_read(machine(), "TVDRAW_X");
114      m_tvdraw_data = ioport("TVDRAW_X")->read();
115115
116116      if (m_tvdraw_data < 4) m_tvdraw_data = 4;
117117      if (m_tvdraw_data > 251) m_tvdraw_data = 251;
118118   }
119119   else
120120   {
121      m_tvdraw_data = input_port_read(machine(), "TVDRAW_Y") + 32;
121      m_tvdraw_data = ioport("TVDRAW_Y")->read() + 32;
122122   }
123123}
124124
r15082r15083
128128
129129READ8_MEMBER( sg1000_state::tvdraw_status_r )
130130{
131   return input_port_read(machine(), "TVDRAW_PEN");
131   return ioport("TVDRAW_PEN")->read();
132132}
133133
134134/*-------------------------------------------------
r15082r15083
564564
565565   static const char *const keynames[] = { "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7" };
566566
567   return input_port_read(machine(), keynames[m_keylatch]);
567   return ioport(keynames[m_keylatch])->read();
568568}
569569
570570READ8_MEMBER( sc3000_state::ppi_pb_r )
r15082r15083
585585   static const char *const keynames[] = { "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7" };
586586
587587   /* keyboard */
588   UINT8 data = input_port_read(machine(), keynames[m_keylatch]);
588   UINT8 data = ioport(keynames[m_keylatch])->read();
589589
590590   /* cartridge contact */
591591   data |= 0x10;
src/mess/drivers/tx0.c
r15082r15083
14711471
14721472   for (i=0; i<4; i++)
14731473   {
1474      typewriter_keys[i] = input_port_read(machine, twrnames[i]);
1474      typewriter_keys[i] = machine.root_device().ioport(twrnames[i])->read();
14751475   }
14761476
14771477   for (i=0; i<4; i++)
r15082r15083
15111511
15121512
15131513   /* read new state of control keys */
1514   control_keys = input_port_read(device->machine(), "CSW");
1514   control_keys = state->ioport("CSW")->read();
15151515
15161516   if (control_keys & tx0_control)
15171517   {
r15082r15083
15801580
15811581
15821582      /* handle toggle switch register keys */
1583      tsr_keys = (input_port_read(device->machine(), "MSW") << 16) | input_port_read(device->machine(), "LSW");
1583      tsr_keys = (device->machine().root_device().ioport("MSW")->read() << 16) | device->machine().root_device().ioport("LSW")->read();
15841584
15851585      /* compute transitions */
15861586      tsr_transitions = tsr_keys & (~ state->m_old_tsr_keys);
src/mess/drivers/eti660.c
r15082r15083
122122
123123READ_LINE_MEMBER( eti660_state::clear_r )
124124{
125   return BIT(input_port_read(machine(), "SPECIAL"), 0);
125   return BIT(ioport("SPECIAL")->read(), 0);
126126}
127127
128128READ_LINE_MEMBER( eti660_state::ef2_r )
r15082r15083
132132
133133READ_LINE_MEMBER( eti660_state::ef4_r )
134134{
135   return BIT(input_port_read(machine(), "SPECIAL"), 1);
135   return BIT(ioport("SPECIAL")->read(), 1);
136136}
137137
138138WRITE_LINE_MEMBER( eti660_state::q_w )
r15082r15083
194194
195195   UINT8 data = 0xf0;
196196
197   if (!BIT(m_keylatch, 0)) data &= input_port_read(machine(), "PA0");
198   if (!BIT(m_keylatch, 1)) data &= input_port_read(machine(), "PA1");
199   if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "PA2");
200   if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "PA3");
197   if (!BIT(m_keylatch, 0)) data &= ioport("PA0")->read();
198   if (!BIT(m_keylatch, 1)) data &= ioport("PA1")->read();
199   if (!BIT(m_keylatch, 2)) data &= ioport("PA2")->read();
200   if (!BIT(m_keylatch, 3)) data &= ioport("PA3")->read();
201201
202202   return data;
203203}
src/mess/drivers/c128.c
r15082r15083
681681
682682READ8_MEMBER( c128_state::vic_lightpen_x_cb )
683683{
684   return input_port_read(machine(), "LIGHTX") & ~0x01;
684   return ioport("LIGHTX")->read() & ~0x01;
685685}
686686
687687READ8_MEMBER( c128_state::vic_lightpen_y_cb )
688688{
689   return input_port_read(machine(), "LIGHTY") & ~0x01;
689   return ioport("LIGHTY")->read() & ~0x01;
690690}
691691
692692READ8_MEMBER( c128_state::vic_lightpen_button_cb )
693693{
694   return input_port_read(machine(), "OTHER") & 0x04;
694   return ioport("OTHER")->read() & 0x04;
695695}
696696
697697READ8_MEMBER( c128_state::vic_rdy_cb )
698698{
699   return input_port_read(machine(), "CTRLSEL") & 0x08;
699   return ioport("CTRLSEL")->read() & 0x08;
700700}
701701
702702static const vic2_interface c128_vic2_ntsc_intf = {
src/mess/drivers/px8.c
r15082r15083
452452
453453   switch (m_ksc)
454454   {
455   case 0: data = input_port_read(machine(), "KSC0"); break;
456   case 1: data = input_port_read(machine(), "KSC1"); break;
457   case 2: data = input_port_read(machine(), "KSC2"); break;
458   case 3: data = input_port_read(machine(), "KSC3"); break;
459   case 4: data = input_port_read(machine(), "KSC4"); break;
460   case 5: data = input_port_read(machine(), "KSC5"); break;
461   case 6: data = input_port_read(machine(), "KSC6"); break;
462   case 7: data = input_port_read(machine(), "KSC7"); break;
463   case 8: data = input_port_read(machine(), "KSC8"); break;
464   case 9: data = input_port_read(machine(), "SW4");  break;
455   case 0: data = ioport("KSC0")->read(); break;
456   case 1: data = ioport("KSC1")->read(); break;
457   case 2: data = ioport("KSC2")->read(); break;
458   case 3: data = ioport("KSC3")->read(); break;
459   case 4: data = ioport("KSC4")->read(); break;
460   case 5: data = ioport("KSC5")->read(); break;
461   case 6: data = ioport("KSC6")->read(); break;
462   case 7: data = ioport("KSC7")->read(); break;
463   case 8: data = ioport("KSC8")->read(); break;
464   case 9: data = ioport("SW4")->read();  break;
465465   }
466466
467467   return data;
src/mess/drivers/mikromik.c
r15082r15083
251251      floppy_drive_set_ready_state(m_floppy0, d, 1);
252252      floppy_drive_set_ready_state(m_floppy1, d, 1);
253253
254      if (input_port_read(machine(), "T5")) upd765_ready_w(m_fdc, d);
254      if (ioport("T5")->read()) upd765_ready_w(m_fdc, d);
255255      break;
256256   }
257257}
r15082r15083
270270{
271271   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" };
272272
273   UINT8 data = input_port_read(machine(), keynames[m_drive]);
274   UINT8 special = input_port_read(machine(), "SPECIAL");
273   UINT8 data = ioport(keynames[m_drive])->read();
274   UINT8 special = ioport("SPECIAL")->read();
275275   int ctrl = BIT(special, 0);
276276   int shift = BIT(special, 2) & BIT(special, 1);
277277   UINT8 keydata = 0xff;
r15082r15083
764764   for (i = 0; i < 8; i++) ls259_w(*program, i, 0);
765765
766766   // set FDC ready
767   if (!input_port_read(machine(), "T5")) upd765_ready_w(m_fdc, 1);
767   if (!ioport("T5")->read()) upd765_ready_w(m_fdc, 1);
768768
769769   // reset FDC
770770   upd765_reset_w(m_fdc, 1);
src/mess/drivers/coco12.c
r15082r15083
6161   PORT_CONFNAME( 0x0f, 0x01, "Right Controller Port (P1)")         PORT_CHANGED( coco_state::joystick_mode_changed, 0 )
6262   PORT_CONFSETTING(  0x00, "Unconnected" )
6363   PORT_CONFSETTING(  0x01, "Joystick" )
64   PORT_CONFSETTING(  0x02, "The Rat Graphics Mouse" )               PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_NOTEQUALS, 0x20)
65   PORT_CONFSETTING(  0x03, "Diecom Light Gun Adaptor" )            PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_NOTEQUALS, 0x30)
64   PORT_CONFSETTING(  0x02, "The Rat Graphics Mouse" )               PORT_CONDITION(CTRL_SEL_TAG, 0xf0, NOTEQUALS, 0x20)
65   PORT_CONFSETTING(  0x03, "Diecom Light Gun Adaptor" )            PORT_CONDITION(CTRL_SEL_TAG, 0xf0, NOTEQUALS, 0x30)
6666   PORT_CONFNAME( 0xf0, 0x10, "Left Controller Port (P2)")            PORT_CHANGED( coco_state::joystick_mode_changed, 0 )
6767   PORT_CONFSETTING(  0x00, "Unconnected" )
6868   PORT_CONFSETTING(  0x10, "Joystick" )
69   PORT_CONFSETTING(  0x20, "The Rat Graphics Mouse" )               PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_NOTEQUALS, 0x02)
70   PORT_CONFSETTING(  0x30, "Diecom Light Gun Adaptor" )            PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_NOTEQUALS, 0x03)
69   PORT_CONFSETTING(  0x20, "The Rat Graphics Mouse" )               PORT_CONDITION(CTRL_SEL_TAG, 0x0f, NOTEQUALS, 0x02)
70   PORT_CONFSETTING(  0x30, "Diecom Light Gun Adaptor" )            PORT_CONDITION(CTRL_SEL_TAG, 0x0f, NOTEQUALS, 0x03)
7171 
7272   PORT_START(HIRES_INTF_TAG)
7373   PORT_CONFNAME( 0x07, 0x00, "Hi-Res Joystick Interfaces" )
7474   PORT_CONFSETTING(    0x00, "None" )
75   PORT_CONFSETTING(    0x01, "Hi-Res in Right Port" )                 PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x01)
76   PORT_CONFSETTING(    0x02, "Hi-Res CoCoMax 3 Style in Right Port" ) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x01)
77   PORT_CONFSETTING(    0x03, "Hi-Res in Left Port" )                  PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x10)
78   PORT_CONFSETTING(    0x04, "Hi-Res CoCoMax 3 Style in Left Port" )  PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x10)
75   PORT_CONFSETTING(    0x01, "Hi-Res in Right Port" )                 PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01)
76   PORT_CONFSETTING(    0x02, "Hi-Res CoCoMax 3 Style in Right Port" ) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01)
77   PORT_CONFSETTING(    0x03, "Hi-Res in Left Port" )                  PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10)
78   PORT_CONFSETTING(    0x04, "Hi-Res CoCoMax 3 Style in Left Port" )  PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10)
7979INPUT_PORTS_END
8080 
8181 
r15082r15083
8686 
8787static INPUT_PORTS_START( coco_joystick )
8888   PORT_START(JOYSTICK_RX_TAG)
89   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x01)
89   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01)
9090   PORT_START(JOYSTICK_RY_TAG)
91   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x01)
91   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01)
9292   PORT_START(JOYSTICK_LX_TAG)
93   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x10)
93   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10)
9494   PORT_START(JOYSTICK_LY_TAG)
95   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x10)
95   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10)
9696   PORT_START(JOYSTICK_BUTTONS_TAG)
97   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x01)
98   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x10)
97   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01)
98   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10)
9999INPUT_PORTS_END
100100 
101101 
src/mess/drivers/sc2.c
r15082r15083
156156
157157   if (BIT(m_kp_matrix, 0))
158158   {
159      data |= input_port_read(machine(), "LINE1");
159      data |= ioport("LINE1")->read();
160160   }
161161
162162   if (BIT(m_kp_matrix, 1))
163163   {
164      data |= input_port_read(machine(), "LINE2");
164      data |= ioport("LINE2")->read();
165165   }
166166
167167   if (BIT(m_kp_matrix, 2))
168168   {
169      data |= input_port_read(machine(), "LINE3");
169      data |= ioport("LINE3")->read();
170170   }
171171
172172   if (BIT(m_kp_matrix, 3))
173173   {
174      data |= input_port_read(machine(), "LINE4");
174      data |= ioport("LINE4")->read();
175175   }
176176
177177   return data;
src/mess/drivers/a2600.c
r15082r15083
11771177   running_machine &machine = device->machine();
11781178
11791179   /* Left controller port */
1180   if ( input_port_read(machine, "CONTROLLERS") / CATEGORY_SELECT == 0x03 )
1180   if ( machine.root_device().ioport("CONTROLLERS")->read() / CATEGORY_SELECT == 0x03 )
11811181   {
11821182      state->m_keypad_left_column = data / 16;
11831183   }
11841184
11851185   /* Right controller port */
1186   switch( input_port_read(machine, "CONTROLLERS") % CATEGORY_SELECT )
1186   switch( machine.root_device().ioport("CONTROLLERS")->read() % CATEGORY_SELECT )
11871187   {
11881188   case 0x03:   /* Keypad */
11891189      state->m_keypad_right_column = data & 0x0F;
r15082r15083
12011201   UINT8 val = 0;
12021202
12031203   /* Left controller port PINs 1-4 ( 4321 ) */
1204   switch( input_port_read(machine, "CONTROLLERS") / CATEGORY_SELECT )
1204   switch( machine.root_device().ioport("CONTROLLERS")->read() / CATEGORY_SELECT )
12051205   {
12061206   case 0x00:  /* Joystick */
12071207   case 0x05:   /* Joystick w/Boostergrip */
1208      val |= input_port_read(machine, "SWA_JOY") & 0xF0;
1208      val |= machine.root_device().ioport("SWA_JOY")->read() & 0xF0;
12091209      break;
12101210   case 0x01:  /* Paddle */
1211      val |= input_port_read(machine, "SWA_PAD") & 0xF0;
1211      val |= machine.root_device().ioport("SWA_PAD")->read() & 0xF0;
12121212      break;
12131213   case 0x02:   /* Driving */
12141214      val |= 0xC0;
1215      val |= ( driving_lookup[ ( input_port_read(machine, "WHEEL_L") & 0x18 ) >> 3 ] << 4 );
1215      val |= ( driving_lookup[ ( machine.root_device().ioport("WHEEL_L")->read() & 0x18 ) >> 3 ] << 4 );
12161216      break;
12171217   case 0x06:   /* Trakball CX-22 */
12181218   case 0x07:   /* Trakball CX-80 / ST mouse */
r15082r15083
12231223   }
12241224
12251225   /* Right controller port PINs 1-4 ( 4321 ) */
1226   switch( input_port_read(machine, "CONTROLLERS") % CATEGORY_SELECT )
1226   switch( machine.root_device().ioport("CONTROLLERS")->read() % CATEGORY_SELECT )
12271227   {
12281228   case 0x00:   /* Joystick */
12291229   case 0x05:   /* Joystick w/Boostergrip */
1230      val |= input_port_read(machine, "SWA_JOY") & 0x0F;
1230      val |= machine.root_device().ioport("SWA_JOY")->read() & 0x0F;
12311231      break;
12321232   case 0x01:   /* Paddle */
1233      val |= input_port_read(machine, "SWA_PAD") & 0x0F;
1233      val |= machine.root_device().ioport("SWA_PAD")->read() & 0x0F;
12341234      break;
12351235   case 0x02:   /* Driving */
12361236      val |= 0x0C;
1237      val |= ( driving_lookup[ ( input_port_read(machine, "WHEEL_R") & 0x18 ) >> 3 ] );
1237      val |= ( driving_lookup[ ( machine.root_device().ioport("WHEEL_R")->read() & 0x18 ) >> 3 ] );
12381238      break;
12391239   case 0x06:   /* Trakball CX-22 */
12401240   case 0x07:   /* Trakball CX-80 / ST mouse */
r15082r15083
12571257
12581258static READ8_DEVICE_HANDLER( riot_input_port_8_r )
12591259{
1260   return input_port_read(device->machine(), "SWB");
1260   return device->machine().root_device().ioport("SWB")->read();
12611261}
12621262
12631263static const riot6532_interface r6532_interface =
r15082r15083
13021302   switch( offset )
13031303   {
13041304   case 0:   /* Left controller port PIN 5 */
1305      switch ( input_port_read(machine(), "CONTROLLERS") / CATEGORY_SELECT )
1305      switch ( ioport("CONTROLLERS")->read() / CATEGORY_SELECT )
13061306      {
13071307      case 0x00:   /* Joystick */
13081308         return TIA_INPUT_PORT_ALWAYS_OFF;
13091309      case 0x01:   /* Paddle */
1310         return input_port_read(machine(), "PADDLE1");
1310         return ioport("PADDLE1")->read();
13111311      case 0x03:   /* Keypad */
13121312         for ( i = 0; i < 4; i++ )
13131313         {
13141314            if ( ! ( ( m_keypad_left_column >> i ) & 0x01 ) )
13151315            {
1316               if ( ( input_port_read(machine(), "KEYPAD_L") >> 3*i ) & 0x01 )
1316               if ( ( ioport("KEYPAD_L")->read() >> 3*i ) & 0x01 )
13171317               {
13181318                  return TIA_INPUT_PORT_ALWAYS_ON;
13191319               }
r15082r15083
13251325         }
13261326         return TIA_INPUT_PORT_ALWAYS_ON;
13271327      case 0x05:   /* Boostergrip joystick */
1328         return ( input_port_read(machine(), "BUTTONS_L") & 0x40 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON;
1328         return ( ioport("BUTTONS_L")->read() & 0x40 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON;
13291329      default:
13301330         return TIA_INPUT_PORT_ALWAYS_OFF;
13311331      }
13321332      break;
13331333   case 1:   /* Right controller port PIN 5 */
1334      switch ( input_port_read(machine(), "CONTROLLERS") / CATEGORY_SELECT )
1334      switch ( ioport("CONTROLLERS")->read() / CATEGORY_SELECT )
13351335      {
13361336      case 0x00:   /* Joystick */
13371337         return TIA_INPUT_PORT_ALWAYS_OFF;
13381338      case 0x01:   /* Paddle */
1339         return input_port_read(machine(), "PADDLE3");
1339         return ioport("PADDLE3")->read();
13401340      case 0x03:   /* Keypad */
13411341         for ( i = 0; i < 4; i++ )
13421342         {
13431343            if ( ! ( ( m_keypad_left_column >> i ) & 0x01 ) )
13441344            {
1345               if ( ( input_port_read(machine(), "KEYPAD_L") >> 3*i ) & 0x02 )
1345               if ( ( ioport("KEYPAD_L")->read() >> 3*i ) & 0x02 )
13461346               {
13471347                  return TIA_INPUT_PORT_ALWAYS_ON;
13481348               }
r15082r15083
13541354         }
13551355         return TIA_INPUT_PORT_ALWAYS_ON;
13561356      case 0x05:   /* Joystick w/Boostergrip */
1357         return ( input_port_read(machine(), "BUTTONS_L") & 0x20 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON;
1357         return ( ioport("BUTTONS_L")->read() & 0x20 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON;
13581358      default:
13591359         return TIA_INPUT_PORT_ALWAYS_OFF;
13601360      }
13611361      break;
13621362   case 2:   /* Left controller port PIN 9 */
1363      switch ( input_port_read(machine(), "CONTROLLERS") % CATEGORY_SELECT )
1363      switch ( ioport("CONTROLLERS")->read() % CATEGORY_SELECT )
13641364      {
13651365      case 0x00:   /* Joystick */
13661366         return TIA_INPUT_PORT_ALWAYS_OFF;
13671367      case 0x01:   /* Paddle */
1368         return input_port_read(machine(), "PADDLE2");
1368         return ioport("PADDLE2")->read();
13691369      case 0x03:   /* Keypad */
13701370         for ( i = 0; i < 4; i++ )
13711371         {
13721372            if ( ! ( ( m_keypad_right_column >> i ) & 0x01 ) )
13731373            {
1374               if ( ( input_port_read(machine(), "KEYPAD_R") >> 3*i ) & 0x01 )
1374               if ( ( ioport("KEYPAD_R")->read() >> 3*i ) & 0x01 )
13751375               {
13761376                  return TIA_INPUT_PORT_ALWAYS_ON;
13771377               }
r15082r15083
13831383         }
13841384         return TIA_INPUT_PORT_ALWAYS_ON;
13851385      case 0x05:   /* Joystick w/Boostergrip */
1386         return ( input_port_read(machine(), "BUTTONS_R") & 0x40 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON;
1386         return ( ioport("BUTTONS_R")->read() & 0x40 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON;
13871387      default:
13881388         return TIA_INPUT_PORT_ALWAYS_OFF;
13891389      }
13901390      break;
13911391   case 3:   /* Right controller port PIN 9 */
1392      switch ( input_port_read(machine(), "CONTROLLERS") % CATEGORY_SELECT )
1392      switch ( ioport("CONTROLLERS")->read() % CATEGORY_SELECT )
13931393      {
13941394      case 0x00:   /* Joystick */
13951395         return TIA_INPUT_PORT_ALWAYS_OFF;
13961396      case 0x01:   /* Paddle */
1397         return input_port_read(machine(), "PADDLE4");
1397         return ioport("PADDLE4")->read();
13981398      case 0x03:   /* Keypad */
13991399         for ( i = 0; i < 4; i++ )
14001400         {
14011401            if ( ! ( ( m_keypad_right_column >> i ) & 0x01 ) )
14021402            {
1403               if ( ( input_port_read(machine(), "KEYPAD_R") >> 3*i ) & 0x02 )
1403               if ( ( ioport("KEYPAD_R")->read() >> 3*i ) & 0x02 )
14041404               {
14051405                  return TIA_INPUT_PORT_ALWAYS_ON;
14061406               }
r15082r15083
14121412         }
14131413         return TIA_INPUT_PORT_ALWAYS_ON;
14141414      case 0x05:   /* Joystick w/Boostergrip */
1415         return ( input_port_read(machine(), "BUTTONS_R") & 0x20 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON;
1415         return ( ioport("BUTTONS_R")->read() & 0x20 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON;
14161416      default:
14171417         return TIA_INPUT_PORT_ALWAYS_OFF;
14181418      }
14191419      break;
14201420   case 4:   /* Left controller port PIN 6 */
1421      switch ( input_port_read(machine(), "CONTROLLERS") / CATEGORY_SELECT )
1421      switch ( ioport("CONTROLLERS")->read() / CATEGORY_SELECT )
14221422      {
14231423      case 0x00:   /* Joystick */
14241424      case 0x05:   /* Joystick w/Boostergrip */
1425         return input_port_read(machine(), "BUTTONS_L");
1425         return ioport("BUTTONS_L")->read();
14261426      case 0x01:   /* Paddle */
14271427         return 0xff;
14281428      case 0x02:   /* Driving */
1429         return input_port_read(machine(), "BUTTONS_L") << 3;
1429         return ioport("BUTTONS_L")->read() << 3;
14301430      case 0x03:   /* Keypad */
14311431         for ( i = 0; i < 4; i++ )
14321432         {
14331433            if ( ! ( ( m_keypad_left_column >> i ) & 0x01 ) )
14341434            {
1435               if ( ( input_port_read(machine(), "KEYPAD_L") >> 3*i ) & 0x04 )
1435               if ( ( ioport("KEYPAD_L")->read() >> 3*i ) & 0x04 )
14361436               {
14371437                  return 0xff;
14381438               }
r15082r15083
14441444         }
14451445         return 0xff;
14461446      case 0x06:   /* Trakball CX-22 */
1447         return input_port_read(machine(), "BUTTONS_L") << 4;
1447         return ioport("BUTTONS_L")->read() << 4;
14481448      default:
14491449         return 0xff;
14501450      }
14511451      break;
14521452   case 5:   /* Right controller port PIN 6 */
1453      switch ( input_port_read(machine(), "CONTROLLERS") % CATEGORY_SELECT )
1453      switch ( ioport("CONTROLLERS")->read() % CATEGORY_SELECT )
14541454      {
14551455      case 0x00:   /* Joystick */
14561456      case 0x05:   /* Joystick w/Boostergrip */
1457         return input_port_read(machine(), "BUTTONS_R");
1457         return ioport("BUTTONS_R")->read();
14581458      case 0x01:   /* Paddle */
14591459         return 0xff;
14601460      case 0x02:   /* Driving */
1461         return input_port_read(machine(), "BUTTONS_R") << 3;
1461         return ioport("BUTTONS_R")->read() << 3;
14621462      case 0x03:   /* Keypad */
14631463         for ( i = 0; i < 4; i++ )
14641464         {
14651465            if ( ! ( ( m_keypad_right_column >> i ) & 0x01 ) )
14661466            {
1467               if ( ( input_port_read(machine(), "KEYPAD_R") >> 3*i ) & 0x04 )
1467               if ( ( ioport("KEYPAD_R")->read() >> 3*i ) & 0x04 )
14681468               {
14691469                  return 0xff;
14701470               }
r15082r15083
14761476         }
14771477         return 0xff;
14781478      case 0x06:   /* Trakball CX-22 */
1479         return input_port_read(machine(), "BUTTONS_R") << 4;
1479         return ioport("BUTTONS_R")->read() << 4;
14801480      default:
14811481         return 0xff;
14821482      }
r15082r15083
20562056static INPUT_PORTS_START( a2600 )
20572057
20582058   PORT_START("PADDLE1")
2059   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_REVERSE PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x10)
2059   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_REVERSE PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x10)
20602060   PORT_START("PADDLE3")
2061   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(3) PORT_REVERSE PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x10)
2061   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(3) PORT_REVERSE PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x10)
20622062   PORT_START("PADDLE2")
2063   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(2) PORT_REVERSE PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x01)
2063   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(2) PORT_REVERSE PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x01)
20642064   PORT_START("PADDLE4")
2065   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(4) PORT_REVERSE PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x01)
2065   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(4) PORT_REVERSE PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x01)
20662066
20672067   PORT_START("BUTTONS_L") /* left port button(s) */
2068//  PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x50)
2069//  PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x50)
2070   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x50)
2071   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x20)
2072   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x00)
2073   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x00)
2074   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x00)
2068//  PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x50)
2069//  PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x50)
2070   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x50)
2071   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x20)
2072   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00)
2073   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00)
2074   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00)
20752075
20762076   PORT_START("BUTTONS_R") /* right port button(s) */
2077//  PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x05)
2078//  PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x05)
2079   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x05)
2080   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x02)
2081   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x00)
2082   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x00)
2083   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x00)
2077//  PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x05)
2078//  PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x05)
2079   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x05)
2080   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x02)
2081   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00)
2082   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00)
2083   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00)
20842084
20852085   PORT_START("SWA_JOY") /* SWCHA joystick */
2086   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x00)
2087   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x00)
2088   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x00)
2089   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x00)
2090   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x00)
2091   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x00)
2092   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x00)
2093   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x00)
2086   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00)
2087   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00)
2088   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00)
2089   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00)
2090   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00)
2091   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00)
2092   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00)
2093   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00)
20942094
20952095   PORT_START("SWA_PAD") /* SWCHA paddles */
20962096   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
20972097   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2098   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x01)
2099   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x01)
2098   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x01)
2099   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x01)
21002100   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
21012101   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
2102   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x10)
2103   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x10)
2102   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x10)
2103   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x10)
21042104
21052105   PORT_START("SWB") /* SWCHB */
21062106   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reset Game") PORT_CODE(KEYCODE_2)
r15082r15083
21452145   //PORT_CONFSETTING(    0x0b, "Save Key" )
21462146
21472147   PORT_START("KEYPAD_L")   /* left keypad */
2148   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 1") PORT_CODE(KEYCODE_7_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2149   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 2") PORT_CODE(KEYCODE_8_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2150   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 3") PORT_CODE(KEYCODE_9_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2151   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 4") PORT_CODE(KEYCODE_4_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2152   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 5") PORT_CODE(KEYCODE_5_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2153   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 6") PORT_CODE(KEYCODE_6_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2154   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 7") PORT_CODE(KEYCODE_1_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2155   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 8") PORT_CODE(KEYCODE_2_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2156   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 9") PORT_CODE(KEYCODE_3_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2157   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left *") PORT_CODE(KEYCODE_0_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2158   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 0") PORT_CODE(KEYCODE_DEL_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2159   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left #") PORT_CODE(KEYCODE_ENTER_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x30)
2148   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 1") PORT_CODE(KEYCODE_7_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
2149   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 2") PORT_CODE(KEYCODE_8_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
2150   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 3") PORT_CODE(KEYCODE_9_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
2151   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 4") PORT_CODE(KEYCODE_4_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
2152   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 5") PORT_CODE(KEYCODE_5_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
2153   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 6") PORT_CODE(KEYCODE_6_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
2154   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 7") PORT_CODE(KEYCODE_1_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
2155   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 8") PORT_CODE(KEYCODE_2_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
2156   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 9") PORT_CODE(KEYCODE_3_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
2157   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left *") PORT_CODE(KEYCODE_0_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
2158   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 0") PORT_CODE(KEYCODE_DEL_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
2159   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left #") PORT_CODE(KEYCODE_ENTER_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30)
21602160
21612161   PORT_START("KEYPAD_R")  /* right keypad */
2162   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 1") PORT_CODE(KEYCODE_5) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2163   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 2") PORT_CODE(KEYCODE_6) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2164   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 3") PORT_CODE(KEYCODE_7) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2165   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 4") PORT_CODE(KEYCODE_R) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2166   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 5") PORT_CODE(KEYCODE_T) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2167   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 6") PORT_CODE(KEYCODE_Y) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2168   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 7") PORT_CODE(KEYCODE_F) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2169   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 8") PORT_CODE(KEYCODE_G) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2170   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 9") PORT_CODE(KEYCODE_H) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2171   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right *") PORT_CODE(KEYCODE_V) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2172   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 0") PORT_CODE(KEYCODE_B) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2173   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right #") PORT_CODE(KEYCODE_N) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x03)
2162   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 1") PORT_CODE(KEYCODE_5) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
2163   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 2") PORT_CODE(KEYCODE_6) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
2164   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 3") PORT_CODE(KEYCODE_7) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
2165   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 4") PORT_CODE(KEYCODE_R) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
2166   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 5") PORT_CODE(KEYCODE_T) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
2167   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 6") PORT_CODE(KEYCODE_Y) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
2168   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 7") PORT_CODE(KEYCODE_F) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
2169   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 8") PORT_CODE(KEYCODE_G) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
2170   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 9") PORT_CODE(KEYCODE_H) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
2171   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right *") PORT_CODE(KEYCODE_V) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
2172   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 0") PORT_CODE(KEYCODE_B) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
2173   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right #") PORT_CODE(KEYCODE_N) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03)
21742174
21752175   PORT_START("WHEEL_L")   /* left driving controller */
2176   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x20)
2176   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x20)
21772177
21782178   PORT_START("WHEEL_R")   /* right driving controller */
2179   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x02)
2179   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x02)
21802180
21812181   PORT_START("GUNX_L")   /* left light gun X */
2182//  PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x40)
2182//  PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x40)
21832183
21842184   PORT_START("GUNY_L")   /* left light gun Y */
2185//  PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x40)
2185//  PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x40)
21862186
21872187   PORT_START("GUNX_R")   /* right light gun X */
2188//  PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x04)
2188//  PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x04)
21892189
21902190   PORT_START("GUNY_R")   /* right light gun Y */
2191//  PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x04)
2191//  PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x04)
21922192
21932193   PORT_START("TRAKX_L")   /* left trak ball X */
2194   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x50)
2194   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x50)
21952195
21962196   PORT_START("TRAKY_L")   /* left trak ball Y */
2197   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, PORTCOND_EQUALS, 0x50)
2197   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x50)
21982198
21992199   PORT_START("TRAKX_R")   /* right trak ball X */
2200   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x05)
2200   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x05)
22012201
22022202   PORT_START("TRAKY_R")   /* right trak ball Y */
2203   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, PORTCOND_EQUALS, 0x05)
2203   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x05)
22042204
22052205INPUT_PORTS_END
22062206
src/mess/drivers/mk2.c
r15082r15083
134134READ8_MEMBER( mk2_state::mk2_read_a )
135135{
136136   int data=0xff;
137   int help=input_port_read(machine(), "BLACK") | input_port_read(machine(), "WHITE"); // looks like white and black keys are the same!
137   int help=ioport("BLACK")->read() | ioport("WHITE")->read(); // looks like white and black keys are the same!
138138
139139   switch (mos6530_portb_out_get(m_miot)&0x7)
140140   {
r15082r15083
147147      if (BIT(help, 0)) data&=~0x20; // A
148148      break;
149149   case 5:
150      if (BIT(input_port_read(machine(), "EXTRA"), 2)) data&=~0x8; // Enter
151      if (BIT(input_port_read(machine(), "EXTRA"), 1)) data&=~0x10; // Clear
150      if (BIT(ioport("EXTRA")->read(), 2)) data&=~0x8; // Enter
151      if (BIT(ioport("EXTRA")->read(), 1)) data&=~0x10; // Clear
152152      if (BIT(help, 7)) data&=~0x20; // H
153153      if (BIT(help, 6)) data&=~0x40; // G
154154      break;
src/mess/drivers/pcw.c
r15082r15083
219219      "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13", "LINE14", "LINE15"
220220   };
221221
222   return input_port_read(machine(), keynames[offset]);
222   return ioport(keynames[offset])->read();
223223}
224224
225225READ8_MEMBER(pcw_state::pcw_keyboard_data_r)
r15082r15083
354354static int pcw_get_sys_status(running_machine &machine)
355355{
356356   pcw_state *state = machine.driver_data<pcw_state>();
357   return state->m_interrupt_counter | (input_port_read(machine, "EXTRA") & (0x040 | 0x010)) | (state->m_system_status & 0x20);
357   return state->m_interrupt_counter | (machine.root_device().ioport("EXTRA")->read() & (0x040 | 0x010)) | (state->m_system_status & 0x20);
358358}
359359
360360READ8_MEMBER(pcw_state::pcw_interrupt_counter_r)
r15082r15083
588588      case 0x0e0:
589589      {
590590         /* spectravideo joystick */
591         if (input_port_read(machine(), "EXTRA") & 0x020)
591         if (ioport("EXTRA")->read() & 0x020)
592592         {
593            return input_port_read(machine(), "SPECTRAVIDEO");
593            return ioport("SPECTRAVIDEO")->read();
594594         }
595595         else
596596         {
r15082r15083
602602      {
603603
604604         /* kempston joystick */
605         return input_port_read(machine(), "KEMPSTON");
605         return ioport("KEMPSTON")->read();
606606      }
607607
608608      case 0x0e1:
r15082r15083
12621262   /* from here on are the pretend dipswitches for machine config etc */
12631263   PORT_START("EXTRA")
12641264   /* vblank */
1265   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK)
1265   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
12661266   /* frame rate option */
12671267   PORT_DIPNAME( 0x10, 0x010, "50/60Hz Frame Rate Option")
12681268   PORT_DIPSETTING(   0x00, "60Hz")
src/mess/drivers/studio2.c
r15082r15083
350350
351351READ_LINE_MEMBER( studio2_state::clear_r )
352352{
353   return BIT(input_port_read(machine(), "CLEAR"), 0);
353   return BIT(ioport("CLEAR")->read(), 0);
354354}
355355
356356READ_LINE_MEMBER( studio2_state::ef3_r )
357357{
358   return BIT(input_port_read(machine(), "A"), m_keylatch);
358   return BIT(ioport("A")->read(), m_keylatch);
359359}
360360
361361READ_LINE_MEMBER( studio2_state::ef4_r )
362362{
363   return BIT(input_port_read(machine(), "B"), m_keylatch);
363   return BIT(ioport("B")->read(), m_keylatch);
364364}
365365
366366WRITE_LINE_MEMBER( studio2_state::q_w )
src/mess/drivers/osi.c
r15082r15083
230230
231231   for (bit = 0; bit < 8; bit++)
232232   {
233      if (!BIT(m_keylatch, bit)) data &= input_port_read(machine(), keynames[bit]);
233      if (!BIT(m_keylatch, bit)) data &= ioport(keynames[bit])->read();
234234   }
235235
236236   return data;
src/mess/drivers/oric.c
r15082r15083
160160   PORT_CONFNAME(0x08, 0x00, "Vsync cable hardware")
161161   PORT_CONFSETTING(   0x00, DEF_STR( Off ) )
162162   PORT_CONFSETTING(   0x08, DEF_STR( On ) )
163   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_VBLANK)
163   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
164164INPUT_PORTS_END
165165
166166static INPUT_PORTS_START(orica)
r15082r15083
265265   PORT_CONFNAME(0x08, 0x00, "Vsync cable hardware")
266266   PORT_CONFSETTING(   0x00, DEF_STR( Off ) )
267267   PORT_CONFSETTING(   0x08, DEF_STR( On ) )
268   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_VBLANK)
268   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
269269INPUT_PORTS_END
270270
271271static INPUT_PORTS_START(telstrat)
r15082r15083
282282   PORT_CONFNAME(0x08, 0x00, "Vsync cable hardware")
283283   PORT_CONFSETTING(   0x00, DEF_STR( Off ) )
284284   PORT_CONFSETTING(   0x08, DEF_STR( On ) )
285   PORT_BIT( 0x010, IP_ACTIVE_HIGH, IPT_VBLANK)
285   PORT_BIT( 0x010, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
286286
287287   PORT_START("JOY0")      /* left joystick port */
288288   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joystick 0 Up") PORT_CODE(JOYCODE_X_RIGHT_SWITCH)
src/mess/drivers/sdk85.c
r15082r15083
105105   {
106106      char kbdrow[6];
107107      sprintf(kbdrow,"X%X",m_digit);
108      data = input_port_read(machine(), kbdrow);
108      data = ioport(kbdrow)->read();
109109   }
110110   return data;
111111}
src/mess/drivers/megadriv.c
r15082r15083
271271
272272   if (state->m_jcart_io_data[0] & 0x40)
273273   {
274      joy[0] = input_port_read_safe(space->machine(), "JCART3_3B", 0);
275      joy[1] = input_port_read_safe(space->machine(), "JCART4_3B", 0);
274      joy[0] = state->ioport("JCART3_3B")->read_safe(0);
275      joy[1] = state->ioport("JCART4_3B")->read_safe(0);
276276      retdata = (state->m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
277277   }
278278   else
279279   {
280      joy[0] = ((input_port_read_safe(space->machine(), "JCART3_3B", 0) & 0xc0) >> 2) |
281        (input_port_read_safe(space->machine(), "JCART3_3B", 0) & 0x03);
282      joy[1] = ((input_port_read_safe(space->machine(), "JCART4_3B", 0) & 0xc0) >> 2) |
283        (input_port_read_safe(space->machine(), "JCART4_3B", 0) & 0x03);
280      joy[0] = ((state->ioport("JCART3_3B")->read_safe(0) & 0xc0) >> 2) |
281        (state->ioport("JCART3_3B")->read_safe(0) & 0x03);
282      joy[1] = ((state->ioport("JCART4_3B")->read_safe(0) & 0xc0) >> 2) |
283        (state->ioport("JCART4_3B")->read_safe(0) & 0x03);
284284      retdata = (state->m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
285285   }
286286   return retdata;
r15082r15083
317317   switch (portnum)
318318   {
319319      case 0:
320         controller = (input_port_read(machine, "CTRLSEL") & 0x0f);
320         controller = (machine.root_device().ioport("CTRLSEL")->read() & 0x0f);
321321         break;
322322
323323      case 1:
324         controller = (input_port_read(machine, "CTRLSEL") & 0xf0);
324         controller = (machine.root_device().ioport("CTRLSEL")->read() & 0xf0);
325325         break;
326326
327327      default:
r15082r15083
338338         {
339339            /* here we read B, C & the additional buttons */
340340            retdata = (megadrive_io_data_regs[portnum] & helper_6b) |
341                     (((input_port_read_safe(machine, pad6names[0][portnum], 0) & 0x30) |
342                        (input_port_read_safe(machine, pad6names[1][portnum], 0) & 0x0f)) & ~helper_6b);
341                     (((state->ioport(pad6names[0][portnum])->read_safe(0) & 0x30) |
342                        (state->ioport(pad6names[1][portnum])->read_safe(0) & 0x0f)) & ~helper_6b);
343343         }
344344         else
345345         {
346346            /* here we read B, C & the directional buttons */
347347            retdata = (megadrive_io_data_regs[portnum] & helper_6b) |
348                     ((input_port_read_safe(machine, pad6names[0][portnum], 0) & 0x3f) & ~helper_6b);
348                     ((state->ioport(pad6names[0][portnum])->read_safe(0) & 0x3f) & ~helper_6b);
349349         }
350350      }
351351      else
r15082r15083
354354         {
355355            /* here we read ((Start & A) >> 2) | 0x00 */
356356            retdata = (megadrive_io_data_regs[portnum] & helper_6b) |
357                     (((input_port_read_safe(machine, pad6names[0][portnum], 0) & 0xc0) >> 2) & ~helper_6b);
357                     (((state->ioport(pad6names[0][portnum])->read_safe(0) & 0xc0) >> 2) & ~helper_6b);
358358         }
359359         else if (state->m_mess_io_stage[portnum]==2)
360360         {
361361            /* here we read ((Start & A) >> 2) | 0x0f */
362362            retdata = (megadrive_io_data_regs[portnum] & helper_6b) |
363                     ((((input_port_read_safe(machine, pad6names[0][portnum], 0) & 0xc0) >> 2) | 0x0f) & ~helper_6b);
363                     ((((state->ioport(pad6names[0][portnum])->read_safe(0) & 0xc0) >> 2) | 0x0f) & ~helper_6b);
364364         }
365365         else
366366         {
367367            /* here we read ((Start & A) >> 2) | Up and Down */
368368            retdata = (megadrive_io_data_regs[portnum] & helper_6b) |
369                     ((((input_port_read_safe(machine, pad6names[0][portnum], 0) & 0xc0) >> 2) |
370                        (input_port_read_safe(machine, pad6names[0][portnum], 0) & 0x03)) & ~helper_6b);
369                     ((((state->ioport(pad6names[0][portnum])->read_safe(0) & 0xc0) >> 2) |
370                        (state->ioport(pad6names[0][portnum])->read_safe(0) & 0x03)) & ~helper_6b);
371371         }
372372      }
373373
r15082r15083
382382      {
383383         /* here we read B, C & the directional buttons */
384384         retdata = (megadrive_io_data_regs[portnum] & helper_3b) |
385                  (((input_port_read_safe(machine, pad3names[portnum], 0) & 0x3f) | 0x40) & ~helper_3b);
385                  (((state->ioport(pad3names[portnum])->read_safe(0) & 0x3f) | 0x40) & ~helper_3b);
386386      }
387387      else
388388      {
389389         /* here we read ((Start & A) >> 2) | Up and Down */
390390         retdata = (megadrive_io_data_regs[portnum] & helper_3b) |
391                  ((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) |
392                     (input_port_read_safe(machine, pad3names[portnum], 0) & 0x03) | 0x40) & ~helper_3b);
391                  ((((state->ioport(pad3names[portnum])->read_safe(0) & 0xc0) >> 2) |
392                     (state->ioport(pad3names[portnum])->read_safe(0) & 0x03) | 0x40) & ~helper_3b);
393393      }
394394   }
395395
r15082r15083
405405   switch (portnum)
406406   {
407407      case 0:
408         controller = (input_port_read(machine, "CTRLSEL") & 0x0f);
408         controller = (machine.root_device().ioport("CTRLSEL")->read() & 0x0f);
409409         break;
410410
411411      case 1:
412         controller = (input_port_read(machine, "CTRLSEL") & 0xf0);
412         controller = (machine.root_device().ioport("CTRLSEL")->read() & 0xf0);
413413         break;
414414
415415      default:
r15082r15083
463463   PORT_CONFSETTING( 0x00, "Joystick 3 Buttons" )
464464
465465   PORT_START("PAD1_3B")      /* Joypad 1 (3 button + start) NOT READ DIRECTLY */
466   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
467   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
468   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
469   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
470   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 B") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
471   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 C") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
472   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 A") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
473   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
466   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
467   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
468   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
469   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
470   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 B") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
471   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 C") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
472   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 A") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
473   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
474474
475475   PORT_START("PAD2_3B")      /* Joypad 2 (3 button + start) NOT READ DIRECTLY */
476   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
477   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
478   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
479   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
480   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 B") PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
481   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 C") PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
482   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 A") PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
483   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
476   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
477   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
478   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
479   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
480   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 B") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
481   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 C") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
482   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 A") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
483   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
484484
485485   PORT_START("JCART3_3B")      /* Joypad 3 on J-Cart (3 button + start) */
486   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, PORTCOND_EQUALS, 0x00)
487   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, PORTCOND_EQUALS, 0x00)
488   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, PORTCOND_EQUALS, 0x00)
489   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, PORTCOND_EQUALS, 0x00)
490   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_NAME("P3 B") PORT_CONDITION("CTRLSEL", 0xf00, PORTCOND_EQUALS, 0x00)
491   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) PORT_NAME("P3 C") PORT_CONDITION("CTRLSEL", 0xf00, PORTCOND_EQUALS, 0x00)
492   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_NAME("P3 A") PORT_CONDITION("CTRLSEL", 0xf00, PORTCOND_EQUALS, 0x00)
493   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, PORTCOND_EQUALS, 0x00)
486   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
487   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
488   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
489   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
490   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_NAME("P3 B") PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
491   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) PORT_NAME("P3 C") PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
492   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_NAME("P3 A") PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
493   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0xf00, EQUALS, 0x00)
494494
495495   PORT_START("JCART4_3B")      /* Joypad 4 on J-Cart (3 button + start) */
496   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x00)
497   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x00)
498   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x00)
499   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x00)
500   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_NAME("P4 B") PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x00)
501   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_NAME("P4 C") PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x00)
502   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_NAME("P4 A") PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x00)
503   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x00)
496   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
497   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
498   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
499   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
500   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_NAME("P4 B") PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
501   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_NAME("P4 C") PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
502   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_NAME("P4 A") PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
503   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x00)
504504
505505   PORT_START("PAD1_6B")      /* Joypad 1 (6 button + start + mode) NOT READ DIRECTLY */
506   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
507   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
508   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
509   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
510   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 B") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
511   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 C") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
512   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 A") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
513   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
506   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
507   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
508   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
509   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
510   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 B") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
511   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 C") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
512   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 A") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
513   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
514514
515515   PORT_START("EXTRA1")   /* Extra buttons for Joypad 1 (6 button + start + mode) NOT READ DIRECTLY */
516   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_NAME("P1 Z") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
517   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("P1 Y") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
518   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("P1 X") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
519   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(1) PORT_NAME("P1 Mode") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
516   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_NAME("P1 Z") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
517   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("P1 Y") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
518   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("P1 X") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
519   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(1) PORT_NAME("P1 Mode") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
520520
521521   PORT_START("PAD2_6B")      /* Joypad 2 (6 button + start + mode) NOT READ DIRECTLY */
522   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
523   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
524   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
525   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
526   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 B") PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
527   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 C") PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
528   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 A") PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
529   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
522   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
523   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
524   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
525   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
526   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 B") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
527   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 C") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
528   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 A") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
529   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
530530
531531   PORT_START("EXTRA2")   /* Extra buttons for Joypad 2 (6 button + start + mode) NOT READ DIRECTLY */
532   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) PORT_NAME("P2 Z") PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
533   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("P2 Y") PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
534   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("P2 X") PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
535   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(2) PORT_NAME("P2 Mode") PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
532   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) PORT_NAME("P2 Z") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
533   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("P2 Y") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
534   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("P2 X") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
535   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(2) PORT_NAME("P2 Mode") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
536536
537537   PORT_START("RESET")      /* Buttons on Genesis Console */
538538   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Reset Button") PORT_IMPULSE(1) // reset, resets 68k (and..?)
r15082r15083
923923   switch (pen)
924924    {
925925      case PICO_PENX:
926         penpos = input_port_read_safe(machine, "PENX", 0);
926         penpos = machine.root_device().ioport("PENX")->read_safe(0);
927927         penpos |= 0x6;
928928         penpos = penpos * 320 / 255;
929929         penpos += 0x3d;
930930         break;
931931      case PICO_PENY:
932         penpos = input_port_read_safe(machine, "PENY", 0);
932         penpos = machine.root_device().ioport("PENY")->read_safe(0);
933933         penpos |= 0x6;
934934         penpos = penpos * 251 / 255;
935935         penpos += 0x1fc;
r15082r15083
950950         retdata = (megadrive_region_export << 6) | (megadrive_region_pal << 5);
951951         break;
952952      case 1:
953         retdata = input_port_read_safe(space->machine(), "PAD", 0);
953         retdata = state->ioport("PAD")->read_safe(0);
954954         break;
955955
956956         /*
r15082r15083
983983           either page 5 or page 6 is often unused.
984984        */
985985         {
986            UINT8 tmp = input_port_read_safe(space->machine(), "PAGE", 0);
986            UINT8 tmp = state->ioport("PAGE")->read_safe(0);
987987            if (tmp == 2 && state->m_page_register != 0x3f)
988988            {
989989               state->m_page_register <<= 1;
src/mess/drivers/mekd2.c
r15082r15083
196196      if (BIT(m_digit, i))
197197      {
198198         sprintf(kbdrow,"X%d",i);
199         m_keydata &= input_port_read(machine(), kbdrow);
199         m_keydata &= ioport(kbdrow)->read();
200200      }
201201   }
202202
src/mess/drivers/rt1715.c
r15082r15083
7979{
8080   UINT8 result = 0xff;
8181
82   if (BIT(offset,  0)) result &= input_port_read(machine(), "row_00");
83   if (BIT(offset,  1)) result &= input_port_read(machine(), "row_10");
84   if (BIT(offset,  2)) result &= input_port_read(machine(), "row_20");
85   if (BIT(offset,  3)) result &= input_port_read(machine(), "row_30");
86   if (BIT(offset,  4)) result &= input_port_read(machine(), "row_40");
87   if (BIT(offset,  5)) result &= input_port_read(machine(), "row_50");
88   if (BIT(offset,  6)) result &= input_port_read(machine(), "row_60");
89   if (BIT(offset,  7)) result &= input_port_read(machine(), "row_70");
90   if (BIT(offset,  8)) result &= input_port_read(machine(), "row_08");
91   if (BIT(offset,  9)) result &= input_port_read(machine(), "row_18");
92   if (BIT(offset, 10)) result &= input_port_read(machine(), "row_28");
93   if (BIT(offset, 11)) result &= input_port_read(machine(), "row_38");
94   if (BIT(offset, 12)) result &= input_port_read(machine(), "row_48");
82   if (BIT(offset,  0)) result &= ioport("row_00")->read();
83   if (BIT(offset,  1)) result &= ioport("row_10")->read();
84   if (BIT(offset,  2)) result &= ioport("row_20")->read();
85   if (BIT(offset,  3)) result &= ioport("row_30")->read();
86   if (BIT(offset,  4)) result &= ioport("row_40")->read();
87   if (BIT(offset,  5)) result &= ioport("row_50")->read();
88   if (BIT(offset,  6)) result &= ioport("row_60")->read();
89   if (BIT(offset,  7)) result &= ioport("row_70")->read();
90   if (BIT(offset,  8)) result &= ioport("row_08")->read();
91   if (BIT(offset,  9)) result &= ioport("row_18")->read();
92   if (BIT(offset, 10)) result &= ioport("row_28")->read();
93   if (BIT(offset, 11)) result &= ioport("row_38")->read();
94   if (BIT(offset, 12)) result &= ioport("row_48")->read();
9595
9696   return result;
9797}
src/mess/drivers/rex6000.c
r15082r15083
322322
323323READ8_MEMBER( rex6000_state::touchscreen_r )
324324{
325   UINT16 x = input_port_read(machine(), "PENX");
326   UINT16 y = input_port_read(machine(), "PENY");
327   UINT16 battery = input_port_read(machine(), "BATTERY");
325   UINT16 x = ioport("PENX")->read();
326   UINT16 y = ioport("PENY")->read();
327   UINT16 battery = ioport("BATTERY")->read();
328328
329329   switch (offset)
330330   {
331331      case 0x08:
332         return ((input_port_read(machine(), "INPUT") & 0x40) ? 0x20 : 0x00) | 0X10;
332         return ((ioport("INPUT")->read() & 0x40) ? 0x20 : 0x00) | 0X10;
333333      case 0x09:
334334         if (m_touchscreen[4] & 0x80)
335335            return (battery>>0) & 0xff;
src/mess/drivers/mirage.c
r15082r15083
120120   if (bank != state->last_sndram_bank)
121121   {
122122      state->last_sndram_bank = bank;
123      state->membank("sndbank")->set_base(device->machine().root_device().memregion("es5503")->base() + bank);
123      state->membank("sndbank")->set_base(state->memregion("es5503")->base() + bank);
124124   }
125125}
126126
src/mess/drivers/ssem.c
r15082r15083
8282static INPUT_CHANGED( panel_check )
8383{
8484   ssem_state *state = field.machine().driver_data<ssem_state>();
85   UINT8 edit0_state = input_port_read(field.machine(), "EDIT0");
86   UINT8 edit1_state = input_port_read(field.machine(), "EDIT1");
87   UINT8 edit2_state = input_port_read(field.machine(), "EDIT2");
88   UINT8 edit3_state = input_port_read(field.machine(), "EDIT3");
89   UINT8 misc_state = input_port_read(field.machine(), "MISC");
85   UINT8 edit0_state = field.machine().root_device().ioport("EDIT0")->read();
86   UINT8 edit1_state = field.machine().root_device().ioport("EDIT1")->read();
87   UINT8 edit2_state = field.machine().root_device().ioport("EDIT2")->read();
88   UINT8 edit3_state = field.machine().root_device().ioport("EDIT3")->read();
89   UINT8 misc_state = field.machine().root_device().ioport("MISC")->read();
9090   device_t *ssem_cpu = field.machine().device("maincpu");
9191
9292   switch( (int)(FPTR)param )
src/mess/drivers/galeb.c
r15082r15083
2626{
2727   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
2828
29   return input_port_read(machine(), keynames[offset]);
29   return ioport(keynames[offset])->read();
3030}
3131
3232/* Address maps */
src/mess/drivers/v1050.c
r15082r15083
227227   int table = 0, row, col;
228228   int keydata = 0xff;
229229
230   UINT8 line_mod = input_port_read(machine(), "ROW12");
230   UINT8 line_mod = ioport("ROW12")->read();
231231
232232   if((line_mod & 0x07) && (line_mod & 0x18))
233233   {
r15082r15083
245245   // scan keyboard
246246   for (row = 0; row < 12; row++)
247247   {
248      UINT8 data = input_port_read(machine(), keynames[row]);
248      UINT8 data = ioport(keynames[row])->read();
249249
250250      for (col = 0; col < 8; col++)
251251      {
src/mess/drivers/ql.c
r15082r15083
247247
248248   UINT8 data = 0;
249249
250   if (BIT(m_keylatch, 0)) data |= input_port_read(machine(), "ROW0") | input_port_read(machine(), "JOY0");
251   if (BIT(m_keylatch, 1)) data |= input_port_read(machine(), "ROW1") | input_port_read(machine(), "JOY1");
252   if (BIT(m_keylatch, 2)) data |= input_port_read(machine(), "ROW2");
253   if (BIT(m_keylatch, 3)) data |= input_port_read(machine(), "ROW3");
254   if (BIT(m_keylatch, 4)) data |= input_port_read(machine(), "ROW4");
255   if (BIT(m_keylatch, 5)) data |= input_port_read(machine(), "ROW5");
256   if (BIT(m_keylatch, 6)) data |= input_port_read(machine(), "ROW6");
257   if (BIT(m_keylatch, 7)) data |= input_port_read(machine(), "ROW7");
250   if (BIT(m_keylatch, 0)) data |= ioport("ROW0")->read() | ioport("JOY0")->read();
251   if (BIT(m_keylatch, 1)) data |= ioport("ROW1")->read() | ioport("JOY1")->read();
252   if (BIT(m_keylatch, 2)) data |= ioport("ROW2")->read();
253   if (BIT(m_keylatch, 3)) data |= ioport("ROW3")->read();
254   if (BIT(m_keylatch, 4)) data |= ioport("ROW4")->read();
255   if (BIT(m_keylatch, 5)) data |= ioport("ROW5")->read();
256   if (BIT(m_keylatch, 6)) data |= ioport("ROW6")->read();
257   if (BIT(m_keylatch, 7)) data |= ioport("ROW7")->read();
258258
259259   return data;
260260}
r15082r15083
943943{
944944   address_space   *program   = m_maincpu->memory().space(AS_PROGRAM);
945945
946   m_disk_type=input_port_read(machine(),QL_CONFIG_PORT) & DISK_TYPE_MASK;
946   m_disk_type=ioport(QL_CONFIG_PORT)->read() & DISK_TYPE_MASK;
947947   logerror("disktype=%d\n",m_disk_type);
948948
949949   m_printer_char=0;
src/mess/drivers/mk14.c
r15082r15083
4646   {
4747      char kbdrow[6];
4848      sprintf(kbdrow,"X%X",offset);
49      return input_port_read(machine(), kbdrow);
49      return ioport(kbdrow)->read();
5050   }
5151   else
5252      return 0xff;
src/mess/drivers/amiga.c
r15082r15083
520520
521521static READ8_DEVICE_HANDLER( amiga_cia_0_portA_r )
522522{
523   UINT8 ret = input_port_read(device->machine(), "CIA0PORTA") & 0xc0;   /* Gameport 1 and 0 buttons */
523   UINT8 ret = device->machine().root_device().ioport("CIA0PORTA")->read() & 0xc0;   /* Gameport 1 and 0 buttons */
524524   ret |= device->machine().device<amiga_fdc>("fdc")->ciaapra_r();
525525   return ret;
526526}
r15082r15083
528528
529529static READ8_DEVICE_HANDLER( amiga_cia_0_cdtv_portA_r )
530530{
531   return input_port_read(device->machine(), "CIA0PORTA") & 0xc0;   /* Gameport 1 and 0 buttons */
531   return device->machine().root_device().ioport("CIA0PORTA")->read() & 0xc0;   /* Gameport 1 and 0 buttons */
532532}
533533
534534
r15082r15083
563563
564564static UINT16 amiga_read_joy0dat(running_machine &machine)
565565{
566   if ( input_port_read(machine, "input") & 0x20 ) {
566   if ( machine.root_device().ioport("input")->read() & 0x20 ) {
567567      /* Joystick */
568      return input_port_read_safe(machine, "JOY0DAT", 0xffff);
568      return machine.root_device().ioport("JOY0DAT")->read_safe(0xffff);
569569   } else {
570570      /* Mouse */
571571      int input;
572      input  = ( input_port_read(machine, "P0MOUSEX") & 0xff );
573      input |= ( input_port_read(machine, "P0MOUSEY") & 0xff ) << 8;
572      input  = ( machine.root_device().ioport("P0MOUSEX")->read() & 0xff );
573      input |= ( machine.root_device().ioport("P0MOUSEY")->read() & 0xff ) << 8;
574574      return input;
575575   }
576576}
577577
578578static UINT16 amiga_read_joy1dat(running_machine &machine)
579579{
580   if ( input_port_read(machine, "input") & 0x10 ) {
580   if ( machine.root_device().ioport("input")->read() & 0x10 ) {
581581      /* Joystick */
582      return input_port_read_safe(machine, "JOY1DAT", 0xffff);
582      return machine.root_device().ioport("JOY1DAT")->read_safe(0xffff);
583583   } else {
584584      /* Mouse */
585585      int input;
586      input  = ( input_port_read(machine, "P1MOUSEX") & 0xff );
587      input |= ( input_port_read(machine, "P1MOUSEY") & 0xff ) << 8;
586      input  = ( machine.root_device().ioport("P1MOUSEX")->read() & 0xff );
587      input |= ( machine.root_device().ioport("P1MOUSEY")->read() & 0xff ) << 8;
588588      return input;
589589   }
590590}
591591
592592static void amiga_reset(running_machine &machine)
593593{
594   if (input_port_read(machine, "hardware") & 0x08)
594   if (machine.root_device().ioport("hardware")->read() & 0x08)
595595   {
596596      /* Install RTC */
597597      machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xdc0000, 0xdc003f, FUNC(amiga_clock_r), FUNC(amiga_clock_w));
src/mess/drivers/sorcerer.c
r15082r15083
192192static INPUT_PORTS_START(sorcerer)
193193   PORT_START("VS")
194194   /* vblank */
195   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK)
195   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
196196
197197   /* line 0 */
198198   PORT_START("LINE0")
src/mess/drivers/abc80x.c
r15082r15083
936936
937937void abc800_state::machine_reset()
938938{
939   m_sb = input_port_read(machine(), "SB");
939   m_sb = ioport("SB")->read();
940940
941941   m_fetch_charram = 0;
942942   bankswitch();
r15082r15083
967967
968968void abc802_state::machine_reset()
969969{
970   UINT8 config = input_port_read(machine(), "CONFIG");
971   m_sb = input_port_read(machine(), "SB");
970   UINT8 config = ioport("CONFIG")->read();
971   m_sb = ioport("SB")->read();
972972
973973   // memory banking
974974   m_lrs = 1;
r15082r15083
10251025
10261026void abc806_state::machine_reset()
10271027{
1028   m_sb = input_port_read(machine(), "SB");
1028   m_sb = ioport("SB")->read();
10291029
10301030   // setup memory banking
10311031   int bank;
src/mess/drivers/qx10.c
r15082r15083
915915      int i;
916916
917917      /* TODO: is there a bit that sets this up? */
918      m_color_mode = input_port_read(machine(), "CONFIG") & 1;
918      m_color_mode = ioport("CONFIG")->read() & 1;
919919
920920      if(m_color_mode) //color
921921      {
src/mess/drivers/cvicny.c
r15082r15083
6969   UINT8 data;
7070   char kbdrow[6];
7171   sprintf(kbdrow,"X%d",m_digit);
72   data = input_port_read(machine(), kbdrow);
72   data = ioport(kbdrow)->read();
7373   return ((data << 4) ^ 0xf0) | data;
7474}
7575
src/mess/drivers/tvc.c
r15082r15083
120120      "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
121121      "LINE8", "LINE9", "LINEA", "LINEB", "LINEC", "LINED", "LINEE", "LINEF"
122122   };
123   return input_port_read(machine(), keynames[m_keyline & 0x0f]);
123   return ioport(keynames[m_keyline & 0x0f])->read();
124124}
125125
126126READ8_MEMBER(tvc_state::tvc_flipflop_r)
src/mess/drivers/tmc1800.c
r15082r15083
473473
474474READ_LINE_MEMBER( tmc1800_state::clear_r )
475475{
476   return BIT(input_port_read(machine(), "RUN"), 0);
476   return BIT(ioport("RUN")->read(), 0);
477477}
478478
479479READ_LINE_MEMBER( tmc1800_state::ef2_r )
r15082r15083
484484READ_LINE_MEMBER( tmc1800_state::ef3_r )
485485{
486486   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
487   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
487   UINT8 data = ~ioport(keynames[m_keylatch / 8])->read();
488488
489489   return BIT(data, m_keylatch % 8);
490490}
r15082r15083
514514
515515READ_LINE_MEMBER( osc1000b_state::clear_r )
516516{
517   return BIT(input_port_read(machine(), "RUN"), 0);
517   return BIT(ioport("RUN")->read(), 0);
518518}
519519
520520READ_LINE_MEMBER( osc1000b_state::ef2_r )
r15082r15083
525525READ_LINE_MEMBER( osc1000b_state::ef3_r )
526526{
527527   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
528   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
528   UINT8 data = ~ioport(keynames[m_keylatch / 8])->read();
529529
530530   return BIT(data, m_keylatch % 8);
531531}
r15082r15083
555555
556556READ_LINE_MEMBER( tmc2000_state::clear_r )
557557{
558   return BIT(input_port_read(machine(), "RUN"), 0);
558   return BIT(ioport("RUN")->read(), 0);
559559}
560560
561561READ_LINE_MEMBER( tmc2000_state::ef2_r )
r15082r15083
566566READ_LINE_MEMBER( tmc2000_state::ef3_r )
567567{
568568   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
569   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
569   UINT8 data = ~ioport(keynames[m_keylatch / 8])->read();
570570
571571   return BIT(data, m_keylatch % 8);
572572}
r15082r15083
611611
612612READ_LINE_MEMBER( nano_state::clear_r )
613613{
614   int run = BIT(input_port_read(machine(), "RUN"), 0);
615   int monitor = BIT(input_port_read(machine(), "MONITOR"), 0);
614   int run = BIT(ioport("RUN")->read(), 0);
615   int monitor = BIT(ioport("MONITOR")->read(), 0);
616616
617617   return run & monitor;
618618}
r15082r15083
625625READ_LINE_MEMBER( nano_state::ef3_r )
626626{
627627   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
628   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
628   UINT8 data = ~ioport(keynames[m_keylatch / 8])->read();
629629
630630   return BIT(data, m_keylatch % 8);
631631}
src/mess/drivers/crvision.c
r15082r15083
552552
553553   for (i = 0; i < 8; i++)
554554   {
555      value = input_port_read(machine(), keynames[pa][i]);
555      value = ioport(keynames[pa][i])->read();
556556
557557      if (value != 0xff)
558558      {
r15082r15083
648648
649649   UINT8 data = 0xff;
650650
651   if (!BIT(m_keylatch, 0)) data &= input_port_read(machine(), "ROW0");
652   if (!BIT(m_keylatch, 1)) data &= input_port_read(machine(), "ROW1");
653   if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "ROW2");
654   if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "ROW3");
655   if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "ROW4");
656   if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "ROW5");
657   if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "ROW6");
658   if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "ROW7");
651   if (!BIT(m_keylatch, 0)) data &= ioport("ROW0")->read();
652   if (!BIT(m_keylatch, 1)) data &= ioport("ROW1")->read();
653   if (!BIT(m_keylatch, 2)) data &= ioport("ROW2")->read();
654   if (!BIT(m_keylatch, 3)) data &= ioport("ROW3")->read();
655   if (!BIT(m_keylatch, 4)) data &= ioport("ROW4")->read();
656   if (!BIT(m_keylatch, 5)) data &= ioport("ROW5")->read();
657   if (!BIT(m_keylatch, 6)) data &= ioport("ROW6")->read();
658   if (!BIT(m_keylatch, 7)) data &= ioport("ROW7")->read();
659659
660660   return data;
661661}
r15082r15083
680680{
681681   UINT8 data = 0xff;
682682
683   if (!BIT(m_joylatch, 0)) data &= input_port_read(machine(), "JOY0");
684   if (!BIT(m_joylatch, 1)) data &= input_port_read(machine(), "JOY1");
685   if (!BIT(m_joylatch, 2)) data &= input_port_read(machine(), "JOY2");
686   if (!BIT(m_joylatch, 3)) data &= input_port_read(machine(), "JOY3");
683   if (!BIT(m_joylatch, 0)) data &= ioport("JOY0")->read();
684   if (!BIT(m_joylatch, 1)) data &= ioport("JOY1")->read();
685   if (!BIT(m_joylatch, 2)) data &= ioport("JOY2")->read();
686   if (!BIT(m_joylatch, 3)) data &= ioport("JOY3")->read();
687687
688688   return data;
689689}
src/mess/drivers/mz2500.c
r15082r15083
13951395   UINT8 res,dir_en,in_r;
13961396
13971397   res = 0xff;
1398   in_r = ~input_port_read(machine(), m_joy_mode & 0x40 ? "JOY_2P" : "JOY_1P");
1398   in_r = ~ioport(m_joy_mode & 0x40 ? "JOY_2P" : "JOY_1P")->read();
13991399
14001400   if(m_joy_mode & 0x40)
14011401   {
r15082r15083
17511751   beep_set_frequency(machine.device(BEEPER_TAG),4096);
17521752   beep_set_state(machine.device(BEEPER_TAG),0);
17531753
1754//  state->m_monitor_type = input_port_read(machine,"DSW1") & 0x40 ? 1 : 0;
1754//  state->m_monitor_type = machine.root_device().ioport("DSW1")->read() & 0x40 ? 1 : 0;
17551755}
17561756
17571757static const gfx_layout mz2500_cg_layout =
r15082r15083
19311931
19321932      res = 0xff;
19331933      for(i=0;i<0xe;i++)
1934         res &= input_port_read(device->machine(), keynames[i]);
1934         res &= device->machine().root_device().ioport(keynames[i])->read();
19351935
19361936      state->m_pio_latchb = res;
19371937
19381938      return res;
19391939   }
19401940
1941   state->m_pio_latchb = input_port_read(device->machine(), keynames[state->m_key_mux & 0xf]);
1941   state->m_pio_latchb = device->machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
19421942
1943   return input_port_read(device->machine(), keynames[state->m_key_mux & 0xf]);
1943   return device->machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
19441944}
19451945
19461946#if 0
src/mess/drivers/fmtowns.c
r15082r15083
581581      case 0:  // key press
582582         m_towns_kb_output = 0x80;
583583         m_towns_kb_extend = scancode & 0x7f;
584         if(input_port_read(machine(),"key3") & 0x00080000)
584         if(ioport("key3")->read() & 0x00080000)
585585            m_towns_kb_output |= 0x04;
586         if(input_port_read(machine(),"key3") & 0x00040000)
586         if(ioport("key3")->read() & 0x00040000)
587587            m_towns_kb_output |= 0x08;
588         if(input_port_read(machine(),"key3") & 0x06400000)
588         if(ioport("key3")->read() & 0x06400000)
589589            m_towns_kb_output |= 0x20;
590590         break;
591591      case 1:  // key release
592592         m_towns_kb_output = 0x90;
593593         m_towns_kb_extend = scancode & 0x7f;
594         if(input_port_read(machine(),"key3") & 0x00080000)
594         if(ioport("key3")->read() & 0x00080000)
595595            m_towns_kb_output |= 0x04;
596         if(input_port_read(machine(),"key3") & 0x00040000)
596         if(ioport("key3")->read() & 0x00040000)
597597            m_towns_kb_output |= 0x08;
598         if(input_port_read(machine(),"key3") & 0x06400000)
598         if(ioport("key3")->read() & 0x06400000)
599599            m_towns_kb_output |= 0x20;
600600         break;
601601      case 2:  // extended byte
r15082r15083
622622   scan = 0;
623623   for(port=0;port<4;port++)
624624   {
625      portval = input_port_read(machine(),kb_ports[port]);
625      portval = ioport(kb_ports[port])->read();
626626      for(bit=0;bit<32;bit++)
627627      {
628628         if(((portval & (1<<bit))) != ((m_kb_prev[port] & (1<<bit))))
r15082r15083
840840READ32_MEMBER(towns_state::towns_padport_r)
841841{
842842   UINT32 ret = 0;
843   UINT32 porttype = input_port_read(space.machine(),"ctrltype");
843   UINT32 porttype = space.machine().root_device().ioport("ctrltype")->read();
844844   UINT8 extra1;
845845   UINT8 extra2;
846846   UINT32 state;
r15082r15083
851851      ret |= 0x00ff0000;
852852   if((porttype & 0x0f) == 0x01)
853853   {
854      extra1 = input_port_read(space.machine(),"joy1_ex");
854      extra1 = space.machine().root_device().ioport("joy1_ex")->read();
855855
856856      if(m_towns_pad_mask & 0x10)
857         ret |= (input_port_read(space.machine(),"joy1") & 0x3f) | 0x00000040;
857         ret |= (space.machine().root_device().ioport("joy1")->read() & 0x3f) | 0x00000040;
858858      else
859         ret |= (input_port_read(space.machine(),"joy1") & 0x0f) | 0x00000030;
859         ret |= (space.machine().root_device().ioport("joy1")->read() & 0x0f) | 0x00000030;
860860
861861      if(extra1 & 0x01) // Run button = left+right
862862         ret &= ~0x0000000c;
r15082r15083
870870   }
871871   if((porttype & 0xf0) == 0x10)
872872   {
873      extra2 = input_port_read(space.machine(),"joy2_ex");
873      extra2 = space.machine().root_device().ioport("joy2_ex")->read();
874874
875875      if(m_towns_pad_mask & 0x20)
876         ret |= ((input_port_read(space.machine(),"joy2") & 0x3f) << 16) | 0x00400000;
876         ret |= ((space.machine().root_device().ioport("joy2")->read() & 0x3f) << 16) | 0x00400000;
877877      else
878         ret |= ((input_port_read(space.machine(),"joy2") & 0x0f) << 16) | 0x00300000;
878         ret |= ((space.machine().root_device().ioport("joy2")->read() & 0x0f) << 16) | 0x00300000;
879879
880880      if(extra2 & 0x01)
881881         ret &= ~0x000c0000;
r15082r15083
889889   }
890890   if((porttype & 0x0f) == 0x04)  // 6-button joystick
891891   {
892      extra1 = input_port_read(space.machine(),"6b_joy1_ex");
892      extra1 = space.machine().root_device().ioport("6b_joy1_ex")->read();
893893
894894      if(m_towns_pad_mask & 0x10)
895895         ret |= 0x0000007f;
896896      else
897         ret |= (input_port_read(space.machine(),"6b_joy1") & 0x0f) | 0x00000070;
897         ret |= (space.machine().root_device().ioport("6b_joy1")->read() & 0x0f) | 0x00000070;
898898
899899      if(!(m_towns_pad_mask & 0x10))
900900      {
r15082r15083
921921   }
922922   if((porttype & 0xf0) == 0x40)  // 6-button joystick
923923   {
924      extra2 = input_port_read(space.machine(),"6b_joy2_ex");
924      extra2 = space.machine().root_device().ioport("6b_joy2_ex")->read();
925925
926926      if(m_towns_pad_mask & 0x20)
927927         ret |= 0x007f0000;
928928      else
929         ret |= ((input_port_read(space.machine(),"6b_joy2") & 0x0f) << 16) | 0x00700000;
929         ret |= ((space.machine().root_device().ioport("6b_joy2")->read() & 0x0f) << 16) | 0x00700000;
930930
931931      if(!(m_towns_pad_mask & 0x10))
932932      {
r15082r15083
975975      }
976976
977977      // button states are always visible
978      state = input_port_read(space.machine(),"mouse1");
978      state = space.machine().root_device().ioport("mouse1")->read();
979979      if(!(state & 0x01))
980980         ret |= 0x00000010;
981981      if(!(state & 0x02))
r15082r15083
10071007      }
10081008
10091009      // button states are always visible
1010      state = input_port_read(space.machine(),"mouse1");
1010      state = space.machine().root_device().ioport("mouse1")->read();
10111011      if(!(state & 0x01))
10121012         ret |= 0x00100000;
10131013      if(!(state & 0x02))
r15082r15083
10221022WRITE32_MEMBER(towns_state::towns_pad_mask_w)
10231023{
10241024   UINT8 current_x,current_y;
1025   UINT32 type = input_port_read(space.machine(),"ctrltype");
1025   UINT32 type = space.machine().root_device().ioport("ctrltype")->read();
10261026
10271027   if(ACCESSING_BITS_16_23)
10281028   {
r15082r15083
10341034            if(m_towns_mouse_output == MOUSE_START)
10351035            {
10361036               m_towns_mouse_output = MOUSE_X_HIGH;
1037               current_x = input_port_read(space.machine(),"mouse2");
1038               current_y = input_port_read(space.machine(),"mouse3");
1037               current_x = space.machine().root_device().ioport("mouse2")->read();
1038               current_y = space.machine().root_device().ioport("mouse3")->read();
10391039               m_towns_mouse_x = m_prev_x - current_x;
10401040               m_towns_mouse_y = m_prev_y - current_y;
10411041               m_prev_x = current_x;
r15082r15083
10501050            if(m_towns_mouse_output == MOUSE_START)
10511051            {
10521052               m_towns_mouse_output = MOUSE_SYNC;
1053               current_x = input_port_read(space.machine(),"mouse2");
1054               current_y = input_port_read(space.machine(),"mouse3");
1053               current_x = space.machine().root_device().ioport("mouse2")->read();
1054               current_y = space.machine().root_device().ioport("mouse3")->read();
10551055               m_towns_mouse_x = m_prev_x - current_x;
10561056               m_towns_mouse_y = m_prev_y - current_y;
10571057               m_prev_x = current_x;
r15082r15083
10701070            if(m_towns_mouse_output == MOUSE_START)
10711071            {
10721072               m_towns_mouse_output = MOUSE_X_HIGH;
1073               current_x = input_port_read(space.machine(),"mouse2");
1074               current_y = input_port_read(space.machine(),"mouse3");
1073               current_x = space.machine().root_device().ioport("mouse2")->read();
1074               current_y = space.machine().root_device().ioport("mouse3")->read();
10751075               m_towns_mouse_x = m_prev_x - current_x;
10761076               m_towns_mouse_y = m_prev_y - current_y;
10771077               m_prev_x = current_x;
r15082r15083
10861086            if(m_towns_mouse_output == MOUSE_START)
10871087            {
10881088               m_towns_mouse_output = MOUSE_SYNC;
1089               current_x = input_port_read(space.machine(),"mouse2");
1090               current_y = input_port_read(space.machine(),"mouse3");
1089               current_x = space.machine().root_device().ioport("mouse2")->read();
1090               current_y = space.machine().root_device().ioport("mouse3")->read();
10911091               m_towns_mouse_x = m_prev_x - current_x;
10921092               m_towns_mouse_y = m_prev_y - current_y;
10931093               m_prev_x = current_x;
r15082r15083
23312331    PORT_BIT(0x20000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("COPY")
23322332
23332333  PORT_START("joy1")
2334    PORT_BIT(0x00000001,IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2335    PORT_BIT(0x00000002,IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2336    PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2337    PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2338    PORT_BIT(0x00000010,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2339    PORT_BIT(0x00000020,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2340    PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2341    PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2334    PORT_BIT(0x00000001,IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2335    PORT_BIT(0x00000002,IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2336    PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2337    PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2338    PORT_BIT(0x00000010,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2339    PORT_BIT(0x00000020,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2340    PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2341    PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
23422342
23432343  PORT_START("joy1_ex")
2344    PORT_BIT(0x00000001,IP_ACTIVE_HIGH, IPT_START) PORT_NAME("1P Run") PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2345    PORT_BIT(0x00000002,IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("1P Select") PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2346    PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2347    PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2348    PORT_BIT(0x00000010,IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2349    PORT_BIT(0x00000020,IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2350    PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2351    PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2344    PORT_BIT(0x00000001,IP_ACTIVE_HIGH, IPT_START) PORT_NAME("1P Run") PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2345    PORT_BIT(0x00000002,IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("1P Select") PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2346    PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2347    PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2348    PORT_BIT(0x00000010,IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2349    PORT_BIT(0x00000020,IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2350    PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2351    PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
23522352
23532353  PORT_START("joy2")
2354    PORT_BIT(0x00000001,IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2355    PORT_BIT(0x00000002,IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2356    PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2357    PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2358    PORT_BIT(0x00000010,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2359    PORT_BIT(0x00000020,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2360    PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2361    PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2354    PORT_BIT(0x00000001,IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2355    PORT_BIT(0x00000002,IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2356    PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2357    PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2358    PORT_BIT(0x00000010,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2359    PORT_BIT(0x00000020,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2360    PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2361    PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
23622362
23632363  PORT_START("joy2_ex")
2364    PORT_BIT(0x00000001,IP_ACTIVE_HIGH, IPT_START) PORT_NAME("2P Run") PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2365    PORT_BIT(0x00000002,IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("2P Select") PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2366    PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2367    PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2368    PORT_BIT(0x00000010,IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2369    PORT_BIT(0x00000020,IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2370    PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2371    PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2364    PORT_BIT(0x00000001,IP_ACTIVE_HIGH, IPT_START) PORT_NAME("2P Run") PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2365    PORT_BIT(0x00000002,IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("2P Select") PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2366    PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2367    PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2368    PORT_BIT(0x00000010,IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2369    PORT_BIT(0x00000020,IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2370    PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2371    PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
23722372
23732373    PORT_START("6b_joy1")
2374      PORT_BIT(0x00000001,IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2375      PORT_BIT(0x00000002,IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2376      PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2377      PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2378      PORT_BIT(0x00000010,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2379      PORT_BIT(0x00000020,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2380      PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2381      PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2374      PORT_BIT(0x00000001,IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2375      PORT_BIT(0x00000002,IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2376      PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2377      PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2378      PORT_BIT(0x00000010,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2379      PORT_BIT(0x00000020,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2380      PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2381      PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
23822382
23832383    PORT_START("6b_joy1_ex")
2384      PORT_BIT(0x00000001,IP_ACTIVE_HIGH, IPT_START) PORT_NAME("1P Run") PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2385      PORT_BIT(0x00000002,IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("1P Select") PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2386      PORT_BIT(0x00000004,IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2387      PORT_BIT(0x00000008,IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2388      PORT_BIT(0x00000010,IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2389      PORT_BIT(0x00000020,IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2390      PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2391      PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x04)
2384      PORT_BIT(0x00000001,IP_ACTIVE_HIGH, IPT_START) PORT_NAME("1P Run") PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2385      PORT_BIT(0x00000002,IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("1P Select") PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2386      PORT_BIT(0x00000004,IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2387      PORT_BIT(0x00000008,IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2388      PORT_BIT(0x00000010,IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2389      PORT_BIT(0x00000020,IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2390      PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
2391      PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x04)
23922392
23932393    PORT_START("6b_joy2")
2394      PORT_BIT(0x00000001,IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2395      PORT_BIT(0x00000002,IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2396      PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2397      PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2398      PORT_BIT(0x00000010,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2399      PORT_BIT(0x00000020,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2400      PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2401      PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2394      PORT_BIT(0x00000001,IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2395      PORT_BIT(0x00000002,IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2396      PORT_BIT(0x00000004,IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2397      PORT_BIT(0x00000008,IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2398      PORT_BIT(0x00000010,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2399      PORT_BIT(0x00000020,IP_ACTIVE_LOW, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2400      PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2401      PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_UNUSED) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
24022402
24032403    PORT_START("6b_joy2_ex")
2404      PORT_BIT(0x00000001,IP_ACTIVE_HIGH, IPT_START) PORT_NAME("2P Run") PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2405      PORT_BIT(0x00000002,IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("2P Select") PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2406      PORT_BIT(0x00000004,IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2407      PORT_BIT(0x00000008,IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2408      PORT_BIT(0x00000010,IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2409      PORT_BIT(0x00000020,IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2410      PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2411      PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x40)
2404      PORT_BIT(0x00000001,IP_ACTIVE_HIGH, IPT_START) PORT_NAME("2P Run") PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2405      PORT_BIT(0x00000002,IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("2P Select") PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2406      PORT_BIT(0x00000004,IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2407      PORT_BIT(0x00000008,IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2408      PORT_BIT(0x00000010,IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2409      PORT_BIT(0x00000020,IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2410      PORT_BIT(0x00000040,IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
2411      PORT_BIT(0x00000080,IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x40)
24122412
24132413  PORT_START("mouse1")  // buttons
24142414   PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left mouse button") PORT_CODE(MOUSECODE_BUTTON1)
src/mess/drivers/a7800.c
r15082r15083
7373
7474   PORT_START("vblank")               /* IN2 */
7575   PORT_BIT(0x7F, IP_ACTIVE_LOW, IPT_UNUSED)
76   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_VBLANK)
76   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
7777
7878   PORT_START("console_buttons")      /* IN3 */
7979   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER)  PORT_NAME("Reset")         PORT_CODE(KEYCODE_R)
src/mess/drivers/gmaster.c
r15082r15083
107107    switch (offset)
108108   {
109109   case UPD7810_PORTA:
110      data = input_port_read(machine(), "JOY");
110      data = ioport("JOY")->read();
111111      break;
112112   default:
113113      logerror("%.4x port %d read %.2x\n", (int)cpu_get_reg(&space.device(), CPUINFO_INT_PC), offset, data);
src/mess/drivers/newbrain.c
r15082r15083
472472         m_keylatch = 0;
473473      }
474474
475      m_keydata = input_port_read(machine(), keynames[m_keylatch]);
475      m_keydata = ioport(keynames[m_keylatch])->read();
476476
477477      output_set_digit_value(m_keylatch, m_segment_data[m_keylatch]);
478478   }
src/mess/drivers/tk80bs.c
r15082r15083
172172
173173   UINT8 data = 0xff;
174174   if (BIT(m_ppi_portc, 4))
175      data &= input_port_read(machine(), "X0");
175      data &= ioport("X0")->read();
176176   if (BIT(m_ppi_portc, 5))
177      data &= input_port_read(machine(), "X1");
177      data &= ioport("X1")->read();
178178   if (BIT(m_ppi_portc, 6))
179      data &= input_port_read(machine(), "X2");
179      data &= ioport("X2")->read();
180180
181181   return data;
182182}
src/mess/drivers/einstein.c
r15082r15083
148148   UINT8 result = 0;
149149
150150   result |= m_de;
151   result |= input_port_read(machine(), "80column_dips") & 0x06;
151   result |= ioport("80column_dips")->read() & 0x06;
152152
153153   return result;
154154}
r15082r15083
176176   einstein_state *einstein = machine.driver_data<einstein_state>();
177177   UINT8 data = 0xff;
178178
179   if (!BIT(einstein->m_keyboard_line, 0)) data &= input_port_read(machine, "LINE0");
180   if (!BIT(einstein->m_keyboard_line, 1)) data &= input_port_read(machine, "LINE1");
181   if (!BIT(einstein->m_keyboard_line, 2)) data &= input_port_read(machine, "LINE2");
182   if (!BIT(einstein->m_keyboard_line, 3)) data &= input_port_read(machine, "LINE3");
183   if (!BIT(einstein->m_keyboard_line, 4)) data &= input_port_read(machine, "LINE4");
184   if (!BIT(einstein->m_keyboard_line, 5)) data &= input_port_read(machine, "LINE5");
185   if (!BIT(einstein->m_keyboard_line, 6)) data &= input_port_read(machine, "LINE6");
186   if (!BIT(einstein->m_keyboard_line, 7)) data &= input_port_read(machine, "LINE7");
179   if (!BIT(einstein->m_keyboard_line, 0)) data &= machine.root_device().ioport("LINE0")->read();
180   if (!BIT(einstein->m_keyboard_line, 1)) data &= machine.root_device().ioport("LINE1")->read();
181   if (!BIT(einstein->m_keyboard_line, 2)) data &= machine.root_device().ioport("LINE2")->read();
182   if (!BIT(einstein->m_keyboard_line, 3)) data &= machine.root_device().ioport("LINE3")->read();
183   if (!BIT(einstein->m_keyboard_line, 4)) data &= machine.root_device().ioport("LINE4")->read();
184   if (!BIT(einstein->m_keyboard_line, 5)) data &= machine.root_device().ioport("LINE5")->read();
185   if (!BIT(einstein->m_keyboard_line, 6)) data &= machine.root_device().ioport("LINE6")->read();
186   if (!BIT(einstein->m_keyboard_line, 7)) data &= machine.root_device().ioport("LINE7")->read();
187187
188188   einstein->m_keyboard_data = data;
189189}
r15082r15083
196196   einstein_scan_keyboard(timer.machine());
197197
198198   /* if /fire1 or /fire2 is 0, signal a fire interrupt */
199   if ((input_port_read(timer.machine(), "BUTTONS") & 0x03) != 0)
199   if ((timer.machine().root_device().ioport("BUTTONS")->read() & 0x03) != 0)
200200   {
201201      einstein->m_interrupt |= EINSTEIN_FIRE_INT;
202202   }
r15082r15083
256256   }
257257
258258   /* double sided drive connected? */
259   if (input_port_read(device->machine(), "config") & data)
259   if (device->machine().root_device().ioport("config")->read() & data)
260260   {
261261      /* bit 4 selects the side then */
262262      //floppy->ss_w(BIT(data, 4));
r15082r15083
331331   m_interrupt &= ~EINSTEIN_KEY_INT;
332332
333333   /* bit 0 and 1: fire buttons on the joysticks */
334   data |= input_port_read(machine(), "BUTTONS");
334   data |= ioport("BUTTONS")->read();
335335
336336   /* bit 2 to 4: printer status */
337337   data |= centronics->busy_r() << 2;
r15082r15083
339339   data |= centronics->fault_r() << 4;
340340
341341   /* bit 5 to 7: graph, control and shift key */
342   data |= input_port_read(machine(), "EXTRA");
342   data |= ioport("EXTRA")->read();
343343
344344   if(VERBOSE_KEYBOARD)
345345      logerror("%s: einstein_kybintmsk_r %02x\n", machine().describe_context(), data);
r15082r15083
423423{
424424   einstein_state *state = machine.driver_data<einstein_state>();
425425   //device_t *floppy;
426   //UINT8 config = input_port_read(machine, "config");
426   //UINT8 config = machine.root_device().ioport("config")->read();
427427
428428   /* save pointers to our devices */
429429   state->m_color_screen = machine.device("screen");
src/mess/drivers/wangpc.c
r15082r15083
764764 
765765    */
766766 
767   return input_port_read(machine(), "SW") << 4;
767   return ioport("SW")->read() << 4;
768768}
769769 
770770WRITE8_MEMBER( wangpc_state::ppi_pc_w )
src/mess/drivers/vboy.c
r15082r15083
141141      case 0x28:   // KCR (Keypad Control Reg)
142142         if (data & 0x04 )
143143         {
144            m_vboy_regs.klb = (data & 0x01) ? 0 : (input_port_read(machine(), "INPUT") & 0x00ff);
145            m_vboy_regs.khb = (data & 0x01) ? 0 : (input_port_read(machine(), "INPUT") & 0xff00) >> 8;
144            m_vboy_regs.klb = (data & 0x01) ? 0 : (ioport("INPUT")->read() & 0x00ff);
145            m_vboy_regs.khb = (data & 0x01) ? 0 : (ioport("INPUT")->read() & 0xff00) >> 8;
146146         }
147147         else if (data & 0x20)
148148         {
149            m_vboy_regs.klb = input_port_read(machine(), "INPUT") & 0x00ff;
150            m_vboy_regs.khb = (input_port_read(machine(), "INPUT") & 0xff00) >> 8;
149            m_vboy_regs.klb = ioport("INPUT")->read() & 0x00ff;
150            m_vboy_regs.khb = (ioport("INPUT")->read() & 0xff00) >> 8;
151151         }
152152         m_vboy_regs.kcr = (data | 0x48) & 0xfd;   // according to docs: bit 6 & bit 3 are unused and set to 1, bit 1 is read only.
153153         break;
src/mess/drivers/ti99_2.c
r15082r15083
273273{
274274   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
275275
276   return input_port_read(machine(), keynames[m_KeyRow]);
276   return ioport(keynames[m_KeyRow])->read();
277277}
278278
279279READ8_MEMBER(ti99_2_state::ti99_2_read_misc_cru)
src/mess/drivers/fk1.c
r15082r15083
388388{
389389   fk1_state *state = timer.machine().driver_data<fk1_state>();
390390
391   if (input_port_read(timer.machine(), "LINE0"))
391   if (timer.machine().root_device().ioport("LINE0")->read())
392392   {
393393      state->m_int_vector = 6;
394394      cputag_set_input_line(timer.machine(), "maincpu", 0, HOLD_LINE);
src/mess/drivers/multi8.c
r15082r15083
365365/* Input ports */
366366static INPUT_PORTS_START( multi8 )
367367   PORT_START("VBLANK")
368   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK)
368   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
369369
370370   PORT_START("key1") //0x00-0x1f
371371   PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_UNUSED) //0x00 null
r15082r15083
484484   multi8_state *state = timer.machine().driver_data<multi8_state>();
485485   static const char *const portnames[3] = { "key1","key2","key3" };
486486   int i,port_i,scancode;
487   UINT8 keymod = input_port_read(timer.machine(),"key_modifiers") & 0x1f;
487   UINT8 keymod = timer.machine().root_device().ioport("key_modifiers")->read() & 0x1f;
488488   scancode = 0;
489489
490490   state->m_shift_press_flag = ((keymod & 0x02) >> 1);
r15082r15083
493493   {
494494      for(i=0;i<32;i++)
495495      {
496         if((input_port_read(timer.machine(),portnames[port_i])>>i) & 1)
496         if((timer.machine().root_device().ioport(portnames[port_i])->read()>>i) & 1)
497497         {
498498            //key_flag = 1;
499499            if(!state->m_shift_press_flag)  // shift not pressed
r15082r15083
578578
579579READ8_MEMBER( multi8_state::porta_r )
580580{
581   int vsync = (input_port_read(machine(), "VBLANK") & 0x1) << 5;
581   int vsync = (ioport("VBLANK")->read() & 0x1) << 5;
582582   /*
583583    -x-- ---- kanji rom is present (0) yes
584584    --x- ---- vsync
src/mess/drivers/gizmondo.c
r15082r15083
8686         data = data & ~0x000000F2;
8787         // keys
8888         data |= 0x00F2;
89         if ((port_c & 0x01) == 0) data &= ~input_port_read( device->machine(), "PORTF-01");
90         if ((port_c & 0x02) == 0) data &= ~input_port_read( device->machine(), "PORTF-02");
91         if ((port_c & 0x04) == 0) data &= ~input_port_read( device->machine(), "PORTF-04");
92         if ((port_c & 0x08) == 0) data &= ~input_port_read( device->machine(), "PORTF-08");
93         if ((port_c & 0x10) == 0) data &= ~input_port_read( device->machine(), "PORTF-10");
94         data &= ~input_port_read( device->machine(), "PORTF");
89         if ((port_c & 0x01) == 0) data &= ~device->machine().root_device().ioport( "PORTF-01")->read();
90         if ((port_c & 0x02) == 0) data &= ~device->machine().root_device().ioport( "PORTF-02")->read();
91         if ((port_c & 0x04) == 0) data &= ~device->machine().root_device().ioport( "PORTF-04")->read();
92         if ((port_c & 0x08) == 0) data &= ~device->machine().root_device().ioport( "PORTF-08")->read();
93         if ((port_c & 0x10) == 0) data &= ~device->machine().root_device().ioport( "PORTF-10")->read();
94         data &= ~device->machine().root_device().ioport( "PORTF")->read();
9595      }
9696      break;
9797      case S3C2440_GPIO_PORT_G :
r15082r15083
9999         data = data & ~0x00008001;
100100         // keys
101101         data = data | 0x8000;
102         data &= ~input_port_read( device->machine(), "PORTG");
102         data &= ~device->machine().root_device().ioport( "PORTG")->read();
103103         // no sd card inserted
104104         data = data | 0x0001;
105105      }
src/mess/drivers/bullet.c
r15082r15083
297297   UINT8 data = 0x10;
298298
299299   // DIP switches
300   data |= input_port_read(machine(), "SW1") & 0x0f;
300   data |= ioport("SW1")->read() & 0x0f;
301301
302302   // floppy interrupt
303303   data |= wd17xx_intrq_r(m_fdc) << 6;
r15082r15083
530530   data |= m_centronics->busy_r();
531531
532532   // DIP switches
533   data |= input_port_read(machine(), "SW1") & 0x06;
533   data |= ioport("SW1")->read() & 0x06;
534534
535535   // floppy interrupt
536536   data |= wd17xx_intrq_r(m_fdc) << 6;
src/mess/drivers/vtech1.c
r15082r15083
523523{
524524   int result = 0xff;
525525
526   if (!BIT(offset, 0)) result &= input_port_read(machine(), "joystick_0");
527   if (!BIT(offset, 1)) result &= input_port_read(machine(), "joystick_0_arm");
528   if (!BIT(offset, 2)) result &= input_port_read(machine(), "joystick_1");
529   if (!BIT(offset, 3)) result &= input_port_read(machine(), "joystick_1_arm");
526   if (!BIT(offset, 0)) result &= ioport("joystick_0")->read();
527   if (!BIT(offset, 1)) result &= ioport("joystick_0_arm")->read();
528   if (!BIT(offset, 2)) result &= ioport("joystick_1")->read();
529   if (!BIT(offset, 3)) result &= ioport("joystick_1_arm")->read();
530530
531531   return result;
532532}
r15082r15083
536536   UINT8 result = 0x3f;
537537
538538   /* bit 0 to 5, keyboard input */
539   if (!BIT(offset, 0)) result &= input_port_read(machine(), "keyboard_0");
540   if (!BIT(offset, 1)) result &= input_port_read(machine(), "keyboard_1");
541   if (!BIT(offset, 2)) result &= input_port_read(machine(), "keyboard_2");
542   if (!BIT(offset, 3)) result &= input_port_read(machine(), "keyboard_3");
543   if (!BIT(offset, 4)) result &= input_port_read(machine(), "keyboard_4");
544   if (!BIT(offset, 5)) result &= input_port_read(machine(), "keyboard_5");
545   if (!BIT(offset, 6)) result &= input_port_read(machine(), "keyboard_6");
546   if (!BIT(offset, 7)) result &= input_port_read(machine(), "keyboard_7");
539   if (!BIT(offset, 0)) result &= ioport("keyboard_0")->read();
540   if (!BIT(offset, 1)) result &= ioport("keyboard_1")->read();
541   if (!BIT(offset, 2)) result &= ioport("keyboard_2")->read();
542   if (!BIT(offset, 3)) result &= ioport("keyboard_3")->read();
543   if (!BIT(offset, 4)) result &= ioport("keyboard_4")->read();
544   if (!BIT(offset, 5)) result &= ioport("keyboard_5")->read();
545   if (!BIT(offset, 6)) result &= ioport("keyboard_6")->read();
546   if (!BIT(offset, 7)) result &= ioport("keyboard_7")->read();
547547
548548   /* bit 6, cassette input */
549549   result |= ((m_cassette->input()) > 0 ? 1 : 0) << 6;
src/mess/drivers/ssystem3.c
r15082r15083
6060   ssystem3_state *state = machine.driver_data<ssystem3_state>();
6161  memset(&state->m_playfield, 0, sizeof(state->m_playfield));
6262  state->m_playfield.signal=FALSE;
63  //  state->m_playfield.on=TRUE; //input_port_read(machine, "Configuration")&1;
63  //  state->m_playfield.on=TRUE; //machine.root_device().ioport("Configuration")->read()&1;
6464}
6565
6666static void ssystem3_playfield_write(running_machine &machine, int reset, int signal)
r15082r15083
112112static void ssystem3_playfield_read(running_machine &machine, int *on, int *ready)
113113{
114114   //ssystem3_state *state = machine.driver_data<ssystem3_state>();
115   *on=!(input_port_read(machine, "Configuration")&1);
115   *on=!(machine.root_device().ioport("Configuration")->read()&1);
116116   //  *on=!state->m_playfield.on;
117117   *ready=FALSE;
118118}
r15082r15083
129129   ssystem3_state *state = device->machine().driver_data<ssystem3_state>();
130130  UINT8 data=0xff;
131131#if 1 // time switch
132  if (!(state->m_porta&0x10)) data&=input_port_read(device->machine(), "matrix1")|0xf1;
133  if (!(state->m_porta&0x20)) data&=input_port_read(device->machine(), "matrix2")|0xf1;
134  if (!(state->m_porta&0x40)) data&=input_port_read(device->machine(), "matrix3")|0xf1;
135  if (!(state->m_porta&0x80)) data&=input_port_read(device->machine(), "matrix4")|0xf1;
132  if (!(state->m_porta&0x10)) data&=device->machine().root_device().ioport("matrix1")->read()|0xf1;
133  if (!(state->m_porta&0x20)) data&=device->machine().root_device().ioport("matrix2")->read()|0xf1;
134  if (!(state->m_porta&0x40)) data&=device->machine().root_device().ioport("matrix3")->read()|0xf1;
135  if (!(state->m_porta&0x80)) data&=device->machine().root_device().ioport("matrix4")->read()|0xf1;
136136#else
137  if (!(state->m_porta&0x10)) data&=input_port_read(device->machine(), "matrix1")|0xf0;
138  if (!(state->m_porta&0x20)) data&=input_port_read(device->machine(), "matrix2")|0xf0;
139  if (!(state->m_porta&0x40)) data&=input_port_read(device->machine(), "matrix3")|0xf0;
140  if (!(state->m_porta&0x80)) data&=input_port_read(device->machine(), "matrix4")|0xf0;
137  if (!(state->m_porta&0x10)) data&=device->machine().root_device().ioport("matrix1")->read()|0xf0;
138  if (!(state->m_porta&0x20)) data&=device->machine().root_device().ioport("matrix2")->read()|0xf0;
139  if (!(state->m_porta&0x40)) data&=device->machine().root_device().ioport("matrix3")->read()|0xf0;
140  if (!(state->m_porta&0x80)) data&=device->machine().root_device().ioport("matrix4")->read()|0xf0;
141141#endif
142142  if (!(state->m_porta&1)) {
143    if (!(input_port_read(device->machine(), "matrix1")&1)) data&=~0x10;
144    if (!(input_port_read(device->machine(), "matrix2")&1)) data&=~0x20;
145    if (!(input_port_read(device->machine(), "matrix3")&1)) data&=~0x40;
146    if (!(input_port_read(device->machine(), "matrix4")&1)) data&=~0x80;
143    if (!(device->machine().root_device().ioport("matrix1")->read()&1)) data&=~0x10;
144    if (!(device->machine().root_device().ioport("matrix2")->read()&1)) data&=~0x20;
145    if (!(device->machine().root_device().ioport("matrix3")->read()&1)) data&=~0x40;
146    if (!(state->ioport("matrix4")->read()&1)) data&=~0x80;
147147  }
148148  if (!(state->m_porta&2)) {
149    if (!(input_port_read(device->machine(), "matrix1")&2)) data&=~0x10;
150    if (!(input_port_read(device->machine(), "matrix2")&2)) data&=~0x20;
151    if (!(input_port_read(device->machine(), "matrix3")&2)) data&=~0x40;
152    if (!(input_port_read(device->machine(), "matrix4")&2)) data&=~0x80;
149    if (!(device->machine().root_device().ioport("matrix1")->read()&2)) data&=~0x10;
150    if (!(device->machine().root_device().ioport("matrix2")->read()&2)) data&=~0x20;
151    if (!(device->machine().root_device().ioport("matrix3")->read()&2)) data&=~0x40;
152    if (!(device->machine().root_device().ioport("matrix4")->read()&2)) data&=~0x80;
153153  }
154154  if (!(state->m_porta&4)) {
155    if (!(input_port_read(device->machine(), "matrix1")&4)) data&=~0x10;
156    if (!(input_port_read(device->machine(), "matrix2")&4)) data&=~0x20;
157    if (!(input_port_read(device->machine(), "matrix3")&4)) data&=~0x40;
158    if (!(input_port_read(device->machine(), "matrix4")&4)) data&=~0x80;
155    if (!(device->machine().root_device().ioport("matrix1")->read()&4)) data&=~0x10;
156    if (!(device->machine().root_device().ioport("matrix2")->read()&4)) data&=~0x20;
157    if (!(device->machine().root_device().ioport("matrix3")->read()&4)) data&=~0x40;
158    if (!(device->machine().root_device().ioport("matrix4")->read()&4)) data&=~0x80;
159159  }
160160  if (!(state->m_porta&8)) {
161    if (!(input_port_read(device->machine(), "matrix1")&8)) data&=~0x10;
162    if (!(input_port_read(device->machine(), "matrix2")&8)) data&=~0x20;
163    if (!(input_port_read(device->machine(), "matrix3")&8)) data&=~0x40;
164    if (!(input_port_read(device->machine(), "matrix4")&8)) data&=~0x80;
161    if (!(device->machine().root_device().ioport("matrix1")->read()&8)) data&=~0x10;
162    if (!(device->machine().root_device().ioport("matrix2")->read()&8)) data&=~0x20;
163    if (!(device->machine().root_device().ioport("matrix3")->read()&8)) data&=~0x40;
164    if (!(device->machine().root_device().ioport("matrix4")->read()&8)) data&=~0x80;
165165  }
166166  //  logerror("%.4x via port a read %02x\n",(int)activecpu_get_pc(), data);
167167  return data;
src/mess/drivers/amstrad.c
r15082r15083
318318{
319319   running_machine &machine = field.machine();
320320
321   if ( (input_port_read(machine, "green_display")) & 0x01 )
321   if ( (machine.root_device().ioport("green_display")->read()) & 0x01 )
322322   {
323323      PALETTE_INIT_CALL( amstrad_cpc_green );
324324   }
src/mess/drivers/ng_aes.c
r15082r15083
307307   {
308308   default:
309309   case 0x00: ret = 0x0000; break; /* nothing? */
310   case 0x09: ret = input_port_read(field.machine(), "MAHJONG1"); break;
311   case 0x12: ret = input_port_read(field.machine(), "MAHJONG2"); break;
312   case 0x1b: ret = input_port_read(field.machine(), "MAHJONG3"); break; /* player 1 normal inputs? */
313   case 0x24: ret = input_port_read(field.machine(), "MAHJONG4"); break;
310   case 0x09: ret = field.machine().root_device().ioport("MAHJONG1")->read(); break;
311   case 0x12: ret = field.machine().root_device().ioport("MAHJONG2")->read(); break;
312   case 0x1b: ret = field.machine().root_device().ioport("MAHJONG3")->read(); break; /* player 1 normal inputs? */
313   case 0x24: ret = field.machine().root_device().ioport("MAHJONG4")->read(); break;
314314   }
315315
316316   return ret;
r15082r15083
10611061READ16_MEMBER(ng_aes_state::aes_in0_r)
10621062{
10631063   UINT32 ret = 0xffff;
1064   UINT32 ctrl = input_port_read(machine(),"CTRLSEL");
1064   UINT32 ctrl = ioport("CTRLSEL")->read();
10651065
10661066   switch(ctrl & 0x0f)
10671067   {
r15082r15083
10691069      ret = 0xffff;
10701070      break;
10711071   case 0x01:
1072      ret = input_port_read(machine(),"IN0");
1072      ret = ioport("IN0")->read();
10731073      break;
10741074   case 0x02:
10751075      switch (m_controller_select)
10761076      {
1077         case 0x09: ret = input_port_read(machine(), "MJ01_P1"); break;
1078         case 0x12: ret = input_port_read(machine(), "MJ02_P1"); break;
1079         case 0x1b: ret = input_port_read(machine(), "MJ03_P1"); break; /* player 1 normal inputs? */
1080         case 0x24: ret = input_port_read(machine(), "MJ04_P1"); break;
1077         case 0x09: ret = ioport("MJ01_P1")->read(); break;
1078         case 0x12: ret = ioport("MJ02_P1")->read(); break;
1079         case 0x1b: ret = ioport("MJ03_P1")->read(); break; /* player 1 normal inputs? */
1080         case 0x24: ret = ioport("MJ04_P1")->read(); break;
10811081         default:
1082            ret = input_port_read(machine(),"IN0");
1082            ret = ioport("IN0")->read();
10831083            break;
10841084      }
10851085      break;
r15082r15083
10911091READ16_MEMBER(ng_aes_state::aes_in1_r)
10921092{
10931093   UINT32 ret = 0xffff;
1094   UINT32 ctrl = input_port_read(machine(),"CTRLSEL");
1094   UINT32 ctrl = ioport("CTRLSEL")->read();
10951095
10961096   switch(ctrl & 0xf0)
10971097   {
r15082r15083
10991099      ret = 0xffff;
11001100      break;
11011101   case 0x10:
1102      ret = input_port_read(machine(),"IN1");
1102      ret = ioport("IN1")->read();
11031103      break;
11041104   case 0x20:
11051105      switch (m_controller_select)
11061106      {
1107         case 0x09: ret = input_port_read(machine(), "MJ01_P2"); break;
1108         case 0x12: ret = input_port_read(machine(), "MJ02_P2"); break;
1109         case 0x1b: ret = input_port_read(machine(), "MJ03_P2"); break; /* player 2 normal inputs? */
1110         case 0x24: ret = input_port_read(machine(), "MJ04_P2"); break;
1107         case 0x09: ret = ioport("MJ01_P2")->read(); break;
1108         case 0x12: ret = ioport("MJ02_P2")->read(); break;
1109         case 0x1b: ret = ioport("MJ03_P2")->read(); break; /* player 2 normal inputs? */
1110         case 0x24: ret = ioport("MJ04_P2")->read(); break;
11111111         default:
1112            ret = input_port_read(machine(),"IN1");
1112            ret = ioport("IN1")->read();
11131113            break;
11141114      }
11151115      break;
r15082r15083
11211121
11221122READ16_MEMBER(ng_aes_state::aes_in2_r)
11231123{
1124   UINT32 in2 = input_port_read(machine(),"IN2");
1124   UINT32 in2 = ioport("IN2")->read();
11251125   UINT32 ret = in2;
1126   UINT32 sel = input_port_read(machine(),"CTRLSEL");
1126   UINT32 sel = ioport("CTRLSEL")->read();
11271127
11281128   if((sel & 0x02) && (m_controller_select == 0x24))
11291129      ret ^= 0x0200;
r15082r15083
14591459static INPUT_PORTS_START( controller )
14601460   PORT_START("IN0")
14611461   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
1462   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
1463   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
1464   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
1465   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
1466   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
1467   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
1468   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
1469   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
1462   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
1463   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
1464   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
1465   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
1466   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
1467   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
1468   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
1469   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
14701470
14711471
14721472   PORT_START("IN1")
14731473   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
1474   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1475   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1476   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1477   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1478   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1479   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1480   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1481   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
1474   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
1475   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
1476   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
1477   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
1478   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
1479   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
1480   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
1481   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
14821482INPUT_PORTS_END
14831483
14841484static INPUT_PORTS_START( mjpanel )
14851485   PORT_START("MJ01_P1")
14861486   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
1487   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1488   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1489   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1490   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1491   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1492   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1493   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1487   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1488   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1489   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1490   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1491   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1492   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1493   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
14941494   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
14951495
14961496   PORT_START("MJ02_P1")
14971497   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
1498   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1499   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1500   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1501   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1502   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1503   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1504   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1505   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1498   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1499   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1500   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1501   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1502   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1503   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1504   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1505   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
15061506
15071507   PORT_START("MJ03_P1")
15081508   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
1509   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1510   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1511   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1512   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1513   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1514   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1515   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1516   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1509   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1510   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1511   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1512   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1513   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1514   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1515   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1516   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
15171517
15181518   PORT_START("MJ04_P1")
15191519   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
1520   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1521   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1522   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1523   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1524   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
1520   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1521   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1522   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1523   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
1524   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
15251525   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15261526   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15271527   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15281528
15291529   PORT_START("MJ01_P2")
15301530   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
1531   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1532   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1533   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1534   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1535   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1536   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1537   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1531   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1532   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1533   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1534   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1535   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1536   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1537   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
15381538   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15391539
15401540   PORT_START("MJ02_P2")
15411541   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
1542   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1543   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1544   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1545   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1546   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1547   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1548   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1542   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1543   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1544   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1545   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1546   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1547   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1548   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
15491549   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15501550
15511551   PORT_START("MJ03_P2")
15521552   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
1553   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1554   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1555   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1556   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1557   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1558   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1559   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1560   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1553   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1554   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1555   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1556   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1557   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1558   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1559   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1560   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
15611561
15621562   PORT_START("MJ04_P2")
15631563   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
1564   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1565   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1566   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1567   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1568   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
1564   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1565   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1566   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1567   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
1568   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
15691569   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15701570   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15711571   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mess/drivers/bml3.c
r15082r15083
581581   {
582582      for(i=0;i<32;i++)
583583      {
584         if((input_port_read(timer.machine(),portnames[port_i])>>i) & 1)
584         if((timer.machine().root_device().ioport(portnames[port_i])->read()>>i) & 1)
585585         {
586586            {
587587               state->m_keyb_press = scancode;
src/mess/drivers/kyocera.c
r15082r15083
6969{
7070   UINT8 data = 0xff;
7171
72   if (!BIT(keylatch, 0)) data &= input_port_read(machine, "KEY0");
73   if (!BIT(keylatch, 1)) data &= input_port_read(machine, "KEY1");
74   if (!BIT(keylatch, 2)) data &= input_port_read(machine, "KEY2");
75   if (!BIT(keylatch, 3)) data &= input_port_read(machine, "KEY3");
76   if (!BIT(keylatch, 4)) data &= input_port_read(machine, "KEY4");
77   if (!BIT(keylatch, 5)) data &= input_port_read(machine, "KEY5");
78   if (!BIT(keylatch, 6)) data &= input_port_read(machine, "KEY6");
79   if (!BIT(keylatch, 7)) data &= input_port_read(machine, "KEY7");
80   if (!BIT(keylatch, 8)) data &= input_port_read(machine, "KEY8");
72   if (!BIT(keylatch, 0)) data &= machine.root_device().ioport("KEY0")->read();
73   if (!BIT(keylatch, 1)) data &= machine.root_device().ioport("KEY1")->read();
74   if (!BIT(keylatch, 2)) data &= machine.root_device().ioport("KEY2")->read();
75   if (!BIT(keylatch, 3)) data &= machine.root_device().ioport("KEY3")->read();
76   if (!BIT(keylatch, 4)) data &= machine.root_device().ioport("KEY4")->read();
77   if (!BIT(keylatch, 5)) data &= machine.root_device().ioport("KEY5")->read();
78   if (!BIT(keylatch, 6)) data &= machine.root_device().ioport("KEY6")->read();
79   if (!BIT(keylatch, 7)) data &= machine.root_device().ioport("KEY7")->read();
80   if (!BIT(keylatch, 8)) data &= machine.root_device().ioport("KEY8")->read();
8181
8282   return data;
8383}
r15082r15083
274274   data |= 0x20;
275275
276276   // low power sensor
277   data |= BIT(input_port_read(machine(), "BATTERY"), 0) << 7;
277   data |= BIT(ioport("BATTERY")->read(), 0) << 7;
278278
279279   return data;
280280}
r15082r15083
316316   data |= 0x20;
317317
318318   // low power sensor
319   data |= BIT(input_port_read(machine(), "BATTERY"), 0) << 7;
319   data |= BIT(ioport("BATTERY")->read(), 0) << 7;
320320
321321   return data;
322322}
src/mess/drivers/sdk86.c
r15082r15083
113113   {
114114      char kbdrow[6];
115115      sprintf(kbdrow,"X%X",m_digit);
116      data = input_port_read(machine(), kbdrow);
116      data = ioport(kbdrow)->read();
117117   }
118118   return data;
119119}
src/mess/drivers/sms.c
r15082r15083
159159
160160static INPUT_PORTS_START( sms )
161161   PORT_START("PORT_DC")
162   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
163   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
164   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
165   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
166   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
167   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x00)
168   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
169   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
162   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
163   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
164   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
165   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
166   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
167   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x00)
168   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
169   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
170170
171171   PORT_START("PORT_DD")
172   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
173   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
174   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
175   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x00)
172   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
173   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
174   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
175   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x00)
176176   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) /* Software Reset bit */
177177   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
178178   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) /* Port A TH */
r15082r15083
183183   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START ) PORT_NAME(DEF_STR(Pause))
184184
185185   PORT_START("LPHASER0")   /* Light phaser X - player 1 */
186   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CHANGED(lgun1_changed, NULL) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
186   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CHANGED(lgun1_changed, NULL) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
187187
188188   PORT_START("LPHASER1")   /* Light phaser Y - player 1 */
189   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CHANGED(lgun1_changed, NULL) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
189   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CHANGED(lgun1_changed, NULL) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
190190
191191   PORT_START("LPHASER2")   /* Light phaser X - player 2 */
192   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CHANGED(lgun2_changed, NULL) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
192   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CHANGED(lgun2_changed, NULL) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
193193
194194   PORT_START("LPHASER3")   /* Light phaser Y - player 2 */
195   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(25) PORT_PLAYER(2) PORT_CHANGED(lgun2_changed, NULL) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
195   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(25) PORT_PLAYER(2) PORT_CHANGED(lgun2_changed, NULL) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
196196
197197   PORT_START("RFU")   /* Rapid Fire Unit */
198198   PORT_CONFNAME( 0x03, 0x00, "Rapid Fire Unit - Player 1" )
r15082r15083
207207   PORT_CONFSETTING(   0x0c, "Button A + B" )
208208
209209   PORT_START("PADDLE0")   /* Paddle player 1 */
210   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(20) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
210   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(20) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
211211
212212   PORT_START("PADDLE1")   /* Paddle player 2 */
213   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(20) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
213   PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(20) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
214214
215215   PORT_START("CTRLIPT")   /* Light Phaser and Paddle Control buttons */
216   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
217   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
218   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x04)
219   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x04)
220   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
221   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
222   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x40)
223   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x40)
216   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
217   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
218   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x04)
219   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x04)
220   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
221   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
222   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x40)
223   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x40)
224224
225225   PORT_START("CTRLSEL")   /* Controller selection */
226226   PORT_CONFNAME( 0x0f, 0x00, "Player 1 Controller" )
r15082r15083
235235   PORT_CONFSETTING( 0x40, "Sega Sports Pad" )
236236
237237   PORT_START("SPORT0")   /* Player 1 Sports Pad X axis */
238   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x04)
238   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x04)
239239
240240   PORT_START("SPORT1")   /* Player 1 Sports Pad Y axis */
241   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x04)
241   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x04)
242242
243243   PORT_START("SPORT2")   /* Player 2 Sports Pad X axis */
244   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x40)
244   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x40)
245245
246246   PORT_START("SPORT3")   /* Player 2 Sports Pad Y axis */
247   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x40)
247   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x40)
248248INPUT_PORTS_END
249249
250250static INPUT_PORTS_START( sms1 )
r15082r15083
259259   PORT_CONFSETTING( 0x01, DEF_STR( On ) )
260260
261261   PORT_START("SSCOPE_BINOCULAR")
262   PORT_CONFNAME( 0x03, 0x00, "SegaScope - Binocular Hack" ) PORT_CONDITION("SEGASCOPE", 0x01, PORTCOND_EQUALS, 0x01)
262   PORT_CONFNAME( 0x03, 0x00, "SegaScope - Binocular Hack" ) PORT_CONDITION("SEGASCOPE", 0x01, EQUALS, 0x01)
263263   PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
264264   PORT_CONFSETTING( 0x01, "Left Lens" )
265265   PORT_CONFSETTING( 0x02, "Right Lens" )
266266   PORT_CONFSETTING( 0x03, "Both Lens" )
267   PORT_BIT( 0x03, 0x00, IPT_UNUSED ) PORT_CONDITION("SEGASCOPE", 0x01, PORTCOND_EQUALS, 0x00)
267   PORT_BIT( 0x03, 0x00, IPT_UNUSED ) PORT_CONDITION("SEGASCOPE", 0x01, EQUALS, 0x00)
268268INPUT_PORTS_END
269269
270270static INPUT_PORTS_START( smsj )
r15082r15083
277277
278278   PORT_START("TVDRAW_X")
279279   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_NAME("Tablet - X Axis") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1)
280   PORT_CONDITION("TVDRAW", 0x01, PORTCOND_EQUALS, 0x01)
280   PORT_CONDITION("TVDRAW", 0x01, EQUALS, 0x01)
281281
282282   PORT_START("TVDRAW_Y")
283283   PORT_BIT( 0xff, 0x60, IPT_LIGHTGUN_Y ) PORT_NAME("Tablet - Y Axis") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0, 191) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1)
284   PORT_CONDITION("TVDRAW", 0x01, PORTCOND_EQUALS, 0x01)
284   PORT_CONDITION("TVDRAW", 0x01, EQUALS, 0x01)
285285
286286   PORT_START("TVDRAW_PEN")
287   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Tablet - Pen") PORT_CONDITION("TVDRAW", 0x01, PORTCOND_EQUALS, 0x01)
287   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Tablet - Pen") PORT_CONDITION("TVDRAW", 0x01, EQUALS, 0x01)
288288INPUT_PORTS_END
289289
290290static INPUT_PORTS_START( gg )
src/mess/drivers/junior.c
r15082r15083
121121   switch( ( m_port_b >> 1 ) & 0x0f )
122122   {
123123   case 0:
124      data = input_port_read(machine(), "LINE0");
124      data = ioport("LINE0")->read();
125125      break;
126126   case 1:
127      data = input_port_read(machine(), "LINE1");
127      data = ioport("LINE1")->read();
128128      break;
129129   case 2:
130      data = input_port_read(machine(), "LINE2");
130      data = ioport("LINE2")->read();
131131      break;
132132   }
133133   return data;
src/mess/drivers/psx.c
r15082r15083
633633      {
634634         if( pad->n_byte < PAD_BYTES_STANDARD )
635635         {
636            pad->n_shiftout = input_port_read(machine, portnames[pad->n_byte + ( n_port * PAD_BYTES_STANDARD )]);
636            pad->n_shiftout = machine.root_device().ioport(portnames[pad->n_byte + ( n_port * PAD_BYTES_STANDARD )])->read();
637637            pad->n_byte++;
638638            b_ack = 1;
639639         }
src/mess/drivers/samcoupe.c
r15082r15083
140140   UINT8 data = 0xe0;
141141
142142   /* bit 5-7, keyboard input */
143   if (!BIT(offset,  8)) data &= input_port_read(machine(), "keyboard_row_fe") & 0xe0;
144   if (!BIT(offset,  9)) data &= input_port_read(machine(), "keyboard_row_fd") & 0xe0;
145   if (!BIT(offset, 10)) data &= input_port_read(machine(), "keyboard_row_fb") & 0xe0;
146   if (!BIT(offset, 11)) data &= input_port_read(machine(), "keyboard_row_f7") & 0xe0;
147   if (!BIT(offset, 12)) data &= input_port_read(machine(), "keyboard_row_ef") & 0xe0;
148   if (!BIT(offset, 13)) data &= input_port_read(machine(), "keyboard_row_df") & 0xe0;
149   if (!BIT(offset, 14)) data &= input_port_read(machine(), "keyboard_row_bf") & 0xe0;
150   if (!BIT(offset, 15)) data &= input_port_read(machine(), "keyboard_row_7f") & 0xe0;
143   if (!BIT(offset,  8)) data &= ioport("keyboard_row_fe")->read() & 0xe0;
144   if (!BIT(offset,  9)) data &= ioport("keyboard_row_fd")->read() & 0xe0;
145   if (!BIT(offset, 10)) data &= ioport("keyboard_row_fb")->read() & 0xe0;
146   if (!BIT(offset, 11)) data &= ioport("keyboard_row_f7")->read() & 0xe0;
147   if (!BIT(offset, 12)) data &= ioport("keyboard_row_ef")->read() & 0xe0;
148   if (!BIT(offset, 13)) data &= ioport("keyboard_row_df")->read() & 0xe0;
149   if (!BIT(offset, 14)) data &= ioport("keyboard_row_bf")->read() & 0xe0;
150   if (!BIT(offset, 15)) data &= ioport("keyboard_row_7f")->read() & 0xe0;
151151
152152   /* bit 0-4, interrupt source */
153153   data |= m_status;
r15082r15083
216216   UINT8 data = 0x1f;
217217
218218   /* bit 0-4, keyboard input */
219   if (!BIT(offset,  8)) data &= input_port_read(machine(), "keyboard_row_fe") & 0x1f;
220   if (!BIT(offset,  9)) data &= input_port_read(machine(), "keyboard_row_fd") & 0x1f;
221   if (!BIT(offset, 10)) data &= input_port_read(machine(), "keyboard_row_fb") & 0x1f;
222   if (!BIT(offset, 11)) data &= input_port_read(machine(), "keyboard_row_f7") & 0x1f;
223   if (!BIT(offset, 12)) data &= input_port_read(machine(), "keyboard_row_ef") & 0x1f;
224   if (!BIT(offset, 13)) data &= input_port_read(machine(), "keyboard_row_df") & 0x1f;
225   if (!BIT(offset, 14)) data &= input_port_read(machine(), "keyboard_row_bf") & 0x1f;
226   if (!BIT(offset, 15)) data &= input_port_read(machine(), "keyboard_row_7f") & 0x1f;
219   if (!BIT(offset,  8)) data &= ioport("keyboard_row_fe")->read() & 0x1f;
220   if (!BIT(offset,  9)) data &= ioport("keyboard_row_fd")->read() & 0x1f;
221   if (!BIT(offset, 10)) data &= ioport("keyboard_row_fb")->read() & 0x1f;
222   if (!BIT(offset, 11)) data &= ioport("keyboard_row_f7")->read() & 0x1f;
223   if (!BIT(offset, 12)) data &= ioport("keyboard_row_ef")->read() & 0x1f;
224   if (!BIT(offset, 13)) data &= ioport("keyboard_row_df")->read() & 0x1f;
225   if (!BIT(offset, 14)) data &= ioport("keyboard_row_bf")->read() & 0x1f;
226   if (!BIT(offset, 15)) data &= ioport("keyboard_row_7f")->read() & 0x1f;
227227
228228   if (offset == 0xff00)
229229   {
230      data &= input_port_read(machine(), "keyboard_row_ff") & 0x1f;
230      data &= ioport("keyboard_row_ff")->read() & 0x1f;
231231
232232      /* if no key has been pressed, return the mouse state */
233233      if (data == 0x1f)
src/mess/drivers/tutor.c
r15082r15083
281281   UINT8 value;
282282
283283   snprintf(port, ARRAY_LENGTH(port), "LINE%d", offset);
284   value = input_port_read(machine(), port);
284   value = ioport(port)->read();
285285
286286   /* hack for ports overlapping with joystick */
287287   if (offset == 4 || offset == 5)
288288   {
289289      snprintf(port, ARRAY_LENGTH(port), "LINE%d_alt", offset);
290      value |= input_port_read(machine(), port);
290      value |= ioport(port)->read();
291291   }
292292
293293   return value;
src/mess/drivers/z1013.c
r15082r15083
242242{
243243   char kbdrow[6];
244244   sprintf(kbdrow,"X%d", m_keyboard_line & 7);
245   UINT8 data = input_port_read(machine(), kbdrow);
245   UINT8 data = ioport(kbdrow)->read();
246246
247247   if (m_keyboard_part)
248248      data >>= 4;
src/mess/drivers/comx35.c
r15082r15083
140140
141141INPUT_CHANGED_MEMBER( comx35_state::trigger_reset )
142142{
143   if (newval && BIT(input_port_read(machine(), "D6"), 7))
143   if (newval && BIT(ioport("D6")->read(), 7))
144144   {
145145      machine_reset();
146146   }
r15082r15083
361361
362362READ_LINE_MEMBER( comx35_state::shift_r )
363363{
364   return BIT(input_port_read(machine(), "MODIFIERS"), 0);
364   return BIT(ioport("MODIFIERS")->read(), 0);
365365}
366366
367367READ_LINE_MEMBER( comx35_state::control_r )
368368{
369   return BIT(input_port_read(machine(), "MODIFIERS"), 1);
369   return BIT(ioport("MODIFIERS")->read(), 1);
370370}
371371
372372static CDP1871_INTERFACE( kbc_intf )
src/mess/drivers/digel804.c
r15082r15083
133133   machine.scheduler().timer_set(attotime::from_hz(10000), FUNC(ep804_kbd_callback));
134134    // 74C923 4 by 5 key encoder.
135135    // if previous key is still held, bail out
136   if (input_port_read(machine, keynames[state->m_kbd_row]))
137      if (state->digel804_convert_col_to_bin(input_port_read(machine, keynames[state->m_kbd_row]), state->m_kbd_row) == state->m_kbd)
136   if (machine.root_device().ioport(keynames[state->m_kbd_row])->read())
137      if (state->digel804_convert_col_to_bin(machine.root_device().ioport(keynames[state->m_kbd_row])->read(), state->m_kbd_row) == state->m_kbd)
138138         return;
139139
140140   state->m_kbd_row++;
141141   state->m_kbd_row &= 3;
142142
143143   /* see if a key pressed */
144   if (input_port_read(machine, keynames[state->m_kbd_row]))
144   if (machine.root_device().ioport(keynames[state->m_kbd_row])->read())
145145   {
146146      fprintf(stderr,"DEBUG: key was pressed!\n");
147      state->m_kbd = state->digel804_convert_col_to_bin(input_port_read(machine, keynames[state->m_kbd_row]), state->m_kbd_row);
147      state->m_kbd = state->digel804_convert_col_to_bin(machine.root_device().ioport(keynames[state->m_kbd_row])->read(), state->m_kbd_row);
148148      state->m_key_intq = 0;
149149      cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);//ASSERT_LINE);
150150   }
src/mess/drivers/tiki100.c
r15082r15083
9797READ8_MEMBER( tiki100_state::keyboard_r )
9898{
9999   static const char *const keynames[] = { "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9", "ROW10", "ROW11", "ROW12" };
100   UINT8 data = input_port_read(machine(), keynames[m_keylatch]);
100   UINT8 data = ioport(keynames[m_keylatch])->read();
101101
102102   m_keylatch++;
103103
src/mess/drivers/pockstat.c
r15082r15083
769769
770770static INPUT_CHANGED( input_update )
771771{
772   UINT32 buttons = input_port_read(field.machine(), "BUTTONS");
772   UINT32 buttons = field.machine().root_device().ioport("BUTTONS")->read();
773773
774774   ps_intc_set_interrupt_line(field.machine(), PS_INT_BTN_ACTION, (buttons &  1) ? 1 : 0);
775775   ps_intc_set_interrupt_line(field.machine(), PS_INT_BTN_RIGHT,   (buttons &  2) ? 1 : 0);
src/mess/drivers/homez80.c
r15082r15083
4949{
5050   char kbdrow[8];
5151   sprintf(kbdrow,"LINE%d",offset);
52   return input_port_read(machine(), kbdrow);
52   return ioport(kbdrow)->read();
5353}
5454
5555static ADDRESS_MAP_START(homez80_mem, AS_PROGRAM, 8, homez80_state)
src/mess/drivers/vcs80.c
r15082r15083
146146   data |= m_keylatch;
147147
148148   /* keyboard rows */
149   data |= BIT(input_port_read(machine(), "ROW0"), m_keylatch) << 4;
150   data |= BIT(input_port_read(machine(), "ROW1"), m_keylatch) << 5;
151   data |= BIT(input_port_read(machine(), "ROW2"), m_keylatch) << 6;
149   data |= BIT(ioport("ROW0")->read(), m_keylatch) << 4;
150   data |= BIT(ioport("ROW1")->read(), m_keylatch) << 5;
151   data |= BIT(ioport("ROW2")->read(), m_keylatch) << 6;
152152
153153   /* demultiplexer clock */
154154   data |= (m_keyclk << 7);
src/mess/drivers/csc.c
r15082r15083
5757      "COL_F", "COL_G", "COL_H", "COL_I"
5858   };
5959
60   return input_port_read(machine(), col_tag[index]);
60   return ioport(col_tag[index])->read();
6161}
6262
6363
src/mess/drivers/amstr_pc.c
r15082r15083
132132static INPUT_PORTS_START( pc200 )
133133   PORT_START("IN0") /* IN0 */
134134   PORT_BIT ( 0xf0, 0xf0,    IPT_UNUSED )
135   PORT_BIT ( 0x08, 0x08,    IPT_VBLANK )
135   PORT_BIT ( 0x08, 0x08,    IPT_CUSTOM ) PORT_VBLANK("screen")
136136   PORT_BIT ( 0x07, 0x07,    IPT_UNUSED )
137137
138138   PORT_START("DSW0") /* IN1 */
src/mess/drivers/x07.c
r15082r15083
5959      {
6060         UINT8 data;
6161
62         switch (input_port_read(machine(), "S1") & 0x3c)
62         switch (ioport("S1")->read() & 0x3c)
6363         {
6464            case 0x04:      data = 0x33;   break;   //right
6565            case 0x08:      data = 0x37;   break;   //left
r15082r15083
7373
7474   case 0x03:   //STRIG(0)
7575      {
76         m_out.data[m_out.write++] = (input_port_read(machine(), "S6") & 0x20 ? 0x00 : 0xff);
76         m_out.data[m_out.write++] = (ioport("S6")->read() & 0x20 ? 0x00 : 0xff);
7777      }
7878      break;
7979
8080   case 0x04:   //STRIG(1)
8181      {
82         m_out.data[m_out.write++] = (input_port_read(machine(), "S1") & 0x40 ? 0x00 : 0xff);
82         m_out.data[m_out.write++] = (ioport("S1")->read() & 0x40 ? 0x00 : 0xff);
8383      }
8484      break;
8585
r15082r15083
9393         if(address == 0xc00e)
9494            data = 0x0a;
9595         else if(address == 0xd000)
96            data = input_port_read(machine(), "BATTERY");
96            data = ioport("BATTERY")->read();
9797         else
9898            data = m_t6834_ram[address & 0x7ff];
9999
r15082r15083
415415
416416         for (int i=0 ;i<10; i++)
417417            if (matrix & (1<<i))
418               data |= input_port_read(machine(), lines[i]);
418               data |= ioport(lines[i])->read();
419419
420420         m_out.data[m_out.write++] = data;
421421      }
r15082r15083
424424   case 0x28:   //test chr
425425      {
426426         UINT8 idx = kb_get_index(m_in.data[m_in.read++]);
427         m_out.data[m_out.write++] = (input_port_read(machine(), x07_keycodes[idx].tag) & x07_keycodes[idx].mask) ? 0x00 : 0xff;
427         m_out.data[m_out.write++] = (ioport(x07_keycodes[idx].tag)->read() & x07_keycodes[idx].mask) ? 0x00 : 0xff;
428428      }
429429      break;
430430
r15082r15083
911911
912912   if (m_kb_on && newval)
913913   {
914      UINT8 shift = (input_port_read(machine(), "A1") & 0x01);
914      UINT8 shift = (ioport("A1")->read() & 0x01);
915915      UINT16 udk_s = udk_offset[(shift*6) +  idx - 1];
916916
917917      /* First 3 chars are used for description */
r15082r15083
932932INPUT_CHANGED_MEMBER( x07_state::kb_keys )
933933{
934934   UINT8 modifier;
935   UINT8 a1 = input_port_read(field.machine(), "A1");
936   UINT8 bz = input_port_read(field.machine(), "BZ");
935   UINT8 a1 = field.machine().root_device().ioport("A1")->read();
936   UINT8 bz = field.machine().root_device().ioport("BZ")->read();
937937   UINT8 keycode = (UINT8)(FPTR)param;
938938
939939   if (m_kb_on && !newval)
r15082r15083
10311031   if (m_draw_udk)
10321032      for(i = 0, x = 0; i < 5; i++)
10331033      {
1034         UINT16 ofs = udk_offset[i + ((input_port_read(machine(), "A1")&0x01) ? 6 : 0)];
1034         UINT16 ofs = udk_offset[i + ((ioport("A1")->read()&0x01) ? 6 : 0)];
10351035         draw_char(x++, 3, 0x83);
10361036         for(j = 0; j < 3; j++)
10371037            draw_char(x++, 3, m_t6834_ram[ofs++]);
r15082r15083
14871487   m_prn_char_code = 0;
14881488   m_prn_size = 0;
14891489
1490   m_regs_r[2] = input_port_read(machine(), "CARDBATTERY");
1490   m_regs_r[2] = ioport("CARDBATTERY")->read();
14911491
14921492   cpu_set_reg(m_maincpu, Z80_PC, 0xc3c3);
14931493}
src/mess/drivers/nanos.c
r15082r15083
367367   int i;
368368   UINT8 code;
369369   UINT8 key_code = 0;
370   UINT8 shift = input_port_read(timer.machine(), "LINEC") & 0x02 ? 1 : 0;
371   UINT8 ctrl =  input_port_read(timer.machine(), "LINEC") & 0x01 ? 1 : 0;
370   UINT8 shift = timer.machine().root_device().ioport("LINEC")->read() & 0x02 ? 1 : 0;
371   UINT8 ctrl =  timer.machine().root_device().ioport("LINEC")->read() & 0x01 ? 1 : 0;
372372   state->m_key_pressed = 0xff;
373373   for(i = 0; i < 7; i++)
374374   {
375375
376      code =   input_port_read(timer.machine(), keynames[i]);
376      code =   timer.machine().root_device().ioport(keynames[i])->read();
377377      if (code != 0)
378378      {
379379         if (i==0 && shift==0) {
src/mess/drivers/amico2k.c
r15082r15083
126126
127127   switch (m_ls145_p)
128128   {
129   case 0:      return input_port_read(machine(), "Q0");
130   case 1:      return input_port_read(machine(), "Q1");
131   case 2:      return input_port_read(machine(), "Q2");
129   case 0:      return ioport("Q0")->read();
130   case 1:      return ioport("Q1")->read();
131   case 2:      return ioport("Q2")->read();
132132   default:   return 0xff;
133133   }
134134}
src/mess/drivers/huebler.c
r15082r15083
3434{
3535   static const char *const keynames[] = { "Y0", "Y1", "Y2", "Y3", "Y4", "Y5", "Y6", "Y7", "Y8", "Y9", "Y10", "Y11", "Y12", "Y13", "Y14", "Y15" };
3636
37   UINT8 data = input_port_read(machine(), keynames[m_key_a8 ? m_key_d6 : m_key_d7]);
37   UINT8 data = ioport(keynames[m_key_a8 ? m_key_d6 : m_key_d7])->read();
3838
3939   int a8 = (data & 0x0f) == 0x0f;
4040
r15082r15083
7878
7979    */
8080
81   UINT8 special = input_port_read(machine(), "SPECIAL");
81   UINT8 special = ioport("SPECIAL")->read();
8282
8383   int ctrl = BIT(special, 0);
8484   int shift = BIT(special, 2) & BIT(special, 1);
src/mess/drivers/fm7.c
r15082r15083
745745
746746   ret |= 0x70;
747747
748   if(input_port_read(machine(),"config") & 0x01)
748   if(ioport("config")->read() & 0x01)
749749   {
750750      ret |= 0x0f;
751751      pdata = centronics->read(space, 0);
752752      for(x=0;x<6;x++)
753753      {
754754         if(~pdata & (1<<x))
755            if(input_port_read(machine(),"lptjoy") & (1 << x))
755            if(ioport("lptjoy")->read() & (1 << x))
756756               ret &= ~0x08;
757757      }
758758   }
r15082r15083
808808{
809809   UINT8 ret = 0xff;
810810
811   if(input_port_read(machine(),"DSW") & 0x02)
811   if(ioport("DSW")->read() & 0x02)
812812      ret &= ~0x01;
813813
814814   return 0xff;
r15082r15083
874874            break;
875875         case 0x09:
876876            // Joystick port read
877            state->m_psg_data = input_port_read(space->machine(),"joy1");
877            state->m_psg_data = space->machine().root_device().ioport("joy1")->read();
878878            break;
879879      }
880880   }
r15082r15083
943943
944944static READ8_DEVICE_HANDLER( fm77av_joy_1_r )
945945{
946   return input_port_read(device->machine(),"joy1");
946   return device->machine().root_device().ioport("joy1")->read();
947947}
948948
949949static READ8_DEVICE_HANDLER( fm77av_joy_2_r )
950950{
951   return input_port_read(device->machine(),"joy2");
951   return device->machine().root_device().ioport("joy2")->read();
952952}
953953
954954READ8_MEMBER(fm7_state::fm7_unknown_r)
r15082r15083
12491249   int bit = 0;
12501250   int x,y;
12511251   UINT32 keys;
1252   UINT32 modifiers = input_port_read(machine,"key_modifiers");
1252   UINT32 modifiers = machine.root_device().ioport("key_modifiers")->read();
12531253   static const UINT16 modscancodes[6] = { 0x52, 0x53, 0x54, 0x55, 0x56, 0x5a };
12541254
12551255   for(x=0;x<3;x++)
12561256   {
1257      keys = input_port_read(machine,portnames[x]);
1257      keys = machine.root_device().ioport(portnames[x])->read();
12581258
12591259      for(y=0;y<32;y++)  // loop through each bit in the port
12601260      {
r15082r15083
12961296   int bit = 0;
12971297   int mod = 0;
12981298   UINT32 keys;
1299   UINT32 modifiers = input_port_read(machine,"key_modifiers");
1299   UINT32 modifiers = machine.root_device().ioport("key_modifiers")->read();
13001300
1301   if(input_port_read(machine,"key3") & 0x40000)
1301   if(machine.root_device().ioport("key3")->read() & 0x40000)
13021302   {
13031303      state->m_break_flag = 1;
13041304      cputag_set_input_line(machine,"maincpu",M6809_FIRQ_LINE,ASSERT_LINE);
r15082r15083
13271327
13281328   for(x=0;x<3;x++)
13291329   {
1330      keys = input_port_read(machine,portnames[x]);
1330      keys = machine.root_device().ioport(portnames[x])->read();
13311331
13321332      for(y=0;y<32;y++)  // loop through each bit in the port
13331333      {
r15082r15083
19561956   // set boot mode (FM-7 only, AV and later has boot RAM instead)
19571957   if(state->m_type == SYS_FM7)
19581958   {
1959      if(!(input_port_read(machine,"DSW") & 0x02))
1959      if(!(machine.root_device().ioport("DSW")->read() & 0x02))
19601960      {  // DOS mode
19611961         state->membank("bank17")->set_base(machine.root_device().memregion("dos")->base());
19621962      }
src/mess/drivers/jr100.c
r15082r15083
229229   jr100_state *state = device->machine().driver_data<jr100_state>();
230230   UINT8 val = 0x1f;
231231   if (keynames[state->m_keyboard_line]) {
232      val = input_port_read(device->machine(), keynames[state->m_keyboard_line]);
232      val = state->ioport(keynames[state->m_keyboard_line])->read();
233233   }
234234   return val;
235235}
src/mess/drivers/vidbrain.c
r15082r15083
8585
8686    */
8787
88   UINT8 data = 0;//input_port_read(machine, "JOY-R");
88   UINT8 data = 0;//machine.root_device().ioport("JOY-R")->read();
8989
90   if (BIT(m_keylatch, 0)) data |= input_port_read(machine(), "IO00");
91   if (BIT(m_keylatch, 1)) data |= input_port_read(machine(), "IO01");
92   if (BIT(m_keylatch, 2)) data |= input_port_read(machine(), "IO02");
93   if (BIT(m_keylatch, 3)) data |= input_port_read(machine(), "IO03");
94   if (BIT(m_keylatch, 4)) data |= input_port_read(machine(), "IO04");
95   if (BIT(m_keylatch, 5)) data |= input_port_read(machine(), "IO05");
96   if (BIT(m_keylatch, 6)) data |= input_port_read(machine(), "IO06");
97   if (BIT(m_keylatch, 7)) data |= input_port_read(machine(), "IO07");
98   if (!BIT(m_cmd, 4)) data |= input_port_read(machine(), "UV201-31");
90   if (BIT(m_keylatch, 0)) data |= ioport("IO00")->read();
91   if (BIT(m_keylatch, 1)) data |= ioport("IO01")->read();
92   if (BIT(m_keylatch, 2)) data |= ioport("IO02")->read();
93   if (BIT(m_keylatch, 3)) data |= ioport("IO03")->read();
94   if (BIT(m_keylatch, 4)) data |= ioport("IO04")->read();
95   if (BIT(m_keylatch, 5)) data |= ioport("IO05")->read();
96   if (BIT(m_keylatch, 6)) data |= ioport("IO06")->read();
97   if (BIT(m_keylatch, 7)) data |= ioport("IO07")->read();
98   if (!BIT(m_cmd, 4)) data |= ioport("UV201-31")->read();
9999
100100   return data;
101101}
src/mess/drivers/slc1.c
r15082r15083
131131   if (m_kbd_type)
132132   { // Trainer
133133      if (upper == 3)
134         data &= input_port_read(machine(), "Y0");
134         data &= ioport("Y0")->read();
135135      else
136136      if (upper == 4)
137         data &= input_port_read(machine(), "Y1");
137         data &= ioport("Y1")->read();
138138      else
139139      if (upper == 5)
140         data &= input_port_read(machine(), "Y2");
140         data &= ioport("Y2")->read();
141141   }
142142   else
143143   { // Chess
144144      if (upper == 3)
145         data &= input_port_read(machine(), "X0");
145         data &= ioport("X0")->read();
146146      else
147147      if (upper == 4)
148         data &= input_port_read(machine(), "X1");
148         data &= ioport("X1")->read();
149149      else
150150      if (upper == 5)
151         data &= input_port_read(machine(), "X2");
151         data &= ioport("X2")->read();
152152   }
153153
154154   return data;
src/mess/drivers/babbage.c
r15082r15083
234234   for (i = 0; i < 4; i++)
235235   {
236236      sprintf(kbdrow,"X%X",i);
237      inp = input_port_read(timer.machine(), kbdrow);
237      inp = timer.machine().root_device().ioport(kbdrow)->read();
238238
239239      for (j = 0; j < 5; j++)
240240         if (BIT(inp, j))
src/mess/drivers/esq1.c
r15082r15083
133133   esq1_state *state = device->machine().driver_data<esq1_state>();
134134//  printf("DP [%02x]: %d mlo %d mhi %d tape %d\n", data, data&1, (data>>4)&1, (data>>5)&1, (data>>6)&3);
135135//  printf("[%02x] bank %d => offset %x (PC=%x)\n", data, bank, bank * 0x1000, cpu_get_pc(device->machine().firstcpu));
136   state->membank("osbank")->set_base(device->machine().root_device().memregion("osrom")->base() + (bank * 0x1000) );
136   state->membank("osbank")->set_base(state->memregion("osrom")->base() + (bank * 0x1000) );
137137}
138138
139139static void duart_tx(device_t *device, int channel, UINT8 data)
src/mess/drivers/ami1200.c
r15082r15083
247247
248248static READ8_DEVICE_HANDLER( a1200_cia_0_portA_r )
249249{
250   UINT8 ret = input_port_read(device->machine(), "CIA0PORTA") & 0xc0;   /* Gameport 1 and 0 buttons */
250   UINT8 ret = device->machine().root_device().ioport("CIA0PORTA")->read() & 0xc0;   /* Gameport 1 and 0 buttons */
251251   ret |= device->machine().device<amiga_fdc>("fdc")->ciaapra_r();
252252   return ret;
253253}
src/mess/drivers/hp49gp.c
r15082r15083
192192      case S3C2410_GPIO_PORT_G :
193193      {
194194         data = data & ~0xFF00;
195         if ((data & 0x02) == 0) data |= (input_port_read( device->machine(), "ROW1") << 8);
196         if ((data & 0x04) == 0) data |= (input_port_read( device->machine(), "ROW2") << 8);
197         if ((data & 0x08) == 0) data |= (input_port_read( device->machine(), "ROW3") << 8);
198         if ((data & 0x10) == 0) data |= (input_port_read( device->machine(), "ROW4") << 8);
199         if ((data & 0x20) == 0) data |= (input_port_read( device->machine(), "ROW5") << 8);
200         if ((data & 0x40) == 0) data |= (input_port_read( device->machine(), "ROW6") << 8);
201         if ((data & 0x80) == 0) data |= (input_port_read( device->machine(), "ROW7") << 8);
195         if ((data & 0x02) == 0) data |= (device->machine().root_device().ioport( "ROW1")->read() << 8);
196         if ((data & 0x04) == 0) data |= (device->machine().root_device().ioport( "ROW2")->read() << 8);
197         if ((data & 0x08) == 0) data |= (device->machine().root_device().ioport( "ROW3")->read() << 8);
198         if ((data & 0x10) == 0) data |= (device->machine().root_device().ioport( "ROW4")->read() << 8);
199         if ((data & 0x20) == 0) data |= (device->machine().root_device().ioport( "ROW5")->read() << 8);
200         if ((data & 0x40) == 0) data |= (device->machine().root_device().ioport( "ROW6")->read() << 8);
201         if ((data & 0x80) == 0) data |= (device->machine().root_device().ioport( "ROW7")->read() << 8);
202202      }
203203      break;
204204      case S3C2410_GPIO_PORT_H :
src/mess/drivers/trs80m2.c
r15082r15083
7575   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8" };
7676   int table = 0, row, col;
7777
78   if (input_port_read(machine(), "ROW9") & 0x07)
78   if (ioport("ROW9")->read() & 0x07)
7979   {
8080      // shift, upper case
8181      table = 1;
8282   }
8383
84   if (input_port_read(machine(), "ROW9") & 0x18)
84   if (ioport("ROW9")->read() & 0x18)
8585   {
8686      // ctrl
8787      table = 2;
r15082r15083
9090   // scan keyboard
9191   for (row = 0; row < 9; row++)
9292   {
93      UINT8 data = input_port_read(machine(), keynames[row]);
93      UINT8 data = ioport(keynames[row])->read();
9494
9595      for (col = 0; col < 8; col++)
9696      {
src/mess/drivers/m5.c
r15082r15083
7373   data |= m_centronics->busy_r() << 1;
7474
7575   // RESET key
76   data |= input_port_read(machine(), "RESET");
76   data |= ioport("RESET")->read();
7777
7878   return data;
7979}
src/mess/drivers/pdp11.c
r15082r15083
263263static MACHINE_RESET(pdp11ub2)
264264{
265265   // Load M9312
266   UINT8* user1 = machine.root_device().memregion("consproms")->base() + input_port_read(machine,"CONSPROM") * 0x0400;
266   UINT8* user1 = machine.root_device().memregion("consproms")->base() + machine.root_device().ioport("CONSPROM")->read() * 0x0400;
267267   UINT8* maincpu = machine.root_device().memregion("maincpu")->base();
268268
269269   //0165000
270270   load9312prom(maincpu + 0165000,user1,0x100);
271271
272   UINT8 s1 = input_port_read(machine,"S1");
272   UINT8 s1 = machine.root_device().ioport("S1")->read();
273273
274274   if (s1 & 0x02) { // if boot enabled
275275      UINT16 addr = 0173000;
276276      if (s1 & 1) {
277277         addr = 0165000;
278278      }
279      addr += input_port_read(machine,"S1_2") * 2;
279      addr += machine.root_device().ioport("S1_2")->read() * 2;
280280      cpu_set_reg(machine.device("maincpu"), T11_PC, addr);
281281   }
282282
283283   //0173000
284   load9312prom(maincpu + 0173000,machine.root_device().memregion("devproms")->base() + input_port_read(machine,"DEVPROM1") * 0x0200,0x080);
284   load9312prom(maincpu + 0173000,machine.root_device().memregion("devproms")->base() + machine.root_device().ioport("DEVPROM1")->read() * 0x0200,0x080);
285285   //0173200
286   load9312prom(maincpu + 0173200,machine.root_device().memregion("devproms")->base() + input_port_read(machine,"DEVPROM2") * 0x0200,0x080);
286   load9312prom(maincpu + 0173200,machine.root_device().memregion("devproms")->base() + machine.root_device().ioport("DEVPROM2")->read() * 0x0200,0x080);
287287   //0173400
288   load9312prom(maincpu + 0173400,machine.root_device().memregion("devproms")->base() + input_port_read(machine,"DEVPROM3") * 0x0200,0x080);
288   load9312prom(maincpu + 0173400,machine.root_device().memregion("devproms")->base() + machine.root_device().ioport("DEVPROM3")->read() * 0x0200,0x080);
289289   //0173600
290   load9312prom(maincpu + 0173600,machine.root_device().memregion("devproms")->base() + input_port_read(machine,"DEVPROM4") * 0x0200,0x080);
290   load9312prom(maincpu + 0173600,machine.root_device().memregion("devproms")->base() + machine.root_device().ioport("DEVPROM4")->read() * 0x0200,0x080);
291291
292292}
293293
src/mess/drivers/pv1000.c
r15082r15083
106106      data = 0;
107107      if ( m_io_regs[5] & 0x08 )
108108      {
109         data = input_port_read( machine(), "IN3" );
109         data = ioport( "IN3" )->read();
110110      }
111111      if ( m_io_regs[5] & 0x04 )
112112      {
113         data = input_port_read( machine(), "IN2" );
113         data = ioport( "IN2" )->read();
114114      }
115115      if ( m_io_regs[5] & 0x02 )
116116      {
117         data = input_port_read( machine(), "IN1" );
117         data = ioport( "IN1" )->read();
118118      }
119119      if ( m_io_regs[5] & 0x01 )
120120      {
121         data = input_port_read( machine(), "IN0" );
121         data = ioport( "IN0" )->read();
122122      }
123123      m_fd_data = 0;
124124      break;
src/mess/drivers/palmz22.c
r15082r15083
159159      break;
160160      case S3C2410_GPIO_PORT_F :
161161      {
162         data = (data & ~0xFF) | (input_port_read( device->machine(), "PORT-F") & 0xFF);
162         data = (data & ~0xFF) | (device->machine().root_device().ioport( "PORT-F")->read() & 0xFF);
163163      }
164164      break;
165165      case S3C2410_GPIO_PORT_G :
r15082r15083
213213   {
214214      case 0 + 0 : data = 0x2EE + (PALM_Z22_BATTERY_LEVEL * 0xFF / 100); break;
215215      case 0 + 1 : data = 0; break;
216      case 2 + 0 : data = input_port_read( device->machine(), "PENX"); break;
217      case 2 + 1 : data = 0x3FF - input_port_read( device->machine(), "PENY"); break;
216      case 2 + 0 : data = device->machine().root_device().ioport( "PENX")->read(); break;
217      case 2 + 1 : data = 0x3FF - device->machine().root_device().ioport( "PENY")->read(); break;
218218   }
219219   verboselog( device->machine(), 5,  "s3c2410_adc_data_r %08X\n", data);
220220   return data;
src/mess/drivers/a5105.c
r15082r15083
157157                                           "KEY8", "KEY9", "KEYA", "UNUSED",
158158                                           "UNUSED", "UNUSED", "UNUSED", "UNUSED" };
159159
160   return input_port_read(machine(), keynames[m_key_mux & 0x0f]);
160   return ioport(keynames[m_key_mux & 0x0f])->read();
161161}
162162
163163READ8_MEMBER( a5105_state::key_mux_r )
src/mess/drivers/mac.c
r15082r15083
115115         if (m_model != MODEL_MAC_CLASSIC_II)
116116         {
117117            // Color Classic has no MONTYPE so the safe read gets us 512x384, which is right
118            if (input_port_read_safe(space.machine(), "MONTYPE", 2) == 1)
118            if (space.machine().root_device().ioport("MONTYPE")->read_safe(2) == 1)
119119            {
120120               palette_set_color(space.machine(), m_rbv_clutoffs, MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]));
121121               m_rbv_palette[m_rbv_clutoffs] = MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]);
r15082r15083
151151         if (m_model != MODEL_MAC_CLASSIC_II)
152152         {
153153            // Color Classic has no MONTYPE so the safe read gets us 512x384, which is right
154            if (input_port_read_safe(space.machine(), "MONTYPE", 2) == 1)
154            if (space.machine().root_device().ioport("MONTYPE")->read_safe(2) == 1)
155155            {
156156               palette_set_color(space.machine(), m_rbv_clutoffs, MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]));
157157               m_rbv_palette[m_rbv_clutoffs] = MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]);
r15082r15083
239239      if (offset == 0x10)
240240      {
241241         data &= ~0x38;
242         data |= (input_port_read_safe(space.machine(), "MONTYPE", 2)<<3);
242         data |= (space.machine().root_device().ioport("MONTYPE")->read_safe(2)<<3);
243243//            printf("rbv_r montype: %02x (PC %x)\n", data, cpu_get_pc(space.cpu));
244244      }
245245
src/mess/drivers/nc.c
r15082r15083
384384            state->membank(bank1)->set_base(addr);
385385
386386            /* write enabled? */
387            if (input_port_read(machine, "EXTRA") & 0x02)
387            if (machine.root_device().ioport("EXTRA")->read() & 0x02)
388388            {
389389               /* yes */
390390               state->membank(bank5)->set_base(addr);
r15082r15083
499499   int inputport_10_state;
500500   int changed_bits;
501501
502   inputport_10_state = input_port_read(timer.machine(), "EXTRA");
502   inputport_10_state = timer.machine().root_device().ioport("EXTRA")->read();
503503
504504   changed_bits = inputport_10_state^state->m_previous_inputport_10_state;
505505
r15082r15083
553553   state->m_memory_config[2] = 0;
554554   state->m_memory_config[3] = 0;
555555
556   state->m_previous_inputport_10_state = input_port_read(machine, "EXTRA");
556   state->m_previous_inputport_10_state = machine.root_device().ioport("EXTRA")->read();
557557
558558   /* setup reset state ints are masked */
559559   state->m_irq_mask = 0;
r15082r15083
670670      nc_update_interrupts(machine());
671671   }
672672
673   return input_port_read(machine(), keynames[offset]);
673   return ioport(keynames[offset])->read();
674674}
675675
676676
r15082r15083
987987      nc_card_battery_status &=~(1<<7);
988988   }
989989
990   if (input_port_read(machine(), "EXTRA") & 0x02)
990   if (ioport("EXTRA")->read() & 0x02)
991991   {
992992      /* card write enable */
993993      nc_card_battery_status &=~(1<<6);
r15082r15083
13861386      nc_card_battery_status&=~(1<<7);
13871387   }
13881388
1389   if (input_port_read(machine(), "EXTRA") & 0x02)
1389   if (ioport("EXTRA")->read() & 0x02)
13901390   {
13911391      /* card write enable */
13921392      nc_card_battery_status &=~(1<<6);
src/mess/drivers/bw12.c
r15082r15083
579579
580580READ_LINE_MEMBER( bw12_state::ay3600_shift_r )
581581{
582   return BIT(input_port_read(machine(), "MODIFIERS"), 0);
582   return BIT(ioport("MODIFIERS")->read(), 0);
583583}
584584
585585READ_LINE_MEMBER( bw12_state::ay3600_control_r )
586586{
587   return BIT(input_port_read(machine(), "MODIFIERS"), 1);
587   return BIT(ioport("MODIFIERS")->read(), 1);
588588}
589589
590590WRITE_LINE_MEMBER( bw12_state::ay3600_data_ready_w )
src/mess/drivers/et3400.c
r15082r15083
3535   UINT8 data = 0xff;
3636
3737   if (~offset & 4)
38      data &= input_port_read(machine(), "X2");
38      data &= ioport("X2")->read();
3939   if (~offset & 2)
40      data &= input_port_read(machine(), "X1");
40      data &= ioport("X1")->read();
4141   if (~offset & 1)
42      data &= input_port_read(machine(), "X0");
42      data &= ioport("X0")->read();
4343
4444   return data;
4545}
src/mess/drivers/pk8000.c
r15082r15083
108108   if(state->m_keyboard_line>9) {
109109      return 0xff;
110110   }
111   return input_port_read(device->machine(),keynames[state->m_keyboard_line]);
111   return device->machine().root_device().ioport(keynames[state->m_keyboard_line])->read();
112112}
113113
114114static WRITE8_DEVICE_HANDLER(pk8000_80_portc_w)
r15082r15083
161161READ8_MEMBER(pk8000_state::pk8000_joy_1_r)
162162{
163163   UINT8 retVal = (cassette_device_image(machine())->input() > 0.0038 ? 0x80 : 0);
164   retVal |= input_port_read(machine(), "JOY1") & 0x7f;
164   retVal |= ioport("JOY1")->read() & 0x7f;
165165   return retVal;
166166}
167167READ8_MEMBER(pk8000_state::pk8000_joy_2_r)
168168{
169169   UINT8 retVal = (cassette_device_image(machine())->input() > 0.0038 ? 0x80 : 0);
170   retVal |= input_port_read(machine(), "JOY2") & 0x7f;
170   retVal |= ioport("JOY2")->read() & 0x7f;
171171   return retVal;
172172}
173173
src/mess/drivers/prestige.c
r15082r15083
154154      break;
155155
156156   case 5:
157      if (input_port_read(machine(), "CART_TYPE") == 0x01)
157      if (ioport("CART_TYPE")->read() == 0x01)
158158      {
159159         //cartridge memory is writable
160160         if (data & 0x08)
r15082r15083
199199
200200   for (int line=0; line<8; line++)
201201      if (!(m_kb_matrix & (1<<line)))
202         data &= input_port_read(machine(), bitnames[offset][line]);
202         data &= ioport(bitnames[offset][line])->read();
203203
204204   return data;
205205}
r15082r15083
216216   switch( offset )
217217   {
218218      case 0:      //x-axis
219         data = (input_port_read(machine(), "MOUSEX") - m_mousex);
219         data = (ioport("MOUSEX")->read() - m_mousex);
220220         break;
221221      case 1:      //y-axis
222         data = (input_port_read(machine(), "MOUSEY") - m_mousey);
222         data = (ioport("MOUSEY")->read() - m_mousey);
223223         break;
224224   }
225225
r15082r15083
231231   switch( offset )
232232   {
233233      case 0:      //x-axis
234         m_mousex = input_port_read(machine(), "MOUSEX");
234         m_mousex = ioport("MOUSEX")->read();
235235         break;
236236      case 1:      //y-axis
237         m_mousey = input_port_read(machine(), "MOUSEY");
237         m_mousey = ioport("MOUSEY")->read();
238238         break;
239239   }
240240}
src/mess/drivers/okean240.c
r15082r15083
100100   for (i = 0; i < 11; i++)
101101   {
102102      sprintf(kbdrow,"X%X",i);
103      j = input_port_read(machine(), kbdrow);
103      j = ioport(kbdrow)->read();
104104      if (j)
105105         return (machine().rand() & 0x10) | 2;
106106   }
r15082r15083
137137      for (i = 0; i < 11; i++)
138138      {
139139         sprintf(kbdrow,"X%X",i);
140         j = input_port_read(machine(), kbdrow);
140         j = ioport(kbdrow)->read();
141141         if (j)
142142         {
143143            if (j==m_j) return 0;
r15082r15083
151151   else
152152   if (offset == 1) // port 41 bits 6&7 (modifier keys), and bit 1 (test rom status bit)
153153   {
154      return (machine().rand() & 2) | input_port_read(machine(), "MODIFIERS");
154      return (machine().rand() & 2) | ioport("MODIFIERS")->read();
155155   }
156156   else // port 42 (get a row)
157157   {
158158      for (i = 0; i < 11; i++)
159159      {
160160         sprintf(kbdrow,"X%X",i);
161         if (input_port_read(machine(), kbdrow) )
161         if (ioport(kbdrow)->read() )
162162            return i;
163163      }
164164   }
src/mess/drivers/ngp.c
r15082r15083
209209   switch( offset )
210210   {
211211   case 0x30:   /* Read controls */
212      data = input_port_read( machine(), "Controls" );
212      data = ioport( "Controls" )->read();
213213      break;
214214   case 0x31:
215      data = input_port_read( machine(), "Power" ) & 0x01;
215      data = ioport( "Power" )->read() & 0x01;
216216      /* Sub-batttery OK */
217217      data |= 0x02;
218218      break;
r15082r15083
558558   if ( state->m_io_reg[0x33] & 0x04 )
559559   {
560560      device_set_input_line( state->m_tlcs900, TLCS900_NMI,
561         (input_port_read(field.machine(), "Power") & 0x01 ) ? CLEAR_LINE : ASSERT_LINE );
561         (field.machine().root_device().ioport("Power")->read() & 0x01 ) ? CLEAR_LINE : ASSERT_LINE );
562562   }
563563}
564564
src/mess/drivers/nes.c
r15082r15083
5656
5757static INPUT_PORTS_START( nes_controllers )
5858   PORT_START("PAD1")   /* Joypad 1 */
59   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0001)
60   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0001)
61   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1)                  PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0001)
62   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1)                  PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0001)
63   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0001)
64   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0001)
65   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0001)
66   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0001)
59   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001)
60   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001)
61   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1)                  PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001)
62   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1)                  PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001)
63   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001)
64   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001)
65   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001)
66   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001)
6767
6868   PORT_START("PAD2")   /* Joypad 2 */
69   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 A") PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0010)
70   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 B") PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0010)
71   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(2)                  PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0010)
72   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(2)                  PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0010)
73   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)            PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0010)
74   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)            PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0010)
75   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)            PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0010)
76   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)            PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0010)
69   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 A") PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010)
70   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 B") PORT_PLAYER(2)   PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010)
71   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(2)                  PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010)
72   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(2)                  PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010)
73   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)            PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010)
74   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)            PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010)
75   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)            PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010)
76   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)            PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010)
7777
7878   PORT_START("PAD3")   /* Joypad 3 */
79   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 A") PORT_PLAYER(3)   PORT_CONDITION("CTRLSEL", 0x0f00, PORTCOND_EQUALS, 0x0100)
80   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 B") PORT_PLAYER(3)   PORT_CONDITION("CTRLSEL", 0x0f00, PORTCOND_EQUALS, 0x0100)
81   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(3)                  PORT_CONDITION("CTRLSEL", 0x0f00, PORTCOND_EQUALS, 0x0100)
82   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(3)                  PORT_CONDITION("CTRLSEL", 0x0f00, PORTCOND_EQUALS, 0x0100)
83   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)            PORT_CONDITION("CTRLSEL", 0x0f00, PORTCOND_EQUALS, 0x0100)
84   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)            PORT_CONDITION("CTRLSEL", 0x0f00, PORTCOND_EQUALS, 0x0100)
85   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)            PORT_CONDITION("CTRLSEL", 0x0f00, PORTCOND_EQUALS, 0x0100)
86   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)            PORT_CONDITION("CTRLSEL", 0x0f00, PORTCOND_EQUALS, 0x0100)
79   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 A") PORT_PLAYER(3)   PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100)
80   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 B") PORT_PLAYER(3)   PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100)
81   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(3)                  PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100)
82   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(3)                  PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100)
83   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)            PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100)
84   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)            PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100)
85   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)            PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100)
86   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)            PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100)
8787
8888   PORT_START("PAD4")   /* Joypad 4 */
89   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 A") PORT_PLAYER(4)   PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x1000)
90   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 B") PORT_PLAYER(4)   PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x1000)
91   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(4)                  PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x1000)
92   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(4)                  PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x1000)
93   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4)            PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x1000)
94   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)            PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x1000)
95   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)            PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x1000)
96   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)            PORT_CONDITION("CTRLSEL", 0xf000, PORTCOND_EQUALS, 0x1000)
89   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 A") PORT_PLAYER(4)   PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000)
90   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 B") PORT_PLAYER(4)   PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000)
91   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(4)                  PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000)
92   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(4)                  PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000)
93   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4)            PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000)
94   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)            PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000)
95   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)            PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000)
96   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)            PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000)
9797
9898   PORT_START("ZAPPER1_X")  /* P1 zapper */
99   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0002)
99   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002)
100100   PORT_START("ZAPPER1_Y")  /* P1 zapper */
101   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0002)
101   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002)
102102   PORT_START("ZAPPER1_T")  /* P1 zapper trigger */
103   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P1 Lightgun Trigger") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0002)
103   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P1 Lightgun Trigger") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002)
104104
105105   PORT_START("ZAPPER2_X")  /* P2 zapper */
106   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_MINMAX(0,255 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0030)
106   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_MINMAX(0,255 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0030)
107107   PORT_START("ZAPPER2_Y")  /* P2 zapper */
108   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_MINMAX(0,255 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0030)
108   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_MINMAX(0,255 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0030)
109109   PORT_START("ZAPPER2_T")  /* P2 zapper trigger */
110   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P2 Lightgun Trigger") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0030)
110   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P2 Lightgun Trigger") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0030)
111111
112112   PORT_START("PADDLE")  /* Arkanoid paddle */
113   PORT_BIT( 0xff, 0x7f, IPT_PADDLE) PORT_SENSITIVITY(25) PORT_KEYDELTA(3) PORT_MINMAX(0x62,0xf2) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, PORTCOND_EQUALS, 0x0040)
113   PORT_BIT( 0xff, 0x7f, IPT_PADDLE) PORT_SENSITIVITY(25) PORT_KEYDELTA(3) PORT_MINMAX(0x62,0xf2) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0040)
114114
115115   PORT_START("CC_LEFT")
116   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
117   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
118   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
119   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
120   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
121   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
122   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
123   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
116   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
117   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
118   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
119   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
120   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
121   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
122   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
123   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
124124
125125   PORT_START("CC_RIGHT")
126   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
127   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
128   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
129   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
130   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
131   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
132   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
133   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(1)PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0006)
126   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
127   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
128   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
129   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
130   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
131   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
132   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
133   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(1)PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0006)
134134
135135INPUT_PORTS_END
136136
137137static INPUT_PORTS_START( fc_keyboard )
138138   PORT_START("FCKEY0")
139   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
140   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
141   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE)   PORT_CHAR('[')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
142   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH)   PORT_CHAR(']')      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
143   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Kana")                        PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
144   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RSHIFT)                  PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
145   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2)   PORT_CHAR('\\')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
146   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Stop") PORT_CODE(KEYCODE_BACKSPACE)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
139   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
140   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
141   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE)   PORT_CHAR('[')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
142   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH)   PORT_CHAR(']')      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
143   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Kana")                        PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
144   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RSHIFT)                  PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
145   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2)   PORT_CHAR('\\')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
146   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Stop") PORT_CODE(KEYCODE_BACKSPACE)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
147147
148148   PORT_START("FCKEY1")
149   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
150   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE)   PORT_CHAR('@')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
151   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON)   PORT_CHAR(':')      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
152   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE)   PORT_CHAR(';')      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
153   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('_')                        PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
154   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('/')                        PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
155   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS)   PORT_CHAR('-')      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
156   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS)   PORT_CHAR('^')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
149   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
150   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE)   PORT_CHAR('@')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
151   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON)   PORT_CHAR(':')      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
152   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE)   PORT_CHAR(';')      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
153   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('_')                        PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
154   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('/')                        PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
155   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS)   PORT_CHAR('-')      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
156   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS)   PORT_CHAR('^')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
157157
158158   PORT_START("FCKEY2")
159   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
160   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O)   PORT_CHAR('O')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
161   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L)   PORT_CHAR('L')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
162   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K)   PORT_CHAR('K')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
163   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP)   PORT_CHAR('.')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
164   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA)   PORT_CHAR(',')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
165   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P)   PORT_CHAR('P')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
166   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0)   PORT_CHAR('0')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
159   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
160   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O)   PORT_CHAR('O')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
161   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L)   PORT_CHAR('L')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
162   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K)   PORT_CHAR('K')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
163   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP)   PORT_CHAR('.')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
164   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA)   PORT_CHAR(',')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
165   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P)   PORT_CHAR('P')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
166   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0)   PORT_CHAR('0')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
167167
168168   PORT_START("FCKEY3")
169   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
170   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I)   PORT_CHAR('I')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
171   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U)   PORT_CHAR('U')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
172   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J)   PORT_CHAR('J')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
173   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M)   PORT_CHAR('M')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
174   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N)   PORT_CHAR('N')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
175   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9)   PORT_CHAR('9')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
176   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8)   PORT_CHAR('8')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
169   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
170   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I)   PORT_CHAR('I')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
171   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U)   PORT_CHAR('U')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
172   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J)   PORT_CHAR('J')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
173   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M)   PORT_CHAR('M')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
174   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N)   PORT_CHAR('N')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
175   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9)   PORT_CHAR('9')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
176   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8)   PORT_CHAR('8')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
177177
178178   PORT_START("FCKEY4")
179   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
180   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y)   PORT_CHAR('Y')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
181   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G)   PORT_CHAR('G')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
182   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H)   PORT_CHAR('H')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
183   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B)   PORT_CHAR('B')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
184   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V)   PORT_CHAR('V')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
185   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7)   PORT_CHAR('7')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
186   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6)   PORT_CHAR('6')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
179   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
180   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y)   PORT_CHAR('Y')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
181   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G)   PORT_CHAR('G')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
182   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H)   PORT_CHAR('H')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
183   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B)   PORT_CHAR('B')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
184   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V)   PORT_CHAR('V')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
185   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7)   PORT_CHAR('7')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
186   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6)   PORT_CHAR('6')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
187187
188188   PORT_START("FCKEY5")
189   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
190   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T)   PORT_CHAR('T')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
191   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R)   PORT_CHAR('R')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
192   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D)   PORT_CHAR('D')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
193   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F)   PORT_CHAR('F')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
194   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C)   PORT_CHAR('C')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
195   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5)   PORT_CHAR('5')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
196   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4)   PORT_CHAR('4')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
189   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
190   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T)   PORT_CHAR('T')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
191   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R)   PORT_CHAR('R')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
192   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D)   PORT_CHAR('D')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
193   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F)   PORT_CHAR('F')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
194   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C)   PORT_CHAR('C')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
195   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5)   PORT_CHAR('5')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
196   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4)   PORT_CHAR('4')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
197197
198198   PORT_START("FCKEY6")
199   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
200   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W)   PORT_CHAR('W')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
201   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S)   PORT_CHAR('S')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
202   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A)   PORT_CHAR('A')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
203   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X)   PORT_CHAR('X')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
204   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z)   PORT_CHAR('Z')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
205   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E)   PORT_CHAR('E')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
206   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3)   PORT_CHAR('3')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
199   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
200   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W)   PORT_CHAR('W')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
201   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S)   PORT_CHAR('S')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
202   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A)   PORT_CHAR('A')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
203   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X)   PORT_CHAR('X')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
204   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z)   PORT_CHAR('Z')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
205   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E)   PORT_CHAR('E')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
206   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3)   PORT_CHAR('3')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
207207
208208   PORT_START("FCKEY7")
209   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1))         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
210   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_MAMEKEY(ESC))         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
211   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q)   PORT_CHAR('Q')                     PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
212   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL)      PORT_CHAR(UCHAR_SHIFT_2)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
213   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT)      PORT_CHAR(UCHAR_SHIFT_1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
214   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Grph") PORT_CODE(KEYCODE_LALT)      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
215   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1)   PORT_CHAR('1')            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
216   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2)   PORT_CHAR('2')            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
209   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1))         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
210   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_MAMEKEY(ESC))         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
211   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q)   PORT_CHAR('Q')                     PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
212   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL)      PORT_CHAR(UCHAR_SHIFT_2)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
213   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT)      PORT_CHAR(UCHAR_SHIFT_1)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
214   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Grph") PORT_CODE(KEYCODE_LALT)      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
215   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1)   PORT_CHAR('1')            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
216   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2)   PORT_CHAR('2')            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
217217
218218   PORT_START("FCKEY8")
219   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Clr")                           PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
220   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_UP)   PORT_CHAR(UCHAR_MAMEKEY(UP))      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
221   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
222   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
223   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
224   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE)      PORT_CHAR(' ')      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
225   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Del") PORT_CODE(KEYCODE_DEL)         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
226   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ins") PORT_CODE(KEYCODE_INSERT)      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
219   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Clr")                           PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
220   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_UP)   PORT_CHAR(UCHAR_MAMEKEY(UP))      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
221   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
222   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
223   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
224   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE)      PORT_CHAR(' ')      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
225   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Del") PORT_CODE(KEYCODE_DEL)         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
226   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ins") PORT_CODE(KEYCODE_INSERT)      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0008)
227227
228228INPUT_PORTS_END
229229
230230static INPUT_PORTS_START( subor_keyboard )
231231   PORT_START("SUBKEY0")
232   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4)   PORT_CHAR('4')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
233   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G)   PORT_CHAR('G')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
234   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F)   PORT_CHAR('F')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
235   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C)   PORT_CHAR('C')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
236   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
237   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E)   PORT_CHAR('E')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
238   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5)   PORT_CHAR('5')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
239   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V)   PORT_CHAR('V')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
232   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4)   PORT_CHAR('4')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
233   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G)   PORT_CHAR('G')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
234   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F)   PORT_CHAR('F')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
235   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C)   PORT_CHAR('C')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
236   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
237   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E)   PORT_CHAR('E')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
238   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5)   PORT_CHAR('5')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
239   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V)   PORT_CHAR('V')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
240240
241241   PORT_START("SUBKEY1")
242   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2)   PORT_CHAR('2')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
243   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D)   PORT_CHAR('D')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
244   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S)   PORT_CHAR('S')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
245   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
246   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1))      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
247   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W)   PORT_CHAR('W')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
248   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3)   PORT_CHAR('3')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
249   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X)   PORT_CHAR('X')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
242   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2)   PORT_CHAR('2')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
243   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D)   PORT_CHAR('D')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
244   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S)   PORT_CHAR('S')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
245   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
246   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1))      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
247   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W)   PORT_CHAR('W')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
248   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3)   PORT_CHAR('3')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
249   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X)   PORT_CHAR('X')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
250250
251251   PORT_START("SUBKEY2")
252   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
253   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE)   PORT_CHAR(8)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
254   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("NEXT")                                 PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
255   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
256   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8))      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
257   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PRIOR")                              PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
258   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
259   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
252   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
253   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE)   PORT_CHAR(8)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
254   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("NEXT")                                 PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
255   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
256   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8))      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
257   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PRIOR")                              PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
258   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
259   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
260260
261261   PORT_START("SUBKEY3")
262   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9)   PORT_CHAR('9')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
263   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I)   PORT_CHAR('I')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
264   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L)   PORT_CHAR('L')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
265   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA)   PORT_CHAR(',')         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
266   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
267   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O)   PORT_CHAR('O')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
268   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0)   PORT_CHAR('0')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
269   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP)   PORT_CHAR('.')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
262   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9)   PORT_CHAR('9')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
263   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I)   PORT_CHAR('I')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
264   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L)   PORT_CHAR('L')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
265   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA)   PORT_CHAR(',')         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
266   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
267   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O)   PORT_CHAR('O')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
268   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0)   PORT_CHAR('0')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
269   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP)   PORT_CHAR('.')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
270270
271271   PORT_START("SUBKEY4")
272   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE)   PORT_CHAR(']')         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
273   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER)   PORT_CHAR(13)            PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
274   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
275   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
276   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7))      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
277   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE)   PORT_CHAR('[')         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
278   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH)   PORT_CHAR('\\')         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
279   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
272   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE)   PORT_CHAR(']')         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
273   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER)   PORT_CHAR(13)            PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
274   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
275   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
276   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7))      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
277   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE)   PORT_CHAR('[')         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
278   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH)   PORT_CHAR('\\')         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
279   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
280280
281281   PORT_START("SUBKEY5")
282   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q)   PORT_CHAR('Q')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
283   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
284   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z)   PORT_CHAR('Z')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
285   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB)   PORT_CHAR('\t')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
286   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC))         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
287   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A)   PORT_CHAR('A')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
288   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1)   PORT_CHAR('1')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
289   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL)      PORT_CHAR(UCHAR_SHIFT_2)      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
282   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q)   PORT_CHAR('Q')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
283   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
284   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z)   PORT_CHAR('Z')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
285   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB)   PORT_CHAR('\t')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
286   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC))         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
287   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A)   PORT_CHAR('A')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
288   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1)   PORT_CHAR('1')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
289   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL)      PORT_CHAR(UCHAR_SHIFT_2)      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
290290
291291   PORT_START("SUBKEY6")
292   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7)   PORT_CHAR('7')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
293   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y)   PORT_CHAR('Y')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
294   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K)   PORT_CHAR('K')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
295   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M)   PORT_CHAR('M')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
296   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
297   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U)   PORT_CHAR('U')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
298   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8)   PORT_CHAR('8')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
299   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J)   PORT_CHAR('J')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
292   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7)   PORT_CHAR('7')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
293   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y)   PORT_CHAR('Y')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
294   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K)   PORT_CHAR('K')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
295   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M)   PORT_CHAR('M')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
296   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
297   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U)   PORT_CHAR('U')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
298   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8)   PORT_CHAR('8')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
299   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J)   PORT_CHAR('J')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
300300
301301   PORT_START("SUBKEY7")
302   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS)   PORT_CHAR('-')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
303   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON)   PORT_CHAR(':')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
304   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE)   PORT_CHAR('\'')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
305   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH)   PORT_CHAR('/')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
306   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
307   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P)      PORT_CHAR('P')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
308   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS)   PORT_CHAR('=')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
309   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT)   PORT_CHAR(UCHAR_SHIFT_1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
302   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS)   PORT_CHAR('-')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
303   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON)   PORT_CHAR(':')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
304   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE)   PORT_CHAR('\'')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
305   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH)   PORT_CHAR('/')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
306   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
307   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P)      PORT_CHAR('P')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
308   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS)   PORT_CHAR('=')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
309   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT)   PORT_CHAR(UCHAR_SHIFT_1)   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
310310
311311   PORT_START("SUBKEY8")
312   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T)   PORT_CHAR('T')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
313   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H)   PORT_CHAR('H')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
314   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N)   PORT_CHAR('N')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
315   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE)   PORT_CHAR(' ')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
316   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
317   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R)   PORT_CHAR('R')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
318   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6)   PORT_CHAR('6')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
319   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B)   PORT_CHAR('B')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
312   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T)   PORT_CHAR('T')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
313   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H)   PORT_CHAR('H')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
314   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N)   PORT_CHAR('N')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
315   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE)   PORT_CHAR(' ')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
316   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
317   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R)   PORT_CHAR('R')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
318   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6)   PORT_CHAR('6')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
319   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B)   PORT_CHAR('B')   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
320320
321321   PORT_START("SUBKEY9")
322   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
322   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
323323
324324   PORT_START("SUBKEY10")
325   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("LMENU")   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
326   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD)   PORT_CHAR(UCHAR_MAMEKEY(4_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
327   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD)   PORT_CHAR(UCHAR_MAMEKEY(7_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
328   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F11)      PORT_CHAR(UCHAR_MAMEKEY(F11))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
329   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F12)      PORT_CHAR(UCHAR_MAMEKEY(F12))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
330   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD)   PORT_CHAR(UCHAR_MAMEKEY(1_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
331   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD)   PORT_CHAR(UCHAR_MAMEKEY(2_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
332   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD)   PORT_CHAR(UCHAR_MAMEKEY(8_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
325   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("LMENU")   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
326   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD)   PORT_CHAR(UCHAR_MAMEKEY(4_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
327   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD)   PORT_CHAR(UCHAR_MAMEKEY(7_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
328   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F11)      PORT_CHAR(UCHAR_MAMEKEY(F11))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
329   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F12)      PORT_CHAR(UCHAR_MAMEKEY(F12))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
330   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD)   PORT_CHAR(UCHAR_MAMEKEY(1_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
331   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD)   PORT_CHAR(UCHAR_MAMEKEY(2_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
332   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD)   PORT_CHAR(UCHAR_MAMEKEY(8_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
333333
334334   PORT_START("SUBKEY11")
335   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD)PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
336   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD)   PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
337   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK)   PORT_CHAR(UCHAR_MAMEKEY(ASTERISK))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
338   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9_PAD)   PORT_CHAR(UCHAR_MAMEKEY(9_PAD))      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
339   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10))         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
340   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD)   PORT_CHAR(UCHAR_MAMEKEY(5_PAD))      PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
341   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD)PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
342   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_NUMLOCK)   PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
335   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD)PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
336   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD)   PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
337   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK)   PORT_CHAR(UCHAR_MAMEKEY(ASTERISK))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
338   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9_PAD)   PORT_CHAR(UCHAR_MAMEKEY(9_PAD))      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
339   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10))         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
340   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD)   PORT_CHAR(UCHAR_MAMEKEY(5_PAD))      PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
341   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD)PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
342   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_NUMLOCK)   PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
343343
344344   PORT_START("SUBKEY12")
345   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE)   PORT_CHAR('`')               PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
346   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD)   PORT_CHAR(UCHAR_MAMEKEY(6_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
347   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PAUSE")                                 PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
348   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("SPACE2")                                 PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
349   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9))         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
350   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD)   PORT_CHAR(UCHAR_MAMEKEY(3_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
351   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD)         PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
352   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD)   PORT_CHAR(UCHAR_MAMEKEY(0_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
345   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE)   PORT_CHAR('`')               PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
346   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD)   PORT_CHAR(UCHAR_MAMEKEY(6_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
347   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PAUSE")                                 PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
348   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("SPACE2")                                 PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
349   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9))         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
350   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD)   PORT_CHAR(UCHAR_MAMEKEY(3_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
351   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD)         PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
352   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD)   PORT_CHAR(UCHAR_MAMEKEY(0_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0009)
353353
354354INPUT_PORTS_END
355355
src/mess/drivers/z88.c
r15082r15083
292292   UINT8 data = 0xff;
293293
294294   if (!(offset & 0x80))
295      data &= input_port_read(machine(), "LINE7");
295      data &= ioport("LINE7")->read();
296296
297297   if (!(offset & 0x40))
298      data &= input_port_read(machine(), "LINE6");
298      data &= ioport("LINE6")->read();
299299
300300   if (!(offset & 0x20))
301      data &= input_port_read(machine(), "LINE5");
301      data &= ioport("LINE5")->read();
302302
303303   if (!(offset & 0x10))
304      data &= input_port_read(machine(), "LINE4");
304      data &= ioport("LINE4")->read();
305305
306306   if (!(offset & 0x08))
307      data &= input_port_read(machine(), "LINE3");
307      data &= ioport("LINE3")->read();
308308
309309   if (!(offset & 0x04))
310      data &= input_port_read(machine(), "LINE2");
310      data &= ioport("LINE2")->read();
311311
312312   if (!(offset & 0x02))
313      data &= input_port_read(machine(), "LINE1");
313      data &= ioport("LINE1")->read();
314314
315315   if (!(offset & 0x01))
316      data &= input_port_read(machine(), "LINE0");
316      data &= ioport("LINE0")->read();
317317
318318   return data;
319319}
src/mess/drivers/pce220.c
r15082r15083
396396   data |= m_serial->in_ack()<<1;
397397   data |= m_serial->in_xin()<<2;
398398
399   data |= input_port_read(machine(), "ON")<<7;
399   data |= ioport("ON")->read()<<7;
400400
401401   return data;
402402}
r15082r15083
419419   UINT8 data = 0x00;
420420
421421   if (m_kb_matrix & 0x01)
422      data |= input_port_read(machine(), "LINE0");
422      data |= ioport("LINE0")->read();
423423   if (m_kb_matrix & 0x02)
424      data |= input_port_read(machine(), "LINE1");
424      data |= ioport("LINE1")->read();
425425   if (m_kb_matrix & 0x04)
426      data |= input_port_read(machine(), "LINE2");
426      data |= ioport("LINE2")->read();
427427   if (m_kb_matrix & 0x08)
428      data |= input_port_read(machine(), "LINE3");
428      data |= ioport("LINE3")->read();
429429   if (m_kb_matrix & 0x10)
430      data |= input_port_read(machine(), "LINE4");
430      data |= ioport("LINE4")->read();
431431   if (m_kb_matrix & 0x20)
432      data |= input_port_read(machine(), "LINE5");
432      data |= ioport("LINE5")->read();
433433   if (m_kb_matrix & 0x40)
434      data |= input_port_read(machine(), "LINE6");
434      data |= ioport("LINE6")->read();
435435   if (m_kb_matrix & 0x80)
436      data |= input_port_read(machine(), "LINE7");
436      data |= ioport("LINE7")->read();
437437   if (m_kb_matrix & 0x100)
438      data |= input_port_read(machine(), "LINE8");
438      data |= ioport("LINE8")->read();
439439   if (m_kb_matrix & 0x200)
440      data |= input_port_read(machine(), "LINE9");
440      data |= ioport("LINE9")->read();
441441
442442   return data;
443443}
src/mess/drivers/sgi_ip2.c
r15082r15083
166166
167167READ16_MEMBER(sgi_ip2_state::sgi_ip2_swtch_r)
168168{
169   verboselog(machine(), 0, "sgi_ip2_swtch_r: %04x\n", input_port_read(machine(), "SWTCH"));
170   return input_port_read(machine(), "SWTCH");
169   verboselog(machine(), 0, "sgi_ip2_swtch_r: %04x\n", ioport("SWTCH")->read());
170   return ioport("SWTCH")->read();
171171}
172172
173173READ8_MEMBER(sgi_ip2_state::sgi_ip2_clock_ctl_r)
src/mess/drivers/pcw16.c
r15082r15083
785785      }
786786   }
787787   // TODO: fix
788   state->subdevice<ns16550_device>("ns16550_2")->ri_w(input_port_read(timer.machine(), "EXTRA") & 0x040);
788   state->subdevice<ns16550_device>("ns16550_2")->ri_w(timer.machine().root_device().ioport("EXTRA")->read() & 0x040);
789789}
790790
791791
r15082r15083
10191019{
10201020//  logerror("system status r: \n");
10211021
1022   return m_system_status | (input_port_read(machine(), "EXTRA") & 0x04);
1022   return m_system_status | (ioport("EXTRA")->read() & 0x04);
10231023}
10241024
10251025READ8_MEMBER(pcw16_state::pcw16_timer_interrupt_counter_r)
r15082r15083
13311331static INPUT_PORTS_START(pcw16)
13321332   PORT_START("EXTRA")
13331333   /* vblank */
1334   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_VBLANK)
1334   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
13351335   /* power switch - default is on */
13361336   PORT_DIPNAME(0x40, 0x40, "Power Switch/Suspend")
13371337   PORT_DIPSETTING(0x0, DEF_STR( Off) )
src/mess/drivers/pc1500.c
r15082r15083
6767   if (!device->started()) return 0;
6868
6969    if (!(state->m_kb_matrix & 0x01))
70      data &= input_port_read(device->machine(), "KEY0");
70      data &= device->machine().root_device().ioport("KEY0")->read();
7171    if (!(state->m_kb_matrix & 0x02))
72      data &= input_port_read(device->machine(), "KEY1");
72      data &= device->machine().root_device().ioport("KEY1")->read();
7373    if (!(state->m_kb_matrix & 0x04))
74      data &= input_port_read(device->machine(), "KEY2");
74      data &= device->machine().root_device().ioport("KEY2")->read();
7575    if (!(state->m_kb_matrix & 0x08))
76      data &= input_port_read(device->machine(), "KEY3");
76      data &= device->machine().root_device().ioport("KEY3")->read();
7777    if (!(state->m_kb_matrix & 0x10))
78      data &= input_port_read(device->machine(), "KEY4");
78      data &= device->machine().root_device().ioport("KEY4")->read();
7979    if (!(state->m_kb_matrix & 0x20))
80      data &= input_port_read(device->machine(), "KEY5");
80      data &= device->machine().root_device().ioport("KEY5")->read();
8181    if (!(state->m_kb_matrix & 0x40))
82      data &= input_port_read(device->machine(), "KEY6");
82      data &= device->machine().root_device().ioport("KEY6")->read();
8383    if (!(state->m_kb_matrix & 0x80))
84      data &= input_port_read(device->machine(), "KEY7");
84      data &= state->ioport("KEY7")->read();
8585
8686   return data;
8787}
r15082r15083
246246
247247   data |= (m_rtc->tp_r()<<5);
248248   data |= (m_rtc->data_out_r()<<6);
249   data |= (input_port_read(machine(), "ON")<<7);
249   data |= (ioport("ON")->read()<<7);
250250
251251   return data;
252252}
src/mess/drivers/vt100.c
r15082r15083
116116      for(i = 0; i < 16; i++)
117117      {
118118         sprintf(kbdrow,"LINE%X", i);
119         code =   input_port_read(timer.machine(), kbdrow);
119         code =   timer.machine().root_device().ioport(kbdrow)->read();
120120         if (code < 0xff)
121121         {
122122            state->m_keyboard_int = 1;
src/mess/drivers/prof80.c
r15082r15083
306306   data |= !m_motor;
307307
308308   // JS4
309   switch (input_port_read(machine(), "J4"))
309   switch (ioport("J4")->read())
310310   {
311311   case 0: js4 = 0; break;
312312   case 1: js4 = 1; break;
r15082r15083
318318   data |= js4 << 4;
319319
320320   // JS5
321   switch (input_port_read(machine(), "J5"))
321   switch (ioport("J5")->read())
322322   {
323323   case 0: js5 = 0; break;
324324   case 1: js5 = 1; break;
src/mess/drivers/savia84.c
r15082r15083
161161   {
162162      char kbdrow[6];
163163      sprintf(kbdrow,"X%d",m_kbd);
164      return input_port_read(machine(), kbdrow);
164      return ioport(kbdrow)->read();
165165   }
166166   else
167167      return 0xff;
src/mess/drivers/pasogo.c
r15082r15083
141141         case 0x09: break;
142142         case 0x0a:
143143            if (vg230->data[9]&1)
144               data=input_port_read(machine(), "JOY");
144               data=ioport("JOY")->read();
145145            else
146146               data=0xff;
147147            break;
src/mess/drivers/aquarius.c
r15082r15083
147147{
148148   UINT8 result = 0xff;
149149
150   if (!BIT(offset,  8)) result &= input_port_read(machine(), "ROW0");
151   if (!BIT(offset,  9)) result &= input_port_read(machine(), "ROW1");
152   if (!BIT(offset, 10)) result &= input_port_read(machine(), "ROW2");
153   if (!BIT(offset, 11)) result &= input_port_read(machine(), "ROW3");
154   if (!BIT(offset, 12)) result &= input_port_read(machine(), "ROW4");
155   if (!BIT(offset, 13)) result &= input_port_read(machine(), "ROW5");
156   if (!BIT(offset, 14)) result &= input_port_read(machine(), "ROW6");
157   if (!BIT(offset, 15)) result &= input_port_read(machine(), "ROW7");
150   if (!BIT(offset,  8)) result &= ioport("ROW0")->read();
151   if (!BIT(offset,  9)) result &= ioport("ROW1")->read();
152   if (!BIT(offset, 10)) result &= ioport("ROW2")->read();
153   if (!BIT(offset, 11)) result &= ioport("ROW3")->read();
154   if (!BIT(offset, 12)) result &= ioport("ROW4")->read();
155   if (!BIT(offset, 13)) result &= ioport("ROW5")->read();
156   if (!BIT(offset, 14)) result &= ioport("ROW6")->read();
157   if (!BIT(offset, 15)) result &= ioport("ROW7")->read();
158158
159159   return result;
160160}
src/mess/drivers/eacc.c
r15082r15083
152152   UINT8 data = m_digit;
153153
154154   if (BIT(m_digit, 3))
155      data |= input_port_read(machine(), "X0");
155      data |= ioport("X0")->read();
156156   if (BIT(m_digit, 4))
157      data |= input_port_read(machine(), "X1");
157      data |= ioport("X1")->read();
158158   if (BIT(m_digit, 5))
159      data |= input_port_read(machine(), "X2");
159      data |= ioport("X2")->read();
160160   if (BIT(m_digit, 6))
161      data |= input_port_read(machine(), "X3");
161      data |= ioport("X3")->read();
162162
163163   return data;
164164}
src/mess/drivers/apexc.c
r15082r15083
404404
405405
406406   /* read new state of edit keys */
407   edit_keys = input_port_read(device->machine(), "data");
407   edit_keys = device->machine().root_device().ioport("data")->read();
408408
409409   /* toggle data reg according to transitions */
410410   state->m_panel_data_reg ^= edit_keys & (~state->m_old_edit_keys);
r15082r15083
414414
415415
416416   /* read new state of control keys */
417   control_keys = input_port_read(device->machine(), "panel");
417   control_keys = state->ioport("panel")->read();
418418
419419   /* compute transitions */
420420   control_transitions = control_keys & (~state->m_old_control_keys);
src/mess/drivers/x68k.c
r15082r15083
452452      {
453453         state->m_mfp.rsr |= 0x80;  // Buffer full
454454//          mfp_trigger_irq(MFP_IRQ_RX_FULL);
455         if(input_port_read(machine,"options") & 0x01)
455         if(machine.root_device().ioport("options")->read() & 0x01)
456456         {
457457            state->m_current_vector[6] = 0x4c;
458458            cputag_set_input_line_and_vector(machine, "maincpu",6,ASSERT_LINE,0x4c);
r15082r15083
483483      {
484484         state->m_keyboard.keytime[x] -= 5;
485485      }
486      if(!(input_port_read(machine, keynames[x / 32]) & (1 << (x % 32))))
486      if(!(machine.root_device().ioport(keynames[x / 32])->read() & (1 << (x % 32))))
487487      {
488488         if(state->m_keyboard.keyon[x] != 0)
489489         {
r15082r15083
497497      // check to see if a key is being held
498498      if(state->m_keyboard.keyon[x] != 0 && state->m_keyboard.keytime[x] == 0 && state->m_keyboard.last_pressed == x)
499499      {
500         if(input_port_read(machine, keynames[state->m_keyboard.last_pressed / 32]) & (1 << (state->m_keyboard.last_pressed % 32)))
500         if(machine.root_device().ioport(keynames[state->m_keyboard.last_pressed / 32])->read() & (1 << (state->m_keyboard.last_pressed % 32)))
501501         {
502502            x68k_keyboard_push_scancode(machine,state->m_keyboard.last_pressed);
503503            state->m_keyboard.keytime[state->m_keyboard.last_pressed] = (state->m_keyboard.repeat^2)*5+30;
504504            logerror("KB: Holding key 0x%02x\n",state->m_keyboard.last_pressed);
505505         }
506506      }
507      if((input_port_read(machine,  keynames[x / 32]) & (1 << (x % 32))))
507      if((machine.root_device().ioport(keynames[x / 32])->read() & (1 << (x % 32))))
508508      {
509509         if(state->m_keyboard.keyon[x] == 0)
510510         {
r15082r15083
548548   switch(state->m_mouse.inputtype)
549549   {
550550   case 0:
551      ipt = input_port_read(machine, "mouse1");
551      ipt = machine.root_device().ioport("mouse1")->read();
552552      break;
553553   case 1:
554      val = input_port_read(machine, "mouse2");
554      val = machine.root_device().ioport("mouse2")->read();
555555      ipt = val - state->m_mouse.last_mouse_x;
556556      state->m_mouse.last_mouse_x = val;
557557      break;
558558   case 2:
559      val = input_port_read(machine, "mouse3");
559      val = machine.root_device().ioport("mouse3")->read();
560560      ipt = val - state->m_mouse.last_mouse_y;
561561      state->m_mouse.last_mouse_y = val;
562562      break;
r15082r15083
697697   x68k_state *state = device->machine().driver_data<x68k_state>();
698698   if(port == 1)
699699   {
700      UINT8 porta = input_port_read(device->machine(),"md3b") & 0xff;
701      UINT8 portb = (input_port_read(device->machine(),"md3b") >> 8) & 0xff;
700      UINT8 porta = device->machine().root_device().ioport("md3b")->read() & 0xff;
701      UINT8 portb = (state->ioport("md3b")->read() >> 8) & 0xff;
702702      if(state->m_mdctrl.mux1 & 0x10)
703703      {
704704         return porta | 0x90;
r15082r15083
710710   }
711711   if(port == 2)
712712   {
713      UINT8 porta = (input_port_read(device->machine(),"md3b") >> 16) & 0xff;
714      UINT8 portb = (input_port_read(device->machine(),"md3b") >> 24) & 0xff;
713      UINT8 porta = (device->machine().root_device().ioport("md3b")->read() >> 16) & 0xff;
714      UINT8 portb = (device->machine().root_device().ioport("md3b")->read() >> 24) & 0xff;
715715      if(state->m_mdctrl.mux2 & 0x20)
716716      {
717717         return porta | 0x90;
r15082r15083
749749   x68k_state *state = device->machine().driver_data<x68k_state>();
750750   if(port == 1)
751751   {
752      UINT8 porta = input_port_read(device->machine(),"md6b") & 0xff;
753      UINT8 portb = (input_port_read(device->machine(),"md6b") >> 8) & 0xff;
754      UINT8 extra = input_port_read(device->machine(),"md6b_extra") & 0x0f;
752      UINT8 porta = device->machine().root_device().ioport("md6b")->read() & 0xff;
753      UINT8 portb = (device->machine().root_device().ioport("md6b")->read() >> 8) & 0xff;
754      UINT8 extra = state->ioport("md6b_extra")->read() & 0x0f;
755755
756756      switch(state->m_mdctrl.seq1)
757757      {
r15082r15083
787787   }
788788   if(port == 2)
789789   {
790      UINT8 porta = (input_port_read(device->machine(),"md6b") >> 16) & 0xff;
791      UINT8 portb = (input_port_read(device->machine(),"md6b") >> 24) & 0xff;
792      UINT8 extra = (input_port_read(device->machine(),"md6b_extra") >> 4) & 0x0f;
790      UINT8 porta = (device->machine().root_device().ioport("md6b")->read() >> 16) & 0xff;
791      UINT8 portb = (device->machine().root_device().ioport("md6b")->read() >> 24) & 0xff;
792      UINT8 extra = (device->machine().root_device().ioport("md6b_extra")->read() >> 4) & 0x0f;
793793
794794      switch(state->m_mdctrl.seq2)
795795      {
r15082r15083
838838   x68k_state *state = device->machine().driver_data<x68k_state>();
839839   if(port == 1)
840840   {
841      UINT8 porta = input_port_read(device->machine(),"xpd1lr") & 0xff;
842      UINT8 portb = (input_port_read(device->machine(),"xpd1lr") >> 8) & 0xff;
841      UINT8 porta = device->machine().root_device().ioport("xpd1lr")->read() & 0xff;
842      UINT8 portb = (state->ioport("xpd1lr")->read() >> 8) & 0xff;
843843      if(state->m_mdctrl.mux1 & 0x10)
844844      {
845845         return porta;
r15082r15083
851851   }
852852   if(port == 2)
853853   {
854      UINT8 porta = (input_port_read(device->machine(),"xpd1lr") >> 16) & 0xff;
855      UINT8 portb = (input_port_read(device->machine(),"xpd1lr") >> 24) & 0xff;
854      UINT8 porta = (device->machine().root_device().ioport("xpd1lr")->read() >> 16) & 0xff;
855      UINT8 portb = (device->machine().root_device().ioport("xpd1lr")->read() >> 24) & 0xff;
856856      if(state->m_mdctrl.mux2 & 0x20)
857857      {
858858         return porta;
r15082r15083
869869static READ8_DEVICE_HANDLER( ppi_port_a_r )
870870{
871871   x68k_state *state = device->machine().driver_data<x68k_state>();
872   int ctrl = input_port_read(device->machine(),"ctrltype") & 0x0f;
872   int ctrl = device->machine().root_device().ioport("ctrltype")->read() & 0x0f;
873873
874874   switch(ctrl)
875875   {
876876      case 0x00:  // standard MSX/FM-Towns joystick
877877         if(state->m_joy.joy1_enable == 0)
878            return input_port_read(device->machine(), "joy1");
878            return state->ioport("joy1")->read();
879879         else
880880            return 0xff;
881881      case 0x01:  // 3-button Megadrive gamepad
r15082r15083
892892static READ8_DEVICE_HANDLER( ppi_port_b_r )
893893{
894894   x68k_state *state = device->machine().driver_data<x68k_state>();
895   int ctrl = input_port_read(device->machine(),"ctrltype") & 0xf0;
895   int ctrl = device->machine().root_device().ioport("ctrltype")->read() & 0xf0;
896896
897897   switch(ctrl)
898898   {
899899      case 0x00:  // standard MSX/FM-Towns joystick
900900         if(state->m_joy.joy2_enable == 0)
901            return input_port_read(device->machine(), "joy2");
901            return state->ioport("joy2")->read();
902902         else
903903            return 0xff;
904904      case 0x10:  // 3-button Megadrive gamepad
r15082r15083
17151715   state->m_current_vector[2] = 0x02;  // bus error
17161716   state->m_current_irq_line = 2;
17171717//  cputag_set_input_line_and_vector(space->machine(), "maincpu",2,ASSERT_LINE,state->m_current_vector[2]);
1718   if(input_port_read(space->machine(), "options") & 0x02)
1718   if(state->ioport("options")->read() & 0x02)
17191719   {
17201720      offset *= 2;
17211721      if(ACCESSING_BITS_0_7)
r15082r15083
17331733   state->m_current_vector[2] = 0x02;  // bus error
17341734   state->m_current_irq_line = 2;
17351735//  cputag_set_input_line_and_vector(space->machine(), "maincpu",2,ASSERT_LINE,state->m_current_vector[2]);
1736   if(input_port_read(space->machine(), "options") & 0x02)
1736   if(state->ioport("options")->read() & 0x02)
17371737   {
17381738      offset *= 2;
17391739      if(ACCESSING_BITS_0_7)
r15082r15083
17501750   state->m_current_vector[2] = 0x02;  // bus error
17511751   state->m_current_irq_line = 2;
17521752//  cputag_set_input_line_and_vector(space->machine(), "maincpu",2,ASSERT_LINE,state->m_current_vector[2]);
1753   if(input_port_read(space->machine(), "options") & 0x02)
1753   if(state->ioport("options")->read() & 0x02)
17541754   {
17551755      offset *= 2;
17561756      if(ACCESSING_BITS_0_7)
r15082r15083
17681768   state->m_current_vector[2] = 0x02;  // bus error
17691769   state->m_current_irq_line = 2;
17701770//  cputag_set_input_line_and_vector(space->machine(), "maincpu",2,ASSERT_LINE,state->m_current_vector[2]);
1771   if(input_port_read(space->machine(), "options") & 0x02)
1771   if(state->ioport("options")->read() & 0x02)
17721772   {
17731773      offset *= 2;
17741774      if(ACCESSING_BITS_0_7)
r15082r15083
17811781{
17821782   x68k_state *state = space->machine().driver_data<x68k_state>();
17831783   /* These are expansion devices, if not present, they cause a bus error */
1784   if(input_port_read(space->machine(), "options") & 0x02)
1784   if(state->ioport("options")->read() & 0x02)
17851785   {
17861786      state->m_current_vector[2] = 0x02;  // bus error
17871787      state->m_current_irq_line = 2;
r15082r15083
17981798{
17991799   x68k_state *state = space->machine().driver_data<x68k_state>();
18001800   /* These are expansion devices, if not present, they cause a bus error */
1801   if(input_port_read(space->machine(), "options") & 0x02)
1801   if(state->ioport("options")->read() & 0x02)
18021802   {
18031803      state->m_current_vector[2] = 0x02;  // bus error
18041804      state->m_current_irq_line = 2;
r15082r15083
21632163// TODO: Sharp Cyber Stick (CZ-8NJ2) support
21642164
21652165   PORT_START( "joy1" )
2166   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CODE(JOYCODE_Y_UP_SWITCH)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x00)
2167   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CODE(JOYCODE_Y_DOWN_SWITCH)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x00)
2168   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CODE(JOYCODE_X_LEFT_SWITCH)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x00)
2169   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CODE(JOYCODE_X_RIGHT_SWITCH)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x00)
2170   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x00)
2171   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(JOYCODE_BUTTON1)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x00)
2172   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(JOYCODE_BUTTON2)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x00)
2173   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x00)
2166   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CODE(JOYCODE_Y_UP_SWITCH)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x00)
2167   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CODE(JOYCODE_Y_DOWN_SWITCH)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x00)
2168   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CODE(JOYCODE_X_LEFT_SWITCH)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x00)
2169   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CODE(JOYCODE_X_RIGHT_SWITCH)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x00)
2170   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x00)
2171   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(JOYCODE_BUTTON1)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x00)
2172   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(JOYCODE_BUTTON2)    PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x00)
2173   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x00)
21742174
21752175   PORT_START( "joy2" )
2176   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CODE(JOYCODE_Y_UP_SWITCH)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x00)
2177   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CODE(JOYCODE_Y_DOWN_SWITCH)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x00)
2178   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CODE(JOYCODE_X_LEFT_SWITCH)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x00)
2179   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CODE(JOYCODE_X_RIGHT_SWITCH)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x00)
2180   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x00)
2181   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(JOYCODE_BUTTON1)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x00)
2182   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(JOYCODE_BUTTON2)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x00)
2183   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x00)
2176   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CODE(JOYCODE_Y_UP_SWITCH)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x00)
2177   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CODE(JOYCODE_Y_DOWN_SWITCH)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x00)
2178   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CODE(JOYCODE_X_LEFT_SWITCH)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x00)
2179   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CODE(JOYCODE_X_RIGHT_SWITCH)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x00)
2180   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x00)
2181   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(JOYCODE_BUTTON1)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x00)
2182   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(JOYCODE_BUTTON2)    PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x00)
2183   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x00)
21842184
21852185   PORT_START( "key1" )
21862186   PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_UNUSED) // unused
r15082r15083
23292329
23302330   // 3-button Megadrive gamepad
23312331   PORT_START("md3b")
2332   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("MD Pad 1 Up") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2333   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("MD Pad 1 Down") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2334   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("MD Pad 1 Left") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2335   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("MD Pad 1 Right") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2336   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2337   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 B Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2338   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 C Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2339   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2332   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("MD Pad 1 Up") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2333   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("MD Pad 1 Down") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2334   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("MD Pad 1 Left") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2335   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("MD Pad 1 Right") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2336   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2337   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 B Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2338   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 C Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2339   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
23402340
2341   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2342   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2343   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2344   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2345   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2346   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 A Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2347   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 Start Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2348   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x01)
2341   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2342   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2343   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2344   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2345   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2346   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 A Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2347   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 Start Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
2348   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x01)
23492349
2350   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("MD Pad 2 Up") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2351   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("MD Pad 2 Down") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2352   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("MD Pad 2 Left") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2353   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("MD Pad 2 Right") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2354   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2355   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 B Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2356   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 C Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2357   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2350   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("MD Pad 2 Up") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2351   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("MD Pad 2 Down") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2352   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("MD Pad 2 Left") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2353   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("MD Pad 2 Right") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2354   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2355   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 B Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2356   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 C Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2357   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
23582358
2359   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2360   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2361   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2362   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2363   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2364   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 A Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2365   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 Start Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2366   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x10)
2359   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2360   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2361   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2362   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2363   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2364   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 A Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2365   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 Start Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
2366   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x10)
23672367
23682368   // 6-button Megadrive gamepad
23692369   PORT_START("md6b")
2370   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("MD Pad 1 Up") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2371   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("MD Pad 1 Down") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2372   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("MD Pad 1 Left") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2373   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("MD Pad 1 Right") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2374   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2375   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 B Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2376   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 C Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2377   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2370   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("MD Pad 1 Up") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2371   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("MD Pad 1 Down") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2372   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("MD Pad 1 Left") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2373   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("MD Pad 1 Right") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2374   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2375   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 B Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2376   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 C Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2377   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
23782378
2379   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2380   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2381   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2382   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2383   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2384   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 A Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2385   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 Start Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2386   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2379   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2380   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2381   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2382   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2383   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2384   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 A Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2385   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 Start Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2386   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
23872387
2388   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("MD Pad 2 Up") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2389   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("MD Pad 2 Down") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2390   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("MD Pad 2 Left") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2391   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("MD Pad 2 Right") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2392   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2393   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 B Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2394   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 C Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2395   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2388   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("MD Pad 2 Up") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2389   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("MD Pad 2 Down") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2390   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_NAME("MD Pad 2 Left") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2391   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_NAME("MD Pad 2 Right") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2392   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2393   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 B Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2394   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 C Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2395   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
23962396
2397   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2398   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2399   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2400   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2401   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2402   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 A Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2403   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 Start Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2404   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2397   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2398   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2399   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2400   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2401   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2402   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 A Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2403   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 Start Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2404   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
24052405
24062406   // extra inputs
24072407   PORT_START("md6b_extra")
2408   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 Z Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2409   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 Y Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2410   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 X Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2411   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 Mode Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x02)
2408   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 Z Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2409   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 Y Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2410   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 X Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
2411   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(1) PORT_NAME("MD Pad 1 Mode Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x02)
24122412
2413   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 Z Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2414   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 Y Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2415   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 X Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2416   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 Mode Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x20)
2413   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 Z Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2414   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 Y Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2415   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 X Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
2416   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(2) PORT_NAME("MD Pad 2 Mode Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x20)
24172417
24182418   // Dempa/Micomsoft XPD-1LR (dual D-pad gamepad sold with Libble Rabble)
24192419   PORT_START("xpd1lr")
2420   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_NAME("XPD Pad 1 Left/Up") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2421   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_NAME("XPD Pad 1 Left/Down") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2422   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_NAME("XPD Pad 1 Left/Left") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2423   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_NAME("XPD Pad 1 Left/Right") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2424   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2425   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("XPD Pad 1 B Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2426   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("XPD Pad 1 A Button") PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2427   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2420   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_NAME("XPD Pad 1 Left/Up") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2421   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_NAME("XPD Pad 1 Left/Down") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2422   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_NAME("XPD Pad 1 Left/Left") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2423   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_NAME("XPD Pad 1 Left/Right") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2424   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2425   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("XPD Pad 1 B Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2426   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("XPD Pad 1 A Button") PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2427   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
24282428
2429   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_NAME("XPD Pad 1 Right/Up") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2430   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_NAME("XPD Pad 1 Right/Down") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2431   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_NAME("XPD Pad 1 Right/Left") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2432   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_NAME("XPD Pad 1 Right/Right") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2433   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2434   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2435   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2436   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, PORTCOND_EQUALS, 0x03)
2429   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_NAME("XPD Pad 1 Right/Up") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2430   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_NAME("XPD Pad 1 Right/Down") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2431   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_NAME("XPD Pad 1 Right/Left") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2432   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_NAME("XPD Pad 1 Right/Right") PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2433   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2434   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2435   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
2436   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0x0f, EQUALS, 0x03)
24372437
2438   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_NAME("XPD Pad 2 Left/Up") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2439   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_NAME("XPD Pad 2 Left/Down") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2440   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_NAME("XPD Pad 2 Left/Left") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2441   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_NAME("XPD Pad 2 Left/Right") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2442   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2443   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("XPD Pad 2 B Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2444   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("XPD Pad 2 A Button") PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2445   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2438   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_NAME("XPD Pad 2 Left/Up") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2439   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_NAME("XPD Pad 2 Left/Down") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2440   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_NAME("XPD Pad 2 Left/Left") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2441   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_NAME("XPD Pad 2 Left/Right") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2442   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2443   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("XPD Pad 2 B Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2444   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("XPD Pad 2 A Button") PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2445   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
24462446
2447   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_NAME("XPD Pad 2 Right/Up") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2448   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_NAME("XPD Pad 2 Right/Down") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2449   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_NAME("XPD Pad 2 Right/Left") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2450   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_NAME("XPD Pad 2 Right/Right") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2451   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2452   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2453   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2454   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, PORTCOND_EQUALS, 0x30)
2447   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_NAME("XPD Pad 2 Right/Up") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2448   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_NAME("XPD Pad 2 Right/Down") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2449   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_NAME("XPD Pad 2 Right/Left") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2450   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_NAME("XPD Pad 2 Right/Right") PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2451   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2452   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2453   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
2454   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("ctrltype", 0xf0, EQUALS, 0x30)
24552455
24562456INPUT_PORTS_END
24572457
src/mess/drivers/pc2000.c
r15082r15083
6262
6363   for (int line=0; line<8; line++)
6464      if (m_mux_data & (1<<line))
65         data &= input_port_read(machine(), bitnames[offset][line]);
65         data &= ioport(bitnames[offset][line])->read();
6666
6767   return data;
6868}
src/mess/drivers/n64.c
r15082r15083
253253static INTERRUPT_GEN( n64_reset_poll )
254254{
255255   n64_periphs *periphs = device->machine().device<n64_periphs>("rcp");
256   periphs->poll_reset_button((input_port_read(device->machine(), "RESET") & 1) ? true : false);
256   periphs->poll_reset_button((device->machine().root_device().ioport("RESET")->read() & 1) ? true : false);
257257}
258258
259259static MACHINE_CONFIG_START( n64, n64_state )
src/mess/drivers/geneve.c
r15082r15083
296296      PORT_CONFSETTING(    GENMOD, "GenMod" )
297297
298298   PORT_START( "BOOTROM" )
299   PORT_CONFNAME( 0x01, GENEVE_098, "Boot ROM" ) PORT_CONDITION( "MODE", 0x01, PORTCOND_EQUALS, 0x00 )
299   PORT_CONFNAME( 0x01, GENEVE_098, "Boot ROM" ) PORT_CONDITION( "MODE", 0x01, EQUALS, 0x00 )
300300      PORT_CONFSETTING( GENEVE_098, "Version 0.98" )
301301      PORT_CONFSETTING( GENEVE_100, "Version 1.00" )
302302
303303   PORT_START( "SRAM" )
304   PORT_CONFNAME( 0x03, 0x01, "Onboard SRAM" ) PORT_CONDITION( "MODE", 0x01, PORTCOND_EQUALS, 0x00 )
304   PORT_CONFNAME( 0x03, 0x01, "Onboard SRAM" ) PORT_CONDITION( "MODE", 0x01, EQUALS, 0x00 )
305305      PORT_CONFSETTING( 0x00, "32 KiB" )
306306      PORT_CONFSETTING( 0x01, "64 KiB" )
307307      PORT_CONFSETTING( 0x02, "384 KiB" )
308308
309309   PORT_START( "GENMODDIPS" )
310   PORT_DIPNAME( GM_TURBO, 0x00, "Genmod Turbo mode") PORT_CONDITION( "MODE", 0x01, PORTCOND_EQUALS, GENMOD ) PORT_CHANGED_MEMBER(GMAPPER_TAG, geneve_mapper_device, gm_changed, 1)
310   PORT_DIPNAME( GM_TURBO, 0x00, "Genmod Turbo mode") PORT_CONDITION( "MODE", 0x01, EQUALS, GENMOD ) PORT_CHANGED_MEMBER(GMAPPER_TAG, geneve_mapper_device, gm_changed, 1)
311311      PORT_CONFSETTING( 0x00, DEF_STR( Off ))
312312      PORT_CONFSETTING( GM_TURBO, DEF_STR( On ))
313   PORT_DIPNAME( GM_TIM, GM_TIM, "Genmod TI mode") PORT_CONDITION( "MODE", 0x01, PORTCOND_EQUALS, GENMOD ) PORT_CHANGED_MEMBER(GMAPPER_TAG, geneve_mapper_device, gm_changed, 2)
313   PORT_DIPNAME( GM_TIM, GM_TIM, "Genmod TI mode") PORT_CONDITION( "MODE", 0x01, EQUALS, GENMOD ) PORT_CHANGED_MEMBER(GMAPPER_TAG, geneve_mapper_device, gm_changed, 2)
314314      PORT_CONFSETTING( 0x00, DEF_STR( Off ))
315315      PORT_CONFSETTING( GM_TIM, DEF_STR( On ))
316316
r15082r15083
440440      if (m_inta==CLEAR_LINE) answer |= 0x02;
441441      if (m_int2==CLEAR_LINE) answer |= 0x04;
442442
443      joy = input_port_read(machine(), "JOY");
443      joy = ioport("JOY")->read();
444444      if (m_joystick_select==0) joy = joy & 0xff;
445445      else joy = (joy>>8) & 0xff;
446446      answer |= joy;
r15082r15083
480480      if (m_keyint==CLEAR_LINE) answer |= 0x40;
481481
482482      // Joystick up (mirror of bit 7)
483      joy = input_port_read(machine(), "JOY");
483      joy = ioport("JOY")->read();
484484      if (m_joystick_select==0) joy = joy & 0xff;
485485      else joy = (joy>>8) & 0xff;
486486      if ((joy & 0x80)==0x00) answer |= 0x80;
r15082r15083
694694   driver->m_int2 = CLEAR_LINE;   // flag reflecting the INT2 line
695695   driver->m_keyint = CLEAR_LINE;
696696
697   driver->m_peribox->set_genmod(input_port_read(machine, "MODE")==GENMOD);
697   driver->m_peribox->set_genmod(machine.root_device().ioport("MODE")->read()==GENMOD);
698698}
699699
700700static MACHINE_CONFIG_START( geneve_60hz, geneve )
src/mess/drivers/beta.c
r15082r15083
115115
116116   switch (m_ls145_p)
117117   {
118   case 6: data &= input_port_read(machine(), "Q6"); break;
119   case 7: data &= input_port_read(machine(), "Q7"); break;
120   case 8: data &= input_port_read(machine(), "Q8"); break;
121   case 9: data &= input_port_read(machine(), "Q9"); break;
118   case 6: data &= ioport("Q6")->read(); break;
119   case 7: data &= ioport("Q7")->read(); break;
120   case 8: data &= ioport("Q8")->read(); break;
121   case 9: data &= ioport("Q9")->read(); break;
122122   default:
123123      if (!m_eprom_oe && !m_eprom_ce)
124124      {
src/mess/drivers/px4.c
r15082r15083
509509   {
510510      space->install_read_bank(0x10000 - size, 0xdfff, "bank3");
511511      space->nop_write(0x10000 - size, 0xdfff);
512      state->membank("bank3")->set_base(space->machine().root_device().memregion(region)->base());
512      state->membank("bank3")->set_base(state->memregion(region)->base());
513513   }
514514
515515   /* ram, continued */
r15082r15083
659659
660660      if (VERBOSE)
661661         logerror("7508 cmd: DIP Switch Read\n");
662      m_sior = input_port_read(machine(), "dips");
662      m_sior = ioport("dips")->read();
663663      break;
664664
665665   case 0x0b: if (VERBOSE) logerror("7508 cmd: Stop Key Interrupt disable\n"); break;
r15082r15083
928928static INPUT_CHANGED( key_callback )
929929{
930930   px4_state *px4 = field.machine().driver_data<px4_state>();
931   UINT32 oldvalue = oldval * field.mask, newvalue = newval * field.mask;
931   UINT32 oldvalue = oldval * field.mask(), newvalue = newval * field.mask();
932932   UINT32 delta = oldvalue ^ newvalue;
933933   int i, scancode = 0xff, down = 0;
934934
src/mess/drivers/mmodular.c
r15082r15083
278278READ8_MEMBER(polgar_state::read_1ff1_sfortea)
279279{
280280   UINT8 data;
281   data = input_port_read(machine(),  "BUTTONS_SFOR1");
281   data = ioport("BUTTONS_SFOR1")->read();
282282   logerror("1ff0 data %02x\n",data);
283283   return 0;
284284//  return data;
r15082r15083
287287READ8_MEMBER(polgar_state::read_1ff0_sfortea)
288288{
289289   UINT8 data;
290   data = input_port_read(machine(),  "BUTTONS_SFOR2");
290   data = ioport("BUTTONS_SFOR2")->read();
291291   logerror("1ff0 data %02x\n",data);
292292   return 0;
293293//  return data;
r15082r15083
655655   if (latch_data)
656656   {
657657      line = get_first_cleared_bit(latch_data);
658      tmp = input_port_read(machine(),  board_lines[line]);
658      tmp = ioport(board_lines[line])->read();
659659
660660      if (tmp != 0xff)
661661         data = convert_imputmask(tmp);
r15082r15083
674674      { "KEY1_0", "KEY1_1", "KEY1_2", "KEY1_3", "KEY1_4", "KEY1_5", "KEY1_6", "KEY1_7" }
675675   };
676676
677   data = input_port_read(machine(), keynames[0][offset]);
677   data = ioport(keynames[0][offset])->read();
678678   // logerror("Keyboard Port = %s Data = %d\n  ", ((led_status & 0x80) == 0x00) ? keynames[0][offset] : keynames[1][offset], data);
679679   return data | 0x7f;
680680}
r15082r15083
687687      { "KEY1_0", "KEY1_1", "KEY1_2", "KEY1_3", "KEY1_4", "KEY1_5", "KEY1_6", "KEY1_7" }
688688   };
689689
690   data = input_port_read(machine(), keynames[0][offset]);
690   data = ioport(keynames[0][offset])->read();
691691   logerror("Keyboard Port = %s Data = %d\n  ", keynames[0][offset] , data);
692692   return data | 0x7f;
693693}
r15082r15083
701701         { "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
702702
703703   if (BPL32latch_data == 0xff) {
704      tmp = input_port_read(machine(),  "BUTTONS_BPL");
704      tmp = ioport("BUTTONS_BPL")->read();
705705      logerror("Keyboard Port Offset = %d tmp %d\n", offset,tmp);
706706
707707      data = tmp << 24;
r15082r15083
709709      if (BPL32latch_data & 0x7f) {
710710         logerror("ReadingBoard %02x\n",BPL32latch_data);
711711         line = get_first_cleared_bit(BPL32latch_data);
712         tmp = input_port_read(machine(),  board_lines[line]);
712         tmp = ioport(board_lines[line])->read();
713713
714714         if (tmp != 0xff)
715715            data = convert_imputmask(tmp) << 24;
r15082r15083
747747         data = mboard_read_board_8(&space,0);
748748   } else {
749749      if (monteciv_select[0] == 0x0) {
750         data = input_port_read(machine(),  "BUTTONS_MONTE2");
750         data = ioport("BUTTONS_MONTE2")->read();
751751#if 0
752752         if (data) {
753753            output_set_digit_value(0,64);
r15082r15083
762762         }
763763#endif
764764      } else {
765         data = input_port_read(machine(),  "BUTTONS_MONTE1");
765         data = ioport("BUTTONS_MONTE1")->read();
766766      }
767767   }
768768   return data;
r15082r15083
779779//          { "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
780780
781781   if (latch_data == 0xff) {
782      data = input_port_read(machine(),  "BUTTONS_ACAD");
782      data = ioport("BUTTONS_ACAD")->read();
783783   } else {
784784//      if (latch_data & 0x7f) {
785785      data = mboard_read_board_8(&space,0);
r15082r15083
787787
788788//          logerror("ReadingBoard %02x\n",latch_data);
789789//          line = get_first_cleared_bit(latch_data);
790//          tmp = input_port_read(machine,  board_lines[line]);
790//          tmp = machine.root_device().ioport(board_lines[line])->read();
791791//          mboard_write_board_8(&space,0, latch_data);
792792//          data = mboard_read_board_8(&space,0);
793793//          logerror("BoardRead Port Offset = %d data %02x Latch %02x\n", offset,data,latch_data);
r15082r15083
826826   UINT32 data;
827827   static const char *const keynames[4] = { "BUTTON_1", "BUTTON_2", "", "BUTTON_3" };
828828
829   data = input_port_read(machine(), keynames[offset]);
829   data = ioport(keynames[offset])->read();
830830
831831   data = data|data<<8|data<<16|data<<24;  // this might not be needed if MAME does handle odd alignment over 32bit boundaries right
832832   logerror("Read from Buttons: %08x %08x\n",offset,data);
r15082r15083
839839   static const char *const keynames[4] = { "BUTTON_1", "", "BUTTON_2", "BUTTON_3" };
840840
841841
842   data = input_port_read(machine(), keynames[offset]);
842   data = ioport(keynames[offset])->read();
843843
844844   data = data << 8;
845845   logerror("Read from Buttons: %08x %08x\n",offset,data);
r15082r15083
852852   static const char *const keynames[3] = { "BUTTON_1", "BUTTON_2", "BUTTON_3" };
853853
854854
855   data = input_port_read(machine(), keynames[offset>>1]) << 8;
855   data = ioport(keynames[offset>>1])->read() << 8;
856856
857857   logerror("Read from %06x offset: %x %04x\n",0xf00000,offset,data);
858858   return data;
src/mess/drivers/pc8801.c
r15082r15083
990990    ---- --x- monitor refresh rate DIP-SW
991991    ---- ---x (pbsy?)
992992    */
993   return input_port_read(machine(), "CTRL");
993   return ioport("CTRL")->read();
994994}
995995
996996WRITE8_MEMBER(pc8801_state::pc8801_ctrl_w)
r15082r15083
18231823   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
18241824   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
18251825   PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("upd1990a", upd1990a_device, data_out_r)
1826   PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_VBLANK )
1826   PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_VBLANK("screen")
18271827   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
18281828
18291829   PORT_START("CFG")      /* EXSWITCH */
r15082r15083
21682168   pc8801_state *state = machine.driver_data<pc8801_state>();
21692169   MACHINE_RESET_CALL( pc8801 );
21702170   state->m_has_clock_speed = 1;
2171   state->m_clock_setting = input_port_read(machine, "CFG") & 0x80;
2171   state->m_clock_setting = machine.root_device().ioport("CFG")->read() & 0x80;
21722172
21732173   machine.device("maincpu")->set_unscaled_clock(state->m_clock_setting ?  XTAL_4MHz : XTAL_8MHz);
21742174   machine.device("fdccpu")->set_unscaled_clock(state->m_clock_setting ?  XTAL_4MHz : XTAL_8MHz); // correct?
r15082r15083
22182218/* YM2203 Interface */
22192219
22202220/* TODO: mouse routing (that's why I don't use DEVCB_INPUT_PORT here) */
2221static READ8_DEVICE_HANDLER( opn_porta_r ) { return input_port_read(device->machine(), "OPN_PA"); }
2222static READ8_DEVICE_HANDLER( opn_portb_r ) { return input_port_read(device->machine(), "OPN_PB"); }
2221static READ8_DEVICE_HANDLER( opn_porta_r ) { return device->machine().root_device().ioport("OPN_PA")->read(); }
2222static READ8_DEVICE_HANDLER( opn_portb_r ) { return device->machine().root_device().ioport("OPN_PB")->read(); }
22232223
22242224static const ym2203_interface pc88_ym2203_intf =
22252225{
src/mess/drivers/poly880.c
r15082r15083
195195   {
196196      if (BIT(m_digit, i))
197197      {
198         if (!BIT(input_port_read(machine(), "KI1"), i)) data &= ~0x10;
199         if (!BIT(input_port_read(machine(), "KI2"), i)) data &= ~0x20;
200         if (!BIT(input_port_read(machine(), "KI3"), i)) data &= ~0x80;
198         if (!BIT(ioport("KI1")->read(), i)) data &= ~0x10;
199         if (!BIT(ioport("KI2")->read(), i)) data &= ~0x20;
200         if (!BIT(ioport("KI3")->read(), i)) data &= ~0x80;
201201      }
202202   }
203203
src/mess/drivers/socrates.c
r15082r15083
146146   // first check that the kb latch[1] is clear; if it isn't, don't touch it!
147147   if ((state->m_kb_latch_low[1] != 0) || (state->m_kb_latch_high[1] != 1)) return;
148148   // next check for joypad buttons
149   keyvalue = input_port_read(machine, "keyboard_jp");
149   keyvalue = machine.root_device().ioport("keyboard_jp")->read();
150150   if (keyvalue != 0)
151151   {
152152      state->m_kb_latch_low[1] = (keyvalue & 0xFF0)>>4;
r15082r15083
156156   // next check for mouse movement.
157157   // this isn't written yet, so write me please!
158158   // next check if shift is down
159   shift = input_port_read(machine, "keyboard_50");
159   shift = machine.root_device().ioport("keyboard_50")->read();
160160   // find key low and high byte ok keyboard section
161161   for (row = 4; row>=0; row--)
162162   {
163      keyvalue = input_port_read(machine, rownames[row]);
163      keyvalue = machine.root_device().ioport(rownames[row])->read();
164164      if (keyvalue != 0)
165165      {
166166         for (powerof2 = 9; powerof2 >= 0; powerof2--)
src/mess/drivers/pc4.c
r15082r15083
3636
3737   for (int line=0; line<8; line++)
3838      if (!(offset & (1<<line)))
39         data &= input_port_read(machine(), bitnames[line]);
39         data &= ioport(bitnames[line])->read();
4040
4141   return data;
4242}
src/mess/drivers/bw2.c
r15082r15083
3131
3232int bw2_state::get_ramdisk_size()
3333{
34   return input_port_read(machine(), "RAMCARD") * 256;
34   return ioport("RAMCARD")->read() * 256;
3535}
3636
3737/* Memory */
r15082r15083
455455
456456   if (m_kb_row <= 9)
457457   {
458      data = input_port_read(machine(), rownames[m_kb_row]);
458      data = ioport(rownames[m_kb_row])->read();
459459   }
460460
461461   return data;
src/mess/drivers/jr200.c
r15082r15083
227227   UINT8 keydata = 0;
228228   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8" };
229229
230   if (input_port_read(machine(), "ROW9") & 0x07)
230   if (ioport("ROW9")->read() & 0x07)
231231   {
232232      /* shift, upper case */
233233      table = 1;
r15082r15083
236236   /* scan keyboard */
237237   for (row = 0; row < 9; row++)
238238   {
239      UINT8 data = input_port_read(machine(), keynames[row]);
239      UINT8 data = ioport(keynames[row])->read();
240240
241241      for (col = 0; col < 8; col++)
242242      {
r15082r15083
352352
353353/* Input ports */
354354static INPUT_PORTS_START( jr200 )
355//  PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
355//  PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
356356
357357   PORT_START("ROW0")
358358   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HELP") PORT_CODE(KEYCODE_TILDE)
src/mess/drivers/enterp.c
r15082r15083
6363   case 0x21:
6464      space->install_read_bank(start, end, page_num);
6565      space->nop_write(start, end);
66      state->membank(page_num)->set_base(space->machine().root_device().memregion("exdos")->base() + ((index - 0x20) * 0x4000));
66      state->membank(page_num)->set_base(state->memregion("exdos")->base() + ((index - 0x20) * 0x4000));
6767      break;
6868
6969   case 0xf8:
r15082r15083
132132   {
133133      case 0x015:
134134         /* read keyboard line */
135         dave_set_reg(device, 0x015, input_port_read(device->machine(), keynames[ep->keyboard_line]));
135         dave_set_reg(device, 0x015, device->machine().root_device().ioport(keynames[ep->keyboard_line])->read());
136136         break;
137137
138138      case 0x016:
139139      {
140140         int ExternalJoystickInputs;
141         int ExternalJoystickPortInput = input_port_read(device->machine(), "JOY1");
141         int ExternalJoystickPortInput = device->machine().root_device().ioport("JOY1")->read();
142142
143143         if (ep->keyboard_line <= 4)
144144         {
src/mess/drivers/portfoli.c
r15082r15083
207207
208208   for (int row = 0; row < 8; row++)
209209   {
210      UINT8 data = input_port_read(machine(), keynames[row]);
210      UINT8 data = ioport(keynames[row])->read();
211211
212212      if (data != 0xff)
213213      {
r15082r15083
348348   data |= (m_pid != PID_NONE) << 5;
349349
350350   /* battery status */
351   data |= BIT(input_port_read(machine(), "BATTERY"), 0) << 6;
351   data |= BIT(ioport("BATTERY")->read(), 0) << 6;
352352
353353   return data;
354354}
r15082r15083
804804   address_space *io = m_maincpu->memory().space(AS_IO);
805805
806806   // peripherals
807   m_pid = input_port_read(machine(), "PERIPHERAL");
807   m_pid = ioport("PERIPHERAL")->read();
808808
809809   io->unmap_readwrite(0x8070, 0x807b);
810810   io->unmap_readwrite(0x807d, 0x807e);
src/mess/drivers/mc10.c
r15082r15083
8787{
8888   UINT8 result = 0xff;
8989
90   if (!BIT(m_keyboard_strobe, 0)) result &= input_port_read(machine(), "pb0");
91   if (!BIT(m_keyboard_strobe, 1)) result &= input_port_read(machine(), "pb1");
92   if (!BIT(m_keyboard_strobe, 2)) result &= input_port_read(machine(), "pb2");
93   if (!BIT(m_keyboard_strobe, 3)) result &= input_port_read(machine(), "pb3");
94   if (!BIT(m_keyboard_strobe, 4)) result &= input_port_read(machine(), "pb4");
95   if (!BIT(m_keyboard_strobe, 5)) result &= input_port_read(machine(), "pb5");
96   if (!BIT(m_keyboard_strobe, 6)) result &= input_port_read(machine(), "pb6");
97   if (!BIT(m_keyboard_strobe, 7)) result &= input_port_read(machine(), "pb7");
90   if (!BIT(m_keyboard_strobe, 0)) result &= ioport("pb0")->read();
91   if (!BIT(m_keyboard_strobe, 1)) result &= ioport("pb1")->read();
92   if (!BIT(m_keyboard_strobe, 2)) result &= ioport("pb2")->read();
93   if (!BIT(m_keyboard_strobe, 3)) result &= ioport("pb3")->read();
94   if (!BIT(m_keyboard_strobe, 4)) result &= ioport("pb4")->read();
95   if (!BIT(m_keyboard_strobe, 5)) result &= ioport("pb5")->read();
96   if (!BIT(m_keyboard_strobe, 6)) result &= ioport("pb6")->read();
97   if (!BIT(m_keyboard_strobe, 7)) result &= ioport("pb7")->read();
9898
9999   return result;
100100}
r15082r15083
103103{
104104   UINT8 result = 0xff;
105105
106   if (!BIT(m_keyboard_strobe, 7)) result &= input_port_read(machine(), "pb7");
106   if (!BIT(m_keyboard_strobe, 7)) result &= ioport("pb7")->read();
107107   else
108   if (!BIT(m_keyboard_strobe, 6)) result &= input_port_read(machine(), "pb6");
108   if (!BIT(m_keyboard_strobe, 6)) result &= ioport("pb6")->read();
109109   else
110   if (!BIT(m_keyboard_strobe, 5)) result &= input_port_read(machine(), "pb5");
110   if (!BIT(m_keyboard_strobe, 5)) result &= ioport("pb5")->read();
111111   else
112   if (!BIT(m_keyboard_strobe, 4)) result &= input_port_read(machine(), "pb4");
112   if (!BIT(m_keyboard_strobe, 4)) result &= ioport("pb4")->read();
113113   else
114   if (!BIT(m_keyboard_strobe, 3)) result &= input_port_read(machine(), "pb3");
114   if (!BIT(m_keyboard_strobe, 3)) result &= ioport("pb3")->read();
115115   else
116   if (!BIT(m_keyboard_strobe, 2)) result &= input_port_read(machine(), "pb2");
116   if (!BIT(m_keyboard_strobe, 2)) result &= ioport("pb2")->read();
117117   else
118   if (!BIT(m_keyboard_strobe, 1)) result &= input_port_read(machine(), "pb1");
118   if (!BIT(m_keyboard_strobe, 1)) result &= ioport("pb1")->read();
119119   else
120   if (!BIT(m_keyboard_strobe, 0)) result &= input_port_read(machine(), "pb0");
120   if (!BIT(m_keyboard_strobe, 0)) result &= ioport("pb0")->read();
121121
122122   return result;
123123}
r15082r15083
164164   UINT8 result = 0xeb;
165165
166166   /* bit 1, keyboard line pa6 */
167   if (!BIT(m_keyboard_strobe, 0)) result &= input_port_read(machine(), "pb0") >> 5;
168   if (!BIT(m_keyboard_strobe, 2)) result &= input_port_read(machine(), "pb2") >> 5;
169   if (!BIT(m_keyboard_strobe, 7)) result &= input_port_read(machine(), "pb7") >> 5;
167   if (!BIT(m_keyboard_strobe, 0)) result &= ioport("pb0")->read() >> 5;
168   if (!BIT(m_keyboard_strobe, 2)) result &= ioport("pb2")->read() >> 5;
169   if (!BIT(m_keyboard_strobe, 7)) result &= ioport("pb7")->read() >> 5;
170170
171171   /* bit 2, printer ots input */
172172   result |= (m_printer->is_ready() ? 0 : 4);
src/mess/drivers/atom.c
r15082r15083
394394
395395   switch (m_keylatch)
396396   {
397   case 0: data &= input_port_read(machine(), "KEY0"); break;
398   case 1: data &= input_port_read(machine(), "KEY1"); break;
399   case 2: data &= input_port_read(machine(), "KEY2"); break;
400   case 3: data &= input_port_read(machine(), "KEY3"); break;
401   case 4: data &= input_port_read(machine(), "KEY4"); break;
402   case 5: data &= input_port_read(machine(), "KEY5"); break;
403   case 6: data &= input_port_read(machine(), "KEY6"); break;
404   case 7: data &= input_port_read(machine(), "KEY7"); break;
405   case 8: data &= input_port_read(machine(), "KEY8"); break;
406   case 9: data &= input_port_read(machine(), "KEY9"); break;
397   case 0: data &= ioport("KEY0")->read(); break;
398   case 1: data &= ioport("KEY1")->read(); break;
399   case 2: data &= ioport("KEY2")->read(); break;
400   case 3: data &= ioport("KEY3")->read(); break;
401   case 4: data &= ioport("KEY4")->read(); break;
402   case 5: data &= ioport("KEY5")->read(); break;
403   case 6: data &= ioport("KEY6")->read(); break;
404   case 7: data &= ioport("KEY7")->read(); break;
405   case 8: data &= ioport("KEY8")->read(); break;
406   case 9: data &= ioport("KEY9")->read(); break;
407407   }
408408
409   data &= input_port_read(machine(), "KEY10");
409   data &= ioport("KEY10")->read();
410410
411411   return data;
412412}
r15082r15083
437437   data |= (m_cassette->input() > 0.0) << 5;
438438
439439   /* keyboard RPT */
440   data |= BIT(input_port_read(machine(), "RPT"), 0) << 6;
440   data |= BIT(ioport("RPT")->read(), 0) << 6;
441441
442442   /* MC6847 FS */
443443   data |= (m_vdg->fs_r() ? 1 : 0) << 7;
src/mess/drivers/lc80.c
r15082r15083
262262   {
263263      if (!BIT(m_digit, i))
264264      {
265         if (!BIT(input_port_read(machine(), "ROW0"), i)) data &= ~0x10;
266         if (!BIT(input_port_read(machine(), "ROW1"), i)) data &= ~0x20;
267         if (!BIT(input_port_read(machine(), "ROW2"), i)) data &= ~0x40;
268         if (!BIT(input_port_read(machine(), "ROW3"), i)) data &= ~0x80;
265         if (!BIT(ioport("ROW0")->read(), i)) data &= ~0x10;
266         if (!BIT(ioport("ROW1")->read(), i)) data &= ~0x20;
267         if (!BIT(ioport("ROW2")->read(), i)) data &= ~0x40;
268         if (!BIT(ioport("ROW3")->read(), i)) data &= ~0x80;
269269      }
270270   }
271271
src/mess/drivers/apf.c
r15082r15083
149149   UINT8 data=~0;
150150
151151   if (!BIT(m_pad_data, 3))
152      data &= input_port_read(machine(), "joy3");
152      data &= ioport("joy3")->read();
153153   if (!BIT(m_pad_data, 2))
154      data &= input_port_read(machine(), "joy2");
154      data &= ioport("joy2")->read();
155155   if (!BIT(m_pad_data, 1))
156      data &= input_port_read(machine(), "joy1");
156      data &= ioport("joy1")->read();
157157   if (!BIT(m_pad_data, 0))
158      data &= input_port_read(machine(), "joy0");
158      data &= ioport("joy0")->read();
159159
160160   return data;
161161}
r15082r15083
311311   static const char *const keynames[] = { "key0", "key1", "key2", "key3", "key4", "key5", "key6", "key7" };
312312
313313   keyboard_line = data & 0x07;
314   m_keyboard_data = input_port_read(machine(), keynames[keyboard_line]);
314   m_keyboard_data = ioport(keynames[keyboard_line])->read();
315315
316316   /* bit 4: cassette motor control */
317317   m_cass->change_state(BIT(data, 4) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
src/mess/drivers/rx78.c
r15082r15083
174174
175175      res = 0;
176176      for(i=0;i<15;i++)
177         res |= input_port_read(machine(), keynames[i]);
177         res |= ioport(keynames[i])->read();
178178
179179      return res;
180180   }
181181
182182   if(m_key_mux >= 1 && m_key_mux <= 15)
183      return input_port_read(machine(), keynames[m_key_mux - 1]);
183      return ioport(keynames[m_key_mux - 1])->read();
184184
185185   return 0;
186186}
src/mess/drivers/snes.c
r15082r15083
136136            { "SUPERSCOPE2", "SUPERSCOPE2_X", "SUPERSCOPE2_Y" },
137137         };
138138
139   INT16 x = input_port_read(field.machine(), portnames[port][1]);
140   INT16 y = input_port_read(field.machine(), portnames[port][2]);
139   INT16 x = field.machine().root_device().ioport(portnames[port][1])->read();
140   INT16 y = field.machine().root_device().ioport(portnames[port][2])->read();
141141
142142   /* these are the theoretical boundaries, but we currently are always onscreen... */
143143   if (x < 0 || x >= SNES_SCR_WIDTH || y < 0 || y >= snes_ppu.beam.last_visible_line)
r15082r15083
150150
151151static TIMER_CALLBACK( lightgun_tick )
152152{
153   if ((input_port_read(machine, "CTRLSEL") & 0x0f) == 0x03 || (input_port_read(machine, "CTRLSEL") & 0x0f) == 0x04)
154   {
153   if ((machine.root_device().ioport("CTRLSEL")->read() & 0x0f) == 0x03 || (machine.root_device().ioport("CTRLSEL")->read() & 0x0f) == 0x04)   {
155154      /* enable lightpen crosshair */
156155      crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_ALL);
157156   }
r15082r15083
161160      crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_NONE);
162161   }
163162
164   if ((input_port_read(machine, "CTRLSEL") & 0xf0) == 0x30 || (input_port_read(machine, "CTRLSEL") & 0xf0) == 0x40)
163   if ((machine.root_device().ioport("CTRLSEL")->read() & 0xf0) == 0x30 || (machine.root_device().ioport("CTRLSEL")->read() & 0xf0) == 0x40)
165164   {
166165      /* enable lightpen crosshair */
167166      crosshair_set_screen(machine, 1, CROSSHAIR_SCREEN_ALL);
r15082r15083
176175
177176static INPUT_PORTS_START( snes_joypads )
178177   PORT_START("SERIAL1_DATA1_L")
179   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
180   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button X") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
181   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button L") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
182   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button R") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
178   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
179   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button X") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
180   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button L") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
181   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button R") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
183182   PORT_START("SERIAL1_DATA1_H")
184   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
185   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
186   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("P1 Select") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
187   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
188   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
189   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
190   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
191   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x01)
183   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
184   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
185   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("P1 Select") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
186   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
187   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
188   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
189   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
190   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x01)
192191
193192   PORT_START("SERIAL2_DATA1_L")
194   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button A") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
195   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button X") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
196   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button L") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
197   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button R") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
193   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button A") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
194   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button X") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
195   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button L") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
196   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button R") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
198197   PORT_START("SERIAL2_DATA1_H")
199   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
200   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
201   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("P2 Select") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
202   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Start") PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
203   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
204   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
205   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
206   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x10)
198   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
199   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
200   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("P2 Select") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
201   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Start") PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
202   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
203   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
204   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
205   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10)
207206
208207   PORT_START("SERIAL1_DATA2_L")
209208   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
r15082r15083
226225   /* bits 4,5 = mouse speed: 0 = slow, 1 = normal, 2 = fast, 3 = unused */
227226   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snes_mouse_speed_input, (void *)0)
228227   /* bits 6,7 = mouse buttons */
229   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Mouse Button Left") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
230   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Mouse Button Right") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
228   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Mouse Button Left") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
229   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Mouse Button Right") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
231230
232231   PORT_START("MOUSE1_X")
233   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
232   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
234233
235234   PORT_START("MOUSE1_Y")
236   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x02)
235   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x02)
237236
238237   PORT_START("MOUSE2")
239238   /* bits 0,3 = mouse signature (must be 1) */
r15082r15083
244243   /* bits 4,5 = mouse speed: 0 = slow, 1 = normal, 2 = fast, 3 = unused */
245244   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snes_mouse_speed_input, (void *)1)
246245   /* bits 6,7 = mouse buttons */
247   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Mouse Button Left") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
248   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Mouse Button Right") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
246   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Mouse Button Left") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
247   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Mouse Button Right") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
249248
250249   PORT_START("MOUSE2_X")
251   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
250   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
252251
253252   PORT_START("MOUSE2_Y")
254   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x20)
253   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x20)
255254INPUT_PORTS_END
256255
257256static INPUT_PORTS_START( snes_superscope )
r15082r15083
260259   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snes_superscope_offscreen_input, (void *)0)
261260   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
262261   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
263   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Port1 Superscope Pause") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
264   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Port1 Superscope Turbo") PORT_TOGGLE PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
265   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Port1 Superscope Cursor") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
266   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Port1 Superscope Fire") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
262   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Port1 Superscope Pause") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
263   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Port1 Superscope Turbo") PORT_TOGGLE PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
264   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Port1 Superscope Cursor") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
265   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Port1 Superscope Fire") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
267266
268267   PORT_START("SUPERSCOPE1_X")
269   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_NAME("Port1 Superscope X Axis") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
268   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_NAME("Port1 Superscope X Axis") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
270269
271270   PORT_START("SUPERSCOPE1_Y")
272   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_NAME("Port1 Superscope Y Axis") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, PORTCOND_EQUALS, 0x03)
271   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_NAME("Port1 Superscope Y Axis") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x0f, EQUALS, 0x03)
273272
274273   PORT_START("SUPERSCOPE2")
275274   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )   // Noise
276275   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snes_superscope_offscreen_input, (void *)1)
277276   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
278277   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
279   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Port2 Superscope Pause") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x30)
280   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Port2 Superscope Turbo") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x30)
281   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Port2 Superscope Cursor") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x30)
282   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Port2 Superscope Fire") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x30)
278   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Port2 Superscope Pause") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x30)
279   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Port2 Superscope Turbo") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x30)
280   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Port2 Superscope Cursor") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x30)
281   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Port2 Superscope Fire") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x30)
283282
284283   PORT_START("SUPERSCOPE2_X")
285   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_NAME("Port2 Superscope X Axis") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x30)
284   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_NAME("Port2 Superscope X Axis") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x30)
286285
287286   PORT_START("SUPERSCOPE2_Y")
288   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_NAME("Port2 Superscope Y Axis") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, PORTCOND_EQUALS, 0x30)
287   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_NAME("Port2 Superscope Y Axis") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x30)
289288INPUT_PORTS_END
290289
291290static INPUT_PORTS_START( snes )
r15082r15083
401400            { "SERIAL2_DATA1_L", "SERIAL2_DATA1_H", "SERIAL2_DATA2_L", "SERIAL2_DATA2_H" },
402401         };
403402
404   state->m_data1[port] = input_port_read(machine, portnames[port][0]) | (input_port_read(machine, portnames[port][1]) << 8);
405   state->m_data2[port] = input_port_read(machine, portnames[port][2]) | (input_port_read(machine, portnames[port][3]) << 8);
403   state->m_data1[port] = machine.root_device().ioport(portnames[port][0])->read() | (machine.root_device().ioport(portnames[port][1])->read() << 8);
404   state->m_data2[port] = machine.root_device().ioport(portnames[port][2])->read() | (machine.root_device().ioport(portnames[port][3])->read() << 8);
406405
407406   // avoid sending signals that could crash games
408407   // if left, no right
r15082r15083
425424            { "MOUSE2", "MOUSE2_X", "MOUSE2_Y" },
426425         };
427426
428   state->m_mouse[port].buttons = input_port_read(machine, portnames[port][0]);
429   state->m_mouse[port].x = input_port_read(machine, portnames[port][1]);
430   state->m_mouse[port].y = input_port_read(machine, portnames[port][2]);
427   state->m_mouse[port].buttons = machine.root_device().ioport(portnames[port][0])->read();
428   state->m_mouse[port].x = machine.root_device().ioport(portnames[port][1])->read();
429   state->m_mouse[port].y = machine.root_device().ioport(portnames[port][2])->read();
431430   var = state->m_mouse[port].x - state->m_mouse[port].oldx;
432431
433432   if (var < -127)
r15082r15083
489488   UINT8 input;
490489
491490   /* first read input bits */
492   state->m_scope[port].x = input_port_read(machine, portnames[port][1]);
493   state->m_scope[port].y = input_port_read(machine, portnames[port][2]);
494   input = input_port_read(machine, portnames[port][0]);
491   state->m_scope[port].x = machine.root_device().ioport(portnames[port][1])->read();
492   state->m_scope[port].y = machine.root_device().ioport(portnames[port][2])->read();
493   input = machine.root_device().ioport(portnames[port][0])->read();
495494
496495   /* then start elaborating input bits: only keep old turbo value */
497496   state->m_scope[port].buttons &= 0x20;
r15082r15083
543542static void snes_input_read( running_machine &machine )
544543{
545544   snes_state *state = machine.driver_data<snes_state>();
546   UINT8 ctrl1 = input_port_read(machine, "CTRLSEL") & 0x0f;
547   UINT8 ctrl2 = (input_port_read(machine, "CTRLSEL") & 0xf0) >> 4;
545   UINT8 ctrl1 = machine.root_device().ioport("CTRLSEL")->read() & 0x0f;
546   UINT8 ctrl2 = (machine.root_device().ioport("CTRLSEL")->read() & 0xf0) >> 4;
548547
549548   /* Check if lightgun has been chosen as input: if so, enable crosshair */
550549   machine.scheduler().timer_set(attotime::zero, FUNC(lightgun_tick));
r15082r15083
608607static UINT8 snes_oldjoy1_read( running_machine &machine )
609608{
610609   snes_state *state = machine.driver_data<snes_state>();
611   UINT8 ctrl1 = input_port_read(machine, "CTRLSEL") & 0x0f;
610   UINT8 ctrl1 = machine.root_device().ioport("CTRLSEL")->read() & 0x0f;
612611   UINT8 res = 0;
613612
614613   switch (ctrl1)
r15082r15083
648647static UINT8 snes_oldjoy2_read( running_machine &machine )
649648{
650649   snes_state *state = machine.driver_data<snes_state>();
651   UINT8 ctrl2 = (input_port_read(machine, "CTRLSEL") & 0xf0) >> 4;
650   UINT8 ctrl2 = (machine.root_device().ioport("CTRLSEL")->read() & 0xf0) >> 4;
652651   UINT8 res = 0;
653652
654653   switch (ctrl2)
src/mess/drivers/gp32.c
r15082r15083
10731073         // smartmedia
10741074         data = (data & ~0x000000FF) | (m_smc.datarx & 0xFF);
10751075         // buttons
1076         data = (data & ~0x0000FF00) | (input_port_read( machine(), "IN0") & 0x0000FF00);
1076         data = (data & ~0x0000FF00) | (ioport( "IN0")->read() & 0x0000FF00);
10771077      }
10781078      break;
10791079      // PDDAT
r15082r15083
10991099         if (!m_smc.do_write) data = data | 0x00000008;
11001100         if (!smartmedia->is_present()) data = data | 0x00000004;
11011101         // buttons
1102         data = (data & ~0x000000C0) | (input_port_read( machine(), "IN1") & 0x000000C0);
1102         data = (data & ~0x000000C0) | (ioport( "IN1")->read() & 0x000000C0);
11031103      }
11041104      break;
11051105   }
src/mess/drivers/channelf.c
r15082r15083
4848
4949READ8_MEMBER( channelf_state::channelf_port_0_r )
5050{
51   return port_read_with_latch(input_port_read(machine(), "PANEL"), m_latch[0]);
51   return port_read_with_latch(ioport("PANEL")->read(), m_latch[0]);
5252}
5353
5454READ8_MEMBER( channelf_state::channelf_port_1_r )
r15082r15083
5656   UINT8 ext_value;
5757
5858   if ((m_latch[0] & 0x40) == 0)
59      ext_value = input_port_read(machine(), "RIGHT_C");
59      ext_value = ioport("RIGHT_C")->read();
6060   else
61      ext_value = 0xc0 | input_port_read(machine(), "RIGHT_C");
61      ext_value = 0xc0 | ioport("RIGHT_C")->read();
6262
6363   return port_read_with_latch(ext_value,m_latch[1]);
6464}
r15082r15083
6868   UINT8 ext_value;
6969
7070   if ((m_latch[0] & 0x40) == 0)
71      ext_value = input_port_read(machine(), "LEFT_C");
71      ext_value = ioport("LEFT_C")->read();
7272   else
7373      ext_value = 0xff;
7474
src/mess/drivers/4004clk.c
r15082r15083
3232
3333READ8_MEMBER(nixieclock_state::data_r)
3434{
35   return input_port_read(machine(), "INPUT") & 0x0f;
35   return ioport("INPUT")->read() & 0x0f;
3636}
3737
3838static UINT8 nixie_to_num(UINT16 val)
src/mess/drivers/c80.c
r15082r15083
109109   {
110110      if (!BIT(m_keylatch, i))
111111      {
112         if (!BIT(input_port_read(machine(), "ROW0"), i)) data &= ~0x01;
113         if (!BIT(input_port_read(machine(), "ROW1"), i)) data &= ~0x02;
114         if (!BIT(input_port_read(machine(), "ROW2"), i)) data &= ~0x04;
112         if (!BIT(ioport("ROW0")->read(), i)) data &= ~0x01;
113         if (!BIT(ioport("ROW1")->read(), i)) data &= ~0x02;
114         if (!BIT(ioport("ROW2")->read(), i)) data &= ~0x04;
115115      }
116116   }
117117
src/mess/drivers/tmc2000e.c
r15082r15083
152152
153153READ_LINE_MEMBER( tmc2000e_state::clear_r )
154154{
155   return BIT(input_port_read(machine(), "RUN"), 0);
155   return BIT(ioport("RUN")->read(), 0);
156156}
157157
158158READ_LINE_MEMBER( tmc2000e_state::ef2_r )
r15082r15083
163163READ_LINE_MEMBER( tmc2000e_state::ef3_r )
164164{
165165   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
166   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
166   UINT8 data = ~ioport(keynames[m_keylatch / 8])->read();
167167
168168   return BIT(data, m_keylatch % 8);
169169}
src/mess/drivers/unior.c
r15082r15083
6767{
6868   char kbdrow[6];
6969   sprintf(kbdrow,"X%X", m_4c&15);
70   return input_port_read(machine(), kbdrow);
70   return ioport(kbdrow)->read();
7171}
7272
7373WRITE8_MEMBER( unior_state::unior_4c_w )
src/mess/drivers/pmi80.c
r15082r15083
5555{
5656   char kbdrow[6];
5757   sprintf(kbdrow,"%X",m_keyrow);
58   return input_port_read(machine(), kbdrow);
58   return ioport(kbdrow)->read();
5959}
6060
6161WRITE8_MEMBER( pmi80_state::keyboard_w )
src/mess/drivers/acrnsys1.c
r15082r15083
8080      {
8181         char kbdrow[6];
8282         sprintf(kbdrow,"X%X",i);
83         data = (input_port_read(machine(), kbdrow) & 0x38) | m_digit;
83         data = (ioport(kbdrow)->read() & 0x38) | m_digit;
8484         break;
8585      }
8686   }
src/mess/drivers/tek405x.c
r15082r15083
641641    */
642642
643643   UINT8 data = 0;
644   UINT8 special = input_port_read(machine(), "SPECIAL");
644   UINT8 special = ioport("SPECIAL")->read();
645645
646646   // keyboard column
647647   data = m_kc;
r15082r15083
670670    */
671671
672672   UINT8 data = 0;
673   UINT8 special = input_port_read(machine(), "SPECIAL");
673   UINT8 special = ioport("SPECIAL")->read();
674674
675675   // shift
676676   data |= (BIT(special, 0) & BIT(special, 1));
src/mess/drivers/coco3.c
r15082r15083
145145 
146146static INPUT_PORTS_START( coco3_joystick )
147147   PORT_START(JOYSTICK_RX_TAG)
148   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x01)
148   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01)
149149   PORT_START(JOYSTICK_RY_TAG)
150   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x01)
150   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01)
151151   PORT_START(JOYSTICK_LX_TAG)
152   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x10)
152   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10)
153153   PORT_START(JOYSTICK_LY_TAG)
154   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x10)
154   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10)
155155   PORT_START(JOYSTICK_BUTTONS_TAG)
156   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button 1") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x01)
157   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Right Button 1") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x01)
158   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button 1")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x10)
159   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Left Button 1")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x10)
156   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button 1") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01)
157   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Right Button 1") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01)
158   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button 1")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10)
159   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Left Button 1")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10)
160160INPUT_PORTS_END
161161 
162162 
r15082r15083
167167 
168168static INPUT_PORTS_START( coco_rat_mouse )
169169   PORT_START(RAT_MOUSE_RX_TAG)
170   PORT_BIT( 0x03, 0x00,  IPT_MOUSE_X) PORT_NAME("Rat Mouse X (Right Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1)  PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x02)
170   PORT_BIT( 0x03, 0x00,  IPT_MOUSE_X) PORT_NAME("Rat Mouse X (Right Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1)  PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x02)
171171   PORT_START(RAT_MOUSE_RY_TAG)
172   PORT_BIT( 0x03, 0x00,  IPT_MOUSE_Y) PORT_NAME("Rat Mouse Y (Right Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_UP) PORT_CODE_INC(KEYCODE_DOWN) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x02)
172   PORT_BIT( 0x03, 0x00,  IPT_MOUSE_Y) PORT_NAME("Rat Mouse Y (Right Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_UP) PORT_CODE_INC(KEYCODE_DOWN) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x02)
173173   PORT_START(RAT_MOUSE_LX_TAG)
174   PORT_BIT( 0x03, 0x00,  IPT_MOUSE_X) PORT_NAME("Rat Mouse X (Left Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2)  PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x20)
174   PORT_BIT( 0x03, 0x00,  IPT_MOUSE_X) PORT_NAME("Rat Mouse X (Left Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2)  PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x20)
175175   PORT_START(RAT_MOUSE_LY_TAG)
176   PORT_BIT( 0x03, 0x00,  IPT_MOUSE_Y) PORT_NAME("Rat Mouse Y (Left Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_UP) PORT_CODE_INC(KEYCODE_DOWN) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x20)
176   PORT_BIT( 0x03, 0x00,  IPT_MOUSE_Y) PORT_NAME("Rat Mouse Y (Left Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_UP) PORT_CODE_INC(KEYCODE_DOWN) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x20)
177177   PORT_START(RAT_MOUSE_BUTTONS_TAG)
178   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Rat Mouse Button 1 (Right Port)") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x02)
179   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Rat Mouse Button 2 (Right Port)") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x02)
180   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Rat Mouse Button 1 (Left Port)")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x20)
181   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Rat Mouse Button 2 (Left Port)")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x20)
178   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Rat Mouse Button 1 (Right Port)") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x02)
179   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Rat Mouse Button 2 (Right Port)") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x02)
180   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Rat Mouse Button 1 (Left Port)")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x20)
181   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Rat Mouse Button 2 (Left Port)")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x20)
182182INPUT_PORTS_END
183183 
184184 
r15082r15083
189189 
190190static INPUT_PORTS_START( coco_lightgun )
191191   PORT_START(DIECOM_LIGHTGUN_RX_TAG)
192   PORT_BIT( 0x1ff, 266, IPT_LIGHTGUN_X ) PORT_NAME("Lightgun X (Right Port)") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(116,416) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x03)
192   PORT_BIT( 0x1ff, 266, IPT_LIGHTGUN_X ) PORT_NAME("Lightgun X (Right Port)") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(116,416) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x03)
193193   PORT_START(DIECOM_LIGHTGUN_RY_TAG)
194   PORT_BIT( 0xff, 121, IPT_LIGHTGUN_Y ) PORT_NAME("Lightgun Y (Right Port)") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0,242) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x03)
194   PORT_BIT( 0xff, 121, IPT_LIGHTGUN_Y ) PORT_NAME("Lightgun Y (Right Port)") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0,242) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x03)
195195   PORT_START(DIECOM_LIGHTGUN_LX_TAG)
196   PORT_BIT( 0x1ff, 266, IPT_LIGHTGUN_X ) PORT_NAME("Lightgun X (Left Port)") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(116,416) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x30)
196   PORT_BIT( 0x1ff, 266, IPT_LIGHTGUN_X ) PORT_NAME("Lightgun X (Left Port)") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(116,416) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x30)
197197   PORT_START(DIECOM_LIGHTGUN_LY_TAG)
198   PORT_BIT( 0xff, 121, IPT_LIGHTGUN_Y ) PORT_NAME("Lightgun Y (Left Port)") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0,242) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x30)
198   PORT_BIT( 0xff, 121, IPT_LIGHTGUN_Y ) PORT_NAME("Lightgun Y (Left Port)") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0,242) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x30)
199199   PORT_START(DIECOM_LIGHTGUN_BUTTONS_TAG)
200   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightgun Trigger (Right Port)") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, PORTCOND_EQUALS, 0x03)
201   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightgun Trigger (Left Port)")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, PORTCOND_EQUALS, 0x30)
200   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightgun Trigger (Right Port)") PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x03)
201   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightgun Trigger (Left Port)")  PORT_CHANGED(coco_state::keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x30)
202202INPUT_PORTS_END
203203 
204204 
src/mess/drivers/pegasus.c
r15082r15083
103103   static const char *const keynames[] = { "X0", "X1", "X2", "X3", "X4", "X5", "X6", "X7" };
104104   UINT8 bit,data = 0xff;
105105   for (bit = 0; bit < 8; bit++)
106      if (!BIT(m_kbd_row, bit)) data &= input_port_read(machine(), keynames[bit]);
106      if (!BIT(m_kbd_row, bit)) data &= ioport(keynames[bit])->read();
107107
108108   m_kbd_irq = (data == 0xff) ? 1 : 0;
109109   if (m_control_bits & 8) data<<=4;
src/mess/drivers/tsispch.c
r15082r15083
197197     * which makes this register read 0xFC
198198     * When s4-7 is turned on, it reads 0xBC
199199     */
200   data = input_port_read(machine(), "s4");
200   data = ioport("s4")->read();
201201   return data;
202202}
203203
src/mess/drivers/intv.c
r15082r15083
200200   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED )
201201
202202   PORT_START("DISC1")
203   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Left/Up") PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
204   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Up-Up-Right") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
205   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Up-Right") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
206   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Right-Up-Right") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
207   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("Left/Right") PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
208   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Right-Down-Right") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
209   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Down-Right") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
210   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Down-Down-Right") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
211   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("Left/Down") PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
212   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Down-Down-Left") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
213   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Down-Left") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
214   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Left-Down-Left") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
215   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("Left/Left") PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
216   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Left-Up-Left") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
217   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Up-Left") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
218   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Up-Up-Left") PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x00)
203   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Left/Up") PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
204   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Up-Up-Right") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
205   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Up-Right") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
206   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Right-Up-Right") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
207   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("Left/Right") PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
208   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Right-Down-Right") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
209   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Down-Right") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
210   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Down-Down-Right") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
211   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("Left/Down") PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
212   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Down-Down-Left") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
213   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Down-Left") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
214   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Left-Down-Left") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
215   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("Left/Left") PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
216   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Left-Up-Left") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
217   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Up-Left") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
218   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left/Up-Up-Left") PORT_CONDITION("OPTIONS",0x01,EQUALS,0x00)
219219
220220   PORT_START("DISCX1")
221   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_X ) PORT_NAME("Left/X") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x01)
221   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_X ) PORT_NAME("Left/X") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,EQUALS,0x01)
222222
223223   PORT_START("DISCY1")
224   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_Y ) PORT_NAME("Left/Y") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_UP) PORT_CODE_INC(KEYCODE_DOWN) PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,PORTCOND_EQUALS,0x01)
224   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_Y ) PORT_NAME("Left/Y") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_UP) PORT_CODE_INC(KEYCODE_DOWN) PORT_PLAYER(1) PORT_CONDITION("OPTIONS",0x01,EQUALS,0x01)
225225
226226   PORT_START("KEYPAD2")   /* Right Player Controller Starts Here */
227227   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Right/1")
r15082r15083
242242   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED )
243243
244244   PORT_START("DISC2")
245   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Right/Up") PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
246   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Up-Up-Right") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
247   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Up-Right") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
248   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Right-Up-Right") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
249   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("Right/Right") PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
250   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Right-Down-Right") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
251   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Down-Right") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
252   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Down-Down-Right") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
253   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("Right/Down") PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
254   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Down-Down-Left") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
255   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Down-Left") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
256   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Left-Down-Left") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
257   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("Right/Left") PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
258   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Left-Up-Left") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
259   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Up-Left") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
260   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Up-Up-Left") PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x00)
245   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Right/Up") PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
246   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Up-Up-Right") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
247   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Up-Right") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
248   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Right-Up-Right") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
249   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("Right/Right") PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
250   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Right-Down-Right") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
251   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Down-Right") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
252   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Down-Down-Right") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
253   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("Right/Down") PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
254   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Down-Down-Left") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
255   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Down-Left") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
256   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Left-Down-Left") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
257   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("Right/Left") PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
258   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Left-Up-Left") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
259   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Up-Left") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
260   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right/Up-Up-Left") PORT_CONDITION("OPTIONS",0x02,EQUALS,0x00)
261261
262262   PORT_START("DISCX2")
263   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_X ) PORT_NAME("Right/X") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_D) PORT_CODE_INC(KEYCODE_G) PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x02)
263   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_X ) PORT_NAME("Right/X") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_D) PORT_CODE_INC(KEYCODE_G) PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,EQUALS,0x02)
264264
265265   PORT_START("DISCY2")
266   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_Y ) PORT_NAME("Right/Y") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_R) PORT_CODE_INC(KEYCODE_F) PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,PORTCOND_EQUALS,0x02)
266   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_Y ) PORT_NAME("Right/Y") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_R) PORT_CODE_INC(KEYCODE_F) PORT_PLAYER(2) PORT_CONDITION("OPTIONS",0x02,EQUALS,0x02)
267267
268268   PORT_START("OPTIONS")
269269   PORT_CONFNAME( 0x01, 0x00, "Left Disc" )
r15082r15083
294294
295295   PORT_START("ECS_ROW0")
296296   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
297   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RTN")            PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
298   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0)         PORT_CHAR('0') PORT_CHAR(')') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
299   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC)      PORT_CHAR(UCHAR_MAMEKEY(ESC)) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
300   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P)         PORT_CHAR('P') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
301   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON)   PORT_CHAR(';') PORT_CHAR(':') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
302   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP)      PORT_CHAR('.') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
303   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT)      PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CHAR('%') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
297   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RTN")            PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
298   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0)         PORT_CHAR('0') PORT_CHAR(')') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
299   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC)      PORT_CHAR(UCHAR_MAMEKEY(ESC)) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
300   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P)         PORT_CHAR('P') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
301   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON)   PORT_CHAR(';') PORT_CHAR(':') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
302   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP)      PORT_CHAR('.') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
303   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT)      PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CHAR('%') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
304304
305305   PORT_START("ECS_ROW1")
306   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L)         PORT_CHAR('L') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
307   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O)         PORT_CHAR('O') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
308   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8)         PORT_CHAR('8') PORT_CHAR('*') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
309   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9)         PORT_CHAR('9') PORT_CHAR('(') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
310   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I)         PORT_CHAR('I') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
311   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K)         PORT_CHAR('K') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
312   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M)         PORT_CHAR('M') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
313   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA)   PORT_CHAR(',') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
306   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L)         PORT_CHAR('L') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
307   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O)         PORT_CHAR('O') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
308   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8)         PORT_CHAR('8') PORT_CHAR('*') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
309   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9)         PORT_CHAR('9') PORT_CHAR('(') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
310   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I)         PORT_CHAR('I') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
311   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K)         PORT_CHAR('K') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
312   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M)         PORT_CHAR('M') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
313   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA)   PORT_CHAR(',') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
314314
315315   PORT_START("ECS_ROW2")
316   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J)         PORT_CHAR('J') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
317   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U)         PORT_CHAR('U') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
318   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6)         PORT_CHAR('6') PORT_CHAR('-') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
319   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7)         PORT_CHAR('7') PORT_CHAR('/') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
320   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y)         PORT_CHAR('Y') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
321   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H)         PORT_CHAR('H') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
322   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B)         PORT_CHAR('B') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
323   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N)         PORT_CHAR('N') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
316   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J)         PORT_CHAR('J') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
317   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U)         PORT_CHAR('U') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
318   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6)         PORT_CHAR('6') PORT_CHAR('-') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
319   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7)         PORT_CHAR('7') PORT_CHAR('/') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
320   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y)         PORT_CHAR('Y') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
321   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H)         PORT_CHAR('H') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
322   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B)         PORT_CHAR('B') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
323   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N)         PORT_CHAR('N') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
324324
325325   PORT_START("ECS_ROW3")
326   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G)         PORT_CHAR('G') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
327   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T)         PORT_CHAR('T') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
328   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4)         PORT_CHAR('4') PORT_CHAR('$') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
329   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5)         PORT_CHAR('5') PORT_CHAR('%') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
330   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R)         PORT_CHAR('R') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
331   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F)         PORT_CHAR('F') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
332   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C)         PORT_CHAR('C') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
333   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V)         PORT_CHAR('V') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
326   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G)         PORT_CHAR('G') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
327   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T)         PORT_CHAR('T') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
328   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4)         PORT_CHAR('4') PORT_CHAR('$') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
329   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5)         PORT_CHAR('5') PORT_CHAR('%') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
330   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R)         PORT_CHAR('R') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
331   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F)         PORT_CHAR('F') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
332   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C)         PORT_CHAR('C') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
333   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V)         PORT_CHAR('V') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
334334
335335   PORT_START("ECS_ROW4")
336   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D)         PORT_CHAR('D') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
337   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E)         PORT_CHAR('E') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
338   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2)         PORT_CHAR('2') PORT_CHAR('"') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
339   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3)         PORT_CHAR('3') PORT_CHAR('#') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
340   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W)         PORT_CHAR('W') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
341   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S)         PORT_CHAR('S') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
342   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z)         PORT_CHAR('Z') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
343   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X)         PORT_CHAR('X') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
336   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D)         PORT_CHAR('D') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
337   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E)         PORT_CHAR('E') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
338   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2)         PORT_CHAR('2') PORT_CHAR('"') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
339   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3)         PORT_CHAR('3') PORT_CHAR('#') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
340   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W)         PORT_CHAR('W') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
341   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S)         PORT_CHAR('S') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
342   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z)         PORT_CHAR('Z') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
343   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X)         PORT_CHAR('X') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
344344
345345   PORT_START("ECS_ROW5")
346   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A)         PORT_CHAR('A') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
347   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTL") PORT_CODE(KEYCODE_RCONTROL) PORT_CODE(KEYCODE_LCONTROL) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
348   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT)   PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR('\'') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
349   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1)         PORT_CHAR('1') PORT_CHAR('=') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
350   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q)         PORT_CHAR('Q') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
351   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP)      PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CHAR('^') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
352   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN)      PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CHAR('?') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
353   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE)   PORT_CHAR(' ') PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
346   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A)         PORT_CHAR('A') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
347   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTL") PORT_CODE(KEYCODE_RCONTROL) PORT_CODE(KEYCODE_LCONTROL) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
348   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT)   PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR('\'') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
349   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1)         PORT_CHAR('1') PORT_CHAR('=') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
350   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q)         PORT_CHAR('Q') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
351   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP)      PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CHAR('^') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
352   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN)      PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CHAR('?') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
353   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE)   PORT_CHAR(' ') PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
354354
355355   PORT_START("ECS_ROW6")
356   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_RSHIFT) PORT_CODE(KEYCODE_LSHIFT)  PORT_CHAR(UCHAR_SHIFT_1) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x02)
356   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_RSHIFT) PORT_CODE(KEYCODE_LSHIFT)  PORT_CHAR(UCHAR_SHIFT_1) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x02)
357357   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
358358   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
359359   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
376376 Bit 6  C6      NC      NC      NC      NC      NC      NC      NC
377377*/
378378   PORT_START("ECS_SYNTH_ROW0")
379   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
380   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Gb2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
381   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
382   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
383   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Eb2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
384   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
385   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Db2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
386   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
379   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
380   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Gb2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
381   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
382   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
383   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Eb2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
384   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
385   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Db2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
386   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
387387
388388   PORT_START("ECS_SYNTH_ROW1")
389   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Eb3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
390   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
391   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Db3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
392   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
393   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
394   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Bb2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
395   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
396   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ab2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
389   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Eb3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
390   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
391   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Db3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
392   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
393   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
394   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Bb2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
395   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
396   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ab2")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
397397
398398   PORT_START("ECS_SYNTH_ROW2")
399   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
400   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Bb3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
401   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
402   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ab3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
403   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
404   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Gb3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
405   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
406   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
399   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
400   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Bb3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
401   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
402   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ab3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
403   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
404   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Gb3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
405   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
406   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E3")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
407407
408408   PORT_START("ECS_SYNTH_ROW3")
409   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
410   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Gb4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
411   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
412   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
413   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Eb4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
414   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
415   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Db4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
416   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
409   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
410   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Gb4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
411   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
412   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
413   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Eb4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
414   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
415   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Db4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
416   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
417417
418418   PORT_START("ECS_SYNTH_ROW4")
419   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Eb5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
420   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
421   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Db5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
422   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
423   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
424   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Bb4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
425   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
426   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ab4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
419   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Eb5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
420   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
421   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Db5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
422   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
423   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
424   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Bb4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
425   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
426   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ab4")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
427427
428428   PORT_START("ECS_SYNTH_ROW5")
429   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
430   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Bb5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
431   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
432   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ab5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
433   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
434   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Gb5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
435   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
436   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
429   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
430   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Bb5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
431   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
432   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ab5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
433   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
434   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Gb5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
435   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
436   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E5")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
437437
438438   PORT_START("ECS_SYNTH_ROW6")
439   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C6")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x01)
439   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C6")  PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x01)
440440   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
441441   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
442442   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
r15082r15083
449449static INPUT_PORTS_START( intv_ecs_pads )
450450// First ECS Hand Controller
451451   PORT_START("KEYPAD3")
452   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/1") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
453   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/2") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
454   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/3") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
455   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/4") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
456   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/5") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
457   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/6") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
458   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/7") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
459   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/8") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
460   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/9") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
461   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/Clear") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
462   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/0") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
463   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/Enter") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
464   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3/Upper") PORT_PLAYER(3) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
465   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3/Lower-Left") PORT_PLAYER(3) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
466   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P3/Lower-Right") PORT_PLAYER(3) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
452   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/1") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
453   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/2") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
454   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/3") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
455   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/4") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
456   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/5") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
457   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/6") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
458   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/7") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
459   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/8") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
460   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/9") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
461   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/Clear") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
462   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/0") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
463   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P3/Enter") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
464   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3/Upper") PORT_PLAYER(3) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
465   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3/Lower-Left") PORT_PLAYER(3) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
466   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P3/Lower-Right") PORT_PLAYER(3) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
467467   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED )
468468
469469   PORT_START("DISC3")
470   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("P3/Up") PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
471   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Up-Up-Right") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
472   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Right") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
473   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Right-Up-Right") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
474   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("P3/Right") PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
475   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Right-Down-Right") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
476   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Down-Right") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
477   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Down-Down-Right") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
478   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("P3/Down") PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
479   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Down-Down-Left") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
480   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Down-Left") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
481   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Left-Down-Left") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
482   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("P3/Left") PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
483   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Left-Up-Left") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
484   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Up-Left") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
485   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Up-Up-Left") PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
470   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("P3/Up") PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
471   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Up-Up-Right") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
472   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Right") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
473   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Right-Up-Right") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
474   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("P3/Right") PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
475   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Right-Down-Right") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
476   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Down-Right") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
477   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Down-Down-Right") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
478   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("P3/Down") PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
479   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Down-Down-Left") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
480   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Down-Left") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
481   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Left-Down-Left") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
482   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("P3/Left") PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
483   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Left-Up-Left") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
484   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Up-Left") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
485   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3/Up-Up-Left") PORT_CONDITION("OPTIONS",0x04,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
486486
487487   PORT_START("DISCX3")
488   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_X ) PORT_NAME("P3/X") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x04) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
488   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_X ) PORT_NAME("P3/X") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,EQUALS,0x04) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
489489
490490   PORT_START("DISCY3")
491   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_Y ) PORT_NAME("P3/Y") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,PORTCOND_EQUALS,0x04) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
491   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_Y ) PORT_NAME("P3/Y") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_PLAYER(3) PORT_CONDITION("OPTIONS",0x04,EQUALS,0x04) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
492492
493493// Second ECS Hand Controller
494494   PORT_START("KEYPAD4")
495   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/1") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
496   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/2") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
497   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/3") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
498   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/4") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
499   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/5") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
500   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/6") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
501   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/7") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
502   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/8") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
503   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/9") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
504   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/Clear") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
505   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/0") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
506   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/Enter") PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
507   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4/Upper") PORT_PLAYER(4) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
508   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4/Lower-Left") PORT_PLAYER(4) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
509   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P4/Lower-Right") PORT_PLAYER(4) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
495   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/1") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
496   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/2") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
497   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/3") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
498   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/4") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
499   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/5") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
500   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/6") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
501   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/7") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
502   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/8") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
503   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/9") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
504   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/Clear") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
505   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/0") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
506   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("P4/Enter") PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
507   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4/Upper") PORT_PLAYER(4) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
508   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4/Lower-Left") PORT_PLAYER(4) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
509   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P4/Lower-Right") PORT_PLAYER(4) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
510510   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED )
511511
512512   PORT_START("DISC4")
513   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("P4/Up") PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
514   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Up-Up-Right") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
515   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Up-Right") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
516   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Right-Up-Right") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
517   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("P4/Right") PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
518   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Right-Down-Right") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
519   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Down-Right") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
520   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Down-Down-Right") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
521   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("P4/Down") PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
522   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Down-Down-Left") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
523   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Down-Left") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
524   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Left-Down-Left") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
525   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("P4/Left") PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
526   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Left-Up-Left") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
527   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Up-Left") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
528   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Up-Up-Left") PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
513   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("P4/Up") PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
514   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Up-Up-Right") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
515   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Up-Right") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
516   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Right-Up-Right") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
517   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("P4/Right") PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
518   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Right-Down-Right") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
519   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Down-Right") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
520   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Down-Down-Right") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
521   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("P4/Down") PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
522   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Down-Down-Left") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
523   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Down-Left") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
524   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Left-Down-Left") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
525   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("P4/Left") PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
526   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Left-Up-Left") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
527   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Up-Left") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
528   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4/Up-Up-Left") PORT_CONDITION("OPTIONS",0x08,EQUALS,0x00) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
529529
530530   PORT_START("DISCX4")
531   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_X ) PORT_NAME("Right/X") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_D) PORT_CODE_INC(KEYCODE_G) PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x08) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
531   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_X ) PORT_NAME("Right/X") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_D) PORT_CODE_INC(KEYCODE_G) PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,EQUALS,0x08) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
532532
533533   PORT_START("DISCY4")
534   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_Y ) PORT_NAME("Right/Y") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_R) PORT_CODE_INC(KEYCODE_F) PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,PORTCOND_EQUALS,0x08) PORT_CONDITION("ECS_CNTRLSEL",0x0f,PORTCOND_EQUALS,0x00)
534   PORT_BIT( 0xff, 0x50, IPT_AD_STICK_Y ) PORT_NAME("Right/Y") PORT_MINMAX(0x00,0x9f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x50) PORT_CODE_DEC(KEYCODE_R) PORT_CODE_INC(KEYCODE_F) PORT_PLAYER(4) PORT_CONDITION("OPTIONS",0x08,EQUALS,0x08) PORT_CONDITION("ECS_CNTRLSEL",0x0f,EQUALS,0x00)
535535INPUT_PORTS_END
536536
537537static INPUT_PORTS_START( intvecs )
src/mess/drivers/elwro800.c
r15082r15083
250250               {
251251                  port_name[4] = '0' + (7 - i);
252252               }
253               data &= (input_port_read(machine(), port_name));
253               data &= (ioport(port_name)->read());
254254            }
255255         }
256256
257257         if ((offset & 0xff) == 0xfb)
258258         {
259            data &= input_port_read(machine(), "LINE9");
259            data &= ioport("LINE9")->read();
260260         }
261261
262262         /* cassette input from wav */
r15082r15083
267267      }
268268      else
269269      {
270         data = input_port_read(machine(), "NETWORK ID");
270         data = ioport("NETWORK ID")->read();
271271      }
272272
273273      return data;
src/mess/drivers/fidelz80.c
r15082r15083
628628
629629   if (!(m_kp_matrix&0x10))
630630   {
631      data &= input_port_read(machine(), "LINE1");
631      data &= ioport("LINE1")->read();
632632   }
633633   if (!(m_kp_matrix&0x20))
634634   {
635      data &= input_port_read(machine(), "LINE2");
635      data &= ioport("LINE2")->read();
636636   }
637637   if (!(m_kp_matrix&0x40))
638638   {
639      data &= input_port_read(machine(), "LINE3");
639      data &= ioport("LINE3")->read();
640640   }
641641   if (!(m_kp_matrix&0x80))
642642   {
643      data &= input_port_read(machine(), "LINE4");
643      data &= ioport("LINE4")->read();
644644   }
645645
646646   return data;
r15082r15083
788788   UINT8 data = 0;
789789
790790   if (m_kp_matrix & 0x01)
791      data |= (input_port_read(machine(), "COL_A"));
791      data |= (ioport("COL_A")->read());
792792   if (m_kp_matrix & 0x02)
793      data |= (input_port_read(machine(), "COL_B"));
793      data |= (ioport("COL_B")->read());
794794   if (m_kp_matrix & 0x04)
795      data |= (input_port_read(machine(), "COL_C"));
795      data |= (ioport("COL_C")->read());
796796   if (m_kp_matrix & 0x08)
797      data |= (input_port_read(machine(), "COL_D"));
797      data |= (ioport("COL_D")->read());
798798   if (m_kp_matrix & 0x10)
799      data |= (input_port_read(machine(), "COL_E"));
799      data |= (ioport("COL_E")->read());
800800   if (m_kp_matrix & 0x20)
801      data |= (input_port_read(machine(), "COL_F"));
801      data |= (ioport("COL_F")->read());
802802   if (m_kp_matrix & 0x40)
803      data |= (input_port_read(machine(), "COL_G"));
803      data |= (ioport("COL_G")->read());
804804   if (m_kp_matrix & 0x80)
805      data |= (input_port_read(machine(), "COL_H"));
805      data |= (ioport("COL_H")->read());
806806   if (m_kp_matrix & 0x100)
807      data |= (input_port_read(machine(), "COL_I"));
807      data |= (ioport("COL_I")->read());
808808   if (m_kp_matrix & 0x200)
809      data |= (input_port_read(machine(), "COL_L"));
809      data |= (ioport("COL_L")->read());
810810
811811   return data & 0xff;
812812}
r15082r15083
902902   UINT8 data = 0xff;
903903
904904   if (m_kp_matrix & 0x01)
905      data &= input_port_read(machine(), "LINE1");
905      data &= ioport("LINE1")->read();
906906   if (m_kp_matrix & 0x02)
907      data &= input_port_read(machine(), "LINE2");
907      data &= ioport("LINE2")->read();
908908   if (m_kp_matrix & 0x04)
909      data &= input_port_read(machine(), "LINE3");
909      data &= ioport("LINE3")->read();
910910   if (m_kp_matrix & 0x08)
911      data &= input_port_read(machine(), "LINE4");
911      data &= ioport("LINE4")->read();
912912   if (m_kp_matrix & 0x10)
913      data &= input_port_read(machine(), "LINE5");
913      data &= ioport("LINE5")->read();
914914   if (m_kp_matrix & 0x20)
915      data &= input_port_read(machine(), "LINE6");
915      data &= ioport("LINE6")->read();
916916   if (m_kp_matrix & 0x40)
917      data &= input_port_read(machine(), "LINE7");
917      data &= ioport("LINE7")->read();
918918   if (m_kp_matrix & 0x80)
919      data &= input_port_read(machine(), "LINE8");
919      data &= ioport("LINE8")->read();
920920
921921   return (m_i8243->i8243_p2_r(offset)&0x0f) | (data&0xf0);
922922}
src/mess/drivers/pv2000.c
r15082r15083
103103   case 7:
104104   case 8:
105105      sprintf(kbdrow,"IN%d",m_keyb_column);
106      data = input_port_read( machine(), kbdrow ) >> 4;
106      data = ioport( kbdrow )->read() >> 4;
107107   }
108108
109109   return data;
r15082r15083
130130   case 8:
131131   case 9:
132132      sprintf(kbdrow,"IN%d",m_keyb_column);
133      data = input_port_read( machine(), kbdrow ) & 0x0f;
133      data = ioport( kbdrow )->read() & 0x0f;
134134   }
135135
136136   return 0xf0 | data;
r15082r15083
139139
140140READ8_MEMBER( pv2000_state::pv2000_keys_mod_r )
141141{
142   return 0xf0 | input_port_read( machine(), "MOD" );
142   return 0xf0 | ioport( "MOD" )->read();
143143}
144144
145145READ8_MEMBER( pv2000_state::cass_in )
r15082r15083
315315      /* Check if a key is pressed */
316316      UINT8 key_pressed;
317317
318      key_pressed = input_port_read( machine(), "IN0" )
319         | input_port_read( machine(), "IN1" )
320         | input_port_read( machine(), "IN2" )
321         | input_port_read( machine(), "IN3" )
322         | input_port_read( machine(), "IN4" )
323         | input_port_read( machine(), "IN5" )
324         | input_port_read( machine(), "IN6" )
325         | input_port_read( machine(), "IN7" )
326         | input_port_read( machine(), "IN8" );
318      key_pressed = ioport( "IN0" )->read()
319         | ioport( "IN1" )->read()
320         | ioport( "IN2" )->read()
321         | ioport( "IN3" )->read()
322         | ioport( "IN4" )->read()
323         | ioport( "IN5" )->read()
324         | ioport( "IN6" )->read()
325         | ioport( "IN7" )->read()
326         | ioport( "IN8" )->read();
327327
328328      if ( key_pressed && m_key_pressed != key_pressed )
329329         cputag_set_input_line(machine(), "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE);
src/mess/drivers/mephisto.c
r15082r15083
117117
118118   data = 0xff;
119119   if (((m_led_status & 0x80) == 0x00))
120      data=input_port_read(machine(), keynames[0][offset]);
120      data=ioport(keynames[0][offset])->read();
121121   else
122      data=input_port_read(machine(), keynames[1][offset]);
122      data=ioport(keynames[1][offset])->read();
123123
124124   logerror("Keyboard Port = %s Data = %d\n  ", ((m_led_status & 0x80) == 0x00) ? keynames[0][offset] : keynames[1][offset], data);
125125   return data | 0x7f;
src/mess/drivers/pyl601.c
r15082r15083
155155{
156156   UINT8 retVal = 0x3f;
157157   UINT8 *keyboard = memregion("keyboard")->base();
158   UINT16 row1 = input_port_read(machine(), "ROW1");
159   UINT16 row2 = input_port_read(machine(), "ROW2");
160   UINT16 row3 = input_port_read(machine(), "ROW3");
161   UINT16 row4 = input_port_read(machine(), "ROW4");
162   UINT16 row5 = input_port_read(machine(), "ROW5");
158   UINT16 row1 = ioport("ROW1")->read();
159   UINT16 row2 = ioport("ROW2")->read();
160   UINT16 row3 = ioport("ROW3")->read();
161   UINT16 row4 = ioport("ROW4")->read();
162   UINT16 row5 = ioport("ROW5")->read();
163163   UINT16 all = row1 | row2 | row3 | row4 | row5;
164   UINT16 addr = input_port_read(machine(), "MODIFIERS");
164   UINT16 addr = ioport("MODIFIERS")->read();
165165   if (all)
166166   {
167167      addr |= selectedline(all) << 2;
src/mess/drivers/scv.c
r15082r15083
180180   UINT8 data = 0xff;
181181
182182   if ( ! ( m_porta & 0x01 ) )
183      data &= input_port_read( machine(), "PA0" );
183      data &= ioport( "PA0" )->read();
184184
185185   if ( ! ( m_porta & 0x02 ) )
186      data &= input_port_read( machine(), "PA1" );
186      data &= ioport( "PA1" )->read();
187187
188188   if ( ! ( m_porta & 0x04 ) )
189      data &= input_port_read( machine(), "PA2" );
189      data &= ioport( "PA2" )->read();
190190
191191   if ( ! ( m_porta & 0x08 ) )
192      data &= input_port_read( machine(), "PA3" );
192      data &= ioport( "PA3" )->read();
193193
194194   if ( ! ( m_porta & 0x10 ) )
195      data &= input_port_read( machine(), "PA4" );
195      data &= ioport( "PA4" )->read();
196196
197197   if ( ! ( m_porta & 0x20 ) )
198      data &= input_port_read( machine(), "PA5" );
198      data &= ioport( "PA5" )->read();
199199
200200   if ( ! ( m_porta & 0x40 ) )
201      data &= input_port_read( machine(), "PA6" );
201      data &= ioport( "PA6" )->read();
202202
203203   if ( ! ( m_porta & 0x80 ) )
204      data &= input_port_read( machine(), "PA7" );
204      data &= ioport( "PA7" )->read();
205205
206206   return data;
207207}
r15082r15083
211211{
212212   UINT8 data = m_portc;
213213
214   data = ( data & 0xfe ) | ( input_port_read( machine(), "PC0" ) & 0x01 );
214   data = ( data & 0xfe ) | ( ioport( "PC0" )->read() & 0x01 );
215215
216216   return data;
217217}
src/mess/drivers/mstation.c
r15082r15083
302302   for (int i=0; i<10; i++)
303303   {
304304      if (!(m_kb_matrix & (1<<i)))
305         data &= input_port_read(machine(), bitnames[i]);
305         data &= ioport(bitnames[i])->read();
306306   }
307307
308308   return data;
src/mess/drivers/supercon.c
r15082r15083
206206
207207/* border pieces and moving piece */
208208
209   port_input=input_port_read(machine, "B_WHITE");
209   port_input=machine.root_device().ioport("B_WHITE")->read();
210210   if (port_input)
211211   {
212212      i=get_first_bit(port_input);
r15082r15083
216216   }
217217
218218
219   port_input=input_port_read(machine, "B_BLACK");
219   port_input=machine.root_device().ioport("B_BLACK")->read();
220220   if (port_input)
221221   {
222222      i=get_first_bit(port_input);
r15082r15083
226226   }
227227
228228
229   port_input=input_port_read(machine, "B_CLR");
229   port_input=machine.root_device().ioport("B_CLR")->read();
230230   if (port_input)
231231   {
232232      if (state->m_moving_piece)
r15082r15083
329329   if (i==NOT_VALID)
330330      return 0xff;
331331
332   key_data=input_port_read(machine(), status_lines[i]);
332   key_data=ioport(status_lines[i])->read();
333333
334334   if (key_data != 0xc0)
335335   {
r15082r15083
385385      output_set_value("MOVING",m_moving_piece);
386386   }
387387
388   key_data=input_port_read(machine(), board_lines[i_18]);
388   key_data=ioport(board_lines[i_18])->read();
389389
390390   if (key_data != 0xff)
391391   {
r15082r15083
393393
394394/* Only if valid data and mouse button is pressed */
395395
396      if (key_data && input_port_read(machine(), "BUTTON_L"))
396      if (key_data && ioport("BUTTON_L")->read())
397397      {
398398
399399/* Set or remove pieces */
r15082r15083
507507{
508508   supercon_state *state = machine.driver_data<supercon_state>();
509509
510   if (input_port_read_safe(machine, "BUTTON_L",0) )            /* wait for mouse release */
510   if (state->ioport("BUTTON_L")->read_safe(0) )            /* wait for mouse release */
511511      state->m_timer_mouse_click->adjust(state->m_wait_time, 0);
512512   else
513513      state->m_selecting=FALSE;
src/mess/drivers/iq151.c
r15082r15083
106106   for (int i = 0; i < 8; i++)
107107   {
108108      sprintf(kbdrow,"X%X",i);
109      data &= input_port_read(machine(), kbdrow);
109      data &= ioport(kbdrow)->read();
110110   }
111111
112112   return data;
r15082r15083
120120   for (int i = 0; i < 8; i++)
121121   {
122122      sprintf(kbdrow,"X%X",i);
123      if (input_port_read(machine(), kbdrow) == 0xff)
123      if (ioport(kbdrow)->read() == 0xff)
124124         data |= (1 << i);
125125   }
126126
r15082r15083
140140   else
141141   {
142142      // kb read
143      data = input_port_read(machine(), "X8");
143      data = ioport("X8")->read();
144144   }
145145
146146   return (data & 0xf0) | (m_cassette_data & 0x0f);
src/mess/drivers/avigo.c
r15082r15083
322322
323323   if (!(m_key_line & 0x01))
324324   {
325      data &= input_port_read(machine(), "LINE0");
325      data &= ioport("LINE0")->read();
326326   }
327327
328328   if (!(m_key_line & 0x02))
329329   {
330      data &= input_port_read(machine(), "LINE1");
330      data &= ioport("LINE1")->read();
331331   }
332332
333333   if (!(m_key_line & 0x04))
334334   {
335      data &= input_port_read(machine(), "LINE2");
335      data &= ioport("LINE2")->read();
336336   }
337337
338338   /* bit 3 is cold/warm start */
r15082r15083
455455            if ((data & 0x08)!=0)
456456            {
457457               LOG(("a/d select x coordinate\n"));
458               LOG(("x coord: %d\n", input_port_read(machine(), "POSX")));
458               LOG(("x coord: %d\n", ioport("POSX")->read()));
459459
460460               /* on screen range 0x060->0x03a0 */
461               if (input_port_read(machine(), "LINE3") & 0x01)
461               if (ioport("LINE3")->read() & 0x01)
462462               {
463463                  /* this might not be totally accurate because hitable screen
464464                        area may include the border around the screen! */
465                  m_ad_value = input_port_read(machine(), "POSX");
465                  m_ad_value = ioport("POSX")->read();
466466               }
467467               else
468468               {
r15082r15083
485485                    0x0350->0x03a6 is panel at bottom */
486486
487487               LOG(("a/d select y coordinate\n"));
488               LOG(("y coord: %d\n", input_port_read(machine(), "POSY")));
488               LOG(("y coord: %d\n", ioport("POSY")->read()));
489489
490               if (input_port_read(machine(), "LINE3") & 0x01)
490               if (ioport("LINE3")->read() & 0x01)
491491               {
492                  m_ad_value = input_port_read(machine(), "POSY");
492                  m_ad_value = ioport("POSY")->read();
493493               }
494494               else
495495               {
r15082r15083
659659INPUT_CHANGED_MEMBER( avigo_state::pen_move_irq )
660660{
661661   // an irq is generated when the pen is down on the screen and is being moved
662   if (input_port_read(machine(), "LINE3") & 0x01)
662   if (ioport("LINE3")->read() & 0x01)
663663   {
664664      LOG(("pen move interrupt\n"));
665665      m_irq |= (1<<6);
src/mess/drivers/juicebox.c
r15082r15083
168168      case S3C44B0_GPIO_PORT_G :
169169      {
170170         data = 0x0000009F;
171         data = (data & ~0x1F) | (input_port_read( device->machine(), "PORTG") & 0x1F);
171         data = (data & ~0x1F) | (device->machine().root_device().ioport( "PORTG")->read() & 0x1F);
172172         #if defined(JUICEBOX_ENTER_DEBUG_MENU)
173173         if (juicebox->port_g_read_count++ < 1)
174174         {
src/mess/drivers/pro80.c
r15082r15083
7272{
7373   UINT8 data = 0x0f;
7474
75   if (!BIT(m_digit_sel, 0)) data &= input_port_read(machine(), "LINE0");
76   if (!BIT(m_digit_sel, 1)) data &= input_port_read(machine(), "LINE1");
77   if (!BIT(m_digit_sel, 2)) data &= input_port_read(machine(), "LINE2");
78   if (!BIT(m_digit_sel, 3)) data &= input_port_read(machine(), "LINE3");
79   if (!BIT(m_digit_sel, 4)) data &= input_port_read(machine(), "LINE4");
80   if (!BIT(m_digit_sel, 5)) data &= input_port_read(machine(), "LINE5");
75   if (!BIT(m_digit_sel, 0)) data &= ioport("LINE0")->read();
76   if (!BIT(m_digit_sel, 1)) data &= ioport("LINE1")->read();
77   if (!BIT(m_digit_sel, 2)) data &= ioport("LINE2")->read();
78   if (!BIT(m_digit_sel, 3)) data &= ioport("LINE3")->read();
79   if (!BIT(m_digit_sel, 4)) data &= ioport("LINE4")->read();
80   if (!BIT(m_digit_sel, 5)) data &= ioport("LINE5")->read();
8181
8282   // cassette-in bits go here - bit 4 = sync bit, bit 5 = data bit
8383   return data;
src/mess/drivers/lx800.c
r15082r15083
6666
6767   logerror("%s: lx800_porta_r(%02x)\n", machine().describe_context(), offset);
6868
69   result |= input_port_read(machine(), "LINEFEED") << 3;
70   result |= input_port_read(machine(), "FORMFEED") << 4;
69   result |= ioport("LINEFEED")->read() << 3;
70   result |= ioport("FORMFEED")->read() << 4;
7171   result |= 1 << 5;
7272
7373   result |= 1 << 7;
r15082r15083
9696
9797   logerror("%s: lx800_portc_r(%02x)\n", machine().describe_context(), offset);
9898
99   result |= input_port_read(machine(), "ONLINE") << 3;
99   result |= ioport("ONLINE")->read() << 3;
100100
101101   return result;
102102}
src/mess/drivers/mpz80.c
r15082r15083
468468   data |= m_int_pend << 1;
469469
470470   // boot address
471   data |= input_port_read(machine(), "16C") & 0xfc;
471   data |= ioport("16C")->read() & 0xfc;
472472
473473   return data;
474474}
r15082r15083
566566
567567static INPUT_PORTS_START( mpz80 )
568568   PORT_START("16C")
569   PORT_DIPNAME( 0xf8, 0xf8, "Power-On-Jump Address" ) PORT_DIPLOCATION("16C:1,2,3,4,5") PORT_CONDITION("12C", 0x02, PORTCOND_EQUALS, 0x02)
569   PORT_DIPNAME( 0xf8, 0xf8, "Power-On-Jump Address" ) PORT_DIPLOCATION("16C:1,2,3,4,5") PORT_CONDITION("12C", 0x02, EQUALS, 0x02)
570570   PORT_DIPSETTING(    0xf8, "F800H" )
571571   PORT_DIPSETTING(    0xf0, "F000H" )
572572   PORT_DIPSETTING(    0xe8, "E800H" )
r15082r15083
599599   PORT_DIPSETTING(    0x10, "Boot DJ/DMA" )
600600   PORT_DIPSETTING(    0x08, "Boot HD/DMA" )
601601   PORT_DIPSETTING(    0x00, "Boot HDCA" )
602   PORT_DIPNAME( 0x70, 0x00, "Diagnostics" ) PORT_DIPLOCATION("16C:2,3,4") PORT_CONDITION("12C", 0x02, PORTCOND_EQUALS, 0x00)
602   PORT_DIPNAME( 0x70, 0x00, "Diagnostics" ) PORT_DIPLOCATION("16C:2,3,4") PORT_CONDITION("12C", 0x02, EQUALS, 0x00)
603603   PORT_DIPSETTING(    0x00, "Read Registers" )
604604   PORT_DIPSETTING(    0x10, "Write Registers" )
605605   PORT_DIPSETTING(    0x20, "Write Map RAMs" )
src/mess/drivers/zrt80.c
r15082r15083
200200   UINT8 chr,gfx,inv;
201201   UINT16 mem,x;
202202   UINT32 *p = &bitmap.pix32(y);
203   UINT8 polarity = input_port_read(device->machine(), "DIPSW1") & 4 ? 0xff : 0;
203   UINT8 polarity = state->ioport("DIPSW1")->read() & 4 ? 0xff : 0;
204204
205205   for (x = 0; x < x_count; x++)
206206   {
src/mess/drivers/svision.c
r15082r15083
3030   switch (state->m_pet.state)
3131   {
3232      case 0:
33         state->m_pet.input = input_port_read(machine, "JOY2");
33         state->m_pet.input = machine.root_device().ioport("JOY2")->read();
3434         /* fall through */
3535
3636      case 2: case 4: case 6: case 8:
r15082r15083
7979   switch (offset)
8080   {
8181      case 0x20:
82         data = input_port_read(machine(), "JOY");
82         data = ioport("JOY")->read();
8383         break;
8484      case 0x21:
8585         data &= ~0xf;
src/mess/drivers/c64.c
r15082r15083
4040
4141void c64_state::check_interrupts()
4242{
43   int restore = BIT(input_port_read(machine(), "SPECIAL"), 7);
43   int restore = BIT(ioport("SPECIAL")->read(), 7);
4444
4545   m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_cia1_irq | m_vic_irq | m_exp_irq);
4646   m_maincpu->set_input_line(INPUT_LINE_NMI, m_cia2_irq | restore | m_exp_nmi);
r15082r15083
125125         {
126126         case 0: // CIA1
127127            if (offset & 1)
128               cia_set_port_mask_value(m_cia1, 1, input_port_read(machine(), "CTRLSEL") & 0x80 ? c64_keyline[9] : c64_keyline[8] );
128               cia_set_port_mask_value(m_cia1, 1, ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[9] : c64_keyline[8] );
129129            else
130               cia_set_port_mask_value(m_cia1, 0, input_port_read(machine(), "CTRLSEL") & 0x80 ? c64_keyline[8] : c64_keyline[9] );
130               cia_set_port_mask_value(m_cia1, 0, ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[8] : c64_keyline[9] );
131131
132132            data = mos6526_r(m_cia1, offset & 0x0f);
133133            break;
r15082r15083
369369
370370READ8_MEMBER( c64_state::vic_lightpen_x_cb )
371371{
372   return input_port_read(machine(), "LIGHTX") & ~0x01;
372   return ioport("LIGHTX")->read() & ~0x01;
373373}
374374
375375READ8_MEMBER( c64_state::vic_lightpen_y_cb )
376376{
377   return input_port_read(machine(), "LIGHTY") & ~0x01;
377   return ioport("LIGHTY")->read() & ~0x01;
378378}
379379
380380READ8_MEMBER( c64_state::vic_lightpen_button_cb )
381381{
382   return input_port_read(machine(), "OTHER") & 0x04;
382   return ioport("OTHER")->read() & 0x04;
383383}
384384
385385READ8_MEMBER( c64_state::vic_dma_read )
r15082r15083
407407
408408READ8_MEMBER( c64_state::vic_rdy_cb )
409409{
410   return input_port_read(machine(), "CYCLES") & 0x07;
410   return ioport("CYCLES")->read() & 0x07;
411411}
412412
413413static const vic2_interface vic_ntsc_intf =
r15082r15083
450450
451451   int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp;
452452   UINT8 cia0porta = mos6526_pa_r(state->m_cia1, 0);
453   int controller1 = input_port_read(machine, "CTRLSEL") & 0x07;
454   int controller2 = input_port_read(machine, "CTRLSEL") & 0x70;
453   int controller1 = machine.root_device().ioport("CTRLSEL")->read() & 0x07;
454   int controller2 = machine.root_device().ioport("CTRLSEL")->read() & 0x70;
455455   // Notice that only a single input is defined for Mouse & Lightpen in both ports
456456   switch (controller1)
457457   {
458458      case 0x01:
459459         if (which)
460            pot2 = input_port_read(machine, "PADDLE2");
460            pot2 = machine.root_device().ioport("PADDLE2")->read();
461461         else
462            pot1 = input_port_read(machine, "PADDLE1");
462            pot1 = machine.root_device().ioport("PADDLE1")->read();
463463         break;
464464
465465      case 0x02:
466466         if (which)
467            pot2 = input_port_read(machine, "TRACKY");
467            pot2 = machine.root_device().ioport("TRACKY")->read();
468468         else
469            pot1 = input_port_read(machine, "TRACKX");
469            pot1 = machine.root_device().ioport("TRACKX")->read();
470470         break;
471471
472472      case 0x03:
473         if (which && (input_port_read(machine, "JOY1_2B") & 0x20))   // Joy1 Button 2
473         if (which && (machine.root_device().ioport("JOY1_2B")->read() & 0x20))   // Joy1 Button 2
474474            pot1 = 0x00;
475475         break;
476476
477477      case 0x04:
478478         if (which)
479            pot2 = input_port_read(machine, "LIGHTY");
479            pot2 = machine.root_device().ioport("LIGHTY")->read();
480480         else
481            pot1 = input_port_read(machine, "LIGHTX");
481            pot1 = machine.root_device().ioport("LIGHTX")->read();
482482         break;
483483
484484      case 0x06:
485         if (which && (input_port_read(machine, "OTHER") & 0x04))   // Lightpen Signal
485         if (which && (machine.root_device().ioport("OTHER")->read() & 0x04))   // Lightpen Signal
486486            pot2 = 0x00;
487487         break;
488488
r15082r15083
499499   {
500500      case 0x10:
501501         if (which)
502            pot4 = input_port_read(machine, "PADDLE4");
502            pot4 = machine.root_device().ioport("PADDLE4")->read();
503503         else
504            pot3 = input_port_read(machine, "PADDLE3");
504            pot3 = machine.root_device().ioport("PADDLE3")->read();
505505         break;
506506
507507      case 0x20:
508508         if (which)
509            pot4 = input_port_read(machine, "TRACKY");
509            pot4 = machine.root_device().ioport("TRACKY")->read();
510510         else
511            pot3 = input_port_read(machine, "TRACKX");
511            pot3 = machine.root_device().ioport("TRACKX")->read();
512512         break;
513513
514514      case 0x30:
515         if (which && (input_port_read(machine, "JOY2_2B") & 0x20))   // Joy2 Button 2
515         if (which && (machine.root_device().ioport("JOY2_2B")->read() & 0x20))   // Joy2 Button 2
516516            pot4 = 0x00;
517517         break;
518518
519519      case 0x40:
520520         if (which)
521            pot4 = input_port_read(machine, "LIGHTY");
521            pot4 = machine.root_device().ioport("LIGHTY")->read();
522522         else
523            pot3 = input_port_read(machine, "LIGHTX");
523            pot3 = machine.root_device().ioport("LIGHTX")->read();
524524         break;
525525
526526      case 0x60:
527         if (which && (input_port_read(machine, "OTHER") & 0x04))   // Lightpen Signal
527         if (which && (machine.root_device().ioport("OTHER")->read() & 0x04))   // Lightpen Signal
528528            pot4 = 0x00;
529529         break;
530530
r15082r15083
537537         break;
538538   }
539539
540   if (input_port_read(machine, "CTRLSEL") & 0x80)      // Swap
540   if (machine.root_device().ioport("CTRLSEL")->read() & 0x80)      // Swap
541541   {
542542      temp = pot1; pot1 = pot3; pot3 = temp;
543543      temp = pot2; pot2 = pot4; pot4 = temp;
src/mess/drivers/ti89.c
r15082r15083
3131   for (bit = 0; bit < 10; bit++)
3232      if (~m_kb_mask & (0x01 << bit))
3333         for (port = 0; port < 8; port++)
34            data ^= input_port_read(machine, bitnames[port]) & (0x01 << bit) ? 0x01 << port : 0x00;
34            data ^= machine.root_device().ioport(bitnames[port])->read() & (0x01 << bit) ? 0x01 << port : 0x00;
3535   return data;
3636}
3737
src/mess/drivers/xerox820.c
r15082r15083
9292   int table = 0, row, col;
9393   int keydata = -1;
9494
95   if (input_port_read(machine(), "ROW9") & 0x07)
95   if (ioport("ROW9")->read() & 0x07)
9696   {
9797      /* shift, upper case */
9898      table = 1;
9999   }
100100
101   if (input_port_read(machine(), "ROW9") & 0x18)
101   if (ioport("ROW9")->read() & 0x18)
102102   {
103103      /* ctrl */
104104      table = 2;
r15082r15083
107107   /* scan keyboard */
108108   for (row = 0; row < 9; row++)
109109   {
110      UINT8 data = input_port_read(machine(), keynames[row]);
110      UINT8 data = ioport(keynames[row])->read();
111111
112112      for (col = 0; col < 8; col++)
113113      {
src/mess/drivers/busicom.c
r15082r15083
2222READ8_MEMBER(busicom_state::keyboard_r)
2323{
2424   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8" , "LINE9"};
25   return input_port_read(machine(),keynames[get_bit_selected(m_keyboard_shifter & 0x3ff,10)]);
25   return ioport(keynames[get_bit_selected(m_keyboard_shifter & 0x3ff,10)])->read();
2626}
2727
2828READ8_MEMBER(busicom_state::printer_r)
2929{
3030   UINT8 retVal = 0;
3131   if (m_drum_index==0) retVal |= 1;
32   retVal |= input_port_read(machine(),"PAPERADV") & 1 ? 8 : 0;
32   retVal |= ioport("PAPERADV")->read() & 1 ? 8 : 0;
3333   return retVal;
3434}
3535
src/mess/drivers/chesstrv.c
r15082r15083
7979{
8080   UINT8 data = 0;
8181
82   data |= input_port_read(machine(), "LINE1");
83   data |= input_port_read(machine(), "LINE2");
84   data |= input_port_read(machine(), "LINE3");
85   data |= input_port_read(machine(), "LINE4");
86   data |= (input_port_read(machine(), "LINE1") ? 0x10 : 0);
87   data |= (input_port_read(machine(), "LINE2") ? 0x20 : 0);
88   data |= (input_port_read(machine(), "LINE3") ? 0x40 : 0);
89   data |= (input_port_read(machine(), "LINE4") ? 0x80 : 0);
82   data |= ioport("LINE1")->read();
83   data |= ioport("LINE2")->read();
84   data |= ioport("LINE3")->read();
85   data |= ioport("LINE4")->read();
86   data |= (ioport("LINE1")->read() ? 0x10 : 0);
87   data |= (ioport("LINE2")->read() ? 0x20 : 0);
88   data |= (ioport("LINE3")->read() ? 0x40 : 0);
89   data |= (ioport("LINE4")->read() ? 0x80 : 0);
9090
9191   return data;
9292}
r15082r15083
102102
103103   switch (m_matrix & 7)
104104   {
105      case 0:      data |= input_port_read(machine(), "LINE1");   break;
106      case 1:      data |= input_port_read(machine(), "LINE2");   break;
107      case 2:      data |= input_port_read(machine(), "LINE3");   break;
108      case 3:      data |= input_port_read(machine(), "LINE4");   break;
105      case 0:      data |= ioport("LINE1")->read();   break;
106      case 1:      data |= ioport("LINE2")->read();   break;
107      case 2:      data |= ioport("LINE3")->read();   break;
108      case 3:      data |= ioport("LINE4")->read();   break;
109109   }
110110
111111   return data;
src/mess/drivers/ti99_4p.c
r15082r15083
566566      // (bit 1: INT1 status)
567567      // (bit 2: INT2 status)
568568      // bit 3-7: keyboard status bits 0 to 4
569      answer = ((input_port_read(machine(), keynames[m_keyboard_column >> 1]) >> ((m_keyboard_column & 1) * 8)) << 3) & 0xF8;
569      answer = ((ioport(keynames[m_keyboard_column >> 1])->read() >> ((m_keyboard_column & 1) * 8)) << 3) & 0xF8;
570570      if (m_alphalock_line==false)
571         answer &= ~(input_port_read(*this, "ALPHA") << 3);
571         answer &= ~(ioport("ALPHA")->read() << 3);
572572      break;
573573
574574   case TMS9901_INT8_INT15:
r15082r15083
577577      // bit 3: tape input mirror
578578      // bit 5-7: weird, not emulated
579579      if (m_keyboard_column == 7)   answer = 0x07;
580      else            answer = ((input_port_read(machine(), keynames[m_keyboard_column >> 1]) >> ((m_keyboard_column & 1) * 8)) >> 5) & 0x07;
580      else            answer = ((ioport(keynames[m_keyboard_column >> 1])->read() >> ((m_keyboard_column & 1) * 8)) >> 5) & 0x07;
581581      break;
582582
583583   case TMS9901_P0_P7:
src/mess/drivers/pc.c
r15082r15083
400400static INPUT_PORTS_START( pccga )
401401   PORT_START("IN0") /* IN0 */
402402   PORT_BIT ( 0xf0, 0xf0,    IPT_UNUSED )
403   PORT_BIT ( 0x08, 0x08,    IPT_VBLANK )
403   PORT_BIT ( 0x08, 0x08,    IPT_CUSTOM ) PORT_VBLANK("screen")
404404   PORT_BIT ( 0x07, 0x07,    IPT_UNUSED )
405405
406406   PORT_START("DSW0") /* IN1 */
r15082r15083
470470static INPUT_PORTS_START( pcega )
471471   PORT_START("IN0") /* IN0 */
472472   PORT_BIT ( 0xf0, 0xf0,    IPT_UNUSED )
473   PORT_BIT ( 0x08, 0x08,    IPT_VBLANK )
473   PORT_BIT ( 0x08, 0x08,    IPT_CUSTOM ) PORT_VBLANK("screen")
474474   PORT_BIT ( 0x07, 0x07,    IPT_UNUSED )
475475
476476   PORT_START("DSW0") /* IN1 */
r15082r15083
541541static INPUT_PORTS_START( europc )
542542   PORT_START("IN0") /* IN0 */
543543   PORT_BIT ( 0xf0, 0xf0,    IPT_UNUSED )
544   PORT_BIT ( 0x08, 0x08,    IPT_VBLANK )
544   PORT_BIT ( 0x08, 0x08,    IPT_CUSTOM ) PORT_VBLANK("screen")
545545   PORT_BIT ( 0x07, 0x07,    IPT_UNUSED )
546546
547547   PORT_START("DSW0") /* IN1 */
r15082r15083
591591static INPUT_PORTS_START( bondwell )
592592   PORT_START("IN0") /* IN0 */
593593   PORT_BIT ( 0xf0, 0xf0,    IPT_UNUSED )
594   PORT_BIT ( 0x08, 0x08,    IPT_VBLANK )
594   PORT_BIT ( 0x08, 0x08,    IPT_CUSTOM ) PORT_VBLANK("screen")
595595   PORT_BIT ( 0x07, 0x07,    IPT_UNUSED )
596596
597597   PORT_START("DSW0") /* IN1 */
r15082r15083
664664static INPUT_PORTS_START( tandy1t )
665665   PORT_START("IN0") /* IN0 */
666666   PORT_BIT ( 0xf0, 0xf0,    IPT_UNUSED )
667   PORT_BIT ( 0x08, 0x08,    IPT_VBLANK )
667   PORT_BIT ( 0x08, 0x08,    IPT_CUSTOM ) PORT_VBLANK("screen")
668668   PORT_BIT ( 0x07, 0x07,    IPT_UNUSED )
669669
670670   PORT_START("DSW0") /* IN1 */
src/mess/drivers/micronic.c
r15082r15083
123123   for (bit = 0; bit < 8; bit++)
124124      if (m_kp_matrix & (1 << bit))
125125         for (port = 0; port < 6; port++)
126            data |= input_port_read(machine(), bitnames[port]) & (0x01 << bit) ? 0x01 << port : 0x00;
126            data |= ioport(bitnames[port])->read() & (0x01 << bit) ? 0x01 << port : 0x00;
127127   return data;
128128}
129129
r15082r15083
156156
157157READ8_MEMBER( micronic_state::irq_flag_r )
158158{
159   return (input_port_read(machine(), "BACKBATTERY")<<4) | (input_port_read(machine(), "MAINBATTERY")<<3) | (keypad_r(space, offset) ? 0 : 1);
159   return (ioport("BACKBATTERY")->read()<<4) | (ioport("MAINBATTERY")->read()<<3) | (keypad_r(space, offset) ? 0 : 1);
160160}
161161
162162WRITE8_MEMBER( micronic_state::bank_select_w )
src/mess/drivers/ptcsol.c
r15082r15083
312312   data |= ay31015_get_output_pin( m_uart, AY31015_FE   ) ? 0x08 : 0;
313313   ay31015_set_input_pin( m_uart, AY31015_SWE, 1 );
314314
315   bool arrowkey = input_port_read(machine(), "ARROWS") ? 0 : 1;
315   bool arrowkey = ioport("ARROWS")->read() ? 0 : 1;
316316   bool keydown = m_sol20_fa & 1;
317317
318318   return data | (arrowkey & keydown);
r15082r15083
328328
329329READ8_MEMBER( sol20_state::sol20_fc_r )
330330{
331   UINT8 data = input_port_read(machine(), "ARROWS");
331   UINT8 data = ioport("ARROWS")->read();
332332   if (BIT(data, 0)) return 0x32;
333333   if (BIT(data, 1)) return 0x34;
334334   if (BIT(data, 2)) return 0x36;
r15082r15083
556556   ay31015_set_input_pin( m_uart, AY31015_CS, 1 );
557557
558558   // set switched uart pins
559   data = input_port_read(machine(), "S4");
559   data = ioport("S4")->read();
560560   ay31015_set_input_pin( m_uart_s, AY31015_CS, 0 );
561561   ay31015_set_input_pin( m_uart_s, AY31015_NB1, BIT(data, 1) ? 1 : 0);
562562   ay31015_set_input_pin( m_uart_s, AY31015_NB2, BIT(data, 2) ? 1 : 0);
r15082r15083
566566   ay31015_set_input_pin( m_uart_s, AY31015_CS, 1 );
567567
568568   // set rs232 baud rate
569   data = input_port_read(machine(), "S3");
569   data = ioport("S3")->read();
570570
571571   if (data > 1)
572572      do
r15082r15083
576576      }
577577      while (!(data & 1) && (s_count < 7)); // find which switch is used
578578
579   if ((s_count == 7) && (input_port_read(machine(), "CONFIG")&1)) // if highest, look at jumper
579   if ((s_count == 7) && (ioport("CONFIG")->read()&1)) // if highest, look at jumper
580580      s_clock = 9600 << 4;
581581   else
582582      s_clock = s_bauds[s_count] << 4;
r15082r15083
608608// Each character is 9 pixels wide (blank ones at the right) and 13 lines deep.
609609// Note on blinking characters:
610610// any character with bit 7 set will blink. With DPMON, do DA C000 C2FF to see what happens
611   UINT8 s1 = input_port_read(machine(), "S1");
612   UINT16 which = (input_port_read(machine(), "CONFIG") & 2) << 10;
611   UINT8 s1 = ioport("S1")->read();
612   UINT16 which = (ioport("CONFIG")->read() & 2) << 10;
613613   UINT8 y,ra,chr,gfx;
614614   UINT16 sy=0,ma,x,inv;
615615   UINT8 polarity = (s1 & 8) ? 0xff : 0;
src/mess/drivers/pce.c
r15082r15083
118118
119119   PORT_START("JOY_P1")
120120   /* II is left of I on the original pad so we map them in reverse order */
121   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button I") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0000)
122   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Button II") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0000)
123   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P1 Select") PORT_PLAYER(1)      PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0000)
124   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P1 Run") PORT_PLAYER(1)         PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0000)
125   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)                     PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0000)
126   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0000)
127   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0000)
128   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0000)
121   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button I") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0000)
122   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Button II") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0000)
123   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P1 Select") PORT_PLAYER(1)      PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0000)
124   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P1 Run") PORT_PLAYER(1)         PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0000)
125   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)                     PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0000)
126   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0000)
127   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0000)
128   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0000)
129129
130130   PORT_START("JOY_P2")
131131   /* II is left of I on the original pad so we map them in reverse order */
132   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Button I") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0000)
133   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Button II") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0000)
134   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P2 Select") PORT_PLAYER(2)      PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0000)
135   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P2 Run") PORT_PLAYER(2)         PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0000)
136   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)                   PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0000)
137   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)                  PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0000)
138   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)                  PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0000)
139   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)                  PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0000)
132   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Button I") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0000)
133   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Button II") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0000)
134   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P2 Select") PORT_PLAYER(2)      PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0000)
135   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P2 Run") PORT_PLAYER(2)         PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0000)
136   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)                   PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0000)
137   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)                  PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0000)
138   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)                  PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0000)
139   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)                  PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0000)
140140
141141   PORT_START("JOY_P3")
142142   /* II is left of I on the original pad so we map them in reverse order */
143   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P3 Button I") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0000)
144   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P3 Button II") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0000)
145   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P3 Select") PORT_PLAYER(3)      PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0000)
146   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P3 Run") PORT_PLAYER(3)         PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0000)
147   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)                   PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0000)
148   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)                  PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0000)
149   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)                  PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0000)
150   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)                  PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0000)
143   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P3 Button I") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0000)
144   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P3 Button II") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0000)
145   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P3 Select") PORT_PLAYER(3)      PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0000)
146   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P3 Run") PORT_PLAYER(3)         PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0000)
147   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)                   PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0000)
148   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)                  PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0000)
149   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)                  PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0000)
150   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)                  PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0000)
151151
152152   PORT_START("JOY_P4")
153153   /* II is left of I on the original pad so we map them in reverse order */
154   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P4 Button I") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0000)
155   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P4 Button II") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0000)
156   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P4 Select") PORT_PLAYER(4)      PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0000)
157   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P4 Run") PORT_PLAYER(4)         PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0000)
158   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)                   PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0000)
159   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0000)
160   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0000)
161   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0000)
154   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P4 Button I") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0000)
155   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P4 Button II") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0000)
156   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P4 Select") PORT_PLAYER(4)      PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0000)
157   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P4 Run") PORT_PLAYER(4)         PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0000)
158   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)                   PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0000)
159   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0000)
160   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0000)
161   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0000)
162162
163163   PORT_START("JOY_P5")
164164   /* II is left of I on the original pad so we map them in reverse order */
165   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P5 Button I") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0000)
166   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P5 Button II") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0000)
167   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P5 Select") PORT_PLAYER(5)      PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0000)
168   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P5 Run") PORT_PLAYER(5)         PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0000)
169   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(5)                   PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0000)
170   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0000)
171   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0000)
172   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0000)
165   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P5 Button I") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0000)
166   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P5 Button II") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0000)
167   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P5 Select") PORT_PLAYER(5)      PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0000)
168   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P5 Run") PORT_PLAYER(5)         PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0000)
169   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(5)                   PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0000)
170   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0000)
171   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0000)
172   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0000)
173173
174174   PORT_START("JOY6B_P1")
175175   /* II is left of I on the original pad so we map them in reverse order */
176   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button I") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
177   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Button II") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
178   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P1 Select") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
179   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P1 Run") PORT_PLAYER(1)      PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
180   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
181   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
182   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
183   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)               PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
184   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Button III") PORT_PLAYER(1) PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
185   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Button IV") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
186   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Button V") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
187   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Button VI") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, PORTCOND_EQUALS, 0x0002)
176   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button I") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
177   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Button II") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
178   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P1 Select") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
179   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P1 Run") PORT_PLAYER(1)      PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
180   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
181   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
182   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)                  PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
183   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)               PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
184   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Button III") PORT_PLAYER(1) PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
185   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Button IV") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
186   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Button V") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
187   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Button VI") PORT_PLAYER(1)   PORT_CONDITION("JOY_TYPE", 0x0003, EQUALS, 0x0002)
188188   PORT_BIT( 0xf000, IP_ACTIVE_HIGH,IPT_UNUSED ) //6-button pad header
189189
190190   PORT_START("JOY6B_P2")  /* Player 2 controls */
191191   /* II is left of I on the original pad so we map them in reverse order */
192   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Button I") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
193   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Button II") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
194   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P2 Select") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
195   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P2 Run") PORT_PLAYER(2)      PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
196   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)                  PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
197   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)                PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
198   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)                  PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
199   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)               PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
200   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Button III") PORT_PLAYER(2) PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
201   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Button IV") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
202   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Button V") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
203   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Button VI") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, PORTCOND_EQUALS, 0x0008)
192   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Button I") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
193   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Button II") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
194   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P2 Select") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
195   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P2 Run") PORT_PLAYER(2)      PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
196   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)                  PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
197   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)                PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
198   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)                  PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
199   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)               PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
200   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Button III") PORT_PLAYER(2) PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
201   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Button IV") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
202   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Button V") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
203   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Button VI") PORT_PLAYER(2)   PORT_CONDITION("JOY_TYPE", 0x000c, EQUALS, 0x0008)
204204   PORT_BIT( 0xf000, IP_ACTIVE_HIGH,IPT_UNUSED ) //6-button pad header
205205
206206   PORT_START("JOY6B_P3")  /* Player 3 controls */
207207   /* II is left of I on the original pad so we map them in reverse order */
208   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P3 Button I") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
209   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P3 Button II") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
210   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P3 Select") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
211   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P3 Run") PORT_PLAYER(3)      PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
212   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)                  PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
213   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)                PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
214   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)                  PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
215   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)               PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
216   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P3 Button III") PORT_PLAYER(3) PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
217   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P3 Button IV") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
218   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P3 Button V") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
219   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P3 Button VI") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, PORTCOND_EQUALS, 0x0020)
208   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P3 Button I") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
209   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P3 Button II") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
210   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P3 Select") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
211   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P3 Run") PORT_PLAYER(3)      PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
212   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)                  PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
213   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)                PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
214   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)                  PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
215   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)               PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
216   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P3 Button III") PORT_PLAYER(3) PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
217   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P3 Button IV") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
218   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P3 Button V") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
219   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P3 Button VI") PORT_PLAYER(3)   PORT_CONDITION("JOY_TYPE", 0x0030, EQUALS, 0x0020)
220220   PORT_BIT( 0xf000, IP_ACTIVE_HIGH,IPT_UNUSED ) //6-button pad header
221221
222222   PORT_START("JOY6B_P4")  /* Player 4 controls */
223223   /* II is left of I on the original pad so we map them in reverse order */
224   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P4 Button I") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
225   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P4 Button II") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
226   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P4 Select") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
227   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P4 Run") PORT_PLAYER(4)      PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
228   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
229   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
230   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
231   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)               PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
232   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P3 Button III") PORT_PLAYER(4) PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
233   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P3 Button IV") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
234   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P3 Button V") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
235   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P3 Button VI") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, PORTCOND_EQUALS, 0x0080)
224   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P4 Button I") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
225   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P4 Button II") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
226   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P4 Select") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
227   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P4 Run") PORT_PLAYER(4)      PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
228   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
229   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
230   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)                  PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
231   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)               PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
232   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P3 Button III") PORT_PLAYER(4) PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
233   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P3 Button IV") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
234   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P3 Button V") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
235   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P3 Button VI") PORT_PLAYER(4)   PORT_CONDITION("JOY_TYPE", 0x00c0, EQUALS, 0x0080)
236236   PORT_BIT( 0xf000, IP_ACTIVE_HIGH,IPT_UNUSED ) //6-button pad header
237237
238238   PORT_START("JOY6B_P5")  /* Player 5 controls */
239239   /* II is left of I on the original pad so we map them in reverse order */
240   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P5 Button I") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
241   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P5 Button II") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
242   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P5 Select") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
243   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P5 Run") PORT_PLAYER(5)      PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
244   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
245   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
246   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
247   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(5)               PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
248   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P5 Button III") PORT_PLAYER(5) PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
249   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P5 Button IV") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
250   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P5 Button V") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
251   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P5 Button VI") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, PORTCOND_EQUALS, 0x0200)
240   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P5 Button I") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
241   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P5 Button II") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
242   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_NAME("P5 Select") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
243   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P5 Run") PORT_PLAYER(5)      PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
244   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
245   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
246   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(5)                  PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
247   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(5)               PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
248   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P5 Button III") PORT_PLAYER(5) PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
249   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P5 Button IV") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
250   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P5 Button V") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
251   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P5 Button VI") PORT_PLAYER(5)   PORT_CONDITION("JOY_TYPE", 0x0300, EQUALS, 0x0200)
252252   PORT_BIT( 0xf000, IP_ACTIVE_HIGH,IPT_UNUSED ) //6-button pad header
253253
254254   PORT_START("JOY_TYPE")
src/mess/drivers/ti99_4x.c
r15082r15083
180180/*
181181    // We do not want to show this setting; makes only sense for Geneve
182182    PORT_START( "MODE" )
183    PORT_CONFNAME( 0x01, 0x00, "Ext. cards modification" ) PORT_CONDITION( "HFDCDIP", 0x0f, PORTCOND_EQUALS, GM_NEVER )
183    PORT_CONFNAME( 0x01, 0x00, "Ext. cards modification" ) PORT_CONDITION( "HFDCDIP", 0x0f, EQUALS, GM_NEVER )
184184        PORT_CONFSETTING(    0x00, "Standard" )
185185        PORT_CONFSETTING(    GENMOD, "GenMod" )
186186*/
r15082r15083
618618            }
619619            else
620620            {
621               answer = ((input_port_read(machine(), keynames[m_keyboard_column >> 1]) >> ((m_keyboard_column & 1) * 8)) << 3) & 0xF8;
621               answer = ((ioport(keynames[m_keyboard_column >> 1])->read() >> ((m_keyboard_column & 1) * 8)) << 3) & 0xF8;
622622            }
623623         }
624624      }
r15082r15083
630630         }
631631         else
632632         {
633            answer = ((input_port_read(machine(), keynames[m_keyboard_column >> 1]) >> ((m_keyboard_column & 1) * 8)) << 3) & 0xF8;
633            answer = ((ioport(keynames[m_keyboard_column >> 1])->read() >> ((m_keyboard_column & 1) * 8)) << 3) & 0xF8;
634634         }
635635
636636         if ((m_mode != TI994) && (m_alphalock_line==false))
637637         {
638            answer &= ~(input_port_read(machine(), "ALPHA") << 3);
638            answer &= ~(ioport("ALPHA")->read() << 3);
639639         }
640640      }
641641
r15082r15083
648648      }
649649      else
650650      {
651         answer = ((input_port_read(machine(), keynames[m_keyboard_column >> 1]) >> ((m_keyboard_column & 1) * 8)) >> 5) & 0x07;
651         answer = ((ioport(keynames[m_keyboard_column >> 1])->read() >> ((m_keyboard_column & 1) * 8)) >> 5) & 0x07;
652652      }
653653      break;
654654
r15082r15083
948948MACHINE_RESET( ti99_4 )
949949{
950950   ti99_4x *driver = machine.driver_data<ti99_4x>();
951   if (input_port_read(machine, "HANDSET")==0x01)
951   if (machine.root_device().ioport("HANDSET")->read()==0x01)
952952      driver->m_handset = static_cast<ti99_handset_device*>(machine.device(HANDSET_TAG));
953953   else
954954      driver->m_handset = NULL;
955955
956   if (input_port_read(machine, "MECMOUSE")==0x01)
956   if (machine.root_device().ioport("MECMOUSE")->read()==0x01)
957957      driver->m_mecmouse = static_cast<mecmouse_device*>(machine.device(MECMOUSE_TAG));
958958   else
959959      driver->m_mecmouse = NULL;
r15082r15083
10741074MACHINE_RESET( ti99_4a )
10751075{
10761076   ti99_4x *driver = machine.driver_data<ti99_4x>();
1077   if (input_port_read(machine, "MECMOUSE")==0x01)
1077   if (machine.root_device().ioport("MECMOUSE")->read()==0x01)
10781078      driver->m_mecmouse = static_cast<mecmouse_device*>(machine.device(MECMOUSE_TAG));
10791079   else
10801080      driver->m_mecmouse = NULL;
src/mess/drivers/alphatro.c
r15082r15083
142142{
143143   alphatro_state *state = device->machine().driver_data<alphatro_state>();
144144   const rgb_t *pens = palette_entry_list_raw(bitmap.palette());
145   bool palette = BIT(input_port_read(device->machine(), "CONFIG"), 5);
145   bool palette = BIT(state->ioport("CONFIG")->read(), 5);
146146   UINT8 chr,gfx,attr,fg,inv;
147147   UINT16 mem,x;
148148   UINT32 *p = &bitmap.pix32(y);
src/mess/drivers/vc4000.c
r15082r15083
5656   switch(offset & 0x0f)
5757   {
5858   case 0x08:
59      data = input_port_read(machine(), "KEYPAD1_1");
59      data = ioport("KEYPAD1_1")->read();
6060      break;
6161   case 0x09:
62      data = input_port_read(machine(), "KEYPAD1_2");
62      data = ioport("KEYPAD1_2")->read();
6363      break;
6464   case 0x0a:
65      data = input_port_read(machine(), "KEYPAD1_3");
65      data = ioport("KEYPAD1_3")->read();
6666      break;
6767   case 0x0b:
68      data = input_port_read(machine(), "PANEL");
68      data = ioport("PANEL")->read();
6969      break;
7070   case 0x0c:
71      data = input_port_read(machine(), "KEYPAD2_1");
71      data = ioport("KEYPAD2_1")->read();
7272      break;
7373   case 0x0d:
74      data = input_port_read(machine(), "KEYPAD2_2");
74      data = ioport("KEYPAD2_2")->read();
7575      break;
7676   case 0x0e:
77      data = input_port_read(machine(), "KEYPAD2_3");
77      data = ioport("KEYPAD2_3")->read();
7878      break;
7979   }
8080   return data;
src/mess/drivers/h8.c
r15082r15083
7070
7171   UINT8 i,keyin,data = 0xff;
7272
73   keyin = input_port_read(machine(), "X0");
73   keyin = ioport("X0")->read();
7474   if (keyin != 0xff)
7575   {
7676      for (i = 1; i < 8; i++)
r15082r15083
7979      data &= 0xfe;
8080   }
8181
82   keyin = input_port_read(machine(), "X1");
82   keyin = ioport("X1")->read();
8383   if (keyin != 0xff)
8484   {
8585      for (i = 1; i < 8; i++)
src/mess/drivers/cosmicos.c
r15082r15083
8787   {
8888      if (BIT(m_keylatch, i))
8989      {
90         UINT8 keydata = input_port_read(machine(), keynames[i]);
90         UINT8 keydata = ioport(keynames[i])->read();
9191
9292         if (BIT(keydata, 0)) data |= 0x01;
9393         if (BIT(keydata, 1)) data |= 0x02;
r15082r15083
159159
160160INPUT_CHANGED_MEMBER( cosmicos_state::data )
161161{
162   UINT8 data = input_port_read(machine(), "DATA");
162   UINT8 data = ioport("DATA")->read();
163163   int i;
164164
165165   for (i = 0; i < 8; i++)
r15082r15083
399399
400400READ_LINE_MEMBER( cosmicos_state::ef1_r )
401401{
402   UINT8 special = input_port_read(machine(), "SPECIAL");
402   UINT8 special = ioport("SPECIAL")->read();
403403
404404   return BIT(special, 0);
405405}
406406
407407READ_LINE_MEMBER( cosmicos_state::ef2_r )
408408{
409   UINT8 special = input_port_read(machine(), "SPECIAL");
409   UINT8 special = ioport("SPECIAL")->read();
410410   int casin = (m_cassette)->input() < 0.0;
411411
412412   output_set_led_value(LED_CASSETTE, casin);
r15082r15083
416416
417417READ_LINE_MEMBER( cosmicos_state::ef3_r )
418418{
419   UINT8 special = input_port_read(machine(), "SPECIAL");
419   UINT8 special = ioport("SPECIAL")->read();
420420
421421   return BIT(special, 2) | BIT(special, 3);
422422}
423423
424424READ_LINE_MEMBER( cosmicos_state::ef4_r )
425425{
426   return BIT(input_port_read(machine(), "BUTTONS"), 0);
426   return BIT(ioport("BUTTONS")->read(), 0);
427427}
428428
429429static COSMAC_SC_WRITE( cosmicos_sc_w )
src/mess/drivers/vic10.c
r15082r15083
198198 
199199READ8_MEMBER( vic10_state::vic_lightpen_x_cb )
200200{
201   return input_port_read(machine(), "LIGHTX") & ~0x01;
201   return ioport("LIGHTX")->read() & ~0x01;
202202}
203203 
204204READ8_MEMBER( vic10_state::vic_lightpen_y_cb )
205205{
206   return input_port_read(machine(), "LIGHTY") & ~0x01;
206   return ioport("LIGHTY")->read() & ~0x01;
207207}
208208 
209209READ8_MEMBER( vic10_state::vic_lightpen_button_cb )
210210{
211   return input_port_read(machine(), "OTHER") & 0x04;
211   return ioport("OTHER")->read() & 0x04;
212212}
213213 
214214READ8_MEMBER( vic10_state::vic_dma_read )
r15082r15083
235235 
236236READ8_MEMBER( vic10_state::vic_rdy_cb )
237237{
238   return input_port_read(machine(), "CYCLES") & 0x07;
238   return ioport("CYCLES")->read() & 0x07;
239239}
240240 
241241static const vic2_interface vic_intf =
r15082r15083
264264 
265265   int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp;
266266   UINT8 cia0porta = mos6526_pa_r(state->m_cia, 0);
267   int controller1 = input_port_read(machine, "CTRLSEL") & 0x07;
268   int controller2 = input_port_read(machine, "CTRLSEL") & 0x70;
267   int controller1 = machine.root_device().ioport("CTRLSEL")->read() & 0x07;
268   int controller2 = machine.root_device().ioport("CTRLSEL")->read() & 0x70;
269269   // Notice that only a single input is defined for Mouse & Lightpen in both ports
270270   switch (controller1)
271271   {
272272      case 0x01:
273273         if (which)
274            pot2 = input_port_read(machine, "PADDLE2");
274            pot2 = machine.root_device().ioport("PADDLE2")->read();
275275         else
276            pot1 = input_port_read(machine, "PADDLE1");
276            pot1 = machine.root_device().ioport("PADDLE1")->read();
277277         break;
278278 
279279      case 0x02:
280280         if (which)
281            pot2 = input_port_read(machine, "TRACKY");
281            pot2 = machine.root_device().ioport("TRACKY")->read();
282282         else
283            pot1 = input_port_read(machine, "TRACKX");
283            pot1 = machine.root_device().ioport("TRACKX")->read();
284284         break;
285285 
286286      case 0x03:
287         if (which && (input_port_read(machine, "JOY1_2B") & 0x20))   // Joy1 Button 2
287         if (which && (machine.root_device().ioport("JOY1_2B")->read() & 0x20))   // Joy1 Button 2
288288            pot1 = 0x00;
289289         break;
290290 
291291      case 0x04:
292292         if (which)
293            pot2 = input_port_read(machine, "LIGHTY");
293            pot2 = machine.root_device().ioport("LIGHTY")->read();
294294         else
295            pot1 = input_port_read(machine, "LIGHTX");
295            pot1 = machine.root_device().ioport("LIGHTX")->read();
296296         break;
297297 
298298      case 0x06:
299         if (which && (input_port_read(machine, "OTHER") & 0x04))   // Lightpen Signal
299         if (which && (machine.root_device().ioport("OTHER")->read() & 0x04))   // Lightpen Signal
300300            pot2 = 0x00;
301301         break;
302302 
r15082r15083
313313   {
314314      case 0x10:
315315         if (which)
316            pot4 = input_port_read(machine, "PADDLE4");
316            pot4 = machine.root_device().ioport("PADDLE4")->read();
317317         else
318            pot3 = input_port_read(machine, "PADDLE3");
318            pot3 = machine.root_device().ioport("PADDLE3")->read();
319319         break;
320320 
321321      case 0x20:
322322         if (which)
323            pot4 = input_port_read(machine, "TRACKY");
323            pot4 = machine.root_device().ioport("TRACKY")->read();
324324         else
325            pot3 = input_port_read(machine, "TRACKX");
325            pot3 = machine.root_device().ioport("TRACKX")->read();
326326         break;
327327 
328328      case 0x30:
329         if (which && (input_port_read(machine, "JOY2_2B") & 0x20))   // Joy2 Button 2
329         if (which && (machine.root_device().ioport("JOY2_2B")->read() & 0x20))   // Joy2 Button 2
330330            pot4 = 0x00;
331331         break;
332332 
333333      case 0x40:
334334         if (which)
335            pot4 = input_port_read(machine, "LIGHTY");
335            pot4 = machine.root_device().ioport("LIGHTY")->read();
336336         else
337            pot3 = input_port_read(machine, "LIGHTX");
337            pot3 = machine.root_device().ioport("LIGHTX")->read();
338338         break;
339339 
340340      case 0x60:
341         if (which && (input_port_read(machine, "OTHER") & 0x04))   // Lightpen Signal
341         if (which && (machine.root_device().ioport("OTHER")->read() & 0x04))   // Lightpen Signal
342342            pot4 = 0x00;
343343         break;
344344 
r15082r15083
351351         break;
352352   }
353353 
354   if (input_port_read(machine, "CTRLSEL") & 0x80)      // Swap
354   if (machine.root_device().ioport("CTRLSEL")->read() & 0x80)      // Swap
355355   {
356356      temp = pot1; pot1 = pot3; pot3 = temp;
357357      temp = pot2; pot2 = pot4; pot4 = temp;
src/mess/drivers/b16.c
r15082r15083
119119
120120READ16_MEMBER( b16_state::vblank_r )
121121{
122   return input_port_read(machine(), "SYSTEM");
122   return ioport("SYSTEM")->read();
123123}
124124
125125WRITE8_MEMBER( b16_state::b16_6845_address_w )
r15082r15083
214214/* Input ports */
215215static INPUT_PORTS_START( b16 )
216216   PORT_START("SYSTEM")
217   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK )
217   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
218218INPUT_PORTS_END
219219
220220
src/mess/drivers/argo.c
r15082r15083
7474   case 0xA1: // keyboard
7575      char kbdrow[6];
7676      sprintf(kbdrow,"X%X",offset>>8);
77      return input_port_read(machine(), kbdrow);
77      return ioport(kbdrow)->read();
7878
7979   case 0xE8: // wants bit 4 low then high
8080      return m_framecnt << 4;
src/mess/drivers/psion.c
r15082r15083
4343   {
4444      for (line = 0; line < 7; line++)
4545         if (m_kb_counter == (0x7f & ~(1 << line)))
46            data = input_port_read(machine, bitnames[line]);
46            data = machine.root_device().ioport(bitnames[line])->read();
4747   }
4848   else
4949   {
5050      //Read all the input lines
5151      for (line = 0; line < 7; line++)
52         data &= input_port_read(machine, bitnames[line]);
52         data &= machine.root_device().ioport(bitnames[line])->read();
5353   }
5454
5555   return data & 0x7c;
r15082r15083
124124        ---- --x- pulse
125125        ---- ---x battery status
126126        */
127      return kb_read(machine()) | input_port_read(machine(), "BATTERY") | input_port_read(machine(), "ON") | (m_kb_counter == 0x7ff)<<1 | m_pulse<<1;
127      return kb_read(machine()) | ioport("BATTERY")->read() | ioport("ON")->read() | (m_kb_counter == 0x7ff)<<1 | m_pulse<<1;
128128   case 0x17:
129129      /* datapack control lines */
130130      return (m_pack1->control_r() | (m_pack2->control_r() & 0x8f)) | ((m_pack2->control_r() & 0x10)<<1);
src/mess/drivers/gba.c
r15082r15083
943943      case 0x0130/4:
944944         if( (mem_mask) & 0x0000ffff )   // KEYINPUT
945945         {
946            return input_port_read(machine(), "IN0");
946            return ioport("IN0")->read();
947947         }
948948         if( (mem_mask) & 0xffff0000 )
949949         {
src/mess/drivers/vixen.c
r15082r15083
511511{
512512   UINT8 data = 0xff;
513513
514   if (!BIT(m_col, 0)) data &= input_port_read(machine(), "ROW0");
515   if (!BIT(m_col, 1)) data &= input_port_read(machine(), "ROW1");
516   if (!BIT(m_col, 2)) data &= input_port_read(machine(), "ROW2");
517   if (!BIT(m_col, 3)) data &= input_port_read(machine(), "ROW3");
518   if (!BIT(m_col, 4)) data &= input_port_read(machine(), "ROW4");
519   if (!BIT(m_col, 5)) data &= input_port_read(machine(), "ROW5");
520   if (!BIT(m_col, 6)) data &= input_port_read(machine(), "ROW6");
521   if (!BIT(m_col, 7)) data &= input_port_read(machine(), "ROW7");
514   if (!BIT(m_col, 0)) data &= ioport("ROW0")->read();
515   if (!BIT(m_col, 1)) data &= ioport("ROW1")->read();
516   if (!BIT(m_col, 2)) data &= ioport("ROW2")->read();
517   if (!BIT(m_col, 3)) data &= ioport("ROW3")->read();
518   if (!BIT(m_col, 4)) data &= ioport("ROW4")->read();
519   if (!BIT(m_col, 5)) data &= ioport("ROW5")->read();
520   if (!BIT(m_col, 6)) data &= ioport("ROW6")->read();
521   if (!BIT(m_col, 7)) data &= ioport("ROW7")->read();
522522
523523   return data;
524524}
src/mess/drivers/bmjr.c
r15082r15083
9696{
9797   char kbdrow[6];
9898   sprintf(kbdrow,"KEY%X", m_key_mux);
99   return (input_port_read(machine(), kbdrow) & 15) | (input_port_read(machine(), "KEYMOD") << 4);
99   return (ioport(kbdrow)->read() & 15) | (ioport("KEYMOD")->read() << 4);
100100}
101101
102102WRITE8_MEMBER( bmjr_state::key_w )
src/ldplayer/ldplayer.c
r15082r15083
9797
9898   // internal state
9999   astring m_filename;
100   input_port_value m_last_controls;
100   ioport_value m_last_controls;
101101   bool m_playing;
102102   required_device<laserdisc_device> m_laserdisc;
103103};
r15082r15083
217217
218218void ldplayer_state::process_commands()
219219{
220   input_port_value controls = input_port_read(machine(), "controls");
220   ioport_value controls = machine().root_device().ioport("controls")->read();
221221   int number;
222222
223223   // step backwards
makefile
r15082r15083
474474# add the optimization flag
475475CCOMFLAGS += -O$(OPTIMIZE)
476476
477# add the error warning flag
478ifndef NOWERROR
479CCOMFLAGS += -Werror
480endif
481
477482# if we are optimizing, include optimization options
478# and make all errors into warnings
479483ifneq ($(OPTIMIZE),0)
480ifneq ($(TARGETOS),os2)
481ifndef NOWERROR
482CCOMFLAGS += -Werror -fno-strict-aliasing $(ARCHOPTS)
483else
484484CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS)
485485endif
486else
487CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS)
488endif
489endif
490486
491487# add a basic set of warnings
492488CCOMFLAGS += \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team