summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/a2gameio/computereyes.h2
-rw-r--r--src/devices/bus/a2gameio/gameio.h2
-rw-r--r--src/devices/bus/a2gameio/joyport.h2
-rw-r--r--src/devices/bus/a2gameio/joystick.h2
-rw-r--r--src/devices/bus/amiga/keyboard/mitsumi.cpp14
-rw-r--r--src/devices/bus/coleco/controller/hand.cpp2
-rw-r--r--src/devices/bus/coleco/controller/sac.cpp2
-rw-r--r--src/devices/bus/isa/asc88.h2
-rw-r--r--src/devices/bus/nscsi/cdd2000.h2
-rw-r--r--src/devices/bus/nscsi/cdrn820s.h2
-rw-r--r--src/devices/bus/s100/am310.h2
-rw-r--r--src/devices/bus/sms_ctrl/paddle.cpp4
-rw-r--r--src/devices/bus/sms_ctrl/sports.cpp6
-rw-r--r--src/devices/bus/sms_ctrl/sportsjp.cpp6
-rw-r--r--src/devices/cpu/bcp/bcpdasm.h2
-rw-r--r--src/devices/cpu/bcp/dp8344.h2
-rw-r--r--src/devices/cpu/cr16b/cr16b.h2
-rw-r--r--src/devices/cpu/cr16b/cr16bdasm.h2
-rw-r--r--src/devices/cpu/f2mc16/f2mc16.h2
-rw-r--r--src/devices/cpu/g65816/g65816.cpp18
-rw-r--r--src/devices/cpu/g65816/g65816.h2
-rw-r--r--src/devices/cpu/g65816/g65816cm.h20
-rw-r--r--src/devices/cpu/m6502/m6502.cpp8
-rw-r--r--src/devices/cpu/m6502/om6502.lst3
-rw-r--r--src/devices/cpu/rii/riscii.h2
-rw-r--r--src/devices/cpu/spc700/spc700.cpp3
-rw-r--r--src/devices/machine/aic565.h2
-rw-r--r--src/devices/machine/ds17x85.h2
-rw-r--r--src/devices/machine/ds1994.cpp45
-rw-r--r--src/devices/machine/i82355.h2
-rw-r--r--src/devices/machine/mm5307.h2
-rw-r--r--src/devices/machine/pcf8584.h2
-rw-r--r--src/devices/machine/sensorboard.cpp8
-rw-r--r--src/devices/video/dp8350.cpp31
-rw-r--r--src/devices/video/t6963c.h2
-rw-r--r--src/emu/drawgfx.cpp347
-rw-r--r--src/emu/drawgfx.h29
-rw-r--r--src/emu/drawgfxm.h1343
-rw-r--r--src/emu/drawgfxt.ipp1911
-rw-r--r--src/emu/ioport.cpp5
-rw-r--r--src/emu/ioport.h27
-rw-r--r--src/lib/util/bitmap.cpp39
-rw-r--r--src/lib/util/bitmap.h118
-rw-r--r--src/mame/audio/gottlieb.cpp2
-rw-r--r--src/mame/audio/snk6502.cpp4
-rw-r--r--src/mame/audio/snk6502.h2
-rw-r--r--src/mame/drivers/8080bw.cpp36
-rw-r--r--src/mame/drivers/acefruit.cpp69
-rw-r--r--src/mame/drivers/aci_ggm.cpp2
-rw-r--r--src/mame/drivers/alg.cpp18
-rw-r--r--src/mame/drivers/amiga.cpp39
-rw-r--r--src/mame/drivers/aristmk5.cpp10
-rw-r--r--src/mame/drivers/arkanoid.cpp2
-rw-r--r--src/mame/drivers/arsystems.cpp15
-rw-r--r--src/mame/drivers/artmagic.cpp10
-rw-r--r--src/mame/drivers/asteroid.cpp20
-rw-r--r--src/mame/drivers/astrocde.cpp10
-rw-r--r--src/mame/drivers/astrof.cpp18
-rw-r--r--src/mame/drivers/at.cpp310
-rw-r--r--src/mame/drivers/atlantis.cpp2
-rw-r--r--src/mame/drivers/bagman.cpp4
-rw-r--r--src/mame/drivers/balsente.cpp2
-rw-r--r--src/mame/drivers/battlex.cpp2
-rw-r--r--src/mame/drivers/blockade.cpp16
-rw-r--r--src/mame/drivers/bmcpokr.cpp10
-rw-r--r--src/mame/drivers/bnstars.cpp9
-rw-r--r--src/mame/drivers/btoads.cpp8
-rw-r--r--src/mame/drivers/bublbobl.cpp4
-rw-r--r--src/mame/drivers/buggychl.cpp2
-rw-r--r--src/mame/drivers/bwidow.cpp18
-rw-r--r--src/mame/drivers/by17.cpp66
-rw-r--r--src/mame/drivers/by35.cpp41
-rw-r--r--src/mame/drivers/bzone.cpp6
-rw-r--r--src/mame/drivers/cave.cpp14
-rw-r--r--src/mame/drivers/ccastles.cpp4
-rw-r--r--src/mame/drivers/champbas.cpp4
-rw-r--r--src/mame/drivers/cischeat.cpp84
-rw-r--r--src/mame/drivers/cloud9.cpp6
-rw-r--r--src/mame/drivers/cop01.cpp12
-rw-r--r--src/mame/drivers/crbaloon.cpp2
-rw-r--r--src/mame/drivers/crimfght.cpp2
-rw-r--r--src/mame/drivers/cubo.cpp17
-rw-r--r--src/mame/drivers/cyclemb.cpp4
-rw-r--r--src/mame/drivers/dacholer.cpp6
-rw-r--r--src/mame/drivers/dcheese.cpp12
-rw-r--r--src/mame/drivers/ddayjlc.cpp2
-rw-r--r--src/mame/drivers/ddenlovr.cpp16
-rw-r--r--src/mame/drivers/ddragon.cpp4
-rw-r--r--src/mame/drivers/ddragon3.cpp16
-rw-r--r--src/mame/drivers/deco_ld.cpp6
-rw-r--r--src/mame/drivers/dlair.cpp20
-rw-r--r--src/mame/drivers/ecoinfr.cpp18
-rw-r--r--src/mame/drivers/enigma2.cpp8
-rw-r--r--src/mame/drivers/eolith.cpp8
-rw-r--r--src/mame/drivers/eolith16.cpp2
-rw-r--r--src/mame/drivers/equites.cpp4
-rw-r--r--src/mame/drivers/exerion.cpp2
-rw-r--r--src/mame/drivers/exidy.cpp27
-rw-r--r--src/mame/drivers/exidy440.cpp52
-rw-r--r--src/mame/drivers/famibox.cpp6
-rw-r--r--src/mame/drivers/fantland.cpp8
-rw-r--r--src/mame/drivers/fgoal.cpp4
-rw-r--r--src/mame/drivers/firefox.cpp16
-rw-r--r--src/mame/drivers/firetrk.cpp71
-rw-r--r--src/mame/drivers/flicker.cpp2
-rw-r--r--src/mame/drivers/flstory.cpp2
-rw-r--r--src/mame/drivers/fromanc2.cpp14
-rw-r--r--src/mame/drivers/gaelco2.cpp48
-rw-r--r--src/mame/drivers/gaelco3d.cpp40
-rw-r--r--src/mame/drivers/galastrm.cpp4
-rw-r--r--src/mame/drivers/galaxi.cpp16
-rw-r--r--src/mame/drivers/galaxian.cpp69
-rw-r--r--src/mame/drivers/galaxold.cpp77
-rw-r--r--src/mame/drivers/gottlieb.cpp22
-rw-r--r--src/mame/drivers/gstream.cpp14
-rw-r--r--src/mame/drivers/hh_cop400.cpp6
-rw-r--r--src/mame/drivers/hh_sm510.cpp88
-rw-r--r--src/mame/drivers/homelab.cpp8
-rw-r--r--src/mame/drivers/homerun.cpp16
-rw-r--r--src/mame/drivers/icecold.cpp2
-rw-r--r--src/mame/drivers/igs009.cpp6
-rw-r--r--src/mame/drivers/igs011.cpp14
-rw-r--r--src/mame/drivers/igspoker.cpp22
-rw-r--r--src/mame/drivers/imolagp.cpp4
-rw-r--r--src/mame/drivers/inufuku.cpp4
-rw-r--r--src/mame/drivers/istrebiteli.cpp26
-rw-r--r--src/mame/drivers/itech32.cpp8
-rw-r--r--src/mame/drivers/itech8.cpp40
-rw-r--r--src/mame/drivers/jackie.cpp6
-rw-r--r--src/mame/drivers/jankenmn.cpp6
-rw-r--r--src/mame/drivers/jedi.cpp2
-rw-r--r--src/mame/drivers/karnov.cpp72
-rw-r--r--src/mame/drivers/kenseim.cpp30
-rw-r--r--src/mame/drivers/konamigx.cpp2
-rw-r--r--src/mame/drivers/ksys573.cpp14
-rw-r--r--src/mame/drivers/ladybug.cpp4
-rw-r--r--src/mame/drivers/lastbank.cpp2
-rw-r--r--src/mame/drivers/lethalj.cpp2
-rw-r--r--src/mame/drivers/limenko.cpp10
-rw-r--r--src/mame/drivers/littlerb.cpp2
-rw-r--r--src/mame/drivers/m92.cpp4
-rw-r--r--src/mame/drivers/merit.cpp12
-rw-r--r--src/mame/drivers/metro.cpp6
-rw-r--r--src/mame/drivers/mhavoc.cpp22
-rw-r--r--src/mame/drivers/micro3d.cpp2
-rw-r--r--src/mame/drivers/midvunit.cpp6
-rw-r--r--src/mame/drivers/midyunit.cpp16
-rw-r--r--src/mame/drivers/midzeus.cpp4
-rw-r--r--src/mame/drivers/missile.cpp8
-rw-r--r--src/mame/drivers/mjkjidai.cpp2
-rw-r--r--src/mame/drivers/model2.cpp4
-rw-r--r--src/mame/drivers/mquake.cpp4
-rw-r--r--src/mame/drivers/ms32.cpp2
-rw-r--r--src/mame/drivers/multigam.cpp6
-rw-r--r--src/mame/drivers/mw18w.cpp2
-rw-r--r--src/mame/drivers/mw8080bw.cpp48
-rw-r--r--src/mame/drivers/namcos21_de.cpp2
-rw-r--r--src/mame/drivers/namcos22.cpp9
-rw-r--r--src/mame/drivers/naomi.cpp6
-rw-r--r--src/mame/drivers/nbmj8891.cpp10
-rw-r--r--src/mame/drivers/neogeo.cpp12
-rw-r--r--src/mame/drivers/niyanpai.cpp10
-rw-r--r--src/mame/drivers/nmk16.cpp30
-rw-r--r--src/mame/drivers/nova2001.cpp2
-rw-r--r--src/mame/drivers/nss.cpp6
-rw-r--r--src/mame/drivers/omegrace.cpp2
-rw-r--r--src/mame/drivers/opwolf.cpp4
-rw-r--r--src/mame/drivers/pc.cpp64
-rw-r--r--src/mame/drivers/pc9801.cpp2
-rw-r--r--src/mame/drivers/pencil2.cpp12
-rw-r--r--src/mame/drivers/peplus.cpp31
-rw-r--r--src/mame/drivers/peyper.cpp17
-rw-r--r--src/mame/drivers/phoenix.cpp8
-rw-r--r--src/mame/drivers/piggypas.cpp9
-rw-r--r--src/mame/drivers/pirates.cpp4
-rw-r--r--src/mame/drivers/piratesh.cpp4
-rw-r--r--src/mame/drivers/plan80.cpp31
-rw-r--r--src/mame/drivers/playch10.cpp2
-rw-r--r--src/mame/drivers/polepos.cpp4
-rw-r--r--src/mame/drivers/policetr.cpp4
-rw-r--r--src/mame/drivers/popeye.cpp10
-rw-r--r--src/mame/drivers/psikyo.cpp18
-rw-r--r--src/mame/drivers/psikyo4.cpp18
-rw-r--r--src/mame/drivers/pzletime.cpp6
-rw-r--r--src/mame/drivers/qdrmfgp.cpp4
-rw-r--r--src/mame/drivers/quantum.cpp2
-rw-r--r--src/mame/drivers/quizshow.cpp2
-rw-r--r--src/mame/drivers/r2dtank.cpp6
-rw-r--r--src/mame/drivers/renegade.cpp2
-rw-r--r--src/mame/drivers/rgum.cpp6
-rw-r--r--src/mame/drivers/rpunch.cpp4
-rw-r--r--src/mame/drivers/scobra.cpp18
-rw-r--r--src/mame/drivers/scramble.cpp12
-rw-r--r--src/mame/drivers/scyclone.cpp6
-rw-r--r--src/mame/drivers/seattle.cpp4
-rw-r--r--src/mame/drivers/segag80v.cpp4
-rw-r--r--src/mame/drivers/segajw.cpp8
-rw-r--r--src/mame/drivers/segaorun.cpp2
-rw-r--r--src/mame/drivers/segas16a.cpp6
-rw-r--r--src/mame/drivers/segas16b.cpp6
-rw-r--r--src/mame/drivers/seibuspi.cpp13
-rw-r--r--src/mame/drivers/seta.cpp6
-rw-r--r--src/mame/drivers/sk1.cpp4
-rw-r--r--src/mame/drivers/snk.cpp143
-rw-r--r--src/mame/drivers/snk6502.cpp6
-rw-r--r--src/mame/drivers/spdodgeb.cpp4
-rw-r--r--src/mame/drivers/spg110.cpp2
-rw-r--r--src/mame/drivers/spoker.cpp8
-rw-r--r--src/mame/drivers/sprint4.cpp45
-rw-r--r--src/mame/drivers/ssingles.cpp2
-rw-r--r--src/mame/drivers/stactics.cpp12
-rw-r--r--src/mame/drivers/starshp1.cpp4
-rw-r--r--src/mame/drivers/starwars.cpp4
-rw-r--r--src/mame/drivers/statriv2.cpp14
-rw-r--r--src/mame/drivers/superqix.cpp14
-rw-r--r--src/mame/drivers/suprnova.cpp12
-rw-r--r--src/mame/drivers/suprridr.cpp2
-rw-r--r--src/mame/drivers/system1.cpp4
-rw-r--r--src/mame/drivers/tail2nos.cpp8
-rw-r--r--src/mame/drivers/taito_f3.cpp21
-rw-r--r--src/mame/drivers/taito_z.cpp19
-rw-r--r--src/mame/drivers/taitosj.cpp41
-rw-r--r--src/mame/drivers/tempest.cpp12
-rw-r--r--src/mame/drivers/tetrisp2.cpp2
-rw-r--r--src/mame/drivers/thayers.cpp12
-rw-r--r--src/mame/drivers/timeplt.cpp6
-rw-r--r--src/mame/drivers/toaplan2.cpp6
-rw-r--r--src/mame/drivers/tomcat.cpp2
-rw-r--r--src/mame/drivers/topspeed.cpp15
-rw-r--r--src/mame/drivers/ultratnk.cpp26
-rw-r--r--src/mame/drivers/vamphalf.cpp2
-rw-r--r--src/mame/drivers/vegaeo.cpp2
-rw-r--r--src/mame/drivers/vegas.cpp8
-rw-r--r--src/mame/drivers/vertigo.cpp1
-rw-r--r--src/mame/drivers/vicdual.cpp208
-rw-r--r--src/mame/drivers/video21.cpp6
-rw-r--r--src/mame/drivers/vii.cpp25
-rw-r--r--src/mame/drivers/viper.cpp8
-rw-r--r--src/mame/drivers/wacky_gator.cpp4
-rw-r--r--src/mame/drivers/wecleman.cpp4
-rw-r--r--src/mame/drivers/williams.cpp11
-rw-r--r--src/mame/drivers/wmg.cpp11
-rw-r--r--src/mame/drivers/wolfpack.cpp10
-rw-r--r--src/mame/drivers/wwfsstar.cpp4
-rw-r--r--src/mame/drivers/xain.cpp6
-rw-r--r--src/mame/drivers/xavix.cpp28
-rw-r--r--src/mame/drivers/xmen.cpp4
-rw-r--r--src/mame/drivers/xxmissio.cpp20
-rw-r--r--src/mame/drivers/zaxxon.cpp35
-rw-r--r--src/mame/drivers/zn.cpp6
-rw-r--r--src/mame/includes/8080bw.h4
-rw-r--r--src/mame/includes/amiga.h2
-rw-r--r--src/mame/includes/artmagic.h2
-rw-r--r--src/mame/includes/asteroid.h2
-rw-r--r--src/mame/includes/astrocde.h2
-rw-r--r--src/mame/includes/btoads.h4
-rw-r--r--src/mame/includes/bwidow.h3
-rw-r--r--src/mame/includes/bzone.h2
-rw-r--r--src/mame/includes/cave.h4
-rw-r--r--src/mame/includes/ccastles.h2
-rw-r--r--src/mame/includes/champbas.h2
-rw-r--r--src/mame/includes/cischeat.h86
-rw-r--r--src/mame/includes/cloud9.h2
-rw-r--r--src/mame/includes/cop01.h2
-rw-r--r--src/mame/includes/dcheese.h2
-rw-r--r--src/mame/includes/ddragon.h2
-rw-r--r--src/mame/includes/ddragon3.h8
-rw-r--r--src/mame/includes/eolith.h4
-rw-r--r--src/mame/includes/equites.h2
-rw-r--r--src/mame/includes/exidy440.h6
-rw-r--r--src/mame/includes/fantland.h7
-rw-r--r--src/mame/includes/fgoal.h2
-rw-r--r--src/mame/includes/firetrk.h10
-rw-r--r--src/mame/includes/fromanc2.h6
-rw-r--r--src/mame/includes/gaelco2.h2
-rw-r--r--src/mame/includes/gaelco3d.h4
-rw-r--r--src/mame/includes/galastrm.h2
-rw-r--r--src/mame/includes/galaxian.h35
-rw-r--r--src/mame/includes/galaxold.h8
-rw-r--r--src/mame/includes/gottlieb.h2
-rw-r--r--src/mame/includes/homerun.h6
-rw-r--r--src/mame/includes/inufuku.h2
-rw-r--r--src/mame/includes/itech32.h2
-rw-r--r--src/mame/includes/itech8.h6
-rw-r--r--src/mame/includes/m92.h2
-rw-r--r--src/mame/includes/metro.h2
-rw-r--r--src/mame/includes/mhavoc.h20
-rw-r--r--src/mame/includes/micro3d.h2
-rw-r--r--src/mame/includes/midyunit.h4
-rw-r--r--src/mame/includes/namcos22.h2
-rw-r--r--src/mame/includes/naomi.h5
-rw-r--r--src/mame/includes/nbmj8891.h2
-rw-r--r--src/mame/includes/niyanpai.h2
-rw-r--r--src/mame/includes/phoenix.h2
-rw-r--r--src/mame/includes/pirates.h2
-rw-r--r--src/mame/includes/playch10.h2
-rw-r--r--src/mame/includes/polepos.h2
-rw-r--r--src/mame/includes/policetr.h2
-rw-r--r--src/mame/includes/popeye.h4
-rw-r--r--src/mame/includes/psikyo.h4
-rw-r--r--src/mame/includes/psikyo4.h2
-rw-r--r--src/mame/includes/scramble.h9
-rw-r--r--src/mame/includes/segag80v.h2
-rw-r--r--src/mame/includes/seibuspi.h2
-rw-r--r--src/mame/includes/snk.h9
-rw-r--r--src/mame/includes/spdodgeb.h2
-rw-r--r--src/mame/includes/sprint4.h6
-rw-r--r--src/mame/includes/stactics.h8
-rw-r--r--src/mame/includes/starwars.h2
-rw-r--r--src/mame/includes/superqix.h4
-rw-r--r--src/mame/includes/suprnova.h8
-rw-r--r--src/mame/includes/tail2nos.h6
-rw-r--r--src/mame/includes/taito_f3.h4
-rw-r--r--src/mame/includes/taito_z.h7
-rw-r--r--src/mame/includes/taitosj.h2
-rw-r--r--src/mame/includes/timeplt.h2
-rw-r--r--src/mame/includes/toaplan2.h2
-rw-r--r--src/mame/includes/topspeed.h7
-rw-r--r--src/mame/includes/ultratnk.h9
-rw-r--r--src/mame/includes/vicdual.h14
-rw-r--r--src/mame/includes/wecleman.h2
-rw-r--r--src/mame/includes/williams.h2
-rw-r--r--src/mame/includes/wolfpack.h2
-rw-r--r--src/mame/includes/wwfsstar.h2
-rw-r--r--src/mame/includes/xain.h2
-rw-r--r--src/mame/includes/xavix.h16
-rw-r--r--src/mame/includes/xmen.h2
-rw-r--r--src/mame/includes/xxmissio.h2
-rw-r--r--src/mame/includes/zaxxon.h4
-rw-r--r--src/mame/machine/amiga.cpp15
-rw-r--r--src/mame/machine/cmi_ankbd.h2
-rw-r--r--src/mame/machine/cmi_mkbd.h2
-rw-r--r--src/mame/machine/gaelco2.cpp45
-rw-r--r--src/mame/machine/galaxold.cpp8
-rw-r--r--src/mame/machine/mhavoc.cpp19
-rw-r--r--src/mame/machine/micro3d.cpp2
-rw-r--r--src/mame/machine/naomi.cpp29
-rw-r--r--src/mame/machine/playch10.cpp2
-rw-r--r--src/mame/machine/scramble.cpp4
-rw-r--r--src/mame/machine/starwars.cpp2
-rw-r--r--src/mame/machine/taito68705interface.h6
-rw-r--r--src/mame/machine/williams.cpp7
-rw-r--r--src/mame/machine/xavix.cpp20
-rw-r--r--src/mame/mame.lst16
-rw-r--r--src/mame/video/733_asr.cpp6
-rw-r--r--src/mame/video/apexc.cpp6
-rw-r--r--src/mame/video/avgdvg.cpp4
-rw-r--r--src/mame/video/avgdvg.h2
-rw-r--r--src/mame/video/exidy440.cpp19
-rw-r--r--src/mame/video/homerun.cpp2
-rw-r--r--src/mame/video/pdp1.cpp9
-rw-r--r--src/mame/video/phoenix.cpp2
-rw-r--r--src/mame/video/psikyosh.cpp29
-rw-r--r--src/mame/video/stactics.cpp6
-rw-r--r--src/mame/video/suna8.cpp24
-rw-r--r--src/mame/video/tc0080vco.cpp22
-rw-r--r--src/mame/video/tx0.cpp6
-rw-r--r--src/osd/mac/appdelegate.h15
-rw-r--r--src/osd/mac/appdelegate.mm54
-rw-r--r--src/osd/mac/macmain.cpp271
-rw-r--r--src/osd/mac/main.mm19
-rw-r--r--src/osd/mac/mamefswindow.h15
-rw-r--r--src/osd/mac/mamefswindow.mm41
-rw-r--r--src/osd/mac/oglview.h19
-rw-r--r--src/osd/mac/oglview.mm106
-rw-r--r--src/osd/mac/osdmac.h86
-rw-r--r--src/osd/mac/video.cpp316
-rw-r--r--src/osd/mac/window.cpp970
-rw-r--r--src/osd/mac/window.h134
-rw-r--r--src/osd/mac/windowcontroller.h16
-rw-r--r--src/osd/mac/windowcontroller.mm131
-rw-r--r--src/osd/modules/debugger/debugosx.mm4
-rw-r--r--src/osd/modules/input/input_mac.cpp55
-rw-r--r--src/osd/modules/lib/osdobj_common.cpp3
-rw-r--r--src/osd/modules/monitor/monitor_mac.cpp189
-rw-r--r--src/osd/modules/opengl/osd_opengl.h3
-rw-r--r--src/osd/modules/render/drawbgfx.cpp21
-rw-r--r--src/osd/modules/render/drawogl.cpp15
-rw-r--r--src/osd/modules/render/drawogl.h5
379 files changed, 6941 insertions, 3698 deletions
diff --git a/src/devices/bus/a2gameio/computereyes.h b/src/devices/bus/a2gameio/computereyes.h
index 52c000a8045..6aef78796a6 100644
--- a/src/devices/bus/a2gameio/computereyes.h
+++ b/src/devices/bus/a2gameio/computereyes.h
@@ -7,7 +7,7 @@
*********************************************************************/
#ifndef MAME_BUS_A2GAMEIO_COMPEYES_H
-#define MAME_BUS_A2GAMEIO_COMPEYES_H 1
+#define MAME_BUS_A2GAMEIO_COMPEYES_H
#pragma once
diff --git a/src/devices/bus/a2gameio/gameio.h b/src/devices/bus/a2gameio/gameio.h
index fa0c1b5eb52..e2bc7e512ea 100644
--- a/src/devices/bus/a2gameio/gameio.h
+++ b/src/devices/bus/a2gameio/gameio.h
@@ -7,7 +7,7 @@
*********************************************************************/
#ifndef MAME_BUS_A2GAMEIO_GAMEIO_H
-#define MAME_BUS_A2GAMEIO_GAMEIO_H 1
+#define MAME_BUS_A2GAMEIO_GAMEIO_H
#pragma once
diff --git a/src/devices/bus/a2gameio/joyport.h b/src/devices/bus/a2gameio/joyport.h
index e138358d87e..0e1b9e1a8dd 100644
--- a/src/devices/bus/a2gameio/joyport.h
+++ b/src/devices/bus/a2gameio/joyport.h
@@ -7,7 +7,7 @@
*********************************************************************/
#ifndef MAME_BUS_A2GAMEIO_JOYPORT_H
-#define MAME_BUS_A2GAMEIO_JOYPORT_H 1
+#define MAME_BUS_A2GAMEIO_JOYPORT_H
#pragma once
diff --git a/src/devices/bus/a2gameio/joystick.h b/src/devices/bus/a2gameio/joystick.h
index 20a17177a32..59969c0c1b3 100644
--- a/src/devices/bus/a2gameio/joystick.h
+++ b/src/devices/bus/a2gameio/joystick.h
@@ -7,7 +7,7 @@
*********************************************************************/
#ifndef MAME_BUS_A2GAMEIO_JOYSTICK_H
-#define MAME_BUS_A2GAMEIO_JOYSTICK_H 1
+#define MAME_BUS_A2GAMEIO_JOYSTICK_H
#pragma once
diff --git a/src/devices/bus/amiga/keyboard/mitsumi.cpp b/src/devices/bus/amiga/keyboard/mitsumi.cpp
index a321562da9b..36837410cc4 100644
--- a/src/devices/bus/amiga/keyboard/mitsumi.cpp
+++ b/src/devices/bus/amiga/keyboard/mitsumi.cpp
@@ -112,7 +112,7 @@ public:
m_mcu->pa_w(machine().dummy_space(), 0, m_meta->read());
}
- CUSTOM_INPUT_MEMBER(kdat_r)
+ READ_LINE_MEMBER(kdat_r)
{
return m_kdat_in ^ 0x01U;
}
@@ -128,7 +128,7 @@ public:
return (result >> 2) ^ 0x3fU;
}
- CUSTOM_INPUT_MEMBER(reset_r)
+ READ_LINE_MEMBER(reset_r)
{
return m_ctrl_a_a;
}
@@ -414,17 +414,17 @@ protected:
INPUT_PORTS_START(fullsize_cols)
PORT_START("COLS")
- PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, mitsumi_keyboard_base, cols_r, nullptr)
+ PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(mitsumi_keyboard_base, cols_r)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, mitsumi_keyboard_base, kdat_r, nullptr)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_MEMBER(mitsumi_keyboard_base, kdat_r)
INPUT_PORTS_END
INPUT_PORTS_START(compact_cols)
PORT_START("COLS")
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, mitsumi_keyboard_base, reset_r, nullptr)
- PORT_BIT(0x7c, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, mitsumi_keyboard_base, cols_r, nullptr)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_MEMBER(mitsumi_keyboard_base, reset_r)
+ PORT_BIT(0x7c, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(mitsumi_keyboard_base, cols_r)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, mitsumi_keyboard_base, kdat_r, nullptr)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_MEMBER(mitsumi_keyboard_base, kdat_r)
INPUT_PORTS_END
INPUT_PORTS_START(mitsumi_meta)
diff --git a/src/devices/bus/coleco/controller/hand.cpp b/src/devices/bus/coleco/controller/hand.cpp
index b8410183b68..d5e4d72b6bc 100644
--- a/src/devices/bus/coleco/controller/hand.cpp
+++ b/src/devices/bus/coleco/controller/hand.cpp
@@ -50,7 +50,7 @@ static INPUT_PORTS_START( coleco_hand_controller )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM )
PORT_START("COMMON1")
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, coleco_hand_controller_device, keypad_r, nullptr)
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(coleco_hand_controller_device, keypad_r)
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM )
diff --git a/src/devices/bus/coleco/controller/sac.cpp b/src/devices/bus/coleco/controller/sac.cpp
index 0a47ac4be7a..7621897c78d 100644
--- a/src/devices/bus/coleco/controller/sac.cpp
+++ b/src/devices/bus/coleco/controller/sac.cpp
@@ -57,7 +57,7 @@ static INPUT_PORTS_START( coleco_super_action_controller )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM )
PORT_START("COMMON1")
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, coleco_super_action_controller_device, keypad_r, nullptr)
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(coleco_super_action_controller_device, keypad_r)
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM )
diff --git a/src/devices/bus/isa/asc88.h b/src/devices/bus/isa/asc88.h
index 068f416112e..101f995760c 100644
--- a/src/devices/bus/isa/asc88.h
+++ b/src/devices/bus/isa/asc88.h
@@ -8,7 +8,7 @@
***************************************************************************/
#ifndef MAME_BUS_ISA_ASC88_H
-#define MAME_BUS_ISA_ASC88_H 1
+#define MAME_BUS_ISA_ASC88_H
#pragma once
diff --git a/src/devices/bus/nscsi/cdd2000.h b/src/devices/bus/nscsi/cdd2000.h
index e69c65f4548..8f2b6eb6a20 100644
--- a/src/devices/bus/nscsi/cdd2000.h
+++ b/src/devices/bus/nscsi/cdd2000.h
@@ -2,7 +2,7 @@
// copyright-holders:AJR
#ifndef MAME_BUS_NSCSI_CDD2000_H
-#define MAME_BUS_NSCSI_CDD2000_H 1
+#define MAME_BUS_NSCSI_CDD2000_H
#pragma once
diff --git a/src/devices/bus/nscsi/cdrn820s.h b/src/devices/bus/nscsi/cdrn820s.h
index 1f5a273e0bc..c76fb007bbd 100644
--- a/src/devices/bus/nscsi/cdrn820s.h
+++ b/src/devices/bus/nscsi/cdrn820s.h
@@ -2,7 +2,7 @@
// copyright-holders:AJR
#ifndef MAME_BUS_NSCSI_CDRN820S_H
-#define MAME_BUS_NSCSI_CDRN820S_H 1
+#define MAME_BUS_NSCSI_CDRN820S_H
#pragma once
diff --git a/src/devices/bus/s100/am310.h b/src/devices/bus/s100/am310.h
index e3740b6ad5f..81d387f4f25 100644
--- a/src/devices/bus/s100/am310.h
+++ b/src/devices/bus/s100/am310.h
@@ -7,7 +7,7 @@
**********************************************************************/
#ifndef MAME_BUS_S100_AM310_H
-#define MAME_BUS_S100_AM310_H 1
+#define MAME_BUS_S100_AM310_H
#pragma once
diff --git a/src/devices/bus/sms_ctrl/paddle.cpp b/src/devices/bus/sms_ctrl/paddle.cpp
index 4f366697218..06f1c9bfa16 100644
--- a/src/devices/bus/sms_ctrl/paddle.cpp
+++ b/src/devices/bus/sms_ctrl/paddle.cpp
@@ -60,11 +60,11 @@ READ_LINE_MEMBER( sms_paddle_device::tr_pin_r )
static INPUT_PORTS_START( sms_paddle )
PORT_START("CTRL_PORT")
- PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_paddle_device, rldu_pins_r, nullptr) // R,L,D,U
+ PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sms_paddle_device, rldu_pins_r) // R,L,D,U
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // TL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // TH
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER( DEVICE_SELF, sms_paddle_device, tr_pin_r ) // TR
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sms_paddle_device, tr_pin_r) // TR
PORT_START("PADDLE_X") // Paddle knob
PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(20) PORT_CENTERDELTA(0) PORT_MINMAX(0,255)
diff --git a/src/devices/bus/sms_ctrl/sports.cpp b/src/devices/bus/sms_ctrl/sports.cpp
index 2cca6cd069b..5a4809d3573 100644
--- a/src/devices/bus/sms_ctrl/sports.cpp
+++ b/src/devices/bus/sms_ctrl/sports.cpp
@@ -120,17 +120,17 @@ CUSTOM_INPUT_MEMBER( sms_sports_pad_device::rldu_pins_r )
static INPUT_PORTS_START( sms_sports_pad )
PORT_START("SPORTS_IN")
- PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_sports_pad_device, rldu_pins_r, nullptr) // R,L,D,U
+ PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sms_sports_pad_device, rldu_pins_r) // R,L,D,U
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // TL (Button 1)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER(DEVICE_SELF, sms_sports_pad_device, th_pin_r) // TH
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sms_sports_pad_device, th_pin_r) // TH
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) // TR (Button 2)
PORT_START("SPORTS_OUT")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) // Directional pins
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) // TL (Button 1)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, sms_sports_pad_device, th_pin_w) // TH
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_MEMBER(sms_sports_pad_device, th_pin_w) // TH
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) // TR (Button 2)
PORT_START("SPORTS_X") /* Sports Pad X axis */
diff --git a/src/devices/bus/sms_ctrl/sportsjp.cpp b/src/devices/bus/sms_ctrl/sportsjp.cpp
index 76c8e607e57..a0c2a69d2ad 100644
--- a/src/devices/bus/sms_ctrl/sportsjp.cpp
+++ b/src/devices/bus/sms_ctrl/sportsjp.cpp
@@ -65,11 +65,11 @@ CUSTOM_INPUT_MEMBER( sms_sports_pad_jp_device::rldu_pins_r ) { return ~(m_rldu_p
static INPUT_PORTS_START( sms_sports_pad_jp )
PORT_START("SPORTS_JP_IN")
- PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_sports_pad_jp_device, rldu_pins_r, nullptr) // R,L,D,U
+ PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sms_sports_pad_jp_device, rldu_pins_r) // R,L,D,U
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER( DEVICE_SELF, sms_sports_pad_jp_device, tl_pin_r ) // TL
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sms_sports_pad_jp_device, tl_pin_r) // TL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // TH
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER( DEVICE_SELF, sms_sports_pad_jp_device, tr_pin_r ) // TR
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sms_sports_pad_jp_device, tr_pin_r) // TR
PORT_START("SPORTS_JP_BT") /* Sports Pad buttons nibble */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
diff --git a/src/devices/cpu/bcp/bcpdasm.h b/src/devices/cpu/bcp/bcpdasm.h
index f544564221e..0389cf33341 100644
--- a/src/devices/cpu/bcp/bcpdasm.h
+++ b/src/devices/cpu/bcp/bcpdasm.h
@@ -7,7 +7,7 @@
***************************************************************************/
#ifndef MAME_CPU_BCP_BCPDASM_H
-#define MAME_CPU_BCP_BCPDASM_H 1
+#define MAME_CPU_BCP_BCPDASM_H
#pragma once
diff --git a/src/devices/cpu/bcp/dp8344.h b/src/devices/cpu/bcp/dp8344.h
index 20a7dec1d8f..70624254b8a 100644
--- a/src/devices/cpu/bcp/dp8344.h
+++ b/src/devices/cpu/bcp/dp8344.h
@@ -7,7 +7,7 @@
**********************************************************************/
#ifndef MAME_CPU_BCP_DP8344_H
-#define MAME_CPU_BCP_DP8344_H 1
+#define MAME_CPU_BCP_DP8344_H
#pragma once
diff --git a/src/devices/cpu/cr16b/cr16b.h b/src/devices/cpu/cr16b/cr16b.h
index 9dbca95f4f4..09334dfeff9 100644
--- a/src/devices/cpu/cr16b/cr16b.h
+++ b/src/devices/cpu/cr16b/cr16b.h
@@ -2,7 +2,7 @@
// copyright-holders:AJR
#ifndef MAME_CPU_CR16B_CR16B_H
-#define MAME_CPU_CR16B_CR16B_H 1
+#define MAME_CPU_CR16B_CR16B_H
#pragma once
diff --git a/src/devices/cpu/cr16b/cr16bdasm.h b/src/devices/cpu/cr16b/cr16bdasm.h
index 36a533b0e7e..fa0218796ee 100644
--- a/src/devices/cpu/cr16b/cr16bdasm.h
+++ b/src/devices/cpu/cr16b/cr16bdasm.h
@@ -2,7 +2,7 @@
// copyright-holders:AJR
#ifndef MAME_CPU_CR16B_CR16BDASM_H
-#define MAME_CPU_CR16B_CR16BDASM_H 1
+#define MAME_CPU_CR16B_CR16BDASM_H
#pragma once
diff --git a/src/devices/cpu/f2mc16/f2mc16.h b/src/devices/cpu/f2mc16/f2mc16.h
index 191b56bf2d4..1afe221d252 100644
--- a/src/devices/cpu/f2mc16/f2mc16.h
+++ b/src/devices/cpu/f2mc16/f2mc16.h
@@ -7,7 +7,7 @@
***************************************************************************/
#ifndef MAME_CPU_F2MC16_F2MC16_H
-#define MAME_CPU_F2MC16_F2MC16_H 1
+#define MAME_CPU_F2MC16_F2MC16_H
#pragma once
diff --git a/src/devices/cpu/g65816/g65816.cpp b/src/devices/cpu/g65816/g65816.cpp
index 93c93f96ed8..eb46c11242d 100644
--- a/src/devices/cpu/g65816/g65816.cpp
+++ b/src/devices/cpu/g65816/g65816.cpp
@@ -895,9 +895,7 @@ void g65816_device::device_start()
machine().save().register_postload(save_prepost_delegate(FUNC(g65816_device::g65816_restore_state), this));
- m_rw8_cycles = 1;
- m_rw16_cycles = 2;
- m_rw24_cycles = 3;
+ m_divider = 1;
state_add( G65816_PC, "PC", m_debugger_temp).callimport().callexport().formatstr("%06X");
state_add( G65816_S, "S", m_s).callimport().formatstr("%04X");
@@ -1031,14 +1029,14 @@ int g65816_device::bus_5A22_cycle_burst(unsigned addr)
if(addr & 0x408000) {
if(addr & 0x800000)
- return (m_fastROM & 1) ? 6 : 8;
+ return (m_fastROM & 1) ? 0 : 2;
- return 8;
+ return 2;
}
- if((addr + 0x6000) & 0x4000) return 8;
- if((addr - 0x4000) & 0x7e00) return 6;
+ if((addr + 0x6000) & 0x4000) return 2;
+ if((addr - 0x4000) & 0x7e00) return 0;
- return 12;
+ return 6;
}
@@ -1048,9 +1046,7 @@ void _5a22_device::device_start()
state_add( _5A22_FASTROM, "fastROM", m_debugger_temp).mask(0x01).callimport().callexport().formatstr("%01X");
- m_rw8_cycles = 0;
- m_rw16_cycles = 0;
- m_rw24_cycles = 0;
+ m_divider = 6;
}
void _5a22_device::state_import(const device_state_entry &entry)
diff --git a/src/devices/cpu/g65816/g65816.h b/src/devices/cpu/g65816/g65816.h
index 454dc7fd1b5..f7028697880 100644
--- a/src/devices/cpu/g65816/g65816.h
+++ b/src/devices/cpu/g65816/g65816.h
@@ -246,7 +246,7 @@ protected:
unsigned m_destination;
int m_ICount;
int m_cpu_type;
- uint8_t m_rw8_cycles, m_rw16_cycles, m_rw24_cycles;
+ uint8_t m_divider;
uint32_t m_debugger_temp;
/* 5A22 specific registers */
diff --git a/src/devices/cpu/g65816/g65816cm.h b/src/devices/cpu/g65816/g65816cm.h
index 6991eca301e..7956eda871c 100644
--- a/src/devices/cpu/g65816/g65816cm.h
+++ b/src/devices/cpu/g65816/g65816cm.h
@@ -117,16 +117,16 @@
/* ======================================================================== */
#define CLK_OP 1
-#define CLK_R8 m_rw8_cycles
-#define CLK_R16 m_rw16_cycles
-#define CLK_R24 m_rw24_cycles
-#define CLK_W8 m_rw8_cycles
-#define CLK_W16 m_rw16_cycles
-#define CLK_W24 m_rw24_cycles
-#define CLK_RMW8 m_rw8_cycles+m_rw8_cycles + 1
-#define CLK_RMW16 m_rw16_cycles+m_rw16_cycles + 1
+#define CLK_R8 1
+#define CLK_R16 2
+#define CLK_R24 3
+#define CLK_W8 1
+#define CLK_W16 2
+#define CLK_W24 3
+#define CLK_RMW8 3
+#define CLK_RMW16 5
+
-#define CLK_IMPLIED 1
#define CLK_IMPLIED 1
#define CLK_RELATIVE_8 1
#define CLK_RELATIVE_16 2
@@ -169,7 +169,7 @@
#define CLK_W_S 2
#define CLK_W_SIY 5
-#define CLK(A) CLOCKS -= A
+#define CLK(A) CLOCKS -= ((A)*(m_divider))
#define CLK_BUS(A) CLOCKS -= A
#define USE_ALL_CLKS() CLOCKS = 0
diff --git a/src/devices/cpu/m6502/m6502.cpp b/src/devices/cpu/m6502/m6502.cpp
index 2ca7329bf87..013e4f19ef4 100644
--- a/src/devices/cpu/m6502/m6502.cpp
+++ b/src/devices/cpu/m6502/m6502.cpp
@@ -6,12 +6,6 @@
MOS Technology 6502, original NMOS variant
-TODO:
-- device_start SP = 0x01bd; can't be right. At power-on, SP = 0(0x100)
- and at RESET, it is decremented 3 times without writing to the stack
- see: https://www.pagetable.com/?p=410
- In other words, the first couple of cycles of STATE_RESET aren't emulated
-
***************************************************************************/
#include "emu.h"
@@ -99,7 +93,7 @@ void m6502_device::init()
X = 0x80;
Y = 0x00;
P = 0x36;
- SP = 0x01bd;
+ SP = 0x0100;
TMP = 0x0000;
TMP2 = 0x00;
IR = 0x00;
diff --git a/src/devices/cpu/m6502/om6502.lst b/src/devices/cpu/m6502/om6502.lst
index e9b8520c490..fd4a85dbf9c 100644
--- a/src/devices/cpu/m6502/om6502.lst
+++ b/src/devices/cpu/m6502/om6502.lst
@@ -1218,6 +1218,9 @@ tya_imp
# exceptions
reset
+ read(SP); dec_SP();
+ read(SP); dec_SP();
+ read(SP); dec_SP();
P |= F_I; PC = read_arg(0xfffc);
PC = set_h(PC, read_arg(0xfffd));
prefetch();
diff --git a/src/devices/cpu/rii/riscii.h b/src/devices/cpu/rii/riscii.h
index df6a1199da3..835d9469f46 100644
--- a/src/devices/cpu/rii/riscii.h
+++ b/src/devices/cpu/rii/riscii.h
@@ -7,7 +7,7 @@
***************************************************************************/
#ifndef MAME_CPU_RII_RISCII_H
-#define MAME_CPU_RII_RISCII_H 1
+#define MAME_CPU_RII_RISCII_H
#pragma once
diff --git a/src/devices/cpu/spc700/spc700.cpp b/src/devices/cpu/spc700/spc700.cpp
index 3118d97e810..b5d2b835cfc 100644
--- a/src/devices/cpu/spc700/spc700.cpp
+++ b/src/devices/cpu/spc700/spc700.cpp
@@ -247,7 +247,8 @@ device_memory_interface::space_config_vector spc700_device::memory_space_config(
/* ======================================================================== */
/* Use up clock cycles */
-#define CLK(A) CLOCKS -= (A)
+#define CLK_DIVIDER 2
+#define CLK(A) CLOCKS -= ((A)*(CLK_DIVIDER))
#define CLK_ALL() CLOCKS = 0
diff --git a/src/devices/machine/aic565.h b/src/devices/machine/aic565.h
index 2f2fdf72b91..581a595d77c 100644
--- a/src/devices/machine/aic565.h
+++ b/src/devices/machine/aic565.h
@@ -7,7 +7,7 @@
**********************************************************************/
#ifndef MAME_MACHINE_AIC565_H
-#define MAME_MACHINE_AIC565_H 1
+#define MAME_MACHINE_AIC565_H
#pragma once
diff --git a/src/devices/machine/ds17x85.h b/src/devices/machine/ds17x85.h
index 3fcdc904c79..413ed5f4b8b 100644
--- a/src/devices/machine/ds17x85.h
+++ b/src/devices/machine/ds17x85.h
@@ -22,7 +22,7 @@
**********************************************************************/
#ifndef MAME_MACHINE_DS17X85_H
-#define MAME_MACHINE_DS17X85_H 1
+#define MAME_MACHINE_DS17X85_H
#pragma once
diff --git a/src/devices/machine/ds1994.cpp b/src/devices/machine/ds1994.cpp
index 8b379f6ba82..bf0f6eef017 100644
--- a/src/devices/machine/ds1994.cpp
+++ b/src/devices/machine/ds1994.cpp
@@ -9,6 +9,9 @@
*
*/
+// FIXME: convert to device_rtc_interface and remove time.h
+// FIXME: convert logging to use logmacro.h
+
#include "emu.h"
#include "machine/ds1994.h"
@@ -25,12 +28,12 @@ inline void ds1994_device::verboselog(int n_level, const char *s_fmt, ...)
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("ds1994 %s %s: %s", tag(), machine().describe_context(), buf);
+ logerror("ds1994 %s: %s", machine().describe_context(), buf);
}
}
// device type definition
-DEFINE_DEVICE_TYPE(DS1994, ds1994_device, "ds1994", "DS1994 RTC + BACKUP RAM")
+DEFINE_DEVICE_TYPE(DS1994, ds1994_device, "ds1994", "DS1994 iButton 4Kb Memory Plus Time")
ds1994_device::ds1994_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, DS1994, tag, owner, clock), device_nvram_interface(mconfig, *this)
@@ -768,41 +771,3 @@ void ds1994_device::nvram_write(emu_file &file)
file.write(m_rtc, RTC_SIZE);
file.write(m_regs, REGS_SIZE);
}
-
-/*
-
-app74.pdf
-
-Under normal circumstances an ibutton will sample the line 30us after the falling edge of the start condition.
-The internal time base of ibutton may deviate from its nominal value. The allowed tollerance band ranges from 15us to 60us.
-This means that the actual slave sampling may occur anywhere from 15 and 60us after the start condition, which is a ratio of 1 to 4.
-During this time frame the voltage on the data line must stay below Vilmax or above Vihmin.
-
-In the 1-Wire system, the logical values 1 and 0 are represented by certain voltages in special waveforms.
-The waveforms needed to write commands or data to ibuttons are called write-1 and write-0 time slots.
-The duration of a low pulse to write a 1 must be shorter than 15us.
-To write a 0, the duration of the low pulse must be at least 60us to cope with worst-case conditions.
-
-The duration of the active part of a time slot can be extended beyond 60us.
-The maximum extension is limited by the fact that a low pulse of a duration of at least eight active time slots ( 480us ) is defined as a Reset Pulse.
-Allowing the same worst-case tolerance ratio, a low pulse of 120us might be sufficient for a reset.
-This limits the extension of the active part of a time slot to a maximum of 120us to prevent misinterpretation with reset.
-
-Commands and data are sent to ibuttons by combining write-0 and write-1 time slots.
-To read data, the master has to generate read-data time slots to define the start condition of each bit.
-The read-data time slots looks essentially the same as a write-1 time slot from the masters point of view.
-Starting at the high-to-low transition, the ibuttons sends 1 bit of its addressed contents.
-If the data bit is a 1, the ibutton leaves the pulse unchanged.
-If the data bit is a 0, the ibutton will pull the data line low for 15us.
-In this time frame data is valid for reading by the master.
-The duration of the low pulse sent by the master should be a minimum of 1us with a maximum value as short as possible to maximize the master sampling window.
-
-The Reset Pulse provides a clear starting condition that supersedes any time slot synchronisation.
-It is defined as single low pulse of minimum duration of eight time slots or 480us followed by a Reset-high time tRSTH of another 480us.
-After a Reset Pulse has been sent, the ibutton will wait for the time tPDH and then generate a Pulse-Presence Pulse of duration tPDL.
-No other communication on the 1-Wire bus is allowed during tRSTH.
-
-There are 1,000 microseconds in a millisecond, and 1,000 milliseconds in a second.
-Thus, there are 1,000,000 microseconds in a second. Why is it "usec"?
-The "u" is supposed to look like the Greek letter Mu that we use for "micro". .
-*/
diff --git a/src/devices/machine/i82355.h b/src/devices/machine/i82355.h
index 1e9423bb585..25cb776d9f7 100644
--- a/src/devices/machine/i82355.h
+++ b/src/devices/machine/i82355.h
@@ -7,7 +7,7 @@
**********************************************************************/
#ifndef MAME_MACHINE_I82355_H
-#define MAME_MACHINE_I82355_H 1
+#define MAME_MACHINE_I82355_H
#pragma once
diff --git a/src/devices/machine/mm5307.h b/src/devices/machine/mm5307.h
index d46124e89ee..c1e6dad8f89 100644
--- a/src/devices/machine/mm5307.h
+++ b/src/devices/machine/mm5307.h
@@ -17,7 +17,7 @@
***************************************************************************/
#ifndef MAME_MACHINE_MM5307_H
-#define MAME_MACHINE_MM5307_H 1
+#define MAME_MACHINE_MM5307_H
#pragma once
diff --git a/src/devices/machine/pcf8584.h b/src/devices/machine/pcf8584.h
index eda20a4df28..68886a7affc 100644
--- a/src/devices/machine/pcf8584.h
+++ b/src/devices/machine/pcf8584.h
@@ -20,7 +20,7 @@
**********************************************************************/
#ifndef MAME_MACHINE_PCF8584_H
-#define MAME_MACHINE_PCF8584_H 1
+#define MAME_MACHINE_PCF8584_H
#pragma once
diff --git a/src/devices/machine/sensorboard.cpp b/src/devices/machine/sensorboard.cpp
index 8a809fe7a73..18f20adf510 100644
--- a/src/devices/machine/sensorboard.cpp
+++ b/src/devices/machine/sensorboard.cpp
@@ -730,7 +730,7 @@ static INPUT_PORTS_START( sensorboard )
PORT_START("UI")
PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1, NOTEQUALS, 0) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("Modifier 2 / Force Sensor") // hold while clicking to force sensor (ignore piece)
PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1, NOTEQUALS, 0) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_NAME("Modifier 1 / Force Piece") // hold while clicking to force piece (ignore sensor)
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sensorboard_device, check_sensor_busy, nullptr) // check if any sensor is busy / pressed (read-only)
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sensorboard_device, check_sensor_busy) // check if any sensor is busy / pressed (read-only)
PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_hand, 0) PORT_NAME("Remove Piece")
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_undo, 0) PORT_NAME("Undo Buffer First")
PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_undo, 1) PORT_NAME("Undo Buffer Previous")
@@ -740,13 +740,13 @@ static INPUT_PORTS_START( sensorboard )
PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_init, 1) PORT_NAME("Board Reset")
PORT_START("BS_CHECK") // board size (internal use)
- PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sensorboard_device, check_bs_mask, nullptr)
+ PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sensorboard_device, check_bs_mask)
PORT_START("SS_CHECK") // spawn size (internal use)
- PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sensorboard_device, check_ss_mask, nullptr)
+ PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sensorboard_device, check_ss_mask)
PORT_START("UI_CHECK") // UI enabled (internal use)
- PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sensorboard_device, check_ui_enabled, nullptr)
+ PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sensorboard_device, check_ui_enabled)
INPUT_PORTS_END
ioport_constructor sensorboard_device::device_input_ports() const
diff --git a/src/devices/video/dp8350.cpp b/src/devices/video/dp8350.cpp
index 4443b58348b..bf77c913f89 100644
--- a/src/devices/video/dp8350.cpp
+++ b/src/devices/video/dp8350.cpp
@@ -178,7 +178,10 @@ dp835x_a_device::dp835x_a_device(const machine_config &mconfig, const char *tag,
void dp835x_device::device_config_complete()
{
- if (has_screen() && screen().refresh_attoseconds() == 0)
+ if (!has_screen())
+ return;
+
+ if (screen().refresh_attoseconds() == 0)
{
int lines_per_frame = m_video_scan_lines + m_vblank_interval[m_60hz_refresh ? 1 : 0];
if (m_half_shift)
@@ -227,6 +230,7 @@ void dp835x_device::device_start()
save_item(NAME(m_rsr));
save_item(NAME(m_cr));
save_item(NAME(m_row_start));
+ save_item(NAME(m_line));
}
@@ -475,7 +479,7 @@ TIMER_CALLBACK_MEMBER(dp835x_device::hblank_start)
m_lrc_callback(0);
// increment line counter or reset it
- if (m_lc < m_char_height - 1 && m_line != lines_per_frame - m_char_height)
+ if (m_lc < m_char_height - 1 && m_line != lines_per_frame - m_char_height - 1)
m_lc++;
else
{
@@ -492,17 +496,6 @@ TIMER_CALLBACK_MEMBER(dp835x_device::hblank_start)
bool lbre = m_lc != (m_cgpi ? 0 : m_char_height - 1);
m_lbre_callback(lbre ? 1 : 0);
- if (m_line >= lines_per_frame - m_char_height && m_line < lines_per_frame)
- {
- m_row_start = m_rsr = m_topr;
- }
- else if (!lbre || m_line >= m_video_scan_lines)
- {
- // calculate starting address of next row (address counter runs continuously during VBLANK)
- m_row_start = m_rsr;
- m_rsr = (m_row_start + m_chars_per_row) & 0xfff;
- }
-
// update vertical blanking output
if (m_line == m_video_scan_lines)
m_vblank_callback(m_vblank_active);
@@ -531,6 +524,18 @@ TIMER_CALLBACK_MEMBER(dp835x_device::hblank_near_end)
m_lrc_callback(1);
if (m_lc == 0)
m_clc_callback(1);
+
+ int last_line = m_video_scan_lines + m_vblank_interval[m_60hz_refresh ? 1 : 0] - (m_cgpi ? 0 : 1);
+ if (m_line >= last_line - m_char_height && m_line < last_line)
+ {
+ m_row_start = m_rsr = m_topr;
+ }
+ else if (m_lc == (m_cgpi ? 0 : m_char_height - 1) || m_line >= m_video_scan_lines)
+ {
+ // calculate starting address of next row (address counter runs continuously during VBLANK)
+ m_row_start = m_rsr;
+ m_rsr = (m_row_start + m_chars_per_row) & 0xfff;
+ }
}
diff --git a/src/devices/video/t6963c.h b/src/devices/video/t6963c.h
index 075bb8f78d0..33b748e38c3 100644
--- a/src/devices/video/t6963c.h
+++ b/src/devices/video/t6963c.h
@@ -8,7 +8,7 @@
**********************************************************************/
#ifndef MAME_VIDEO_T6963C_H
-#define MAME_VIDEO_T6963C_H 1
+#define MAME_VIDEO_T6963C_H
#pragma once
diff --git a/src/emu/drawgfx.cpp b/src/emu/drawgfx.cpp
index 841ae7c670f..488a0c9740e 100644
--- a/src/emu/drawgfx.cpp
+++ b/src/emu/drawgfx.cpp
@@ -8,18 +8,7 @@
*********************************************************************/
#include "emu.h"
-#include "drawgfxm.h"
-
-
-/***************************************************************************
- GLOBAL VARIABLES
-***************************************************************************/
-
-// if this line errors during compile, the size of NO_PRIORITY is wrong and I need to use something else
-u8 no_priority_size_is_wrong[2 * (sizeof(NO_PRIORITY) == 3) - 1];
-
-bitmap_ind8 drawgfx_dummy_priority_bitmap;
-
+#include "drawgfxt.ipp"
/***************************************************************************
@@ -364,8 +353,7 @@ void gfx_element::opaque(bitmap_ind16 &dest, const rectangle &cliprect,
{
color = colorbase() + granularity() * (color % colors());
code %= elements();
- DECLARE_NO_PRIORITY;
- DRAWGFX_CORE(u16, PIXEL_OP_REBASE_OPAQUE, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [color](u16 &destp, const u8 &srcp) { PIXEL_OP_REBASE_OPAQUE(destp, srcp); });
}
void gfx_element::opaque(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -373,8 +361,7 @@ void gfx_element::opaque(bitmap_rgb32 &dest, const rectangle &cliprect,
{
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
code %= elements();
- DECLARE_NO_PRIORITY;
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [paldata](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_OPAQUE(destp, srcp); });
}
@@ -407,8 +394,7 @@ void gfx_element::transpen(bitmap_ind16 &dest, const rectangle &cliprect,
// render
color = colorbase() + granularity() * (color % colors());
- DECLARE_NO_PRIORITY;
- DRAWGFX_CORE(u16, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [trans_pen, color](u16 &destp, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN(destp, srcp); });
}
void gfx_element::transpen(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -435,8 +421,7 @@ void gfx_element::transpen(bitmap_rgb32 &dest, const rectangle &cliprect,
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DECLARE_NO_PRIORITY;
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [trans_pen, paldata](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_TRANSPEN(destp, srcp); });
}
@@ -456,8 +441,7 @@ void gfx_element::transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect,
return;
// render
- DECLARE_NO_PRIORITY;
- DRAWGFX_CORE(u16, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [trans_pen, color](u16 &destp, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN(destp, srcp); });
}
void gfx_element::transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -470,8 +454,7 @@ void gfx_element::transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect,
return;
// render
- DECLARE_NO_PRIORITY;
- DRAWGFX_CORE(u32, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [trans_pen, color](u32 &destp, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN(destp, srcp); });
}
@@ -505,8 +488,7 @@ void gfx_element::transmask(bitmap_ind16 &dest, const rectangle &cliprect,
// render
color = colorbase() + granularity() * (color % colors());
- DECLARE_NO_PRIORITY;
- DRAWGFX_CORE(u16, PIXEL_OP_REBASE_TRANSMASK, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [trans_mask, color](u16 &destp, const u8 &srcp) { PIXEL_OP_REBASE_TRANSMASK(destp, srcp); });
}
void gfx_element::transmask(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -533,8 +515,7 @@ void gfx_element::transmask(bitmap_rgb32 &dest, const rectangle &cliprect,
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DECLARE_NO_PRIORITY;
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANSMASK, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [trans_mask, paldata](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_TRANSMASK(destp, srcp); });
}
@@ -554,8 +535,7 @@ void gfx_element::transtable(bitmap_ind16 &dest, const rectangle &cliprect,
color = colorbase() + granularity() * (color % colors());
const pen_t *shadowtable = m_palette->shadow_table();
code %= elements();
- DECLARE_NO_PRIORITY;
- DRAWGFX_CORE(u16, PIXEL_OP_REBASE_TRANSTABLE16, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [pentable, color, shadowtable](u16 &destp, const u8 &srcp) { PIXEL_OP_REBASE_TRANSTABLE16(destp, srcp); });
}
void gfx_element::transtable(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -568,8 +548,7 @@ void gfx_element::transtable(bitmap_rgb32 &dest, const rectangle &cliprect,
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
const pen_t *shadowtable = m_palette->shadow_table();
code %= elements();
- DECLARE_NO_PRIORITY;
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANSTABLE32, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [pentable, paldata, shadowtable](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_TRANSTABLE32(destp, srcp); });
}
@@ -594,8 +573,7 @@ void gfx_element::alpha(bitmap_rgb32 &dest, const rectangle &cliprect,
// get final code and color, and grab lookup tables
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DECLARE_NO_PRIORITY;
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [trans_pen, alpha_val, paldata](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_TRANSPEN_ALPHA32(destp, srcp); });
}
@@ -620,8 +598,7 @@ void gfx_element::zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect,
// render
color = colorbase() + granularity() * (color % colors());
code %= elements();
- DECLARE_NO_PRIORITY;
- DRAWGFXZOOM_CORE(u16, PIXEL_OP_REBASE_OPAQUE, NO_PRIORITY);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, [color](u16 &destp, const u8 &srcp) { PIXEL_OP_REBASE_OPAQUE(destp, srcp); });
}
void gfx_element::zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -635,8 +612,7 @@ void gfx_element::zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect,
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
code %= elements();
- DECLARE_NO_PRIORITY;
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, [paldata](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_OPAQUE(destp, srcp); });
}
@@ -673,8 +649,7 @@ void gfx_element::zoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect,
// render
color = colorbase() + granularity() * (color % colors());
- DECLARE_NO_PRIORITY;
- DRAWGFXZOOM_CORE(u16, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, [trans_pen, color](u16 &destp, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN(destp, srcp); });
}
void gfx_element::zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -705,8 +680,7 @@ void gfx_element::zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect,
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DECLARE_NO_PRIORITY;
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, [trans_pen, paldata](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_TRANSPEN(destp, srcp); });
}
@@ -730,8 +704,7 @@ void gfx_element::zoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprec
return;
// render
- DECLARE_NO_PRIORITY;
- DRAWGFXZOOM_CORE(u16, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, [trans_pen, color](u16 &destp, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN(destp, srcp); });
}
void gfx_element::zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -748,8 +721,7 @@ void gfx_element::zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprec
return;
// render
- DECLARE_NO_PRIORITY;
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, [trans_pen, color](u32 &destp, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN(destp, srcp); });
}
@@ -787,8 +759,7 @@ void gfx_element::zoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect,
// render
color = colorbase() + granularity() * (color % colors());
- DECLARE_NO_PRIORITY;
- DRAWGFXZOOM_CORE(u16, PIXEL_OP_REBASE_TRANSMASK, NO_PRIORITY);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, [trans_mask, color](u16 &destp, const u8 &srcp) { PIXEL_OP_REBASE_TRANSMASK(destp, srcp); });
}
void gfx_element::zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -819,8 +790,7 @@ void gfx_element::zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect,
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DECLARE_NO_PRIORITY;
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REMAP_TRANSMASK, NO_PRIORITY);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, [trans_mask, paldata](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_TRANSMASK(destp, srcp); });
}
@@ -844,8 +814,7 @@ void gfx_element::zoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect,
color = colorbase() + granularity() * (color % colors());
const pen_t *shadowtable = m_palette->shadow_table();
code %= elements();
- DECLARE_NO_PRIORITY;
- DRAWGFXZOOM_CORE(u16, PIXEL_OP_REBASE_TRANSTABLE16, NO_PRIORITY);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, [pentable, color, shadowtable](u16 &destp, const u8 &srcp) { PIXEL_OP_REBASE_TRANSTABLE16(destp, srcp); });
}
void gfx_element::zoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -862,8 +831,7 @@ void gfx_element::zoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect,
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
const pen_t *shadowtable = m_palette->shadow_table();
code %= elements();
- DECLARE_NO_PRIORITY;
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REMAP_TRANSTABLE32, NO_PRIORITY);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, [pentable, paldata, shadowtable](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_TRANSTABLE32(destp, srcp); });
}
@@ -892,8 +860,7 @@ void gfx_element::zoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect,
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DECLARE_NO_PRIORITY;
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32, NO_PRIORITY);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, [trans_pen, alpha_val, paldata](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_TRANSPEN_ALPHA32(destp, srcp); });
}
@@ -918,7 +885,7 @@ void gfx_element::prio_opaque(bitmap_ind16 &dest, const rectangle &cliprect,
// render
color = colorbase() + granularity() * (color % colors());
code %= elements();
- DRAWGFX_CORE(u16, PIXEL_OP_REBASE_OPAQUE_PRIORITY, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, color](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void gfx_element::prio_opaque(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -931,7 +898,7 @@ void gfx_element::prio_opaque(bitmap_rgb32 &dest, const rectangle &cliprect,
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
code %= elements();
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_OPAQUE_PRIORITY, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, paldata](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIORITY(destp, pri, srcp); });
}
@@ -968,7 +935,7 @@ void gfx_element::prio_transpen(bitmap_ind16 &dest, const rectangle &cliprect,
// render
color = colorbase() + granularity() * (color % colors());
- DRAWGFX_CORE(u16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, trans_pen, color](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
void gfx_element::prio_transpen(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -998,7 +965,7 @@ void gfx_element::prio_transpen(bitmap_rgb32 &dest, const rectangle &cliprect,
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANSPEN_PRIORITY, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, trans_pen, paldata](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
@@ -1021,7 +988,7 @@ void gfx_element::prio_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprec
pmask |= 1 << 31;
// render
- DRAWGFX_CORE(u16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, trans_pen, color](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
void gfx_element::prio_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -1037,7 +1004,7 @@ void gfx_element::prio_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprec
pmask |= 1 << 31;
// render
- DRAWGFX_CORE(u32, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, trans_pen, color](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
@@ -1074,7 +1041,7 @@ void gfx_element::prio_transmask(bitmap_ind16 &dest, const rectangle &cliprect,
// render
color = colorbase() + granularity() * (color % colors());
- DRAWGFX_CORE(u16, PIXEL_OP_REBASE_TRANSMASK_PRIORITY, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, trans_mask, color](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_TRANSMASK_PRIORITY(destp, pri, srcp); });
}
void gfx_element::prio_transmask(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -1104,7 +1071,7 @@ void gfx_element::prio_transmask(bitmap_rgb32 &dest, const rectangle &cliprect,
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANSMASK_PRIORITY, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, trans_mask, paldata](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_TRANSMASK_PRIORITY(destp, pri, srcp); });
}
@@ -1128,7 +1095,7 @@ void gfx_element::prio_transtable(bitmap_ind16 &dest, const rectangle &cliprect,
color = colorbase() + granularity() * (color % colors());
const pen_t *shadowtable = m_palette->shadow_table();
code %= elements();
- DRAWGFX_CORE(u16, PIXEL_OP_REBASE_TRANSTABLE16_PRIORITY, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, pentable, color, shadowtable](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_TRANSTABLE16_PRIORITY(destp, pri, srcp); });
}
void gfx_element::prio_transtable(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -1144,7 +1111,7 @@ void gfx_element::prio_transtable(bitmap_rgb32 &dest, const rectangle &cliprect,
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
const pen_t *shadowtable = m_palette->shadow_table();
code %= elements();
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, pentable, paldata, shadowtable](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY(destp, pri, srcp); });
}
@@ -1173,7 +1140,7 @@ void gfx_element::prio_alpha(bitmap_rgb32 &dest, const rectangle &cliprect,
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, trans_pen, alpha_val, paldata](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY(destp, pri, srcp); });
}
@@ -1202,7 +1169,7 @@ void gfx_element::prio_zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect
// render
color = colorbase() + granularity() * (color % colors());
code %= elements();
- DRAWGFXZOOM_CORE(u16, PIXEL_OP_REBASE_OPAQUE_PRIORITY, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, color](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void gfx_element::prio_zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -1219,7 +1186,7 @@ void gfx_element::prio_zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
code %= elements();
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REMAP_OPAQUE_PRIORITY, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, paldata](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIORITY(destp, pri, srcp); });
}
@@ -1261,7 +1228,7 @@ void gfx_element::prio_zoom_transpen(bitmap_ind16 &dest, const rectangle &clipre
// render
color = colorbase() + granularity() * (color % colors());
- DRAWGFXZOOM_CORE(u16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, trans_pen, color](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
void gfx_element::prio_zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -1296,7 +1263,7 @@ void gfx_element::prio_zoom_transpen(bitmap_rgb32 &dest, const rectangle &clipre
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REMAP_TRANSPEN_PRIORITY, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, trans_pen, paldata](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
@@ -1325,7 +1292,7 @@ void gfx_element::prio_zoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cl
pmask |= 1 << 31;
// render
- DRAWGFXZOOM_CORE(u16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, trans_pen, color](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
void gfx_element::prio_zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -1346,7 +1313,7 @@ void gfx_element::prio_zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cl
pmask |= 1 << 31;
// render
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, trans_pen, color](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
@@ -1389,7 +1356,7 @@ void gfx_element::prio_zoom_transmask(bitmap_ind16 &dest, const rectangle &clipr
// render
color = colorbase() + granularity() * (color % colors());
- DRAWGFXZOOM_CORE(u16, PIXEL_OP_REBASE_TRANSMASK_PRIORITY, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, trans_mask, color](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_TRANSMASK_PRIORITY(destp, pri, srcp); });
}
void gfx_element::prio_zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -1424,7 +1391,7 @@ void gfx_element::prio_zoom_transmask(bitmap_rgb32 &dest, const rectangle &clipr
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REMAP_TRANSMASK_PRIORITY, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, trans_mask, paldata](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_TRANSMASK_PRIORITY(destp, pri, srcp); });
}
@@ -1453,7 +1420,7 @@ void gfx_element::prio_zoom_transtable(bitmap_ind16 &dest, const rectangle &clip
color = colorbase() + granularity() * (color % colors());
const pen_t *shadowtable = m_palette->shadow_table();
code %= elements();
- DRAWGFXZOOM_CORE(u16, PIXEL_OP_REBASE_TRANSTABLE16_PRIORITY, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, pentable, color, shadowtable](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REBASE_TRANSTABLE16_PRIORITY(destp, pri, srcp); });
}
void gfx_element::prio_zoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect,
@@ -1474,7 +1441,7 @@ void gfx_element::prio_zoom_transtable(bitmap_rgb32 &dest, const rectangle &clip
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
const pen_t *shadowtable = m_palette->shadow_table();
code %= elements();
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, pentable, paldata, shadowtable](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY(destp, pri, srcp); });
}
@@ -1509,7 +1476,7 @@ void gfx_element::prio_zoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect,
// render
const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors());
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, trans_pen, alpha_val, paldata](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY(destp, pri, srcp); });
}
@@ -1554,7 +1521,7 @@ void gfx_element::prio_transpen_additive(bitmap_rgb32 &dest, const rectangle &cl
pmask |= 1 << 31;
/* render based on dest bitmap depth */
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANSPEN_PRIORITY_ADDIIVE32, u8);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, priority, [pmask, trans_pen, paldata](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_TRANSPEN_PRIORITY_ADDIIVE32(destp, pri, srcp); });
}
@@ -1594,14 +1561,14 @@ void gfx_element::prio_zoom_transpen_additive(bitmap_rgb32 &dest, const rectangl
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
- DRAWGFXZOOM_CORE(u32, PIXEL_OP_REMAP_TRANSPEN_PRIORITY_ADDIIVE32, u8);
+ drawgfxzoom_core(dest, cliprect, code, flipx, flipy, destx, desty, scalex, scaley, priority, [pmask, trans_pen, paldata](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_TRANSPEN_PRIORITY_ADDIIVE32(destp, pri, srcp); });
}
//#define MAKE_ARGB_RGB(a, rgb) rgb_t(a, rgb.r(), rgb.g(), rgb.b())
#define MAKE_ARGB_RGB(a, rgb) rgb_t(rgb).set_a(a)
// combine in 'alpha' when copying to store in ARGB
-#define PIXEL_OP_REMAP_TRANS0_ALPHASTORE32(DEST, PRIORITY, SOURCE) \
+#define PIXEL_OP_REMAP_TRANS0_ALPHASTORE32(DEST, SOURCE) \
do \
{ \
u32 srcdata = (SOURCE); \
@@ -1610,7 +1577,7 @@ do
} \
while (0)
// combine in 'alphatable' value to store in ARGB
-#define PIXEL_OP_REMAP_TRANS0_ALPHATABLESTORE32(DEST, PRIORITY, SOURCE) \
+#define PIXEL_OP_REMAP_TRANS0_ALPHATABLESTORE32(DEST, SOURCE) \
do \
{ \
u32 srcdata = (SOURCE); \
@@ -1619,7 +1586,7 @@ do
} \
while (0)
// drawgfxm.h macro to render alpha into 32-bit buffer
-#define PIXEL_OP_REMAP_TRANS0_ALPHATABLE32(DEST, PRIORITY, SOURCE) \
+#define PIXEL_OP_REMAP_TRANS0_ALPHATABLE32(DEST, SOURCE) \
do \
{ \
u32 srcdata = (SOURCE); \
@@ -1637,7 +1604,6 @@ void gfx_element::alphastore(bitmap_rgb32 &dest, const rectangle &cliprect,
u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty,
int fixedalpha, u8 *alphatable)
{
- DECLARE_NO_PRIORITY;
const pen_t *paldata;
assert(alphatable != nullptr);
@@ -1659,14 +1625,9 @@ void gfx_element::alphastore(bitmap_rgb32 &dest, const rectangle &cliprect,
return;
if (fixedalpha >= 0)
- {
- u8 alpha = fixedalpha;
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANS0_ALPHASTORE32, NO_PRIORITY);
- }
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [paldata, alpha = fixedalpha, alphatable](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_TRANS0_ALPHASTORE32(destp, srcp); });
else
- {
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANS0_ALPHATABLESTORE32, NO_PRIORITY);
- }
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [paldata, alphatable](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_TRANS0_ALPHATABLESTORE32(destp, srcp); });
}
/*-------------------------------------------------
@@ -1678,8 +1639,6 @@ void gfx_element::alphatable(bitmap_rgb32 &dest, const rectangle &cliprect,
u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty,
int fixedalpha, u8 *alphatable)
{
- DECLARE_NO_PRIORITY;
-
const pen_t *paldata;
/* if we have a fixed alpha, call the standard drawgfx_alpha */
@@ -1701,7 +1660,7 @@ void gfx_element::alphatable(bitmap_rgb32 &dest, const rectangle &cliprect,
if (has_pen_usage() && (pen_usage(code) & ~(1 << 0)) == 0)
return;
- DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANS0_ALPHATABLE32, NO_PRIORITY);
+ drawgfx_core(dest, cliprect, code, flipx, flipy, destx, desty, [paldata, fixedalpha, alphatable](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_TRANS0_ALPHATABLE32(destp, srcp); });
}
@@ -1716,28 +1675,24 @@ void gfx_element::alphatable(bitmap_rgb32 &dest, const rectangle &cliprect,
void draw_scanline8(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length, const u8 *srcptr, const pen_t *paldata)
{
- DECLARE_NO_PRIORITY;
-
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u16, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [paldata](u16 &destp, const u8 &srcp) { PIXEL_OP_REMAP_OPAQUE(destp, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u16, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [](u16 &destp, const u8 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); });
}
void draw_scanline8(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u8 *srcptr, const pen_t *paldata)
{
- DECLARE_NO_PRIORITY;
-
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [paldata](u32 &destp, const u8 &srcp) { PIXEL_OP_REMAP_OPAQUE(destp, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [](u32 &destp, const u8 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); });
}
void prio_draw_scanline8(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length, const u8 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u32 pmask)
@@ -1747,11 +1702,11 @@ void prio_draw_scanline8(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length,
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u16, PIXEL_OP_REMAP_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pmask](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIORITY(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u16, PIXEL_OP_COPY_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pmask](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void prio_draw_scanline8(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u8 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u32 pmask)
@@ -1761,11 +1716,11 @@ void prio_draw_scanline8(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length,
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u32, PIXEL_OP_REMAP_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pmask](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIORITY(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pmask](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void primask_draw_scanline8(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length, const u8 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -1775,11 +1730,11 @@ void primask_draw_scanline8(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 leng
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u16, PIXEL_OP_REMAP_OPAQUE_PRIMASK, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pcode, pmask](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIMASK(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u16, PIXEL_OP_COPY_OPAQUE_PRIMASK, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pcode, pmask](u16 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIMASK(destp, pri, srcp); });
}
void primask_draw_scanline8(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u8 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -1789,11 +1744,11 @@ void primask_draw_scanline8(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 leng
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u32, PIXEL_OP_REMAP_OPAQUE_PRIMASK, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pcode, pmask](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIMASK(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_OPAQUE_PRIMASK, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pcode, pmask](u32 &destp, u8 &pri, const u8 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIMASK(destp, pri, srcp); });
}
@@ -1804,28 +1759,24 @@ void primask_draw_scanline8(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 leng
void draw_scanline16(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length, const u16 *srcptr, const pen_t *paldata)
{
- DECLARE_NO_PRIORITY;
-
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u16, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [paldata](u16 &destp, const u16 &srcp) { PIXEL_OP_REMAP_OPAQUE(destp, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u16, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [](u16 &destp, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); });
}
void draw_scanline16(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u16 *srcptr, const pen_t *paldata)
{
- DECLARE_NO_PRIORITY;
-
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [paldata](u32 &destp, const u16 &srcp) { PIXEL_OP_REMAP_OPAQUE(destp, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [](u32 &destp, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); });
}
void prio_draw_scanline16(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length, const u16 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u32 pmask)
@@ -1835,11 +1786,11 @@ void prio_draw_scanline16(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u16, PIXEL_OP_REMAP_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIORITY(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u16, PIXEL_OP_COPY_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void prio_draw_scanline16(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u16 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u32 pmask)
@@ -1849,11 +1800,11 @@ void prio_draw_scanline16(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u32, PIXEL_OP_REMAP_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pmask](u32 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIORITY(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pmask](u32 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void primask_draw_scanline16(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length, const u16 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -1863,11 +1814,11 @@ void primask_draw_scanline16(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 len
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u16, PIXEL_OP_REMAP_OPAQUE_PRIMASK, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pcode, pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIMASK(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u16, PIXEL_OP_COPY_OPAQUE_PRIMASK, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pcode, pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIMASK(destp, pri, srcp); });
}
void primask_draw_scanline16(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u16 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -1877,11 +1828,11 @@ void primask_draw_scanline16(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 len
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u32, PIXEL_OP_REMAP_OPAQUE_PRIMASK, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pcode, pmask](u32 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIMASK(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_OPAQUE_PRIMASK, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pcode, pmask](u32 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIMASK(destp, pri, srcp); });
}
@@ -1892,28 +1843,24 @@ void primask_draw_scanline16(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 len
void draw_scanline32(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length, const u32 *srcptr, const pen_t *paldata)
{
- DECLARE_NO_PRIORITY;
-
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u16, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [paldata](u16 &destp, const u32 &srcp) { PIXEL_OP_REMAP_OPAQUE(destp, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u16, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [](u16 &destp, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); });
}
void draw_scanline32(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u32 *srcptr, const pen_t *paldata)
{
- DECLARE_NO_PRIORITY;
-
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [paldata](u32 &destp, const u32 &srcp) { PIXEL_OP_REMAP_OPAQUE(destp, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [](u32 &destp, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); });
}
void prio_draw_scanline32(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length, const u32 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u32 pmask)
@@ -1923,11 +1870,11 @@ void prio_draw_scanline32(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u16, PIXEL_OP_REMAP_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pmask](u16 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIORITY(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u16, PIXEL_OP_COPY_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pmask](u16 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void prio_draw_scanline32(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u32 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u32 pmask)
@@ -1937,11 +1884,11 @@ void prio_draw_scanline32(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u32, PIXEL_OP_REMAP_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIORITY(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_OPAQUE_PRIORITY, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void primask_draw_scanline32(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 length, const u32 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -1951,11 +1898,11 @@ void primask_draw_scanline32(bitmap_ind16 &bitmap, s32 destx, s32 desty, s32 len
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u16, PIXEL_OP_REMAP_OPAQUE_PRIMASK, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pcode, pmask](u16 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIMASK(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u16, PIXEL_OP_COPY_OPAQUE_PRIMASK, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pcode, pmask](u16 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIMASK(destp, pri, srcp); });
}
void primask_draw_scanline32(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u32 *srcptr, const pen_t *paldata, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -1965,64 +1912,11 @@ void primask_draw_scanline32(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 len
// palette lookup case
if (paldata != nullptr)
- DRAWSCANLINE_CORE(u32, PIXEL_OP_REMAP_OPAQUE_PRIMASK, u8);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [paldata, pcode, pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_REMAP_OPAQUE_PRIMASK(destp, pri, srcp); });
// raw copy case
else
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_OPAQUE_PRIMASK, u8);
-}
-
-
-
-/***************************************************************************
- EXTRACT_SCANLINE IMPLEMENTATIONS
-***************************************************************************/
-
-/*-------------------------------------------------
- extract_scanline8 - copy pixels from a single
- scanline of a bitmap to an 8bpp buffer
--------------------------------------------------*/
-
-void extract_scanline8(const bitmap_ind16 &bitmap, s32 srcx, s32 srcy, s32 length, u8 *destptr)
-{
- EXTRACTSCANLINE_CORE(u16);
-}
-
-void extract_scanline8(const bitmap_rgb32 &bitmap, s32 srcx, s32 srcy, s32 length, u8 *destptr)
-{
- EXTRACTSCANLINE_CORE(u32);
-}
-
-
-/*-------------------------------------------------
- extract_scanline16 - copy pixels from a single
- scanline of a bitmap to a 16bpp buffer
--------------------------------------------------*/
-
-void extract_scanline16(const bitmap_ind16 &bitmap, s32 srcx, s32 srcy, s32 length, u16 *destptr)
-{
- EXTRACTSCANLINE_CORE(u16);
-}
-
-void extract_scanline16(const bitmap_rgb32 &bitmap, s32 srcx, s32 srcy, s32 length, u16 *destptr)
-{
- EXTRACTSCANLINE_CORE(u32);
-}
-
-
-/*-------------------------------------------------
- extract_scanline32 - copy pixels from a single
- scanline of a bitmap to a 32bpp buffer
--------------------------------------------------*/
-
-void extract_scanline32(const bitmap_ind16 &bitmap, s32 srcx, s32 srcy, s32 length, u32 *destptr)
-{
- EXTRACTSCANLINE_CORE(u16);
-}
-
-void extract_scanline32(const bitmap_rgb32 &bitmap, s32 srcx, s32 srcy, s32 length, u32 *destptr)
-{
- EXTRACTSCANLINE_CORE(u32);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, priority, [pcode, pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIMASK(destp, pri, srcp); });
}
@@ -2038,14 +1932,12 @@ void extract_scanline32(const bitmap_rgb32 &bitmap, s32 srcx, s32 srcy, s32 leng
void copybitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect)
{
- DECLARE_NO_PRIORITY;
- COPYBITMAP_CORE(u16, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, [](u16 &destp, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); });
}
void copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect)
{
- DECLARE_NO_PRIORITY;
- COPYBITMAP_CORE(u32, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, [](u32 &destp, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); });
}
void prio_copybitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, bitmap_ind8 &priority, u32 pmask)
@@ -2053,7 +1945,7 @@ void prio_copybitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int
// high bit of the mask is implicitly on
pmask |= 1 << 31;
- COPYBITMAP_CORE(u16, PIXEL_OP_COPY_OPAQUE_PRIORITY, u8);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, priority, [pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void prio_copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, bitmap_ind8 &priority, u32 pmask)
@@ -2061,7 +1953,7 @@ void prio_copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int
// high bit of the mask is implicitly on
pmask |= 1 << 31;
- COPYBITMAP_CORE(u32, PIXEL_OP_COPY_OPAQUE_PRIORITY, u8);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, priority, [pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void primask_copybitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -2069,7 +1961,7 @@ void primask_copybitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx,
if (pcode == 0 && pmask == 0xff)
copybitmap(dest, src, flipx, flipy, destx, desty, cliprect);
else
- COPYBITMAP_CORE(u16, PIXEL_OP_COPY_OPAQUE_PRIMASK, u8);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, priority, [pcode, pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIMASK(destp, pri, srcp); });
}
void primask_copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -2077,7 +1969,7 @@ void primask_copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx,
if (pcode == 0 && pmask == 0xff)
copybitmap(dest, src, flipx, flipy, destx, desty, cliprect);
else
- COPYBITMAP_CORE(u32, PIXEL_OP_COPY_OPAQUE_PRIMASK, u8);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, priority, [pcode, pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIMASK(destp, pri, srcp); });
}
@@ -2089,20 +1981,18 @@ void primask_copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx,
void copybitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, u32 trans_pen)
{
- DECLARE_NO_PRIORITY;
if (trans_pen > 0xffff)
copybitmap(dest, src, flipx, flipy, destx, desty, cliprect);
else
- COPYBITMAP_CORE(u16, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, [trans_pen](u16 &destp, const u16 &srcp) { PIXEL_OP_COPY_TRANSPEN(destp, srcp); });
}
void copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, u32 trans_pen)
{
- DECLARE_NO_PRIORITY;
if (trans_pen == 0xffffffff)
copybitmap(dest, src, flipx, flipy, destx, desty, cliprect);
else
- COPYBITMAP_CORE(u32, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, [trans_pen](u32 &destp, const u32 &srcp) { PIXEL_OP_COPY_TRANSPEN(destp, srcp); });
}
void prio_copybitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, bitmap_ind8 &priority, u32 pmask, u32 trans_pen)
@@ -2113,7 +2003,7 @@ void prio_copybitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, int flip
if (trans_pen > 0xffff)
prio_copybitmap(dest, src, flipx, flipy, destx, desty, cliprect, priority, pmask);
else
- COPYBITMAP_CORE(u16, PIXEL_OP_COPY_TRANSPEN_PRIORITY, u8);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, priority, [pmask, trans_pen](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
void prio_copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, bitmap_ind8 &priority, u32 pmask, u32 trans_pen)
@@ -2124,7 +2014,7 @@ void prio_copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flip
if (trans_pen == 0xffffffff)
prio_copybitmap(dest, src, flipx, flipy, destx, desty, cliprect, priority, pmask);
else
- COPYBITMAP_CORE(u32, PIXEL_OP_COPY_TRANSPEN_PRIORITY, u8);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, priority, [pmask, trans_pen](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
void primask_copybitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, u32 trans_pen, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -2134,7 +2024,7 @@ void primask_copybitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, int f
else if (trans_pen > 0xffff)
primask_copybitmap(dest, src, flipx, flipy, destx, desty, cliprect, priority, pcode, pmask);
else
- COPYBITMAP_CORE(u16, PIXEL_OP_COPY_TRANSPEN_PRIMASK, u8);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, priority, [trans_pen, pcode, pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_TRANSPEN_PRIMASK(destp, pri, srcp); });
}
void primask_copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, u32 trans_pen, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -2144,7 +2034,7 @@ void primask_copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int f
else if (trans_pen == 0xffffffff)
primask_copybitmap(dest, src, flipx, flipy, destx, desty, cliprect, priority, pcode, pmask);
else
- COPYBITMAP_CORE(u32, PIXEL_OP_COPY_TRANSPEN_PRIMASK, u8);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, priority, [trans_pen, pcode, pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_TRANSPEN_PRIMASK(destp, pri, srcp); });
}
@@ -2156,8 +2046,7 @@ void primask_copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int f
void copybitmap_transalpha(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect)
{
- DECLARE_NO_PRIORITY;
- COPYBITMAP_CORE(u32, PIXEL_OP_COPY_TRANSALPHA, NO_PRIORITY);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, [](u32 &destp, const u32 &srcp) { PIXEL_OP_COPY_TRANSALPHA(destp, srcp); });
}
void prio_copybitmap_transalpha(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, bitmap_ind8 &priority, u32 pmask)
@@ -2165,7 +2054,7 @@ void prio_copybitmap_transalpha(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int
// high bit of the mask is implicitly on
pmask |= 1 << 31;
- COPYBITMAP_CORE(u32, PIXEL_OP_COPY_TRANSALPHA_PRIORITY, u8);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, priority, [pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_TRANSALPHA_PRIORITY(destp, pri, srcp); });
}
void primask_copybitmap_transalpha(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -2173,7 +2062,7 @@ void primask_copybitmap_transalpha(bitmap_rgb32 &dest, const bitmap_rgb32 &src,
if (pcode == 0 && pmask == 0xff)
copybitmap_transalpha(dest, src, flipx, flipy, destx, desty, cliprect);
else
- COPYBITMAP_CORE(u32, PIXEL_OP_COPY_TRANSALPHA_PRIMASK, u8);
+ copybitmap_core(dest, src, flipx, flipy, destx, desty, cliprect, priority, [pcode, pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_TRANSALPHA_PRIMASK(destp, pri, srcp); });
}
@@ -2568,14 +2457,12 @@ void primask_copyscrollbitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src,
void copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound)
{
- DECLARE_NO_PRIORITY;
- COPYROZBITMAP_CORE(u16, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, [](u16 &destp, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); });
}
void copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound)
{
- DECLARE_NO_PRIORITY;
- COPYROZBITMAP_CORE(u32, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, [](u32 &destp, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); });
}
void prio_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask)
@@ -2583,7 +2470,7 @@ void prio_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bit
// high bit of the mask is implicitly on
pmask |= 1 << 31;
- COPYROZBITMAP_CORE(u16, PIXEL_OP_COPY_OPAQUE_PRIORITY, u8);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void prio_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask)
@@ -2591,7 +2478,7 @@ void prio_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bit
// high bit of the mask is implicitly on
pmask |= 1 << 31;
- COPYROZBITMAP_CORE(u32, PIXEL_OP_COPY_OPAQUE_PRIORITY, u8);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); });
}
void primask_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -2599,7 +2486,7 @@ void primask_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const
if (pcode == 0 && pmask == 0xff)
copyrozbitmap(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound);
else
- COPYROZBITMAP_CORE(u16, PIXEL_OP_COPY_OPAQUE_PRIMASK, u8);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [pcode, pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIMASK(destp, pri, srcp); });
}
void primask_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -2607,7 +2494,7 @@ void primask_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const
if (pcode == 0 && pmask == 0xff)
copyrozbitmap(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound);
else
- COPYROZBITMAP_CORE(u32, PIXEL_OP_COPY_OPAQUE_PRIMASK, u8);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [pcode, pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIMASK(destp, pri, srcp); });
}
@@ -2620,14 +2507,12 @@ void primask_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const
void copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 trans_pen)
{
- DECLARE_NO_PRIORITY;
- COPYROZBITMAP_CORE(u16, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, [trans_pen](u16 &destp, const u16 &srcp) { PIXEL_OP_COPY_TRANSPEN(destp, srcp); });
}
void copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 trans_pen)
{
- DECLARE_NO_PRIORITY;
- COPYROZBITMAP_CORE(u32, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, [trans_pen](u32 &destp, const u32 &srcp) { PIXEL_OP_COPY_TRANSPEN(destp, srcp); });
}
void prio_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask, u32 trans_pen)
@@ -2635,7 +2520,7 @@ void prio_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, con
// high bit of the mask is implicitly on
pmask |= 1 << 31;
- COPYROZBITMAP_CORE(u16, PIXEL_OP_COPY_TRANSPEN_PRIORITY, u8);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [pmask, trans_pen](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
void prio_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask, u32 trans_pen)
@@ -2643,7 +2528,7 @@ void prio_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, con
// high bit of the mask is implicitly on
pmask |= 1 << 31;
- COPYROZBITMAP_CORE(u32, PIXEL_OP_COPY_TRANSPEN_PRIORITY, u8);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [pmask, trans_pen](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_TRANSPEN_PRIORITY(destp, pri, srcp); });
}
void primask_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 trans_pen, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -2651,7 +2536,7 @@ void primask_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect,
if (pcode == 0 && pmask == 0xff)
copyrozbitmap_trans(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, trans_pen);
else
- COPYROZBITMAP_CORE(u16, PIXEL_OP_COPY_TRANSPEN_PRIMASK, u8);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [trans_pen, pcode, pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_TRANSPEN_PRIMASK(destp, pri, srcp); });
}
void primask_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 trans_pen, bitmap_ind8 &priority, u8 pcode, u8 pmask)
@@ -2659,5 +2544,5 @@ void primask_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect,
if (pcode == 0 && pmask == 0xff)
copyrozbitmap_trans(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, trans_pen);
else
- COPYROZBITMAP_CORE(u32, PIXEL_OP_COPY_TRANSPEN_PRIMASK, u8);
+ copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [trans_pen, pcode, pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_TRANSPEN_PRIMASK(destp, pri, srcp); });
}
diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h
index 4d3f4d0e0c9..08732a42bfd 100644
--- a/src/emu/drawgfx.h
+++ b/src/emu/drawgfx.h
@@ -202,6 +202,9 @@ public:
// ----- core graphics drawing -----
+ // core drawgfx implementation
+ template <typename BitmapType, typename FunctionClass> void drawgfx_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, FunctionClass pixel_op);
+
// specific drawgfx implementations for each transparency type
void opaque(bitmap_ind16 &dest, const rectangle &cliprect, u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty);
void opaque(bitmap_rgb32 &dest, const rectangle &cliprect, u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty);
@@ -217,6 +220,9 @@ public:
// ----- zoomed graphics drawing -----
+ // core zoom implementation
+ template <typename BitmapType, typename FunctionClass> void drawgfxzoom_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley, FunctionClass pixel_op);
+
// specific zoom implementations for each transparency type
void zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley);
void zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley);
@@ -232,6 +238,9 @@ public:
// ----- priority masked graphics drawing -----
+ // core prio implementation
+ template <typename BitmapType, typename PriorityType, typename FunctionClass> void drawgfx_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, PriorityType &priority, FunctionClass pixel_op);
+
// specific prio implementations for each transparency type
void prio_opaque(bitmap_ind16 &dest, const rectangle &cliprect, u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty, bitmap_ind8 &priority, u32 pmask);
void prio_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty, bitmap_ind8 &priority, u32 pmask);
@@ -247,6 +256,9 @@ public:
// ----- priority masked zoomed graphics drawing -----
+ // core prio_zoom implementation
+ template <typename BitmapType, typename PriorityType, typename FunctionClass> void drawgfxzoom_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley, PriorityType &priority, FunctionClass pixel_op);
+
// specific prio_zoom implementations for each transparency type
void prio_zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley, bitmap_ind8 &priority, u32 pmask);
void prio_zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley, bitmap_ind8 &priority, u32 pmask);
@@ -265,6 +277,7 @@ public:
void prio_zoom_transpen_additive(bitmap_rgb32 &dest, const rectangle &cliprect, u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley, bitmap_ind8 &priority, u32 pmask, u32 trans_pen);
void alphastore(bitmap_rgb32 &dest, const rectangle &cliprect, u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty, int fixedalpha, u8 *alphatable);
void alphatable(bitmap_rgb32 &dest, const rectangle &cliprect, u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty, int fixedalpha, u8 *alphatable);
+
private:
// internal helpers
void decode(u32 code);
@@ -344,22 +357,6 @@ void primask_draw_scanline32(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 len
-// ----- scanline extraction -----
-
-// copy pixels from a single scanline of a bitmap to an 8bpp buffer
-void extract_scanline8(const bitmap_ind16 &bitmap, s32 srcx, s32 srcy, s32 length, u8 *destptr);
-void extract_scanline8(const bitmap_rgb32 &bitmap, s32 srcx, s32 srcy, s32 length, u8 *destptr);
-
-// copy pixels from a single scanline of a bitmap to a 16bpp buffer
-void extract_scanline16(const bitmap_ind16 &bitmap, s32 srcx, s32 srcy, s32 length, u16 *destptr);
-void extract_scanline16(const bitmap_rgb32 &bitmap, s32 srcx, s32 srcy, s32 length, u16 *destptr);
-
-// copy pixels from a single scanline of a bitmap to a 32bpp buffer
-void extract_scanline32(const bitmap_ind16 &bitmap, s32 srcx, s32 srcy, s32 length, u32 *destptr);
-void extract_scanline32(const bitmap_rgb32 &bitmap, s32 srcx, s32 srcy, s32 length, u32 *destptr);
-
-
-
// ----- bitmap copying -----
// copy from one bitmap to another, copying all unclipped pixels
diff --git a/src/emu/drawgfxm.h b/src/emu/drawgfxm.h
deleted file mode 100644
index 6361ed8bf92..00000000000
--- a/src/emu/drawgfxm.h
+++ /dev/null
@@ -1,1343 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Nicola Salmoria, Aaron Giles
-/*********************************************************************
-
- drawgfxm.h
-
- Macros implementing drawgfx core operations. Drivers can use
- these if they need custom behavior not provided by the existing
- drawgfx functions.
-**********************************************************************
-
- How to use these macros:
-
- There are two sets of macros. The PIXEL_OP* macros are simple
- per-pixel operations, designed to take a SOURCE pixel and
- copy it to the DEST, perhaps updating the PRIORITY pixel as
- well. On their own, they are not particularly useful.
-
- The second set of macros represents the core gfx/bitmap walking
- and rendering code. These macros generally take the target pixel
- type (u8, u16, u32), one of the PIXEL_OP* macros,
- and a priority bitmap pixel type (u8, u16, u32, or the
- special type NO_PRIORITY).
-
- Although the code may look inefficient at first, the compiler is
- able to easily optimize out unused cases due to the way the
- macros are written, leaving behind just the cases we are
- interested in.
-
- The general approach for using these macros is:
-
- my_drawing_function(params)
- {
- // ensure that all the required parameters for the mega
- // macro are defined (if they are not needed, just declare
- // the variables and set them equal to a known constant
- // value to help the compiler)
-
- // set up any additional variables needed by the PIXEL_OP*
- // macro you want to use (each macro has its own
- // requirements)
-
- MEGA_MACRO(BITMAP_TYPE, PIXEL_OP, PRIORITY_TYPE);
- }
-
-*********************************************************************/
-
-#pragma once
-
-#ifndef __DRAWGFXM_H__
-#define __DRAWGFXM_H__
-
-/* special priority type meaning "none" */
-struct NO_PRIORITY { char dummy[3]; };
-
-extern bitmap_ind8 drawgfx_dummy_priority_bitmap;
-#define DECLARE_NO_PRIORITY bitmap_t &priority = drawgfx_dummy_priority_bitmap;
-
-
-/* macros for using the optional priority */
-#define PRIORITY_VALID(x) (sizeof(x) != sizeof(NO_PRIORITY))
-#define PRIORITY_ADDR(p,t,y,x) (PRIORITY_VALID(t) ? (&(p).pixt<t>(y, x)) : nullptr)
-#define PRIORITY_ADVANCE(t,p,i) do { if (PRIORITY_VALID(t)) (p) += (i); } while (0)
-
-
-/***************************************************************************
- PIXEL OPERATIONS
-***************************************************************************/
-
-/*-------------------------------------------------
- PIXEL_OP_COPY_OPAQUE - render all pixels
- regardless of pen, copying directly
--------------------------------------------------*/
-
-#define PIXEL_OP_COPY_OPAQUE(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- (DEST) = SOURCE; \
-} \
-while (0)
-#define PIXEL_OP_COPY_OPAQUE_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
- (DEST) = SOURCE; \
- (PRIORITY) = 31; \
-} \
-while (0)
-#define PIXEL_OP_COPY_OPAQUE_PRIMASK(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- (DEST) = SOURCE; \
- (PRIORITY) = ((PRIORITY) & pmask) | pcode; \
-} \
-while (0)
-
-/*-------------------------------------------------
- PIXEL_OP_COPY_TRANSPEN - render all pixels
- except those matching 'transpen', copying
- directly
--------------------------------------------------*/
-
-#define PIXEL_OP_COPY_TRANSPEN(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (srcdata != trans_pen) \
- (DEST) = SOURCE; \
-} \
-while (0)
-#define PIXEL_OP_COPY_TRANSPEN_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (srcdata != trans_pen) \
- { \
- if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
- (DEST) = SOURCE; \
- (PRIORITY) = 31; \
- } \
-} \
-while (0)
-#define PIXEL_OP_COPY_TRANSPEN_PRIMASK(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (srcdata != trans_pen) \
- { \
- (DEST) = SOURCE; \
- (PRIORITY) = ((PRIORITY) & pmask) | pcode; \
- } \
-} \
-while (0)
-
-/*-------------------------------------------------
- PIXEL_OP_COPY_TRANSALPHA - render all pixels
- except those with an alpha of zero, copying
- directly
--------------------------------------------------*/
-
-#define PIXEL_OP_COPY_TRANSALPHA(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if ((srcdata & 0xff000000) != 0) \
- (DEST) = SOURCE; \
-} \
-while (0)
-#define PIXEL_OP_COPY_TRANSALPHA_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if ((srcdata & 0xff000000) != 0) \
- { \
- if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
- (DEST) = SOURCE; \
- (PRIORITY) = 31; \
- } \
-} \
-while (0)
-#define PIXEL_OP_COPY_TRANSALPHA_PRIMASK(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if ((srcdata & 0xff000000) != 0) \
- { \
- (DEST) = SOURCE; \
- (PRIORITY) = ((PRIORITY) & pmask) | pcode; \
- } \
-} \
-while (0)
-
-/*-------------------------------------------------
- PIXEL_OP_REMAP_OPAQUE - render all pixels
- regardless of pen, mapping the pen via the
- 'paldata' array
--------------------------------------------------*/
-
-#define PIXEL_OP_REMAP_OPAQUE(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- (DEST) = paldata[SOURCE]; \
-} \
-while (0)
-#define PIXEL_OP_REMAP_OPAQUE_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
- (DEST) = paldata[SOURCE]; \
- (PRIORITY) = 31; \
-} \
-while (0)
-#define PIXEL_OP_REMAP_OPAQUE_PRIMASK(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- (DEST) = paldata[SOURCE]; \
- (PRIORITY) = ((PRIORITY) & pmask) | pcode; \
-} \
-while (0)
-
-/*-------------------------------------------------
- PIXEL_OP_REBASE_OPAQUE - render all pixels
- regardless of pen, adding 'color' to the
- pen value
--------------------------------------------------*/
-
-#define PIXEL_OP_REBASE_OPAQUE(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- (DEST) = color + (SOURCE); \
-} \
-while (0)
-#define PIXEL_OP_REBASE_OPAQUE_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
- (DEST) = color + (SOURCE); \
- (PRIORITY) = 31; \
-} \
-while (0)
-
-/*-------------------------------------------------
- PIXEL_OP_REMAP_TRANSPEN - render all pixels
- except those matching 'trans_pen', mapping the
- pen via the 'paldata' array
--------------------------------------------------*/
-
-#define PIXEL_OP_REMAP_TRANSPEN(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (srcdata != trans_pen) \
- (DEST) = paldata[srcdata]; \
-} \
-while (0)
-#define PIXEL_OP_REMAP_TRANSPEN_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (srcdata != trans_pen) \
- { \
- if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
- (DEST) = paldata[srcdata]; \
- (PRIORITY) = 31; \
- } \
-} \
-while (0)
-
-/*-------------------------------------------------
- PIXEL_OP_REBASE_TRANSPEN - render all pixels
- except those matching 'transpen', adding
- 'color' to the pen value
--------------------------------------------------*/
-
-#define PIXEL_OP_REBASE_TRANSPEN(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (srcdata != trans_pen) \
- (DEST) = color + srcdata; \
-} \
-while (0)
-#define PIXEL_OP_REBASE_TRANSPEN_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (srcdata != trans_pen) \
- { \
- if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
- (DEST) = color + srcdata; \
- (PRIORITY) = 31; \
- } \
-} \
-while (0)
-
-/*-------------------------------------------------
- PIXEL_OP_REMAP_TRANSMASK - render all pixels
- except those matching 'trans_mask', mapping the
- pen via the 'paldata' array
--------------------------------------------------*/
-
-#define PIXEL_OP_REMAP_TRANSMASK(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (((trans_mask >> srcdata) & 1) == 0) \
- (DEST) = paldata[srcdata]; \
-} \
-while (0)
-#define PIXEL_OP_REMAP_TRANSMASK_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (((trans_mask >> srcdata) & 1) == 0) \
- { \
- if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
- (DEST) = paldata[srcdata]; \
- (PRIORITY) = 31; \
- } \
-} \
-while (0)
-
-/*-------------------------------------------------
- PIXEL_OP_REBASE_TRANSMASK - render all pixels
- except those matching 'trans_mask', adding
- 'color' to the pen value
--------------------------------------------------*/
-
-#define PIXEL_OP_REBASE_TRANSMASK(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (((trans_mask >> srcdata) & 1) == 0) \
- (DEST) = color + srcdata; \
-} \
-while (0)
-#define PIXEL_OP_REBASE_TRANSMASK_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (((trans_mask >> srcdata) & 1) == 0) \
- { \
- if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
- (DEST) = color + srcdata; \
- (PRIORITY) = 31; \
- } \
-} \
-while (0)
-
-/*-------------------------------------------------
- PIXEL_OP_REBASE_TRANSTABLE - look up each pen in
- 'pentable'; if the entry is DRAWMODE_NONE,
- don't draw it; if the entry is DRAWMODE_SOURCE,
- add 'color' to the pen value; if the entry is
- DRAWMODE_SHADOW, generate a shadow of the
- destination pixel using 'shadowtable'
-
- PIXEL_OP_REMAP_TRANSTABLE - look up each pen in
- 'pentable'; if the entry is DRAWMODE_NONE,
- don't draw it; if the entry is DRAWMODE_SOURCE,
- look up the pen via the 'paldata' array; if the
- entry is DRAWMODE_SHADOW, generate a shadow of
- the destination pixel using 'shadowtable'
--------------------------------------------------*/
-
-#define PIXEL_OP_REBASE_TRANSTABLE16(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- u32 entry = pentable[srcdata]; \
- if (entry != DRAWMODE_NONE) \
- { \
- if (entry == DRAWMODE_SOURCE) \
- (DEST) = color + srcdata; \
- else \
- (DEST) = shadowtable[DEST]; \
- } \
-} \
-while (0)
-#define PIXEL_OP_REMAP_TRANSTABLE32(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- u32 entry = pentable[srcdata]; \
- if (entry != DRAWMODE_NONE) \
- { \
- if (entry == DRAWMODE_SOURCE) \
- (DEST) = paldata[srcdata]; \
- else \
- (DEST) = shadowtable[rgb_t(DEST).as_rgb15()]; \
- } \
-} \
-while (0)
-#define PIXEL_OP_REBASE_TRANSTABLE16_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- u32 entry = pentable[srcdata]; \
- if (entry != DRAWMODE_NONE) \
- { \
- u8 pridata = (PRIORITY); \
- if (entry == DRAWMODE_SOURCE) \
- { \
- if (((1 << (pridata & 0x1f)) & pmask) == 0) \
- (DEST) = color + srcdata; \
- (PRIORITY) = 31; \
- } \
- else if ((pridata & 0x80) == 0 && ((1 << (pridata & 0x1f)) & pmask) == 0) \
- { \
- (DEST) = shadowtable[DEST]; \
- (PRIORITY) = pridata | 0x80; \
- } \
- } \
-} \
-while (0)
-#define PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- u32 entry = pentable[srcdata]; \
- if (entry != DRAWMODE_NONE) \
- { \
- u8 pridata = (PRIORITY); \
- if (entry == DRAWMODE_SOURCE) \
- { \
- if (((1 << (pridata & 0x1f)) & pmask) == 0) \
- (DEST) = paldata[srcdata]; \
- (PRIORITY) = 31; \
- } \
- else if ((pridata & 0x80) == 0 && ((1 << (pridata & 0x1f)) & pmask) == 0) \
- { \
- (DEST) = shadowtable[rgb_t(DEST).as_rgb15()]; \
- (PRIORITY) = pridata | 0x80; \
- } \
- } \
-} \
-while (0)
-
-/*-------------------------------------------------
- PIXEL_OP_REMAP_TRANSPEN_ALPHA - render all
- pixels except those matching 'transpen',
- mapping the pen to via the 'paldata' array;
- the resulting color is RGB alpha blended
- against the destination using 'alpha'
--------------------------------------------------*/
-
-#define PIXEL_OP_REMAP_TRANSPEN_ALPHA32(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (srcdata != trans_pen) \
- (DEST) = alpha_blend_r32((DEST), paldata[srcdata], alpha_val); \
-} \
-while (0)
-#define PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY(DEST, PRIORITY, SOURCE) \
-do \
-{ \
- u32 srcdata = (SOURCE); \
- if (srcdata != trans_pen) \
- { \
- if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
- (DEST) = alpha_blend_r32((DEST), paldata[srcdata], alpha_val); \
- (PRIORITY) = 31; \
- } \
-} \
-while (0)
-
-
-/***************************************************************************
- BASIC DRAWGFX CORE
-***************************************************************************/
-
-/*
- Assumed input parameters or local variables:
-
- bitmap_t &dest - the bitmap to render to
- const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
- gfx_element *gfx - pointer to the gfx_element to render
- u32 code - index of the entry within gfx_element
- u32 color - index of the color within gfx_element
- int flipx - non-zero means render right-to-left instead of left-to-right
- int flipy - non-zero means render bottom-to-top instead of top-to-bottom
- s32 destx - the top-left X coordinate to render to
- s32 desty - the top-left Y coordinate to render to
- bitmap_t &priority - the priority bitmap (even if PRIORITY_TYPE is NO_PRIORITY, at least needs a dummy)
-*/
-
-
-#define DRAWGFX_CORE(PIXEL_TYPE, PIXEL_OP, PRIORITY_TYPE) \
-do { \
- g_profiler.start(PROFILER_DRAWGFX); \
- do { \
- const u8 *srcdata; \
- s32 destendx, destendy; \
- s32 srcx, srcy; \
- s32 curx, cury; \
- s32 dy; \
- \
- assert(dest.valid()); \
- assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority.valid()); \
- assert(dest.cliprect().contains(cliprect)); \
- assert(code < elements()); \
- \
- /* ignore empty/invalid cliprects */ \
- if (cliprect.empty()) \
- break; \
- \
- /* compute final pixel in X and exit if we are entirely clipped */ \
- destendx = destx + width() - 1; \
- if (destx > cliprect.right() || destendx < cliprect.left()) \
- break; \
- \
- /* apply left clip */ \
- srcx = 0; \
- if (destx < cliprect.left()) \
- { \
- srcx = cliprect.left() - destx; \
- destx = cliprect.left(); \
- } \
- \
- /* apply right clip */ \
- if (destendx > cliprect.right()) \
- destendx = cliprect.right(); \
- \
- /* compute final pixel in Y and exit if we are entirely clipped */ \
- destendy = desty + height() - 1; \
- if (desty > cliprect.bottom() || destendy < cliprect.top()) \
- break; \
- \
- /* apply top clip */ \
- srcy = 0; \
- if (desty < cliprect.top()) \
- { \
- srcy = cliprect.top() - desty; \
- desty = cliprect.top(); \
- } \
- \
- /* apply bottom clip */ \
- if (destendy > cliprect.bottom()) \
- destendy = cliprect.bottom(); \
- \
- /* apply X flipping */ \
- if (flipx) \
- srcx = width() - 1 - srcx; \
- \
- /* apply Y flipping */ \
- dy = rowbytes(); \
- if (flipy) \
- { \
- srcy = height() - 1 - srcy; \
- dy = -dy; \
- } \
- \
- /* fetch the source data */ \
- srcdata = get_data(code); \
- \
- /* compute how many blocks of 4 pixels we have */ \
- u32 numblocks = (destendx + 1 - destx) / 4; \
- u32 leftovers = (destendx + 1 - destx) - 4 * numblocks; \
- \
- /* adjust srcdata to point to the first source pixel of the row */ \
- srcdata += srcy * rowbytes() + srcx; \
- \
- /* non-flipped 8bpp case */ \
- if (!flipx) \
- { \
- /* iterate over pixels in Y */ \
- for (cury = desty; cury <= destendy; cury++) \
- { \
- PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \
- PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const u8 *srcptr = srcdata; \
- srcdata += dy; \
- \
- /* iterate over unrolled blocks of 4 */ \
- for (curx = 0; curx < numblocks; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- PIXEL_OP(destptr[1], priptr[1], srcptr[1]); \
- PIXEL_OP(destptr[2], priptr[2], srcptr[2]); \
- PIXEL_OP(destptr[3], priptr[3], srcptr[3]); \
- \
- srcptr += 4; \
- destptr += 4; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 4); \
- } \
- \
- /* iterate over leftover pixels */ \
- for (curx = 0; curx < leftovers; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- srcptr++; \
- destptr++; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 1); \
- } \
- } \
- } \
- \
- /* flipped 8bpp case */ \
- else \
- { \
- /* iterate over pixels in Y */ \
- for (cury = desty; cury <= destendy; cury++) \
- { \
- PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \
- PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const u8 *srcptr = srcdata; \
- srcdata += dy; \
- \
- /* iterate over unrolled blocks of 4 */ \
- for (curx = 0; curx < numblocks; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[ 0]); \
- PIXEL_OP(destptr[1], priptr[1], srcptr[-1]); \
- PIXEL_OP(destptr[2], priptr[2], srcptr[-2]); \
- PIXEL_OP(destptr[3], priptr[3], srcptr[-3]); \
- \
- srcptr -= 4; \
- destptr += 4; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 4); \
- } \
- \
- /* iterate over leftover pixels */ \
- for (curx = 0; curx < leftovers; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- srcptr--; \
- destptr++; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 1); \
- } \
- } \
- } \
- } while (0); \
- g_profiler.stop(); \
-} while (0)
-
-
-
-/***************************************************************************
- BASIC DRAWGFXZOOM CORE
-***************************************************************************/
-
-/*
- Assumed input parameters or local variables:
-
- bitmap_t &dest - the bitmap to render to
- const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
- gfx_element *gfx - pointer to the gfx_element to render
- u32 code - index of the entry within gfx_element
- u32 color - index of the color within gfx_element
- int flipx - non-zero means render right-to-left instead of left-to-right
- int flipy - non-zero means render bottom-to-top instead of top-to-bottom
- s32 destx - the top-left X coordinate to render to
- s32 desty - the top-left Y coordinate to render to
- u32 scalex - the 16.16 scale factor in the X dimension
- u32 scaley - the 16.16 scale factor in the Y dimension
- bitmap_t &priority - the priority bitmap (even if PRIORITY_TYPE is NO_PRIORITY, at least needs a dummy)
-*/
-
-
-#define DRAWGFXZOOM_CORE(PIXEL_TYPE, PIXEL_OP, PRIORITY_TYPE) \
-do { \
- g_profiler.start(PROFILER_DRAWGFX); \
- do { \
- const u8 *srcdata; \
- u32 dstwidth, dstheight; \
- s32 destendx, destendy; \
- s32 srcx, srcy; \
- s32 curx, cury; \
- s32 dx, dy; \
- \
- assert(dest.valid()); \
- assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority.valid()); \
- assert(dest.cliprect().contains(cliprect)); \
- \
- /* ignore empty/invalid cliprects */ \
- if (cliprect.empty()) \
- break; \
- \
- /* compute scaled size */ \
- dstwidth = (scalex * width() + 0x8000) >> 16; \
- dstheight = (scaley * height() + 0x8000) >> 16; \
- if (dstwidth < 1 || dstheight < 1) \
- break; \
- \
- /* compute 16.16 source steps in dx and dy */ \
- dx = (width() << 16) / dstwidth; \
- dy = (height() << 16) / dstheight; \
- \
- /* compute final pixel in X and exit if we are entirely clipped */ \
- destendx = destx + dstwidth - 1; \
- if (destx > cliprect.right() || destendx < cliprect.left()) \
- break; \
- \
- /* apply left clip */ \
- srcx = 0; \
- if (destx < cliprect.left()) \
- { \
- srcx = (cliprect.left() - destx) * dx; \
- destx = cliprect.left(); \
- } \
- \
- /* apply right clip */ \
- if (destendx > cliprect.right()) \
- destendx = cliprect.right(); \
- \
- /* compute final pixel in Y and exit if we are entirely clipped */ \
- destendy = desty + dstheight - 1; \
- if (desty > cliprect.bottom() || destendy < cliprect.top()) \
- { \
- g_profiler.stop(); \
- return; \
- } \
- \
- /* apply top clip */ \
- srcy = 0; \
- if (desty < cliprect.top()) \
- { \
- srcy = (cliprect.top() - desty) * dy; \
- desty = cliprect.top(); \
- } \
- \
- /* apply bottom clip */ \
- if (destendy > cliprect.bottom()) \
- destendy = cliprect.bottom(); \
- \
- /* apply X flipping */ \
- if (flipx) \
- { \
- srcx = (dstwidth - 1) * dx - srcx; \
- dx = -dx; \
- } \
- \
- /* apply Y flipping */ \
- if (flipy) \
- { \
- srcy = (dstheight - 1) * dy - srcy; \
- dy = -dy; \
- } \
- \
- /* fetch the source data */ \
- srcdata = get_data(code); \
- \
- /* compute how many blocks of 4 pixels we have */ \
- u32 numblocks = (destendx + 1 - destx) / 4; \
- u32 leftovers = (destendx + 1 - destx) - 4 * numblocks; \
- \
- /* iterate over pixels in Y */ \
- for (cury = desty; cury <= destendy; cury++) \
- { \
- PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \
- PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const u8 *srcptr = srcdata + (srcy >> 16) * rowbytes(); \
- s32 cursrcx = srcx; \
- srcy += dy; \
- \
- /* iterate over unrolled blocks of 4 */ \
- for (curx = 0; curx < numblocks; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[cursrcx >> 16]); \
- cursrcx += dx; \
- PIXEL_OP(destptr[1], priptr[1], srcptr[cursrcx >> 16]); \
- cursrcx += dx; \
- PIXEL_OP(destptr[2], priptr[2], srcptr[cursrcx >> 16]); \
- cursrcx += dx; \
- PIXEL_OP(destptr[3], priptr[3], srcptr[cursrcx >> 16]); \
- cursrcx += dx; \
- \
- destptr += 4; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 4); \
- } \
- \
- /* iterate over leftover pixels */ \
- for (curx = 0; curx < leftovers; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[cursrcx >> 16]); \
- cursrcx += dx; \
- destptr++; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 1); \
- } \
- } \
- } while (0); \
- g_profiler.stop(); \
-} while (0)
-
-
-
-/***************************************************************************
- BASIC COPYBITMAP CORE
-***************************************************************************/
-
-/*
- Assumed input parameters or local variables:
-
- bitmap_t &dest - the bitmap to copy to
- bitmap_t &src - the bitmap to copy from (must be same bpp as dest)
- const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
- int flipx - non-zero means render right-to-left instead of left-to-right
- int flipy - non-zero means render bottom-to-top instead of top-to-bottom
- s32 destx - the top-left X coordinate to copy to
- s32 desty - the top-left Y coordinate to copy to
- bitmap_t &priority - the priority bitmap (even if PRIORITY_TYPE is NO_PRIORITY, at least needs a dummy)
-*/
-
-#define COPYBITMAP_CORE(PIXEL_TYPE, PIXEL_OP, PRIORITY_TYPE) \
-do { \
- g_profiler.start(PROFILER_COPYBITMAP); \
- do { \
- const PIXEL_TYPE *srcdata; \
- u32 numblocks, leftovers; \
- s32 destendx, destendy; \
- s32 srcx, srcy; \
- s32 curx, cury; \
- s32 dx, dy; \
- \
- assert(dest.valid()); \
- assert(src.valid()); \
- assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority.valid()); \
- assert(dest.cliprect().contains(cliprect)); \
- \
- /* ignore empty/invalid cliprects */ \
- if (cliprect.empty()) \
- break; \
- \
- /* standard setup; dx counts bytes in X, dy counts pixels in Y */ \
- dx = 1; \
- dy = src.rowpixels(); \
- \
- /* compute final pixel in X and exit if we are entirely clipped */ \
- destendx = destx + src.width() - 1; \
- if (destx > cliprect.right() || destendx < cliprect.left()) \
- break; \
- \
- /* apply left clip */ \
- srcx = 0; \
- if (destx < cliprect.left()) \
- { \
- srcx = cliprect.left() - destx; \
- destx = cliprect.left(); \
- } \
- \
- /* apply right clip */ \
- if (destendx > cliprect.right()) \
- destendx = cliprect.right(); \
- \
- /* compute final pixel in Y and exit if we are entirely clipped */ \
- destendy = desty + src.height() - 1; \
- if (desty > cliprect.bottom() || destendy < cliprect.top()) \
- break; \
- \
- /* apply top clip */ \
- srcy = 0; \
- if (desty < cliprect.top()) \
- { \
- srcy = cliprect.top() - desty; \
- desty = cliprect.top(); \
- } \
- \
- /* apply bottom clip */ \
- if (destendy > cliprect.bottom()) \
- destendy = cliprect.bottom(); \
- \
- /* apply X flipping */ \
- if (flipx) \
- { \
- srcx = src.width() - 1 - srcx; \
- dx = -dx; \
- } \
- \
- /* apply Y flipping */ \
- if (flipy) \
- { \
- srcy = src.height() - 1 - srcy; \
- dy = -dy; \
- } \
- \
- /* compute how many blocks of 4 pixels we have */ \
- numblocks = (destendx + 1 - destx) / 4; \
- leftovers = (destendx + 1 - destx) - 4 * numblocks; \
- \
- /* compute the address of the first source pixel of the first row */ \
- srcdata = &src.pixt<PIXEL_TYPE>(srcy, srcx); \
- \
- /* non-flipped case */ \
- if (!flipx) \
- { \
- /* iterate over pixels in Y */ \
- for (cury = desty; cury <= destendy; cury++) \
- { \
- PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \
- PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const PIXEL_TYPE *srcptr = srcdata; \
- srcdata += dy; \
- \
- /* iterate over unrolled blocks of 4 */ \
- for (curx = 0; curx < numblocks; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- PIXEL_OP(destptr[1], priptr[1], srcptr[1]); \
- PIXEL_OP(destptr[2], priptr[2], srcptr[2]); \
- PIXEL_OP(destptr[3], priptr[3], srcptr[3]); \
- \
- srcptr += 4; \
- destptr += 4; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 4); \
- } \
- \
- /* iterate over leftover pixels */ \
- for (curx = 0; curx < leftovers; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- srcptr++; \
- destptr++; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 1); \
- } \
- } \
- } \
- \
- /* flipped case */ \
- else \
- { \
- /* iterate over pixels in Y */ \
- for (cury = desty; cury <= destendy; cury++) \
- { \
- PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \
- PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const PIXEL_TYPE *srcptr = srcdata; \
- srcdata += dy; \
- \
- /* iterate over unrolled blocks of 4 */ \
- for (curx = 0; curx < numblocks; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[ 0]); \
- PIXEL_OP(destptr[1], priptr[1], srcptr[-1]); \
- PIXEL_OP(destptr[2], priptr[2], srcptr[-2]); \
- PIXEL_OP(destptr[3], priptr[3], srcptr[-3]); \
- \
- srcptr -= 4; \
- destptr += 4; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 4); \
- } \
- \
- /* iterate over leftover pixels */ \
- for (curx = 0; curx < leftovers; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- srcptr--; \
- destptr++; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 1); \
- } \
- } \
- } \
- } while (0); \
- g_profiler.stop(); \
-} while (0)
-
-
-
-/***************************************************************************
- BASIC COPYROZBITMAP CORE
-***************************************************************************/
-
-/*
- Assumed input parameters or local variables:
-
- bitmap_t &dest - the bitmap to copy to
- bitmap_t &src - the bitmap to copy from (must be same bpp as dest)
- const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
- s32 destx - the 16.16 source X position at destination pixel (0,0)
- s32 desty - the 16.16 source Y position at destination pixel (0,0)
- s32 incxx - the 16.16 amount to increment in source X for each destination X pixel
- s32 incyx - the 16.16 amount to increment in source Y for each destination X pixel
- s32 incxy - the 16.16 amount to increment in source X for each destination Y pixel
- s32 incyy - the 16.16 amount to increment in source Y for each destination Y pixel
- int wraparound - non-zero means wrap when hitting the edges of the source
- bitmap_t &priority - the priority bitmap (even if PRIORITY_TYPE is NO_PRIORITY, at least needs a dummy)
-*/
-
-#define COPYROZBITMAP_CORE(PIXEL_TYPE, PIXEL_OP, PRIORITY_TYPE) \
-do { \
- u32 srcfixwidth, srcfixheight; \
- u32 numblocks, leftovers; \
- s32 curx, cury; \
- \
- g_profiler.start(PROFILER_COPYBITMAP); \
- \
- assert(dest.valid()); \
- assert(dest.valid()); \
- assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority.valid()); \
- assert(dest.cliprect().contains(cliprect)); \
- assert(!wraparound || (src.width() & (src.width() - 1)) == 0); \
- assert(!wraparound || (src.height() & (src.height() - 1)) == 0); \
- \
- /* ignore empty/invalid cliprects */ \
- if (cliprect.empty()) \
- break; \
- \
- /* compute fixed-point 16.16 size of the source bitmap */ \
- srcfixwidth = src.width() << 16; \
- srcfixheight = src.height() << 16; \
- \
- /* advance the starting coordinates to the top-left of the cliprect */ \
- startx += cliprect.left() * incxx + cliprect.top() * incyx; \
- starty += cliprect.left() * incxy + cliprect.top() * incyy; \
- \
- /* compute how many blocks of 4 pixels we have */ \
- numblocks = cliprect.width() / 4; \
- leftovers = cliprect.width() - 4 * numblocks; \
- \
- /* if incxy and incyx are 0, then we aren't rotating, just zooming */ \
- if (incxy == 0 && incyx == 0) \
- { \
- /* zoom-only, non-wraparound case */ \
- if (!wraparound) \
- { \
- /* iterate over pixels in Y */ \
- for (cury = cliprect.top(); cury <= cliprect.bottom(); cury++) \
- { \
- PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.left()); \
- PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, cliprect.left()); \
- const PIXEL_TYPE *srcptr; \
- s32 srcx = startx; \
- s32 srcy = starty; \
- \
- starty += incyy; \
- \
- /* check srcy for the whole row at once */ \
- if ((u32)srcy < srcfixheight) \
- { \
- srcptr = &src.pixt<PIXEL_TYPE>(srcy >> 16); \
- \
- /* iterate over unrolled blocks of 4 */ \
- for (curx = 0; curx < numblocks; curx++) \
- { \
- if (u32(srcx) < srcfixwidth) \
- PIXEL_OP(destptr[0], priptr[0], srcptr[srcx >> 16]); \
- srcx += incxx; \
- \
- if (u32(srcx) < srcfixwidth) \
- PIXEL_OP(destptr[1], priptr[1], srcptr[srcx >> 16]); \
- srcx += incxx; \
- \
- if (u32(srcx) < srcfixwidth) \
- PIXEL_OP(destptr[2], priptr[2], srcptr[srcx >> 16]); \
- srcx += incxx; \
- \
- if (u32(srcx) < srcfixwidth) \
- PIXEL_OP(destptr[3], priptr[3], srcptr[srcx >> 16]); \
- srcx += incxx; \
- \
- destptr += 4; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 4); \
- } \
- \
- /* iterate over leftover pixels */ \
- for (curx = 0; curx < leftovers; curx++) \
- { \
- if (u32(srcx) < srcfixwidth) \
- PIXEL_OP(destptr[0], priptr[0], srcptr[srcx >> 16]); \
- srcx += incxx; \
- destptr++; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 1); \
- } \
- } \
- } \
- } \
- \
- /* zoom-only, wraparound case */ \
- else \
- { \
- /* convert srcfixwidth/height into a mask and apply */ \
- srcfixwidth--; \
- srcfixheight--; \
- startx &= srcfixwidth; \
- starty &= srcfixheight; \
- \
- /* iterate over pixels in Y */ \
- for (cury = cliprect.top(); cury <= cliprect.bottom(); cury++) \
- { \
- PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.left()); \
- PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, cliprect.left()); \
- const PIXEL_TYPE *srcptr = &src.pixt<PIXEL_TYPE>(starty >> 16); \
- s32 srcx = startx; \
- \
- starty = (starty + incyy) & srcfixheight; \
- \
- /* iterate over unrolled blocks of 4 */ \
- for (curx = 0; curx < numblocks; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[srcx >> 16]); \
- srcx = (srcx + incxx) & srcfixwidth; \
- \
- PIXEL_OP(destptr[1], priptr[1], srcptr[srcx >> 16]); \
- srcx = (srcx + incxx) & srcfixwidth; \
- \
- PIXEL_OP(destptr[2], priptr[2], srcptr[srcx >> 16]); \
- srcx = (srcx + incxx) & srcfixwidth; \
- \
- PIXEL_OP(destptr[3], priptr[3], srcptr[srcx >> 16]); \
- srcx = (srcx + incxx) & srcfixwidth; \
- \
- destptr += 4; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 4); \
- } \
- \
- /* iterate over leftover pixels */ \
- for (curx = 0; curx < leftovers; curx++) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[srcx >> 16]); \
- srcx = (srcx + incxx) & srcfixwidth; \
- destptr++; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 1); \
- } \
- } \
- } \
- } \
- \
- /* full rotation case */ \
- else \
- { \
- /* full rotation, non-wraparound case */ \
- if (!wraparound) \
- { \
- /* iterate over pixels in Y */ \
- for (cury = cliprect.top(); cury <= cliprect.bottom(); cury++) \
- { \
- PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.left()); \
- PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, cliprect.left()); \
- const PIXEL_TYPE *srcptr; \
- s32 srcx = startx; \
- s32 srcy = starty; \
- \
- startx += incyx; \
- starty += incyy; \
- \
- /* iterate over unrolled blocks of 4 */ \
- for (curx = 0; curx < numblocks; curx++) \
- { \
- if (u32(srcx) < srcfixwidth && (u32)srcy < srcfixheight) \
- { \
- srcptr = &src.pixt<PIXEL_TYPE>(srcy >> 16, srcx >> 16); \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- } \
- srcx += incxx; \
- srcy += incxy; \
- \
- if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight) \
- { \
- srcptr = &src.pixt<PIXEL_TYPE>(srcy >> 16, srcx >> 16); \
- PIXEL_OP(destptr[1], priptr[1], srcptr[0]); \
- } \
- srcx += incxx; \
- srcy += incxy; \
- \
- if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight) \
- { \
- srcptr = &src.pixt<PIXEL_TYPE>(srcy >> 16, srcx >> 16); \
- PIXEL_OP(destptr[2], priptr[2], srcptr[0]); \
- } \
- srcx += incxx; \
- srcy += incxy; \
- \
- if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight) \
- { \
- srcptr = &src.pixt<PIXEL_TYPE>(srcy >> 16, srcx >> 16); \
- PIXEL_OP(destptr[3], priptr[3], srcptr[0]); \
- } \
- srcx += incxx; \
- srcy += incxy; \
- \
- destptr += 4; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 4); \
- } \
- \
- /* iterate over leftover pixels */ \
- for (curx = 0; curx < leftovers; curx++) \
- { \
- if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight) \
- { \
- srcptr = &src.pixt<PIXEL_TYPE>(srcy >> 16, srcx >> 16); \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- } \
- srcx += incxx; \
- srcy += incxy; \
- destptr++; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 1); \
- } \
- } \
- } \
- \
- /* zoom-only, wraparound case */ \
- else \
- { \
- /* convert srcfixwidth/height into a mask and apply */ \
- srcfixwidth--; \
- srcfixheight--; \
- startx &= srcfixwidth; \
- starty &= srcfixheight; \
- \
- /* iterate over pixels in Y */ \
- for (cury = cliprect.top(); cury <= cliprect.bottom(); cury++) \
- { \
- PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.left()); \
- PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, cliprect.left()); \
- const PIXEL_TYPE *srcptr; \
- s32 srcx = startx; \
- s32 srcy = starty; \
- \
- startx = (startx + incyx) & srcfixwidth; \
- starty = (starty + incyy) & srcfixheight; \
- \
- /* iterate over unrolled blocks of 4 */ \
- for (curx = 0; curx < numblocks; curx++) \
- { \
- srcptr = &src.pixt<PIXEL_TYPE>(srcy >> 16, srcx >> 16); \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- srcx = (srcx + incxx) & srcfixwidth; \
- srcy = (srcy + incxy) & srcfixheight; \
- \
- srcptr = &src.pixt<PIXEL_TYPE>(srcy >> 16, srcx >> 16); \
- PIXEL_OP(destptr[1], priptr[1], srcptr[0]); \
- srcx = (srcx + incxx) & srcfixwidth; \
- srcy = (srcy + incxy) & srcfixheight; \
- \
- srcptr = &src.pixt<PIXEL_TYPE>(srcy >> 16, srcx >> 16); \
- PIXEL_OP(destptr[2], priptr[2], srcptr[0]); \
- srcx = (srcx + incxx) & srcfixwidth; \
- srcy = (srcy + incxy) & srcfixheight; \
- \
- srcptr = &src.pixt<PIXEL_TYPE>(srcy >> 16, srcx >> 16); \
- PIXEL_OP(destptr[3], priptr[3], srcptr[0]); \
- srcx = (srcx + incxx) & srcfixwidth; \
- srcy = (srcy + incxy) & srcfixheight; \
- \
- destptr += 4; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 4); \
- } \
- \
- /* iterate over leftover pixels */ \
- for (curx = 0; curx < leftovers; curx++) \
- { \
- srcptr = &src.pixt<PIXEL_TYPE>(srcy >> 16, srcx >> 16); \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- srcx = (srcx + incxx) & srcfixwidth; \
- srcy = (srcy + incxy) & srcfixheight; \
- destptr++; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 1); \
- } \
- } \
- } \
- } \
- g_profiler.stop(); \
-} while (0)
-
-
-
-/***************************************************************************
- BASIC DRAWSCANLINE CORE
-***************************************************************************/
-
-/*
- Assumed input parameters or local variables:
-
- bitmap_t &bitmap - the bitmap to copy to
- s32 destx - the X coordinate to copy to
- s32 desty - the Y coordinate to copy to
- s32 length - the total number of pixels to copy
- const UINTx *srcptr - pointer to memory containing the source pixels
- bitmap_t &priority - the priority bitmap (even if PRIORITY_TYPE is NO_PRIORITY, at least needs a dummy)
-*/
-
-#define DRAWSCANLINE_CORE(PIXEL_TYPE, PIXEL_OP, PRIORITY_TYPE) \
-do { \
- assert(bitmap.valid()); \
- assert(destx >= 0); \
- assert(destx + length <= bitmap.width()); \
- assert(desty >= 0); \
- assert(desty < bitmap.height()); \
- assert(srcptr != nullptr); \
- assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority.valid()); \
- \
- { \
- PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, desty, destx); \
- PIXEL_TYPE *destptr = &bitmap.pixt<PIXEL_TYPE>(desty, destx); \
- \
- /* iterate over unrolled blocks of 4 */ \
- while (length >= 4) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- PIXEL_OP(destptr[1], priptr[1], srcptr[1]); \
- PIXEL_OP(destptr[2], priptr[2], srcptr[2]); \
- PIXEL_OP(destptr[3], priptr[3], srcptr[3]); \
- \
- length -= 4; \
- srcptr += 4; \
- destptr += 4; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 4); \
- } \
- \
- /* iterate over leftover pixels */ \
- while (length-- > 0) \
- { \
- PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \
- srcptr++; \
- destptr++; \
- PRIORITY_ADVANCE(PRIORITY_TYPE, priptr, 1); \
- } \
- } \
-} while (0)
-
-
-
-/***************************************************************************
- BASIC EXTRACTSCANLINE CORE
-***************************************************************************/
-
-/*
- Assumed input parameters:
-
- bitmap_t &bitmap - the bitmap to extract from
- s32 srcx - the X coordinate to begin extraction
- s32 srcy - the Y coordinate to begin extraction
- s32 length - the total number of pixels to extract
- UINTx *destptr - pointer to memory to receive the extracted pixels
-*/
-
-#define EXTRACTSCANLINE_CORE(PIXEL_TYPE) \
-do { \
- assert(bitmap.valid()); \
- assert(srcx >= 0); \
- assert(srcx + length <= bitmap.width()); \
- assert(srcy >= 0); \
- assert(srcy < bitmap.height()); \
- assert(destptr != nullptr); \
- \
- { \
- const PIXEL_TYPE *srcptr = &bitmap.pixt<PIXEL_TYPE>(srcy, srcx); \
- \
- /* iterate over unrolled blocks of 4 */ \
- while (length >= 4) \
- { \
- destptr[0] = srcptr[0]; \
- destptr[1] = srcptr[1]; \
- destptr[2] = srcptr[2]; \
- destptr[3] = srcptr[3]; \
- length -= 4; \
- srcptr += 4; \
- destptr += 4; \
- } \
- \
- /* iterate over leftover pixels */ \
- while (length > 0) \
- { \
- destptr[0] = srcptr[0]; \
- length--; \
- srcptr++; \
- destptr++; \
- } \
- } \
-} while (0)
-
-
-#endif /* __DRAWGFXM_H__ */
diff --git a/src/emu/drawgfxt.ipp b/src/emu/drawgfxt.ipp
new file mode 100644
index 00000000000..eb4910ebf78
--- /dev/null
+++ b/src/emu/drawgfxt.ipp
@@ -0,0 +1,1911 @@
+// license:BSD-3-Clause
+// copyright-holders:Nicola Salmoria, Aaron Giles
+/*********************************************************************
+
+ drawgfxt.ipp
+
+ Template function implementing drawgfx core operations. Drivers
+ can use these if they need custom behavior not provided by the
+ existing drawgfx functions.
+
+*********************************************************************/
+
+#pragma once
+
+#ifndef MAME_EMU_DRAWGFXT_IPP
+#define MAME_EMU_DRAWGFXT_IPP
+
+
+/***************************************************************************
+ PIXEL OPERATIONS
+***************************************************************************/
+
+/*-------------------------------------------------
+ PIXEL_OP_COPY_OPAQUE - render all pixels
+ regardless of pen, copying directly
+-------------------------------------------------*/
+
+#define PIXEL_OP_COPY_OPAQUE(DEST, SOURCE) \
+do \
+{ \
+ (DEST) = SOURCE; \
+} \
+while (0)
+#define PIXEL_OP_COPY_OPAQUE_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
+ (DEST) = SOURCE; \
+ (PRIORITY) = 31; \
+} \
+while (0)
+#define PIXEL_OP_COPY_OPAQUE_PRIMASK(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ (DEST) = SOURCE; \
+ (PRIORITY) = ((PRIORITY) & pmask) | pcode; \
+} \
+while (0)
+
+/*-------------------------------------------------
+ PIXEL_OP_COPY_TRANSPEN - render all pixels
+ except those matching 'transpen', copying
+ directly
+-------------------------------------------------*/
+
+#define PIXEL_OP_COPY_TRANSPEN(DEST, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (srcdata != trans_pen) \
+ (DEST) = SOURCE; \
+} \
+while (0)
+#define PIXEL_OP_COPY_TRANSPEN_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (srcdata != trans_pen) \
+ { \
+ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
+ (DEST) = SOURCE; \
+ (PRIORITY) = 31; \
+ } \
+} \
+while (0)
+#define PIXEL_OP_COPY_TRANSPEN_PRIMASK(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (srcdata != trans_pen) \
+ { \
+ (DEST) = SOURCE; \
+ (PRIORITY) = ((PRIORITY) & pmask) | pcode; \
+ } \
+} \
+while (0)
+
+/*-------------------------------------------------
+ PIXEL_OP_COPY_TRANSALPHA - render all pixels
+ except those with an alpha of zero, copying
+ directly
+-------------------------------------------------*/
+
+#define PIXEL_OP_COPY_TRANSALPHA(DEST, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if ((srcdata & 0xff000000) != 0) \
+ (DEST) = SOURCE; \
+} \
+while (0)
+#define PIXEL_OP_COPY_TRANSALPHA_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if ((srcdata & 0xff000000) != 0) \
+ { \
+ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
+ (DEST) = SOURCE; \
+ (PRIORITY) = 31; \
+ } \
+} \
+while (0)
+#define PIXEL_OP_COPY_TRANSALPHA_PRIMASK(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if ((srcdata & 0xff000000) != 0) \
+ { \
+ (DEST) = SOURCE; \
+ (PRIORITY) = ((PRIORITY) & pmask) | pcode; \
+ } \
+} \
+while (0)
+
+/*-------------------------------------------------
+ PIXEL_OP_REMAP_OPAQUE - render all pixels
+ regardless of pen, mapping the pen via the
+ 'paldata' array
+-------------------------------------------------*/
+
+#define PIXEL_OP_REMAP_OPAQUE(DEST, SOURCE) \
+do \
+{ \
+ (DEST) = paldata[SOURCE]; \
+} \
+while (0)
+#define PIXEL_OP_REMAP_OPAQUE_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
+ (DEST) = paldata[SOURCE]; \
+ (PRIORITY) = 31; \
+} \
+while (0)
+#define PIXEL_OP_REMAP_OPAQUE_PRIMASK(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ (DEST) = paldata[SOURCE]; \
+ (PRIORITY) = ((PRIORITY) & pmask) | pcode; \
+} \
+while (0)
+
+/*-------------------------------------------------
+ PIXEL_OP_REBASE_OPAQUE - render all pixels
+ regardless of pen, adding 'color' to the
+ pen value
+-------------------------------------------------*/
+
+#define PIXEL_OP_REBASE_OPAQUE(DEST, SOURCE) \
+do \
+{ \
+ (DEST) = color + (SOURCE); \
+} \
+while (0)
+#define PIXEL_OP_REBASE_OPAQUE_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
+ (DEST) = color + (SOURCE); \
+ (PRIORITY) = 31; \
+} \
+while (0)
+
+/*-------------------------------------------------
+ PIXEL_OP_REMAP_TRANSPEN - render all pixels
+ except those matching 'trans_pen', mapping the
+ pen via the 'paldata' array
+-------------------------------------------------*/
+
+#define PIXEL_OP_REMAP_TRANSPEN(DEST, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (srcdata != trans_pen) \
+ (DEST) = paldata[srcdata]; \
+} \
+while (0)
+#define PIXEL_OP_REMAP_TRANSPEN_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (srcdata != trans_pen) \
+ { \
+ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
+ (DEST) = paldata[srcdata]; \
+ (PRIORITY) = 31; \
+ } \
+} \
+while (0)
+
+/*-------------------------------------------------
+ PIXEL_OP_REBASE_TRANSPEN - render all pixels
+ except those matching 'transpen', adding
+ 'color' to the pen value
+-------------------------------------------------*/
+
+#define PIXEL_OP_REBASE_TRANSPEN(DEST, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (srcdata != trans_pen) \
+ (DEST) = color + srcdata; \
+} \
+while (0)
+#define PIXEL_OP_REBASE_TRANSPEN_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (srcdata != trans_pen) \
+ { \
+ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
+ (DEST) = color + srcdata; \
+ (PRIORITY) = 31; \
+ } \
+} \
+while (0)
+
+/*-------------------------------------------------
+ PIXEL_OP_REMAP_TRANSMASK - render all pixels
+ except those matching 'trans_mask', mapping the
+ pen via the 'paldata' array
+-------------------------------------------------*/
+
+#define PIXEL_OP_REMAP_TRANSMASK(DEST, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (((trans_mask >> srcdata) & 1) == 0) \
+ (DEST) = paldata[srcdata]; \
+} \
+while (0)
+#define PIXEL_OP_REMAP_TRANSMASK_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (((trans_mask >> srcdata) & 1) == 0) \
+ { \
+ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
+ (DEST) = paldata[srcdata]; \
+ (PRIORITY) = 31; \
+ } \
+} \
+while (0)
+
+/*-------------------------------------------------
+ PIXEL_OP_REBASE_TRANSMASK - render all pixels
+ except those matching 'trans_mask', adding
+ 'color' to the pen value
+-------------------------------------------------*/
+
+#define PIXEL_OP_REBASE_TRANSMASK(DEST, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (((trans_mask >> srcdata) & 1) == 0) \
+ (DEST) = color + srcdata; \
+} \
+while (0)
+#define PIXEL_OP_REBASE_TRANSMASK_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (((trans_mask >> srcdata) & 1) == 0) \
+ { \
+ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
+ (DEST) = color + srcdata; \
+ (PRIORITY) = 31; \
+ } \
+} \
+while (0)
+
+/*-------------------------------------------------
+ PIXEL_OP_REBASE_TRANSTABLE - look up each pen in
+ 'pentable'; if the entry is DRAWMODE_NONE,
+ don't draw it; if the entry is DRAWMODE_SOURCE,
+ add 'color' to the pen value; if the entry is
+ DRAWMODE_SHADOW, generate a shadow of the
+ destination pixel using 'shadowtable'
+
+ PIXEL_OP_REMAP_TRANSTABLE - look up each pen in
+ 'pentable'; if the entry is DRAWMODE_NONE,
+ don't draw it; if the entry is DRAWMODE_SOURCE,
+ look up the pen via the 'paldata' array; if the
+ entry is DRAWMODE_SHADOW, generate a shadow of
+ the destination pixel using 'shadowtable'
+-------------------------------------------------*/
+
+#define PIXEL_OP_REBASE_TRANSTABLE16(DEST, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ u32 entry = pentable[srcdata]; \
+ if (entry != DRAWMODE_NONE) \
+ { \
+ if (entry == DRAWMODE_SOURCE) \
+ (DEST) = color + srcdata; \
+ else \
+ (DEST) = shadowtable[DEST]; \
+ } \
+} \
+while (0)
+#define PIXEL_OP_REMAP_TRANSTABLE32(DEST, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ u32 entry = pentable[srcdata]; \
+ if (entry != DRAWMODE_NONE) \
+ { \
+ if (entry == DRAWMODE_SOURCE) \
+ (DEST) = paldata[srcdata]; \
+ else \
+ (DEST) = shadowtable[rgb_t(DEST).as_rgb15()]; \
+ } \
+} \
+while (0)
+#define PIXEL_OP_REBASE_TRANSTABLE16_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ u32 entry = pentable[srcdata]; \
+ if (entry != DRAWMODE_NONE) \
+ { \
+ u8 pridata = (PRIORITY); \
+ if (entry == DRAWMODE_SOURCE) \
+ { \
+ if (((1 << (pridata & 0x1f)) & pmask) == 0) \
+ (DEST) = color + srcdata; \
+ (PRIORITY) = 31; \
+ } \
+ else if ((pridata & 0x80) == 0 && ((1 << (pridata & 0x1f)) & pmask) == 0) \
+ { \
+ (DEST) = shadowtable[DEST]; \
+ (PRIORITY) = pridata | 0x80; \
+ } \
+ } \
+} \
+while (0)
+#define PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ u32 entry = pentable[srcdata]; \
+ if (entry != DRAWMODE_NONE) \
+ { \
+ u8 pridata = (PRIORITY); \
+ if (entry == DRAWMODE_SOURCE) \
+ { \
+ if (((1 << (pridata & 0x1f)) & pmask) == 0) \
+ (DEST) = paldata[srcdata]; \
+ (PRIORITY) = 31; \
+ } \
+ else if ((pridata & 0x80) == 0 && ((1 << (pridata & 0x1f)) & pmask) == 0) \
+ { \
+ (DEST) = shadowtable[rgb_t(DEST).as_rgb15()]; \
+ (PRIORITY) = pridata | 0x80; \
+ } \
+ } \
+} \
+while (0)
+
+/*-------------------------------------------------
+ PIXEL_OP_REMAP_TRANSPEN_ALPHA - render all
+ pixels except those matching 'transpen',
+ mapping the pen to via the 'paldata' array;
+ the resulting color is RGB alpha blended
+ against the destination using 'alpha'
+-------------------------------------------------*/
+
+#define PIXEL_OP_REMAP_TRANSPEN_ALPHA32(DEST, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (srcdata != trans_pen) \
+ (DEST) = alpha_blend_r32((DEST), paldata[srcdata], alpha_val); \
+} \
+while (0)
+#define PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY(DEST, PRIORITY, SOURCE) \
+do \
+{ \
+ u32 srcdata = (SOURCE); \
+ if (srcdata != trans_pen) \
+ { \
+ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \
+ (DEST) = alpha_blend_r32((DEST), paldata[srcdata], alpha_val); \
+ (PRIORITY) = 31; \
+ } \
+} \
+while (0)
+
+
+/***************************************************************************
+ BASIC DRAWGFX CORE
+***************************************************************************/
+
+/*
+ Input parameters:
+
+ bitmap_t &dest - the bitmap to render to
+ const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
+ gfx_element *gfx - pointer to the gfx_element to render
+ u32 code - index of the entry within gfx_element
+ int flipx - non-zero means render right-to-left instead of left-to-right
+ int flipy - non-zero means render bottom-to-top instead of top-to-bottom
+ s32 destx - the top-left X coordinate to render to
+ s32 desty - the top-left Y coordinate to render to
+ bitmap_t &priority - the priority bitmap (if and only if priority is to be applied)
+*/
+
+
+template <typename BitmapType, typename FunctionClass>
+void gfx_element::drawgfx_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, FunctionClass pixel_op)
+{
+ g_profiler.start(PROFILER_DRAWGFX);
+ do {
+ assert(dest.valid());
+ assert(dest.cliprect().contains(cliprect));
+ assert(code < elements());
+
+ // ignore empty/invalid cliprects
+ if (cliprect.empty())
+ break;
+
+ // compute final pixel in X and exit if we are entirely clipped
+ s32 destendx = destx + width() - 1;
+ if (destx > cliprect.right() || destendx < cliprect.left())
+ break;
+
+ // apply left clip
+ s32 srcx = 0;
+ if (destx < cliprect.left())
+ {
+ srcx = cliprect.left() - destx;
+ destx = cliprect.left();
+ }
+
+ // apply right clip
+ if (destendx > cliprect.right())
+ destendx = cliprect.right();
+
+ // compute final pixel in Y and exit if we are entirely clipped
+ s32 destendy = desty + height() - 1;
+ if (desty > cliprect.bottom() || destendy < cliprect.top())
+ break;
+
+ // apply top clip
+ s32 srcy = 0;
+ if (desty < cliprect.top())
+ {
+ srcy = cliprect.top() - desty;
+ desty = cliprect.top();
+ }
+
+ // apply bottom clip
+ if (destendy > cliprect.bottom())
+ destendy = cliprect.bottom();
+
+ // apply X flipping
+ if (flipx)
+ srcx = width() - 1 - srcx;
+
+ // apply Y flipping
+ s32 dy = rowbytes();
+ if (flipy)
+ {
+ srcy = height() - 1 - srcy;
+ dy = -dy;
+ }
+
+ // fetch the source data
+ const u8 *srcdata = get_data(code);
+
+ // compute how many blocks of 4 pixels we have
+ u32 numblocks = (destendx + 1 - destx) / 4;
+ u32 leftovers = (destendx + 1 - destx) - 4 * numblocks;
+
+ // adjust srcdata to point to the first source pixel of the row
+ srcdata += srcy * rowbytes() + srcx;
+
+ // non-flipped 8bpp case
+ if (!flipx)
+ {
+ // iterate over pixels in Y
+ for (s32 cury = desty; cury <= destendy; cury++)
+ {
+ auto *destptr = &dest.pix(cury, destx);
+ const u8 *srcptr = srcdata;
+ srcdata += dy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], srcptr[0]);
+ pixel_op(destptr[1], srcptr[1]);
+ pixel_op(destptr[2], srcptr[2]);
+ pixel_op(destptr[3], srcptr[3]);
+
+ srcptr += 4;
+ destptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], srcptr[0]);
+ srcptr++;
+ destptr++;
+ }
+ }
+ }
+
+ // flipped 8bpp case
+ else
+ {
+ // iterate over pixels in Y
+ for (s32 cury = desty; cury <= destendy; cury++)
+ {
+ auto *destptr = &dest.pix(cury, destx);
+ const u8 *srcptr = srcdata;
+ srcdata += dy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], srcptr[ 0]);
+ pixel_op(destptr[1], srcptr[-1]);
+ pixel_op(destptr[2], srcptr[-2]);
+ pixel_op(destptr[3], srcptr[-3]);
+
+ srcptr -= 4;
+ destptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], srcptr[0]);
+ srcptr--;
+ destptr++;
+ }
+ }
+ }
+ } while (0);
+ g_profiler.stop();
+}
+
+
+template <typename BitmapType, typename PriorityType, typename FunctionClass>
+void gfx_element::drawgfx_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, PriorityType &priority, FunctionClass pixel_op)
+{
+ g_profiler.start(PROFILER_DRAWGFX);
+ do {
+ assert(dest.valid());
+ assert(priority.valid());
+ assert(dest.cliprect().contains(cliprect));
+ assert(code < elements());
+
+ // ignore empty/invalid cliprects
+ if (cliprect.empty())
+ break;
+
+ // compute final pixel in X and exit if we are entirely clipped
+ s32 destendx = destx + width() - 1;
+ if (destx > cliprect.right() || destendx < cliprect.left())
+ break;
+
+ // apply left clip
+ s32 srcx = 0;
+ if (destx < cliprect.left())
+ {
+ srcx = cliprect.left() - destx;
+ destx = cliprect.left();
+ }
+
+ // apply right clip
+ if (destendx > cliprect.right())
+ destendx = cliprect.right();
+
+ // compute final pixel in Y and exit if we are entirely clipped
+ s32 destendy = desty + height() - 1;
+ if (desty > cliprect.bottom() || destendy < cliprect.top())
+ break;
+
+ // apply top clip
+ s32 srcy = 0;
+ if (desty < cliprect.top())
+ {
+ srcy = cliprect.top() - desty;
+ desty = cliprect.top();
+ }
+
+ // apply bottom clip
+ if (destendy > cliprect.bottom())
+ destendy = cliprect.bottom();
+
+ // apply X flipping
+ if (flipx)
+ srcx = width() - 1 - srcx;
+
+ // apply Y flipping
+ s32 dy = rowbytes();
+ if (flipy)
+ {
+ srcy = height() - 1 - srcy;
+ dy = -dy;
+ }
+
+ // fetch the source data
+ const u8 *srcdata = get_data(code);
+
+ // compute how many blocks of 4 pixels we have
+ u32 numblocks = (destendx + 1 - destx) / 4;
+ u32 leftovers = (destendx + 1 - destx) - 4 * numblocks;
+
+ // adjust srcdata to point to the first source pixel of the row
+ srcdata += srcy * rowbytes() + srcx;
+
+ // non-flipped 8bpp case
+ if (!flipx)
+ {
+ // iterate over pixels in Y
+ for (s32 cury = desty; cury <= destendy; cury++)
+ {
+ auto *priptr = &priority.pix(cury, destx);
+ auto *destptr = &dest.pix(cury, destx);
+ const u8 *srcptr = srcdata;
+ srcdata += dy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ pixel_op(destptr[1], priptr[1], srcptr[1]);
+ pixel_op(destptr[2], priptr[2], srcptr[2]);
+ pixel_op(destptr[3], priptr[3], srcptr[3]);
+
+ srcptr += 4;
+ destptr += 4;
+ priptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ srcptr++;
+ destptr++;
+ priptr++;
+ }
+ }
+ }
+
+ // flipped 8bpp case
+ else
+ {
+ // iterate over pixels in Y
+ for (s32 cury = desty; cury <= destendy; cury++)
+ {
+ auto *priptr = &priority.pix(cury, destx);
+ auto *destptr = &dest.pix(cury, destx);
+ const u8 *srcptr = srcdata;
+ srcdata += dy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[ 0]);
+ pixel_op(destptr[1], priptr[1], srcptr[-1]);
+ pixel_op(destptr[2], priptr[2], srcptr[-2]);
+ pixel_op(destptr[3], priptr[3], srcptr[-3]);
+
+ srcptr -= 4;
+ destptr += 4;
+ priptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ srcptr--;
+ destptr++;
+ priptr++;
+ }
+ }
+ }
+ } while (0);
+ g_profiler.stop();
+}
+
+
+
+/***************************************************************************
+ BASIC DRAWGFXZOOM CORE
+***************************************************************************/
+
+/*
+ Input parameters:
+
+ bitmap_t &dest - the bitmap to render to
+ const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
+ gfx_element *gfx - pointer to the gfx_element to render
+ u32 code - index of the entry within gfx_element
+ int flipx - non-zero means render right-to-left instead of left-to-right
+ int flipy - non-zero means render bottom-to-top instead of top-to-bottom
+ s32 destx - the top-left X coordinate to render to
+ s32 desty - the top-left Y coordinate to render to
+ u32 scalex - the 16.16 scale factor in the X dimension
+ u32 scaley - the 16.16 scale factor in the Y dimension
+ bitmap_t &priority - the priority bitmap (if and only if priority is to be applied)
+*/
+
+
+template <typename BitmapType, typename FunctionClass>
+void gfx_element::drawgfxzoom_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley, FunctionClass pixel_op)
+{
+ g_profiler.start(PROFILER_DRAWGFX);
+ do {
+ assert(dest.valid());
+ assert(dest.cliprect().contains(cliprect));
+
+ // ignore empty/invalid cliprects
+ if (cliprect.empty())
+ break;
+
+ // compute scaled size
+ u32 dstwidth = (scalex * width() + 0x8000) >> 16;
+ u32 dstheight = (scaley * height() + 0x8000) >> 16;
+ if (dstwidth < 1 || dstheight < 1)
+ break;
+
+ // compute 16.16 source steps in dx and dy
+ s32 dx = (width() << 16) / dstwidth;
+ s32 dy = (height() << 16) / dstheight;
+
+ // compute final pixel in X and exit if we are entirely clipped
+ s32 destendx = destx + dstwidth - 1;
+ if (destx > cliprect.right() || destendx < cliprect.left())
+ break;
+
+ // apply left clip
+ s32 srcx = 0;
+ if (destx < cliprect.left())
+ {
+ srcx = (cliprect.left() - destx) * dx;
+ destx = cliprect.left();
+ }
+
+ // apply right clip
+ if (destendx > cliprect.right())
+ destendx = cliprect.right();
+
+ // compute final pixel in Y and exit if we are entirely clipped
+ s32 destendy = desty + dstheight - 1;
+ if (desty > cliprect.bottom() || destendy < cliprect.top())
+ {
+ g_profiler.stop();
+ return;
+ }
+
+ // apply top clip
+ s32 srcy = 0;
+ if (desty < cliprect.top())
+ {
+ srcy = (cliprect.top() - desty) * dy;
+ desty = cliprect.top();
+ }
+
+ // apply bottom clip
+ if (destendy > cliprect.bottom())
+ destendy = cliprect.bottom();
+
+ // apply X flipping
+ if (flipx)
+ {
+ srcx = (dstwidth - 1) * dx - srcx;
+ dx = -dx;
+ }
+
+ // apply Y flipping
+ if (flipy)
+ {
+ srcy = (dstheight - 1) * dy - srcy;
+ dy = -dy;
+ }
+
+ // fetch the source data
+ const u8 *srcdata = get_data(code);
+
+ // compute how many blocks of 4 pixels we have
+ u32 numblocks = (destendx + 1 - destx) / 4;
+ u32 leftovers = (destendx + 1 - destx) - 4 * numblocks;
+
+ // iterate over pixels in Y
+ for (s32 cury = desty; cury <= destendy; cury++)
+ {
+ auto *destptr = &dest.pix(cury, destx);
+ const u8 *srcptr = srcdata + (srcy >> 16) * rowbytes();
+ s32 cursrcx = srcx;
+ srcy += dy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], srcptr[cursrcx >> 16]);
+ cursrcx += dx;
+ pixel_op(destptr[1], srcptr[cursrcx >> 16]);
+ cursrcx += dx;
+ pixel_op(destptr[2], srcptr[cursrcx >> 16]);
+ cursrcx += dx;
+ pixel_op(destptr[3], srcptr[cursrcx >> 16]);
+ cursrcx += dx;
+
+ destptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], srcptr[cursrcx >> 16]);
+ cursrcx += dx;
+ destptr++;
+ }
+ }
+ } while (0);
+ g_profiler.stop();
+}
+
+
+template <typename BitmapType, typename PriorityType, typename FunctionClass>
+void gfx_element::drawgfxzoom_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley, PriorityType &priority, FunctionClass pixel_op)
+{
+ g_profiler.start(PROFILER_DRAWGFX);
+ do {
+ assert(dest.valid());
+ assert(priority.valid());
+ assert(dest.cliprect().contains(cliprect));
+
+ // ignore empty/invalid cliprects
+ if (cliprect.empty())
+ break;
+
+ // compute scaled size
+ u32 dstwidth = (scalex * width() + 0x8000) >> 16;
+ u32 dstheight = (scaley * height() + 0x8000) >> 16;
+ if (dstwidth < 1 || dstheight < 1)
+ break;
+
+ // compute 16.16 source steps in dx and dy
+ s32 dx = (width() << 16) / dstwidth;
+ s32 dy = (height() << 16) / dstheight;
+
+ // compute final pixel in X and exit if we are entirely clipped
+ s32 destendx = destx + dstwidth - 1;
+ if (destx > cliprect.right() || destendx < cliprect.left())
+ break;
+
+ // apply left clip
+ s32 srcx = 0;
+ if (destx < cliprect.left())
+ {
+ srcx = (cliprect.left() - destx) * dx;
+ destx = cliprect.left();
+ }
+
+ // apply right clip
+ if (destendx > cliprect.right())
+ destendx = cliprect.right();
+
+ // compute final pixel in Y and exit if we are entirely clipped
+ s32 destendy = desty + dstheight - 1;
+ if (desty > cliprect.bottom() || destendy < cliprect.top())
+ {
+ g_profiler.stop();
+ return;
+ }
+
+ // apply top clip
+ s32 srcy = 0;
+ if (desty < cliprect.top())
+ {
+ srcy = (cliprect.top() - desty) * dy;
+ desty = cliprect.top();
+ }
+
+ // apply bottom clip
+ if (destendy > cliprect.bottom())
+ destendy = cliprect.bottom();
+
+ // apply X flipping
+ if (flipx)
+ {
+ srcx = (dstwidth - 1) * dx - srcx;
+ dx = -dx;
+ }
+
+ // apply Y flipping
+ if (flipy)
+ {
+ srcy = (dstheight - 1) * dy - srcy;
+ dy = -dy;
+ }
+
+ // fetch the source data
+ const u8 *srcdata = get_data(code);
+
+ // compute how many blocks of 4 pixels we have
+ u32 numblocks = (destendx + 1 - destx) / 4;
+ u32 leftovers = (destendx + 1 - destx) - 4 * numblocks;
+
+ // iterate over pixels in Y
+ for (s32 cury = desty; cury <= destendy; cury++)
+ {
+ auto *priptr = &priority.pix(cury, destx);
+ auto *destptr = &dest.pix(cury, destx);
+ const u8 *srcptr = srcdata + (srcy >> 16) * rowbytes();
+ s32 cursrcx = srcx;
+ srcy += dy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[cursrcx >> 16]);
+ cursrcx += dx;
+ pixel_op(destptr[1], priptr[1], srcptr[cursrcx >> 16]);
+ cursrcx += dx;
+ pixel_op(destptr[2], priptr[2], srcptr[cursrcx >> 16]);
+ cursrcx += dx;
+ pixel_op(destptr[3], priptr[3], srcptr[cursrcx >> 16]);
+ cursrcx += dx;
+
+ destptr += 4;
+ priptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[cursrcx >> 16]);
+ cursrcx += dx;
+ destptr++;
+ priptr++;
+ }
+ }
+ } while (0);
+ g_profiler.stop();
+}
+
+
+
+/***************************************************************************
+ BASIC COPYBITMAP CORE
+***************************************************************************/
+
+/*
+ Input parameters:
+
+ bitmap_t &dest - the bitmap to copy to
+ bitmap_t &src - the bitmap to copy from (must be same bpp as dest)
+ const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
+ int flipx - non-zero means render right-to-left instead of left-to-right
+ int flipy - non-zero means render bottom-to-top instead of top-to-bottom
+ s32 destx - the top-left X coordinate to copy to
+ s32 desty - the top-left Y coordinate to copy to
+ bitmap_t &priority - the priority bitmap (if and only if priority is to be applied)
+*/
+
+template <typename BitmapType, typename FunctionClass>
+void copybitmap_core(BitmapType &dest, const BitmapType &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, FunctionClass pixel_op)
+{
+ g_profiler.start(PROFILER_COPYBITMAP);
+ do {
+ assert(dest.valid());
+ assert(src.valid());
+ assert(dest.cliprect().contains(cliprect));
+
+ // ignore empty/invalid cliprects
+ if (cliprect.empty())
+ break;
+
+ // standard setup; dx counts bytes in X, dy counts pixels in Y
+ s32 dx = 1;
+ s32 dy = src.rowpixels();
+
+ // compute final pixel in X and exit if we are entirely clipped
+ s32 destendx = destx + src.width() - 1;
+ if (destx > cliprect.right() || destendx < cliprect.left())
+ break;
+
+ // apply left clip
+ s32 srcx = 0;
+ if (destx < cliprect.left())
+ {
+ srcx = cliprect.left() - destx;
+ destx = cliprect.left();
+ }
+
+ // apply right clip
+ if (destendx > cliprect.right())
+ destendx = cliprect.right();
+
+ // compute final pixel in Y and exit if we are entirely clipped
+ s32 destendy = desty + src.height() - 1;
+ if (desty > cliprect.bottom() || destendy < cliprect.top())
+ break;
+
+ // apply top clip
+ s32 srcy = 0;
+ if (desty < cliprect.top())
+ {
+ srcy = cliprect.top() - desty;
+ desty = cliprect.top();
+ }
+
+ // apply bottom clip
+ if (destendy > cliprect.bottom())
+ destendy = cliprect.bottom();
+
+ // apply X flipping
+ if (flipx)
+ {
+ srcx = src.width() - 1 - srcx;
+ dx = -dx;
+ }
+
+ // apply Y flipping
+ if (flipy)
+ {
+ srcy = src.height() - 1 - srcy;
+ dy = -dy;
+ }
+
+ // compute how many blocks of 4 pixels we have
+ u32 numblocks = (destendx + 1 - destx) / 4;
+ u32 leftovers = (destendx + 1 - destx) - 4 * numblocks;
+
+ // compute the address of the first source pixel of the first row
+ const auto *srcdata = &src.pix(srcy, srcx);
+
+ // non-flipped case
+ if (!flipx)
+ {
+ // iterate over pixels in Y
+ for (s32 cury = desty; cury <= destendy; cury++)
+ {
+ auto *destptr = &dest.pix(cury, destx);
+ const auto *srcptr = srcdata;
+ srcdata += dy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], srcptr[0]);
+ pixel_op(destptr[1], srcptr[1]);
+ pixel_op(destptr[2], srcptr[2]);
+ pixel_op(destptr[3], srcptr[3]);
+
+ srcptr += 4;
+ destptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], srcptr[0]);
+ srcptr++;
+ destptr++;
+ }
+ }
+ }
+
+ // flipped case
+ else
+ {
+ // iterate over pixels in Y
+ for (s32 cury = desty; cury <= destendy; cury++)
+ {
+ auto *destptr = &dest.pix(cury, destx);
+ const auto *srcptr = srcdata;
+ srcdata += dy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], srcptr[ 0]);
+ pixel_op(destptr[1], srcptr[-1]);
+ pixel_op(destptr[2], srcptr[-2]);
+ pixel_op(destptr[3], srcptr[-3]);
+
+ srcptr -= 4;
+ destptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], srcptr[0]);
+ srcptr--;
+ destptr++;
+ }
+ }
+ }
+ } while (0);
+ g_profiler.stop();
+}
+
+
+template <typename BitmapType, typename PriorityType, typename FunctionClass>
+void copybitmap_core(BitmapType &dest, const BitmapType &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, PriorityType &priority, FunctionClass pixel_op)
+{
+ g_profiler.start(PROFILER_COPYBITMAP);
+ do {
+ assert(dest.valid());
+ assert(src.valid());
+ assert(priority.valid());
+ assert(dest.cliprect().contains(cliprect));
+
+ // ignore empty/invalid cliprects
+ if (cliprect.empty())
+ break;
+
+ // standard setup; dx counts bytes in X, dy counts pixels in Y
+ s32 dx = 1;
+ s32 dy = src.rowpixels();
+
+ // compute final pixel in X and exit if we are entirely clipped
+ s32 destendx = destx + src.width() - 1;
+ if (destx > cliprect.right() || destendx < cliprect.left())
+ break;
+
+ // apply left clip
+ s32 srcx = 0;
+ if (destx < cliprect.left())
+ {
+ srcx = cliprect.left() - destx;
+ destx = cliprect.left();
+ }
+
+ // apply right clip
+ if (destendx > cliprect.right())
+ destendx = cliprect.right();
+
+ // compute final pixel in Y and exit if we are entirely clipped
+ s32 destendy = desty + src.height() - 1;
+ if (desty > cliprect.bottom() || destendy < cliprect.top())
+ break;
+
+ // apply top clip
+ s32 srcy = 0;
+ if (desty < cliprect.top())
+ {
+ srcy = cliprect.top() - desty;
+ desty = cliprect.top();
+ }
+
+ // apply bottom clip
+ if (destendy > cliprect.bottom())
+ destendy = cliprect.bottom();
+
+ // apply X flipping
+ if (flipx)
+ {
+ srcx = src.width() - 1 - srcx;
+ dx = -dx;
+ }
+
+ // apply Y flipping
+ if (flipy)
+ {
+ srcy = src.height() - 1 - srcy;
+ dy = -dy;
+ }
+
+ // compute how many blocks of 4 pixels we have
+ u32 numblocks = (destendx + 1 - destx) / 4;
+ u32 leftovers = (destendx + 1 - destx) - 4 * numblocks;
+
+ // compute the address of the first source pixel of the first row
+ const auto *srcdata = &src.pix(srcy, srcx);
+
+ // non-flipped case
+ if (!flipx)
+ {
+ // iterate over pixels in Y
+ for (s32 cury = desty; cury <= destendy; cury++)
+ {
+ auto *priptr = &priority.pix(cury, destx);
+ auto *destptr = &dest.pix(cury, destx);
+ const auto *srcptr = srcdata;
+ srcdata += dy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ pixel_op(destptr[1], priptr[1], srcptr[1]);
+ pixel_op(destptr[2], priptr[2], srcptr[2]);
+ pixel_op(destptr[3], priptr[3], srcptr[3]);
+
+ srcptr += 4;
+ destptr += 4;
+ priptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ srcptr++;
+ destptr++;
+ priptr++;
+ }
+ }
+ }
+
+ // flipped case
+ else
+ {
+ // iterate over pixels in Y
+ for (s32 cury = desty; cury <= destendy; cury++)
+ {
+ auto *priptr = &priority.pix(cury, destx);
+ auto *destptr = &dest.pix(cury, destx);
+ const auto *srcptr = srcdata;
+ srcdata += dy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[ 0]);
+ pixel_op(destptr[1], priptr[1], srcptr[-1]);
+ pixel_op(destptr[2], priptr[2], srcptr[-2]);
+ pixel_op(destptr[3], priptr[3], srcptr[-3]);
+
+ srcptr -= 4;
+ destptr += 4;
+ priptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ srcptr--;
+ destptr++;
+ priptr++;
+ }
+ }
+ }
+ } while (0);
+ g_profiler.stop();
+}
+
+
+
+/***************************************************************************
+ BASIC COPYROZBITMAP CORE
+***************************************************************************/
+
+/*
+ Input parameters:
+
+ bitmap_t &dest - the bitmap to copy to
+ bitmap_t &src - the bitmap to copy from (must be same bpp as dest)
+ const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
+ s32 destx - the 16.16 source X position at destination pixel (0,0)
+ s32 desty - the 16.16 source Y position at destination pixel (0,0)
+ s32 incxx - the 16.16 amount to increment in source X for each destination X pixel
+ s32 incyx - the 16.16 amount to increment in source Y for each destination X pixel
+ s32 incxy - the 16.16 amount to increment in source X for each destination Y pixel
+ s32 incyy - the 16.16 amount to increment in source Y for each destination Y pixel
+ int wraparound - non-zero means wrap when hitting the edges of the source
+ bitmap_t &priority - the priority bitmap (if and only if priority is to be applied)
+*/
+
+template <typename BitmapType, typename FunctionClass>
+void copyrozbitmap_core(BitmapType &dest, const rectangle &cliprect, const BitmapType &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, FunctionClass pixel_op)
+{
+ g_profiler.start(PROFILER_COPYBITMAP);
+
+ assert(dest.valid());
+ assert(dest.valid());
+ assert(dest.cliprect().contains(cliprect));
+ assert(!wraparound || (src.width() & (src.width() - 1)) == 0);
+ assert(!wraparound || (src.height() & (src.height() - 1)) == 0);
+
+ // ignore empty/invalid cliprects
+ if (cliprect.empty())
+ {
+ g_profiler.stop();
+ return;
+ }
+
+ // compute fixed-point 16.16 size of the source bitmap
+ u32 srcfixwidth = src.width() << 16;
+ u32 srcfixheight = src.height() << 16;
+
+ // advance the starting coordinates to the top-left of the cliprect
+ startx += cliprect.left() * incxx + cliprect.top() * incyx;
+ starty += cliprect.left() * incxy + cliprect.top() * incyy;
+
+ // compute how many blocks of 4 pixels we have
+ u32 numblocks = cliprect.width() / 4;
+ u32 leftovers = cliprect.width() - 4 * numblocks;
+
+ // if incxy and incyx are 0, then we aren't rotating, just zooming
+ if (incxy == 0 && incyx == 0)
+ {
+ // zoom-only, non-wraparound case
+ if (!wraparound)
+ {
+ // iterate over pixels in Y
+ for (s32 cury = cliprect.top(); cury <= cliprect.bottom(); cury++)
+ {
+ auto *destptr = &dest.pix(cury, cliprect.left());
+ s32 srcx = startx;
+ s32 srcy = starty;
+
+ starty += incyy;
+
+ // check srcy for the whole row at once
+ if (u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16);
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ if (u32(srcx) < srcfixwidth)
+ pixel_op(destptr[0], srcptr[srcx >> 16]);
+ srcx += incxx;
+
+ if (u32(srcx) < srcfixwidth)
+ pixel_op(destptr[1], srcptr[srcx >> 16]);
+ srcx += incxx;
+
+ if (u32(srcx) < srcfixwidth)
+ pixel_op(destptr[2], srcptr[srcx >> 16]);
+ srcx += incxx;
+
+ if (u32(srcx) < srcfixwidth)
+ pixel_op(destptr[3], srcptr[srcx >> 16]);
+ srcx += incxx;
+
+ destptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ if (u32(srcx) < srcfixwidth)
+ pixel_op(destptr[0], srcptr[srcx >> 16]);
+ srcx += incxx;
+ destptr++;
+ }
+ }
+ }
+ }
+
+ // zoom-only, wraparound case
+ else
+ {
+ // convert srcfixwidth/height into a mask and apply
+ srcfixwidth--;
+ srcfixheight--;
+ startx &= srcfixwidth;
+ starty &= srcfixheight;
+
+ // iterate over pixels in Y
+ for (s32 cury = cliprect.top(); cury <= cliprect.bottom(); cury++)
+ {
+ auto *destptr = &dest.pix(cury, cliprect.left());
+ const auto *srcptr = &src.pix(starty >> 16);
+ s32 srcx = startx;
+
+ starty = (starty + incyy) & srcfixheight;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], srcptr[srcx >> 16]);
+ srcx = (srcx + incxx) & srcfixwidth;
+
+ pixel_op(destptr[1], srcptr[srcx >> 16]);
+ srcx = (srcx + incxx) & srcfixwidth;
+
+ pixel_op(destptr[2], srcptr[srcx >> 16]);
+ srcx = (srcx + incxx) & srcfixwidth;
+
+ pixel_op(destptr[3], srcptr[srcx >> 16]);
+ srcx = (srcx + incxx) & srcfixwidth;
+
+ destptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], srcptr[srcx >> 16]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ destptr++;
+ }
+ }
+ }
+ }
+
+ // full rotation case
+ else
+ {
+ // full rotation, non-wraparound case
+ if (!wraparound)
+ {
+ // iterate over pixels in Y
+ for (s32 cury = cliprect.top(); cury <= cliprect.bottom(); cury++)
+ {
+ auto *destptr = &dest.pix(cury, cliprect.left());
+ s32 srcx = startx;
+ s32 srcy = starty;
+
+ startx += incyx;
+ starty += incyy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[0], srcptr[0]);
+ }
+ srcx += incxx;
+ srcy += incxy;
+
+ if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[1], srcptr[0]);
+ }
+ srcx += incxx;
+ srcy += incxy;
+
+ if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[2], srcptr[0]);
+ }
+ srcx += incxx;
+ srcy += incxy;
+
+ if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[3], srcptr[0]);
+ }
+ srcx += incxx;
+ srcy += incxy;
+
+ destptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[0], srcptr[0]);
+ }
+ srcx += incxx;
+ srcy += incxy;
+ destptr++;
+ }
+ }
+ }
+
+ // zoom-only, wraparound case
+ else
+ {
+ // convert srcfixwidth/height into a mask and apply
+ srcfixwidth--;
+ srcfixheight--;
+ startx &= srcfixwidth;
+ starty &= srcfixheight;
+
+ // iterate over pixels in Y
+ for (s32 cury = cliprect.top(); cury <= cliprect.bottom(); cury++)
+ {
+ auto *destptr = &dest.pix(cury, cliprect.left());
+ s32 srcx = startx;
+ s32 srcy = starty;
+
+ startx = (startx + incyx) & srcfixwidth;
+ starty = (starty + incyy) & srcfixheight;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[0], srcptr[0]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ srcy = (srcy + incxy) & srcfixheight;
+
+ srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[1], srcptr[0]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ srcy = (srcy + incxy) & srcfixheight;
+
+ srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[2], srcptr[0]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ srcy = (srcy + incxy) & srcfixheight;
+
+ srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[3], srcptr[0]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ srcy = (srcy + incxy) & srcfixheight;
+
+ destptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[0], srcptr[0]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ srcy = (srcy + incxy) & srcfixheight;
+ destptr++;
+ }
+ }
+ }
+ }
+ g_profiler.stop();
+}
+
+
+template <typename BitmapType, typename PriorityType, typename FunctionClass>
+void copyrozbitmap_core(BitmapType &dest, const rectangle &cliprect, const BitmapType &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, PriorityType &priority, FunctionClass pixel_op)
+{
+ g_profiler.start(PROFILER_COPYBITMAP);
+
+ assert(dest.valid());
+ assert(dest.valid());
+ assert(priority.valid());
+ assert(dest.cliprect().contains(cliprect));
+ assert(!wraparound || (src.width() & (src.width() - 1)) == 0);
+ assert(!wraparound || (src.height() & (src.height() - 1)) == 0);
+
+ // ignore empty/invalid cliprects
+ if (cliprect.empty())
+ {
+ g_profiler.stop();
+ return;
+ }
+
+ // compute fixed-point 16.16 size of the source bitmap
+ u32 srcfixwidth = src.width() << 16;
+ u32 srcfixheight = src.height() << 16;
+
+ // advance the starting coordinates to the top-left of the cliprect
+ startx += cliprect.left() * incxx + cliprect.top() * incyx;
+ starty += cliprect.left() * incxy + cliprect.top() * incyy;
+
+ // compute how many blocks of 4 pixels we have
+ u32 numblocks = cliprect.width() / 4;
+ u32 leftovers = cliprect.width() - 4 * numblocks;
+
+ // if incxy and incyx are 0, then we aren't rotating, just zooming
+ if (incxy == 0 && incyx == 0)
+ {
+ // zoom-only, non-wraparound case
+ if (!wraparound)
+ {
+ // iterate over pixels in Y
+ for (s32 cury = cliprect.top(); cury <= cliprect.bottom(); cury++)
+ {
+ auto *priptr = &priority.pix(cury, cliprect.left());
+ auto *destptr = &dest.pix(cury, cliprect.left());
+ s32 srcx = startx;
+ s32 srcy = starty;
+
+ starty += incyy;
+
+ // check srcy for the whole row at once
+ if (u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16);
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ if (u32(srcx) < srcfixwidth)
+ pixel_op(destptr[0], priptr[0], srcptr[srcx >> 16]);
+ srcx += incxx;
+
+ if (u32(srcx) < srcfixwidth)
+ pixel_op(destptr[1], priptr[1], srcptr[srcx >> 16]);
+ srcx += incxx;
+
+ if (u32(srcx) < srcfixwidth)
+ pixel_op(destptr[2], priptr[2], srcptr[srcx >> 16]);
+ srcx += incxx;
+
+ if (u32(srcx) < srcfixwidth)
+ pixel_op(destptr[3], priptr[3], srcptr[srcx >> 16]);
+ srcx += incxx;
+
+ destptr += 4;
+ priptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ if (u32(srcx) < srcfixwidth)
+ pixel_op(destptr[0], priptr[0], srcptr[srcx >> 16]);
+ srcx += incxx;
+ destptr++;
+ priptr++;
+ }
+ }
+ }
+ }
+
+ // zoom-only, wraparound case
+ else
+ {
+ // convert srcfixwidth/height into a mask and apply
+ srcfixwidth--;
+ srcfixheight--;
+ startx &= srcfixwidth;
+ starty &= srcfixheight;
+
+ // iterate over pixels in Y
+ for (s32 cury = cliprect.top(); cury <= cliprect.bottom(); cury++)
+ {
+ auto *priptr = &priority.pix(cury, cliprect.left());
+ auto *destptr = &dest.pix(cury, cliprect.left());
+ const auto *srcptr = &src.pix(starty >> 16);
+ s32 srcx = startx;
+
+ starty = (starty + incyy) & srcfixheight;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[srcx >> 16]);
+ srcx = (srcx + incxx) & srcfixwidth;
+
+ pixel_op(destptr[1], priptr[1], srcptr[srcx >> 16]);
+ srcx = (srcx + incxx) & srcfixwidth;
+
+ pixel_op(destptr[2], priptr[2], srcptr[srcx >> 16]);
+ srcx = (srcx + incxx) & srcfixwidth;
+
+ pixel_op(destptr[3], priptr[3], srcptr[srcx >> 16]);
+ srcx = (srcx + incxx) & srcfixwidth;
+
+ destptr += 4;
+ priptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[srcx >> 16]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ destptr++;
+ priptr++;
+ }
+ }
+ }
+ }
+
+ // full rotation case
+ else
+ {
+ // full rotation, non-wraparound case
+ if (!wraparound)
+ {
+ // iterate over pixels in Y
+ for (s32 cury = cliprect.top(); cury <= cliprect.bottom(); cury++)
+ {
+ auto *priptr = &priority.pix(cury, cliprect.left());
+ auto *destptr = &dest.pix(cury, cliprect.left());
+ s32 srcx = startx;
+ s32 srcy = starty;
+
+ startx += incyx;
+ starty += incyy;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ }
+ srcx += incxx;
+ srcy += incxy;
+
+ if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[1], priptr[1], srcptr[0]);
+ }
+ srcx += incxx;
+ srcy += incxy;
+
+ if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[2], priptr[2], srcptr[0]);
+ }
+ srcx += incxx;
+ srcy += incxy;
+
+ if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[3], priptr[3], srcptr[0]);
+ }
+ srcx += incxx;
+ srcy += incxy;
+
+ destptr += 4;
+ priptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ if (u32(srcx) < srcfixwidth && u32(srcy) < srcfixheight)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ }
+ srcx += incxx;
+ srcy += incxy;
+ destptr++;
+ priptr++;
+ }
+ }
+ }
+
+ // zoom-only, wraparound case
+ else
+ {
+ // convert srcfixwidth/height into a mask and apply
+ srcfixwidth--;
+ srcfixheight--;
+ startx &= srcfixwidth;
+ starty &= srcfixheight;
+
+ // iterate over pixels in Y
+ for (s32 cury = cliprect.top(); cury <= cliprect.bottom(); cury++)
+ {
+ auto *priptr = &priority.pix(cury, cliprect.left());
+ auto *destptr = &dest.pix(cury, cliprect.left());
+ s32 srcx = startx;
+ s32 srcy = starty;
+
+ startx = (startx + incyx) & srcfixwidth;
+ starty = (starty + incyy) & srcfixheight;
+
+ // iterate over unrolled blocks of 4
+ for (s32 curx = 0; curx < numblocks; curx++)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ srcy = (srcy + incxy) & srcfixheight;
+
+ srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[1], priptr[1], srcptr[0]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ srcy = (srcy + incxy) & srcfixheight;
+
+ srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[2], priptr[2], srcptr[0]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ srcy = (srcy + incxy) & srcfixheight;
+
+ srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[3], priptr[3], srcptr[0]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ srcy = (srcy + incxy) & srcfixheight;
+
+ destptr += 4;
+ priptr += 4;
+ }
+
+ // iterate over leftover pixels
+ for (s32 curx = 0; curx < leftovers; curx++)
+ {
+ const auto *srcptr = &src.pix(srcy >> 16, srcx >> 16);
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ srcx = (srcx + incxx) & srcfixwidth;
+ srcy = (srcy + incxy) & srcfixheight;
+ destptr++;
+ priptr++;
+ }
+ }
+ }
+ }
+ g_profiler.stop();
+}
+
+
+
+/***************************************************************************
+ BASIC DRAWSCANLINE CORE
+***************************************************************************/
+
+/*
+ Input parameters:
+
+ bitmap_t &bitmap - the bitmap to copy to
+ s32 destx - the X coordinate to copy to
+ s32 desty - the Y coordinate to copy to
+ s32 length - the total number of pixels to copy
+ const UINTx *srcptr - pointer to memory containing the source pixels
+ bitmap_t &priority - the priority bitmap (if and only if priority is to be applied)
+*/
+
+template <typename BitmapType, typename SourceType, typename FunctionClass>
+void drawscanline_core(BitmapType &bitmap, s32 destx, s32 desty, s32 length, const SourceType *srcptr, FunctionClass pixel_op)
+{
+ assert(bitmap.valid());
+ assert(destx >= 0);
+ assert(destx + length <= bitmap.width());
+ assert(desty >= 0);
+ assert(desty < bitmap.height());
+ assert(srcptr != nullptr);
+
+ auto *destptr = &bitmap.pix(desty, destx);
+
+ // iterate over unrolled blocks of 4
+ while (length >= 4)
+ {
+ pixel_op(destptr[0], srcptr[0]);
+ pixel_op(destptr[1], srcptr[1]);
+ pixel_op(destptr[2], srcptr[2]);
+ pixel_op(destptr[3], srcptr[3]);
+
+ length -= 4;
+ srcptr += 4;
+ destptr += 4;
+ }
+
+ // iterate over leftover pixels
+ while (length-- > 0)
+ {
+ pixel_op(destptr[0], srcptr[0]);
+ srcptr++;
+ destptr++;
+ }
+}
+
+
+template <typename BitmapType, typename SourceType, typename PriorityType, typename FunctionClass>
+void drawscanline_core(BitmapType &bitmap, s32 destx, s32 desty, s32 length, const SourceType *srcptr, PriorityType &priority, FunctionClass pixel_op)
+{
+ assert(bitmap.valid());
+ assert(destx >= 0);
+ assert(destx + length <= bitmap.width());
+ assert(desty >= 0);
+ assert(desty < bitmap.height());
+ assert(srcptr != nullptr);
+ assert(priority.valid());
+
+ auto *priptr = &priority.pix(desty, destx);
+ auto *destptr = &bitmap.pix(desty, destx);
+
+ // iterate over unrolled blocks of 4
+ while (length >= 4)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ pixel_op(destptr[1], priptr[1], srcptr[1]);
+ pixel_op(destptr[2], priptr[2], srcptr[2]);
+ pixel_op(destptr[3], priptr[3], srcptr[3]);
+
+ length -= 4;
+ srcptr += 4;
+ destptr += 4;
+ priptr += 4;
+
+ // iterate over leftover pixels
+ while (length-- > 0)
+ {
+ pixel_op(destptr[0], priptr[0], srcptr[0]);
+ srcptr++;
+ destptr++;
+ priptr++;
+ }
+ }
+}
+
+
+#endif // MAME_EMU_DRAWGFXT_IPP
diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp
index 58d076607d8..c65a5cb582b 100644
--- a/src/emu/ioport.cpp
+++ b/src/emu/ioport.cpp
@@ -597,7 +597,6 @@ ioport_field::ioport_field(ioport_port &port, ioport_type type, ioport_value def
m_flags(0),
m_impulse(0),
m_name(name),
- m_read_param(nullptr),
m_write_param(0),
m_digital_value(false),
m_min(0),
@@ -1210,7 +1209,7 @@ void ioport_field::crosshair_position(float &x, float &y, bool &gotx, bool &goty
// apply custom mapping if necessary
if (!m_crosshair_mapper.isnull())
- value = m_crosshair_mapper(*this, value);
+ value = m_crosshair_mapper(value);
// handle X axis
if (m_crosshair_axis == CROSSHAIR_AXIS_X)
@@ -3189,7 +3188,7 @@ void dynamic_field::read(ioport_value &result)
return;
// call the callback to read a new value
- ioport_value newval = m_field.m_read(m_field, m_field.m_read_param);
+ ioport_value newval = m_field.m_read();
m_oldval = newval;
// merge in the bits (don't invert yet, as all digitals are inverted together)
diff --git a/src/emu/ioport.h b/src/emu/ioport.h
index ff93dbc6eb8..df7d2ad026b 100644
--- a/src/emu/ioport.h
+++ b/src/emu/ioport.h
@@ -653,9 +653,9 @@ enum
typedef void(*ioport_constructor)(device_t &owner, ioport_list &portlist, std::string &errorbuf);
// I/O port callback function delegates
-typedef device_delegate<ioport_value (ioport_field &, void *)> ioport_field_read_delegate;
+typedef device_delegate<ioport_value ()> ioport_field_read_delegate;
typedef device_delegate<void (ioport_field &, u32, ioport_value, ioport_value)> ioport_field_write_delegate;
-typedef device_delegate<float (ioport_field &, float)> ioport_field_crossmap_delegate;
+typedef device_delegate<float (float)> ioport_field_crossmap_delegate;
// ======================> inp_header
@@ -1128,7 +1128,6 @@ private:
const char * m_name; // user-friendly name to display
input_seq m_seq[SEQ_TYPE_TOTAL];// sequences of all types
ioport_field_read_delegate m_read; // read callback routine
- void * m_read_param; // parameter for read callback routine
ioport_field_write_delegate m_write; // write callback routine
u32 m_write_param; // parameter for write callback routine
@@ -1525,7 +1524,7 @@ public:
ioport_configurer& field_set_analog_wraps() { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_WRAPS; return *this; }
ioport_configurer& field_set_remap_table(const ioport_value *table) { m_curfield->m_remap_table = table; return *this; }
ioport_configurer& field_set_analog_invert() { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_INVERT; return *this; }
- ioport_configurer& field_set_dynamic_read(ioport_field_read_delegate delegate, void *param = nullptr) { m_curfield->m_read = delegate; m_curfield->m_read_param = param; return *this; }
+ ioport_configurer& field_set_dynamic_read(ioport_field_read_delegate delegate) { m_curfield->m_read = delegate; return *this; }
ioport_configurer& field_set_dynamic_write(ioport_field_write_delegate delegate, u32 param = 0) { m_curfield->m_write = delegate; m_curfield->m_write_param = param; return *this; }
ioport_configurer& field_set_diplocation(const char *location) { m_curfield->expand_diplocation(location, m_errorbuf); return *this; }
@@ -1556,16 +1555,16 @@ private:
#define UCHAR_MAMEKEY(code) (UCHAR_MAMEKEY_BEGIN + ITEM_ID_##code)
// macro for a read callback function (PORT_CUSTOM)
-#define CUSTOM_INPUT_MEMBER(name) ioport_value name(ioport_field &field, void *param)
-#define DECLARE_CUSTOM_INPUT_MEMBER(name) ioport_value name(ioport_field &field, void *param)
+#define CUSTOM_INPUT_MEMBER(name) ioport_value name()
+#define DECLARE_CUSTOM_INPUT_MEMBER(name) ioport_value name()
// macro for port write callback functions (PORT_CHANGED)
#define INPUT_CHANGED_MEMBER(name) void name(ioport_field &field, u32 param, ioport_value oldval, ioport_value newval)
#define DECLARE_INPUT_CHANGED_MEMBER(name) void name(ioport_field &field, u32 param, ioport_value oldval, ioport_value newval)
// macro for port changed callback functions (PORT_CROSSHAIR_MAPPER)
-#define CROSSHAIR_MAPPER_MEMBER(name) float name(ioport_field &field, float linear_value)
-#define DECLARE_CROSSHAIR_MAPPER_MEMBER(name) float name(ioport_field &field, float linear_value)
+#define CROSSHAIR_MAPPER_MEMBER(name) float name(float linear_value)
+#define DECLARE_CROSSHAIR_MAPPER_MEMBER(name) float name(float linear_value)
// macro for wrapping a default string
#define DEF_STR(str_num) ((const char *)INPUT_STRING_##str_num)
@@ -1710,18 +1709,24 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, s
configurer.field_set_analog_invert();
// read callbacks
-#define PORT_CUSTOM_MEMBER(_device, _class, _member, _param) \
- configurer.field_set_dynamic_read(ioport_field_read_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)nullptr), (void *)(_param));
+#define PORT_CUSTOM_MEMBER(_class, _member) \
+ configurer.field_set_dynamic_read(ioport_field_read_delegate(&_class::_member, #_class "::" #_member, DEVICE_SELF, (_class *)nullptr));
+#define PORT_CUSTOM_DEVICE_MEMBER(_device, _class, _member) \
+ configurer.field_set_dynamic_read(ioport_field_read_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)nullptr));
// write callbacks
#define PORT_CHANGED_MEMBER(_device, _class, _member, _param) \
configurer.field_set_dynamic_write(ioport_field_write_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)nullptr), (_param));
// input device handler
+#define PORT_READ_LINE_MEMBER(_class, _member) \
+ configurer.field_set_dynamic_read(ioport_field_read_delegate([](_class &device)->ioport_value { return (device._member() & 1) ? ~ioport_value(0) : 0; } , #_class "::" #_member, DEVICE_SELF, (_class *)nullptr));
#define PORT_READ_LINE_DEVICE_MEMBER(_device, _class, _member) \
- configurer.field_set_dynamic_read(ioport_field_read_delegate([](_class &device, ioport_field &field, void *param)->ioport_value { return (device._member() & 1) ? ~ioport_value(0) : 0; } , #_class "::" #_member, _device, (_class *)nullptr));
+ configurer.field_set_dynamic_read(ioport_field_read_delegate([](_class &device)->ioport_value { return (device._member() & 1) ? ~ioport_value(0) : 0; } , #_class "::" #_member, _device, (_class *)nullptr));
// output device handler
+#define PORT_WRITE_LINE_MEMBER(_class, _member) \
+ configurer.field_set_dynamic_write(ioport_field_write_delegate([](_class &device, ioport_field &field, u32 param, ioport_value oldval, ioport_value newval) { device._member(newval); }, #_class "::" #_member, DEVICE_SELF, (_class *)nullptr));
#define PORT_WRITE_LINE_DEVICE_MEMBER(_device, _class, _member) \
configurer.field_set_dynamic_write(ioport_field_write_delegate([](_class &device, ioport_field &field, u32 param, ioport_value oldval, ioport_value newval) { device._member(newval); }, #_class "::" #_member, _device, (_class *)nullptr));
diff --git a/src/lib/util/bitmap.cpp b/src/lib/util/bitmap.cpp
index a0a1e92f4d9..87cf8a27b76 100644
--- a/src/lib/util/bitmap.cpp
+++ b/src/lib/util/bitmap.cpp
@@ -41,6 +41,42 @@ inline void bitmap_t::compute_base(int xslop, int yslop)
}
+//-------------------------------------------------
+// valid_format - return true if the bitmap format
+// is valid and agrees with the BPP
+//-------------------------------------------------
+
+inline bool bitmap_t::valid_format() const
+{
+ switch (m_format)
+ {
+ // invalid format
+ case BITMAP_FORMAT_INVALID:
+ return false;
+
+ // 8bpp formats
+ case BITMAP_FORMAT_IND8:
+ return m_bpp == 8;
+
+ // 16bpp formats
+ case BITMAP_FORMAT_IND16:
+ case BITMAP_FORMAT_YUY16:
+ return m_bpp == 16;
+
+ // 32bpp formats
+ case BITMAP_FORMAT_IND32:
+ case BITMAP_FORMAT_RGB32:
+ case BITMAP_FORMAT_ARGB32:
+ return m_bpp == 32;
+
+ // 64bpp formats
+ case BITMAP_FORMAT_IND64:
+ return m_bpp == 64;
+ }
+
+ return false;
+}
+
//**************************************************************************
// BITMAP ALLOCATION/CONFIGURATION
@@ -84,6 +120,8 @@ bitmap_t::bitmap_t(bitmap_format format, uint8_t bpp, int width, int height, int
, m_bpp(bpp)
, m_palette(nullptr)
{
+ assert(valid_format());
+
// allocate intializes all other fields
allocate(width, height, xslop, yslop);
}
@@ -113,6 +151,7 @@ bitmap_t::bitmap_t(bitmap_format format, uint8_t bpp, void *base, int width, int
, m_palette(nullptr)
, m_cliprect(0, width - 1, 0, height - 1)
{
+ assert(valid_format());
}
/**
diff --git a/src/lib/util/bitmap.h b/src/lib/util/bitmap.h
index efb18f7e456..ed6a5382a61 100644
--- a/src/lib/util/bitmap.h
+++ b/src/lib/util/bitmap.h
@@ -31,8 +31,7 @@ enum bitmap_format
BITMAP_FORMAT_IND64, // 64bpp indexed
BITMAP_FORMAT_RGB32, // 32bpp 8-8-8 RGB
BITMAP_FORMAT_ARGB32, // 32bpp 8-8-8-8 ARGB
- BITMAP_FORMAT_YUY16, // 16bpp 8-8 Y/Cb, Y/Cr in sequence
- BITMAP_FORMAT_LAST
+ BITMAP_FORMAT_YUY16 // 16bpp 8-8 Y/Cb, Y/Cr in sequence
};
@@ -161,8 +160,8 @@ public:
}
// pixel access
- template<typename _PixelType>
- _PixelType &pixt(int32_t y, int32_t x = 0) const { return *(reinterpret_cast<_PixelType *>(m_base) + y * m_rowpixels + x); }
+ template<typename PixelType>
+ PixelType &pixt(int32_t y, int32_t x = 0) const { return *(reinterpret_cast<PixelType *>(m_base) + y * m_rowpixels + x); }
void *raw_pixptr(int32_t y, int32_t x = 0) const { return reinterpret_cast<uint8_t *>(m_base) + (y * m_rowpixels + x) * m_bpp / 8; }
protected:
@@ -174,6 +173,7 @@ private:
// internal helpers
int32_t compute_rowpixels(int width, int xslop);
void compute_base(int xslop, int yslop);
+ bool valid_format() const;
// internal state
std::unique_ptr<uint8_t []> m_alloc; // pointer to allocated pixel memory
@@ -189,111 +189,47 @@ private:
};
-// ======================> bitmap8_t, bitmap16_t, bitmap32_t, bitmap64_t
+// ======================> bitmap_specific, bitmap8_t, bitmap16_t, bitmap32_t, bitmap64_t
-// 8bpp bitmaps
-class bitmap8_t : public bitmap_t
+template<typename PixelType>
+class bitmap_specific : public bitmap_t
{
-private:
- // private helpers
- bool valid_format(bitmap_format format) const { return (format == BITMAP_FORMAT_IND8); }
+ static constexpr int PixelBits = 8 * sizeof(PixelType);
protected:
// construction/destruction -- subclasses only
- bitmap8_t(bitmap8_t &&) = default;
- bitmap8_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 8, width, height, xslop, yslop) { }
- bitmap8_t(bitmap_format format, uint8_t *base, int width, int height, int rowpixels) : bitmap_t(format, 8, base, width, height, rowpixels) { assert(valid_format(format)); }
- bitmap8_t(bitmap_format format, bitmap8_t &source, const rectangle &subrect) : bitmap_t(format, 8, source, subrect) { }
+ bitmap_specific(bitmap_specific<PixelType> &&) = default;
+ bitmap_specific(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, PixelBits, width, height, xslop, yslop) { }
+ bitmap_specific(bitmap_format format, PixelType *base, int width, int height, int rowpixels) : bitmap_t(format, PixelBits, base, width, height, rowpixels) { }
+ bitmap_specific(bitmap_format format, bitmap_specific<PixelType> &source, const rectangle &subrect) : bitmap_t(format, PixelBits, source, subrect) { }
- bitmap8_t &operator=(bitmap8_t &&) = default;
+ bitmap_specific<PixelType> &operator=(bitmap_specific<PixelType> &&) = default;
public:
- // getters
- uint8_t bpp() const { return 8; }
-
- // pixel accessors
- typedef uint8_t pixel_t;
- pixel_t &pix(int32_t y, int32_t x = 0) const { return pixt<pixel_t>(y, x); }
- pixel_t &pix8(int32_t y, int32_t x = 0) const { return pixt<pixel_t>(y, x); }
-};
+ using pixel_t = PixelType;
-// 16bpp bitmaps
-class bitmap16_t : public bitmap_t
-{
-private:
- // private helpers
- bool valid_format(bitmap_format format) const { return (format == BITMAP_FORMAT_IND16 || format == BITMAP_FORMAT_YUY16); }
-
-protected:
- // construction/destruction -- subclasses only
- bitmap16_t(bitmap16_t &&) = default;
- bitmap16_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 16, width, height, xslop, yslop) { assert(valid_format(format)); }
- bitmap16_t(bitmap_format format, uint16_t *base, int width, int height, int rowpixels) : bitmap_t(format, 16, base, width, height, rowpixels) { assert(valid_format(format)); }
- bitmap16_t(bitmap_format format, bitmap16_t &source, const rectangle &subrect) : bitmap_t(format, 16, source, subrect) { }
-
- bitmap16_t &operator=(bitmap16_t &&) = default;
-
-public:
// getters
- uint8_t bpp() const { return 16; }
+ uint8_t bpp() const { return PixelBits; }
// pixel accessors
- typedef uint16_t pixel_t;
- pixel_t &pix(int32_t y, int32_t x = 0) const { return pixt<pixel_t>(y, x); }
- pixel_t &pix16(int32_t y, int32_t x = 0) const { return pixt<pixel_t>(y, x); }
+ PixelType &pix(int32_t y, int32_t x = 0) const { return pixt<PixelType>(y, x); }
+ PixelType &pix8(int32_t y, int32_t x = 0) const { static_assert(PixelBits == 8, "must be 8bpp"); return pixt<PixelType>(y, x); }
+ PixelType &pix16(int32_t y, int32_t x = 0) const { static_assert(PixelBits == 16, "must be 16bpp"); return pixt<PixelType>(y, x); }
+ PixelType &pix32(int32_t y, int32_t x = 0) const { static_assert(PixelBits == 32, "must be 32bpp"); return pixt<PixelType>(y, x); }
+ PixelType &pix64(int32_t y, int32_t x = 0) const { static_assert(PixelBits == 64, "must be 64bpp"); return pixt<PixelType>(y, x); }
};
-// 32bpp bitmaps
-class bitmap32_t : public bitmap_t
-{
-private:
- // private helpers
- bool valid_format(bitmap_format format) const { return (format == BITMAP_FORMAT_IND32 || format == BITMAP_FORMAT_RGB32 || format == BITMAP_FORMAT_ARGB32); }
-
-protected:
- // construction/destruction -- subclasses only
- bitmap32_t(bitmap32_t &&) = default;
- bitmap32_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 32, width, height, xslop, yslop) { assert(valid_format(format)); }
- bitmap32_t(bitmap_format format, uint32_t *base, int width, int height, int rowpixels) : bitmap_t(format, 32, base, width, height, rowpixels) { assert(valid_format(format)); }
- bitmap32_t(bitmap_format format, bitmap32_t &source, const rectangle &subrect) : bitmap_t(format, 32, source, subrect) { }
-
- bitmap32_t &operator=(bitmap32_t &&) = default;
+// 8bpp bitmaps
+using bitmap8_t = bitmap_specific<uint8_t>;
-public:
- // getters
- uint8_t bpp() const { return 32; }
+// 16bpp bitmaps
+using bitmap16_t = bitmap_specific<uint16_t>;
- // pixel accessors
- typedef uint32_t pixel_t;
- pixel_t &pix(int32_t y, int32_t x = 0) const { return pixt<pixel_t>(y, x); }
- pixel_t &pix32(int32_t y, int32_t x = 0) const { return pixt<pixel_t>(y, x); }
-};
+// 32bpp bitmaps
+using bitmap32_t = bitmap_specific<uint32_t>;
// 64bpp bitmaps
-class bitmap64_t : public bitmap_t
-{
-private:
- // private helpers
- bool valid_format(bitmap_format format) const { return (format == BITMAP_FORMAT_IND64); }
-
-protected:
- // construction/destruction -- subclasses only
- bitmap64_t(bitmap64_t &&) = default;
- bitmap64_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 64, width, height, xslop, yslop) { assert(valid_format(format)); }
- bitmap64_t(bitmap_format format, uint64_t *base, int width, int height, int rowpixels) : bitmap_t(format, 64, base, width, height, rowpixels) { assert(valid_format(format)); }
- bitmap64_t(bitmap_format format, bitmap64_t &source, const rectangle &subrect) : bitmap_t(format, 64, source, subrect) { }
-
- bitmap64_t &operator=(bitmap64_t &&) = default;
-
-public:
- // getters
- uint8_t bpp() const { return 64; }
-
- // pixel accessors
- typedef uint64_t pixel_t;
- pixel_t &pix(int32_t y, int32_t x = 0) const { return pixt<pixel_t>(y, x); }
- pixel_t &pix64(int32_t y, int32_t x = 0) const { return pixt<pixel_t>(y, x); }
-};
+using bitmap64_t = bitmap_specific<uint64_t>;
// ======================> bitmap_ind8, bitmap_ind16, bitmap_ind32, bitmap_ind64
diff --git a/src/mame/audio/gottlieb.cpp b/src/mame/audio/gottlieb.cpp
index 222b2e1ed08..cbab96454e2 100644
--- a/src/mame/audio/gottlieb.cpp
+++ b/src/mame/audio/gottlieb.cpp
@@ -647,7 +647,7 @@ INPUT_PORTS_START( gottlieb_sound_r2 )
PORT_DIPNAME( 0x40, 0x40, "Sound Test" ) PORT_DIPLOCATION("SB2:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gottlieb_sound_r2_device, speech_drq_custom_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(gottlieb_sound_r2_device, speech_drq_custom_r)
INPUT_PORTS_END
diff --git a/src/mame/audio/snk6502.cpp b/src/mame/audio/snk6502.cpp
index 94e647db077..ef691cce2c1 100644
--- a/src/mame/audio/snk6502.cpp
+++ b/src/mame/audio/snk6502.cpp
@@ -319,9 +319,9 @@ void snk6502_sound_device::set_music_clock(double clock_time)
m_tone_clock = 0;
}
-CUSTOM_INPUT_MEMBER(snk6502_sound_device::music0_playing)
+READ_LINE_MEMBER(snk6502_sound_device::music0_playing)
{
- return m_tone_channels[0].mute ? 0x01 : 0x00;
+ return m_tone_channels[0].mute ? 1 : 0;
}
void snk6502_sound_device::set_channel_base(int channel, int base, int mask)
diff --git a/src/mame/audio/snk6502.h b/src/mame/audio/snk6502.h
index 354fca29081..244e6218b19 100644
--- a/src/mame/audio/snk6502.h
+++ b/src/mame/audio/snk6502.h
@@ -19,7 +19,7 @@ class snk6502_sound_device : public device_t, public device_sound_interface
public:
snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_CUSTOM_INPUT_MEMBER(music0_playing);
+ DECLARE_READ_LINE_MEMBER(music0_playing);
void set_music_freq(int freq);
void set_music_clock(double clock_time);
diff --git a/src/mame/drivers/8080bw.cpp b/src/mame/drivers/8080bw.cpp
index dd0cd620792..1758ad9115e 100644
--- a/src/mame/drivers/8080bw.cpp
+++ b/src/mame/drivers/8080bw.cpp
@@ -245,7 +245,7 @@ static INPUT_PORTS_START( sicv )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in1_control_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in1_control_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("IN2")
@@ -260,7 +260,7 @@ static INPUT_PORTS_START( sicv )
PORT_DIPSETTING( 0x00, "1500" )
/* SW1:5,6,7: In OFF, PL2 can have no control of joystick, going auto left/right and other problems like no laser gun.
Be sure these are always ON */
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in2_control_r, nullptr) PORT_DIPLOCATION("SW1:5,6,7") /* Labeled as "FACTORY" */
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in2_control_r) PORT_DIPLOCATION("SW1:5,6,7") // Labeled as "FACTORY"
PORT_DIPNAME( 0x80, 0x00, "Coin Info" ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -318,7 +318,7 @@ static INPUT_PORTS_START( alieninv )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in1_control_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in1_control_r)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN2")
@@ -330,7 +330,7 @@ static INPUT_PORTS_START( alieninv )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_DIPLOCATION("SW1:3") /* Pence Coin */
PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:4" ) /* Not bonus */
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in2_control_r, nullptr) PORT_DIPLOCATION("SW1:5,6,7")
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in2_control_r) PORT_DIPLOCATION("SW1:5,6,7")
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x00, "2C/1C 50p/3C (+ Bonus Life)" )
PORT_DIPSETTING( 0x80, "1C/1C 50p/5C" )
@@ -1722,7 +1722,7 @@ void _8080bw_state::crashrd(machine_config &config)
/* */
/*******************************************************/
-CUSTOM_INPUT_MEMBER(_8080bw_state::sflush_80_r)
+READ_LINE_MEMBER(_8080bw_state::sflush_80_r)
{
return (m_screen->vpos() & 0x80) ? 1 : 0;
}
@@ -1775,7 +1775,7 @@ static INPUT_PORTS_START( sflush )
PORT_DIPNAME( 0x40, 0x00, "Coinage Display" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, _8080bw_state,sflush_80_r, nullptr) // 128V?
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(_8080bw_state, sflush_80_r) // 128V?
PORT_START("PADDLE")
PORT_BIT( 0xff, 0x6a, IPT_PADDLE ) PORT_MINMAX(0x16,0xbf) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_CENTERDELTA(0)
@@ -2249,7 +2249,7 @@ static INPUT_PORTS_START( yosakdon )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in1_control_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in1_control_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN1")
@@ -2264,7 +2264,7 @@ static INPUT_PORTS_START( yosakdon )
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in2_control_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in2_control_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
/* Dummy controls port, P1 */
@@ -3173,7 +3173,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(_8080bw_state::claybust_gun_callback)
m_claybust_gun_pos = 0;
}
-CUSTOM_INPUT_MEMBER(_8080bw_state::claybust_gun_on_r)
+READ_LINE_MEMBER(_8080bw_state::claybust_gun_on_r)
{
return (m_claybust_gun_pos != 0) ? 1 : 0;
}
@@ -3231,7 +3231,7 @@ void _8080bw_state::claybust_io_map(address_map &map)
static INPUT_PORTS_START( claybust )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, _8080bw_state, claybust_gun_on_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(_8080bw_state, claybust_gun_on_r)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_IMPULSE(2) PORT_CHANGED_MEMBER(DEVICE_SELF, _8080bw_state, claybust_gun_trigger, 0)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
@@ -3323,7 +3323,7 @@ static INPUT_PORTS_START( galactic )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in1_control_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in1_control_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("IN2")
@@ -3338,7 +3338,7 @@ static INPUT_PORTS_START( galactic )
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x08, "6" )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in2_control_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in2_control_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
/* Dummy controls port, P1 */
@@ -3446,17 +3446,17 @@ static INPUT_PORTS_START( invmulti )
/* same as Midway Space Invaders, except that SW is unused */
PORT_START("IN0")
PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW:8" )
- PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_sw6_sw7_r, nullptr)
+ PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_sw6_sw7_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in0_control_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_sw5_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in0_control_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_sw5_r)
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_coin_input_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_coin_input_r)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in1_control_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in1_control_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN2")
@@ -3464,7 +3464,7 @@ static INPUT_PORTS_START( invmulti )
PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW:4" )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW:2" )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in2_control_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in2_control_r)
PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW:1" )
/* fake port for reading the coin input */
diff --git a/src/mame/drivers/acefruit.cpp b/src/mame/drivers/acefruit.cpp
index c3ebc08de7b..96d9c1219ef 100644
--- a/src/mame/drivers/acefruit.cpp
+++ b/src/mame/drivers/acefruit.cpp
@@ -43,9 +43,9 @@ public:
void init_sidewndr();
- DECLARE_CUSTOM_INPUT_MEMBER(sidewndr_payout_r);
- DECLARE_CUSTOM_INPUT_MEMBER(starspnr_coinage_r);
- DECLARE_CUSTOM_INPUT_MEMBER(starspnr_payout_r);
+ template <int Mask> DECLARE_READ_LINE_MEMBER(sidewndr_payout_r);
+ template <int Mask> DECLARE_READ_LINE_MEMBER(starspnr_coinage_r);
+ template <int Mask> DECLARE_READ_LINE_MEMBER(starspnr_payout_r);
protected:
enum
@@ -229,56 +229,53 @@ uint32_t acefruit_state::screen_update_acefruit(screen_device &screen, bitmap_in
return 0;
}
-CUSTOM_INPUT_MEMBER(acefruit_state::sidewndr_payout_r)
+template <int Mask>
+READ_LINE_MEMBER(acefruit_state::sidewndr_payout_r)
{
- int bit_mask = (uintptr_t)param;
-
- switch (bit_mask)
+ switch (Mask)
{
case 0x01:
- return ((m_port_payout->read() & bit_mask) >> 0);
+ return ((m_port_payout->read() & Mask) >> 0);
case 0x02:
- return ((m_port_payout->read() & bit_mask) >> 1);
+ return ((m_port_payout->read() & Mask) >> 1);
default:
- logerror("sidewndr_payout_r : invalid %02X bit_mask\n",bit_mask);
+ logerror("sidewndr_payout_r : invalid %02X bit_mask\n",Mask);
return 0;
}
}
-CUSTOM_INPUT_MEMBER(acefruit_state::starspnr_coinage_r)
+template <int Mask>
+READ_LINE_MEMBER(acefruit_state::starspnr_coinage_r)
{
- int bit_mask = (uintptr_t)param;
-
- switch (bit_mask)
+ switch (Mask)
{
case 0x01:
- return ((m_port_coinage->read() & bit_mask) >> 0);
+ return ((m_port_coinage->read() & Mask) >> 0);
case 0x02:
- return ((m_port_coinage->read() & bit_mask) >> 1);
+ return ((m_port_coinage->read() & Mask) >> 1);
case 0x04:
- return ((m_port_coinage->read() & bit_mask) >> 2);
+ return ((m_port_coinage->read() & Mask) >> 2);
case 0x08:
- return ((m_port_coinage->read() & bit_mask) >> 3);
+ return ((m_port_coinage->read() & Mask) >> 3);
default:
- logerror("starspnr_coinage_r : invalid %02X bit_mask\n",bit_mask);
+ logerror("starspnr_coinage_r : invalid %02X bit_mask\n",Mask);
return 0;
}
}
-CUSTOM_INPUT_MEMBER(acefruit_state::starspnr_payout_r)
+template <int Mask>
+READ_LINE_MEMBER(acefruit_state::starspnr_payout_r)
{
- int bit_mask = (uintptr_t)param;
-
- switch (bit_mask)
+ switch (Mask)
{
case 0x01:
- return ((m_port_payout->read() & bit_mask) >> 0);
+ return ((m_port_payout->read() & Mask) >> 0);
case 0x02:
- return ((m_port_payout->read() & bit_mask) >> 1);
+ return ((m_port_payout->read() & Mask) >> 1);
case 0x04:
- return ((m_port_payout->read() & bit_mask) >> 2);
+ return ((m_port_payout->read() & Mask) >> 2);
default:
- logerror("starspnr_payout_r : invalid %02X bit_mask\n",bit_mask);
+ logerror("starspnr_payout_r : invalid %02X bit_mask\n",Mask);
return 0;
}
}
@@ -383,14 +380,14 @@ static INPUT_PORTS_START( sidewndr )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME( "Cancel/Clear" )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME( "Refill" ) PORT_TOGGLE
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) /* "Token in" - also "Refill" when "Refill" mode ON */
- PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,sidewndr_payout_r, (void *)0x01)
+ PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, sidewndr_payout_r<0x01>)
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN3") // 3
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME( "Hold/Nudge 1" )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME( "Accountancy System" ) PORT_TOGGLE
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 ) /* "50P in" */
- PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,sidewndr_payout_r, (void *)0x02)
+ PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, sidewndr_payout_r<0x02>)
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN4") // 4
@@ -497,7 +494,7 @@ static INPUT_PORTS_START( starspnr )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Collect/Cancel" )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
/* tested at 0xeed7 with IN1 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_coinage_r, (void *)0x08) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x08>) /* to be confirmed */
PORT_START("IN2") // 2
/* tested at 0xe83c */
@@ -507,7 +504,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xef82 after IN5 bit 1 and after IN1 bit 3 - after coins are tested - table at 0xefa8 (3 bytes) */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0xeeba with IN3 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_coinage_r, (void *)0x02) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x02>) /* to be confirmed */
/* tested at 0x1b0f */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -516,7 +513,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xe8ea and 0xecbe */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0xeeba with IN2 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_coinage_r, (void *)0x01) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x01>) /* to be confirmed */
/* tested at 0x0178 */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -527,7 +524,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xed86 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0xeed7 with IN1 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_coinage_r, (void *)0x04) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_coinage_r<0x04>) /* to be confirmed */
PORT_START("IN5") // 5
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME( "Hold 3" )
@@ -536,7 +533,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xec6f */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0x1d60 with IN6 bit 3 and IN7 bit 3 - table at 0x1d90 (8 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_payout_r, (void *)0x01) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_payout_r<0x01>) /* to be confirmed */
/* tested at 0xe312 and 0xe377 */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -545,7 +542,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xee42, 0xee5e and 0xeff5 before IN1 bit 0 - invalid code after 0xf000 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0x1d60 with IN5 bit 3 and IN7 bit 3 - table at 0x1d90 (8 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_payout_r, (void *)0x02) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_payout_r<0x02>) /* to be confirmed */
/* tested at 0xe8dd and 0xec1c */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -557,7 +554,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xedcb */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0x1d60 with IN5 bit 3 and IN6 bit 3 - table at 0x1d90 (8 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_payout_r, (void *)0x04) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_CUSTOM) PORT_READ_LINE_MEMBER(acefruit_state, starspnr_payout_r<0x04>) /* to be confirmed */
/* tested at 0xec2a */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/aci_ggm.cpp b/src/mame/drivers/aci_ggm.cpp
index 5814963e2c8..1c740817b8d 100644
--- a/src/mame/drivers/aci_ggm.cpp
+++ b/src/mame/drivers/aci_ggm.cpp
@@ -411,7 +411,7 @@ static INPUT_PORTS_START( ggm )
PORT_CONFSETTING( 0x03, "Steinitz" )
PORT_START("IN.6")
- PORT_BIT(0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, ggm_state, overlay_r, nullptr)
+ PORT_BIT(0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(ggm_state, overlay_r)
INPUT_PORTS_END
diff --git a/src/mame/drivers/alg.cpp b/src/mame/drivers/alg.cpp
index 2cb251611c7..352fda8a519 100644
--- a/src/mame/drivers/alg.cpp
+++ b/src/mame/drivers/alg.cpp
@@ -48,8 +48,8 @@ public:
{ }
DECLARE_CUSTOM_INPUT_MEMBER(lightgun_pos_r);
- DECLARE_CUSTOM_INPUT_MEMBER(lightgun_trigger_r);
- DECLARE_CUSTOM_INPUT_MEMBER(lightgun_holster_r);
+ DECLARE_READ_LINE_MEMBER(lightgun_trigger_r);
+ DECLARE_READ_LINE_MEMBER(lightgun_holster_r);
void init_aplatoon();
void init_palr3();
@@ -155,14 +155,14 @@ CUSTOM_INPUT_MEMBER(alg_state::lightgun_pos_r)
}
-CUSTOM_INPUT_MEMBER(alg_state::lightgun_trigger_r)
+READ_LINE_MEMBER(alg_state::lightgun_trigger_r)
{
/* read the trigger control based on the input select */
return (m_triggers->read() >> m_input_select) & 1;
}
-CUSTOM_INPUT_MEMBER(alg_state::lightgun_holster_r)
+READ_LINE_MEMBER(alg_state::lightgun_holster_r)
{
/* read the holster control based on the input select */
return (m_triggers->read() >> (2 + m_input_select)) & 1;
@@ -230,11 +230,11 @@ void alg_state::main_map_picmatic(address_map &map)
static INPUT_PORTS_START( alg )
PORT_START("joy_0_dat") /* read by Amiga core */
- PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,amiga_joystick_convert, (void *)0)
+ PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(alg_state, amiga_joystick_convert<0>)
PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("joy_1_dat") /* read by Amiga core */
- PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,amiga_joystick_convert, (void *)1)
+ PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(alg_state, amiga_joystick_convert<1>)
PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("potgo") /* read by Amiga core */
@@ -245,7 +245,7 @@ static INPUT_PORTS_START( alg )
PORT_BIT( 0xaaff, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("HVPOS") /* read by Amiga core */
- PORT_BIT( 0x1ffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,lightgun_pos_r, nullptr)
+ PORT_BIT( 0x1ffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(alg_state, lightgun_pos_r)
PORT_START("FIRE")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
@@ -276,13 +276,13 @@ static INPUT_PORTS_START( alg_2p )
PORT_MODIFY("potgo")
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,lightgun_trigger_r, nullptr)
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(alg_state, lightgun_trigger_r)
PORT_MODIFY("FIRE")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("p2_joy")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,lightgun_holster_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(alg_state, lightgun_holster_r)
PORT_START("GUN2X") /* referenced by lightgun_pos_r */
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(2)
diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp
index d19165cd21c..ec51d490bc1 100644
--- a/src/mame/drivers/amiga.cpp
+++ b/src/mame/drivers/amiga.cpp
@@ -552,7 +552,7 @@ public:
u16 handle_joystick_potgor(u16 potgor);
DECLARE_CUSTOM_INPUT_MEMBER( cd32_input );
- DECLARE_CUSTOM_INPUT_MEMBER( cd32_sel_mirror_input );
+ template <int P> DECLARE_READ_LINE_MEMBER( cd32_sel_mirror_input );
void init_pal();
void init_ntsc();
@@ -1146,9 +1146,10 @@ CUSTOM_INPUT_MEMBER( cd32_state::cd32_input )
return handle_joystick_potgor(m_potgo_value) >> 8;
}
-CUSTOM_INPUT_MEMBER( cd32_state::cd32_sel_mirror_input )
+template <int P>
+READ_LINE_MEMBER( cd32_state::cd32_sel_mirror_input )
{
- u8 bits = m_player_ports[(int)(uintptr_t)param]->read();
+ u8 bits = m_player_ports[P]->read();
return (bits & 0x20)>>5;
}
@@ -1459,6 +1460,22 @@ void a4000_state::a4000t_mem(address_map &map)
// INPUTS
//**************************************************************************
+template <int P>
+CUSTOM_INPUT_MEMBER( amiga_state::amiga_joystick_convert )
+{
+ uint8_t bits = m_joy_ports[P].read_safe(0xff);
+
+ int up = (bits >> 0) & 1;
+ int down = (bits >> 1) & 1;
+ int left = (bits >> 2) & 1;
+ int right = (bits >> 3) & 1;
+
+ if (left) up ^= 1;
+ if (right) down ^= 1;
+
+ return down | (right << 1) | (up << 8) | (left << 9);
+}
+
static INPUT_PORTS_START( amiga )
PORT_START("input")
PORT_CONFNAME(0x10, 0x00, "Game Port 0 Device")
@@ -1469,16 +1486,16 @@ static INPUT_PORTS_START( amiga )
PORT_CONFSETTING(0x20, DEF_STR(Joystick) )
PORT_START("cia_0_port_a")
- PORT_BIT(0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state, floppy_drive_status, (void *)0)
+ PORT_BIT(0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(amiga_state, floppy_drive_status)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(1)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2)
PORT_START("joy_0_dat")
- PORT_BIT(0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state, amiga_joystick_convert, (void *)0)
+ PORT_BIT(0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(amiga_state, amiga_joystick_convert<0>)
PORT_BIT(0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_START("joy_1_dat")
- PORT_BIT(0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state, amiga_joystick_convert, (void *)1)
+ PORT_BIT(0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(amiga_state, amiga_joystick_convert<1>)
PORT_BIT(0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_START("potgo")
@@ -1519,19 +1536,19 @@ INPUT_PORTS_START( cd32 )
PORT_MODIFY("cia_0_port_a")
PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_CUSTOM )
// this is the regular port for reading a single button joystick on the Amiga, many CD32 games require this to mirror the pad start button!
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cd32_state, cd32_sel_mirror_input, (void *)0)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cd32_state, cd32_sel_mirror_input, (void *)1)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cd32_state, cd32_sel_mirror_input<0>)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cd32_state, cd32_sel_mirror_input<1>)
PORT_MODIFY("joy_0_dat")
- PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state, amiga_joystick_convert, (void *)0)
+ PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(amiga_state, amiga_joystick_convert<0>)
PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_MODIFY("joy_1_dat")
- PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state, amiga_joystick_convert, (void *)1)
+ PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(amiga_state, amiga_joystick_convert<1>)
PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_MODIFY("potgo")
- PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cd32_state, cd32_input, (void *)0)
+ PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(cd32_state, cd32_input)
PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
// CD32 '11' button pad (4 dpad directions + 7 buttons), not read directly
diff --git a/src/mame/drivers/aristmk5.cpp b/src/mame/drivers/aristmk5.cpp
index d0c3761394f..95aec608b5b 100644
--- a/src/mame/drivers/aristmk5.cpp
+++ b/src/mame/drivers/aristmk5.cpp
@@ -704,7 +704,7 @@ public:
INPUT_CHANGED_MEMBER(coin_start);
CUSTOM_INPUT_MEMBER(coin_r);
CUSTOM_INPUT_MEMBER(coin_usa_r);
- CUSTOM_INPUT_MEMBER(hopper_r);
+ DECLARE_READ_LINE_MEMBER(hopper_r);
private:
DECLARE_WRITE32_MEMBER(Ns5w48);
@@ -1213,7 +1213,7 @@ void aristmk5_state::aristmk5_drame_map(address_map &map)
}
-CUSTOM_INPUT_MEMBER(aristmk5_state::hopper_r)
+READ_LINE_MEMBER(aristmk5_state::hopper_r)
{
return (m_hopper_test && m_hopper->line_r()) ? 0 : 1;
}
@@ -1388,7 +1388,7 @@ static INPUT_PORTS_START( aristmk5_usa )
PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_GAMBLE_DOOR) PORT_CODE(KEYCODE_C) PORT_TOGGLE PORT_NAME("Cashbox door")
PORT_START("P4")
- PORT_BIT(0x00000078, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, aristmk5_state, coin_usa_r, nullptr)
+ PORT_BIT(0x00000078, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(aristmk5_state, coin_usa_r)
PORT_START("P5")
PORT_BIT(0x00000008, IP_ACTIVE_LOW, IPT_OTHER) // Meters
@@ -1442,8 +1442,8 @@ static INPUT_PORTS_START( aristmk5 )
PORT_BIT(0x00c00000, IP_ACTIVE_HIGH, IPT_UNUSED) // Unused mechanical security switch
PORT_START("P3")
- PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CUSTOM_MEMBER(DEVICE_SELF, aristmk5_state, hopper_r, nullptr)
- PORT_BIT(0x000000f8, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, aristmk5_state, coin_r, nullptr)
+ PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_READ_LINE_MEMBER(aristmk5_state, hopper_r)
+ PORT_BIT(0x000000f8, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(aristmk5_state, coin_r)
PORT_START("P6")
PORT_BIT(0x00000002, IP_ACTIVE_LOW, IPT_OTHER) // Battery
diff --git a/src/mame/drivers/arkanoid.cpp b/src/mame/drivers/arkanoid.cpp
index 55b284416a7..83bf0c53aa5 100644
--- a/src/mame/drivers/arkanoid.cpp
+++ b/src/mame/drivers/arkanoid.cpp
@@ -1010,7 +1010,7 @@ static INPUT_PORTS_START( arkanoid )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arkanoid_state, arkanoid_semaphore_input_r, nullptr) // Z80 and MCU Semaphores
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(arkanoid_state, arkanoid_semaphore_input_r) // Z80 and MCU Semaphores
PORT_START("SYSTEM2") // these are the secondary "RH" joystick ports for P1 and P2; the circuitry to read them is populated on the arkanoid PCB, but the game never actually reads these.
/*PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP )
diff --git a/src/mame/drivers/arsystems.cpp b/src/mame/drivers/arsystems.cpp
index c4d09ecfc49..3dc38a177c9 100644
--- a/src/mame/drivers/arsystems.cpp
+++ b/src/mame/drivers/arsystems.cpp
@@ -89,7 +89,7 @@ public:
void init_argh();
DECLARE_WRITE16_MEMBER(arcadia_multibios_change_game);
- DECLARE_CUSTOM_INPUT_MEMBER(coin_counter_r);
+ template <int Coin> DECLARE_CUSTOM_INPUT_MEMBER(coin_counter_r);
DECLARE_INPUT_CHANGED_MEMBER(coin_changed_callback);
DECLARE_WRITE8_MEMBER(arcadia_cia_0_portb_w);
@@ -162,12 +162,11 @@ WRITE8_MEMBER(arcadia_amiga_state::arcadia_cia_0_portb_w)
*
*************************************/
+template <int Coin>
CUSTOM_INPUT_MEMBER(arcadia_amiga_state::coin_counter_r)
{
- int coin = (uintptr_t)param;
-
/* return coin counter values */
- return m_coin_counter[coin] & 3;
+ return m_coin_counter[Coin] & 3;
}
@@ -257,15 +256,15 @@ static INPUT_PORTS_START( arcadia )
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arcadia_amiga_state,coin_counter_r, (void *)0)
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arcadia_amiga_state,coin_counter_r, (void *)1)
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(arcadia_amiga_state, coin_counter_r<0>)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(arcadia_amiga_state, coin_counter_r<1>)
PORT_START("joy_0_dat")
- PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arcadia_amiga_state,amiga_joystick_convert, (void *)0)
+ PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(arcadia_amiga_state, amiga_joystick_convert<0>)
PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("joy_1_dat")
- PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arcadia_amiga_state,amiga_joystick_convert, (void *)1)
+ PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(arcadia_amiga_state, amiga_joystick_convert<1>)
PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("potgo")
diff --git a/src/mame/drivers/artmagic.cpp b/src/mame/drivers/artmagic.cpp
index 79548718334..3189eb3d0f0 100644
--- a/src/mame/drivers/artmagic.cpp
+++ b/src/mame/drivers/artmagic.cpp
@@ -371,7 +371,7 @@ void artmagic_state::stonebal_protection()
}
-CUSTOM_INPUT_MEMBER(artmagic_state::prot_r)
+READ_LINE_MEMBER(artmagic_state::prot_r)
{
return m_prot_output_bit;
}
@@ -599,8 +599,8 @@ static INPUT_PORTS_START( cheesech )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("30000a")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, artmagic_state,prot_r, nullptr) /* protection data */
- PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* protection ready */
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(artmagic_state, prot_r) // protection data
+ PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_CUSTOM ) // protection ready
PORT_BIT( 0x00fc, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -791,8 +791,8 @@ static INPUT_PORTS_START( shtstar )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("3c000a")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, artmagic_state,prot_r, nullptr) /* protection data */
- PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* protection ready */
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(artmagic_state, prot_r) // protection data
+ PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_CUSTOM ) // protection ready
PORT_BIT( 0x00fc, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
diff --git a/src/mame/drivers/asteroid.cpp b/src/mame/drivers/asteroid.cpp
index 1a59ce4c4ca..1e18d8b4eba 100644
--- a/src/mame/drivers/asteroid.cpp
+++ b/src/mame/drivers/asteroid.cpp
@@ -389,7 +389,7 @@ void asteroid_state::llander_map(address_map &map)
*
*************************************/
-CUSTOM_INPUT_MEMBER(asteroid_state::clock_r)
+READ_LINE_MEMBER(asteroid_state::clock_r)
{
return (m_maincpu->total_cycles() & 0x100) ? 1 : 0;
}
@@ -398,8 +398,8 @@ static INPUT_PORTS_START( asteroid )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
/* Bit 2 is the 3 KHz source and Bit 3 the VG_HALT bit */
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, asteroid_state,clock_r, nullptr)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("dvg", dvg_device, done_r, nullptr)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(asteroid_state, clock_r)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dvg", dvg_device, done_r)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_CODE(KEYCODE_SPACE) PORT_CODE(JOYCODE_BUTTON3) /* hyperspace */
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1) /* fire */
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Diagnostic Step")
@@ -458,7 +458,7 @@ static INPUT_PORTS_START( asteroidb )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* Bit 7 is VG_HALT */
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("dvg", dvg_device, done_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dvg", dvg_device, done_r)
PORT_MODIFY("IN1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
@@ -495,9 +495,9 @@ static INPUT_PORTS_START( asterock )
PORT_MODIFY("IN0")
/* Bit 0 is VG_HALT and Bit 2 is the 3 KHz source */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("dvg", dvg_device, done_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dvg", dvg_device, done_r)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, asteroid_state,clock_r, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(asteroid_state, clock_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_SPACE) PORT_CODE(JOYCODE_BUTTON3) /* hyperspace */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1) /* fire */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diagnostic Step")
@@ -537,8 +537,8 @@ static INPUT_PORTS_START( astdelux )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* According to schematics */
/* Bit 2 is the 3 KHz source and Bit 3 the VG_HALT bit */
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, asteroid_state,clock_r, nullptr)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("dvg", dvg_device, done_r, nullptr)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(asteroid_state, clock_r)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dvg", dvg_device, done_r)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_CODE(KEYCODE_SPACE) PORT_CODE(JOYCODE_BUTTON3) /* hyperspace */
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1) /* fire */
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Diagnostic Step")
@@ -625,12 +625,12 @@ INPUT_PORTS_END
static INPUT_PORTS_START( llander )
PORT_START("IN0")
/* Bit 0 is VG_HALT */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("dvg", dvg_device, done_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dvg", dvg_device, done_r)
PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
/* Of the rest, Bit 6 is the 3KHz source. 3,4 and 5 are unknown */
PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, asteroid_state,clock_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(asteroid_state, clock_r)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diagnostic Step")
PORT_START("IN1")
diff --git a/src/mame/drivers/astrocde.cpp b/src/mame/drivers/astrocde.cpp
index ad983c5553e..ece42b777cf 100644
--- a/src/mame/drivers/astrocde.cpp
+++ b/src/mame/drivers/astrocde.cpp
@@ -404,7 +404,7 @@ WRITE8_MEMBER(astrocde_state::votrax_speech_w)
}
-CUSTOM_INPUT_MEMBER( astrocde_state::votrax_speech_status_r )
+READ_LINE_MEMBER( astrocde_state::votrax_speech_status_r )
{
return m_votrax->request();
}
@@ -723,7 +723,7 @@ static INPUT_PORTS_START( ebases )
PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "S1:8" )
PORT_START("P4HANDLE")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ebases_state, trackball_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(ebases_state, trackball_r)
PORT_START("TRACKX1")
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_RESET
@@ -838,7 +838,7 @@ static INPUT_PORTS_START( wow )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrocde_state, votrax_speech_status_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(astrocde_state, votrax_speech_status_r)
PORT_START("P4HANDLE")
/* "If S1:1,2,3 are all ON or all OFF, only coin meter number 1 will count." */
@@ -908,7 +908,7 @@ static INPUT_PORTS_START( gorf )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrocde_state, votrax_speech_status_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(astrocde_state, votrax_speech_status_r)
PORT_START("P4HANDLE")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("S1:1")
@@ -1055,7 +1055,7 @@ static INPUT_PORTS_START( demndrgn )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("P2HANDLE")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, demndrgn_state, joystick_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(demndrgn_state, joystick_r)
PORT_START("P3HANDLE")
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
diff --git a/src/mame/drivers/astrof.cpp b/src/mame/drivers/astrof.cpp
index 7864d161b7c..2556459885d 100644
--- a/src/mame/drivers/astrof.cpp
+++ b/src/mame/drivers/astrof.cpp
@@ -624,8 +624,8 @@ static INPUT_PORTS_START( astrof )
PORT_START("IN")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrof_state,astrof_p1_controls_r, nullptr)
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrof_state,astrof_p2_controls_r, nullptr)
+ PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(astrof_state, astrof_p1_controls_r)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(astrof_state, astrof_p2_controls_r)
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
@@ -679,8 +679,8 @@ static INPUT_PORTS_START( abattle )
PORT_START("IN")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
- PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrof_state,astrof_p1_controls_r, nullptr)
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrof_state,astrof_p2_controls_r, nullptr)
+ PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(astrof_state, astrof_p1_controls_r)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(astrof_state, astrof_p2_controls_r)
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
@@ -734,8 +734,8 @@ static INPUT_PORTS_START( spfghmk2 )
PORT_START("IN")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrof_state,astrof_p1_controls_r, nullptr)
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrof_state,astrof_p2_controls_r, nullptr)
+ PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(astrof_state, astrof_p1_controls_r)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(astrof_state, astrof_p2_controls_r)
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
@@ -785,8 +785,8 @@ static INPUT_PORTS_START( spfghmk22 )
PORT_START("IN")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrof_state,astrof_p1_controls_r, nullptr)
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrof_state,astrof_p2_controls_r, nullptr)
+ PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(astrof_state, astrof_p1_controls_r)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(astrof_state, astrof_p2_controls_r)
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
@@ -839,7 +839,7 @@ static INPUT_PORTS_START( tomahawk )
PORT_INCLUDE( astrof_common )
PORT_START("IN")
- PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrof_state,tomahawk_controls_r, nullptr)
+ PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(astrof_state, tomahawk_controls_r)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/at.cpp b/src/mame/drivers/at.cpp
index 84c25dc8fd9..78efdf3e29c 100644
--- a/src/mame/drivers/at.cpp
+++ b/src/mame/drivers/at.cpp
@@ -899,7 +899,7 @@ ROM_START( ibm5170 )
ROMX_LOAD( "6181028.u27", 0x10000, 0x8000, CRC(f6573f2a) SHA1(3e52cfa6a6a62b4e8576f4fe076c858c220e6c1a), ROM_SKIP(1) | ROM_BIOS(0)) /* T 6181028 8506AAA // TMM23256P-5878 // (C)IBM CORP 1981,-1984 */
ROMX_LOAD( "6181029.u47", 0x10001, 0x8000, CRC(7075fbb2) SHA1(a7b885cfd38710c9bc509da1e3ba9b543a2760be), ROM_SKIP(1) | ROM_BIOS(0)) /* T 6181029 8506AAA // TMM23256P-5879 // (C)IBM CORP 1981,-1984 */
- ROM_SYSTEM_BIOS( 1, "rev2", "IBM PC/AT 5170 06/10/85") /* Another verifaction of these crcs would be nice */
+ ROM_SYSTEM_BIOS( 1, "rev2", "IBM PC/AT 5170 06/10/85") /* Another verification of these crcs would be nice */
ROMX_LOAD( "6480090.u27", 0x10000, 0x8000, CRC(99703aa9) SHA1(18022e93a0412c8477e58f8c61a87718a0b9ab0e), ROM_SKIP(1) | ROM_BIOS(1))
ROMX_LOAD( "6480091.u47", 0x10001, 0x8000, CRC(013ef44b) SHA1(bfa15d2180a1902cb6d38c6eed3740f5617afd16), ROM_SKIP(1) | ROM_BIOS(1))
@@ -1492,26 +1492,28 @@ ROM_START( at )
ROM_SYSTEM_BIOS(24, "ami_ft", "AMI Flying Triumph") /* (BIOS release date:: 12-06-1986) */
ROMX_LOAD( "286_access_methods_rom2_32k.bin", 0x10000, 0x8000, CRC(749c65af) SHA1(7c6e9e217afe020b7b36785549fdbfb89de8f872), ROM_SKIP(1) | ROM_BIOS(24) )
ROMX_LOAD( "286_access_methods_rom4_32k.bin", 0x10001, 0x8000, CRC(0f15581a) SHA1(2a22635f30388ca371f0f1f31652cfa647bb322d), ROM_SKIP(1) | ROM_BIOS(24) )
- // 25: 286 board with Headland GC101A-PC; GC102-PC chipset and Phoenix BIOS 2493119, ISA8: 2, ISA16: 5
- ROM_SYSTEM_BIOS(25, "head_ph_1", "Headland/Phoenix #1") // Phoenix 80286 ROM BIOS PLUS Version 3.10.21 ((BIOS release date:: 15-01-1988)
- ROMX_LOAD( "286-headland-lo_32k.bin", 0x10000, 0x8000, CRC(21b68bed) SHA1(1e4acda50b12ad463c169ba615805f5dcf257b18), ROM_SKIP(1) | ROM_BIOS(25) )
- ROMX_LOAD( "286-headland-hi_32k.bin", 0x10001, 0x8000, CRC(04c8ab12) SHA1(b46c14528aca15464e4050b423c2f621a4313a85), ROM_SKIP(1) | ROM_BIOS(25) )
- // 26: MS-0010-2 - Phoenix ROM BIOS Version 3.06
- ROM_SYSTEM_BIOS(26, "ms-0010-2", "MS-0010-2") /* (BIOS release date:: 19-01-1987) (ISA8: 3, ISA16: 5) */
- ROMX_LOAD( "286-ms0010-2-lo_32k.bin", 0x10000, 0x8000, CRC(2c381474) SHA1(94b9825d412ea39d67857102a0375852b349fcd6), ROM_SKIP(1) | ROM_BIOS(26) )
- ROMX_LOAD( "286-ms0010-2-hi_32k.bin", 0x10001, 0x8000, CRC(4fdb8c64) SHA1(c2e7f88f0ac97ee5eed0c97864b7f1810e99ea26), ROM_SKIP(1) | ROM_BIOS(26) )
- // 27: CMP enterprise CO.LTD. Phoenix 80286 ROM BIOS Version 3.00
- ROM_SYSTEM_BIOS(27, "cmpa286", "CMP A286") /* (Chipset Acer (ALi) M1207-12) (BIOS release date:: 01-09-1986) (ISA8: 2, ISA16: 6) */
- ROMX_LOAD( "286-a286-even_16k.bin", 0x18000, 0x4000, CRC(30809487) SHA1(413de43ca7e1930cdf3c006718d8baf743a9ff1e), ROM_SKIP(1) | ROM_BIOS(27) )
- ROMX_LOAD( "286-a286-odd_16k.bin", 0x18001, 0x4000, CRC(3a11aacf) SHA1(23185531ae10912b974048d3607b563e55d3fa96), ROM_SKIP(1) | ROM_BIOS(27) )
- // 28: AL-6410 (found online, no markings on the board itself), Chipset: Chips P82A204, P82A203, P82A205, P82C201, P82C202
- ROM_SYSTEM_BIOS(28, "al6410", "AL-6410") /* (BIOS-String: D286-1103-110387-K0) (BIOS release date:: 03-11-1987) (ISA8: 2, ISA16: 6) */
- ROMX_LOAD( "al-6410_ami_bios_low.bin", 0x10000, 0x8000, CRC(50c4e121) SHA1(5f9c27aabdc6bb810e90bced2053b7c21c4994dd), ROM_SKIP(1) | ROM_BIOS(28) )
- ROMX_LOAD( "al-6410_ami_bios_high.bin", 0x10001, 0x8000, CRC(a44be083) SHA1(99f73d7ceb315eb3770c94d90228f8859cadc610), ROM_SKIP(1) | ROM_BIOS(28) )
- // 29: AT SYSTEM 6M/8M/10M - Chipset: Chips P82A205; P82C201; P82A203; P82A204
- ROM_SYSTEM_BIOS(29, "at6m8m10m", "AT SYSTEM 6M/8M/10M") /* (BIOS release date:: 04-02-1987) */
- ROMX_LOAD( "286-at system 6m8m10m-l_32k.bin", 0x10000, 0x8000, CRC(37e0e1c1) SHA1(f5cd17658554a73bb86c5c8e630dac3e34b38e51), ROM_SKIP(1) | ROM_BIOS(29) )
- ROMX_LOAD( "286-at system 6m8m10m-r_32k.bin", 0x10001, 0x8000, CRC(c672efff) SHA1(7224bb6b4d25ef34bc0aa9d7c450baf9b47fd917), ROM_SKIP(1) | ROM_BIOS(29) )
+ // 25: MS-0010-2 - Phoenix ROM BIOS Version 3.06
+ ROM_SYSTEM_BIOS(25, "ms-0010-2", "MS-0010-2") /* (BIOS release date:: 19-01-1987) (ISA8: 3, ISA16: 5) */
+ ROMX_LOAD( "286-ms0010-2-lo_32k.bin", 0x10000, 0x8000, CRC(2c381474) SHA1(94b9825d412ea39d67857102a0375852b349fcd6), ROM_SKIP(1) | ROM_BIOS(25) )
+ ROMX_LOAD( "286-ms0010-2-hi_32k.bin", 0x10001, 0x8000, CRC(4fdb8c64) SHA1(c2e7f88f0ac97ee5eed0c97864b7f1810e99ea26), ROM_SKIP(1) | ROM_BIOS(25) )
+ // ***** Motherboards using the original Chips CS8220 chipset: P82C202, P82C201, P82A203, P82A204, P82A205
+ // 26: AL-6410 (found online, no markings on the board itself), Chipset: Chips P82A204, P82A203, P82A205, P82C201, P82C202
+ ROM_SYSTEM_BIOS(26, "al6410", "AL-6410") /* (BIOS-String: D286-1103-110387-K0) (BIOS release date:: 03-11-1987) (ISA8: 2, ISA16: 6) */
+ ROMX_LOAD( "al-6410_ami_bios_low.bin", 0x10000, 0x8000, CRC(50c4e121) SHA1(5f9c27aabdc6bb810e90bced2053b7c21c4994dd), ROM_SKIP(1) | ROM_BIOS(26) )
+ ROMX_LOAD( "al-6410_ami_bios_high.bin", 0x10001, 0x8000, CRC(a44be083) SHA1(99f73d7ceb315eb3770c94d90228f8859cadc610), ROM_SKIP(1) | ROM_BIOS(14) )
+ // 27: AT SYSTEM 6M/8M/10M - Chipset: Chips P82A205; P82C201; P82A203; P82A204 - ISA8:2, ISA16: 6
+ ROM_SYSTEM_BIOS(27, "at6m8m10m", "AT SYSTEM 6M/8M/10M") // (BIOS release date:: 04-02-1987) - OSC: 20.000000MHz - MQ-14.3 - 12.000
+ ROMX_LOAD( "286-at system 6m8m10m-l_32k.bin", 0x10000, 0x8000, CRC(37e0e1c1) SHA1(f5cd17658554a73bb86c5c8e630dac3e34b38e51), ROM_SKIP(1) | ROM_BIOS(27) )
+ ROMX_LOAD( "286-at system 6m8m10m-r_32k.bin", 0x10001, 0x8000, CRC(c672efff) SHA1(7224bb6b4d25ef34bc0aa9d7c450baf9b47fd917), ROM_SKIP(1) | ROM_BIOS(27) )
+ // 28: CDTEK - BIOS-String: DSUN-1202-042088-K0 286-BIOS AMI for CDTEK - ISA8:2, ISA16:6 - Chipset ICs plus SN76LS612N, RTC MC146818P
+ ROM_SYSTEM_BIOS(28, "cdtekchips", "CDTEK 286") // ISA8:2, ISA16: 6 - OSC: 12.000, 14.31818, 16000.00KHz
+ ROMX_LOAD( "286-cdtek2-even_32k.bin", 0x10000, 0x8000, CRC(94867e8d) SHA1(12e61cc8b875b57324c93276c9f6093f2bd0e277), ROM_SKIP(1) | ROM_BIOS(28) )
+ ROMX_LOAD( "286-cdtek2-odd_32k.bin", 0x10001, 0x8000, CRC(153ed3bd) SHA1(10b711e0f0d79e0b6d181f24fe66544d2d72a310), ROM_SKIP(1) | ROM_BIOS(28) )
+ // 29: This board looks identical to #2 but has different chips fitted: SN76LS612N = Zymos HCT612, Chips P82A204 = TACT80204FN, P82A203 = STK-5134, P82A205 = STK-5135,
+ // P82C201 = STK-5132, P82C202 = STK-5133 - BIOS-String: Phoenix 80286 ROM BIOS Version 3.06
+ ROM_SYSTEM_BIOS(29, "286tact", "286 TACT") // OSC: 20.0000MHz, 14.31818 - 24.000MHz
+ ROMX_LOAD( "286-tact-320548-1_32k.bin", 0x10000, 0x8000, CRC(0b528d19) SHA1(15f5a94d89461655c0f74681bbae5745db009ac2), ROM_SKIP(1) | ROM_BIOS(29) )
+ ROMX_LOAD( "286-tact-320548-2_32k.bin", 0x10001, 0x8000, CRC(418aa2d0) SHA1(b6af0b8aa595d8f8de6c0fc851bf1c226dcc7ca7), ROM_SKIP(1) | ROM_BIOS(29) )
ROM_END
ROM_START( atvga )
@@ -1567,6 +1569,23 @@ ROM_START( atvga )
ROM_SYSTEM_BIOS(13, "bravo", "AST Bravo/286") // fails with keyboard controller test, probably expects specific kbdc rom
ROMX_LOAD( "107000-704.bin", 0x10000, 0x8000, CRC(94faf87e) SHA1(abaafa6c2ae9b9fba95b244dcbcc1c752ac6c0a0),ROM_SKIP(1) | ROM_BIOS(13) )
ROMX_LOAD( "107000-705.bin", 0x10001, 0x8000, CRC(e1263c1e) SHA1(b564f1043ef45ecbdf4f06bb500150ad992c2931),ROM_SKIP(1) | ROM_BIOS(13) )
+ // ***** Motherboards using the original Chips CS8220 chipset: P82C202, P82C201, P82A203, P82A204, P82A205
+ // 14: same as BIOS '26' in VGA
+ ROM_SYSTEM_BIOS(14, "al6410", "AL-6410")
+ ROMX_LOAD( "al-6410_ami_bios_low.bin", 0x10000, 0x8000, CRC(50c4e121) SHA1(5f9c27aabdc6bb810e90bced2053b7c21c4994dd), ROM_SKIP(1) | ROM_BIOS(14) )
+ ROMX_LOAD( "al-6410_ami_bios_high.bin", 0x10001, 0x8000, CRC(a44be083) SHA1(99f73d7ceb315eb3770c94d90228f8859cadc610), ROM_SKIP(1) | ROM_BIOS(14) )
+ // 15: same as BIOS '27' in VGA
+ ROM_SYSTEM_BIOS(15, "at6m8m10m", "AT SYSTEM 6M/8M/10M")
+ ROMX_LOAD( "286-at system 6m8m10m-l_32k.bin", 0x10000, 0x8000, CRC(37e0e1c1) SHA1(f5cd17658554a73bb86c5c8e630dac3e34b38e51), ROM_SKIP(1) | ROM_BIOS(15) )
+ ROMX_LOAD( "286-at system 6m8m10m-r_32k.bin", 0x10001, 0x8000, CRC(c672efff) SHA1(7224bb6b4d25ef34bc0aa9d7c450baf9b47fd917), ROM_SKIP(1) | ROM_BIOS(15) )
+ // 16: same as BIOS '28' in VGA
+ ROM_SYSTEM_BIOS(16, "cdtekchips", "CDTEK 286")
+ ROMX_LOAD( "286-cdtek2-even_32k.bin", 0x10000, 0x8000, CRC(94867e8d) SHA1(12e61cc8b875b57324c93276c9f6093f2bd0e277), ROM_SKIP(1) | ROM_BIOS(16) )
+ ROMX_LOAD( "286-cdtek2-odd_32k.bin", 0x10001, 0x8000, CRC(153ed3bd) SHA1(10b711e0f0d79e0b6d181f24fe66544d2d72a310), ROM_SKIP(1) | ROM_BIOS(16) )
+ // 17: same as BIOS '29' in VGA
+ ROM_SYSTEM_BIOS(17, "286tact", "286 TACT")
+ ROMX_LOAD( "286-tact-320548-1_32k.bin", 0x10000, 0x8000, CRC(0b528d19) SHA1(15f5a94d89461655c0f74681bbae5745db009ac2), ROM_SKIP(1) | ROM_BIOS(17) )
+ ROMX_LOAD( "286-tact-320548-2_32k.bin", 0x10001, 0x8000, CRC(418aa2d0) SHA1(b6af0b8aa595d8f8de6c0fc851bf1c226dcc7ca7), ROM_SKIP(1) | ROM_BIOS(17) )
ROM_END
// Chips & Technologies CS8221 NEAT chipset: P82C211 + P82C212 + P82C215 + P82C206
@@ -1588,6 +1607,18 @@ ROM_START( neat )
ROM_SYSTEM_BIOS(3, "ptm1233c", "DTK PTM-1233C")
ROMX_LOAD( "286-dtk ptm-1233c-low_32k.bin", 0x10000, 0x8000, CRC(8909164c) SHA1(51978929a690746c1956ca6b1f0412777dc5d35b), ROM_SKIP(1) | ROM_BIOS(3) )
ROMX_LOAD( "286-dtk ptm-1233c-high_32k.bin", 0x10001, 0x8000, CRC(9105968c) SHA1(737d4df8040655315a648fed8a8d574f39e7dc35), ROM_SKIP(1) | ROM_BIOS(3) )
+ // 4: 286-NEAT - BIOS-String: ENET-1131-040990-K0 - NEAT V3.2 6-18-90 - ISA8: 3, ISA16: 5
+ ROM_SYSTEM_BIOS(4, "286neat", "286-NEAT")
+ ROMX_LOAD( "286-neat_neat012-l-verify.bin", 0x10000, 0x8000, CRC(591d226c) SHA1(7f42797ead8213022192bb2bbbe2de7f6796ac6f), ROM_SKIP(1) | ROM_BIOS(4) )
+ ROMX_LOAD( "286-neat_neat012-h-verify.bin", 0x10001, 0x8000, CRC(0198e2e4) SHA1(10ced383b6dc00c2e98b7bed0782f59a9c266625), ROM_SKIP(1) | ROM_BIOS(4) )
+ // 5: AUVA VIP BAM/16-11 - BIOS-String: Phoenix 80286 ROM BIOS PLUS Version 3.10 20 - ISA8:1, ISA16: 5, Memory Slot: 1
+ ROM_SYSTEM_BIOS(5, "bam1611", "VIP BAM/16-11") // OSC: 18.432 - 14.318 - 32.000MHz
+ ROMX_LOAD( "286-vip bam-6-11 m215100-lo_32k.bin", 0x10000, 0x8000, CRC(b51b8bc1) SHA1(a7ebbced98aca32a7f0cdf80d1b832dfeb92d5e7), ROM_SKIP(1) | ROM_BIOS(5) )
+ ROMX_LOAD( "286-vip bam-6-11 m215100-hi_32k.bin", 0x10001, 0x8000, CRC(46ddd5a6) SHA1(fd4267af298c7f70e062a7c4e023caf852bbf082), ROM_SKIP(1) | ROM_BIOS(5) )
+ // 6: CP-805 - BIOS-String: ENET-1138-030390-K0
+ ROM_SYSTEM_BIOS(6, "cp805", "CP-805")
+ ROMX_LOAD( "286-chips ami78384 even.bin", 0x10000, 0x8000, CRC(5280fee0) SHA1(25051ad6bbccddc0738861b614dbafbca5c3bff5), ROM_SKIP(1) | ROM_BIOS(6) )
+ ROMX_LOAD( "286-chips ami78384 odd.bin", 0x10001, 0x8000, CRC(24526bf3) SHA1(8f8b46fe2e708fa53d0eeb44a16924cd878bdd33), ROM_SKIP(1) | ROM_BIOS(6) )
ROM_END
@@ -1595,6 +1626,14 @@ ROM_END
// 80286 motherboard
//**************************************************************************
+// Olivetti M203 motherboard - complains about "Timer Sync Error"
+// on board Paradise PVGA1A VGA chip - Chipset: 2 TACT chips, one VLSI chip - one 16bit ISA "slot" in pin strip form intended for an expansion module
+ROM_START( olim203 )
+ ROM_REGION(0x20000, "bios", 0)
+ ROMX_LOAD( "286-olivetti-m203-low.bin", 0x00000, 0x10000, CRC(d683dc20) SHA1(04271529139724d7a091490658b186b59a83676f), ROM_SKIP(1) )
+ ROMX_LOAD( "286-olivetti-m203-high.bin", 0x00001, 0x10000, CRC(c7324ecf) SHA1(fa5ee92c21e54ec711d01b211760521a71ef424d), ROM_SKIP(1) )
+ROM_END
+
// Snobol Mini 286 - BIOS-String: DGS2-1402-101090-K0
// Chipset: GST GOLD GS62C101 and GS62C102
ROM_START( snomi286 )
@@ -1621,16 +1660,6 @@ ROM_START( sarcpc )
ROM_LOAD( "sarcrev12.bin", 0x10000, 0x10000, CRC(1c5e3f2d) SHA1(1fcc8b1b9d9383467223dd41e420f9352beca654) )
ROM_END
-// Toptek 286 Turbo (board name somewhat uncertain; 5x 8-bit ISA, 3x 16-bit ISA, 2 banks of onboard RAM + 2 banks expansion RAM)
-// VLSI VL82C100 + VL82C101B + VL82C102A + VL82C103A + VL82C104; MC146818 or HM6818P RTC; unidentified keyboard controller
-ROM_START( toptek286 )
- ROM_REGION(0x20000, "bios", 0)
- // BIOS-String: D286-1295-091589-K0
- // Original BIOS64 dump split into even and odd bytes based on available PCB info
- ROM_LOAD16_BYTE( "toptek_vlsi_even.bin", 0x10000, 0x8000, CRC(f35465e8) SHA1(c85afc2168e355120c63b68d5c11fce7770fe1b7) )
- ROM_LOAD16_BYTE( "toptek_vlsi_odd.bin", 0x10001, 0x8000, CRC(b7272729) SHA1(686c976b9b7989862846a79d00f1f9116f03bc17) )
-ROM_END
-
// Everex EV-1806 (6 16-bit ISA, 1 8-bit ISA)
// Everex IC-00121-0 + IC-00122-0; CHIPS P82C206; Intel 8272A(?); 146818A RTC
ROM_START( ev1806 )
@@ -1652,30 +1681,12 @@ ROM_START( ev1815 )
ROMX_LOAD( "award_v3.03gs_ev1815_odd.bin", 0x10001, 0x8000, CRC(5bcd9421) SHA1(f32e5a39da593c6982f964fb05b0802d54c3de45), ROM_SKIP(1) | ROM_BIOS(1) )
ROM_END
-// KT216WB5-HI Rev.2 (1 8-bit ISA, 5 16-bit ISA)
-// Winbond W83C201P + W83C202AP + W83C203AP + W83C204P + W83C205AP; MC146818AP RTC; JETkey keyboard BIOS
-ROM_START( kt216wb5 )
- ROM_REGION(0x20000, "bios", 0)
- // BIOS-String: D286-1149-083090-K0 - WIN 286 BIOS
- ROMX_LOAD( "kt216wb5_even.bin", 0x10000, 0x8000, CRC(6b5509c0) SHA1(73b303b90cc0cd23b7e13362019193c938a2e502), ROM_SKIP(1) )
- ROMX_LOAD( "kt216wb5_odd.bin", 0x10001, 0x8000, CRC(af541ada) SHA1(26d2617dbe8c15f1b0d4782375bcb291a7923703), ROM_SKIP(1) )
-ROM_END
-
-// LM-103S (1 8-bit ISA, 6 16-bit ISA, 4 memory slots)
-// Headland Technology G2 chipset: HT101A + 2x HT102; HM6818P RTC; AMI keyboard BIOS
-ROM_START( lm103s )
- ROM_REGION(0x20000, "bios", 0)
- // BIOS-String: D286-1234-121589-K0
- ROMX_LOAD( "ami_lm103-s_lo.bin", 0x10000, 0x8000, CRC(a24be20b) SHA1(ffc5faf6d773154bf2f037556d2e381e81a28a58), ROM_SKIP(1) )
- ROMX_LOAD( "ami_lm103-s_hi.bin", 0x10001, 0x8000, CRC(7b63e60c) SHA1(da78b95b12051b6d4701a412fdc5e7874595c188), ROM_SKIP(1) )
-ROM_END
-
// MAT286 REV.D (5 16-bit ISA, 1 8-bit ISA, 2 memory slots)
// Headland Technology HT12P-16/A; HM6818P RTC; JETkey keyboard BIOS; unmarked 40-pin DIP
ROM_START( mat286 )
ROM_REGION(0x20000, "bios", 0)
- // BIOS-String: DH12-1112-061390-K0 - HT-12 286 BIOS
+ // BIOS-String: DH12-1112-061390-K0 - HT-12 286 BIOS - Board is also used in Polish Optimus 286 computer with a special Hercules character ROM (also available)
// Files separated from single BIOS64 dump (PCB photo shows split ROMs are used)
ROMX_LOAD( "9221fkf_imp23256_ami-l.bin", 0x10000, 0x08000, CRC(55deb5c2) SHA1(19ce1a7cc985b5895c585e39211475de2e3b0dd1), ROM_SKIP(1) )
ROMX_LOAD( "9221gjf_imp23256_ami-h.bin", 0x10001, 0x08000, CRC(04a2cec4) SHA1(564d37a8b2c0f4d0e23cd1e280a09d47c9945da8), ROM_SKIP(1) )
@@ -1709,15 +1720,122 @@ ROM_START ( mkp286 )
ROMX_LOAD( "286-morse_kp286_hi.bin", 0x10001, 0x8000, CRC(a5f640e0) SHA1(7bbb7fce54079005cb691816d2301a3eda475a82), ROM_SKIP(1) )
ROM_END
-// Motherboards using the 5 chip VLSI chipset
-// MG Products (Japanese) - Chipset: VLSI VL82C102A; VLSI VL82C101B; VLSI VL82C104; VLSI VL82C103A; VLSI VL82C100; (VLSI 8908BT; 8906BT; 8852BT; 8907BT; 8906BT)
-// BIOS: AMI 286 BIOS+ - BIOS-String: D286-9987-092588-K0 - ISA8: 2, ISA16: 8
-// ROM_SYSTEM_BIOS(27, "286vlsij", "Japanese 286 VLSI") /* (BIOS release date:: 25-09-1988) (ISA8: 3, ISA16: 5) */
+// WYSEpc 286 - motherboard: WY-2200-01 - continuous ticks from the speaker
+ROM_START( wy220001 )
+ ROM_REGION(0x20000, "bios", 0)
+ ROMX_LOAD( "wyse_tech_rev.a_250325-02_27128-15.bin", 0x18000, 0x4000, CRC(010f1c4d) SHA1(712d6ca4e4bdbc6b105c8691d612407edcfd9cf7), ROM_SKIP(1))
+ ROMX_LOAD( "wyse_tech_rev.a_250326-02_27128-15.bin", 0x18001, 0x4000, CRC(37fcd62b) SHA1(ada0e232387c8ba7067168f50f8b7a89eb824c44), ROM_SKIP(1))
+ROM_END
+
+
+// ***** Motherboards using the Acer (ALi) M1207 chipset
+
+// CMP enterprise CO.LTD. Phoenix 80286 ROM BIOS Version 3.00
+// ROM_SYSTEM_BIOS(26, "cmpa286", "CMP A286") /* (Chipset Acer (ALi) M1207-12) (BIOS release date:: 01-09-1986) (ISA8: 2, ISA16: 6) */
+ROM_START ( cmpa286 )
+ ROM_REGION(0x20000, "bios", 0)
+ ROMX_LOAD( "286-a286-even_16k.bin", 0x18000, 0x4000, CRC(30809487) SHA1(413de43ca7e1930cdf3c006718d8baf743a9ff1e), ROM_SKIP(1) )
+ ROMX_LOAD( "286-a286-odd_16k.bin", 0x18001, 0x4000, CRC(3a11aacf) SHA1(23185531ae10912b974048d3607b563e55d3fa96), ROM_SKIP(1) )
+ROM_END
+
+// AUVA VIP-M21502A BAM16-A0 - BIOS-String: DAR2-1105-061390-K0 - 286-BIOS AMI for AUVA 286, 02/08/1991 - ISA8:2, ISA16:5
+ROM_START( bam16a0 )
+ ROM_REGION(0x20000, "bios", 0)
+ ROMX_LOAD( "286-vip-m21502a-lo_32k.bin", 0x10000, 0x8000, CRC(413692db) SHA1(54bf664526b137cabf974c1fc659493e76243a88), ROM_SKIP(1) )
+ ROMX_LOAD( "286-vip-m21502a-hi_32k.bin", 0x10001, 0x8000, CRC(5db9db04) SHA1(8085384b943454a708be3104b47f6793d0040ab1), ROM_SKIP(1) )
+ROM_END
+
+
+
+// ***** Motherboards using the Chips SCAT 82C235 chipset
+
+// Biostar MB-1212C - ISA8:2, ISA16:5
+ROM_START ( mb1212c )
+ // 0: BIOS-String: ESC2-1223-083090-K2 - 286 BIOS AMI for MB-1212C version 1.1
+ ROM_REGION(0x20000, "bios", 0)
+ ROM_SYSTEM_BIOS(0, "mb1212_1", "mb1212_1")
+ ROMX_LOAD( "biostar mb-1212c.bin", 0x10000, 0x10000, CRC(153a783a) SHA1(acad4a3ffe93d3884dcb743c32d6317a132cda7b), ROM_BIOS(0) )
+ // 1: CHIPS SCAT BIOS Version 125D - MB-1212C
+ ROM_SYSTEM_BIOS(1, "mb1212_2", "mb1212_2")
+ ROMX_LOAD( "mb-1212c.bin", 0x10000, 0x10000, CRC(4675530a) SHA1(c34b1c67ac29695e565363f484e17ab5f8ddaad5), ROM_BIOS(1) )
+ROM_END
+
+
+// ***** Motherboards using the Headland G2 chipset
+
+// LM-103S (1 8-bit ISA, 6 16-bit ISA, 4 memory slots)
+// Headland Technology G2 chipset: HT101A + 2x HT102; HM6818P RTC; AMI keyboard BIOS
+ROM_START( lm103s )
+ ROM_REGION(0x20000, "bios", 0)
+ // BIOS-String: D286-1234-121589-K0
+ ROMX_LOAD( "ami_lm103-s_lo.bin", 0x10000, 0x8000, CRC(a24be20b) SHA1(ffc5faf6d773154bf2f037556d2e381e81a28a58), ROM_SKIP(1) )
+ ROMX_LOAD( "ami_lm103-s_hi.bin", 0x10001, 0x8000, CRC(7b63e60c) SHA1(da78b95b12051b6d4701a412fdc5e7874595c188), ROM_SKIP(1) )
+ROM_END
+
+// CDTEK board with Headland G2 chipset - ISA8:1, ISA16:5
+ROM_START ( cdtekg2 ) // BIOS-String: D286-1435-040990-K0 - Board is used in Polish California Access 286 with a special Hercules character ROM (also available)
+ ROM_REGION(0x20000, "bios", 0)
+ ROMX_LOAD( "286_cdtek headland-l_32k.bin", 0x10000, 0x8000, CRC(341fe2a3) SHA1(f8e10aea477c2b3c92b28a7e0fd0adf8ade22b9e), ROM_SKIP(1) )
+ ROMX_LOAD( "286_cdtek headland-h_32k.bin", 0x10001, 0x8000, CRC(bd6fd54f) SHA1(72500ebe4041fbe635562bf55c5d3635257e38f1), ROM_SKIP(1) )
+ROM_END
+
+// Octek board with Headland G2 chipset - ISA8:2, ISA16:6
+//BIOS-String: 286 Modular BIOS Version 3.03 - O.O.A.L.
+ROM_START ( octekg2 ) // BIOS-String: D286-1435-040990-K0
+ ROM_REGION(0x20000, "bios", 0)
+ ROMX_LOAD( "286-octek-g2_u44_32k.bin", 0x10000, 0x8000, CRC(05892a08) SHA1(e12795524d87c422b0b5d660b36139592893e9c6), ROM_SKIP(1) )
+ ROMX_LOAD( "286-octek-g2_u45_32k.bin", 0x10001, 0x8000, CRC(2f81de14) SHA1(952d9e35a6f8ea74eb8b4bf7ea80d7c358474cb8), ROM_SKIP(1) )
+ROM_END
+
+
+ROM_START( headg2 )
+ ROM_REGION( 0x20000, "bios", 0)
+ // 0: 286 board with Headland GC101A-PC; GC102-PC chipset and Phoenix BIOS 2493119, ISA8: 2, ISA16: 5
+ ROM_SYSTEM_BIOS(0, "head_ph_1", "Headland/Phoenix #1") // Phoenix 80286 ROM BIOS PLUS Version 3.10.21 ((BIOS release date:: 15-01-1988)
+ ROMX_LOAD( "286-headland-lo_32k.bin", 0x10000, 0x8000, CRC(21b68bed) SHA1(1e4acda50b12ad463c169ba615805f5dcf257b18), ROM_SKIP(1) | ROM_BIOS(0) )
+ ROMX_LOAD( "286-headland-hi_32k.bin", 0x10001, 0x8000, CRC(04c8ab12) SHA1(b46c14528aca15464e4050b423c2f621a4313a85), ROM_SKIP(1) | ROM_BIOS(0) )
+ // 1: BIOS-String: 286 Modular BIOS Version 3.03HL - ISA16: 5
+ ROM_SYSTEM_BIOS(1, "head4530", "Headland 4530")
+ ROMX_LOAD( "286-headland 4530-high_32k.bin", 0x10001, 0x8000, CRC(f84c0e75) SHA1(42dc068d1cd5105cd576b023e2ccfe0f0646d4e3), ROM_SKIP(1) | ROM_BIOS(1) )
+ ROMX_LOAD( "286-headland 4530-low_32k.bin", 0x10000, 0x8000, CRC(0856dde8) SHA1(cee5d6002c405df984f3c7fa83c4f3e034f1e586), ROM_SKIP(1) | ROM_BIOS(1) )
+ROM_END
+
+
+// ***** Motherboards using the 5 chip Winbond chipset W83C201P + W83C202AP + W83C203AP + W83C204P + W83C205AP
+
+// KT216WB5-HI Rev.2 (1 8-bit ISA, 5 16-bit ISA)
+// Winbond W83C201P + W83C202AP + W83C203AP + W83C204P + W83C205AP; MC146818AP RTC; JETkey keyboard BIOS
+ROM_START( kt216wb5 )
+ ROM_REGION(0x20000, "bios", 0)
+ // BIOS-String: D286-1149-083090-K0 - WIN 286 BIOS
+ ROMX_LOAD( "kt216wb5_even.bin", 0x10000, 0x8000, CRC(6b5509c0) SHA1(73b303b90cc0cd23b7e13362019193c938a2e502), ROM_SKIP(1) )
+ ROMX_LOAD( "kt216wb5_odd.bin", 0x10001, 0x8000, CRC(af541ada) SHA1(26d2617dbe8c15f1b0d4782375bcb291a7923703), ROM_SKIP(1) )
+ROM_END
+
+// KMA-202F-12R - ISA16:7 - BIOS-String: 286 Modular BIOS Version 3.11
+// Winbond W83C201P + W83C202AP + W83C203AP + W83C204P + W83C205AP; DS12887+ RTC; AWARD keyboard BIOS
+ROM_START( kma202f )
+ ROM_REGION(0x20000, "bios", 0)
+ ROMX_LOAD( "286_lo.bin", 0x10000, 0x8000, CRC(0ce69691) SHA1(6904ac54f30f2244058653aaa623804dd02b4332), ROM_SKIP(1) )
+ ROMX_LOAD( "286_hi.bin", 0x10001, 0x8000, CRC(1330b6f2) SHA1(691bb4a51ce3d9a026ee33c3fd02fc4e13b4a184), ROM_SKIP(1) )
+ROM_END
+
+
+// ***** Motherboards using the 5 chip VLSI chipset
+
ROM_START( vlsi5 )
ROM_REGION(0x20000, "bios", 0)
- ROMX_LOAD( "286-vlsi_japan-2-even_32k.bin", 0x10000, 0x8000, CRC(e3e64cbc) SHA1(5259e3c8686f2239a5fb0dc38aa80380ef9ec5fa), ROM_SKIP(1) )
- ROMX_LOAD( "286-vlsi_japan-2-odd_32k.bin", 0x10001, 0x8000, CRC(aa533f39) SHA1(d88c7d4029a283b94b99e2017d29fbf9eb9105b1), ROM_SKIP(1) )
+ // 0: MG Products (Japanese) - Chipset: VLSI VL82C102A; VLSI VL82C101B; VLSI VL82C104; VLSI VL82C103A; VLSI VL82C100; (VLSI 8908BT; 8906BT; 8852BT; 8907BT; 8906BT)
+ // BIOS: AMI 286 BIOS+ - BIOS-String: D286-9987-092588-K0 - ISA8: 2, ISA16: 8
+ // (BIOS release date:: 25-09-1988) (ISA8: 3, ISA16: 5)
+ ROM_SYSTEM_BIOS(0, "286vlsij", "Japanese 286 VLSI")
+ ROMX_LOAD( "286-vlsi_japan-2-even_32k.bin", 0x10000, 0x8000, CRC(e3e64cbc) SHA1(5259e3c8686f2239a5fb0dc38aa80380ef9ec5fa), ROM_SKIP(1) | ROM_BIOS(0) )
+ ROMX_LOAD( "286-vlsi_japan-2-odd_32k.bin", 0x10001, 0x8000, CRC(aa533f39) SHA1(d88c7d4029a283b94b99e2017d29fbf9eb9105b1), ROM_SKIP(1) | ROM_BIOS(0) )
+ // 1: BIOS-String: D286-1223-121589-K0 - 286-BIOS AMI for MBVLSI-168 - ISA8: 3, ISA16: 5
+ ROM_SYSTEM_BIOS(1, "mbvlsi168", "MBVLSI-168")
+ ROMX_LOAD( "286-vlsi-002350-041_32k.bin", 0x10000, 0x8000, CRC(0e0e2bc9) SHA1(0af05b15ea8141ece84fb4420e6a21720f01c7a6), ROM_SKIP(1) | ROM_BIOS(1) )
+ ROMX_LOAD( "286-vlsi-002350-042_32k.bin", 0x10001, 0x8000, CRC(5ef7b91d) SHA1(d57c7f4c8d28708f128c5f0b1251d5943c7cdf76), ROM_SKIP(1) | ROM_BIOS(1) )
ROM_END
// Uniron U3911-V3 - Chipset as above - BIOS-String: Phoenix 80286 ROM BIOS PLUS Version 3.10 00 - P/N 891012 - 80286
@@ -1727,6 +1845,16 @@ ROM_START( u3911v3 )
ROMX_LOAD( "286-uniron-u14_32k.bin", 0x10000, 0x8000, CRC(d2e9c52a) SHA1(ff6726b527b0bebed50c053a698e1b61aada3043), ROM_SKIP(1) )
ROM_END
+// Toptek 286 Turbo (board name somewhat uncertain; 5x 8-bit ISA, 3x 16-bit ISA, 2 banks of onboard RAM + 2 banks expansion RAM)
+// VLSI VL82C100 + VL82C101B + VL82C102A + VL82C103A + VL82C104; MC146818 or HM6818P RTC; unidentified keyboard controller
+ROM_START( toptek286 )
+ ROM_REGION(0x20000, "bios", 0)
+ // BIOS-String: D286-1295-091589-K0
+ // Original BIOS64 dump split into even and odd bytes based on available PCB info
+ ROM_LOAD16_BYTE( "toptek_vlsi_even.bin", 0x10000, 0x8000, CRC(f35465e8) SHA1(c85afc2168e355120c63b68d5c11fce7770fe1b7) )
+ ROM_LOAD16_BYTE( "toptek_vlsi_odd.bin", 0x10001, 0x8000, CRC(b7272729) SHA1(686c976b9b7989862846a79d00f1f9116f03bc17) )
+ROM_END
+
// ***** Motherboards using the 5 chip SUNTAC chipset
@@ -1773,16 +1901,21 @@ ROM_START( mba009)
ROM_END
-
// ***** Motherboards using the Headland HT12/A chipset
-// Octek Fox II - Chipset: Headland HT12/A - BIOS String:
-ROM_START( o286foxii)
+// Octek Fox II - Chipset: Headland HT12/A - BIOS String: DH1X-6069-113090-K0 - HT-1X 286 BIOS
+ROM_START( o286foxii )
ROM_REGION(0x20000, "bios", 0)
ROMX_LOAD( "286-fox2-even_32k.bin", 0x10000, 0x8000, CRC(54dc119f) SHA1(4bc543beef0d2201fa20eac90a0a6ca38ebf0dbf), ROM_SKIP(1))
ROMX_LOAD( "286-fox2-odd_32k.bin", 0x10001, 0x8000, CRC(e5db7775) SHA1(2bd0572b9f7c76eff51375b551586ca8484e2a74), ROM_SKIP(1))
ROM_END
+// BI-025C HT12 286 - Chipset: Headland HT12/A - BIOS-String: DH12-1103-061390-K0 - ISA8: 2, ISA16: 5
+ROM_START( bi025c )
+ ROM_REGION(0x20000, "bios", 0)
+ ROMX_LOAD( "bi-025c-ht12_even.bin", 0x10000, 0x8000, CRC(7ea7e088) SHA1(e245b3ecce39e85cacb17abf60d2cee000d1750d), ROM_SKIP(1))
+ ROMX_LOAD( "bi-025c-ht12_odd.bin", 0x10001, 0x8000, CRC(f18b3eef) SHA1(e14d4b3ea0234613e60512cf79e5580c9ce7f3f6), ROM_SKIP(1))
+ROM_END
ROM_START( ht12a )
ROM_REGION(0x20000, "bios", 0)
@@ -1922,6 +2055,7 @@ ROM_END
// 80286 Notebook/Laptop/Portable
//**************************************************************************
+
// Compaq Portable II
// Chips: Intel D8742, SN76LS612N, 2x NEC D8237AC-5, 2xIntel P8259A-2, MC146818AP, Intel P8254
// Enhanced Color Graphics board: Chips P82C431, P82C434A
@@ -1997,7 +2131,7 @@ ROM_START( at386sx )
// 1: BIOS-String: 30-0400-428027-00101111-070791-SCMPSX-0 / VLSI SCAMP 386SX 16/20/25MHz
ROM_SYSTEM_BIOS(1, "scamp", "VLSI SCAMPSX")
ROMX_LOAD( "ami_386sx_vlsi_scamp_070791.bin", 0x10000, 0x10000, CRC(082d071c) SHA1(69af9a951f138146036b3c9ac3761cc6589b6cf5), ROM_BIOS(1))
- // 2: NCR 386 CPU card
+ // 2: NCR 386 CPU card - Chipset: TACT82301PB, TACT82302PB, TACT82303PB
ROM_SYSTEM_BIOS(2, "ncr386sx", "NCR 386sx card") // Upgrade card for e.g. NCR PC-8 - Setup Version 2.7.1
ROMX_LOAD( "ncr_386sx_u12-19_7.3.bin", 0x10001, 0x8000, CRC(9e4c9a2a) SHA1(0a45d9f04f03b7ae39734916af7786bc52e5e917), ROM_SKIP(1) | ROM_BIOS(2))
ROMX_LOAD( "ncr_386sx_u46-17_7.3.bin", 0x10000, 0x8000, CRC(73ad83a2) SHA1(bf6704fb4a0da37251f192cea3af2bc8cc2e9cdb), ROM_SKIP(1) | ROM_BIOS(2))
@@ -2029,11 +2163,11 @@ ROM_START( at386 )
ROM_SYSTEM_BIOS(2, "amicg", "AMI CG")
ROMX_LOAD( "amicg.1", 0x10000, 0x10000,CRC(8408965a) SHA1(9893d3ac851e01b06a68a67d3721df36ca2c96f5), ROM_BIOS(2))
// 3:
- ROM_SYSTEM_BIOS(3, "msi386", "MSI 386") // MSI 386 mainboard, initializes graphics card, then hangs
+ ROM_SYSTEM_BIOS(3, "msi386", "MSI 386") // MSI 386 mainboard, initializes graphics card, then hangs - Chipset: Chips P82A304, P82A303, P82A302C, 2xP82B305, P82C301C, P82A306A,
ROMX_LOAD( "ami_386_msi_02297_even.bin", 0x10000, 0x8000, CRC(768590a0) SHA1(90c5203d78591a093fd4f54ceb8d9827f1e64f39), ROM_SKIP(1) | ROM_BIOS(3) )
ROMX_LOAD( "ami_386_msi_02297_odd.bin", 0x10001, 0x8000, CRC(7b1360dc) SHA1(552ccda9f90826621e88d9abdc47306b9c2b2b15), ROM_SKIP(1) | ROM_BIOS(3) )
// 4: BIOS-String: 20-0200-DF1121-00101111-102591-SYM_386B-0 / 386DX/SX (S1A.P)
- ROM_SYSTEM_BIOS(4, "386sc2c", "386-SC-2C")
+ ROM_SYSTEM_BIOS(4, "386sc2c", "386-SC-2C") // Chipset: SYMPHONY SL82C362, SL82C461, SL82C465
ROMX_LOAD("386-sc-2c_ami_za492668.bin", 0x10000, 0x10000, CRC(b408eeb7) SHA1(cf1974492119e1aae623fa366d5760343e827e52), ROM_BIOS(4) )
// 5: BIOS-String: EC&T-1332-040990-K0
ROM_SYSTEM_BIOS(5, "cs8230", "CS8230")
@@ -2043,14 +2177,14 @@ ROM_START( at386 )
ROMX_LOAD( "ami2939e.rom", 0x10000, 0x8000, CRC(65cbbd32) SHA1(d7d26b496f8e86f01722ad9f171a68f9fcdc477c), ROM_SKIP(1) | ROM_BIOS(6) )
ROMX_LOAD( "ami2939o.rom", 0x10001, 0x8000, CRC(8db6e739) SHA1(cdd47709d6036fad4be40c15bff41752d831d4b8), ROM_SKIP(1) | ROM_BIOS(6) )
// 7: NCR 386 slot CPU - Upgrade card for e.g. NCR PC-8 - set graphics card to CGA to see a "Timer One Error" message
- ROM_SYSTEM_BIOS(7, "ncr386", "NCR 386 CPU card")
+ ROM_SYSTEM_BIOS(7, "ncr386", "NCR 386 CPU card") // Chipset: SN76LS612PN, 2xAM9517A-5JC, NCR 006-3500402PT M472018 8650A
ROMX_LOAD( "ncr_386_card_04152_u44_ver5.0.bin", 0x10000, 0x10000, CRC(80e44318) SHA1(54e1d4d646a577c53c65b2292b383ed6d91b65b2), ROM_BIOS(7))
// ROM_LOAD ("ncr_386_card_keyboard_04181_u27_ver5.6.bin", 0x0000, 0x800, CRC(6c9004e7) SHA1(0fe77f47ff77333d1ff9bfcf8d6d92193ab1f208))
// 8: BIOS-String: Phoenix 80386 ROM BIOS PLUS Version 1.10 22
ROM_SYSTEM_BIOS(8, "cbm386", "Commodore 386")
ROMX_LOAD( "cbm-386-bios-lo-v1.022e-8100.bin", 0x10000, 0x8000, CRC(a054a1b8) SHA1(d952b02cc10534325c1c5aaa8b6dfb77bc20a179), ROM_SKIP(1) | ROM_BIOS(8))
ROMX_LOAD( "cbm-386-bios-hi-v1.022e-d100.bin", 0x10001, 0x8000, CRC(b9541f3d) SHA1(e37c704521e85b07369d21b0521f4d1871c318dd), ROM_SKIP(1) | ROM_BIOS(8))
- // 9: flashing "K/B controller incorrect"
+ // 9: flashing "K/B controller incorrect" - Chipset: ALi M1217-40
ROM_SYSTEM_BIOS(9, "gmb386sat", "GMB-386SAT_V1.0")
ROMX_LOAD( "gmb-386sat_v1.0.bin", 0x10000, 0x10000, CRC(59ecc773) SHA1(f2007fce76b3a91f51bfb5f43c1539d5ae06d35f), ROM_BIOS(9))
// 10: BIOS-String: X0-0100-000000-00101111-060692-RC2018A-0 / Ver 1.4b / Texas Instruments 486 DLC [S3Q]
@@ -2258,46 +2392,46 @@ ROM_START( at486 )
// 5: BIOS-String: 04/08/96-VT82C486A-214L2000-00 / Version 3.27GN1
ROM_SYSTEM_BIOS(5, "ficgacv", "FIC 486-GAC-V 3.27GN1") /* includes CL-GD542X VGA BIOS 1.41 */
ROMX_LOAD( "327gn1.awd", 0x00000, 0x20000, CRC(017614d4) SHA1(2228c28f21a7e78033d24319449297936465b164), ROM_BIOS(5))
- // 6: BIOS-String: 05/06/94-VT82C486A-214L2000-00 / Version 3.15GN
- ROM_SYSTEM_BIOS(6, "ficgiovp", "FIC 486-GIO-VP 3.15GN")
+ // 6: BIOS-String: 05/06/94-VT82C486A-214L2000-00 / Version 3.15GN - ISA16:4, ISA/VL: 2
+ ROM_SYSTEM_BIOS(6, "ficgiovp", "FIC 486-GIO-VP 3.15GN") // Chipset: VIP VT82C486A, Promise PDC20230C, one further VIA, one other unreadable
ROMX_LOAD( "giovp315.rom", 0x10000, 0x10000, CRC(e102c3f5) SHA1(f15a7e9311cc17afe86da0b369607768b030ddec), ROM_BIOS(6))
- // 7: BIOS-String: 11/20/94-VT82C486A-214L2000-00 / Version 3.06G (11/25/94)
- ROM_SYSTEM_BIOS(7, "ficgiovt", "FIC 486-GIO-VT 3.06G") /* 1994-11-20 */
+ // 7: BIOS-String: 11/20/94-VT82C486A-214L2000-00 / Version 3.06G (11/25/94) - OSC: 24.0L3P - ISA16:3, ISA/VL: 2
+ ROM_SYSTEM_BIOS(7, "ficgiovt", "FIC 486-GIO-VT 3.06G") // 1994-11-20 - Chipset: Winbond W83757AF, W83758P, VIA VT82C486A, VT8255N, VT82C482
ROMX_LOAD( "306gcd00.awd", 0x10000, 0x10000, CRC(75f3ded4) SHA1(999d4b58204e0b0f33262d0613c855b528bf9597), ROM_BIOS(7))
- // 8: BIOS-String: 07/06/VT82C486A-214L2000-00 / Version 3.26G
- ROM_SYSTEM_BIOS(8, "ficgiovt2_326", "FIC 486-GIO-VT2 3.26G")
+ // 8: BIOS-String: 07/06/VT82C486A-214L2000-00 / Version 3.26G - ISA8: 1, ISA16: 3, ISA/VL: 2
+ ROM_SYSTEM_BIOS(8, "ficgiovt2_326", "FIC 486-GIO-VT2 3.26G") // Chipset: Winbond W83758P, Winbond W83757AF, VIA VT82C482, VT82C486A, VT82C461
ROMX_LOAD( "326g1c00.awd", 0x10000, 0x10000, CRC(2e729ab5) SHA1(b713f97fa0e0b62856dab917f417f5b21020b354), ROM_BIOS(8))
// 9: BIOS-String: 06/19/95-VT82C486A-214L2000-00 / Version VBS1.08H 486-GIO-VT2
- ROM_SYSTEM_BIOS(9, "486_gio_vt2","VBS1.08H 486-GVT-2")
+ ROM_SYSTEM_BIOS(9, "486_gio_vt2","VBS1.08H 486-GVT-2") // Chipset: VIA VT82C486A, VT82C482 - ISA16: 4, ISA/VL: 2
ROMX_LOAD( "award_486_gio_vt2.bin", 0x10000, 0x10000, CRC(58d7c7f9) SHA1(097f15ec2bd672cb3f1763298ca802c7ff26021f), ROM_BIOS(9)) // Vobis version, Highscreen boot logo
// 10: BIOS-String: 07/17/97-VT82C486A-214L2000-00 / Version 3.276
ROM_SYSTEM_BIOS(10, "ficgiovt2_3276", "FIC 486-GIO-VT2 3.276")
ROMX_LOAD( "32760000.bin", 0x10000, 0x10000, CRC(ad179128) SHA1(595f67ba4a1c8eb5e118d75bf657fff3803dcf4f), ROM_BIOS(10))
- // 11: BIOS-String: 11/02/94-VT82C486A-214L2000-00 Version 3.07G
- ROM_SYSTEM_BIOS(11, "ficgvt2", "FIC 486-GVT-2 3.07G")
+ // 11: BIOS-String: 11/02/94-VT82C486A-214L2000-00 Version 3.07G - ISA8: 1, ISA16: 4, ISA/VL: 2
+ ROM_SYSTEM_BIOS(11, "ficgvt2", "FIC 486-GVT-2 3.07G") // Chipset: VIA VT82C486A, VT82C482, VIA VT8255N
ROMX_LOAD( "3073.bin", 0x10000, 0x10000, CRC(a6723863) SHA1(ee93a2f1ec84a3d67e267d0a490029f9165f1533), ROM_BIOS(11))
- // 12: BIOS-String: 06/27/95-VT82C505-2A4L4000-00 / Version 5.15S
+ // 12: BIOS-String: 06/27/95-VT82C505-2A4L4000-00 / Version 5.15S - Chipset: S3 Trio64, FDC 37665GT, VT82C496G, VT82C406MV
ROM_SYSTEM_BIOS(12, "ficgpak2", "FIC 486-PAK-2 5.15S") /* includes Phoenix S3 TRIO64 Enhanced VGA BIOS 1.4-01 */
ROMX_LOAD( "515sbd8a.awd", 0x00000, 0x20000, CRC(778247e1) SHA1(07d8f0f2464abf507be1e8dfa06cd88737782411), ROM_BIOS(12))
- // 13
- ROM_SYSTEM_BIOS(13, "ficpio3g7", "FIC 486-PIO-3 1.15G705") /* pnp */
+ // 13: runs into Award BootBlock BIOS - Chipset: VIA VT82C505, VT82C416, VT82C496G, Winbond W83787F
+ ROM_SYSTEM_BIOS(13, "ficpio3g7", "FIC 486-PIO-3 1.15G705") // pnp - ISA16: 4, PCI: 3
ROMX_LOAD( "115g705.awd", 0x00000, 0x20000, CRC(ddb1544a) SHA1(d165c9ecdc9397789abddfe0fef69fdf954fa41b), ROM_BIOS(13))
- // 14
+ // 14 runs into Award BootBlock BIOS
ROM_SYSTEM_BIOS(14, "ficpio3g1", "FIC 486-PIO-3 1.15G105") /* non-pnp */
ROMX_LOAD( "115g105.awd", 0x00000, 0x20000, CRC(b327eb83) SHA1(9e1ff53e07ca035d8d43951bac345fec7131678d), ROM_BIOS(14))
- // 15
+ // 15 runs into Award BootBlock BIOS
ROM_SYSTEM_BIOS(15, "ficpos", "FIC 486-POS")
ROMX_LOAD( "116di6b7.bin", 0x00000, 0x20000, CRC(d1d84616) SHA1(2f2b27ce100cf784260d8e155b48db8cfbc63285), ROM_BIOS(15))
- // 16: BIOS-String: 06/27/95-VT82C505-2A4L4000-00 / Version 5.15
- ROM_SYSTEM_BIOS(16, "ficpvt", "FIC 486-PVT 5.15")
+ // 16: BIOS-String: 06/27/95-VT82C505-2A4L4000-00 / Version 5.15 / Chipset: VIA VT82C496G PC/AT
+ ROM_SYSTEM_BIOS(16, "ficpvt", "FIC 486-PVT 5.15") // ISA16: 6, ISA/VL: 2
ROMX_LOAD( "5150eef3.awd", 0x00000, 0x20000, CRC(eb35785d) SHA1(1e601bc8da73f22f11effe9cdf5a84d52576142b), ROM_BIOS(16))
// 17: BIOS-String: 10/05/95-VT82C505-2A4L4000-00 / Version 5.162W2(PCTIO)
- ROM_SYSTEM_BIOS(17, "ficpvtio", "FIC 486-PVT-IO 5.162W2")
+ ROM_SYSTEM_BIOS(17, "ficpvtio", "FIC 486-PVT-IO 5.162W2") // Chipset: VT82C406MV, VT82C496G, W83777/83787F, W83758P
ROMX_LOAD( "5162cf37.awd", 0x00000, 0x20000, CRC(378d813d) SHA1(aa674eff5b972b31924941534c3c988f6f78dc93), ROM_BIOS(17))
// 18: BIOS-String: 40-0401-428003-00101111-111192-OP495SLC-0 / PX486DX33/50P3 IVN 1.0 25/06/1993
- ROM_SYSTEM_BIOS(18, "qdi", "QDI PX486DX33/50P3")
+ ROM_SYSTEM_BIOS(18, "qdi", "QDI PX486DX33/50P3") // OPTi-SLC (82C495SLC & 82C206) - ISA8: 1, ISA16: 3, ISA/VL: 3
ROMX_LOAD( "qdi_px486.u23", 0x10000, 0x10000, CRC(c80ecfb6) SHA1(34cc9ef68ff719cd0771297bf184efa83a805f3e), ROM_BIOS(18))
- // 19: BIOS-String: 40-00AG-001247-00101111-060692-SIS3486-0 / AV4 ISA/VL-BUS SYSTEM BIOS
+ // 19: BIOS-String: 40-00AG-001247-00101111-060692-SIS3486-0 / AV4 ISA/VL-BUS SYSTEM BIOS / Chipset: SIS 85C460ATQ
ROM_SYSTEM_BIOS(19, "ava4529j", "AVA4529J") // this is a board with two VLB slots
ROMX_LOAD("amibios_486dx_isa_bios_aa4025963.bin", 0x10000, 0x10000, CRC(65558d9e) SHA1(2e2840665d069112a2c7169afec687ad03449295), ROM_BIOS(19))
ROM_END
@@ -2568,6 +2702,7 @@ COMP( 1995, aa486s, ibm5170, 0, at486, 0, at_state, init_at
COMP( 1994, a486sv1, ibm5170, 0, at486, 0, at_state, init_at, "Asus", "VL/EISA-486SV1", MACHINE_NOT_WORKING )
COMP( 1994, a486sv2g, ibm5170, 0, at486, 0, at_state, init_at, "Asus", "VL/I-486SV2G", MACHINE_NOT_WORKING )
COMP( 199?, mb8433uud, ibm5170, 0, at486, 0, at_state, init_at, "Biostar", "MB8433-UUD-A", MACHINE_NOT_WORKING ) // lands in Award BootBlock BIOS
+COMP( 199?, mb1212c, ibm5170, 0, atvga, 0, at_state, init_at, "Biostar", "MB-1212C", MACHINE_NOT_WORKING )
COMP( 1990, c386sx16, ibm5170, 0, at386sx, 0, at_state, init_at, "Commodore Business Machines", "386SX-16", MACHINE_NOT_WORKING )
COMP( 199?, dt386, ibm5170, 0, at386, 0, at_state, init_at, "Commodore Business Machines", "DT386", MACHINE_NOT_WORKING )
COMP( 199?, dt486, ibm5170, 0, at486, 0, at_state, init_at, "Commodore Business Machines", "DT486", MACHINE_NOT_WORKING )
@@ -2588,12 +2723,19 @@ COMP( 1994, ficvipio, ibm5170, 0, at486, 0, at_state, init_at
COMP( 199?, ficvipio2, ibm5170, 0, at486, 0, at_state, init_at, "First International Computer", "486-VIP-IO2", MACHINE_NOT_WORKING )
COMP( 199?, hot409, ibm5170, 0, at486, 0, at_state, init_at, "Shuttle Computer International", "HOT-409", MACHINE_NOT_WORKING )
COMP( 198?, aubam12s2, ibm5170, 0, atvga, 0, at_state, init_at, "AUVA COMPUTER, INC.", "BAM/12-S2", MACHINE_NOT_WORKING )
+COMP( 198?, wy220001, ibm5170, 0, ibm5162, 0, at_state, init_at, "Wyse", "WYSEpc 286", MACHINE_NOT_WORKING )
COMP( 198?, mkp286, ibm5170, 0, atvga, 0, at_state, init_at, "Morse", "KP-286", MACHINE_NOT_WORKING )
COMP( 198?, pccm205, ibm5170, 0, atvga, 0, at_state, init_at, "PC-Chips", "M205", MACHINE_NOT_WORKING )
COMP( 199?, pccm321, ibm5170, 0, at386, 0, at_state, init_at, "PC-Chips", "M321", MACHINE_NOT_WORKING )
COMP( 199?, pccm326, ibm5170, 0, at386, 0, at_state, init_at, "PC-Chips", "M326", MACHINE_NOT_WORKING )
COMP( 199?, pccm919, ibm5170, 0, at486, 0, at_state, init_at, "PC-Chips", "M919", MACHINE_NOT_WORKING )
COMP( 198?, snomi286, ibm5170, 0, atvga, 0, at_state, init_at, "Snobol", "Mini 286", MACHINE_NOT_WORKING )
+COMP( 198?, cmpa286, ibm5170, 0, atvga, 0, at_state, init_at, "CMP enterprise CO.LTD.", "286 motherboard", MACHINE_NOT_WORKING )
+COMP( 198?, bam16a0, ibm5170, 0, atvga, 0, at_state, init_at, "AUVA", "VIP-M21502A BAM16-A0", MACHINE_NOT_WORKING )
+COMP( 199?, olim203, ibm5170, 0, atvga, 0, at_state, init_at, "Olivetti", "M203 motherboard", MACHINE_NOT_WORKING )
+COMP( 199?, cdtekg2, ibm5170, 0, atvga, 0, at_state, init_at, "CDTEK", "286 motherboard with Headland G2 chipset", MACHINE_NOT_WORKING )
+COMP( 199?, octekg2, ibm5170, 0, atvga, 0, at_state, init_at, "Octek", "286 mainboard with Headland G2 chipset", MACHINE_NOT_WORKING )
+COMP( 199?, headg2, ibm5170, 0, atvga, 0, at_state, init_at, "<unknown>", "286 motherboards with Headland G2 chipset", MACHINE_NOT_WORKING )
COMP( 199?, sy019hi, ibm5170, 0, at386, 0, at_state, init_at, "Soyo", "SY-019H and SY-019I", MACHINE_NOT_WORKING )
COMP( 199?, suntac5, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "286 motherboards with 5-chip SUNTAC chipset", MACHINE_NOT_WORKING )
COMP( 198?, vlsi5, ibm5170, 0, atvga, 0, at_state, init_at, "<unknown>", "286 motherboards with 5-chip VLSI chipset", MACHINE_NOT_WORKING )
@@ -2606,6 +2748,8 @@ COMP( 1992, mbc28, ibm5170, 0, at386sx, 0, at_state, init_at
COMP( 199?, sarcpc, ibm5170, 0, ibm5162, 0, at_state, init_at, "<unknown>", "80286 Standard System (SARC RC2015 chipset)", MACHINE_NOT_WORKING )
COMP( 199?, sm38640f, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "SM 386-40F (Forex chipset)", MACHINE_NOT_WORKING )
COMP( 199?, 4nd04a, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "386-4N-D04A (UMC chipset)", MACHINE_NOT_WORKING )
+COMP( 199?, bi025c, ibm5170, 0, atvga, 0, at_state, init_at, "<unknown>", "BI-025C HT-12 286 (HT12/A chipset)", MACHINE_NOT_WORKING )
+COMP( 199?, kma202f, ibm5170, 0, atvga, 0, at_state, init_at, "<unknown>", "KMA-202F-12R (Winbond chipset)", MACHINE_NOT_WORKING )
COMP( 1986, pcd2, ibm5170, 0, ibm5170, 0, at_state, init_at, "Siemens", "PCD-2", MACHINE_NOT_WORKING )
COMP( 199?, pcd3nsx, ibm5170, 0, at386sx, 0, at_state, init_at, "Siemens-Nixdorf", "PCD-3Nsx Notebook Computer", MACHINE_NOT_WORKING )
COMP( 199?, pcd4x, ibm5170, 0, at486, 0, at_state, init_at, "Siemens-Nixdorf", "PCD-4H, PCD-4M", MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/atlantis.cpp b/src/mame/drivers/atlantis.cpp
index ae666dd55a2..fb91a2a6a6f 100644
--- a/src/mame/drivers/atlantis.cpp
+++ b/src/mame/drivers/atlantis.cpp
@@ -767,7 +767,7 @@ static INPUT_PORTS_START( mwskins )
PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("IN2")
- //PORT_BIT(0x0007, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, atlantis_state, port_mod_r, "KEYPAD")
+ //PORT_BIT(0x0007, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(atlantis_state, port_mod_r)
PORT_BIT(0xffff, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("AN.0")
diff --git a/src/mame/drivers/bagman.cpp b/src/mame/drivers/bagman.cpp
index 66720698d43..c5175916802 100644
--- a/src/mame/drivers/bagman.cpp
+++ b/src/mame/drivers/bagman.cpp
@@ -343,7 +343,7 @@ static INPUT_PORTS_START( squaitsa )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
- PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, squaitsa_state, dial_input_r<0>, nullptr)
+ PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(squaitsa_state, dial_input_r<0>)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_START("P2")
@@ -352,7 +352,7 @@ static INPUT_PORTS_START( squaitsa )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
- PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, squaitsa_state, dial_input_r<1>, nullptr)
+ PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(squaitsa_state, dial_input_r<1>)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_START("DSW")
diff --git a/src/mame/drivers/balsente.cpp b/src/mame/drivers/balsente.cpp
index f4c3f8bc33b..5fc95e5ba11 100644
--- a/src/mame/drivers/balsente.cpp
+++ b/src/mame/drivers/balsente.cpp
@@ -1022,7 +1022,7 @@ static INPUT_PORTS_START( nstocker )
PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" )
PORT_MODIFY("IN0")
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, balsente_state,nstocker_bits_r, nullptr)
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(balsente_state, nstocker_bits_r)
/* cheese alert -- we have to map this to player 2 so that it doesn't interfere with
the crosshair controls */
diff --git a/src/mame/drivers/battlex.cpp b/src/mame/drivers/battlex.cpp
index da2d2a9f05d..d1aab0ccce0 100644
--- a/src/mame/drivers/battlex.cpp
+++ b/src/mame/drivers/battlex.cpp
@@ -166,7 +166,7 @@ static INPUT_PORTS_START( battlex )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, battlex_state,battlex_in0_b4_r, nullptr)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(battlex_state, battlex_in0_b4_r)
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x20, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
diff --git a/src/mame/drivers/blockade.cpp b/src/mame/drivers/blockade.cpp
index 990d2d5d357..127c85c951b 100644
--- a/src/mame/drivers/blockade.cpp
+++ b/src/mame/drivers/blockade.cpp
@@ -45,7 +45,7 @@ public:
{ }
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
- DECLARE_CUSTOM_INPUT_MEMBER(coin_r);
+ DECLARE_READ_LINE_MEMBER(coin_r);
DECLARE_WRITE8_MEMBER(coin_latch_w);
DECLARE_WRITE8_MEMBER(videoram_w);
@@ -123,7 +123,7 @@ static INPUT_PORTS_START( blockade )
PORT_CONFSETTING( 0x50, "4" )
PORT_CONFSETTING( 0x30, "5" )
PORT_CONFSETTING( 0x70, "6" )
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, blockade_state, coin_r, nullptr)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_MEMBER(blockade_state, coin_r)
PORT_START("IN1")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_4WAY PORT_PLAYER(2)
@@ -154,7 +154,7 @@ static INPUT_PORTS_START( comotion )
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, blockade_state, coin_r, nullptr)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_MEMBER(blockade_state, coin_r)
PORT_MODIFY("IN1")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_4WAY PORT_PLAYER(1)
@@ -193,7 +193,7 @@ static INPUT_PORTS_START( blasto )
PORT_CONFSETTING( 0x00, "70 Secs") // though service manual says 60
PORT_CONFSETTING( 0x08, "90 Secs")
PORT_BIT(0x70, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, blockade_state, coin_r, nullptr)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_MEMBER(blockade_state, coin_r)
PORT_MODIFY("IN1")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2)
@@ -228,7 +228,7 @@ static INPUT_PORTS_START( hustle )
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_START1)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START2)
PORT_BIT(0x60, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, blockade_state, coin_r, nullptr)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_MEMBER(blockade_state, coin_r)
PORT_MODIFY("IN1")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_4WAY PORT_PLAYER(2)
@@ -265,7 +265,7 @@ static INPUT_PORTS_START( mineswpr )
PORT_CONFSETTING( 0x50, "4")
PORT_CONFSETTING( 0x30, "5")
PORT_CONFSETTING( 0x70, "6")
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, blockade_state, coin_r, nullptr)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_MEMBER(blockade_state, coin_r)
PORT_MODIFY("IN1")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_4WAY PORT_PLAYER(1)
@@ -296,7 +296,7 @@ static INPUT_PORTS_START( mineswpr4 )
PORT_CONFSETTING( 0x50, "4")
PORT_CONFSETTING( 0x30, "5")
PORT_CONFSETTING( 0x70, "6")
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, blockade_state, coin_r, nullptr)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_MEMBER(blockade_state, coin_r)
PORT_MODIFY("IN1")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_4WAY PORT_PLAYER(1)
@@ -332,7 +332,7 @@ INPUT_CHANGED_MEMBER( blockade_state::coin_inserted )
m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero);
}
-CUSTOM_INPUT_MEMBER( blockade_state::coin_r )
+READ_LINE_MEMBER( blockade_state::coin_r )
{
return m_coin_latch;
}
diff --git a/src/mame/drivers/bmcpokr.cpp b/src/mame/drivers/bmcpokr.cpp
index 4dfc66aad2d..6efbc64c122 100644
--- a/src/mame/drivers/bmcpokr.cpp
+++ b/src/mame/drivers/bmcpokr.cpp
@@ -44,7 +44,7 @@ public:
m_palette(*this, "palette")
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
+ DECLARE_READ_LINE_MEMBER(hopper_r);
void bmcpokr(machine_config &config);
void mjmaglmp(machine_config &config);
@@ -336,7 +336,7 @@ READ16_MEMBER(bmcpokr_state::dsw_r)
return 0xff << 8;
}
-CUSTOM_INPUT_MEMBER(bmcpokr_state::hopper_r)
+READ_LINE_MEMBER(bmcpokr_state::hopper_r)
{
// motor off should clear the sense bit (I guess ticket.c should actually do this).
// Otherwise a hopper bit stuck low will prevent several keys from being registered.
@@ -489,7 +489,7 @@ static INPUT_PORTS_START( bmcpokr )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // n.a. [START, ESC in service mode]
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // SCORE
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // BET [BET, credit -1]
- PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bmcpokr_state,hopper_r, nullptr) // HP [HOPPER, credit -100]
+ PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_READ_LINE_MEMBER(bmcpokr_state, hopper_r) // HP [HOPPER, credit -100]
PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // ACCOUNT [SERVICE MODE]
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // KEY-OUT [KEY-OUT, no hopper]
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // DOUBLE-UP
@@ -507,7 +507,7 @@ static INPUT_PORTS_START( bmcpokr )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // n.a. [START, ESC in service mode]
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // <Left>2 (3rd)
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // <Down>1 (2nd) [BET, credit -1]
-// PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bmcpokr_state,hopper_r, nullptr) // HP [HOPPER, credit -100]
+// PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_READ_LINE_MEMBER(bmcpokr_state, hopper_r) // HP [HOPPER, credit -100]
PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // A2 [SERVICE MODE]
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // C2 [KEY-OUT, no hopper]
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // S1 [START, ESC in service mode]
@@ -609,7 +609,7 @@ static INPUT_PORTS_START( mjmaglmp )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN2 ) // NOTE
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // KEY DOWN
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // PAY
- PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bmcpokr_state,hopper_r, nullptr) // HOPPER
+ PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_READ_LINE_MEMBER(bmcpokr_state, hopper_r) // HOPPER
PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW ) // ACCOUNT
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset") // RESET
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // (unused)
diff --git a/src/mame/drivers/bnstars.cpp b/src/mame/drivers/bnstars.cpp
index 3c2bf793f92..d67b3dbdae7 100644
--- a/src/mame/drivers/bnstars.cpp
+++ b/src/mame/drivers/bnstars.cpp
@@ -126,7 +126,7 @@ public:
void init_bnstars();
- DECLARE_CUSTOM_INPUT_MEMBER(mahjong_ctrl_r);
+ template <int P> DECLARE_CUSTOM_INPUT_MEMBER(mahjong_ctrl_r);
private:
@@ -558,7 +558,7 @@ uint32_t bnstars_state::screen_update_bnstars_right(screen_device &screen, bitma
static INPUT_PORTS_START( bnstars )
PORT_START("P1")
- PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bnstars_state, mahjong_ctrl_r, (void *)0)
+ PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(bnstars_state, mahjong_ctrl_r<0>)
PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -601,7 +601,7 @@ static INPUT_PORTS_START( bnstars )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("P2")
- PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bnstars_state, mahjong_ctrl_r, (void *)1)
+ PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(bnstars_state, mahjong_ctrl_r<1>)
PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -752,9 +752,10 @@ static GFXDECODE_START( gfx_bnstars )
GFXDECODE_ENTRY( "gfx7", 0, txlayout, 0x6000, 0x10 ) /* Tx scr2 */
GFXDECODE_END
+template <int P>
CUSTOM_INPUT_MEMBER(bnstars_state::mahjong_ctrl_r)
{
- required_ioport_array<4> &keys = (((int)(uintptr_t)param) == 0) ? m_p1_keys : m_p2_keys;
+ required_ioport_array<4> &keys = (P == 0) ? m_p1_keys : m_p2_keys;
switch (m_bnstars1_mahjong_select & 0x2080)
{
diff --git a/src/mame/drivers/btoads.cpp b/src/mame/drivers/btoads.cpp
index 080f8de3e0e..5137bde47ed 100644
--- a/src/mame/drivers/btoads.cpp
+++ b/src/mame/drivers/btoads.cpp
@@ -73,13 +73,13 @@ READ16_MEMBER( btoads_state::main_sound_r )
}
-CUSTOM_INPUT_MEMBER( btoads_state::main_to_sound_r )
+READ_LINE_MEMBER( btoads_state::main_to_sound_r )
{
return m_main_to_sound_ready;
}
-CUSTOM_INPUT_MEMBER( btoads_state::sound_to_main_r )
+READ_LINE_MEMBER( btoads_state::sound_to_main_r )
{
return m_sound_to_main_ready;
}
@@ -264,9 +264,9 @@ static INPUT_PORTS_START( btoads )
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("SPECIAL")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, btoads_state, sound_to_main_r, nullptr)
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(btoads_state, sound_to_main_r)
PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, btoads_state, main_to_sound_r, nullptr)
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(btoads_state, main_to_sound_r)
PORT_BIT( 0xff7c, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("SW1")
diff --git a/src/mame/drivers/bublbobl.cpp b/src/mame/drivers/bublbobl.cpp
index fbc15414368..87704cf3b5c 100644
--- a/src/mame/drivers/bublbobl.cpp
+++ b/src/mame/drivers/bublbobl.cpp
@@ -732,8 +732,8 @@ static INPUT_PORTS_START( tokio )
PORT_INCLUDE( tokio_base )
PORT_MODIFY("IN0")
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("bmcu", taito68705_mcu_device, host_semaphore_r, nullptr)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("bmcu", taito68705_mcu_device, mcu_semaphore_r, nullptr)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("bmcu", taito68705_mcu_device, host_semaphore_r)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("bmcu", taito68705_mcu_device, mcu_semaphore_r)
INPUT_PORTS_END
static INPUT_PORTS_START( bublboblp )
diff --git a/src/mame/drivers/buggychl.cpp b/src/mame/drivers/buggychl.cpp
index 1b3e25cc09a..6cb0ebf2783 100644
--- a/src/mame/drivers/buggychl.cpp
+++ b/src/mame/drivers/buggychl.cpp
@@ -417,7 +417,7 @@ static INPUT_PORTS_START( buggychl )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_TILT )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, buggychl_state, pedal_in_r, nullptr)
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(buggychl_state, pedal_in_r)
PORT_START("PEDAL")
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_NAME("P1 Pedal") PORT_SENSITIVITY(100) PORT_KEYDELTA(15) /* accelerator */
diff --git a/src/mame/drivers/bwidow.cpp b/src/mame/drivers/bwidow.cpp
index 00638ada226..cb756f8ac11 100644
--- a/src/mame/drivers/bwidow.cpp
+++ b/src/mame/drivers/bwidow.cpp
@@ -309,7 +309,7 @@ READ8_MEMBER(bwidow_state::spacduel_IN3_r)
return res;
}
-CUSTOM_INPUT_MEMBER(bwidow_state::clock_r)
+READ_LINE_MEMBER(bwidow_state::clock_r)
{
return (m_maincpu->total_cycles() & 0x100) ? 1 : 0;
}
@@ -484,9 +484,9 @@ static INPUT_PORTS_START( bwidow )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diagnostic Step")
/* bit 6 is the VG HALT bit. We set it to "low" */
/* per default (busy vector processor). */
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("avg", avg_device, done_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_device, done_r)
/* bit 7 is tied to a 3kHz clock */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bwidow_state,clock_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(bwidow_state, clock_r)
PORT_START("DSW0")
PORT_DIPNAME(0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("D4:!7,!8")
@@ -562,9 +562,9 @@ static INPUT_PORTS_START( gravitar )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diagnostic Step")
/* bit 6 is the VG HALT bit. We set it to "low" */
/* per default (busy vector processor). */
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("avg", avg_device, done_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_device, done_r)
/* bit 7 is tied to a 3kHz clock */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bwidow_state,clock_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(bwidow_state, clock_r)
PORT_START("DSW0")
PORT_DIPUNUSED_DIPLOC( 0x03, IP_ACTIVE_HIGH, "D4:!7,!8" )
@@ -636,9 +636,9 @@ static INPUT_PORTS_START( lunarbat )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* bit 6 is the VG HALT bit. We set it to "low" */
/* per default (busy vector processor). */
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("avg", avg_device, done_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_device, done_r)
/* bit 7 is tied to a 3kHz clock */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bwidow_state,clock_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(bwidow_state, clock_r)
PORT_START("DSW0") /* DSW0 - Not read */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -670,9 +670,9 @@ static INPUT_PORTS_START( spacduel )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diagnostic Step")
/* bit 6 is the VG HALT bit. We set it to "low" */
/* per default (busy vector processor). */
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("avg", avg_device, done_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_device, done_r)
/* bit 7 is tied to a 3kHz clock */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bwidow_state,clock_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(bwidow_state, clock_r)
PORT_START("DSW0")
PORT_DIPNAME(0x03, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("D4:!7,!8")
diff --git a/src/mame/drivers/by17.cpp b/src/mame/drivers/by17.cpp
index b33d20a0c23..0449568af27 100644
--- a/src/mame/drivers/by17.cpp
+++ b/src/mame/drivers/by17.cpp
@@ -60,9 +60,9 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(activity_button);
DECLARE_INPUT_CHANGED_MEMBER(self_test);
- DECLARE_CUSTOM_INPUT_MEMBER(outhole_x0);
- DECLARE_CUSTOM_INPUT_MEMBER(saucer_x3);
- DECLARE_CUSTOM_INPUT_MEMBER(drop_target_x2);
+ template <int Param> DECLARE_READ_LINE_MEMBER(outhole_x0);
+ template <int Param> DECLARE_READ_LINE_MEMBER(saucer_x3);
+ template <int Param> DECLARE_READ_LINE_MEMBER(drop_target_x2);
void by17(machine_config &config);
@@ -302,7 +302,7 @@ static INPUT_PORTS_START( by17 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_TILT )
// PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Outhole") PORT_CODE(KEYCODE_BACKSPACE)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, outhole_x0, (void *)0x07) // PORT_CODE(KEYCODE_BACKSPACE)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, outhole_x0<0x07>) // PORT_CODE(KEYCODE_BACKSPACE)
PORT_START("X1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 )
@@ -386,17 +386,17 @@ static INPUT_PORTS_START( matahari )
PORT_DIPSETTING( 0x80, "Replay")
PORT_MODIFY("X2") /* Drop Target switches */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x20) // PORT_CODE(KEYCODE_K)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x21) // PORT_CODE(KEYCODE_J)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x22) // PORT_CODE(KEYCODE_H)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x23) // PORT_CODE(KEYCODE_G)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x24) // PORT_CODE(KEYCODE_F)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x25) // PORT_CODE(KEYCODE_D)
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x26) // PORT_CODE(KEYCODE_S)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x27) // PORT_CODE(KEYCODE_A)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x20>) // PORT_CODE(KEYCODE_K)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x21>) // PORT_CODE(KEYCODE_J)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x22>) // PORT_CODE(KEYCODE_H)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x23>) // PORT_CODE(KEYCODE_G)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x24>) // PORT_CODE(KEYCODE_F)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x25>) // PORT_CODE(KEYCODE_D)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x26>) // PORT_CODE(KEYCODE_S)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x27>) // PORT_CODE(KEYCODE_A)
PORT_MODIFY("X3")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, saucer_x3, (void *)0x37) // PORT_CODE(KEYCODE_Q)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, saucer_x3<0x37>) // PORT_CODE(KEYCODE_Q)
INPUT_PORTS_END
static INPUT_PORTS_START( pwerplay )
@@ -438,24 +438,25 @@ static INPUT_PORTS_START( pwerplay )
PORT_DIPSETTING( 0xc0, "Extra Ball / Replay")
PORT_MODIFY("X2") /* Drop Target switches */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x20) // PORT_CODE(KEYCODE_K)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x21) // PORT_CODE(KEYCODE_J)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x22) // PORT_CODE(KEYCODE_H)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x23) // PORT_CODE(KEYCODE_G)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x24) // PORT_CODE(KEYCODE_F)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x25) // PORT_CODE(KEYCODE_D)
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x26) // PORT_CODE(KEYCODE_S)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, drop_target_x2, (void *)0x27) // PORT_CODE(KEYCODE_A)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x20>) // PORT_CODE(KEYCODE_K)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x21>) // PORT_CODE(KEYCODE_J)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x22>) // PORT_CODE(KEYCODE_H)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x23>) // PORT_CODE(KEYCODE_G)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x24>) // PORT_CODE(KEYCODE_F)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x25>) // PORT_CODE(KEYCODE_D)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x26>) // PORT_CODE(KEYCODE_S)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, drop_target_x2<0x27>) // PORT_CODE(KEYCODE_A)
PORT_MODIFY("X3")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by17_state, saucer_x3, (void *)0x37) // PORT_CODE(KEYCODE_Q)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by17_state, saucer_x3<0x37>) // PORT_CODE(KEYCODE_Q)
INPUT_PORTS_END
-CUSTOM_INPUT_MEMBER( by17_state::outhole_x0 )
+template <int Param>
+READ_LINE_MEMBER( by17_state::outhole_x0 )
{
- int bit_shift = ((uintptr_t)param & 0x07);
- int port = (((uintptr_t)param >> 4) & 0x07);
+ int bit_shift = (Param & 0x07);
+ int port = ((Param >> 4) & 0x07);
/* Here we simulate the ball sitting in the Outhole so the Outhole Solenoid can release it */
@@ -465,10 +466,11 @@ CUSTOM_INPUT_MEMBER( by17_state::outhole_x0 )
return ((m_io_hold_x[port] >> bit_shift) & 1);
}
-CUSTOM_INPUT_MEMBER( by17_state::saucer_x3 )
+template <int Param>
+READ_LINE_MEMBER( by17_state::saucer_x3 )
{
- int bit_shift = ((uintptr_t)param & 0x07);
- int port = (((uintptr_t)param >> 4) & 0x07);
+ int bit_shift = (Param & 0x07);
+ int port = ((Param >> 4) & 0x07);
/* Here we simulate the ball sitting in a Saucer so the Saucer Solenoid can release it */
@@ -478,13 +480,13 @@ CUSTOM_INPUT_MEMBER( by17_state::saucer_x3 )
return ((m_io_hold_x[port] >> bit_shift) & 1);
}
-
-CUSTOM_INPUT_MEMBER( by17_state::drop_target_x2 )
+template <int Param>
+READ_LINE_MEMBER( by17_state::drop_target_x2 )
{
/* Here we simulate fallen Drop Targets so the Drop Target Reset Solenoids can release the switches */
- int bit_shift = ((uintptr_t)param & 0x07);
- int port = (((uintptr_t)param >> 4) & 0x07);
+ int bit_shift = (Param & 0x07);
+ int port = ((Param >> 4) & 0x07);
switch (bit_shift)
{
diff --git a/src/mame/drivers/by35.cpp b/src/mame/drivers/by35.cpp
index 9b71ad328e7..29d765c531b 100644
--- a/src/mame/drivers/by35.cpp
+++ b/src/mame/drivers/by35.cpp
@@ -95,9 +95,9 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(activity_button);
DECLARE_INPUT_CHANGED_MEMBER(self_test);
- DECLARE_CUSTOM_INPUT_MEMBER(outhole_x0);
- DECLARE_CUSTOM_INPUT_MEMBER(drop_target_x0);
- DECLARE_CUSTOM_INPUT_MEMBER(kickback_x3);
+ template <int Param> DECLARE_READ_LINE_MEMBER(outhole_x0);
+ template <int Param> DECLARE_READ_LINE_MEMBER(drop_target_x0);
+ template <int Param> DECLARE_READ_LINE_MEMBER(kickback_x3);
void by35(machine_config &config);
void nuovo(machine_config &config);
@@ -402,7 +402,7 @@ static INPUT_PORTS_START( by35 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_TILT )
// PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Outhole") PORT_CODE(KEYCODE_BACKSPACE)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by35_state, outhole_x0, (void *)0x07) // PORT_CODE(KEYCODE_BACKSPACE)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by35_state, outhole_x0<0x07>) // PORT_CODE(KEYCODE_BACKSPACE)
PORT_START("X1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 )
@@ -843,14 +843,14 @@ static INPUT_PORTS_START( playboy )
PORT_DIPSETTING( 0x40, "Extra Ball or Special Held Until Collected")
PORT_MODIFY("X0") /* Drop Target switches */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by35_state, drop_target_x0, (void *)0x00) // PORT_CODE(KEYCODE_STOP)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by35_state, drop_target_x0, (void *)0x01) // PORT_CODE(KEYCODE_SLASH)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by35_state, drop_target_x0, (void *)0x02) // PORT_CODE(KEYCODE_OPENBRACE)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by35_state, drop_target_x0, (void *)0x03) // PORT_CODE(KEYCODE_CLOSEBRACE)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by35_state, drop_target_x0, (void *)0x04) // PORT_CODE(KEYCODE_BACKSLASH)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by35_state, drop_target_x0<0x00>) // PORT_CODE(KEYCODE_STOP)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by35_state, drop_target_x0<0x01>) // PORT_CODE(KEYCODE_SLASH)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by35_state, drop_target_x0<0x02>) // PORT_CODE(KEYCODE_OPENBRACE)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by35_state, drop_target_x0<0x03>) // PORT_CODE(KEYCODE_CLOSEBRACE)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by35_state, drop_target_x0<0x04>) // PORT_CODE(KEYCODE_BACKSLASH)
PORT_MODIFY("X3")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, by35_state, kickback_x3, (void *)0x37) // PORT_CODE(KEYCODE_Q)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(by35_state, kickback_x3<0x37>) // PORT_CODE(KEYCODE_Q)
PORT_START("RT2")
PORT_ADJUSTER( 50, "RT2 - Tone Sustain" )
@@ -952,10 +952,11 @@ static INPUT_PORTS_START( frontier )
INPUT_PORTS_END
-CUSTOM_INPUT_MEMBER( by35_state::outhole_x0 )
+template <int Param>
+READ_LINE_MEMBER( by35_state::outhole_x0 )
{
- int bit_shift = ((uintptr_t)param & 0x07);
- int port = (((uintptr_t)param >> 4) & 0x07);
+ int bit_shift = (Param & 0x07);
+ int port = ((Param >> 4) & 0x07);
/* Here we simulate the ball sitting in the Outhole so the Outhole Solenoid can release it */
@@ -965,10 +966,11 @@ CUSTOM_INPUT_MEMBER( by35_state::outhole_x0 )
return ((m_io_hold_x[port] >> bit_shift) & 1);
}
-CUSTOM_INPUT_MEMBER( by35_state::kickback_x3 )
+template <int Param>
+READ_LINE_MEMBER( by35_state::kickback_x3 )
{
- int bit_shift = ((uintptr_t)param & 0x07);
- int port = (((uintptr_t)param >> 4) & 0x07);
+ int bit_shift = (Param & 0x07);
+ int port = ((Param >> 4) & 0x07);
/* Here we simulate the ball sitting in a Saucer so the Saucer Solenoid can release it */
@@ -978,12 +980,13 @@ CUSTOM_INPUT_MEMBER( by35_state::kickback_x3 )
return ((m_io_hold_x[port] >> bit_shift) & 1);
}
-CUSTOM_INPUT_MEMBER( by35_state::drop_target_x0 )
+template <int Param>
+READ_LINE_MEMBER( by35_state::drop_target_x0 )
{
/* Here we simulate the Drop Target switch states so the Drop Target Reset Solenoid can also release the switches */
- int bit_shift = ((uintptr_t)param & 0x07);
- int port = (((uintptr_t)param >> 4) & 0x07);
+ int bit_shift = (Param & 0x07);
+ int port = ((Param >> 4) & 0x07);
switch (bit_shift)
{
diff --git a/src/mame/drivers/bzone.cpp b/src/mame/drivers/bzone.cpp
index cc8fc1e7753..09e95802ce4 100644
--- a/src/mame/drivers/bzone.cpp
+++ b/src/mame/drivers/bzone.cpp
@@ -267,7 +267,7 @@ INTERRUPT_GEN_MEMBER(bzone_state::bzone_interrupt)
*
*************************************/
-CUSTOM_INPUT_MEMBER(bzone_state::clock_r)
+READ_LINE_MEMBER(bzone_state::clock_r)
{
return (m_maincpu->total_cycles() & 0x100) ? 1 : 0;
}
@@ -394,9 +394,9 @@ void redbaron_state::redbaron_map(address_map &map)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diagnostic Step") \
/* bit 6 is the VG HALT bit. We set it to "low" */\
/* per default (busy vector processor). */\
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("avg", avg_bzone_device, done_r, nullptr)\
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_bzone_device, done_r)\
/* bit 7 is tied to a 3kHz clock */\
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bzone_state,clock_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(bzone_state, clock_r)
#define BZONEDSW0\
diff --git a/src/mame/drivers/cave.cpp b/src/mame/drivers/cave.cpp
index 216eec536ae..f5c895ad14f 100644
--- a/src/mame/drivers/cave.cpp
+++ b/src/mame/drivers/cave.cpp
@@ -735,7 +735,7 @@ void cave_state::korokoro_eeprom_w(offs_t offset, u16 data, u16 mem_mask)
}
}
-CUSTOM_INPUT_MEMBER(cave_state::korokoro_hopper_r)
+READ_LINE_MEMBER(cave_state::korokoro_hopper_r)
{
return m_hopper ? 1 : 0;
}
@@ -1123,7 +1123,7 @@ void cave_state::tjumpman_leds_w(u8 data)
// popmessage("led %04X", data);
}
-CUSTOM_INPUT_MEMBER(cave_state::tjumpman_hopper_r)
+READ_LINE_MEMBER(cave_state::tjumpman_hopper_r)
{
return (m_hopper && !(m_screen[0]->frame_number() % 10)) ? 0 : 1;
}
@@ -1608,7 +1608,7 @@ static INPUT_PORTS_START( korokoro )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 ) // service medal out?
PORT_SERVICE( 0x2000, IP_ACTIVE_LOW )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cave_state,korokoro_hopper_r, nullptr) // motor / hopper status ???
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cave_state, korokoro_hopper_r) // motor / hopper status ???
PORT_START("IN1")
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
@@ -1625,7 +1625,7 @@ static INPUT_PORTS_START( tekkencw )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( DEF_STR( Yes ) ) PORT_CODE(KEYCODE_Y) // suru ("do")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Bet" )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cave_state,tjumpman_hopper_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cave_state, tjumpman_hopper_r)
PORT_START("IN1")
PORT_CONFNAME( 0x08, 0x08, "Self Test" )
@@ -1647,7 +1647,7 @@ static INPUT_PORTS_START( tekkenbs )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Bet" )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cave_state,tjumpman_hopper_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cave_state, tjumpman_hopper_r)
PORT_START("IN1")
PORT_CONFNAME( 0x08, 0x08, "Self Test" )
@@ -1668,7 +1668,7 @@ static INPUT_PORTS_START( tjumpman )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( DEF_STR( Yes ) ) PORT_CODE(KEYCODE_Y) // suru ("do")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "1 Bet" )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cave_state,tjumpman_hopper_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cave_state, tjumpman_hopper_r)
PORT_START("IN1")
PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1691,7 +1691,7 @@ static INPUT_PORTS_START( pacslot )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "Pac-Man" ) PORT_CODE(KEYCODE_Y)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Bet" )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cave_state, tjumpman_hopper_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cave_state, tjumpman_hopper_r)
PORT_START("IN1")
PORT_CONFNAME( 0x08, 0x08, "Self Test" )
diff --git a/src/mame/drivers/ccastles.cpp b/src/mame/drivers/ccastles.cpp
index 9b5f86a9522..d054eba255d 100644
--- a/src/mame/drivers/ccastles.cpp
+++ b/src/mame/drivers/ccastles.cpp
@@ -170,7 +170,7 @@ TIMER_CALLBACK_MEMBER(ccastles_state::clock_irq)
}
-CUSTOM_INPUT_MEMBER(ccastles_state::get_vblank)
+READ_LINE_MEMBER(ccastles_state::vblank_r)
{
int scanline = m_screen->vpos();
return m_syncprom[scanline & 0xff] & 1;
@@ -340,7 +340,7 @@ static INPUT_PORTS_START( ccastles )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ccastles_state,get_vblank, nullptr)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ccastles_state, vblank_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Left Jump/1P Start Upright") PORT_CONDITION("IN1",0x20,EQUALS,0x00) /* left Jump, non-cocktail start1 */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("1P Jump") PORT_CONDITION("IN1",0x20,EQUALS,0x20) /* 1p Jump, cocktail */
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Right Jump/2P Start Upright") PORT_CONDITION("IN1",0x20,EQUALS,0x00) /* right Jump, non-cocktail start2 */
diff --git a/src/mame/drivers/champbas.cpp b/src/mame/drivers/champbas.cpp
index 201eb966bac..03218b93243 100644
--- a/src/mame/drivers/champbas.cpp
+++ b/src/mame/drivers/champbas.cpp
@@ -98,7 +98,7 @@ TODO:
*
*************************************/
-CUSTOM_INPUT_MEMBER(champbas_state::watchdog_bit2)
+READ_LINE_MEMBER(champbas_state::watchdog_bit2)
{
return (0x10 - m_watchdog->get_vblank_counter()) >> 2 & 1;
}
@@ -337,7 +337,7 @@ static INPUT_PORTS_START( talbot )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, champbas_state, watchdog_bit2, nullptr) // bit 2 of the watchdog counter
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(champbas_state, watchdog_bit2) // bit 2 of the watchdog counter
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp
index bbf0a46dfe3..1fbf37acc69 100644
--- a/src/mame/drivers/cischeat.cpp
+++ b/src/mame/drivers/cischeat.cpp
@@ -698,7 +698,7 @@ void cischeat_state::armchmp2_map(address_map &map)
#define RIGHT 0
#define LEFT 1
-WRITE16_MEMBER(cischeat_state::captflag_leds_w)
+WRITE16_MEMBER(captflag_state::leds_w)
{
COMBINE_DATA( &m_captflag_leds );
if (ACCESSING_BITS_8_15)
@@ -709,13 +709,13 @@ WRITE16_MEMBER(cischeat_state::captflag_leds_w)
m_leds[1] = BIT(data, 13); // select
int power = (data & 0x1000);
- m_captflag_hopper->motor_w(power ? 1 : 0); // prize motor
+ m_hopper->motor_w(power ? 1 : 0); // prize motor
if (!power)
- m_captflag_hopper->reset();
+ m_hopper->reset();
}
}
-WRITE16_MEMBER(cischeat_state::captflag_oki_bank_w)
+WRITE16_MEMBER(captflag_state::oki_bank_w)
{
if (ACCESSING_BITS_0_7)
{
@@ -726,32 +726,32 @@ WRITE16_MEMBER(cischeat_state::captflag_oki_bank_w)
// Motors
-WRITE16_MEMBER(cischeat_state::captflag_motor_command_right_w)
+WRITE16_MEMBER(captflag_state::motor_command_right_w)
{
// Output check:
// e09a up
// 80b9 - (when not busy)
// 0088 - (when busy)
// e0ba down
- data = COMBINE_DATA( &m_captflag_motor_command[RIGHT] );
- captflag_motor_move(RIGHT, data);
+ data = COMBINE_DATA( &m_motor_command[RIGHT] );
+ motor_move(RIGHT, data);
}
-WRITE16_MEMBER(cischeat_state::captflag_motor_command_left_w)
+WRITE16_MEMBER(captflag_state::motor_command_left_w)
{
// Output check:
// e0ba up
// 8099 - (when not busy)
// 0088 - (when busy)
// e09a down
- data = COMBINE_DATA( &m_captflag_motor_command[LEFT] );
- captflag_motor_move(LEFT, data);
+ data = COMBINE_DATA( &m_motor_command[LEFT] );
+ motor_move(LEFT, data);
}
-void cischeat_state::captflag_motor_move(int side, uint16_t data)
+void captflag_state::motor_move(int side, uint16_t data)
{
- uint16_t & pos = m_captflag_motor_pos[side];
+ uint16_t & pos = m_motor_pos[side];
- timer_device &dev((side == RIGHT) ? *m_captflag_motor_right : *m_captflag_motor_left);
+ timer_device &dev((side == RIGHT) ? *m_motor_right : *m_motor_left);
// bool busy = !(dev.time_left() == attotime::never);
bool busy = false;
@@ -802,20 +802,22 @@ void cischeat_state::captflag_motor_move(int side, uint16_t data)
output().set_value((side == RIGHT) ? "right" : "left", pos);
}
-CUSTOM_INPUT_MEMBER(cischeat_state::captflag_motor_pos_r)
+template <int N>
+CUSTOM_INPUT_MEMBER(captflag_state::motor_pos_r)
{
const uint8_t pos[4] = {1,0,2,3}; // -> 2,3,1,0 offsets -> 0123
- return ~pos[m_captflag_motor_pos[(uintptr_t)param]];
+ return ~pos[m_motor_pos[N]];
}
-CUSTOM_INPUT_MEMBER(cischeat_state::captflag_motor_busy_r)
+template <int N>
+READ_LINE_MEMBER(captflag_state::motor_busy_r)
{
-// timer_device & dev = ((side == RIGHT) ? m_captflag_motor_right : m_captflag_motor_left);
+// timer_device & dev = ((side == RIGHT) ? m_motor_right : m_motor_left);
// return (dev.time_left() == attotime::never) ? 0 : 1;
return 0;
}
-void cischeat_state::captflag_map(address_map &map)
+void captflag_state::captflag_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x082000, 0x082005).w("scroll0", FUNC(megasys1_tilemap_device::scroll_w));
@@ -827,24 +829,24 @@ void cischeat_state::captflag_map(address_map &map)
map(0x0b0000, 0x0b7fff).ram().w("scroll2", FUNC(megasys1_tilemap_device::write)).share("scroll2"); // Scroll RAM 2
map(0x0b8000, 0x0bffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x0f0000, 0x0fffff).ram().share("ram"); // Work RAM + Spriteram
- map(0x100000, 0x100001).portr("SW1_2").w(FUNC(cischeat_state::captflag_oki_bank_w)); // 2 x DSW + Sound
- map(0x100008, 0x100009).portr("Buttons").w(FUNC(cischeat_state::captflag_leds_w)); // Buttons + Leds
+ map(0x100000, 0x100001).portr("SW1_2").w(FUNC(captflag_state::oki_bank_w)); // 2 x DSW + Sound
+ map(0x100008, 0x100009).portr("Buttons").w(FUNC(captflag_state::leds_w)); // Buttons + Leds
map(0x100015, 0x100015).rw(m_oki1, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound
map(0x100019, 0x100019).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //
- map(0x10001c, 0x10001d).w(FUNC(cischeat_state::scudhamm_enable_w)); // ?
+ map(0x10001c, 0x10001d).w(FUNC(captflag_state::scudhamm_enable_w)); // ?
map(0x100040, 0x100041).portr("SW01"); // DSW + Motor
- map(0x100044, 0x100045).w(FUNC(cischeat_state::captflag_motor_command_left_w)); // Motor Command (Left)
- map(0x100048, 0x100049).w(FUNC(cischeat_state::captflag_motor_command_right_w)); // Motor Command (Right)
+ map(0x100044, 0x100045).w(FUNC(captflag_state::motor_command_left_w)); // Motor Command (Left)
+ map(0x100048, 0x100049).w(FUNC(captflag_state::motor_command_right_w)); // Motor Command (Right)
map(0x100060, 0x10007f).ram().share("nvram"); // NVRAM (even bytes only)
}
-void cischeat_state::captflag_oki1_map(address_map &map)
+void captflag_state::oki1_map(address_map &map)
{
map(0x00000, 0x1ffff).rom();
map(0x20000, 0x3ffff).bankr("oki1_bank");
}
-void cischeat_state::captflag_oki2_map(address_map &map)
+void captflag_state::oki2_map(address_map &map)
{
map(0x00000, 0x1ffff).rom();
map(0x20000, 0x3ffff).bankr("oki2_bank");
@@ -1752,11 +1754,11 @@ static INPUT_PORTS_START( captflag )
PORT_DIPUNKNOWN_DIPLOC( 0x8000, 0x8000, "SW2:8" )
PORT_START("SW01")
- PORT_BIT( 0x0003, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, cischeat_state, captflag_motor_pos_r, (void *)LEFT)
- PORT_BIT( 0x000c, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, cischeat_state, captflag_motor_pos_r, (void *)RIGHT)
+ PORT_BIT( 0x0003, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(captflag_state, motor_pos_r<LEFT>)
+ PORT_BIT( 0x000c, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(captflag_state, motor_pos_r<RIGHT>)
- PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, cischeat_state, captflag_motor_busy_r, (void *)LEFT)
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, cischeat_state, captflag_motor_busy_r, (void *)RIGHT)
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(captflag_state, motor_busy_r<LEFT>)
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(captflag_state, motor_busy_r<RIGHT>)
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW01:1,2")
PORT_DIPSETTING( 0x0000, DEF_STR( Easy ) )
@@ -2157,7 +2159,7 @@ void cischeat_state::armchmp2(machine_config &config)
4-7] rte
*/
-TIMER_DEVICE_CALLBACK_MEMBER(cischeat_state::captflag_scanline)
+TIMER_DEVICE_CALLBACK_MEMBER(captflag_state::captflag_scanline)
{
int scanline = param;
@@ -2168,14 +2170,14 @@ TIMER_DEVICE_CALLBACK_MEMBER(cischeat_state::captflag_scanline)
m_maincpu->set_input_line(3, HOLD_LINE);
}
-void cischeat_state::captflag(machine_config &config)
+void captflag_state::captflag(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(24'000'000) / 2); // TMP68000P-12
- m_maincpu->set_addrmap(AS_PROGRAM, &cischeat_state::captflag_map);
- TIMER(config, "scantimer").configure_scanline(FUNC(cischeat_state::captflag_scanline), "screen", 0, 1);
+ m_maincpu->set_addrmap(AS_PROGRAM, &captflag_state::captflag_map);
+ TIMER(config, "scantimer").configure_scanline(FUNC(captflag_state::captflag_scanline), "screen", 0, 1);
- TICKET_DISPENSER(config, m_captflag_hopper, attotime::from_msec(2000), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH );
+ TICKET_DISPENSER(config, m_hopper, attotime::from_msec(2000), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH );
WATCHDOG_TIMER(config, m_watchdog);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -2187,7 +2189,7 @@ void cischeat_state::captflag(machine_config &config)
// m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500 * 3) /* not accurate */);
m_screen->set_size(256, 256);
m_screen->set_visarea(0, 256-1, 0 +16, 256-1 -16);
- m_screen->set_screen_update(FUNC(cischeat_state::screen_update_scudhamm));
+ m_screen->set_screen_update(FUNC(captflag_state::screen_update_scudhamm));
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_scudhamm);
@@ -2198,8 +2200,8 @@ void cischeat_state::captflag(machine_config &config)
MEGASYS1_TILEMAP(config, m_tmap[2], m_palette, 0x4e00/2);
// Motors
- TIMER(config, m_captflag_motor_left).configure_generic(timer_device::expired_delegate());
- TIMER(config, m_captflag_motor_right).configure_generic(timer_device::expired_delegate());
+ TIMER(config, m_motor_left).configure_generic(timer_device::expired_delegate());
+ TIMER(config, m_motor_right).configure_generic(timer_device::expired_delegate());
// Layout
config.set_default_layout(layout_captflag);
@@ -2209,12 +2211,12 @@ void cischeat_state::captflag(machine_config &config)
SPEAKER(config, "rspeaker").front_right();
OKIM6295(config, m_oki1, 4000000/2, okim6295_device::PIN7_HIGH); // pin 7 not verified
- m_oki1->set_addrmap(0, &cischeat_state::captflag_oki1_map);
+ m_oki1->set_addrmap(0, &captflag_state::oki1_map);
m_oki1->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
m_oki1->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
OKIM6295(config, m_oki2, 4000000/2, okim6295_device::PIN7_HIGH); // pin 7 not verified
- m_oki2->set_addrmap(0, &cischeat_state::captflag_oki2_map);
+ m_oki2->set_addrmap(0, &captflag_state::oki2_map);
m_oki2->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
m_oki2->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
}
@@ -3711,7 +3713,7 @@ ROM_START( captflag )
ROM_LOAD( "mr92027-09_w26.ic18", 0x000000, 0x100000, CRC(3aaa332a) SHA1(6c19364069e0b077a07ac4f9c4b0cf0c0985a42a) ) // 1 on the PCB
ROM_END
-void cischeat_state::init_captflag()
+void captflag_state::init_captflag()
{
m_oki1_bank->configure_entries(0, 0x100000 / 0x20000, memregion("oki1")->base(), 0x20000);
m_oki2_bank->configure_entries(0, 0x100000 / 0x20000, memregion("oki2")->base(), 0x20000);
@@ -3736,5 +3738,5 @@ GAME( 1992, armchmp2o2,armchmp2, armchmp2, armchmp2, cischeat_state, empty_init
GAME( 1992, armchmp2o, armchmp2, armchmp2, armchmp2, cischeat_state, empty_init, ROT270, "Jaleco", "Arm Champs II (ver 1.7)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1992, wildplt, 0, wildplt, wildplt, wildplt_state, init_f1gpstar, ROT0, "Jaleco", "Wild Pilot", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // busted timings
GAMEL( 1993, f1gpstr2, 0, f1gpstr2, f1gpstr2, cischeat_state, init_f1gpstar, ROT0, "Jaleco", "F-1 Grand Prix Star II", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN, layout_f1gpstar )
-GAME( 1993, captflag, 0, captflag, captflag, cischeat_state, init_captflag, ROT270, "Jaleco", "Captain Flag (Japan)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1993, captflag, 0, captflag, captflag, captflag_state, init_captflag, ROT270, "Jaleco", "Captain Flag (Japan)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1994, scudhamm, 0, scudhamm, scudhamm, cischeat_state, empty_init, ROT270, "Jaleco", "Scud Hammer", MACHINE_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/cloud9.cpp b/src/mame/drivers/cloud9.cpp
index cf3855fe764..7d6cd992daf 100644
--- a/src/mame/drivers/cloud9.cpp
+++ b/src/mame/drivers/cloud9.cpp
@@ -142,7 +142,7 @@ TIMER_CALLBACK_MEMBER(cloud9_state::clock_irq)
}
-CUSTOM_INPUT_MEMBER(cloud9_state::get_vblank)
+READ_LINE_MEMBER(cloud9_state::vblank_r)
{
int scanline = m_screen->vpos();
return (~m_syncprom[scanline & 0xff] >> 1) & 1;
@@ -289,7 +289,7 @@ static INPUT_PORTS_START( cloud9 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cloud9_state,get_vblank, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cloud9_state, vblank_r)
PORT_START("IN1")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -330,7 +330,7 @@ static INPUT_PORTS_START( firebeas )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cloud9_state,get_vblank, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cloud9_state, vblank_r)
PORT_START("IN1")
PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/cop01.cpp b/src/mame/drivers/cop01.cpp
index 06a8329f43a..23b78715bdd 100644
--- a/src/mame/drivers/cop01.cpp
+++ b/src/mame/drivers/cop01.cpp
@@ -102,10 +102,10 @@ READ8_MEMBER(cop01_state::cop01_sound_command_r)
}
-CUSTOM_INPUT_MEMBER(cop01_state::mightguy_area_r)
+template <int Mask>
+READ_LINE_MEMBER(cop01_state::mightguy_area_r)
{
- int bit_mask = (uintptr_t)param;
- return (ioport("FAKE")->read() & bit_mask) ? 0x01 : 0x00;
+ return (ioport("FAKE")->read() & Mask) ? 1 : 0;
}
WRITE8_MEMBER(cop01_state::cop01_irq_ack_w)
@@ -329,7 +329,7 @@ static INPUT_PORTS_START( mightguy )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cop01_state,mightguy_area_r, (void *)0x04) // "Start Area" - see fake Dip Switch
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cop01_state, mightguy_area_r<0x04>) // "Start Area" - see fake Dip Switch
PORT_START("DSW2")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
@@ -347,8 +347,8 @@ static INPUT_PORTS_START( mightguy )
PORT_DIPSETTING( 0x20, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, "Invincibility")
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cop01_state,mightguy_area_r, (void *)0x01) // "Start Area" - see fake Dip Switch
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cop01_state,mightguy_area_r, (void *)0x02) // "Start Area" - see fake Dip Switch
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cop01_state, mightguy_area_r<0x01>) // "Start Area" - see fake Dip Switch
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cop01_state, mightguy_area_r<0x02>) // "Start Area" - see fake Dip Switch
PORT_START("FAKE") /* FAKE Dip Switch */
PORT_DIPNAME( 0x07, 0x07, "Starting Area" )
diff --git a/src/mame/drivers/crbaloon.cpp b/src/mame/drivers/crbaloon.cpp
index ff32e1de93e..b0e0f99fd6f 100644
--- a/src/mame/drivers/crbaloon.cpp
+++ b/src/mame/drivers/crbaloon.cpp
@@ -295,7 +295,7 @@ static INPUT_PORTS_START( crbaloon )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Name Reset")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, crbaloon_state,pc3092_r, nullptr)
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(crbaloon_state, pc3092_r)
PORT_START("PC3092")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
diff --git a/src/mame/drivers/crimfght.cpp b/src/mame/drivers/crimfght.cpp
index 8a9fbcd2cc1..cc1b9cb146d 100644
--- a/src/mame/drivers/crimfght.cpp
+++ b/src/mame/drivers/crimfght.cpp
@@ -183,7 +183,7 @@ static INPUT_PORTS_START( crimfght )
PORT_DIPUNUSED_DIPLOC(0x02, IP_ACTIVE_LOW, "SW3:2")
PORT_SERVICE_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW3:3")
PORT_DIPUNUSED_DIPLOC(0x08, IP_ACTIVE_LOW, "SW3:4")
- PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, crimfght_state, system_r, nullptr)
+ PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(crimfght_state, system_r)
PORT_START("P1")
KONAMI8_B123_START(1)
diff --git a/src/mame/drivers/cubo.cpp b/src/mame/drivers/cubo.cpp
index 3ccd4f22fc2..50cf4c71f52 100644
--- a/src/mame/drivers/cubo.cpp
+++ b/src/mame/drivers/cubo.cpp
@@ -336,7 +336,7 @@ public:
uint16_t handle_joystick_potgor(uint16_t potgor);
DECLARE_CUSTOM_INPUT_MEMBER(cubo_input);
- DECLARE_CUSTOM_INPUT_MEMBER(cd32_sel_mirror_input);
+ template <int P> DECLARE_READ_LINE_MEMBER(cd32_sel_mirror_input);
DECLARE_WRITE_LINE_MEMBER( akiko_int_w );
DECLARE_WRITE8_MEMBER( akiko_cia_0_port_a_write );
@@ -534,9 +534,10 @@ CUSTOM_INPUT_MEMBER( cubo_state::cubo_input )
return handle_joystick_potgor(m_potgo_value) >> 8;
}
-CUSTOM_INPUT_MEMBER( cubo_state::cd32_sel_mirror_input )
+template <int P>
+READ_LINE_MEMBER( cubo_state::cd32_sel_mirror_input )
{
- uint8_t bits = m_player_ports[(int)(uintptr_t)param]->read();
+ uint8_t bits = m_player_ports[P]->read();
return (bits & 0x20)>>5;
}
@@ -546,22 +547,22 @@ static INPUT_PORTS_START( cubo )
PORT_START("CIA0PORTA")
PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_CUSTOM )
/* this is the regular port for reading a single button joystick on the Amiga, many CD32 games require this to mirror the pad start button! */
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cubo_state,cd32_sel_mirror_input, (void *)1)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cubo_state,cd32_sel_mirror_input, (void *)0)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cubo_state, cd32_sel_mirror_input<1>)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(cubo_state, cd32_sel_mirror_input<0>)
PORT_START("CIA0PORTB")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("joy_0_dat")
- PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cubo_state, amiga_joystick_convert, (void *)1)
+ PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(cubo_state, amiga_joystick_convert<1>)
PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("joy_1_dat")
- PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cubo_state, amiga_joystick_convert, (void *)0)
+ PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(cubo_state, amiga_joystick_convert<0>)
PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("potgo")
- PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cubo_state,cubo_input, nullptr)
+ PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(cubo_state, cubo_input)
PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
diff --git a/src/mame/drivers/cyclemb.cpp b/src/mame/drivers/cyclemb.cpp
index 7c5e4a10c77..45a625d8ca5 100644
--- a/src/mame/drivers/cyclemb.cpp
+++ b/src/mame/drivers/cyclemb.cpp
@@ -708,7 +708,7 @@ static INPUT_PORTS_START( cyclemb )
PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("P1_1")
- PORT_BIT( 0x9f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cyclemb_state, pad_r<0>, nullptr)
+ PORT_BIT( 0x9f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(cyclemb_state, pad_r<0>)
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("PAD_P1")
@@ -731,7 +731,7 @@ static INPUT_PORTS_START( cyclemb )
PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("P2_1")
- PORT_BIT( 0x9f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cyclemb_state, pad_r<1>, nullptr)
+ PORT_BIT( 0x9f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(cyclemb_state, pad_r<1>)
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("PAD_P2")
diff --git a/src/mame/drivers/dacholer.cpp b/src/mame/drivers/dacholer.cpp
index 338307f87a1..015d0fa5834 100644
--- a/src/mame/drivers/dacholer.cpp
+++ b/src/mame/drivers/dacholer.cpp
@@ -62,7 +62,7 @@ public:
void itaten(machine_config &config);
void dacholer(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(snd_ack_r);
+ DECLARE_READ_LINE_MEMBER(snd_ack_r);
private:
DECLARE_WRITE8_MEMBER(bg_scroll_x_w);
@@ -302,7 +302,7 @@ WRITE8_MEMBER(dacholer_state::snd_ack_w)
m_snd_ack = data;
}
-CUSTOM_INPUT_MEMBER(dacholer_state::snd_ack_r)
+READ_LINE_MEMBER(dacholer_state::snd_ack_r)
{
return m_snd_ack; //guess ...
}
@@ -382,7 +382,7 @@ static INPUT_PORTS_START( dacholer )
PORT_DIPSETTING( 0x04, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dacholer_state,snd_ack_r, nullptr)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(dacholer_state, snd_ack_r)
PORT_START("DSWB")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) /* table at 0x0a9c */
diff --git a/src/mame/drivers/dcheese.cpp b/src/mame/drivers/dcheese.cpp
index 2c13dd86b9a..21d57cd27f5 100644
--- a/src/mame/drivers/dcheese.cpp
+++ b/src/mame/drivers/dcheese.cpp
@@ -111,12 +111,6 @@ void dcheese_state::machine_start()
*
*************************************/
-CUSTOM_INPUT_MEMBER(dcheese_state::sound_latch_state_r)
-{
- return m_soundlatch->pending_r();
-}
-
-
WRITE16_MEMBER(dcheese_state::eeprom_control_w)
{
/* toggles bit $0100 very frequently while waiting for things */
@@ -245,7 +239,7 @@ static INPUT_PORTS_START( dcheese )
PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r)
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* sound->main buffer status (0=empty) */
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dcheese_state,sound_latch_state_r, nullptr)
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r)
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_VOLUME_DOWN )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -295,7 +289,7 @@ static INPUT_PORTS_START( lottof2 )
PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r)
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* sound->main buffer status (0=empty) */
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dcheese_state,sound_latch_state_r, nullptr)
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r)
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_VOLUME_DOWN )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -343,7 +337,7 @@ static INPUT_PORTS_START( fredmem )
PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r)
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* sound->main buffer status (0=empty) */
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dcheese_state,sound_latch_state_r, nullptr)
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r)
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_VOLUME_DOWN )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/ddayjlc.cpp b/src/mame/drivers/ddayjlc.cpp
index a6a77990714..02a18490774 100644
--- a/src/mame/drivers/ddayjlc.cpp
+++ b/src/mame/drivers/ddayjlc.cpp
@@ -454,7 +454,7 @@ static INPUT_PORTS_START( ddayjlc )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SERVICE1 )
- PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ddayjlc_state,prot_r, nullptr)
+ PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(ddayjlc_state, prot_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("DSW1")
diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp
index 4c37d3f68d4..3f5f3bc44a2 100644
--- a/src/mame/drivers/ddenlovr.cpp
+++ b/src/mame/drivers/ddenlovr.cpp
@@ -212,7 +212,7 @@ public:
void init_rongrong();
void init_momotaro();
- DECLARE_CUSTOM_INPUT_MEMBER(ddenlovr_blitter_irq_r);
+ DECLARE_READ_LINE_MEMBER(blitter_irq_r);
DECLARE_CUSTOM_INPUT_MEMBER(ddenlovj_blitter_r);
DECLARE_CUSTOM_INPUT_MEMBER(nettoqc_special_r);
DECLARE_CUSTOM_INPUT_MEMBER(mjflove_blitter_r);
@@ -1748,7 +1748,7 @@ uint32_t ddenlovr_state::screen_update_ddenlovr(screen_device &screen, bitmap_rg
return 0;
}
-CUSTOM_INPUT_MEMBER(ddenlovr_state::ddenlovr_blitter_irq_r)
+READ_LINE_MEMBER(ddenlovr_state::blitter_irq_r)
{
return m_ddenlovr_blitter_irq_flag;
}
@@ -4548,7 +4548,7 @@ static INPUT_PORTS_START( ddenlovj )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) /* Test */
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) // blitter busy flag
- PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ddenlovr_state,ddenlovj_blitter_r, nullptr) // blitter irq flag? (bit 5) & RTC (bit 6)
+ PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(ddenlovr_state, ddenlovj_blitter_r) // blitter irq flag? (bit 5) & RTC (bit 6)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM )
PORT_START("DSW1")
@@ -4654,7 +4654,7 @@ static INPUT_PORTS_START( ddenlovr )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) /* Test */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) // ? quiz365
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ddenlovr_state,ddenlovr_blitter_irq_r, nullptr) // blitter irq flag
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ddenlovr_state, blitter_irq_r) // blitter irq flag
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) // blitter busy flag
PORT_START("DSW")
@@ -4709,7 +4709,7 @@ static INPUT_PORTS_START( nettoqc )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) /* Test */
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) // blitter busy flag
- PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ddenlovr_state,nettoqc_special_r, nullptr) // ? (bit 5) & blitter irq flag (bit 6)
+ PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(ddenlovr_state, nettoqc_special_r) // ? (bit 5) & blitter irq flag (bit 6)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM )
PORT_START("DSW1")
@@ -4807,7 +4807,7 @@ static INPUT_PORTS_START( ultrchmp )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) /* Test */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ddenlovr_state,ddenlovr_blitter_irq_r, nullptr) // blitter irq flag
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ddenlovr_state, blitter_irq_r) // blitter irq flag
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) // blitter busy flag
PORT_START("DSW")
@@ -4987,7 +4987,7 @@ static INPUT_PORTS_START( quiz365 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) /* Test */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) // ? quiz365
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ddenlovr_state,ddenlovr_blitter_irq_r, nullptr) // blitter irq flag
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ddenlovr_state, blitter_irq_r) // blitter irq flag
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) // blitter busy flag
PORT_START("DSW1")
@@ -8089,7 +8089,7 @@ static INPUT_PORTS_START( mjflove )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) PORT_TOGGLE
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ddenlovr_state,mjflove_blitter_r, nullptr) // RTC (bit 5) & blitter irq flag (bit 6)
+ PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(ddenlovr_state, mjflove_blitter_r) // RTC (bit 5) & blitter irq flag (bit 6)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) // blitter busy flag
PORT_START("KEY0")
diff --git a/src/mame/drivers/ddragon.cpp b/src/mame/drivers/ddragon.cpp
index 70fdc54f3cc..d9f13ffd2b0 100644
--- a/src/mame/drivers/ddragon.cpp
+++ b/src/mame/drivers/ddragon.cpp
@@ -332,7 +332,7 @@ WRITE8_MEMBER(ddragon_state::ddragonba_port_w)
*
*************************************/
-CUSTOM_INPUT_MEMBER(ddragon_state::subcpu_bus_free)
+READ_LINE_MEMBER(ddragon_state::subcpu_bus_free_r)
{
// Corresponds to BA (Bus Available) on the HD63701
if (m_subcpu)
@@ -680,7 +680,7 @@ static INPUT_PORTS_START( ddragon )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ddragon_state, subcpu_bus_free, nullptr)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ddragon_state, subcpu_bus_free_r)
PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
diff --git a/src/mame/drivers/ddragon3.cpp b/src/mame/drivers/ddragon3.cpp
index 746b587b3a3..d0128d7c991 100644
--- a/src/mame/drivers/ddragon3.cpp
+++ b/src/mame/drivers/ddragon3.cpp
@@ -270,16 +270,16 @@ WRITE8_MEMBER(wwfwfest_state::wwfwfest_priority_w)
/* DIPs are spread across the other input ports */
+template <int N>
CUSTOM_INPUT_MEMBER(wwfwfest_state::dsw_3f_r)
{
- const char *tag = (const char *)param;
- return ioport(tag)->read() & 0x3f;
+ return m_dsw[N]->read() & 0x3f;
}
+template <int N>
CUSTOM_INPUT_MEMBER(wwfwfest_state::dsw_c0_r)
{
- const char *tag = (const char *)param;
- return (ioport(tag)->read() & 0xc0) >> 6;
+ return (m_dsw[N]->read() & 0xc0) >> 6;
}
@@ -604,7 +604,7 @@ static INPUT_PORTS_START( wwfwfest )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x3000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wwfwfest_state,dsw_c0_r, "DSW2")
+ PORT_BIT( 0x3000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(wwfwfest_state, dsw_c0_r<1>)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -617,7 +617,7 @@ static INPUT_PORTS_START( wwfwfest )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x3f00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wwfwfest_state,dsw_3f_r, "DSW2")
+ PORT_BIT( 0x3f00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(wwfwfest_state, dsw_3f_r<1>)
PORT_START("P3")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
@@ -628,7 +628,7 @@ static INPUT_PORTS_START( wwfwfest )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START3 )
- PORT_BIT( 0x3f00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wwfwfest_state,dsw_3f_r, "DSW1")
+ PORT_BIT( 0x3f00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(wwfwfest_state, dsw_3f_r<0>)
PORT_START("P4")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
@@ -639,7 +639,7 @@ static INPUT_PORTS_START( wwfwfest )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START4 )
- PORT_BIT( 0x0300, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wwfwfest_state,dsw_c0_r, "DSW1")
+ PORT_BIT( 0x0300, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(wwfwfest_state, dsw_c0_r<0>)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/deco_ld.cpp b/src/mame/drivers/deco_ld.cpp
index 553b43ece79..f8adb56d08d 100644
--- a/src/mame/drivers/deco_ld.cpp
+++ b/src/mame/drivers/deco_ld.cpp
@@ -140,7 +140,7 @@ public:
void rblaster(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(begas_vblank_r);
+ DECLARE_READ_LINE_MEMBER(begas_vblank_r);
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
private:
@@ -318,7 +318,7 @@ void deco_ld_state::rblaster_sound_map(address_map &map)
map(0xe000, 0xffff).rom();
}
-CUSTOM_INPUT_MEMBER( deco_ld_state::begas_vblank_r )
+READ_LINE_MEMBER( deco_ld_state::begas_vblank_r )
{
return m_screen->vpos() >= 240*2;
}
@@ -361,7 +361,7 @@ static INPUT_PORTS_START( begas )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,deco_ld_state,begas_vblank_r, nullptr) // TODO: IPT_VBLANK doesn't seem to work fine?
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(deco_ld_state, begas_vblank_r) // TODO: IPT_VBLANK doesn't seem to work fine?
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x01, "DSWA" )
diff --git a/src/mame/drivers/dlair.cpp b/src/mame/drivers/dlair.cpp
index 4c2ef3c9511..29a1cbcc035 100644
--- a/src/mame/drivers/dlair.cpp
+++ b/src/mame/drivers/dlair.cpp
@@ -69,8 +69,8 @@ public:
{
}
- DECLARE_CUSTOM_INPUT_MEMBER(laserdisc_status_r);
- DECLARE_CUSTOM_INPUT_MEMBER(laserdisc_command_r);
+ DECLARE_READ_LINE_MEMBER(laserdisc_status_r);
+ DECLARE_READ_LINE_MEMBER(laserdisc_command_r);
void init_fixed();
void init_variable();
@@ -106,7 +106,7 @@ private:
return CLEAR_LINE;
}
- uint8_t laserdisc_status_r()
+ uint8_t laserdisc_status_strobe_r()
{
if (m_ldv1000 != nullptr) return m_ldv1000->status_strobe_r();
return CLEAR_LINE;
@@ -343,13 +343,13 @@ WRITE8_MEMBER(dlair_state::led_den2_w)
*
*************************************/
-CUSTOM_INPUT_MEMBER(dlair_state::laserdisc_status_r)
+READ_LINE_MEMBER(dlair_state::laserdisc_status_r)
{
- return laserdisc_status_r();
+ return laserdisc_status_strobe_r();
}
-CUSTOM_INPUT_MEMBER(dlair_state::laserdisc_command_r)
+READ_LINE_MEMBER(dlair_state::laserdisc_command_r)
{
return (laserdisc_ready_r() == ASSERT_LINE) ? 0 : 1;
}
@@ -563,8 +563,8 @@ static INPUT_PORTS_START( dlair )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dlair_state,laserdisc_status_r, nullptr) /* status strobe */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dlair_state,laserdisc_command_r, nullptr) /* command strobe */
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(dlair_state, laserdisc_status_r) /* status strobe */
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(dlair_state, laserdisc_command_r) /* command strobe */
INPUT_PORTS_END
@@ -595,8 +595,8 @@ static INPUT_PORTS_START( dleuro )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dlair_state,laserdisc_status_r, nullptr) /* status strobe */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dlair_state,laserdisc_command_r, nullptr) /* command strobe */
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(dlair_state, laserdisc_status_r) /* status strobe */
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(dlair_state, laserdisc_command_r) /* command strobe */
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("A:1")
diff --git a/src/mame/drivers/ecoinfr.cpp b/src/mame/drivers/ecoinfr.cpp
index 35590fbb350..51081e9667f 100644
--- a/src/mame/drivers/ecoinfr.cpp
+++ b/src/mame/drivers/ecoinfr.cpp
@@ -67,9 +67,9 @@ public:
void init_ecoinfr();
void init_ecoinfrmab();
- DECLARE_CUSTOM_INPUT_MEMBER(ecoinfr_reel1_opto_r);
- DECLARE_CUSTOM_INPUT_MEMBER(ecoinfr_reel2_opto_r);
- DECLARE_CUSTOM_INPUT_MEMBER(ecoinfr_reel3_opto_r);
+ DECLARE_READ_LINE_MEMBER(reel1_opto_r);
+ DECLARE_READ_LINE_MEMBER(reel2_opto_r);
+ DECLARE_READ_LINE_MEMBER(reel3_opto_r);
private:
int irq_toggle;
@@ -515,19 +515,19 @@ void ecoinfr_state::portmap(address_map &map)
map(0x18, 0x18).w(FUNC(ecoinfr_state::ec_port18_out_w)); // 24 (Watchdog)
}
-CUSTOM_INPUT_MEMBER(ecoinfr_state::ecoinfr_reel1_opto_r)
+READ_LINE_MEMBER(ecoinfr_state::reel1_opto_r)
{
if (m_optic_pattern & 0x1) return 1;
return 0;
}
-CUSTOM_INPUT_MEMBER(ecoinfr_state::ecoinfr_reel2_opto_r)
+READ_LINE_MEMBER(ecoinfr_state::reel2_opto_r)
{
if (m_optic_pattern & 0x2) return 1;
return 0;
}
-CUSTOM_INPUT_MEMBER(ecoinfr_state::ecoinfr_reel3_opto_r)
+READ_LINE_MEMBER(ecoinfr_state::reel3_opto_r)
{
if (m_optic_pattern & 0x4) return 1;
return 0;
@@ -561,12 +561,12 @@ static INPUT_PORTS_START( ecoinfr_barx )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ecoinfr_state,ecoinfr_reel1_opto_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ecoinfr_state, reel1_opto_r)
PORT_DIPNAME( 0x02, 0x02, "IN1:02" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ecoinfr_state,ecoinfr_reel3_opto_r, nullptr)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ecoinfr_state,ecoinfr_reel2_opto_r, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ecoinfr_state, reel3_opto_r)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ecoinfr_state, reel2_opto_r)
PORT_DIPNAME( 0x10, 0x10, "IN1:10" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
diff --git a/src/mame/drivers/enigma2.cpp b/src/mame/drivers/enigma2.cpp
index f700ea1eacc..cc0609461aa 100644
--- a/src/mame/drivers/enigma2.cpp
+++ b/src/mame/drivers/enigma2.cpp
@@ -502,14 +502,14 @@ static INPUT_PORTS_START( enigma2 )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
- PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, enigma2_state,p1_controls_r, nullptr)
+ PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p1_controls_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, enigma2_state,p2_controls_r, nullptr)
+ PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p2_controls_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("DSW")
@@ -557,7 +557,7 @@ static INPUT_PORTS_START( enigma2a )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, enigma2_state,p1_controls_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p1_controls_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN1")
@@ -565,7 +565,7 @@ static INPUT_PORTS_START( enigma2a )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, enigma2_state,p2_controls_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p2_controls_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("DSW")
diff --git a/src/mame/drivers/eolith.cpp b/src/mame/drivers/eolith.cpp
index 1eab7cba8c2..32abd745d10 100644
--- a/src/mame/drivers/eolith.cpp
+++ b/src/mame/drivers/eolith.cpp
@@ -277,7 +277,7 @@ static INPUT_PORTS_START( common )
PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, eolith_state, eolith_speedup_getvblank, nullptr)
+ PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(eolith_state, speedup_vblank_r)
PORT_BIT( 0x00003f80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00008000, IP_ACTIVE_LOW )
@@ -515,7 +515,7 @@ static INPUT_PORTS_START( stealsee )
PORT_INCLUDE(common)
PORT_MODIFY("IN0")
- PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, eolith_state, stealsee_speedup_getvblank, nullptr)
+ PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(eolith_state, stealsee_speedup_vblank_r)
INPUT_PORTS_END
@@ -1726,7 +1726,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(eolith_state::eolith_speedup)
}
}
-CUSTOM_INPUT_MEMBER(eolith_state::eolith_speedup_getvblank)
+READ_LINE_MEMBER(eolith_state::speedup_vblank_r)
{
// printf("%s:eolith speedup_read data %02x\n",machine().describe_context().c_str(), m_speedup_vblank);
@@ -1735,7 +1735,7 @@ CUSTOM_INPUT_MEMBER(eolith_state::eolith_speedup_getvblank)
}
// StealSee doesn't use interrupts, just the vblank
-CUSTOM_INPUT_MEMBER(eolith_state::stealsee_speedup_getvblank)
+READ_LINE_MEMBER(eolith_state::stealsee_speedup_vblank_r)
{
int pc = m_maincpu->pc();
diff --git a/src/mame/drivers/eolith16.cpp b/src/mame/drivers/eolith16.cpp
index 882c27ad7fd..baa2558ed80 100644
--- a/src/mame/drivers/eolith16.cpp
+++ b/src/mame/drivers/eolith16.cpp
@@ -90,7 +90,7 @@ void eolith16_state::eolith16_map(address_map &map)
static INPUT_PORTS_START( eolith16 )
PORT_START("SPECIAL")
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, eolith16_state, eolith_speedup_getvblank, nullptr)
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(eolith16_state, speedup_vblank_r)
PORT_BIT( 0xff6f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SYSTEM")
diff --git a/src/mame/drivers/equites.cpp b/src/mame/drivers/equites.cpp
index 3e3c6839c37..a066ec22e83 100644
--- a/src/mame/drivers/equites.cpp
+++ b/src/mame/drivers/equites.cpp
@@ -583,7 +583,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(splndrbt_state::splndrbt_scanline)
/******************************************************************************/
// CPU Handlers
-CUSTOM_INPUT_MEMBER(gekisou_state::gekisou_unknown_bit_r)
+READ_LINE_MEMBER(gekisou_state::gekisou_unknown_bit_r)
{
return m_gekisou_unknown_bit;
}
@@ -791,7 +791,7 @@ static INPUT_PORTS_START( gekisou )
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
- PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gekisou_state, gekisou_unknown_bit_r, nullptr)
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(gekisou_state, gekisou_unknown_bit_r)
/* this is actually a variable resistor */
PORT_START(FRQ_ADJUSTER_TAG)
diff --git a/src/mame/drivers/exerion.cpp b/src/mame/drivers/exerion.cpp
index 93afe3231ea..f89a3242dd4 100644
--- a/src/mame/drivers/exerion.cpp
+++ b/src/mame/drivers/exerion.cpp
@@ -237,7 +237,7 @@ void exerion_state::sub_map(address_map &map)
/* verified from Z80 code */
static INPUT_PORTS_START( exerion )
PORT_START("IN0")
- PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exerion_state, exerion_controls_r, nullptr)
+ PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(exerion_state, exerion_controls_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
diff --git a/src/mame/drivers/exidy.cpp b/src/mame/drivers/exidy.cpp
index 79313769fb4..923554137f8 100644
--- a/src/mame/drivers/exidy.cpp
+++ b/src/mame/drivers/exidy.cpp
@@ -638,7 +638,7 @@ static INPUT_PORTS_START( teetert )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x44, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy_state,teetert_input_r, nullptr)
+ PORT_BIT( 0x44, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(exidy_state, teetert_input_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1449,6 +1449,30 @@ ROM_START( venture4 )
ROM_END
+ROM_START( venture2b )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "d2732.2s", 0x8000, 0x1000, CRC(87d69fe9) SHA1(d5ccf71af478873f32e23530a62515327f39f672) ) // only unique program ROM
+ ROM_LOAD( "d2732.2r", 0x9000, 0x1000, CRC(8163cefc) SHA1(7061819dd1105e8368c045dad2effae62d124539) )
+ ROM_LOAD( "d2732.2n", 0xa000, 0x1000, CRC(324a5054) SHA1(f845ff2f717ea627891e0dc9d6e66f690c0843d8) )
+ ROM_LOAD( "d2732.2m", 0xb000, 0x1000, CRC(24358203) SHA1(10c3ea83a892d6fd2751e590afe45bffa65bd6e0) )
+ ROM_LOAD( "d2732.2l", 0xc000, 0x1000, CRC(04428165) SHA1(6d8d860ce1f805ba2eb315f47c8660799256e921) )
+ ROM_LOAD( "d2732.2k", 0xd000, 0x1000, CRC(4c1a702a) SHA1(7f6a68d3cfdd885108eebb7ea76b3c2ce6070b18) )
+ ROM_LOAD( "d2732.2h", 0xe000, 0x1000, CRC(1aab27c2) SHA1(66c7274dbb8bda3c78cc61d96a6cb1a9b29939b5) )
+ ROM_LOAD( "d2732.2f", 0xf000, 0x1000, CRC(767bdd71) SHA1(334a903e05fc86186f90aa2d9ce3b0d367d7e516) )
+
+ ROM_REGION( 0x8000, "soundbd:audiocpu", 0 )
+ ROM_LOAD( "tms2516.10f", 0x5800, 0x0800, CRC(4ea1c3d9) SHA1(d0c99c9d5b887d717c68e8745906ae4e65aec6ad) )
+ ROM_LOAD( "tms2564.10j", 0x6000, 0x2000, CRC(da9d8588) SHA1(b2e6509748059fc317af56d66396427c5ca78748) ) // bigger ROM, but contents identical to venture2
+
+ ROM_REGION( 0x0800, "gfx1", 0 )
+ ROM_LOAD( "tms2516.6j", 0x0000, 0x0800, CRC(ea6fd981) SHA1(46b1658e1607423d5a073f14097c2a48d59057c0) ) // GFX ROM matches venture4, instead
+
+ ROM_REGION( 0x140, "proms", 0 ) // only 2 PROMs
+ ROM_LOAD( "sn74s288n.6c", 0x0000, 0x0020, CRC(f76b4fcf) SHA1(197e0cc508ffeb5cefa4046bdfb158939d598225) )
+ ROM_LOAD( "sn74s288n.3d", 0x0120, 0x0020, CRC(e26f9053) SHA1(eec35b6aa2c2d305418306bf4a1754a0583f109f) )
+ROM_END
+
+
ROM_START( pepper2 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "main_12a", 0x9000, 0x1000, CRC(33db4737) SHA1(d8f7a5d340ddbc4d06d403c3bff0102ce637d24e) )
@@ -1771,6 +1795,7 @@ GAME( 1981, mtrapb2, mtrap, mtrap, mtrap, exidy_state, init_mtrap,
GAME( 1981, venture, 0, venture, venture, exidy_state, init_venture, ROT0, "Exidy", "Venture (version 5 set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, venture2, venture, venture, venture, exidy_state, init_venture, ROT0, "Exidy", "Venture (version 5 set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, venture4, venture, venture, venture, exidy_state, init_venture, ROT0, "Exidy", "Venture (version 4)", MACHINE_SUPPORTS_SAVE )
+GAME( 1981, venture2b, venture, venture, venture, exidy_state, init_venture, ROT0, "bootleg", "Venture (version 5 set 2, bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, teetert, 0, teetert, teetert, exidy_state, init_teetert, ROT0, "Exidy", "Teeter Torture (prototype)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/exidy440.cpp b/src/mame/drivers/exidy440.cpp
index a71c7f05624..ef28ecfd5f3 100644
--- a/src/mame/drivers/exidy440.cpp
+++ b/src/mame/drivers/exidy440.cpp
@@ -271,13 +271,13 @@ INPUT_CHANGED_MEMBER(exidy440_state::coin_inserted)
*
*************************************/
-CUSTOM_INPUT_MEMBER(exidy440_state::firq_beam_r)
+READ_LINE_MEMBER(exidy440_state::firq_beam_r)
{
return m_firq_beam;
}
-CUSTOM_INPUT_MEMBER(exidy440_state::firq_vblank_r)
+READ_LINE_MEMBER(exidy440_state::firq_vblank_r)
{
return m_firq_vblank;
}
@@ -530,8 +530,8 @@ static INPUT_PORTS_START( crossbow )
PORT_DIPSETTING( 0x30, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x20, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_beam_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_beam_r)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_START("IN1") /* audio board dips */
COINAGE
@@ -571,8 +571,8 @@ static INPUT_PORTS_START( cheyenne )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_beam_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_beam_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_START("IN1") /* audio board dips */
COINAGE
@@ -612,8 +612,8 @@ static INPUT_PORTS_START( combat )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_beam_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_beam_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_START("IN1") /* audio board dips */
COINAGE
@@ -653,8 +653,8 @@ static INPUT_PORTS_START( catch22 )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_beam_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_beam_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_START("IN1") /* audio board dips */
COINAGE
@@ -696,8 +696,8 @@ static INPUT_PORTS_START( cracksht )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_beam_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_beam_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_START("IN1") /* audio board dips */
COINAGE
@@ -734,8 +734,8 @@ static INPUT_PORTS_START( claypign )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_beam_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_beam_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_START("IN1") /* audio board dips */
COINAGE
@@ -776,8 +776,8 @@ static INPUT_PORTS_START( chiller )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_beam_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_beam_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_START("IN1") /* audio board dips */
COINAGE
@@ -815,8 +815,8 @@ static INPUT_PORTS_START( topsecex )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_beam_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_beam_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_START("IN1") /* audio board dips */
COINAGE
@@ -852,7 +852,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( hitnmiss )
PORT_START("IN0") /* player inputs and logic board dips */
- PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,hitnmiss_button1_r, nullptr)
+ PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(exidy440_state, hitnmiss_button1_r)
PORT_DIPNAME( 0x0c, 0x00, "Seconds" )
PORT_DIPSETTING( 0x04, "20" )
PORT_DIPSETTING( 0x00, "30" )
@@ -863,8 +863,8 @@ static INPUT_PORTS_START( hitnmiss )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_beam_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_beam_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_START("IN1") /* audio board dips */
COINAGE
@@ -896,7 +896,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( whodunit )
PORT_START("IN0") /* player inputs and logic board dips */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 )
PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) )
PORT_DIPSETTING( 0x04, "2" )
@@ -908,8 +908,8 @@ static INPUT_PORTS_START( whodunit )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_beam_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_beam_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_START("IN1") /* audio board dips */
COINAGE
@@ -947,8 +947,8 @@ static INPUT_PORTS_START( showdown )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_beam_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, exidy440_state,firq_vblank_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_beam_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(exidy440_state, firq_vblank_r)
PORT_START("IN1") /* audio board dips */
COINAGE
diff --git a/src/mame/drivers/famibox.cpp b/src/mame/drivers/famibox.cpp
index 5c01db664b9..fab34e49be2 100644
--- a/src/mame/drivers/famibox.cpp
+++ b/src/mame/drivers/famibox.cpp
@@ -77,7 +77,7 @@ public:
void famibox(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(famibox_coin_r);
+ DECLARE_READ_LINE_MEMBER(coin_r);
DECLARE_INPUT_CHANGED_MEMBER(famibox_keyswitch_changed);
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
@@ -421,7 +421,7 @@ INPUT_CHANGED_MEMBER(famibox_state::coin_inserted)
}
}
-CUSTOM_INPUT_MEMBER(famibox_state::famibox_coin_r)
+READ_LINE_MEMBER(famibox_state::coin_r)
{
return m_coins > 0;
}
@@ -480,7 +480,7 @@ static INPUT_PORTS_START( famibox )
PORT_DIPSETTING( 0x08, "Key position 4" )
PORT_DIPSETTING( 0x10, "Key position 5" )
PORT_DIPSETTING( 0x20, "Key position 6" )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, famibox_state,famibox_coin_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(famibox_state, coin_r)
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, famibox_state,coin_inserted, 0)
diff --git a/src/mame/drivers/fantland.cpp b/src/mame/drivers/fantland.cpp
index 77cf05ff9bb..21fce64c7a3 100644
--- a/src/mame/drivers/fantland.cpp
+++ b/src/mame/drivers/fantland.cpp
@@ -689,10 +689,10 @@ INPUT_PORTS_END
Wheels Runner
***************************************************************************/
+template <int Player>
CUSTOM_INPUT_MEMBER(fantland_state::wheelrun_wheel_r)
{
- int player = (uintptr_t)param;
- int delta = ioport(player ? "WHEEL1" : "WHEEL0")->read();
+ int delta = m_wheel[Player]->read();
delta = (delta & 0x7f) - (delta & 0x80) + 4;
if (delta > 7) delta = 7;
@@ -708,7 +708,7 @@ static INPUT_PORTS_START( wheelrun )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, fantland_state,wheelrun_wheel_r, (void *)0)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(fantland_state, wheelrun_wheel_r<0>)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("53001") /* 53001 */
@@ -716,7 +716,7 @@ static INPUT_PORTS_START( wheelrun )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, fantland_state,wheelrun_wheel_r, (void *)1)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(fantland_state, wheelrun_wheel_r<1>)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("53002") /* 53002 */
diff --git a/src/mame/drivers/fgoal.cpp b/src/mame/drivers/fgoal.cpp
index e4014e1458c..b3aca7a63ef 100644
--- a/src/mame/drivers/fgoal.cpp
+++ b/src/mame/drivers/fgoal.cpp
@@ -110,7 +110,7 @@ READ8_MEMBER(fgoal_state::analog_r)
}
-CUSTOM_INPUT_MEMBER(fgoal_state::_80_r)
+READ_LINE_MEMBER(fgoal_state::_80_r)
{
uint8_t ret = (m_screen->vpos() & 0x80) ? 1 : 0;
@@ -263,7 +263,7 @@ static INPUT_PORTS_START( fgoal )
/* extra credit score changes depending on player's performance */
PORT_START("IN1")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, fgoal_state, _80_r, nullptr) /* 128V */
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(fgoal_state, _80_r) /* 128V */
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ))
PORT_DIPSETTING( 0x00, DEF_STR( Upright ))
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ))
diff --git a/src/mame/drivers/firefox.cpp b/src/mame/drivers/firefox.cpp
index 695345457f3..ab35e22dd29 100644
--- a/src/mame/drivers/firefox.cpp
+++ b/src/mame/drivers/firefox.cpp
@@ -69,8 +69,6 @@ public:
m_mainbank(*this, "mainbank")
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(mainflag_r);
- DECLARE_CUSTOM_INPUT_MEMBER(soundflag_r);
void firefox(machine_config &config);
private:
@@ -330,16 +328,6 @@ WRITE8_MEMBER(firefox_state::firefox_objram_bank_w)
*
*************************************/
-CUSTOM_INPUT_MEMBER(firefox_state::mainflag_r)
-{
- return m_soundlatch->pending_r() ? 1 : 0;
-}
-
-CUSTOM_INPUT_MEMBER(firefox_state::soundflag_r)
-{
- return m_soundlatch2->pending_r() ? 1 : 0;
-}
-
WRITE_LINE_MEMBER(firefox_state::sound_reset_w)
{
m_audiocpu->set_input_line(INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
@@ -540,8 +528,8 @@ static INPUT_PORTS_START( firefox )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("rdin1")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firefox_state,mainflag_r, nullptr)
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firefox_state,soundflag_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch2", generic_latch_8_device, pending_r)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
diff --git a/src/mame/drivers/firetrk.cpp b/src/mame/drivers/firetrk.cpp
index ecbb92ee960..3a79bf22061 100644
--- a/src/mame/drivers/firetrk.cpp
+++ b/src/mame/drivers/firetrk.cpp
@@ -178,25 +178,27 @@ READ8_MEMBER(firetrk_state::montecar_dip_r)
}
-CUSTOM_INPUT_MEMBER(firetrk_state::steer_dir_r)
+template <int P>
+READ_LINE_MEMBER(firetrk_state::steer_dir_r)
{
- return m_steer_dir[(uintptr_t)param];
+ return m_steer_dir[P];
}
-CUSTOM_INPUT_MEMBER(firetrk_state::steer_flag_r)
+template <int P>
+READ_LINE_MEMBER(firetrk_state::steer_flag_r)
{
- return m_steer_flag[(uintptr_t)param];
+ return m_steer_flag[P];
}
-CUSTOM_INPUT_MEMBER(firetrk_state::skid_r)
+template <int P>
+READ_LINE_MEMBER(firetrk_state::skid_r)
{
uint32_t ret;
- int which = (uintptr_t)param;
- if (which != 2)
- ret = m_skid[which];
+ if (P != 2)
+ ret = m_skid[P];
else
ret = m_skid[0] | m_skid[1];
@@ -204,13 +206,13 @@ CUSTOM_INPUT_MEMBER(firetrk_state::skid_r)
}
-CUSTOM_INPUT_MEMBER(firetrk_state::crash_r)
+template <int P>
+READ_LINE_MEMBER(firetrk_state::crash_r)
{
uint32_t ret;
- int which = (uintptr_t)param;
- if (which != 2)
- ret = m_crash[which];
+ if (P != 2)
+ ret = m_crash[P];
else
ret = m_crash[0] | m_crash[1];
@@ -218,9 +220,10 @@ CUSTOM_INPUT_MEMBER(firetrk_state::crash_r)
}
-CUSTOM_INPUT_MEMBER(firetrk_state::gear_r)
+template <int P>
+READ_LINE_MEMBER(firetrk_state::gear_r)
{
- return (m_gear == (uintptr_t)param) ? 1 : 0;
+ return (m_gear == P) ? 1 : 0;
}
@@ -417,11 +420,11 @@ static INPUT_PORTS_START( firetrk )
PORT_START("BIT_0")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas") PORT_PLAYER(1)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, steer_dir_r, (void *)0)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, steer_dir_r, (void *)1)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, steer_dir_r<0>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, steer_dir_r<1>)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Bell") PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_TILT )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, skid_r, (void *)2)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, skid_r<2>)
PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) PORT_CHANGED_MEMBER(DEVICE_SELF, firetrk_state, service_mode_switch_changed, 0)
PORT_START("BIT_6")
@@ -439,11 +442,11 @@ static INPUT_PORTS_START( firetrk )
PORT_START("BIT_7")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, steer_flag_r, (void *)0)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, steer_flag_r, (void *)1)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, steer_flag_r<0>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, steer_flag_r<1>)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, crash_r, (void *)2)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, crash_r<2>)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Diag Step")
PORT_START("HORN")
@@ -485,23 +488,23 @@ static INPUT_PORTS_START( superbug )
PORT_DIPSETTING( 0xc0, DEF_STR( German ) )
PORT_START("BIT_0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, gear_r, (void *)1)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, gear_r<1>)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, steer_dir_r, (void *)0)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, steer_dir_r<0>)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MEMORY_RESET ) PORT_NAME("Hiscore Reset")
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x20, IP_ACTIVE_HIGH )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, skid_r, (void *)0)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, skid_r<0>)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_TILT )
PORT_START("BIT_7")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, gear_r, (void *)2)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, gear_r, (void *)0)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, steer_flag_r, (void *)0)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, gear_r<2>)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, gear_r<0>)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, steer_flag_r<0>)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, crash_r, (void *)0)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, crash_r<0>)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Track Select")
PORT_START("GEAR")
@@ -557,14 +560,14 @@ static INPUT_PORTS_START( montecar )
PORT_DIPSETTING( 0x00, DEF_STR( German ) )
PORT_START("BIT_6")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, gear_r, (void *)0)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, gear_r, (void *)1)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, gear_r, (void *)2)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, gear_r<0>)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, gear_r<1>)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, gear_r<2>)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Track Select")
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas")
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, steer_dir_r, (void *)0)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, skid_r, (void *)1)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, steer_dir_r<0>)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, skid_r<1>)
PORT_START("BIT_7")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
@@ -573,8 +576,8 @@ static INPUT_PORTS_START( montecar )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, steer_flag_r, (void *)0)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state, skid_r, (void *)0)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, steer_flag_r<0>)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(firetrk_state, skid_r<0>)
PORT_START("GEAR")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Gear 1") PORT_CHANGED_MEMBER(DEVICE_SELF, firetrk_state, gear_changed, 0)
diff --git a/src/mame/drivers/flicker.cpp b/src/mame/drivers/flicker.cpp
index c6815cc51a3..7f246481e51 100644
--- a/src/mame/drivers/flicker.cpp
+++ b/src/mame/drivers/flicker.cpp
@@ -125,7 +125,7 @@ static INPUT_PORTS_START( flicker )
PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Door Slam") PORT_CODE(KEYCODE_HOME) PORT_CHANGED_MEMBER(DEVICE_SELF, flicker_state, test_changed, 0)
PORT_BIT(0x001c, IP_ACTIVE_HIGH, IPT_UNKNOWN) // called "two coins", "three coins", "four coins" in patent, purpose unknown
- PORT_BIT(0x07e0, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, flicker_state, coins_in, nullptr)
+ PORT_BIT(0x07e0, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(flicker_state, coins_in)
PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_TILT)
PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_START) PORT_NAME("Credit Button") PORT_CHANGED_MEMBER(DEVICE_SELF, flicker_state, test_changed, 0)
PORT_BIT(0x6000, IP_ACTIVE_HIGH, IPT_UNUSED)
diff --git a/src/mame/drivers/flstory.cpp b/src/mame/drivers/flstory.cpp
index 8f2ad9132fd..1f885f91c68 100644
--- a/src/mame/drivers/flstory.cpp
+++ b/src/mame/drivers/flstory.cpp
@@ -506,7 +506,7 @@ static INPUT_PORTS_START( victnine )
/* bits 0,1 are MCU related:
- bit 0: mcu is ready to receive data from main cpu
- bit 1: mcu has sent data to the main cpu */
- PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, flstory_state,victnine_mcu_status_bit01_r, nullptr)
+ PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(flstory_state, victnine_mcu_status_bit01_r)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 )
diff --git a/src/mame/drivers/fromanc2.cpp b/src/mame/drivers/fromanc2.cpp
index 8bd66cfc0fb..475251720cb 100644
--- a/src/mame/drivers/fromanc2.cpp
+++ b/src/mame/drivers/fromanc2.cpp
@@ -67,17 +67,17 @@ READ16_MEMBER(fromanc2_state::keymatrix_r)
return ret;
}
-CUSTOM_INPUT_MEMBER(fromanc2_state::subcpu_int_r)
+READ_LINE_MEMBER(fromanc2_state::subcpu_int_r)
{
return m_subcpu_int_flag & 0x01;
}
-CUSTOM_INPUT_MEMBER(fromanc2_state::sndcpu_nmi_r)
+READ_LINE_MEMBER(fromanc2_state::sndcpu_nmi_r)
{
return m_sndcpu_nmi_flag & 0x01;
}
-CUSTOM_INPUT_MEMBER(fromanc2_state::subcpu_nmi_r)
+READ_LINE_MEMBER(fromanc2_state::subcpu_nmi_r)
{
return m_subcpu_nmi_flag & 0x01;
}
@@ -304,9 +304,9 @@ static INPUT_PORTS_START( fromanc2 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, fromanc2_state,subcpu_int_r, nullptr) // SUBCPU INT FLAG
- PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, fromanc2_state,sndcpu_nmi_r, nullptr) // SNDCPU NMI FLAG
- PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, fromanc2_state,subcpu_nmi_r, nullptr) // SUBCPU NMI FLAG
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(fromanc2_state, subcpu_int_r) // SUBCPU INT FLAG
+ PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(fromanc2_state, sndcpu_nmi_r) // SNDCPU NMI FLAG
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(fromanc2_state, subcpu_nmi_r) // SUBCPU NMI FLAG
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( "Service Mode (1P)" ) PORT_CODE(KEYCODE_F2) // TEST (1P)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( "Service Mode (2P)" ) PORT_CODE(KEYCODE_F2) // TEST (2P)
@@ -405,7 +405,7 @@ static INPUT_PORTS_START( fromanc4 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN4 )
- PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, fromanc2_state,sndcpu_nmi_r, nullptr) // SNDCPU NMI FLAG
+ PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(fromanc2_state, sndcpu_nmi_r) // SNDCPU NMI FLAG
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/gaelco2.cpp b/src/mame/drivers/gaelco2.cpp
index 0a75914de40..13974ef8cbb 100644
--- a/src/mame/drivers/gaelco2.cpp
+++ b/src/mame/drivers/gaelco2.cpp
@@ -1968,6 +1968,50 @@ ROM_END
WORLD RALLY 2
============================================================================*/
+/***************************************************************************
+
+ World Rally 2 analog controls
+ - added by Mirko Mattioli <els@fastwebnet.it>
+ ---------------------------------------------------------------
+ WR2 pcb has two ADC, one for each player. The ADCs have in common
+ the clock signal line (adc_clk) and the chip enable signal line
+ (adc_cs) and, of course, two different data out signal lines.
+ When "Pot Wheel" option is selected via dip-switch, then the gear
+ is enabled (low/high shifter); the gear is disabled in joy mode by
+ the CPU program code. No brakes are present in this game.
+ Analog controls routines come from modified code wrote by Aaron
+ Giles for gaelco3d driver.
+
+***************************************************************************/
+
+template <int N>
+READ_LINE_MEMBER(wrally2_state::wrally2_analog_bit_r)
+{
+ return (m_analog_ports[N] >> 7) & 0x01;
+}
+
+
+WRITE_LINE_MEMBER(wrally2_state::wrally2_adc_clk)
+{
+ /* a zero/one combo is written here to clock the next analog port bit */
+ if (!state)
+ {
+ m_analog_ports[0] <<= 1;
+ m_analog_ports[1] <<= 1;
+ }
+}
+
+
+WRITE_LINE_MEMBER(wrally2_state::wrally2_adc_cs)
+{
+ /* a zero is written here to read the analog ports, and a one is written when finished */
+ if (!state)
+ {
+ m_analog_ports[0] = m_analog0->read();
+ m_analog_ports[1] = m_analog1->read();
+ }
+}
+
void wrally2_state::wrally2_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); /* ROM */
@@ -1994,7 +2038,7 @@ static INPUT_PORTS_START( wrally2 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Acc.")
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Gear") PORT_TOGGLE
- PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, wrally2_state,wrally2_analog_bit_r, (void *)0x00) /* ADC_1 serial input */
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(wrally2_state, wrally2_analog_bit_r<0>) /* ADC_1 serial input */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
PORT_SERVICE_DIPLOC( 0x0100, IP_ACTIVE_LOW, "SW2:1" )
PORT_DIPNAME( 0x0200, 0x0000, "Coin mechanism" ) PORT_DIPLOCATION("SW2:2")
@@ -2052,7 +2096,7 @@ static INPUT_PORTS_START( wrally2 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Acc.")
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Gear") PORT_TOGGLE
- PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, wrally2_state,wrally2_analog_bit_r, (void *)0x01) /* ADC_2 serial input */
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(wrally2_state, wrally2_analog_bit_r<1>) /* ADC_2 serial input */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN2 )
diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp
index 11c5b398f24..7a4f364bdf2 100644
--- a/src/mame/drivers/gaelco3d.cpp
+++ b/src/mame/drivers/gaelco3d.cpp
@@ -305,10 +305,10 @@ WRITE16_MEMBER(gaelco3d_state::sound_status_w)
*
*************************************/
-CUSTOM_INPUT_MEMBER(gaelco3d_state::analog_bit_r)
+template <int N>
+READ_LINE_MEMBER(gaelco3d_state::analog_bit_r)
{
- int which = (uintptr_t)param;
- return (m_analog_ports[which] >> 7) & 0x01;
+ return (m_analog_ports[N] >> 7) & 0x01;
}
@@ -337,10 +337,10 @@ WRITE_LINE_MEMBER(gaelco3d_state::analog_port_latch_w)
}
}
-CUSTOM_INPUT_MEMBER(gaelco3d_state::fp_analog_bit_r)
+template <int N>
+READ_LINE_MEMBER(gaelco3d_state::fp_analog_bit_r)
{
- int which = (uintptr_t)param;
- return (m_fp_analog_ports[which] >> m_fp_clock) & 1;
+ return (m_fp_analog_ports[N] >> m_fp_clock) & 1;
}
WRITE_LINE_MEMBER(gaelco3d_state::fp_analog_clock_w)
@@ -747,10 +747,10 @@ static INPUT_PORTS_START( speedup )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // checked after reading analog from port 1
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) // checked after reading analog from port 2
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) // checked after reading analog from port 3
- PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)0)
- PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)1)
- PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)2)
- PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)3)
+ PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<0>)
+ PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<1>)
+ PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<2>)
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<3>)
PORT_START("IN3")
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN2 ) // verified
@@ -786,10 +786,10 @@ static INPUT_PORTS_START( surfplnt )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x0800, IP_ACTIVE_LOW )
- PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)0)
- PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)1)
- PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)2)
- PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)3)
+ PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<0>)
+ PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<1>)
+ PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<2>)
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<3>)
PORT_START("IN3")
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -823,10 +823,10 @@ static INPUT_PORTS_START( radikalb )
PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x08000000, IP_ACTIVE_LOW )
- PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)0)
- PORT_BIT( 0x20000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)1)
- PORT_BIT( 0x40000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)2)
- PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,analog_bit_r, (void *)3)
+ PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<0>)
+ PORT_BIT( 0x20000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<1>)
+ PORT_BIT( 0x40000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<2>)
+ PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, analog_bit_r<3>)
PORT_START("IN3")
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
@@ -868,8 +868,8 @@ static INPUT_PORTS_START( footbpow )
PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x08000000, IP_ACTIVE_LOW )
- PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,fp_analog_bit_r, (void *)1)
- PORT_BIT( 0x20000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco3d_state,fp_analog_bit_r, (void *)0)
+ PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, fp_analog_bit_r<1>)
+ PORT_BIT( 0x20000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(gaelco3d_state, fp_analog_bit_r<0>)
PORT_BIT( 0xc0000000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("IN3")
diff --git a/src/mame/drivers/galastrm.cpp b/src/mame/drivers/galastrm.cpp
index 1779b9ada61..ac619aee3f3 100644
--- a/src/mame/drivers/galastrm.cpp
+++ b/src/mame/drivers/galastrm.cpp
@@ -70,7 +70,7 @@ void galastrm_state::tc0610_w(offs_t offset, u16 data)
}
-CUSTOM_INPUT_MEMBER(galastrm_state::frame_counter_r)
+READ_LINE_MEMBER(galastrm_state::frame_counter_r)
{
return m_frame_counter;
}
@@ -113,7 +113,7 @@ void galastrm_state::main_map(address_map &map)
static INPUT_PORTS_START( galastrm )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galastrm_state, frame_counter_r, nullptr)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galastrm_state, frame_counter_r)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/galaxi.cpp b/src/mame/drivers/galaxi.cpp
index 3f9e2472e51..e0a6cbfe08d 100644
--- a/src/mame/drivers/galaxi.cpp
+++ b/src/mame/drivers/galaxi.cpp
@@ -70,8 +70,8 @@ public:
void lastfour(machine_config &config);
void magjoker(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(ticket_r);
- DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
+ DECLARE_READ_LINE_MEMBER(ticket_r);
+ DECLARE_READ_LINE_MEMBER(hopper_r);
protected:
virtual void machine_start() override;
@@ -297,12 +297,12 @@ WRITE16_MEMBER(galaxi_state::_500004_w)
show_out();
}
-CUSTOM_INPUT_MEMBER(galaxi_state::ticket_r)
+READ_LINE_MEMBER(galaxi_state::ticket_r)
{
return m_ticket && !(m_screen->frame_number() % 10);
}
-CUSTOM_INPUT_MEMBER(galaxi_state::hopper_r)
+READ_LINE_MEMBER(galaxi_state::hopper_r)
{
return m_hopper && !(m_screen->frame_number() % 10);
}
@@ -376,11 +376,11 @@ static INPUT_PORTS_START( galaxi )
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_POKER_HOLD5 )
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_GAMBLE_PAYOUT )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxi_state, hopper_r, nullptr) // hopper sensor
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(galaxi_state, hopper_r) // hopper sensor
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(5) // coin a
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(5) // coin b (token)
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_COIN3 ) // pin 25LC
- PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxi_state, ticket_r, nullptr) // ticket sensor
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxi_state, ticket_r) // ticket sensor
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM ) // hopper out (pin 14LS)
PORT_SERVICE_NO_TOGGLE( 0x2000, IP_ACTIVE_HIGH ) // test
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) // (pin 26LC)
@@ -396,11 +396,11 @@ static INPUT_PORTS_START( magjoker )
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_POKER_HOLD5 )
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_GAMBLE_PAYOUT )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxi_state, hopper_r, nullptr) // hopper sensor
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxi_state, hopper_r) // hopper sensor
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(5) // coin a
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(5) // coin b (token)
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Hopper Refill") PORT_CODE(KEYCODE_H)
- PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxi_state, ticket_r, nullptr) // ticket sensor
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxi_state, ticket_r) // ticket sensor
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM ) // hopper out (pin 14LS)
PORT_SERVICE_NO_TOGGLE( 0x2000, IP_ACTIVE_HIGH ) // test
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_GAMBLE_KEYOUT ) // (pin 26LC)
diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp
index cc371f9586e..b8cda8fd62b 100644
--- a/src/mame/drivers/galaxian.cpp
+++ b/src/mame/drivers/galaxian.cpp
@@ -929,8 +929,8 @@ READ8_MEMBER(galaxian_state::theend_protection_r)
return m_protection_result;
}
-
-CUSTOM_INPUT_MEMBER(galaxian_state::theend_protection_alt_r)
+template <int N>
+READ_LINE_MEMBER(galaxian_state::theend_protection_alt_r)
{
/*
Handled by a custom IC. Holds two bits derived from the upper bit of
@@ -1231,16 +1231,16 @@ WRITE8_MEMBER(galaxian_state::scorpion_digitalker_control_w)
*
*************************************/
-INPUT_CHANGED_MEMBER(galaxian_state::gmgalax_game_changed)
+INPUT_CHANGED_MEMBER(gmgalax_state::game_changed)
{
address_space &space = m_maincpu->space(AS_PROGRAM);
/* new value is the selected game */
- m_gmgalax_selected_game = newval;
+ m_selected_game = newval;
/* select the bank and graphics bank based on it */
- membank("bank1")->set_entry(m_gmgalax_selected_game);
- galaxian_gfxbank_w(space, 0, m_gmgalax_selected_game);
+ membank("bank1")->set_entry(m_selected_game);
+ galaxian_gfxbank_w(space, 0, m_selected_game);
/* reset the stars */
galaxian_stars_enable_w(space, 0, 0);
@@ -1250,12 +1250,10 @@ INPUT_CHANGED_MEMBER(galaxian_state::gmgalax_game_changed)
}
-CUSTOM_INPUT_MEMBER(galaxian_state::gmgalax_port_r)
+template <int N>
+CUSTOM_INPUT_MEMBER(gmgalax_state::port_r)
{
- const char *portname = (const char *)param;
- if (m_gmgalax_selected_game != 0)
- portname += strlen(portname) + 1;
- return ioport(portname)->read();
+ return (m_selected_game != 0 ? m_glin : m_gmin)[N]->read();
}
@@ -1305,9 +1303,10 @@ WRITE8_MEMBER(galaxian_state::zigzag_ay8910_w)
*
*************************************/
-CUSTOM_INPUT_MEMBER(galaxian_state::azurian_port_r)
+template <int N>
+READ_LINE_MEMBER(galaxian_state::azurian_port_r)
{
- return (ioport("FAKE")->read() >> (uintptr_t)param) & 1;
+ return (ioport("FAKE")->read() >> N) & 1;
}
@@ -1318,14 +1317,14 @@ CUSTOM_INPUT_MEMBER(galaxian_state::azurian_port_r)
*
*************************************/
-CUSTOM_INPUT_MEMBER(galaxian_state::kingball_muxbit_r)
+READ_LINE_MEMBER(galaxian_state::kingball_muxbit_r)
{
/* multiplex the service mode switch with a speech DIP switch */
return (ioport("FAKE")->read() >> m_kingball_speech_dip) & 1;
}
-CUSTOM_INPUT_MEMBER(galaxian_state::kingball_noise_r)
+READ_LINE_MEMBER(galaxian_state::kingball_noise_r)
{
/* bit 5 is the NOISE line from the sound circuit. The code just verifies
that it's working, doesn't actually use return value, so we can just use
@@ -2867,7 +2866,7 @@ static INPUT_PORTS_START( azurian )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, azurian_port_r, (void *)0) /* "linked" with bit 2 of IN2 */
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxian_state, azurian_port_r<0>) /* "linked" with bit 2 of IN2 */
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Lives ) )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x80, "5" )
@@ -2879,7 +2878,7 @@ static INPUT_PORTS_START( azurian )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Bonus_Life ) )
PORT_DIPSETTING( 0x00, "5000" )
PORT_DIPSETTING( 0x02, "7000" )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, azurian_port_r, (void *)1) /* "linked" with bit 6 of IN1 */
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxian_state, azurian_port_r<1>) /* "linked" with bit 6 of IN1 */
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) )
@@ -3491,13 +3490,13 @@ INPUT_PORTS_END
static INPUT_PORTS_START( gmgalax )
PORT_START("IN0")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, gmgalax_port_r, "GMIN0\0GLIN0")
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(gmgalax_state, port_r<0>)
PORT_START("IN1")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, gmgalax_port_r, "GMIN1\0GLIN1")
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(gmgalax_state, port_r<1>)
PORT_START("IN2")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, gmgalax_port_r, "GMIN2\0GLIN2")
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(gmgalax_state, port_r<2>)
PORT_START("GMIN0") /* Ghost Muncher - IN0 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
@@ -3575,7 +3574,7 @@ static INPUT_PORTS_START( gmgalax )
PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("GAMESEL") /* fake - game select */
- PORT_DIPNAME( 0x01, 0x00, "Game Select") PORT_CODE(KEYCODE_F1) PORT_TOGGLE PORT_CHANGED_MEMBER(DEVICE_SELF, galaxian_state, gmgalax_game_changed, 0)
+ PORT_DIPNAME( 0x01, 0x00, "Game Select") PORT_CODE(KEYCODE_F1) PORT_TOGGLE PORT_CHANGED_MEMBER(DEVICE_SELF, gmgalax_state, game_changed, 0)
PORT_DIPSETTING( 0x00, "Ghost Muncher" )
PORT_DIPSETTING( 0x01, "Galaxian" )
INPUT_PORTS_END
@@ -4328,14 +4327,14 @@ static INPUT_PORTS_START( kingball )
PORT_INCLUDE(galaxian)
PORT_MODIFY("IN0")
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, kingball_muxbit_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxian_state, kingball_muxbit_r)
/* Relating to above port:Hack? - possibly multiplexed via writes to $b003 */
//PORT_DIPNAME( 0x40, 0x40, "Speech" )
//PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
//PORT_DIPSETTING( 0x40, DEF_STR( On ) )
PORT_MODIFY("IN1")
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, kingball_noise_r, nullptr) /* NOISE line */
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxian_state, kingball_noise_r) /* NOISE line */
PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0xc0, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_1C ) )
@@ -4826,9 +4825,9 @@ static INPUT_PORTS_START( theend )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, theend_protection_alt_r, (void *)0) /* protection bit */
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxian_state, theend_protection_alt_r<0>) /* protection bit */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, theend_protection_alt_r, (void *)1) /* protection bit */
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxian_state, theend_protection_alt_r<1>) /* protection bit */
PORT_START("IN3") /* need for some PPI accesses */
PORT_BIT( 0xff, 0x00, IPT_UNUSED )
@@ -4870,9 +4869,9 @@ static INPUT_PORTS_START( scramble )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, theend_protection_alt_r, (void *)0) /* protection bit */
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxian_state, theend_protection_alt_r<0>) /* protection bit */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, theend_protection_alt_r, (void *)1) /* protection bit */
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxian_state, theend_protection_alt_r<1>) /* protection bit */
PORT_START("IN3") /* need for some PPI accesses */
PORT_BIT( 0xff, 0x00, IPT_UNUSED )
@@ -5348,7 +5347,7 @@ CUSTOM_INPUT_MEMBER(galaxian_state::moonwar_dial_r)
/* verified from Z80 code */
static INPUT_PORTS_START( moonwar )
PORT_START("IN0")
- PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, moonwar_dial_r, nullptr)
+ PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(galaxian_state, moonwar_dial_r)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL // cocktail: p2 shield
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
@@ -6183,14 +6182,14 @@ void galaxian_state::zigzag(machine_config &config)
}
-void galaxian_state::gmgalax(machine_config &config)
+void gmgalax_state::gmgalax(machine_config &config)
{
galaxian(config);
/* banked video hardware */
m_gfxdecode->set_info(gfx_gmgalax);
m_palette->set_entries(64);
- m_palette->set_init(FUNC(galaxian_state::galaxian_palette));
+ m_palette->set_init(FUNC(gmgalax_state::galaxian_palette));
}
@@ -7073,20 +7072,20 @@ void galaxian_state::init_azurian()
}
-void galaxian_state::init_gmgalax()
+void gmgalax_state::init_gmgalax()
{
address_space &space = m_maincpu->space(AS_PROGRAM);
/* video extensions */
- common_init(&galaxian_state::galaxian_draw_bullet, &galaxian_state::galaxian_draw_background, &galaxian_state::gmgalax_extend_tile_info, &galaxian_state::gmgalax_extend_sprite_info);
+ common_init(&galaxian_state::galaxian_draw_bullet, &galaxian_state::galaxian_draw_background, &gmgalax_state::gmgalax_extend_tile_info, &gmgalax_state::gmgalax_extend_sprite_info);
/* ROM is banked */
space.install_read_bank(0x0000, 0x3fff, "bank1");
membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
/* callback when the game select is toggled */
- gmgalax_game_changed(*machine().ioport().ports().begin()->second->fields().first(), 0, 0, 0);
- save_item(NAME(m_gmgalax_selected_game));
+ game_changed(*machine().ioport().ports().begin()->second->fields().first(), 0, 0, 0);
+ save_item(NAME(m_selected_game));
}
@@ -12777,7 +12776,7 @@ GAME( 1982, zigzagb, 0, zigzag, zigzag, galaxian_state, init_
GAME( 1982, zigzagb2, zigzagb, zigzag, zigzag, galaxian_state, init_zigzag, ROT90, "bootleg (LAX)", "Zig Zag (Dig Dug conversion on Galaxian hardware, bootleg set 2)", MACHINE_SUPPORTS_SAVE )
/* multi-game select via external switch */
-GAME( 1981, gmgalax, 0, gmgalax, gmgalax, galaxian_state, init_gmgalax, ROT90, "bootleg", "Ghostmuncher Galaxian (bootleg)", MACHINE_SUPPORTS_SAVE )
+GAME( 1981, gmgalax, 0, gmgalax, gmgalax, gmgalax_state, init_gmgalax, ROT90, "bootleg", "Ghostmuncher Galaxian (bootleg)", MACHINE_SUPPORTS_SAVE )
// Multigames
GAME( 2002, fourplay, 0, fourplay, galaxian, galaxian_state, init_fourplay, ROT90, "Macro", "Four Play", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp
index 6055bb97fdc..61d91dfcedb 100644
--- a/src/mame/drivers/galaxold.cpp
+++ b/src/mame/drivers/galaxold.cpp
@@ -837,19 +837,18 @@ void galaxold_state::bullsdrtg_data_map(address_map &map)
}
/* Lives Dips are spread across two input ports */
-CUSTOM_INPUT_MEMBER(galaxold_state::vpool_lives_r)
+template <int Mask>
+READ_LINE_MEMBER(galaxold_state::vpool_lives_r)
{
- int bit_mask = (uintptr_t)param;
-
- switch (bit_mask)
+ switch (Mask)
{
case 0x40: /* vpool : IN1 (0xa800) bit 6 */
- return ((ioport("LIVES")->read() & bit_mask) >> 6);
+ return ((ioport("LIVES")->read() & Mask) >> 6);
case 0x01: /* vpool : DSW (0xb000) bit 0 */
- return ((ioport("LIVES")->read() & bit_mask) >> 0);
+ return ((ioport("LIVES")->read() & Mask) >> 0);
default:
- logerror("vpool_lives_r : invalid %02X bit_mask\n",bit_mask);
+ logerror("vpool_lives_r : invalid %02X bit_mask\n",Mask);
return 0;
}
}
@@ -873,11 +872,11 @@ static INPUT_PORTS_START( vpool )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,vpool_lives_r, (void *)0x40)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxold_state, vpool_lives_r<0x40>)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("DSW0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,vpool_lives_r, (void *)0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxold_state, vpool_lives_r<0x01>)
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x02, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
@@ -1080,24 +1079,23 @@ INPUT_PORTS_END
/* Coinage Dips are spread across two input ports */
+template <int Mask>
CUSTOM_INPUT_MEMBER(galaxold_state::ckongg_coinage_r)
{
- int bit_mask = (uintptr_t)param;
-
- switch (bit_mask)
+ switch (Mask)
{
case 0x0c: /* ckongg : DSW (0xc800) bits 2 and 3 */
- return ((ioport("COINAGE")->read() & bit_mask) >> 2);
+ return ((ioport("COINAGE")->read() & Mask) >> 2);
case 0x40: /* ckongg : IN1 (0xc400) bit 6 */
- return ((ioport("COINAGE")->read() & bit_mask) >> 6);
+ return ((ioport("COINAGE")->read() & Mask) >> 6);
case 0xc0: /* ckongmc : IN1 (0xa800) bits 6 and 7 */
- return ((ioport("COINAGE")->read() & bit_mask) >> 6);
+ return ((ioport("COINAGE")->read() & Mask) >> 6);
case 0x01: /* ckongmc : DSW (0xb000) bit 0 */
- return ((ioport("COINAGE")->read() & bit_mask) >> 0);
+ return ((ioport("COINAGE")->read() & Mask) >> 0);
default:
- logerror("ckongg_coinage_r : invalid %02X bit_mask\n",bit_mask);
+ logerror("ckongg_coinage_r : invalid %02X bit_mask\n",Mask);
return 0;
}
}
@@ -1121,7 +1119,7 @@ static INPUT_PORTS_START( ckongg )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,ckongg_coinage_r, (void *)0x40)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(galaxold_state, ckongg_coinage_r<0x40>)
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x80, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
@@ -1132,7 +1130,7 @@ static INPUT_PORTS_START( ckongg )
PORT_DIPSETTING( 0x01, "4" )
PORT_DIPSETTING( 0x02, "5" )
PORT_DIPSETTING( 0x03, "6" )
- PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,ckongg_coinage_r, (void *)0x0c)
+ PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(galaxold_state, ckongg_coinage_r<0x0c>)
PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("COINAGE")
@@ -1166,10 +1164,10 @@ static INPUT_PORTS_START( ckongmc )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,ckongg_coinage_r, (void *)0xc0)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(galaxold_state, ckongg_coinage_r<0xc0>)
PORT_START("DSW")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,ckongg_coinage_r, (void *)0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(galaxold_state, ckongg_coinage_r<0x01>)
PORT_DIPNAME( 0x06, 0x00, DEF_STR( Lives ) )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x02, "4" )
@@ -1417,6 +1415,14 @@ static INPUT_PORTS_START( scrambler )
INPUT_PORTS_END
+template <int Mask>
+READ_LINE_MEMBER(galaxold_state::_4in1_fake_port_r)
+{
+ static const char *const portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" };
+
+ return (ioport(portnames[m__4in1_bank])->read() & Mask) ? 1 : 0;
+}
+
static INPUT_PORTS_START( 4in1 )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
@@ -1437,18 +1443,18 @@ static INPUT_PORTS_START( 4in1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x40) // See fake ports
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x80) // See fake ports
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxold_state, _4in1_fake_port_r<0x40>) // See fake ports
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxold_state, _4in1_fake_port_r<0x80>) // See fake ports
PORT_START("DSW0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x01) // See fake ports
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x02) // See fake ports
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxold_state, _4in1_fake_port_r<0x01>) // See fake ports
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxold_state, _4in1_fake_port_r<0x02>) // See fake ports
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
PORT_DIPSETTING( 0x00, "3" ) // 2 when continue (Scramble PT2)
PORT_DIPSETTING( 0x04, "5" ) // 2 when continue (Scramble PT2)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x08) // See fake ports
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x10) // See fake ports
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x20) // See fake ports
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxold_state, _4in1_fake_port_r<0x08>) // See fake ports
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxold_state, _4in1_fake_port_r<0x10>) // See fake ports
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(galaxold_state, _4in1_fake_port_r<0x20>) // fake ports
PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("FAKE1") /* The Ghost Muncher PT3 - FAKE DSW0 (bits 0 to 5) and IN1 (bits 6 and 7) */
@@ -1592,19 +1598,18 @@ INPUT_PORTS_END
/* Coinage Dips are spread across two input ports */
+template <int Mask>
CUSTOM_INPUT_MEMBER(galaxold_state::dkongjrm_coinage_r)
{
- int bit_mask = (uintptr_t)param;
-
- switch (bit_mask)
+ switch (Mask)
{
case 0xc0: /* dkongjrm : IN1 (0xa8??) bits 6 and 7 */
- return ((ioport("COINAGE")->read() & bit_mask) >> 6);
+ return ((ioport("COINAGE")->read() & Mask) >> 6);
case 0x01: /* dkongjrm : DSW (0xb0??) bit 0 */
- return ((ioport("COINAGE")->read() & bit_mask) >> 0);
+ return ((ioport("COINAGE")->read() & Mask) >> 0);
default:
- logerror("dkongjrm_coinage_r : invalid %02X bit_mask\n",bit_mask);
+ logerror("dkongjrm_coinage_r : invalid %02X bit_mask\n",Mask);
return 0;
}
}
@@ -1628,10 +1633,10 @@ static INPUT_PORTS_START( dkongjrm )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,dkongjrm_coinage_r, (void *)0xc0)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(galaxold_state, dkongjrm_coinage_r<0xc0>)
PORT_START("DSW")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,dkongjrm_coinage_r, (void *)0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(galaxold_state, dkongjrm_coinage_r<0x01>)
PORT_DIPNAME( 0x06, 0x00, DEF_STR( Lives ) )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x02, "4" )
diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp
index cda30320922..3ae77dcb246 100644
--- a/src/mame/drivers/gottlieb.cpp
+++ b/src/mame/drivers/gottlieb.cpp
@@ -277,12 +277,10 @@ void gottlieb_state::machine_reset()
*
*************************************/
-CUSTOM_INPUT_MEMBER(gottlieb_state::analog_delta_r)
+template <int N>
+CUSTOM_INPUT_MEMBER(gottlieb_state::track_delta_r)
{
- const char *string = (const char *)param;
- int which = string[0] - '0';
-
- return ioport(&string[1])->read() - m_track[which];
+ return (N ? m_track_y : m_track_x)->read() - m_track[N];
}
@@ -837,10 +835,10 @@ static INPUT_PORTS_START( reactor )
PORT_BIT ( 0xfc, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("IN2") /* trackball H */
- PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gottlieb_state,analog_delta_r, "0TRACKX")
+ PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(gottlieb_state, track_delta_r<0>)
PORT_START("IN3") /* trackball V */
- PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gottlieb_state,analog_delta_r, "1TRACKY")
+ PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(gottlieb_state, track_delta_r<1>)
PORT_START("IN4")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
@@ -1048,10 +1046,10 @@ static INPUT_PORTS_START( argusg )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("IN2") /* trackball H */
- PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gottlieb_state,analog_delta_r, "0TRACKX")
+ PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(gottlieb_state, track_delta_r<0>)
PORT_START("IN3") /* trackball V */
- PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gottlieb_state,analog_delta_r, "1TRACKY")
+ PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(gottlieb_state, track_delta_r<1>)
/* NOTE: Buttons are shared for both players; are mirrored to each side of the controller */
PORT_START("IN4")
@@ -1105,7 +1103,7 @@ static INPUT_PORTS_START( mplanets )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN3") /* trackball V (dial) */
- PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gottlieb_state,analog_delta_r, "1TRACKY")
+ PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(gottlieb_state, track_delta_r<1>)
PORT_START("IN4")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
@@ -1584,7 +1582,7 @@ static INPUT_PORTS_START( 3stooges )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN4") /* joystick inputs */
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gottlieb_state,stooges_joystick_r, nullptr)
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(gottlieb_state, stooges_joystick_r)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3)
@@ -1696,7 +1694,7 @@ static INPUT_PORTS_START( wizwarz )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN3") /* trackball V is a dial input */
- PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gottlieb_state,analog_delta_r, "1TRACKY")
+ PORT_BIT( 0xff, 0, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(gottlieb_state, track_delta_r<1>)
PORT_START("IN4") /* ? */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
diff --git a/src/mame/drivers/gstream.cpp b/src/mame/drivers/gstream.cpp
index 42cc5dc63ad..73fc65c96e7 100644
--- a/src/mame/drivers/gstream.cpp
+++ b/src/mame/drivers/gstream.cpp
@@ -161,9 +161,9 @@ public:
void init_gstream();
void init_x2222();
- DECLARE_CUSTOM_INPUT_MEMBER(gstream_mirror_service_r);
+ DECLARE_READ_LINE_MEMBER(mirror_service_r);
DECLARE_CUSTOM_INPUT_MEMBER(gstream_mirror_r);
- DECLARE_CUSTOM_INPUT_MEMBER(x2222_toggle_r);
+ DECLARE_READ_LINE_MEMBER(x2222_toggle_r);
private:
/* devices */
@@ -212,14 +212,14 @@ private:
void x2222_io(address_map &map);
};
-CUSTOM_INPUT_MEMBER(gstream_state::x2222_toggle_r) // or the game hangs when starting, might be a status flag for the sound?
+READ_LINE_MEMBER(gstream_state::x2222_toggle_r) // or the game hangs when starting, might be a status flag for the sound?
{
m_toggle ^= 0xffff;
return m_toggle;
}
-CUSTOM_INPUT_MEMBER(gstream_state::gstream_mirror_service_r)
+READ_LINE_MEMBER(gstream_state::mirror_service_r)
{
int result;
@@ -427,10 +427,10 @@ static INPUT_PORTS_START( gstream )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE2 )
PORT_BIT( 0x7000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gstream_state,gstream_mirror_service_r, nullptr)
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(gstream_state, mirror_service_r)
PORT_START("IN2")
- PORT_BIT( 0x004f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gstream_state,gstream_mirror_r, nullptr)
+ PORT_BIT( 0x004f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(gstream_state, gstream_mirror_r)
PORT_BIT( 0xffb0, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -522,7 +522,7 @@ static INPUT_PORTS_START( x2222 )
PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gstream_state,x2222_toggle_r, nullptr)
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(gstream_state, x2222_toggle_r)
INPUT_PORTS_END
diff --git a/src/mame/drivers/hh_cop400.cpp b/src/mame/drivers/hh_cop400.cpp
index 7f1edd5a0f6..5380f7a25da 100644
--- a/src/mame/drivers/hh_cop400.cpp
+++ b/src/mame/drivers/hh_cop400.cpp
@@ -678,7 +678,7 @@ public:
u8 m_motor_pos;
TIMER_DEVICE_CALLBACK_MEMBER(motor_sim_tick);
- DECLARE_CUSTOM_INPUT_MEMBER(motor_switch);
+ DECLARE_READ_LINE_MEMBER(motor_switch_r);
DECLARE_WRITE8_MEMBER(write_l);
DECLARE_WRITE8_MEMBER(write_d);
@@ -703,7 +703,7 @@ void lchicken_state::machine_start()
// handlers
-CUSTOM_INPUT_MEMBER(lchicken_state::motor_switch)
+READ_LINE_MEMBER(lchicken_state::motor_switch_r)
{
return m_motor_pos > 0xe8; // approximation
}
@@ -782,7 +782,7 @@ static INPUT_PORTS_START( lchicken )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, lchicken_state, motor_switch, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(lchicken_state, motor_switch_r)
INPUT_PORTS_END
void lchicken_state::lchicken(machine_config &config)
diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp
index 0315ffd257e..86c7afb3985 100644
--- a/src/mame/drivers/hh_sm510.cpp
+++ b/src/mame/drivers/hh_sm510.cpp
@@ -21,6 +21,7 @@ TODO:
- confirm gnw_mmouse/gnw_egg rom (dumped from Soviet clone, but pretty
confident that it's same)
- confirm gnw_climbcs rom (assumed to be the same as gnw_climber)
+- dump/add purple version of gnw_judge
- dump/add CN-07 version of gnw_helmet
- Currently there is no accurate way to dump the SM511/SM512 melody ROM
electronically. For the ones that weren't decapped, they were read by
@@ -48,7 +49,7 @@ AC-01 s SM5A Ball (aka Toss-Up)
FL-02 s SM5A Flagman (aka Flag Man)
MT-03 s SM5A Vermin (aka The Exterminator)
RC-04 s SM5A Fire (aka Fireman Fireman)
-IP-05* s SM5A? Judge
+IP-05 s SM5A Judge
MN-06* g SM5A? Manhole
CN-07 g SM5A Helmet (aka Headache)
LN-08* g SM5A? Lion
@@ -672,6 +673,90 @@ ROM_END
/***************************************************************************
+ Nintendo Game & Watch: Judge (model IP-05)
+ * PCB label IP-05
+ * Sharp SM5A label IP-05 5010 (no decap)
+ * lcd screen with custom segments, 1-bit sound
+
+ This is the first (green) issue of the game which contains a bug where the
+ players are scored differently when wrongly dodging a win. This issue is
+ fixed in the second (purple) issue.
+
+***************************************************************************/
+
+class gnw_judge_state : public hh_sm510_state
+{
+public:
+ gnw_judge_state(const machine_config &mconfig, device_type type, const char *tag) :
+ hh_sm510_state(mconfig, type, tag)
+ { }
+
+ void gnw_judge(machine_config &config);
+};
+
+// config
+
+static INPUT_PORTS_START( gnw_judge )
+ PORT_START("IN.0") // R2
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
+
+ PORT_START("IN.1") // R3
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_CHANGED_CB(input_changed) PORT_16WAY PORT_NAME("P2 Dodge")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_CHANGED_CB(input_changed) PORT_16WAY PORT_NAME("P2 Hit")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_CHANGED_CB(input_changed) PORT_16WAY PORT_NAME("P1 Dodge")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_CHANGED_CB(input_changed) PORT_16WAY PORT_NAME("P1 Hit")
+
+ PORT_START("IN.2") // R4
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_CHANGED_CB(input_changed) PORT_NAME("Time")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_CHANGED_CB(input_changed) PORT_NAME("Game B")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) PORT_CHANGED_CB(input_changed) PORT_NAME("Game A")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
+
+ PORT_START("B")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) // display test?
+
+ PORT_START("ACL")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED_CB(acl_button) PORT_NAME("ACL")
+INPUT_PORTS_END
+
+void gnw_judge_state::gnw_judge(machine_config &config)
+{
+ /* basic machine hardware */
+ SM5A(config, m_maincpu);
+ m_maincpu->set_r_mask_option(sm510_base_device::RMASK_DIRECT); // confirmed
+ m_maincpu->write_segs().set(FUNC(hh_sm510_state::sm500_lcd_segment_w));
+ m_maincpu->read_k().set(FUNC(hh_sm510_state::input_r));
+ m_maincpu->write_r().set(FUNC(hh_sm510_state::piezo_input_w));
+ m_maincpu->read_b().set_ioport("B");
+
+ /* video hardware */
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
+ screen.set_refresh_hz(60);
+ screen.set_size(1647, 1080);
+ screen.set_visarea_full();
+
+ /* sound hardware */
+ SPEAKER(config, "mono").front_center();
+ SPEAKER_SOUND(config, m_speaker);
+ m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
+}
+
+// roms
+
+ROM_START( gnw_judge )
+ ROM_REGION( 0x1000, "maincpu", 0 )
+ ROM_LOAD( "ip-05", 0x0000, 0x0740, CRC(1b28a834) SHA1(cb8dbbf678ba22c4484d18cc1a6b99c1d34d1951) )
+
+ ROM_REGION( 104950, "screen", 0)
+ ROM_LOAD( "gnw_judge.svg", 0, 104950, CRC(fb51e31b) SHA1(c78e6d80aa5b59de1955ba5f83cc138b83bf714c) )
+ROM_END
+
+
+
+
+
+/***************************************************************************
+
Nintendo Game & Watch: Helmet (model CN-07)
* PCB label CN-07
* Sharp SM5A label CN-17 21ZA (no decap)
@@ -10077,6 +10162,7 @@ CONS( 1980, gnw_ball, 0, 0, gnw_ball, gnw_ball, gnw_ball_state
CONS( 1980, gnw_flagman, 0, 0, gnw_flagman, gnw_flagman, gnw_flagman_state, empty_init, "Nintendo", "Game & Watch: Flagman", MACHINE_SUPPORTS_SAVE )
CONS( 1980, gnw_vermin, 0, 0, gnw_vermin, gnw_vermin, gnw_vermin_state, empty_init, "Nintendo", "Game & Watch: Vermin", MACHINE_SUPPORTS_SAVE )
CONS( 1980, gnw_fires, 0, 0, gnw_fires, gnw_fires, gnw_fires_state, empty_init, "Nintendo", "Game & Watch: Fire (silver)", MACHINE_SUPPORTS_SAVE )
+CONS( 1980, gnw_judge, 0, 0, gnw_judge, gnw_judge, gnw_judge_state, empty_init, "Nintendo", "Game & Watch: Judge", MACHINE_SUPPORTS_SAVE )
CONS( 1981, gnw_helmet, 0, 0, gnw_helmet, gnw_helmet, gnw_helmet_state, empty_init, "Nintendo", "Game & Watch: Helmet", MACHINE_SUPPORTS_SAVE )
// Nintendo G&W: wide screen
diff --git a/src/mame/drivers/homelab.cpp b/src/mame/drivers/homelab.cpp
index dbbc6f6bec5..55fe65152bc 100644
--- a/src/mame/drivers/homelab.cpp
+++ b/src/mame/drivers/homelab.cpp
@@ -62,7 +62,7 @@ public:
void init_brailab4();
- DECLARE_CUSTOM_INPUT_MEMBER(cass3_r);
+ DECLARE_READ_LINE_MEMBER(cass3_r);
private:
DECLARE_READ8_MEMBER(key_r);
@@ -170,7 +170,7 @@ WRITE8_MEMBER( homelab_state::brailab4_portff_w )
membank("bank1")->set_entry(1);
}
-CUSTOM_INPUT_MEMBER( homelab_state::cass3_r )
+READ_LINE_MEMBER( homelab_state::cass3_r )
{
return (m_cass->input() > 0.03);
}
@@ -362,7 +362,7 @@ static INPUT_PORTS_START( homelab3 ) // F4 to F8 are foreign characters
PORT_BIT(0xf0, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("X3")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homelab_state, cass3_r, " ")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(homelab_state, cass3_r)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1)
PORT_BIT(0xf8, IP_ACTIVE_LOW, IPT_UNUSED)
@@ -475,7 +475,7 @@ static INPUT_PORTS_START( brailab4 ) // F4 to F8 are foreign characters
PORT_BIT(0xf0, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("X3")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homelab_state, cass3_r, " ")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(homelab_state, cass3_r)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1)
PORT_BIT(0xf8, IP_ACTIVE_LOW, IPT_UNUSED)
diff --git a/src/mame/drivers/homerun.cpp b/src/mame/drivers/homerun.cpp
index 9ced0870472..4b45d7a71ef 100644
--- a/src/mame/drivers/homerun.cpp
+++ b/src/mame/drivers/homerun.cpp
@@ -126,12 +126,12 @@ void homerun_state::io_map(address_map &map)
}
-CUSTOM_INPUT_MEMBER(homerun_state::homerun_d7756_busy_r)
+READ_LINE_MEMBER(homerun_state::homerun_d7756_busy_r)
{
return m_samples->playing(0) ? 0 : 1;
}
-CUSTOM_INPUT_MEMBER(homerun_state::ganjaja_d7756_busy_r)
+READ_LINE_MEMBER(homerun_state::ganjaja_d7756_busy_r)
{
return m_d7756->busy_r();
}
@@ -152,8 +152,8 @@ CUSTOM_INPUT_MEMBER(homerun_state::ganjaja_hopper_status_r)
static INPUT_PORTS_START( homerun )
PORT_START("IN0")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, sprite0_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_d7756_busy_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(homerun_state, sprite0_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(homerun_state, homerun_d7756_busy_r)
PORT_BIT( 0x37, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("IN1")
@@ -189,7 +189,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( dynashot )
PORT_START("IN0")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, sprite0_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(homerun_state, sprite0_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) // doesn't have d7756
PORT_BIT( 0x37, IP_ACTIVE_HIGH, IPT_UNKNOWN )
@@ -227,8 +227,8 @@ static INPUT_PORTS_START( ganjaja )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // ?
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, sprite0_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, ganjaja_d7756_busy_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(homerun_state, sprite0_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(homerun_state, ganjaja_d7756_busy_r)
PORT_BIT( 0x36, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("IN1")
@@ -236,7 +236,7 @@ static INPUT_PORTS_START( ganjaja )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_NAME("P1 Down / Paper")
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("P1 Right / Scissors")
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) // unused?
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, ganjaja_hopper_status_r, nullptr)
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(homerun_state, ganjaja_hopper_status_r)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
diff --git a/src/mame/drivers/icecold.cpp b/src/mame/drivers/icecold.cpp
index 055d81782eb..7d09be7a758 100644
--- a/src/mame/drivers/icecold.cpp
+++ b/src/mame/drivers/icecold.cpp
@@ -156,7 +156,7 @@ static INPUT_PORTS_START( icecold )
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP)
- PORT_BIT(0x55, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, icecold_state, motors_limit_r, nullptr)
+ PORT_BIT(0x55, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(icecold_state, motors_limit_r)
PORT_START("X0")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_START1)
diff --git a/src/mame/drivers/igs009.cpp b/src/mame/drivers/igs009.cpp
index 459cf6c8e05..88a622f316c 100644
--- a/src/mame/drivers/igs009.cpp
+++ b/src/mame/drivers/igs009.cpp
@@ -66,7 +66,7 @@ public:
void init_jingbell();
void init_jingbelli();
- DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
+ DECLARE_READ_LINE_MEMBER(hopper_r);
private:
DECLARE_WRITE8_MEMBER(reel1_ram_w);
@@ -387,7 +387,7 @@ uint32_t igs009_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
***************************************************************************/
-CUSTOM_INPUT_MEMBER(igs009_state::hopper_r)
+READ_LINE_MEMBER(igs009_state::hopper_r)
{
return m_hopper && !(m_screen->frame_number()%10);
}
@@ -698,7 +698,7 @@ static INPUT_PORTS_START( jingbell )
PORT_START("SERVICE")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Memory Clear") // stats, memory
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igs009_state,hopper_r, nullptr) // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igs009_state, hopper_r) // hopper sensor
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Pay Out")
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) // test (press during boot)
diff --git a/src/mame/drivers/igs011.cpp b/src/mame/drivers/igs011.cpp
index 8f54ac5c800..21b5163779b 100644
--- a/src/mame/drivers/igs011.cpp
+++ b/src/mame/drivers/igs011.cpp
@@ -100,7 +100,7 @@ public:
{
}
- DECLARE_CUSTOM_INPUT_MEMBER(igs_hopper_r);
+ DECLARE_READ_LINE_MEMBER(igs_hopper_r);
void init_lhbv33c();
void init_drgnwrldv21j();
@@ -641,7 +641,7 @@ void igs011_state::machine_start()
// Inputs
-CUSTOM_INPUT_MEMBER(igs011_state::igs_hopper_r)
+READ_LINE_MEMBER(igs011_state::igs_hopper_r)
{
return (m_igs_hopper && ((m_screen->frame_number()/5)&1)) ? 0x0000 : 0x0001;
}
@@ -3275,7 +3275,7 @@ static INPUT_PORTS_START( lhb2 )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) // data clear
PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, igs011_state, igs_hopper_r, nullptr) // hopper switch
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igs011_state, igs_hopper_r) // hopper switch
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 ) // stats
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // clear coin
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -3405,7 +3405,7 @@ static INPUT_PORTS_START( nkishusp )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) // data clear
PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, igs011_state,igs_hopper_r, nullptr) // hopper switch
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igs011_state, igs_hopper_r) // hopper switch
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 ) // stats
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // clear coin
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -3534,7 +3534,7 @@ static INPUT_PORTS_START( wlcc )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 ) // shown in test mode
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // clear coin
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, igs011_state,igs_hopper_r, nullptr) // hopper switch
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igs011_state, igs_hopper_r) // hopper switch
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
@@ -3663,7 +3663,7 @@ static INPUT_PORTS_START( lhb )
PORT_DIPUNKNOWN( 0x80, 0x80 )
PORT_START("COIN")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, igs011_state,igs_hopper_r, nullptr) // hopper switch
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igs011_state, igs_hopper_r) // hopper switch
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) // system reset
PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // stats
@@ -3964,7 +3964,7 @@ static INPUT_PORTS_START( xymg )
PORT_DIPUNKNOWN( 0x80, 0x80 )
PORT_START("COIN")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, igs011_state,igs_hopper_r, nullptr) // hopper switch
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igs011_state, igs_hopper_r) // hopper switch
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // stats
diff --git a/src/mame/drivers/igspoker.cpp b/src/mame/drivers/igspoker.cpp
index 6993004728d..92a9f1fe0bd 100644
--- a/src/mame/drivers/igspoker.cpp
+++ b/src/mame/drivers/igspoker.cpp
@@ -124,7 +124,7 @@ public:
void init_cpokerpk();
void init_kungfu();
- DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
+ DECLARE_READ_LINE_MEMBER(hopper_r);
private:
DECLARE_READ8_MEMBER(igs_irqack_r);
@@ -393,7 +393,7 @@ WRITE8_MEMBER(igspoker_state::custom_io_w)
}
}
-CUSTOM_INPUT_MEMBER(igspoker_state::hopper_r)
+READ_LINE_MEMBER(igspoker_state::hopper_r)
{
if (m_hopper) return !(m_screen->frame_number()%10);
return machine().input().code_pressed(KEYCODE_H);
@@ -541,7 +541,7 @@ static INPUT_PORTS_START( cpoker )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SERVICE")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state, hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igspoker_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
@@ -675,7 +675,7 @@ static INPUT_PORTS_START( cpokerx )
PORT_START("SERVICE")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Attendent")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state, hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igspoker_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -840,7 +840,7 @@ static INPUT_PORTS_START( csk227 )
PORT_START("SERVICE")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state, hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igspoker_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
@@ -985,7 +985,7 @@ static INPUT_PORTS_START( csk234 )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SERVICE")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state, hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igspoker_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
@@ -1137,7 +1137,7 @@ static INPUT_PORTS_START( igs_ncs )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
PORT_START("SERVICE")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state, hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igspoker_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
@@ -1459,7 +1459,7 @@ static INPUT_PORTS_START( cpokerpk )
PORT_DIPSETTING( 0x00, "100:1" )
PORT_START("SERVICE")
- PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state, hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igspoker_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
@@ -1594,7 +1594,7 @@ static INPUT_PORTS_START( chleague )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SERVICE")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state, hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igspoker_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
@@ -1733,7 +1733,7 @@ static INPUT_PORTS_START( pktet346 )
PORT_START("SERVICE")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state, hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igspoker_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
@@ -1844,7 +1844,7 @@ static INPUT_PORTS_START( igstet341 )
PORT_START("SERVICE")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state, hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(igspoker_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
diff --git a/src/mame/drivers/imolagp.cpp b/src/mame/drivers/imolagp.cpp
index 459d5e223c8..238eef986a7 100644
--- a/src/mame/drivers/imolagp.cpp
+++ b/src/mame/drivers/imolagp.cpp
@@ -450,7 +450,7 @@ static INPUT_PORTS_START( imolagp )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("IN0")
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, imolagp_state, imolagp_steerlatch_r, nullptr)
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(imolagp_state, imolagp_steerlatch_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
@@ -481,7 +481,7 @@ static INPUT_PORTS_START( imolagpo )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("IN1")
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, imolagp_state, imolagp_steerlatch_r, nullptr)
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(imolagp_state, imolagp_steerlatch_r)
INPUT_PORTS_END
diff --git a/src/mame/drivers/inufuku.cpp b/src/mame/drivers/inufuku.cpp
index 1d1df8bccfb..8215a410db1 100644
--- a/src/mame/drivers/inufuku.cpp
+++ b/src/mame/drivers/inufuku.cpp
@@ -100,7 +100,7 @@ WRITE8_MEMBER(inufuku_state::inufuku_soundrombank_w)
******************************************************************************/
-CUSTOM_INPUT_MEMBER(inufuku_state::soundflag_r)
+READ_LINE_MEMBER(inufuku_state::soundflag_r)
{
return m_soundlatch->pending_r() ? 0 : 1;
}
@@ -222,7 +222,7 @@ static INPUT_PORTS_START( inufuku )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, inufuku_state,soundflag_r, nullptr) // pending sound command
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(inufuku_state, soundflag_r) // pending sound command
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) // 3on3dunk cares about something in here, possibly a vblank flag
PORT_START( "EEPROMOUT" )
diff --git a/src/mame/drivers/istrebiteli.cpp b/src/mame/drivers/istrebiteli.cpp
index 9eb028d49ac..2121be3167b 100644
--- a/src/mame/drivers/istrebiteli.cpp
+++ b/src/mame/drivers/istrebiteli.cpp
@@ -144,7 +144,7 @@ public:
void istreb(machine_config &config);
void motogonki(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(collision_r);
+ template <int ID> DECLARE_READ_LINE_MEMBER(collision_r);
DECLARE_CUSTOM_INPUT_MEMBER(coin_r);
DECLARE_INPUT_CHANGED_MEMBER(coin_inc);
@@ -449,23 +449,23 @@ void istrebiteli_state::moto_io_map(address_map &map)
map(0x40, 0x4f).w(FUNC(istrebiteli_state::moto_tileram_w));
}
-CUSTOM_INPUT_MEMBER(istrebiteli_state::collision_r)
+template <int ID>
+READ_LINE_MEMBER(istrebiteli_state::collision_r)
{
// piece of HACK
// real hardware does per-pixel sprite collision detection
- int id = *(int*)&param;
- if ((m_spr_ctrl[id] & 0x80) == 0)
+ if ((m_spr_ctrl[ID] & 0x80) == 0)
{
- int sx = m_spr_xy[0 + id * 2];
- int sy = m_spr_xy[1 + id * 2];
- int px = m_spr_xy[6 - id * 2] + 3;
- int py = m_spr_xy[7 - id * 2] + 3;
+ int sx = m_spr_xy[0 + ID * 2];
+ int sy = m_spr_xy[1 + ID * 2];
+ int px = m_spr_xy[6 - ID * 2] + 3;
+ int py = m_spr_xy[7 - ID * 2] + 3;
if (sx > 56 && px >= sx && px < (sx + 8) && py >= sy && py < (sy + 8))
- m_spr_collision[id] |= 1;
+ m_spr_collision[ID] |= 1;
}
- return m_spr_collision[id];
+ return m_spr_collision[ID];
}
CUSTOM_INPUT_MEMBER(istrebiteli_state::coin_r)
@@ -486,7 +486,7 @@ static INPUT_PORTS_START( istreb )
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(1)
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(1)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, istrebiteli_state, collision_r, 1)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_MEMBER(istrebiteli_state, collision_r<1>)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
@@ -496,14 +496,14 @@ static INPUT_PORTS_START( istreb )
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2)
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, istrebiteli_state, collision_r, 0)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_MEMBER(istrebiteli_state, collision_r<0>)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("IN2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START2)
- PORT_BIT(0x3c, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, istrebiteli_state, coin_r, nullptr)
+ PORT_BIT(0x3c, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(istrebiteli_state, coin_r)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_HBLANK("screen")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
diff --git a/src/mame/drivers/itech32.cpp b/src/mame/drivers/itech32.cpp
index d11c61cf430..e96530bacfd 100644
--- a/src/mame/drivers/itech32.cpp
+++ b/src/mame/drivers/itech32.cpp
@@ -488,7 +488,7 @@ void itech32_state::color_w(u8 data)
*************************************/
-CUSTOM_INPUT_MEMBER(itech32_state::special_port_r)
+READ_LINE_MEMBER(itech32_state::special_port_r)
{
if (m_soundlatch->pending_r())
m_special_result ^= 1;
@@ -1093,7 +1093,7 @@ static INPUT_PORTS_START( timekill )
PORT_SERVICE_NO_TOGGLE( 0x0001, IP_ACTIVE_LOW )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech32_state,special_port_r, nullptr)
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech32_state, special_port_r)
PORT_DIPNAME( 0x0010, 0x0000, "Video Sync" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x0000, "-" )
PORT_DIPSETTING( 0x0010, "+" )
@@ -1138,7 +1138,7 @@ static INPUT_PORTS_START( itech32_base_16bit )
PORT_SERVICE_NO_TOGGLE( 0x0001, IP_ACTIVE_LOW )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech32_state,special_port_r, nullptr)
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech32_state, special_port_r)
PORT_DIPNAME( 0x0010, 0x0000, "Video Sync" ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x0000, "-" )
PORT_DIPSETTING( 0x0010, "+" )
@@ -1357,7 +1357,7 @@ static INPUT_PORTS_START( itech32_base_32bit )
PORT_SERVICE_NO_TOGGLE( 0x00010000, IP_ACTIVE_LOW )
PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech32_state,special_port_r, nullptr)
+ PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech32_state, special_port_r)
PORT_DIPNAME( 0x00100000, 0x00000000, "Video Sync" ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x00000000, "-" )
PORT_DIPSETTING( 0x00100000, "+" )
diff --git a/src/mame/drivers/itech8.cpp b/src/mame/drivers/itech8.cpp
index 72eea1aa603..f3ec9da347d 100644
--- a/src/mame/drivers/itech8.cpp
+++ b/src/mame/drivers/itech8.cpp
@@ -752,7 +752,7 @@ WRITE8_MEMBER(itech8_state::rimrockn_bank_w)
*
*************************************/
-CUSTOM_INPUT_MEMBER(itech8_state::special_r)
+READ_LINE_MEMBER(itech8_state::special_r)
{
return m_pia_portb_data & 0x01;
}
@@ -1056,7 +1056,7 @@ void itech8_state::slikz80_io_map(address_map &map)
static INPUT_PORTS_START( wfortune )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x08, DEF_STR( Upright ) )
@@ -1085,7 +1085,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( grmatch )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x08, 0x08, "Adjustments Lockout" )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
@@ -1123,7 +1123,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( stratab )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x08, DEF_STR( Upright ) )
@@ -1171,14 +1171,12 @@ INPUT_PORTS_END
CUSTOM_INPUT_MEMBER(itech8_state::gtg_mux)
{
- const char *tag1 = (const char *)param;
- const char *tag2 = tag1 + strlen(tag1) + 1;
- return ioport(tag1)->read() & ioport(tag2)->read();
+ return m_p1->read() & m_p2->read();
}
static INPUT_PORTS_START( gtg )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x08, DEF_STR( Upright ) )
@@ -1189,7 +1187,7 @@ static INPUT_PORTS_START( gtg )
PORT_START("60")
/* it is still unknown how the second player inputs are muxed in */
/* currently we map both sets of controls to the same inputs */
- PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,gtg_mux, "P1\0P2")
+ PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(itech8_state, gtg_mux)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
@@ -1215,7 +1213,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( gtgt )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
@@ -1242,7 +1240,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( gtg2t )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x08, DEF_STR( Upright ) )
@@ -1279,7 +1277,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( slikshot )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
@@ -1306,7 +1304,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( dynobop )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
@@ -1333,7 +1331,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( sstrike )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
@@ -1360,7 +1358,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( pokrdice )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Lower Right") PORT_CODE(KEYCODE_3_PAD)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
@@ -1389,7 +1387,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( hstennis )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x08, DEF_STR( Upright ) )
@@ -1424,7 +1422,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( arlingtn )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) /* see code at e23c */
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
@@ -1455,7 +1453,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( peggle )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
@@ -1477,7 +1475,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( pegglet )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
@@ -1499,7 +1497,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( neckneck )
PORT_START("40")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) /* see code at e23c */
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
@@ -1540,7 +1538,7 @@ static INPUT_PORTS_START( rimrockn )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN4 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech8_state,special_r, nullptr) /* input from sound board */
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(itech8_state, special_r) /* input from sound board */
PORT_START("80")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/jackie.cpp b/src/mame/drivers/jackie.cpp
index 7f85992824b..36281367b71 100644
--- a/src/mame/drivers/jackie.cpp
+++ b/src/mame/drivers/jackie.cpp
@@ -77,7 +77,7 @@ public:
void init_jackie();
- DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
+ DECLARE_READ_LINE_MEMBER(hopper_r);
private:
DECLARE_WRITE8_MEMBER(fg_tile_w);
@@ -375,7 +375,7 @@ void jackie_state::io_map(address_map &map)
map(0x8000, 0xffff).r(FUNC(jackie_state::expram_r));
}
-CUSTOM_INPUT_MEMBER(jackie_state::hopper_r)
+READ_LINE_MEMBER(jackie_state::hopper_r)
{
if (m_hopper) return !(m_screen->frame_number()%10);
return machine().input().code_pressed(KEYCODE_H);
@@ -454,7 +454,7 @@ static INPUT_PORTS_START( jackie )
PORT_START("SERVICE")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_9) PORT_NAME("Attendent")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,jackie_state,hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jackie_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) // test (press during boot)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
diff --git a/src/mame/drivers/jankenmn.cpp b/src/mame/drivers/jankenmn.cpp
index 4f722610c3e..6b4b948756e 100644
--- a/src/mame/drivers/jankenmn.cpp
+++ b/src/mame/drivers/jankenmn.cpp
@@ -169,7 +169,7 @@ public:
, m_lamps(*this, "lamp%u", 0U)
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(hopper_status_r);
+ DECLARE_READ_LINE_MEMBER(hopper_status_r);
void jankenmn(machine_config &config);
@@ -251,7 +251,7 @@ WRITE8_MEMBER(jankenmn_state::lamps3_w)
logerror("payout: %02X\n", (data & 0x04));
}
-CUSTOM_INPUT_MEMBER(jankenmn_state::hopper_status_r)
+READ_LINE_MEMBER(jankenmn_state::hopper_status_r)
{
// temp workaround, needs hopper
return machine().rand();
@@ -336,7 +336,7 @@ static INPUT_PORTS_START( jankenmn )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Paa (Paper)")
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 ) // 100 yen coin
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jankenmn_state, hopper_status_r, nullptr)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jankenmn_state, hopper_status_r)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) // 10 yen coin
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) // 10 yen coin
diff --git a/src/mame/drivers/jedi.cpp b/src/mame/drivers/jedi.cpp
index e0c773cf42d..eb177b62da1 100644
--- a/src/mame/drivers/jedi.cpp
+++ b/src/mame/drivers/jedi.cpp
@@ -303,7 +303,7 @@ static INPUT_PORTS_START( jedi )
PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
PORT_BIT( 0x18, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,jedi_state,jedi_audio_comm_stat_r, nullptr)
+ PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(jedi_state, jedi_audio_comm_stat_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("STICKY")
diff --git a/src/mame/drivers/karnov.cpp b/src/mame/drivers/karnov.cpp
index 6e1a68bda52..31b9a48dd19 100644
--- a/src/mame/drivers/karnov.cpp
+++ b/src/mame/drivers/karnov.cpp
@@ -1004,8 +1004,8 @@ ROM_START( karnov )
ROM_LOAD( "dn19-5", 0x58000, 0x08000, CRC(8fd4fa40) SHA1(1870fb0c5c64fbc53a10115f0f3c7624cf2465db) )
ROM_REGION( 0x0800, "proms", 0 )
- ROM_LOAD( "karnprom_21.k8", 0x0000, 0x0400, CRC(aab0bb93) SHA1(545707fbb1007fca1fe297c5fce61e485e7084fc) )
- ROM_LOAD( "karnprom_20.l6", 0x0400, 0x0400, CRC(02f78ffb) SHA1(cb4dd8b0ce3c404195321b17e10f51352f506958) )
+ ROM_LOAD( "dn-21.k8", 0x0000, 0x0400, CRC(aab0bb93) SHA1(545707fbb1007fca1fe297c5fce61e485e7084fc) ) /* MB7132E BPROM */
+ ROM_LOAD( "dn-20.l6", 0x0400, 0x0400, CRC(02f78ffb) SHA1(cb4dd8b0ce3c404195321b17e10f51352f506958) ) /* MB7122E BPROM */
ROM_END
ROM_START( karnova )
@@ -1043,8 +1043,8 @@ ROM_START( karnova )
ROM_LOAD( "dn19-5", 0x58000, 0x08000, CRC(8fd4fa40) SHA1(1870fb0c5c64fbc53a10115f0f3c7624cf2465db) )
ROM_REGION( 0x0800, "proms", 0 )
- ROM_LOAD( "karnprom_21.k8", 0x0000, 0x0400, CRC(aab0bb93) SHA1(545707fbb1007fca1fe297c5fce61e485e7084fc) )
- ROM_LOAD( "karnprom_20.l6", 0x0400, 0x0400, CRC(02f78ffb) SHA1(cb4dd8b0ce3c404195321b17e10f51352f506958) )
+ ROM_LOAD( "dn-21.k8", 0x0000, 0x0400, CRC(aab0bb93) SHA1(545707fbb1007fca1fe297c5fce61e485e7084fc) ) /* MB7132E BPROM */
+ ROM_LOAD( "dn-20.l6", 0x0400, 0x0400, CRC(02f78ffb) SHA1(cb4dd8b0ce3c404195321b17e10f51352f506958) ) /* MB7122E BPROM */
ROM_END
ROM_START( karnovj )
@@ -1082,8 +1082,8 @@ ROM_START( karnovj )
ROM_LOAD( "kar19", 0x58000, 0x08000, CRC(7bc174bb) SHA1(d8bc320169fc3a9cdd3f271ea523fb0486abae2c) )
ROM_REGION( 0x0800, "proms", 0 )
- ROM_LOAD( "karnprom_21.k8", 0x0000, 0x0400, CRC(aab0bb93) SHA1(545707fbb1007fca1fe297c5fce61e485e7084fc) )
- ROM_LOAD( "karnprom_20.l6", 0x0400, 0x0400, CRC(02f78ffb) SHA1(cb4dd8b0ce3c404195321b17e10f51352f506958) )
+ ROM_LOAD( "dn-21.k8", 0x0000, 0x0400, CRC(aab0bb93) SHA1(545707fbb1007fca1fe297c5fce61e485e7084fc) ) /* MB7132E BPROM */
+ ROM_LOAD( "dn-20.l6", 0x0400, 0x0400, CRC(02f78ffb) SHA1(cb4dd8b0ce3c404195321b17e10f51352f506958) ) /* MB7122E BPROM */
ROM_END
ROM_START( karnovjbl )
@@ -1127,47 +1127,47 @@ ROM_START( karnovjbl )
ROM_LOAD( "24.bin", 0x58000, 0x08000, CRC(7bc174bb) SHA1(d8bc320169fc3a9cdd3f271ea523fb0486abae2c) )
ROM_REGION( 0x0800, "proms", 0 ) // not dumped for this set
- ROM_LOAD( "karnprom.21", 0x0000, 0x0400, CRC(aab0bb93) SHA1(545707fbb1007fca1fe297c5fce61e485e7084fc) )
- ROM_LOAD( "karnprom.20", 0x0400, 0x0400, CRC(02f78ffb) SHA1(cb4dd8b0ce3c404195321b17e10f51352f506958) )
+ ROM_LOAD( "dn-21.k8", 0x0000, 0x0400, CRC(aab0bb93) SHA1(545707fbb1007fca1fe297c5fce61e485e7084fc) ) /* MB7132E BPROM */
+ ROM_LOAD( "dn-20.l6", 0x0400, 0x0400, CRC(02f78ffb) SHA1(cb4dd8b0ce3c404195321b17e10f51352f506958) ) /* MB7122E BPROM */
ROM_END
ROM_START( wndrplnt )
ROM_REGION( 0x60000, "maincpu", 0 ) /* 6*64k for 68000 code */
- ROM_LOAD16_BYTE( "ea08.bin", 0x00000, 0x10000, CRC(b0578a14) SHA1(a420d1e8f80405161c86a123610ddf17c7ff07ff) )
- ROM_LOAD16_BYTE( "ea11.bin", 0x00001, 0x10000, CRC(271edc6c) SHA1(6aa411fa4a3613018e7d971c5675f54d5765904d) )
- ROM_LOAD16_BYTE( "ea07.bin", 0x20000, 0x10000, CRC(7095a7d5) SHA1(a7ee88cad03690a72a52b8ea2310416aa53febdd) )
- ROM_LOAD16_BYTE( "ea10.bin", 0x20001, 0x10000, CRC(81a96475) SHA1(2d2e647ed7867b1a7f0dc24544e241e4b1c9fa92) )
- ROM_LOAD16_BYTE( "ea06.bin", 0x40000, 0x10000, CRC(5951add3) SHA1(394552c29a6266becbdb36c3bd65fc1f56701d11) )
- ROM_LOAD16_BYTE( "ea09.bin", 0x40001, 0x10000, CRC(c4b3cb1e) SHA1(006becbcdbbb3e666382e59e8fa5a5ebe06e5724) )
+ ROM_LOAD16_BYTE( "ea08.j16", 0x00000, 0x10000, CRC(b0578a14) SHA1(a420d1e8f80405161c86a123610ddf17c7ff07ff) )
+ ROM_LOAD16_BYTE( "ea11.j19", 0x00001, 0x10000, CRC(271edc6c) SHA1(6aa411fa4a3613018e7d971c5675f54d5765904d) )
+ ROM_LOAD16_BYTE( "ea07.j14", 0x20000, 0x10000, CRC(7095a7d5) SHA1(a7ee88cad03690a72a52b8ea2310416aa53febdd) )
+ ROM_LOAD16_BYTE( "ea10.j18", 0x20001, 0x10000, CRC(81a96475) SHA1(2d2e647ed7867b1a7f0dc24544e241e4b1c9fa92) )
+ ROM_LOAD16_BYTE( "ea06.j13", 0x40000, 0x10000, CRC(5951add3) SHA1(394552c29a6266becbdb36c3bd65fc1f56701d11) )
+ ROM_LOAD16_BYTE( "ea09.j17", 0x40001, 0x10000, CRC(c4b3cb1e) SHA1(006becbcdbbb3e666382e59e8fa5a5ebe06e5724) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 6502 Sound CPU */
- ROM_LOAD( "ea05.bin", 0x8000, 0x8000, CRC(8dbb6231) SHA1(342faa020448ce916e820b3df18d44191983f7a6) )
+ ROM_LOAD( "ea05.f3", 0x8000, 0x8000, CRC(8dbb6231) SHA1(342faa020448ce916e820b3df18d44191983f7a6) )
ROM_REGION( 0x1000, "mcu", 0 ) /* i8751 MCU */
- ROM_LOAD( "wndrplnt_i8751", 0x0000, 0x1000, NO_DUMP )
+ ROM_LOAD( "wndrplnt_i8751.k13", 0x0000, 0x1000, NO_DUMP )
ROM_REGION( 0x08000, "gfx1", 0 )
- ROM_LOAD( "ea00.bin", 0x00000, 0x08000, CRC(9f3cac4c) SHA1(af8a275ff531029dbada3c820c9f660fef383100) ) /* Characters */
+ ROM_LOAD( "ea00.c5", 0x00000, 0x08000, CRC(9f3cac4c) SHA1(af8a275ff531029dbada3c820c9f660fef383100) ) /* Characters */
ROM_REGION( 0x40000, "gfx2", 0 )
- ROM_LOAD( "ea04.bin", 0x00000, 0x10000, CRC(7d701344) SHA1(4efaa73a4b2534078ee25111a2f5143c7c7e846f) ) /* Backgrounds */
- ROM_LOAD( "ea01.bin", 0x10000, 0x10000, CRC(18df55fb) SHA1(406ea47365ff8372bb2588c97c438ea02aa17538) )
- ROM_LOAD( "ea03.bin", 0x20000, 0x10000, CRC(922ef050) SHA1(e33aea6df2e1a14bd371ed0a2b172f58edcc0e8e) )
- ROM_LOAD( "ea02.bin", 0x30000, 0x10000, CRC(700fde70) SHA1(9b5b59aaffac091622329dc6ebedb24806b69964) )
+ ROM_LOAD( "ea04.d18", 0x00000, 0x10000, CRC(7d701344) SHA1(4efaa73a4b2534078ee25111a2f5143c7c7e846f) ) /* Backgrounds */
+ ROM_LOAD( "ea01.c18", 0x10000, 0x10000, CRC(18df55fb) SHA1(406ea47365ff8372bb2588c97c438ea02aa17538) )
+ ROM_LOAD( "ea03.d15", 0x20000, 0x10000, CRC(922ef050) SHA1(e33aea6df2e1a14bd371ed0a2b172f58edcc0e8e) )
+ ROM_LOAD( "ea02.c18", 0x30000, 0x10000, CRC(700fde70) SHA1(9b5b59aaffac091622329dc6ebedb24806b69964) )
ROM_REGION( 0x80000, "gfx3", 0 )
- ROM_LOAD( "ea12.bin", 0x00000, 0x10000, CRC(a6d4e99d) SHA1(a85dbb23d05d1e386d8a66f505fa9dfcc554327b) ) /* Sprites - 2 sets of 4, interleaved here */
- ROM_LOAD( "ea14.bin", 0x10000, 0x10000, CRC(915ffdc9) SHA1(b65cdc8ee953494f2b69e06cd6c97ee142d83c3e) )
- ROM_LOAD( "ea13.bin", 0x20000, 0x10000, CRC(cd839f3a) SHA1(7eae3a1e080b7db22968d556e80b620cb07976b0) )
- ROM_LOAD( "ea15.bin", 0x30000, 0x10000, CRC(a1f14f16) SHA1(5beb2b8967aa34271f734865704c6bab07d76a8c) )
+ ROM_LOAD( "ea12.f8", 0x00000, 0x10000, CRC(a6d4e99d) SHA1(a85dbb23d05d1e386d8a66f505fa9dfcc554327b) ) /* Sprites - 2 sets of 4, interleaved here */
+ ROM_LOAD( "ea14.f9", 0x10000, 0x10000, CRC(915ffdc9) SHA1(b65cdc8ee953494f2b69e06cd6c97ee142d83c3e) )
+ ROM_LOAD( "ea13.f13", 0x20000, 0x10000, CRC(cd839f3a) SHA1(7eae3a1e080b7db22968d556e80b620cb07976b0) )
+ ROM_LOAD( "ea15.f15", 0x30000, 0x10000, CRC(a1f14f16) SHA1(5beb2b8967aa34271f734865704c6bab07d76a8c) )
ROM_LOAD( "ea16.bin", 0x40000, 0x10000, CRC(7a1d8a9c) SHA1(2b924a7e5a2490a7144b981155f2503d3737875d) )
ROM_LOAD( "ea17.bin", 0x50000, 0x10000, CRC(21a3223d) SHA1(7754ed9cbe4eed94b49130af6108e919be18e5b3) )
ROM_LOAD( "ea18.bin", 0x60000, 0x10000, CRC(3fb2cec7) SHA1(7231bb728f1009186d41e177402e84b63f25a44f) )
ROM_LOAD( "ea19.bin", 0x70000, 0x10000, CRC(87cf03b5) SHA1(29bc25642be1dd7e25f13e96dae90572f7a09d21) )
ROM_REGION( 0x0800, "proms", 0 )
- ROM_LOAD( "ea21.prm", 0x0000, 0x0400, CRC(c8beab49) SHA1(970c2bad3cbf2d7fc313997ae0fe11dd04383b40) )
- ROM_LOAD( "ea20.prm", 0x0400, 0x0400, CRC(619f9d1e) SHA1(17fe49b6c9ce17be4a03e3400229e3ef4998a46f) )
+ ROM_LOAD( "ea-21.k8", 0x0000, 0x0400, CRC(c8beab49) SHA1(970c2bad3cbf2d7fc313997ae0fe11dd04383b40) ) /* MB7132E BPROM */
+ ROM_LOAD( "ea-20.l6", 0x0400, 0x0400, CRC(619f9d1e) SHA1(17fe49b6c9ce17be4a03e3400229e3ef4998a46f) ) /* MB7122E BPROM */
ROM_END
ROM_START( chelnov )
@@ -1201,8 +1201,8 @@ ROM_START( chelnov )
ROM_LOAD( "ee15-.f15", 0x30000, 0x10000, CRC(81e3e68b) SHA1(1059c70b8bfe09c212a19767cfe23efa22afc196) )
ROM_REGION( 0x0800, "proms", 0 )
- ROM_LOAD( "ee-17.k8", 0x0000, 0x0400, CRC(b1db6586) SHA1(a7ecfcb4cf0f7450900820b3dfad8813efedfbea) ) /* different from the Japanese set - need to verify */
- ROM_LOAD( "ee-16.l6", 0x0400, 0x0400, CRC(41816132) SHA1(89a1194bd8bf39f13419df685e489440bdb05676) )
+ ROM_LOAD( "ee-17.k8", 0x0000, 0x0400, CRC(b1db6586) SHA1(a7ecfcb4cf0f7450900820b3dfad8813efedfbea) ) /* MB7132E BPROM */
+ ROM_LOAD( "ee-16.l6", 0x0400, 0x0400, CRC(41816132) SHA1(89a1194bd8bf39f13419df685e489440bdb05676) ) /* MB7122E BPROM */
ROM_END
ROM_START( chelnovu )
@@ -1236,8 +1236,8 @@ ROM_START( chelnovu )
ROM_LOAD( "ee15-.f15", 0x30000, 0x10000, CRC(81e3e68b) SHA1(1059c70b8bfe09c212a19767cfe23efa22afc196) )
ROM_REGION( 0x0800, "proms", 0 )
- ROM_LOAD( "ee-17.k8", 0x0000, 0x0400, CRC(b1db6586) SHA1(a7ecfcb4cf0f7450900820b3dfad8813efedfbea) ) /* different from the Japanese set - need to verify */
- ROM_LOAD( "ee-16.l6", 0x0400, 0x0400, CRC(41816132) SHA1(89a1194bd8bf39f13419df685e489440bdb05676) )
+ ROM_LOAD( "ee-17.k8", 0x0000, 0x0400, CRC(b1db6586) SHA1(a7ecfcb4cf0f7450900820b3dfad8813efedfbea) ) /* MB7132E BPROM */
+ ROM_LOAD( "ee-16.l6", 0x0400, 0x0400, CRC(41816132) SHA1(89a1194bd8bf39f13419df685e489440bdb05676) ) /* MB7122E BPROM */
ROM_END
ROM_START( chelnovj ) /* at least 1 PCB found with all labels as 'EPR-EExx' like Sega labels */
@@ -1271,8 +1271,8 @@ ROM_START( chelnovj ) /* at least 1 PCB found with all labels as 'EPR-EExx' like
ROM_LOAD( "ee15-.f15", 0x30000, 0x10000, CRC(81e3e68b) SHA1(1059c70b8bfe09c212a19767cfe23efa22afc196) )
ROM_REGION( 0x0800, "proms", 0 )
- ROM_LOAD( "ee-17.k8", 0x0000, 0x0400, CRC(309c49d8) SHA1(7220002f6ef97514b4e6f61706fc16061120dafa) ) /* different from the other sets - need to verify */
- ROM_LOAD( "ee-16.l6", 0x0400, 0x0400, CRC(41816132) SHA1(89a1194bd8bf39f13419df685e489440bdb05676) )
+ ROM_LOAD( "ee-17.k8", 0x0000, 0x0400, CRC(b1db6586) SHA1(a7ecfcb4cf0f7450900820b3dfad8813efedfbea) ) /* MB7132E BPROM */
+ ROM_LOAD( "ee-16.l6", 0x0400, 0x0400, CRC(41816132) SHA1(89a1194bd8bf39f13419df685e489440bdb05676) ) /* MB7122E BPROM */
ROM_END
// bootleg of chelnovj, only interesting because it uses a SCM8031HCCN40 instead of the usual 8051 for protection
@@ -1312,8 +1312,8 @@ ROM_START( chelnovjbl ) // code is the same as the regular chelnovj set
ROM_LOAD( "ee15-.f15", 0x30000, 0x10000, CRC(81e3e68b) SHA1(1059c70b8bfe09c212a19767cfe23efa22afc196) )
ROM_REGION( 0x0800, "proms", 0 )
- ROM_LOAD( "ee-17.k8", 0x0000, 0x0400, CRC(309c49d8) SHA1(7220002f6ef97514b4e6f61706fc16061120dafa) ) /* different from the parent set; - might be bad (comment from chelnovj, not dumped here) */
- ROM_LOAD( "ee-16.l6", 0x0400, 0x0400, CRC(41816132) SHA1(89a1194bd8bf39f13419df685e489440bdb05676) )
+ ROM_LOAD( "ee-17.k8", 0x0000, 0x0400, CRC(b1db6586) SHA1(a7ecfcb4cf0f7450900820b3dfad8813efedfbea) ) /* MB7132E BPROM */
+ ROM_LOAD( "ee-16.l6", 0x0400, 0x0400, CRC(41816132) SHA1(89a1194bd8bf39f13419df685e489440bdb05676) ) /* MB7122E BPROM */
ROM_END
/*
@@ -1364,7 +1364,7 @@ ROM_START( chelnovjbla )
ROM_LOAD( "ee15-.f15", 0x30000, 0x10000, CRC(81e3e68b) SHA1(1059c70b8bfe09c212a19767cfe23efa22afc196) )
ROM_REGION( 0x0800, "proms", 0 )
- ROM_LOAD( "ee-17.k8", 0x0000, 0x0400, CRC(309c49d8) SHA1(7220002f6ef97514b4e6f61706fc16061120dafa) ) /* different from the parent set; - might be bad (comment from chelnovj, not dumped here) */
+ ROM_LOAD( "ee-17.k8", 0x0000, 0x0400, CRC(b1db6586) SHA1(a7ecfcb4cf0f7450900820b3dfad8813efedfbea) ) /* not dumped here, taken from parent */
ROM_LOAD( "ee-16.l6", 0x0400, 0x0400, CRC(41816132) SHA1(89a1194bd8bf39f13419df685e489440bdb05676) )
ROM_END
diff --git a/src/mame/drivers/kenseim.cpp b/src/mame/drivers/kenseim.cpp
index ad985da6393..d36a07e7116 100644
--- a/src/mame/drivers/kenseim.cpp
+++ b/src/mame/drivers/kenseim.cpp
@@ -172,11 +172,11 @@ public:
void init_kenseim();
- DECLARE_CUSTOM_INPUT_MEMBER(kenseim_cmd_1234_r);
- DECLARE_CUSTOM_INPUT_MEMBER(kenseim_cmd_5678_r);
- DECLARE_CUSTOM_INPUT_MEMBER(kenseim_cmd_9_r);
- DECLARE_CUSTOM_INPUT_MEMBER(kenseim_cmd_req_r);
- DECLARE_CUSTOM_INPUT_MEMBER(kenseim_cmd_LVm_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(cmd_1234_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(cmd_5678_r);
+ DECLARE_READ_LINE_MEMBER(cmd_9_r);
+ DECLARE_READ_LINE_MEMBER(cmd_req_r);
+ DECLARE_READ_LINE_MEMBER(cmd_LVm_r);
private:
void mole_up(int side, int mole)
@@ -373,27 +373,27 @@ WRITE8_MEMBER(kenseim_state::cpu_portc_w)
/* 68k side COMMS reads */
-CUSTOM_INPUT_MEMBER(kenseim_state::kenseim_cmd_1234_r)
+CUSTOM_INPUT_MEMBER(kenseim_state::cmd_1234_r)
{
return (m_to_68k_cmd_low & 0x0f) >> 0;
}
-CUSTOM_INPUT_MEMBER(kenseim_state::kenseim_cmd_5678_r)
+CUSTOM_INPUT_MEMBER(kenseim_state::cmd_5678_r)
{
return (m_to_68k_cmd_low & 0xf0) >> 4;
}
-CUSTOM_INPUT_MEMBER(kenseim_state::kenseim_cmd_9_r)
+READ_LINE_MEMBER(kenseim_state::cmd_9_r)
{
return m_to_68k_cmd_d9;
}
-CUSTOM_INPUT_MEMBER(kenseim_state::kenseim_cmd_req_r)
+READ_LINE_MEMBER(kenseim_state::cmd_req_r)
{
return m_to_68k_cmd_req;
}
-CUSTOM_INPUT_MEMBER(kenseim_state::kenseim_cmd_LVm_r)
+READ_LINE_MEMBER(kenseim_state::cmd_LVm_r)
{
return m_to_68k_cmd_LVm;;
}
@@ -512,10 +512,10 @@ static INPUT_PORTS_START( kenseim )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED /*IPT_COIN1*/ ) // n/c
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED /*IPT_COIN2*/ ) // n/c
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_9_r, nullptr) // PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) // D9
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(kenseim_state, cmd_9_r) // PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) // D9
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // n/c?
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_req_r, nullptr) // PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) // REQ
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_LVm_r, nullptr) // PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) // LVm
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(kenseim_state, cmd_req_r) // PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) // REQ
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(kenseim_state, cmd_LVm_r) // PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) // LVm
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_SERVICE( 0x40, IP_ACTIVE_LOW ) n/c
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // n/c?
@@ -524,7 +524,7 @@ static INPUT_PORTS_START( kenseim )
// PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) // D6
// PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) // D7
// PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) // D8
- PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_5678_r, nullptr)
+ PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(kenseim_state, cmd_5678_r)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED/*IPT_BUTTON1*/ ) /*PORT_PLAYER(1)*/ // n/c
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED/*IPT_BUTTON2*/ ) /*PORT_PLAYER(1)*/ // n/c
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED/*IPT_BUTTON3*/ ) /*PORT_PLAYER(1)*/ // n/c
@@ -534,7 +534,7 @@ static INPUT_PORTS_START( kenseim )
// PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) // D2
// PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) // D3
// PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) // D4
- PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_1234_r, nullptr)
+ PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(kenseim_state, cmd_1234_r)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED /*IPT_BUTTON1*/ ) /*PORT_PLAYER(2)*/ // n/c
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED /*IPT_BUTTON2*/ ) /*PORT_PLAYER(2)*/ // n/c
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED /*IPT_BUTTON3*/ ) /*PORT_PLAYER(2)*/ // n/c
diff --git a/src/mame/drivers/konamigx.cpp b/src/mame/drivers/konamigx.cpp
index 5deb364a2d4..02879ecf82f 100644
--- a/src/mame/drivers/konamigx.cpp
+++ b/src/mame/drivers/konamigx.cpp
@@ -1189,7 +1189,7 @@ static INPUT_PORTS_START( common )
// note: racin' force expects bit 1 of the eeprom port to toggle
PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
- PORT_BIT( 0x000000fe, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, konamigx_state, gx_rdport1_3_r, nullptr)
+ PORT_BIT( 0x000000fe, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(konamigx_state, gx_rdport1_3_r)
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/ksys573.cpp b/src/mame/drivers/ksys573.cpp
index 17fbf6b5136..f8c5f328778 100644
--- a/src/mame/drivers/ksys573.cpp
+++ b/src/mame/drivers/ksys573.cpp
@@ -466,8 +466,8 @@ public:
void init_drmn();
DECLARE_CUSTOM_INPUT_MEMBER( gn845pwbb_read );
- DECLARE_CUSTOM_INPUT_MEMBER( gunmania_tank_shutter_sensor );
- DECLARE_CUSTOM_INPUT_MEMBER( gunmania_cable_holder_sensor );
+ DECLARE_READ_LINE_MEMBER( gunmania_tank_shutter_sensor );
+ DECLARE_READ_LINE_MEMBER( gunmania_cable_holder_sensor );
DECLARE_READ_LINE_MEMBER( h8_d0_r );
DECLARE_READ_LINE_MEMBER( h8_d1_r );
@@ -2026,7 +2026,7 @@ WRITE16_MEMBER( ksys573_state::gunmania_w )
verboselog( 2, "gunmania_w %08x %08x %08x\n", offset, mem_mask, data );
}
-CUSTOM_INPUT_MEMBER( ksys573_state::gunmania_tank_shutter_sensor )
+READ_LINE_MEMBER( ksys573_state::gunmania_tank_shutter_sensor )
{
if( m_tank_shutter_position == 0 )
{
@@ -2036,7 +2036,7 @@ CUSTOM_INPUT_MEMBER( ksys573_state::gunmania_tank_shutter_sensor )
return 0;
}
-CUSTOM_INPUT_MEMBER( ksys573_state::gunmania_cable_holder_sensor )
+READ_LINE_MEMBER( ksys573_state::gunmania_cable_holder_sensor )
{
return m_cable_holder_release;
}
@@ -2713,7 +2713,7 @@ static INPUT_PORTS_START( ddr )
PORT_INCLUDE( konami573 )
PORT_MODIFY( "IN2" )
- PORT_BIT( 0x00000f0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER( DEVICE_SELF, ksys573_state,gn845pwbb_read, nullptr )
+ PORT_BIT( 0x00000f0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER( ksys573_state, gn845pwbb_read )
PORT_START( "STAGE" )
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_16WAY PORT_PLAYER( 1 )
@@ -2873,11 +2873,11 @@ static INPUT_PORTS_START( gunmania )
PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER( 1 ) PORT_NAME( "Bullet Tube-1 Sensor" )
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER( 1 ) PORT_NAME( "Bullet Tube-2 Sensor" )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER( 1 ) PORT_NAME( "Safety Sensor Under" )
- PORT_BIT( 0x00000100, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER( DEVICE_SELF,ksys573_state,gunmania_tank_shutter_sensor, nullptr )
+ PORT_BIT( 0x00000100, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ksys573_state, gunmania_tank_shutter_sensor)
PORT_MODIFY( "IN3" )
PORT_BIT( 0x0d000b00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x02000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER( DEVICE_SELF,ksys573_state,gunmania_cable_holder_sensor, nullptr )
+ PORT_BIT( 0x02000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ksys573_state, gunmania_cable_holder_sensor)
PORT_START( "GUNX" )
PORT_BIT( 0x7f, 0x2f, IPT_LIGHTGUN_X ) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_MINMAX( 0x00,0x5f ) PORT_SENSITIVITY( 100 ) PORT_KEYDELTA( 15 ) PORT_PLAYER( 1 )
diff --git a/src/mame/drivers/ladybug.cpp b/src/mame/drivers/ladybug.cpp
index 14ee602e55d..6160930e578 100644
--- a/src/mame/drivers/ladybug.cpp
+++ b/src/mame/drivers/ladybug.cpp
@@ -202,13 +202,13 @@ CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r)
static INPUT_PORTS_START( ladybug )
PORT_START("IN0")
- PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ladybug_state, ladybug_p1_control_r, nullptr)
+ PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(ladybug_state, ladybug_p1_control_r)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT )
PORT_START("IN1")
- PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ladybug_state, ladybug_p2_control_r, nullptr)
+ PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(ladybug_state, ladybug_p2_control_r)
// This should be connected to the 4V clock. I don't think the game uses it.
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
// Note that there are TWO VBlank inputs, one is active low, the other active
diff --git a/src/mame/drivers/lastbank.cpp b/src/mame/drivers/lastbank.cpp
index 3934797a153..d6403343398 100644
--- a/src/mame/drivers/lastbank.cpp
+++ b/src/mame/drivers/lastbank.cpp
@@ -223,7 +223,7 @@ static INPUT_PORTS_START( lastbank )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, lastbank_state, sound_status_r, nullptr)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(lastbank_state, sound_status_r)
PORT_START("P1_KEY0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("5-6") PORT_CODE(KEYCODE_B)
diff --git a/src/mame/drivers/lethalj.cpp b/src/mame/drivers/lethalj.cpp
index 01875d251d5..2fc6664dc42 100644
--- a/src/mame/drivers/lethalj.cpp
+++ b/src/mame/drivers/lethalj.cpp
@@ -514,7 +514,7 @@ static INPUT_PORTS_START( cclownz )
PORT_DIPSETTING( 0x0000, "3000" )
PORT_START("IN1")
- PORT_BIT( 0x0f0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, lethalj_state,cclownz_paddle, nullptr)
+ PORT_BIT( 0x0f0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(lethalj_state, cclownz_paddle)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r)
PORT_BIT( 0x0060, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
diff --git a/src/mame/drivers/limenko.cpp b/src/mame/drivers/limenko.cpp
index d8291d3ad28..55ccde825cd 100644
--- a/src/mame/drivers/limenko.cpp
+++ b/src/mame/drivers/limenko.cpp
@@ -66,7 +66,7 @@ public:
void init_legendoh();
void init_spotty();
- DECLARE_CUSTOM_INPUT_MEMBER(spriteram_bit_r);
+ DECLARE_READ_LINE_MEMBER(spriteram_bit_r);
protected:
virtual void video_start() override;
@@ -164,7 +164,7 @@ void limenko_state::fg_videoram_w(offs_t offset, u32 data, u32 mem_mask)
m_fg_tilemap->mark_tile_dirty(offset);
}
-CUSTOM_INPUT_MEMBER(limenko_state::spriteram_bit_r)
+READ_LINE_MEMBER(limenko_state::spriteram_bit_r)
{
return m_spriteram_bit;
}
@@ -572,7 +572,7 @@ static INPUT_PORTS_START(legendoh)
PORT_DIPNAME(0x20000000, 0x00000000, "Sound Enable")
PORT_DIPSETTING( 0x20000000, DEF_STR(Off))
PORT_DIPSETTING( 0x00000000, DEF_STR(On))
- PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, limenko_state,spriteram_bit_r, nullptr) //changes spriteram location
+ PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(limenko_state, spriteram_bit_r) //changes spriteram location
PORT_BIT(0x4000ffff, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("EEPROMOUT")
@@ -616,7 +616,7 @@ static INPUT_PORTS_START(sb2003)
PORT_DIPNAME(0x20000000, 0x00000000, "Sound Enable")
PORT_DIPSETTING( 0x20000000, DEF_STR(Off))
PORT_DIPSETTING( 0x00000000, DEF_STR(On))
- PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, limenko_state,spriteram_bit_r, nullptr) //changes spriteram location
+ PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(limenko_state, spriteram_bit_r) //changes spriteram location
PORT_BIT(0x00100000, IP_ACTIVE_LOW, IPT_SERVICE1) // checked in dynabomb I/O test, but doesn't work in game
PORT_BIT(0x5f00ffff, IP_ACTIVE_LOW, IPT_UNUSED)
@@ -654,7 +654,7 @@ static INPUT_PORTS_START(spotty)
PORT_BIT(0x00010000, IP_ACTIVE_LOW, IPT_START1)
PORT_BIT(0x00020000, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x00040000, IP_ACTIVE_LOW, IPT_COIN1)
- PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, limenko_state,spriteram_bit_r, nullptr) //changes spriteram location
+ PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(limenko_state, spriteram_bit_r) //changes spriteram location
PORT_SERVICE_NO_TOGGLE(0x00200000, IP_ACTIVE_LOW)
PORT_BIT(0x00400000, IP_ACTIVE_LOW, IPT_CUSTOM) //security bit
PORT_BIT(0x00800000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
diff --git a/src/mame/drivers/littlerb.cpp b/src/mame/drivers/littlerb.cpp
index 5c5c206ca69..0058b8d9acb 100644
--- a/src/mame/drivers/littlerb.cpp
+++ b/src/mame/drivers/littlerb.cpp
@@ -255,7 +255,7 @@ static INPUT_PORTS_START( littlerb )
PORT_DIPNAME( 0x1000, 0x1000, "???" )
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_BIT( 0xe000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, littlerb_state,littlerb_frame_step_r, nullptr)
+ PORT_BIT( 0xe000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(littlerb_state, littlerb_frame_step_r)
PORT_START("P2") /* 16bit */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
diff --git a/src/mame/drivers/m92.cpp b/src/mame/drivers/m92.cpp
index 23cf49cb831..8485bdaf54e 100644
--- a/src/mame/drivers/m92.cpp
+++ b/src/mame/drivers/m92.cpp
@@ -283,7 +283,7 @@ WRITE8_MEMBER(m92_state::bankswitch_w)
logerror("%05x: bankswitch %04x\n", m_maincpu->pc(), data);
}
-CUSTOM_INPUT_MEMBER(m92_state::m92_sprite_busy_r)
+READ_LINE_MEMBER(m92_state::sprite_busy_r)
{
return m_sprite_buffer_busy;
}
@@ -420,7 +420,7 @@ static INPUT_PORTS_START( m92_2player )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, m92_state,m92_sprite_busy_r, nullptr)
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(m92_state, sprite_busy_r)
/* DIP switch bank 3 */
PORT_DIPUNKNOWN_DIPLOC( 0x0100, 0x0100, "SW3:1" )
PORT_DIPUNKNOWN_DIPLOC( 0x0200, 0x0200, "SW3:2" )
diff --git a/src/mame/drivers/merit.cpp b/src/mame/drivers/merit.cpp
index 8c932d55280..ba47fc504d6 100644
--- a/src/mame/drivers/merit.cpp
+++ b/src/mame/drivers/merit.cpp
@@ -120,7 +120,7 @@ public:
void init_key_2();
void init_dtrvwz5();
- DECLARE_CUSTOM_INPUT_MEMBER(rndbit_r);
+ DECLARE_READ_LINE_MEMBER(rndbit_r);
private:
void dodge_nvram_init(nvram_device &nvram, void *base, size_t size);
@@ -411,7 +411,7 @@ WRITE8_MEMBER(merit_state::casino5_bank_w)
}
}
-CUSTOM_INPUT_MEMBER(merit_state::rndbit_r)
+READ_LINE_MEMBER(merit_state::rndbit_r)
{
return machine().rand();
}
@@ -638,7 +638,7 @@ static INPUT_PORTS_START( meritpoker )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, merit_state,rndbit_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(merit_state, rndbit_r)
PORT_START("DSW")
PORT_DIPUNKNOWN_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:1" )
@@ -846,7 +846,7 @@ static INPUT_PORTS_START( pitboss ) /* PCB pinout maps 12 lamp outputs - Where a
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_COCKTAIL PORT_CODE(KEYCODE_G) PORT_NAME("P2 Button 5")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_COCKTAIL PORT_CODE(KEYCODE_W) PORT_NAME("P2 Play")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, merit_state,rndbit_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(merit_state, rndbit_r)
PORT_START("DSW")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW:1")
@@ -909,7 +909,7 @@ static INPUT_PORTS_START( mroundup ) // todo: Find were Player 2 "Play" is mappe
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_COCKTAIL PORT_CODE(KEYCODE_G) PORT_NAME("P2 Button 5")
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // pulling this LOW causes "unathorized conversion" msg.
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, merit_state,rndbit_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(merit_state, rndbit_r)
PORT_START("DSW")
PORT_DIPNAME( 0x01, 0x01, "Enable Draw Poker" ) PORT_DIPLOCATION("SW1:1")
@@ -1054,7 +1054,7 @@ static INPUT_PORTS_START( casino5 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, merit_state,rndbit_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(merit_state, rndbit_r)
PORT_START("DSW")
PORT_DIPNAME( 0x01, 0x01, "Enable Draw Poker" ) PORT_DIPLOCATION("SW1:1")
diff --git a/src/mame/drivers/metro.cpp b/src/mame/drivers/metro.cpp
index 47722f3d48a..41600286900 100644
--- a/src/mame/drivers/metro.cpp
+++ b/src/mame/drivers/metro.cpp
@@ -322,9 +322,9 @@ READ8_MEMBER(metro_state::soundstatus_r)
return (m_busy_sndcpu ? 0x00 : 0x01);
}
-CUSTOM_INPUT_MEMBER(metro_state::custom_soundstatus_r)
+READ_LINE_MEMBER(metro_state::custom_soundstatus_r)
{
- return (m_busy_sndcpu ? 0x01 : 0x00);
+ return (m_busy_sndcpu ? 1 : 0);
}
WRITE8_MEMBER(metro_state::soundstatus_w)
@@ -1373,7 +1373,7 @@ void metro_state::vmetal_map(address_map &map)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 ) \
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 ) \
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, metro_state,custom_soundstatus_r, nullptr) /* From Sound CPU */
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(metro_state, custom_soundstatus_r) /* From Sound CPU */
#define COINAGE_SERVICE_LOC(DIPBANK) \
diff --git a/src/mame/drivers/mhavoc.cpp b/src/mame/drivers/mhavoc.cpp
index df4dcfaf274..52d51efd330 100644
--- a/src/mame/drivers/mhavoc.cpp
+++ b/src/mame/drivers/mhavoc.cpp
@@ -375,7 +375,7 @@ void mhavoc_state::alphaone_map(address_map &map)
*
*************************************/
-CUSTOM_INPUT_MEMBER(mhavoc_state::clock_r)
+READ_LINE_MEMBER(mhavoc_state::clock_r)
{
/* 2.4kHz (divide 2.5MHz by 1024) */
return (m_alpha->total_cycles() & 0x400) ? 0 : 1;
@@ -394,20 +394,20 @@ static INPUT_PORTS_START( mhavoc )
/* Bit 2 = Gamma xmtd flag */
/* Bit 1 = 2.4kHz (divide 2.5MHz by 1024) */
/* Bit 0 = Vector generator halt flag */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("avg", avg_mhavoc_device, done_r, nullptr)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,clock_r, nullptr)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,gamma_xmtd_r, nullptr)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,gamma_rcvd_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_mhavoc_device, done_r)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(mhavoc_state, clock_r)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(mhavoc_state, gamma_xmtd_r)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(mhavoc_state, gamma_rcvd_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diag Step/Coin C") PORT_CODE(KEYCODE_F1)
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,mhavoc_bit67_r, "COIN\0SERVICE")
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mhavoc_state, coin_service_r)
PORT_START("IN1") /* gamma */
/* Bits 7-2 = input switches */
/* Bit 1 = Alpha rcvd flag */
/* Bit 0 = Alpha xmtd flag */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,alpha_xmtd_r, nullptr)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,alpha_rcvd_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(mhavoc_state, alpha_xmtd_r)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(mhavoc_state, alpha_rcvd_r)
PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
@@ -476,7 +476,7 @@ static INPUT_PORTS_START( mhavocrv )
PORT_INCLUDE( mhavoc )
PORT_MODIFY("IN1")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,tms5220_r, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("tms", tms5220_device, readyq_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -493,8 +493,8 @@ INPUT_PORTS_END
static INPUT_PORTS_START( alphaone )
PORT_START("IN0") /* alpha (player_1 = 0) */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("avg", avg_mhavoc_device, done_r, nullptr)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,clock_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_mhavoc_device, done_r)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(mhavoc_state, clock_r)
PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
diff --git a/src/mame/drivers/micro3d.cpp b/src/mame/drivers/micro3d.cpp
index 6077a7cb88a..160fdaadb2d 100644
--- a/src/mame/drivers/micro3d.cpp
+++ b/src/mame/drivers/micro3d.cpp
@@ -117,7 +117,7 @@ static INPUT_PORTS_START( botss )
PORT_INCLUDE( micro3d )
PORT_MODIFY("INPUTS_A_B")
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, micro3d_state, botss_hwchk_r, nullptr)
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(micro3d_state, botss_hwchk_r)
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Shield")
PORT_SERVICE( 0x0400, IP_ACTIVE_LOW )
diff --git a/src/mame/drivers/midvunit.cpp b/src/mame/drivers/midvunit.cpp
index 5ae88e17edb..319eff9f656 100644
--- a/src/mame/drivers/midvunit.cpp
+++ b/src/mame/drivers/midvunit.cpp
@@ -757,7 +757,7 @@ static INPUT_PORTS_START( crusnusa )
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_NAME("Motion Status - Device 2")
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_NAME("Motion Status - Device 3")
PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_NAME("Motion Status - Device 4")
- PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, midvunit_state, motion_r, nullptr )
+ PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(midvunit_state, motion_r)
PORT_START("DSW")
/* DSW2 at U97 */
@@ -1300,7 +1300,7 @@ ROM_START( crusnusa ) /* Version 4.1, Mon Feb 13 1995 - 16:53:40 */
ROM_LOAD32_BYTE( "cusa.u29", 0x800003, 0x80000, CRC(cbe52c60) SHA1(3f309ce8ef1784c830f4160cfe76dc3a0b438cac) )
ROM_REGION( 0x0b33, "pals", 0 ) // all protected
- ROM_LOAD("a-19993.u38", 0x0000, 0x02e5, CRC(7e8b7b0d) SHA1(f9af19da171f949a11c5548da7b4277aecb6f2a8) ) /* TIBPAL22V10-15BCNT */
+ ROM_LOAD("a-19993.u38", 0x0000, 0x02e5, BAD_DUMP CRC(7e8b7b0d) SHA1(f9af19da171f949a11c5548da7b4277aecb6f2a8) ) /* TIBPAL22V10-15BCNT */
ROM_LOAD("a-19670.u43", 0x0000, 0x0144, BAD_DUMP CRC(acafcc97) SHA1(b6f916838d08590a536fe925ec62d66e6ea3dcbc) ) /* TIBPAL20L8-10CNT */
ROM_LOAD("a-19668.u52", 0x0000, 0x0157, BAD_DUMP CRC(7915134e) SHA1(aeb22e46abdc14a9e9b34cfe3b77da3e29b789fe) ) /* GAL20V8B */
ROM_LOAD("a-19671.u54", 0x0000, 0x02dd, BAD_DUMP CRC(b9cce038) SHA1(8d1df026bdac66ea5493e9e51c23f8eb182b024e) ) /* TIBPAL22V10-15BCNT */
@@ -1343,7 +1343,7 @@ ROM_START( crusnusa40 ) /* Version 4.0, Wed Feb 08 1995 - 10:45:14 */
ROM_LOAD32_BYTE( "cusa.u29", 0x800003, 0x80000, CRC(cbe52c60) SHA1(3f309ce8ef1784c830f4160cfe76dc3a0b438cac) )
ROM_REGION( 0x0b33, "pals", 0 ) // all protected
- ROM_LOAD("a-19993.u38", 0x0000, 0x02e5, CRC(7e8b7b0d) SHA1(f9af19da171f949a11c5548da7b4277aecb6f2a8) ) /* TIBPAL22V10-15BCNT */
+ ROM_LOAD("a-19993.u38", 0x0000, 0x02e5, BAD_DUMP CRC(7e8b7b0d) SHA1(f9af19da171f949a11c5548da7b4277aecb6f2a8) ) /* TIBPAL22V10-15BCNT */
ROM_LOAD("a-19670.u43", 0x0000, 0x0144, BAD_DUMP CRC(acafcc97) SHA1(b6f916838d08590a536fe925ec62d66e6ea3dcbc) ) /* TIBPAL20L8-10CNT */
ROM_LOAD("a-19668.u52", 0x0000, 0x0157, BAD_DUMP CRC(7915134e) SHA1(aeb22e46abdc14a9e9b34cfe3b77da3e29b789fe) ) /* GAL20V8B */
ROM_LOAD("a-19671.u54", 0x0000, 0x02dd, BAD_DUMP CRC(b9cce038) SHA1(8d1df026bdac66ea5493e9e51c23f8eb182b024e) ) /* TIBPAL22V10-15BCNT */
diff --git a/src/mame/drivers/midyunit.cpp b/src/mame/drivers/midyunit.cpp
index 4d35c966546..7c0d543b23e 100644
--- a/src/mame/drivers/midyunit.cpp
+++ b/src/mame/drivers/midyunit.cpp
@@ -153,7 +153,7 @@ WRITE8_MEMBER(midyunit_state::yawdim_oki_bank_w)
*
*************************************/
-CUSTOM_INPUT_MEMBER(midyunit_state::narc_talkback_strobe_r)
+READ_LINE_MEMBER(midyunit_state::narc_talkback_strobe_r)
{
return (m_narc_sound->read() >> 8) & 1;
}
@@ -165,7 +165,7 @@ CUSTOM_INPUT_MEMBER(midyunit_state::narc_talkback_data_r)
}
-CUSTOM_INPUT_MEMBER(midyunit_state::adpcm_irq_state_r)
+READ_LINE_MEMBER(midyunit_state::adpcm_irq_state_r)
{
return m_adpcm_sound->irq_read() & 1;
}
@@ -241,7 +241,7 @@ static INPUT_PORTS_START( narc )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN4 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, midyunit_state,narc_talkback_strobe_r, nullptr)
+ PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(midyunit_state, narc_talkback_strobe_r)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) /* memory protect interlock */
PORT_BIT( 0x3000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xc000, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -257,7 +257,7 @@ static INPUT_PORTS_START( narc )
*/
PORT_START("IN2")
- PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, midyunit_state,narc_talkback_data_r, nullptr)
+ PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(midyunit_state, narc_talkback_data_r)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW")
@@ -724,7 +724,7 @@ static INPUT_PORTS_START( mkla2 )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Block 2") PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Low Punch") PORT_PLAYER(1)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Low Kick") PORT_PLAYER(1)
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, midyunit_state,adpcm_irq_state_r, nullptr)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(midyunit_state, adpcm_irq_state_r)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Block 2") PORT_PLAYER(1)
PORT_START("IN2")
@@ -816,7 +816,7 @@ static INPUT_PORTS_START( mkla4 )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Block 2") PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Low Punch") PORT_PLAYER(1)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Low Kick") PORT_PLAYER(1)
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, midyunit_state,adpcm_irq_state_r, nullptr)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(midyunit_state, adpcm_irq_state_r)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Block 2") PORT_PLAYER(1)
PORT_START("IN2")
@@ -908,7 +908,7 @@ static INPUT_PORTS_START( term2 )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x3000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, midyunit_state,adpcm_irq_state_r, nullptr)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(midyunit_state, adpcm_irq_state_r)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("DSW")
@@ -1009,7 +1009,7 @@ static INPUT_PORTS_START( totcarn )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) /* video freeze */
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x3c00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, midyunit_state,adpcm_irq_state_r, nullptr)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(midyunit_state, adpcm_irq_state_r)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2")
diff --git a/src/mame/drivers/midzeus.cpp b/src/mame/drivers/midzeus.cpp
index a34c61a00f0..192bc040bb0 100644
--- a/src/mame/drivers/midzeus.cpp
+++ b/src/mame/drivers/midzeus.cpp
@@ -1100,7 +1100,7 @@ static INPUT_PORTS_START( crusnexo )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN2")
- PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, midzeus_state, keypad_r, nullptr )
+ PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(midzeus_state, keypad_r )
PORT_BIT( 0xfff8, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEYPAD")
@@ -1216,7 +1216,7 @@ static INPUT_PORTS_START( thegrid )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2")
- PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, midzeus_state, custom_49way_r, nullptr)
+ PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(midzeus_state, custom_49way_r)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("49WAYX")
diff --git a/src/mame/drivers/missile.cpp b/src/mame/drivers/missile.cpp
index 2a62d81080f..6aa4787d203 100644
--- a/src/mame/drivers/missile.cpp
+++ b/src/mame/drivers/missile.cpp
@@ -387,7 +387,7 @@ public:
void init_missilem();
void init_suprmatk();
- DECLARE_CUSTOM_INPUT_MEMBER(get_vblank);
+ DECLARE_READ_LINE_MEMBER(vblank_r);
private:
DECLARE_WRITE8_MEMBER(missile_w);
@@ -505,7 +505,7 @@ TIMER_CALLBACK_MEMBER(missile_state::clock_irq)
}
-CUSTOM_INPUT_MEMBER(missile_state::get_vblank)
+READ_LINE_MEMBER(missile_state::vblank_r)
{
int v = scanline_to_v(m_screen->vpos());
return v < 24;
@@ -991,7 +991,7 @@ static INPUT_PORTS_START( missile )
PORT_BIT( 0x18, IP_ACTIVE_HIGH, IPT_CUSTOM )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, missile_state,get_vblank, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(missile_state, vblank_r)
PORT_START("R10") /* IN2 */
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("R10:1,2")
@@ -1081,7 +1081,7 @@ static INPUT_PORTS_START( suprmatk )
PORT_BIT( 0x18, IP_ACTIVE_HIGH, IPT_CUSTOM )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, missile_state,get_vblank, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(missile_state, vblank_r)
PORT_START("R10") /* IN2 */
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("R10:1,2")
diff --git a/src/mame/drivers/mjkjidai.cpp b/src/mame/drivers/mjkjidai.cpp
index 2aa94b2d72a..c83ef4b9023 100644
--- a/src/mame/drivers/mjkjidai.cpp
+++ b/src/mame/drivers/mjkjidai.cpp
@@ -162,7 +162,7 @@ static INPUT_PORTS_START( mjkjidai )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEYBOARD")
- PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, mjkjidai_state, keyboard_r, nullptr)
+ PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(mjkjidai_state, keyboard_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // reinitialize NVRAM and reset the game
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
diff --git a/src/mame/drivers/model2.cpp b/src/mame/drivers/model2.cpp
index 4f2d41e2db1..3ed7aae5fd0 100644
--- a/src/mame/drivers/model2.cpp
+++ b/src/mame/drivers/model2.cpp
@@ -1739,7 +1739,7 @@ static INPUT_PORTS_START( daytona )
PORT_MODIFY("IN1")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON9) PORT_NAME("VR4 (Green)")
PORT_BIT(0x0e, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x70, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, model2_state, daytona_gearbox_r, nullptr)
+ PORT_BIT(0x70, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(model2_state, daytona_gearbox_r)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_MODIFY("IN2")
@@ -1878,7 +1878,7 @@ static INPUT_PORTS_START( srallyc )
PORT_MODIFY("IN1")
PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x70, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, model2_state, daytona_gearbox_r, nullptr)
+ PORT_BIT(0x70, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(model2_state, daytona_gearbox_r)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_MODIFY("IN2")
diff --git a/src/mame/drivers/mquake.cpp b/src/mame/drivers/mquake.cpp
index 1fdf926f4bb..a8917d18086 100644
--- a/src/mame/drivers/mquake.cpp
+++ b/src/mame/drivers/mquake.cpp
@@ -174,11 +174,11 @@ static INPUT_PORTS_START( mquake )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) /* JS1SW */
PORT_START("joy_0_dat")
- PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mquake_state,amiga_joystick_convert, (void *)0)
+ PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mquake_state, amiga_joystick_convert<0>)
PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("joy_1_dat")
- PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mquake_state,amiga_joystick_convert, (void *)1)
+ PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mquake_state, amiga_joystick_convert<1>)
PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("p1_joy")
diff --git a/src/mame/drivers/ms32.cpp b/src/mame/drivers/ms32.cpp
index b71bb15525d..d3c5112b116 100644
--- a/src/mame/drivers/ms32.cpp
+++ b/src/mame/drivers/ms32.cpp
@@ -934,7 +934,7 @@ static INPUT_PORTS_START( ms32_mahjong )
PORT_INCLUDE( ms32 )
PORT_MODIFY("INPUTS")
- PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ms32_state,mahjong_ctrl_r, nullptr) // here we read mahjong keys
+ PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(ms32_state, mahjong_ctrl_r) // here we read mahjong keys
PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
diff --git a/src/mame/drivers/multigam.cpp b/src/mame/drivers/multigam.cpp
index 11034f792f3..a8617843474 100644
--- a/src/mame/drivers/multigam.cpp
+++ b/src/mame/drivers/multigam.cpp
@@ -135,7 +135,7 @@ public:
void init_multigam();
void init_multigm3();
- DECLARE_CUSTOM_INPUT_MEMBER(multigam_inputs_r);
+ DECLARE_READ_LINE_MEMBER(multigam_inputs_r);
protected:
virtual void machine_start() override;
@@ -346,7 +346,7 @@ READ8_MEMBER(multigam_state::multigam_IN1_r)
return ((m_in_1 >> m_in_1_shift++) & 0x01) | 0x40;
}
-CUSTOM_INPUT_MEMBER(multigam_state::multigam_inputs_r)
+READ_LINE_MEMBER(multigam_state::multigam_inputs_r)
{
/* bit 0: serial input (dsw)
bit 1: coin */
@@ -1036,7 +1036,7 @@ static INPUT_PORTS_START( multigam_common )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, multigam_state,multigam_inputs_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(multigam_state, multigam_inputs_r)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
INPUT_PORTS_END
diff --git a/src/mame/drivers/mw18w.cpp b/src/mame/drivers/mw18w.cpp
index f3a2e8263e4..64194a28ed0 100644
--- a/src/mame/drivers/mw18w.cpp
+++ b/src/mame/drivers/mw18w.cpp
@@ -219,7 +219,7 @@ static INPUT_PORTS_START( mw18w )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // left/right sw.
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw18w_state, mw18w_sensors_r, nullptr)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw18w_state, mw18w_sensors_r)
PORT_START("IN1")
PORT_BIT( 0x1f, 0x00, IPT_PEDAL ) PORT_REMAP_TABLE(mw18w_controller_table + 0x20) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_NAME("Gas Pedal")
diff --git a/src/mame/drivers/mw8080bw.cpp b/src/mame/drivers/mw8080bw.cpp
index c1ff84b847d..d00d06e6695 100644
--- a/src/mame/drivers/mw8080bw.cpp
+++ b/src/mame/drivers/mw8080bw.cpp
@@ -385,7 +385,7 @@ static INPUT_PORTS_START( seawolf )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,seawolf_erase_input_r, nullptr)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, seawolf_erase_input_r)
PORT_DIPNAME( 0xe0, 0x60, "Extended Time At" ) PORT_DIPLOCATION("G4:6,7,8")
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
PORT_DIPSETTING( 0x20, "2000" )
@@ -656,21 +656,21 @@ void mw8080bw_state::tornbase_io_map(address_map &map)
static INPUT_PORTS_START( tornbase )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,tornbase_hit_left_input_r, nullptr)
- PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,tornbase_pitch_left_input_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, tornbase_hit_left_input_r)
+ PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, tornbase_pitch_left_input_r)
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B1:7")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,tornbase_hit_right_input_r, nullptr)
- PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,tornbase_pitch_right_input_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, tornbase_hit_right_input_r)
+ PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, tornbase_pitch_right_input_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED) /* not connected */
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* schematics shows it as "START", but not used by the software */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,tornbase_score_input_r, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, tornbase_score_input_r)
PORT_DIPNAME( 0x78, 0x40, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B1:2,3,4,5")
PORT_DIPSETTING( 0x18, "4 Coins/1 Inning" )
PORT_DIPSETTING( 0x10, "3 Coins/1 Inning" )
@@ -1240,10 +1240,10 @@ void mw8080bw_state::desertgu_io_map(address_map &map)
static INPUT_PORTS_START( desertgu )
PORT_START("IN0")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,desertgu_gun_input_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, desertgu_gun_input_r)
PORT_START("IN1")
- PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,desertgu_dip_sw_0_1_r, nullptr)
+ PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, desertgu_dip_sw_0_1_r)
PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN1", 0x30, NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:5,6")
PORT_DIPSETTING( 0x00, DEF_STR( English ) )
PORT_DIPSETTING( 0x04, DEF_STR( German ) )
@@ -1365,12 +1365,12 @@ void mw8080bw_state::dplay_io_map(address_map &map)
static INPUT_PORTS_START( dplay )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Hit") PORT_PLAYER(1)
- PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,dplay_pitch_left_input_r, nullptr)
+ PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, dplay_pitch_left_input_r)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Hit") PORT_PLAYER(2)
- PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,dplay_pitch_right_input_r, nullptr)
+ PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, dplay_pitch_right_input_r)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("IN2")
@@ -1429,12 +1429,12 @@ INPUT_PORTS_END
static INPUT_PORTS_START( einning )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Hit") PORT_PLAYER(1)
- PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,dplay_pitch_left_input_r, nullptr)
+ PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, dplay_pitch_left_input_r)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Hit") PORT_PLAYER(2)
- PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,dplay_pitch_right_input_r, nullptr)
+ PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, dplay_pitch_right_input_r)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("IN2")
@@ -1756,7 +1756,7 @@ void mw8080bw_state::clowns_io_map(address_map &map)
static INPUT_PORTS_START( clowns )
PORT_START("IN0")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,clowns_controller_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, clowns_controller_r)
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) /* not connected */
@@ -1805,7 +1805,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( clowns1 )
PORT_START("IN0")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,clowns_controller_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, clowns_controller_r)
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1896,7 +1896,7 @@ void mw8080bw_state::spacwalk_io_map(address_map &map)
static INPUT_PORTS_START( spacwalk )
PORT_START("IN0")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,clowns_controller_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, clowns_controller_r)
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2545,6 +2545,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_coin_input_r)
{
uint32_t ret = ioport(INVADERS_COIN_INPUT_PORT_TAG)->read();
+ // FIXME: use PORT_CHANGED_MEMBER or PORT_WRITE_LINE_MEMBER instead of updating here
machine().bookkeeping().coin_counter_w(0, !ret);
return ret;
@@ -2648,17 +2649,17 @@ static INPUT_PORTS_START( invaders )
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW:8")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
- PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_sw6_sw7_r, nullptr)
+ PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_sw6_sw7_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in0_control_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_sw5_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in0_control_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_sw5_r)
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_coin_input_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_coin_input_r)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in1_control_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in1_control_r)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN2")
@@ -2671,7 +2672,7 @@ static INPUT_PORTS_START( invaders )
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW:2")
PORT_DIPSETTING( 0x08, "1000" )
PORT_DIPSETTING( 0x00, "1500" )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in2_control_r, nullptr)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_in2_control_r)
PORT_DIPNAME( 0x80, 0x00, "Display Coinage" ) PORT_DIPLOCATION("SW:1")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -2754,6 +2755,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::blueshrk_coin_input_r)
{
uint32_t ret = ioport(BLUESHRK_COIN_INPUT_PORT_TAG)->read();
+ // FIXME: use PORT_CHANGED_MEMBER or PORT_WRITE_LINE_MEMBER instead of updating here
machine().bookkeeping().coin_counter_w(0, !ret);
return ret;
@@ -2781,7 +2783,7 @@ static INPUT_PORTS_START( blueshrk )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,blueshrk_coin_input_r, nullptr)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, blueshrk_coin_input_r)
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -2872,7 +2874,7 @@ static INPUT_PORTS_START( invad2ct )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_coin_input_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, invaders_coin_input_r)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
diff --git a/src/mame/drivers/namcos21_de.cpp b/src/mame/drivers/namcos21_de.cpp
index 5b1ed9a62e8..92c08805094 100644
--- a/src/mame/drivers/namcos21_de.cpp
+++ b/src/mame/drivers/namcos21_de.cpp
@@ -556,7 +556,7 @@ static INPUT_PORTS_START( driveyes )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("pcb_1:MCUDI0")
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("gearbox", namcoio_gearbox_device, in_r, nullptr )
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_DEVICE_MEMBER("gearbox", namcoio_gearbox_device, in_r)
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("pcb_1:MCUDI1") /* 63B05Z0 - $3001 */
diff --git a/src/mame/drivers/namcos22.cpp b/src/mame/drivers/namcos22.cpp
index 8ad1f1d5f50..23e472cadd2 100644
--- a/src/mame/drivers/namcos22.cpp
+++ b/src/mame/drivers/namcos22.cpp
@@ -3335,9 +3335,10 @@ INPUT_PORTS_END
/*********************************************************************************************/
-CUSTOM_INPUT_MEMBER(namcos22s_state::alpine_motor_read)
+template <int N>
+READ_LINE_MEMBER(namcos22s_state::alpine_motor_r)
{
- return m_motor_status >> (uintptr_t)param & 1;
+ return BIT(m_motor_status, N);
}
static INPUT_PORTS_START( alpiner )
@@ -3349,8 +3350,8 @@ static INPUT_PORTS_START( alpiner )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 ) // Decision / View Change
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_16WAY // L Selection
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_16WAY // R Selection
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, namcos22s_state, alpine_motor_read, 0) // steps are free
- PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, namcos22s_state, alpine_motor_read, 1) // steps are locked
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(namcos22s_state, alpine_motor_r<0>) // steps are free
+ PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(namcos22s_state, alpine_motor_r<1>) // steps are locked
PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("ADC.0")
diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp
index ed5f2018ca8..a175a2bf7a7 100644
--- a/src/mame/drivers/naomi.cpp
+++ b/src/mame/drivers/naomi.cpp
@@ -2534,7 +2534,7 @@ static INPUT_PORTS_START( naomi_mp )
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CHANGED_MEMBER(DEVICE_SELF, naomi_state,naomi_mp_w, 0)
PORT_START("P1")
- PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, naomi_state,naomi_mp_r, "KEY1\0KEY2\0KEY3\0KEY4\0KEY5")
+ PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(naomi_state, naomi_mp_r)
PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("KEY1")
@@ -2587,7 +2587,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( suchie3 )
PORT_INCLUDE( naomi_mp )
PORT_MODIFY("P1")
- PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, naomi_state,naomi_mp_r, "KEY5\0KEY2\0KEY3\0KEY4\0KEY1")
+ PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(naomi_state, suchie3_mp_r)
INPUT_PORTS_END
static INPUT_PORTS_START( naomi_kb )
@@ -2615,7 +2615,7 @@ static INPUT_PORTS_START( naomi_kb )
// ---- ---x num lock
PORT_START("P1.KC1")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, naomi_state, naomi_kb_r, 0)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(naomi_state, naomi_kb_r)
PORT_START("P1.KC2")
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
diff --git a/src/mame/drivers/nbmj8891.cpp b/src/mame/drivers/nbmj8891.cpp
index 1d19aa6d393..376b129c49e 100644
--- a/src/mame/drivers/nbmj8891.cpp
+++ b/src/mame/drivers/nbmj8891.cpp
@@ -566,7 +566,7 @@ void nbmj8891_state::taiwanmb_io_map(address_map &map)
* However, a few games (lovehous, maiko, mmaiko, hanaoji and the ones using inputport3_r below)
* read nb1413m3_outcoin_flag also at inputport3! Is this the correct behaviour for these games
* or should they only check the flag at inputport3? */
-CUSTOM_INPUT_MEMBER( nbmj8891_state::nb1413m3_outcoin_flag_r )
+READ_LINE_MEMBER( nbmj8891_state::nb1413m3_outcoin_flag_r )
{
return m_nb1413m3->m_outcoin_flag & 0x01;
}
@@ -1649,7 +1649,7 @@ static INPUT_PORTS_START( lovehous )
PORT_START("PORT0-2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_outcoin_flag_r, nullptr) // OUT COIN
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(nbmj8891_state, nb1413m3_outcoin_flag_r) // OUT COIN
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1810,7 +1810,7 @@ static INPUT_PORTS_START( maiko )
PORT_START("PORT0-2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_outcoin_flag_r, nullptr) // OUT COIN
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(nbmj8891_state, nb1413m3_outcoin_flag_r) // OUT COIN
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) //
@@ -1886,7 +1886,7 @@ static INPUT_PORTS_START( mmaiko )
PORT_START("PORT0-2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_outcoin_flag_r, nullptr) // OUT COIN
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(nbmj8891_state, nb1413m3_outcoin_flag_r) // OUT COIN
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1962,7 +1962,7 @@ static INPUT_PORTS_START( hanaoji )
PORT_START("PORT0-2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_outcoin_flag_r, nullptr) // OUT COIN
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(nbmj8891_state, nb1413m3_outcoin_flag_r) // OUT COIN
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) //
diff --git a/src/mame/drivers/neogeo.cpp b/src/mame/drivers/neogeo.cpp
index 82f55dbc5df..3b4720ef2b7 100644
--- a/src/mame/drivers/neogeo.cpp
+++ b/src/mame/drivers/neogeo.cpp
@@ -1826,8 +1826,8 @@ INPUT_PORTS_START( neogeo )
PORT_START("SYSTEM")
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0f00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ngarcade_base_state, startsel_edge_joy_r, nullptr)
- PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_base_state, get_memcard_status, nullptr)
+ PORT_BIT( 0x0f00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(ngarcade_base_state, startsel_edge_joy_r)
+ PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(neogeo_base_state, get_memcard_status)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) // Hardware type (AES=0, MVS=1). Some games check this and show a piracy warning screen if the hardware and BIOS don't match
PORT_START("AUDIO/COIN")
@@ -1838,7 +1838,7 @@ INPUT_PORTS_START( neogeo )
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) // sense: 4-slot
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("upd4990a", upd1990a_device, tp_r)
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("upd4990a", upd1990a_device, data_out_r)
- PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_base_state,get_audio_result, nullptr)
+ PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(neogeo_base_state, get_audio_result)
PORT_START("TEST")
PORT_BIT( 0x003f, IP_ACTIVE_HIGH, IPT_UNUSED )
@@ -1851,7 +1851,7 @@ static INPUT_PORTS_START( neogeo_mvs )
PORT_INCLUDE( neogeo )
PORT_MODIFY("SYSTEM")
- PORT_BIT( 0x0500, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ngarcade_base_state, startsel_edge_joy_r, nullptr)
+ PORT_BIT( 0x0500, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(ngarcade_base_state, startsel_edge_joy_r)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_3)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_4)
@@ -1876,14 +1876,14 @@ INPUT_PORTS_START( aes )
PORT_START("IN2")
PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED )
// Start & Select are read from controller slot device
- PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_base_state, get_memcard_status, nullptr)
+ PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(neogeo_base_state, get_memcard_status)
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* Hardware type (AES=0, MVS=1) Some games check this and show a piracy warning screen if the hardware and BIOS don't match */
PORT_START("AUDIO")
PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED ) /* AES has no coin slots, it's a console */
PORT_BIT( 0x0018, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* what is this? Universe BIOS uses these bits to detect MVS or AES hardware */
PORT_BIT( 0x00e0, IP_ACTIVE_HIGH, IPT_UNUSED ) /* AES has no upd4990a */
- PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_base_state, get_audio_result, nullptr)
+ PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(neogeo_base_state, get_audio_result)
PORT_START("JP") // JP1 and JP2 are jumpers or solderpads depending on AES board revision, intended for use on the Development BIOS
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Short JP1 (Debug Monitor)") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, aes_base_state, aes_jp1, 0)
diff --git a/src/mame/drivers/niyanpai.cpp b/src/mame/drivers/niyanpai.cpp
index 5cdbd6a3f82..5f02e7ea0b8 100644
--- a/src/mame/drivers/niyanpai.cpp
+++ b/src/mame/drivers/niyanpai.cpp
@@ -109,7 +109,7 @@ WRITE16_MEMBER(niyanpai_state::tmp68301_parallel_port_w)
machine().bookkeeping().coin_lockout_w(0,data & 0x08);
}
-CUSTOM_INPUT_MEMBER(niyanpai_state::musobana_outcoin_flag_r)
+READ_LINE_MEMBER(niyanpai_state::musobana_outcoin_flag_r)
{
if (m_motor_on) m_musobana_outcoin_flag ^= 1;
else m_musobana_outcoin_flag = 1;
@@ -482,7 +482,7 @@ static INPUT_PORTS_START( musobana ) // I don't have manual for this game.
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 ) // CREDIT CLEAR
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
- PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, niyanpai_state,musobana_outcoin_flag_r, nullptr) // OUT COIN
+ PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(niyanpai_state, musobana_outcoin_flag_r) // OUT COIN
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) // TEST
@@ -536,7 +536,7 @@ static INPUT_PORTS_START( 4psimasy )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 ) // CREDIT CLEAR
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
- PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, niyanpai_state,musobana_outcoin_flag_r, nullptr) // OUT COIN
+ PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(niyanpai_state, musobana_outcoin_flag_r) // OUT COIN
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) // TEST
@@ -602,7 +602,7 @@ static INPUT_PORTS_START( mhhonban ) // I don't have manual for this game.
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 ) // CREDIT CLEAR
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
- PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, niyanpai_state,musobana_outcoin_flag_r, nullptr) // OUT COIN
+ PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(niyanpai_state, musobana_outcoin_flag_r) // OUT COIN
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) // TEST
@@ -668,7 +668,7 @@ static INPUT_PORTS_START( zokumahj ) // I don't have manual for this game.
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 ) // CREDIT CLEAR
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
- PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, niyanpai_state,musobana_outcoin_flag_r, nullptr) // OUT COIN
+ PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(niyanpai_state, musobana_outcoin_flag_r) // OUT COIN
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) // TEST
diff --git a/src/mame/drivers/nmk16.cpp b/src/mame/drivers/nmk16.cpp
index 06df64835a7..cde064818b9 100644
--- a/src/mame/drivers/nmk16.cpp
+++ b/src/mame/drivers/nmk16.cpp
@@ -4693,11 +4693,11 @@ void nmk16_state::gunnailb(machine_config &config)
void nmk16_state::macross2(machine_config &config)
{
/* basic machine hardware */
- M68000(config, m_maincpu, 10000000); /* 10 MHz ? */
+ M68000(config, m_maincpu, XTAL(10'000'000)); /* MC68000P12 10 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::macross2_map);
set_hacky_interrupt_timing(config);
- Z80(config, m_audiocpu, 4000000); /* 4 MHz ? */
+ Z80(config, m_audiocpu, 4000000); /* Z8400B PS 4 MHz ? */
m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::macross2_sound_map);
m_audiocpu->set_addrmap(AS_IO, &nmk16_state::macross2_sound_io_map);
@@ -4715,17 +4715,17 @@ void nmk16_state::macross2(machine_config &config)
GENERIC_LATCH_8(config, m_soundlatch);
GENERIC_LATCH_8(config, "soundlatch2");
- ym2203_device &ymsnd(YM2203(config, "ymsnd", 1500000));
+ ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000) / 8));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.50);
ymsnd.add_route(1, "mono", 0.50);
ymsnd.add_route(2, "mono", 0.50);
ymsnd.add_route(3, "mono", 1.20);
- OKIM6295(config, m_oki[0], 16000000/4, okim6295_device::PIN7_LOW);
+ OKIM6295(config, m_oki[0], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW);
m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10);
- OKIM6295(config, m_oki[1], 16000000/4, okim6295_device::PIN7_LOW);
+ OKIM6295(config, m_oki[1], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW);
m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10);
nmk112_device &nmk112(NMK112(config, "nmk112", 0));
@@ -4736,11 +4736,11 @@ void nmk16_state::macross2(machine_config &config)
void nmk16_state::tdragon2(machine_config &config)
{
/* basic machine hardware */
- M68000(config, m_maincpu, 10000000); /* 10 MHz */
+ M68000(config, m_maincpu, XTAL(10'000'000)); /* TMP68000P-12 10 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::tdragon2_map);
set_hacky_interrupt_timing(config);
- Z80(config, m_audiocpu, 4000000); /* 4 MHz */
+ Z80(config, m_audiocpu, 4000000); /* Z0840006PSC 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::macross2_sound_map);
m_audiocpu->set_addrmap(AS_IO, &nmk16_state::macross2_sound_io_map);
@@ -4758,17 +4758,17 @@ void nmk16_state::tdragon2(machine_config &config)
GENERIC_LATCH_8(config, m_soundlatch);
GENERIC_LATCH_8(config, "soundlatch2");
- ym2203_device &ymsnd(YM2203(config, "ymsnd", 1500000));
+ ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000) / 8));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.50);
ymsnd.add_route(1, "mono", 0.50);
ymsnd.add_route(2, "mono", 0.50);
ymsnd.add_route(3, "mono", 1.20);
- OKIM6295(config, m_oki[0], 16000000/4, okim6295_device::PIN7_LOW);
+ OKIM6295(config, m_oki[0], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW);
m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10);
- OKIM6295(config, m_oki[1], 16000000/4, okim6295_device::PIN7_LOW);
+ OKIM6295(config, m_oki[1], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW);
m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10);
nmk112_device &nmk112(NMK112(config, "nmk112", 0));
@@ -4787,11 +4787,11 @@ void nmk16_state::tdragon3h(machine_config &config)
void nmk16_state::raphero(machine_config &config)
{
/* basic machine hardware */
- M68000(config, m_maincpu, 14000000); /* 14 MHz measured */
+ M68000(config, m_maincpu, XTAL(14'000'000)); /* MC68HC000P12 or MC68000P12F or TMP68HC000P-16 14 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::raphero_map);
set_hacky_interrupt_timing(config);
- TMP90841(config, m_audiocpu, 8000000);
+ TMP90841(config, m_audiocpu, XTAL(16'000'000) / 2); // TMP90C841AN 8 MHz
m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::raphero_sound_mem_map);
/* video hardware */
@@ -4808,17 +4808,17 @@ void nmk16_state::raphero(machine_config &config)
GENERIC_LATCH_8(config, m_soundlatch);
GENERIC_LATCH_8(config, "soundlatch2");
- ym2203_device &ymsnd(YM2203(config, "ymsnd", 1500000));
+ ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000) / 8));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.50);
ymsnd.add_route(1, "mono", 0.50);
ymsnd.add_route(2, "mono", 0.50);
ymsnd.add_route(3, "mono", 1.20);
- OKIM6295(config, m_oki[0], 16000000/4, okim6295_device::PIN7_LOW);
+ OKIM6295(config, m_oki[0], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW);
m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10);
- OKIM6295(config, m_oki[1], 16000000/4, okim6295_device::PIN7_LOW);
+ OKIM6295(config, m_oki[1], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW);
m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10);
nmk112_device &nmk112(NMK112(config, "nmk112", 0));
diff --git a/src/mame/drivers/nova2001.cpp b/src/mame/drivers/nova2001.cpp
index e19726fc8c1..d8ebe5cb5d2 100644
--- a/src/mame/drivers/nova2001.cpp
+++ b/src/mame/drivers/nova2001.cpp
@@ -393,7 +393,7 @@ static INPUT_PORTS_START( ninjakun )
PORT_START("IN2") /* 0xa002 */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nova2001_state,ninjakun_io_A002_ctrl_r, nullptr)
+ PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(nova2001_state, ninjakun_io_A002_ctrl_r)
PORT_START("DSW1") // printed "SW 2"
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
diff --git a/src/mame/drivers/nss.cpp b/src/mame/drivers/nss.cpp
index 65b716c5b3b..a0d1f495d85 100644
--- a/src/mame/drivers/nss.cpp
+++ b/src/mame/drivers/nss.cpp
@@ -322,7 +322,7 @@ public:
void init_nss();
- DECLARE_CUSTOM_INPUT_MEMBER(game_over_flag_r);
+ DECLARE_READ_LINE_MEMBER(game_over_flag_r);
private:
required_device<cpu_device> m_bioscpu;
@@ -652,7 +652,7 @@ void nss_state::machine_start()
}
-CUSTOM_INPUT_MEMBER(nss_state::game_over_flag_r)
+READ_LINE_MEMBER(nss_state::game_over_flag_r)
{
return m_game_over_flag;
}
@@ -665,7 +665,7 @@ static INPUT_PORTS_START( snes )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_START("FP")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nss_state,game_over_flag_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(nss_state, game_over_flag_r)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("Restart Button")
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("Page Up Button")
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("Page Down Button")
diff --git a/src/mame/drivers/omegrace.cpp b/src/mame/drivers/omegrace.cpp
index 697295a1559..621cc9c67e6 100644
--- a/src/mame/drivers/omegrace.cpp
+++ b/src/mame/drivers/omegrace.cpp
@@ -502,7 +502,7 @@ static INPUT_PORTS_START( omegrace )
PORT_BIT( 0x3f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10) PORT_COCKTAIL
PORT_START("AVGDVG") /* port 0x0b */
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("dvg", dvg_device, done_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dvg", dvg_device, done_r)
INPUT_PORTS_END
diff --git a/src/mame/drivers/opwolf.cpp b/src/mame/drivers/opwolf.cpp
index 893f88200c2..b9cc31fb9aa 100644
--- a/src/mame/drivers/opwolf.cpp
+++ b/src/mame/drivers/opwolf.cpp
@@ -541,11 +541,11 @@ static INPUT_PORTS_START( opwolf )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN2")
- PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, opwolf_state, opwolf_gun_x_r, nullptr)
+ PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(opwolf_state, opwolf_gun_x_r)
PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN3")
- PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, opwolf_state, opwolf_gun_y_r, nullptr)
+ PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(opwolf_state, opwolf_gun_y_r)
PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START(P1X_PORT_TAG) /* P1X (span allows you to shoot enemies behind status bar) */
diff --git a/src/mame/drivers/pc.cpp b/src/mame/drivers/pc.cpp
index c916d4055e9..b9d188eddcc 100644
--- a/src/mame/drivers/pc.cpp
+++ b/src/mame/drivers/pc.cpp
@@ -70,7 +70,7 @@ public:
void juko16(machine_config &config);
void hyo88t(machine_config &config);
void kyoxt(machine_config &config);
-
+
void init_bondwell();
DECLARE_INPUT_CHANGED_MEMBER(pc_turbo_callback);
@@ -486,6 +486,22 @@ ROM_START( eagle1600 )
ROM_LOAD("eagle 1600 video char gen u301.bin", 0x00000, 0x1000, CRC(1a7e552f) SHA1(749058783eec9d96a70dc5fdbfccb56196f889dc))
ROM_END
+/*************************************************************** Eagle PC-2 ***
+
+Links: http://www.digibarn.com/collections/systems/eagle-pc/index.html , https://www.atarimagazines.com/creative/v10n2/28_Eagle_PC2.php http://www.old-computers.com/museum/computer.asp?st=1&c=529
+Form Factor: Desktop
+
+Error message: Cannot read boot sector
+******************************************************************************/
+
+ROM_START( eaglepc2 )
+ ROM_REGION16_LE(0x10000,"bios", 0)
+ ROM_LOAD("eagle_pc-2_bios_2.812_1986_u1101.bin", 0xe000, 0x2000, CRC(cd0fc034) SHA1(883cb4808c565f2582873a51cc637ab25b457f88))
+
+ ROM_REGION(0x8000,"gfx1", 0)
+ ROM_LOAD("eagle_pc-2_cga_char_rom_u401.bin", 0x00000, 0x1000, CRC(e85da08d) SHA1(176a7027bd14cc7efbb5cec5c2ac89ba002912d0))
+
+ROM_END
/********************************************************** Eagle PC Spirit ***
@@ -1291,6 +1307,48 @@ ROM_START( nixpc01 )
ROM_LOAD( "nx01.bin", 0xc000, 0x4000, CRC(b0a75d1f) SHA1(7c2890eced917969968fc2e7491cda90a9734e03))
ROM_END
+/******************************************************Leading Edge Model M ***
+
+aka the Sperry PC, the "Sperry HT - 4.71 Bios" that can be found online is identical to the v.4.71 below
+E-TD10 - TOD Error
+acording to http://www.o3one.org/hwdocs/bios_doc/dosref22.html this machine had AT-like RTC services
+The "M" stood for a Mitsubishi made machine, the "Leading Edge Model D" was made by Daewoo
+Works with the "siemens" config, so instead of duplicating it until more is known we'll use that.
+
+******************************************************************************/
+
+ROM_START( ledgmodm )
+ ROM_REGION(0x10000, "bios", 0)
+ ROM_SYSTEM_BIOS(0, "v330", "Version 3.30")
+ ROMX_LOAD( "leading_edge-model_m-version_3.30.bin", 0xc000, 0x4000, CRC(386dd187) SHA1(848ccdc8209c24478a4f75dd941760c43d3bc732), ROM_BIOS(0) )
+ ROM_SYSTEM_BIOS(1, "v471", "Version 4.71")
+ ROMX_LOAD( "leading_edge-model_m-version_4.71.bin", 0xc000, 0x4000, CRC(0d5d8bee) SHA1(6c35adf6a8da149e420b5aa8dd0e18e02488cfa0), ROM_BIOS(1) )
+ROM_END
+
+/************************************** CCI Micromint MPX-16 PC Motherboard ***
+
+Circuit Cellar Project
+The ROMs are marked "Micromint MPX16 5/8 PC/Term 3/1/84"
+hangs on boot, maybe they are waiting for a serial connection
+
+******************************************************************************/
+
+ROM_START( mpx16 )
+ ROM_REGION16_LE(0x10000,"bios", 0)
+ ROM_LOAD("mpx16u84.bin", 0xe000, 0x1000, CRC(8a557a25) SHA1(90f8112c094cc0ac44c2d5d43fbb577333dfc165))
+ ROM_LOAD("mpx16u85.bin", 0xf000, 0x1000, CRC(42097571) SHA1(2acaca033242e35e512b30b2233da02bde561cc3))
+ROM_END
+
+/*************************************************** Vendex HeadStart Plus ***
+
+Samsung manufactured - Chipset: Faraday FE2010A - "Keyboard Error or no keyboard present"
+On-board: FDC
+
+******************************************************************************/
+ROM_START( hstrtpls )
+ ROM_REGION(0x10000,"bios", 0)
+ ROM_LOAD("bios.bin", 0xc000, 0x04000, CRC(19d705f8) SHA1(5e607fec6b533bc59d8d804e399bb9d438d6999d))
+ROM_END
/***************************************************************************
@@ -1333,3 +1391,7 @@ COMP( 198?, juko16, ibm5150, 0, juko16, pccga, pc_state,
COMP( 198?, hyo88t, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Hyosung", "Topstar 88T", MACHINE_NOT_WORKING )
COMP( 198?, kyoxt, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Kyocera", "XT", MACHINE_NOT_WORKING )
COMP( 198?, kaypropc, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Kaypro Corporation", "PC", MACHINE_NOT_WORKING )
+COMP( 198?, ledgmodm, ibm5150, 0, siemens, pccga, pc_state, empty_init, "Leading Edge", "Model M", MACHINE_NOT_WORKING )
+COMP( 198?, eaglepc2, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Eagle", "PC-2", MACHINE_NOT_WORKING )
+COMP( 198?, mpx16, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Micromint", "MPX-16", MACHINE_NOT_WORKING )
+COMP( 198?, hstrtpls, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Vendex", "HeadStart Plus", MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp
index 282285d0a3c..76144fb92d7 100644
--- a/src/mame/drivers/pc9801.cpp
+++ b/src/mame/drivers/pc9801.cpp
@@ -1601,7 +1601,7 @@ static INPUT_PORTS_START( pc9801 )
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) //system clock = 5 MHz (0) / 8 MHz (1)
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, pc9801_state, system_type_r, nullptr)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(pc9801_state, system_type_r)
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, "System Specification" ) PORT_DIPLOCATION("SW1:1") //jumps to daa00 if off, presumably some card booting
diff --git a/src/mame/drivers/pencil2.cpp b/src/mame/drivers/pencil2.cpp
index 090b4b2bd7a..f6fe91efb81 100644
--- a/src/mame/drivers/pencil2.cpp
+++ b/src/mame/drivers/pencil2.cpp
@@ -107,8 +107,8 @@ public:
void pencil2(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(printer_ready_r);
- DECLARE_CUSTOM_INPUT_MEMBER(printer_ack_r);
+ DECLARE_READ_LINE_MEMBER(printer_ready_r);
+ DECLARE_READ_LINE_MEMBER(printer_ack_r);
private:
DECLARE_WRITE8_MEMBER(port10_w);
@@ -192,7 +192,7 @@ WRITE_LINE_MEMBER( pencil2_state::write_centronics_busy )
m_centronics_busy = state;
}
-CUSTOM_INPUT_MEMBER( pencil2_state::printer_ready_r )
+READ_LINE_MEMBER( pencil2_state::printer_ready_r )
{
return m_centronics_busy;
}
@@ -202,7 +202,7 @@ WRITE_LINE_MEMBER( pencil2_state::write_centronics_ack )
m_centronics_ack = state;
}
-CUSTOM_INPUT_MEMBER( pencil2_state::printer_ack_r )
+READ_LINE_MEMBER( pencil2_state::printer_ack_r )
{
return m_centronics_ack;
}
@@ -216,10 +216,10 @@ static INPUT_PORTS_START( pencil2 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, pencil2_state, printer_ready_r, " ")
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(pencil2_state, printer_ready_r)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Break") PORT_CODE(KEYCODE_END)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, pencil2_state, printer_ack_r, " ")
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(pencil2_state, printer_ack_r)
PORT_START("E1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j') PORT_CHAR('@')
diff --git a/src/mame/drivers/peplus.cpp b/src/mame/drivers/peplus.cpp
index 6778945bb33..c69232af1f7 100644
--- a/src/mame/drivers/peplus.cpp
+++ b/src/mame/drivers/peplus.cpp
@@ -238,6 +238,7 @@ public:
m_bp(*this, "BP"),
m_touch_x(*this, "TOUCH_X"),
m_touch_y(*this, "TOUCH_Y"),
+ m_inp_bank(*this, "IN_BANK%u", 1U),
m_cmos_ram(*this, "cmos"),
m_program_ram(*this, "prograram"),
m_s3000_ram(*this, "s3000_ram"),
@@ -261,7 +262,7 @@ public:
void init_pepluss64();
void init_peplussbw();
- DECLARE_CUSTOM_INPUT_MEMBER(input_r);
+ template <int N> DECLARE_CUSTOM_INPUT_MEMBER(input_r);
protected:
virtual void machine_start() override;
@@ -283,6 +284,7 @@ private:
optional_ioport m_bp;
optional_ioport m_touch_x;
optional_ioport m_touch_y;
+ optional_ioport_array<2> m_inp_bank;
required_shared_ptr<uint8_t> m_cmos_ram;
required_shared_ptr<uint8_t> m_program_ram;
@@ -1088,10 +1090,11 @@ void peplus_state::main_iomap(address_map &map)
* Input ports *
*************************/
+template <int N>
CUSTOM_INPUT_MEMBER(peplus_state::input_r)
{
uint8_t inp_ret = 0x00;
- uint8_t inp_read = ioport((const char *)param)->read();
+ uint8_t inp_read = m_inp_bank[N]->read();
if (inp_read & 0x01) inp_ret = 0x01;
if (inp_read & 0x02) inp_ret = 0x02;
@@ -1165,9 +1168,9 @@ static INPUT_PORTS_START( peplus_schip )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("IN0")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK1")
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<0>)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK2")
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<1>)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Card Cage") PORT_CODE(KEYCODE_M) PORT_TOGGLE
INPUT_PORTS_END
@@ -1193,9 +1196,9 @@ static INPUT_PORTS_START( nonplus_poker )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) // Bill Acceptor
PORT_START("IN0")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK1")
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<0>)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK2")
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<1>)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Card Cage") PORT_CODE(KEYCODE_M) PORT_TOGGLE
PORT_MODIFY("SW1")
@@ -1243,9 +1246,9 @@ static INPUT_PORTS_START( peplus_poker )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) // Bill Acceptor
PORT_START("IN0")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK1")
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<0>)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK2")
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<1>)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Card Cage") PORT_CODE(KEYCODE_M) PORT_TOGGLE
INPUT_PORTS_END
@@ -1271,9 +1274,9 @@ static INPUT_PORTS_START( peplus_bjack )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON15 ) // Bill Acceptor
PORT_START("IN0")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK1")
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<0>)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK2")
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<1>)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Card Cage") PORT_CODE(KEYCODE_M) PORT_TOGGLE
INPUT_PORTS_END
@@ -1304,9 +1307,9 @@ static INPUT_PORTS_START( peplus_keno )
PORT_BIT( 0xffff, 0x200, IPT_LIGHTGUN_Y ) PORT_MINMAX(0x00, 1024) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(13)
PORT_START("IN0")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK1")
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<0>)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Light Pen") PORT_CODE(KEYCODE_A)
- PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK2")
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<1>)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Card Cage") PORT_CODE(KEYCODE_M) PORT_TOGGLE
INPUT_PORTS_END
@@ -1332,9 +1335,9 @@ static INPUT_PORTS_START( peplus_slots )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON15 ) // Bill Acceptor
PORT_START("IN0")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK1")
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<0>)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state, input_r, "IN_BANK2")
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(peplus_state, input_r<1>)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Card Cage") PORT_CODE(KEYCODE_M) PORT_TOGGLE
INPUT_PORTS_END
diff --git a/src/mame/drivers/peyper.cpp b/src/mame/drivers/peyper.cpp
index f3dc37a2f57..c39595cb46c 100644
--- a/src/mame/drivers/peyper.cpp
+++ b/src/mame/drivers/peyper.cpp
@@ -53,7 +53,7 @@ public:
, m_dpl(*this, "dpl_%u", 0U)
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(wolfman_replay_hs_r);
+ template <int Mask> DECLARE_CUSTOM_INPUT_MEMBER(wolfman_replay_hs_r);
void init_peyper();
void init_odin();
void init_wolfman();
@@ -186,18 +186,17 @@ WRITE8_MEMBER(peyper_state::sol_w)
}
+template <int Mask>
CUSTOM_INPUT_MEMBER(peyper_state::wolfman_replay_hs_r)
{
- int bit_mask = (uintptr_t)param;
-
- switch (bit_mask)
+ switch (Mask)
{
case 0x03:
- return ((ioport("REPLAY")->read() & bit_mask) >> 0);
+ return ((ioport("REPLAY")->read() & Mask) >> 0);
case 0x40:
- return ((ioport("REPLAY")->read() & bit_mask) >> 6);
+ return ((ioport("REPLAY")->read() & Mask) >> 6);
default:
- logerror("wolfman_replay_hs_r : invalid %02X bit_mask\n",bit_mask);
+ logerror("wolfman_replay_hs_r : invalid %02X bit_mask\n",Mask);
return 0;
}
}
@@ -511,14 +510,14 @@ static INPUT_PORTS_START( wolfman )
PORT_DIPSETTING( 0x20, "01" )
// PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coinage ) ) // Partidas/Moneda - code at 0x0a69 - tables at 0x0b30 (4 * 3) - credits BCD stored at 0x6151
// PORT_DIPNAME( 0x04, 0x00, "Balls" ) // Bolas/Partida - code at 0x0a5c - stored at 0x60bd
- PORT_BIT( 0x03, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, peyper_state,wolfman_replay_hs_r, (void *)0x03)
+ PORT_BIT( 0x03, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(peyper_state, wolfman_replay_hs_r<0x03>)
/* DSW1 : port 0x24 - DSW1-1 is bit 7 ... DSW1-8 is bit 0 */
PORT_START("DSW1")
PORT_DIPNAME( 0x80, 0x00, "Adjust Replay" ) // Premios por Puntuacion - code at 0x0aa3 - stored at 0x60c4 and 0x60cc (0x00 NO / 0x05 YES)
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x80, DEF_STR( Yes ) )
- PORT_BIT( 0x40, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, peyper_state,wolfman_replay_hs_r, (void *)0x40)
+ PORT_BIT( 0x40, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(peyper_state, wolfman_replay_hs_r<0x40>)
PORT_DIPNAME( 0x20, 0x00, "Clear RAM on Reset" ) // Borrador RAM - code at 0x0ace - range 0x6141..0x616f - 0x616d = 0x5a and 0x616e = 0xa5
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x20, DEF_STR( Yes ) )
diff --git a/src/mame/drivers/phoenix.cpp b/src/mame/drivers/phoenix.cpp
index 065e5770a1d..703e90a1fc0 100644
--- a/src/mame/drivers/phoenix.cpp
+++ b/src/mame/drivers/phoenix.cpp
@@ -101,7 +101,7 @@ static INPUT_PORTS_START( phoenix )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, phoenix_state,player_input_r, nullptr)
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(phoenix_state, player_input_r)
PORT_START("DSW0")
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION( "SW1:1,2" )
@@ -184,7 +184,7 @@ static INPUT_PORTS_START( condor )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, phoenix_state,player_input_r, nullptr)
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(phoenix_state, player_input_r)
PORT_START("DSW0")
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION( "SW1:1,2" )
@@ -314,7 +314,7 @@ static INPUT_PORTS_START( pleiads )
PORT_INCLUDE( phoenix )
PORT_MODIFY("IN0")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, phoenix_state,pleiads_protection_r, nullptr) /* Protection. See 0x0552 */
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(phoenix_state, pleiads_protection_r) // Protection. See 0x0552
PORT_MODIFY("DSW0")
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW1:7" )
@@ -337,7 +337,7 @@ static INPUT_PORTS_START( pleiadbl )
PORT_INCLUDE( phoenix )
PORT_MODIFY("IN0")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, phoenix_state,pleiads_protection_r, nullptr) /* Protection. See 0x0552 */
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(phoenix_state, pleiads_protection_r) // Protection. See 0x0552
PORT_MODIFY("DSW0")
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW1:7" )
diff --git a/src/mame/drivers/piggypas.cpp b/src/mame/drivers/piggypas.cpp
index 20b3a23f899..9dcfa1b5e30 100644
--- a/src/mame/drivers/piggypas.cpp
+++ b/src/mame/drivers/piggypas.cpp
@@ -37,7 +37,7 @@ public:
void piggypas(machine_config &config);
void fidlstix(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(ball_sensor);
- DECLARE_CUSTOM_INPUT_MEMBER(ticket_r);
+
private:
void output_digits();
virtual void machine_start() override;
@@ -150,17 +150,12 @@ INPUT_CHANGED_MEMBER(piggypas_state::ball_sensor)
m_maincpu->set_input_line(1, newval ? CLEAR_LINE : ASSERT_LINE);
}
-CUSTOM_INPUT_MEMBER(piggypas_state::ticket_r)
-{
- return m_ticket->line_r();
-}
-
static INPUT_PORTS_START( piggypas )
PORT_START("IN0")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN3)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_START1)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_COIN4)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, piggypas_state, ticket_r, nullptr)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_COIN2)
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Gate sensor") PORT_CODE(KEYCODE_G)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
diff --git a/src/mame/drivers/pirates.cpp b/src/mame/drivers/pirates.cpp
index aa543f63141..66e86bab16f 100644
--- a/src/mame/drivers/pirates.cpp
+++ b/src/mame/drivers/pirates.cpp
@@ -117,7 +117,7 @@ WRITE16_MEMBER(pirates_state::out_w)
// logerror("%06x: out_w %04x\n",m_maincpu->pc(),data);
}
-CUSTOM_INPUT_MEMBER(pirates_state::prot_r)
+READ_LINE_MEMBER(pirates_state::prot_r)
{
// static int prot = 0xa3;
// offs_t pc;
@@ -204,7 +204,7 @@ static INPUT_PORTS_START( pirates )
PORT_BIT( 0x0010, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) // EEPROM data
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // seems checked in "test mode"
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // seems checked in "test mode"
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, pirates_state,prot_r, nullptr) // protection
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_READ_LINE_MEMBER(pirates_state, prot_r) // protection
/* What do these bits do ? */
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN )
diff --git a/src/mame/drivers/piratesh.cpp b/src/mame/drivers/piratesh.cpp
index b42c050a2d6..15c0fda159a 100644
--- a/src/mame/drivers/piratesh.cpp
+++ b/src/mame/drivers/piratesh.cpp
@@ -490,7 +490,7 @@ static INPUT_PORTS_START( piratesh )
PORT_START("SPECIAL")
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("k053250", k053250ps_device, dmairq_r)
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // FIXME: NCPU from 053246 (DMA)
- PORT_BIT( 0x0c00, IP_ACTIVE_HIGH, IPT_CUSTOM )PORT_CUSTOM_MEMBER(DEVICE_SELF, piratesh_state, battery_r, nullptr)
+ PORT_BIT( 0x0c00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(piratesh_state, battery_r)
PORT_START("HELM")
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(1)
@@ -507,7 +507,7 @@ static INPUT_PORTS_START( piratesh )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r)
- PORT_BIT( 0x1800, IP_ACTIVE_HIGH, IPT_CUSTOM )PORT_CUSTOM_MEMBER(DEVICE_SELF, piratesh_state, helm_r, nullptr)
+ PORT_BIT( 0x1800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(piratesh_state, helm_r)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/plan80.cpp b/src/mame/drivers/plan80.cpp
index 65adfc6b469..b4678cafb24 100644
--- a/src/mame/drivers/plan80.cpp
+++ b/src/mame/drivers/plan80.cpp
@@ -27,6 +27,8 @@
#include "cpu/i8085/i8085.h"
#include "emupal.h"
#include "screen.h"
+#include "sound/spkrdev.h"
+#include "speaker.h"
class plan80_state : public driver_device
@@ -37,6 +39,7 @@ public:
, m_maincpu(*this, "maincpu")
, m_p_videoram(*this, "videoram")
, m_p_chargen(*this, "chargen")
+ , m_speaker(*this, "speaker")
{ }
void plan80(machine_config &config);
@@ -49,8 +52,9 @@ private:
TIMER_BOOT
};
- DECLARE_READ8_MEMBER(plan80_04_r);
- DECLARE_WRITE8_MEMBER(plan80_09_w);
+ DECLARE_READ8_MEMBER(port04_r);
+ DECLARE_WRITE8_MEMBER(port09_w);
+ DECLARE_WRITE8_MEMBER(port10_w);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void plan80_io(address_map &map);
@@ -58,13 +62,15 @@ private:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
uint8_t m_kbd_row;
+ bool m_spk_pol;
virtual void machine_reset() override;
required_device<cpu_device> m_maincpu;
required_shared_ptr<uint8_t> m_p_videoram;
required_region_ptr<u8> m_p_chargen;
+ required_device<speaker_sound_device> m_speaker;
};
-READ8_MEMBER( plan80_state::plan80_04_r )
+READ8_MEMBER( plan80_state::port04_r )
{
uint8_t data = 0xff;
@@ -86,11 +92,17 @@ READ8_MEMBER( plan80_state::plan80_04_r )
return data;
}
-WRITE8_MEMBER( plan80_state::plan80_09_w )
+WRITE8_MEMBER( plan80_state::port09_w )
{
m_kbd_row = data;
}
+WRITE8_MEMBER( plan80_state::port10_w )
+{
+ m_spk_pol ^= 1;
+ m_speaker->level_w(m_spk_pol);
+}
+
void plan80_state::plan80_mem(address_map &map)
{
@@ -105,8 +117,9 @@ void plan80_state::plan80_io(address_map &map)
{
map.unmap_value_high();
map.global_mask(0xff);
- map(0x04, 0x04).r(FUNC(plan80_state::plan80_04_r));
- map(0x09, 0x09).w(FUNC(plan80_state::plan80_09_w));
+ map(0x04, 0x04).r(FUNC(plan80_state::port04_r));
+ map(0x09, 0x09).w(FUNC(plan80_state::port09_w));
+ map(0x10, 0x10).w(FUNC(plan80_state::port10_w));
}
/* Input ports */
@@ -251,6 +264,10 @@ void plan80_state::plan80(machine_config &config)
GFXDECODE(config, "gfxdecode", "palette", gfx_plan80);
PALETTE(config, "palette", palette_device::MONOCHROME);
+
+ /* sound hardware */
+ SPEAKER(config, "mono").front_center();
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50);
}
/* ROM definition */
@@ -268,4 +285,4 @@ ROM_END
/* Driver */
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
-COMP( 1988, plan80, 0, 0, plan80, plan80, plan80_state, init_plan80, "Tesla Eltos", "Plan-80", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
+COMP( 1988, plan80, 0, 0, plan80, plan80, plan80_state, init_plan80, "Tesla Eltos", "Plan-80", MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/playch10.cpp b/src/mame/drivers/playch10.cpp
index f0d17da7fda..023f963978a 100644
--- a/src/mame/drivers/playch10.cpp
+++ b/src/mame/drivers/playch10.cpp
@@ -388,7 +388,7 @@ static INPUT_PORTS_START( playch10 )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Channel Select") PORT_CODE(KEYCODE_0)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Enter") PORT_CODE(KEYCODE_MINUS)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Reset") PORT_CODE(KEYCODE_EQUALS)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, playch10_state,pc10_int_detect_r, nullptr) // INT Detect
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(playch10_state, int_detect_r) // INT Detect
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 )
diff --git a/src/mame/drivers/polepos.cpp b/src/mame/drivers/polepos.cpp
index d078d1ba5c1..df70e540201 100644
--- a/src/mame/drivers/polepos.cpp
+++ b/src/mame/drivers/polepos.cpp
@@ -314,7 +314,7 @@ template<bool sub1> WRITE16_MEMBER(polepos_state::z8002_nvi_enable_w)
(sub1 ? m_subcpu : m_subcpu2)->set_input_line(z8002_device::NVI_LINE, CLEAR_LINE);
}
-CUSTOM_INPUT_MEMBER(polepos_state::auto_start_r)
+READ_LINE_MEMBER(polepos_state::auto_start_r)
{
return m_auto_start_mask;
}
@@ -477,7 +477,7 @@ static INPUT_PORTS_START( polepos )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) POLEPOS_TOGGLE /* Gear */
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, polepos_state,auto_start_r, nullptr) // start 1, program controlled
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(polepos_state, auto_start_r) // start 1, program controlled
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
diff --git a/src/mame/drivers/policetr.cpp b/src/mame/drivers/policetr.cpp
index b10b9bd9310..7265232dd67 100644
--- a/src/mame/drivers/policetr.cpp
+++ b/src/mame/drivers/policetr.cpp
@@ -188,7 +188,7 @@ WRITE32_MEMBER(policetr_state::bsmt2000_data_w)
}
-CUSTOM_INPUT_MEMBER(policetr_state::bsmt_status_r)
+READ_LINE_MEMBER(policetr_state::bsmt_status_r)
{
return m_bsmt->read_status();
}
@@ -323,7 +323,7 @@ static INPUT_PORTS_START( policetr )
PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED ) /* /TILT (note 1) */
PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED ) /* /SERVICE (note 1) */
- PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, policetr_state, bsmt_status_r, nullptr)
+ PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(policetr_state, bsmt_status_r)
PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* /XSW2 (note 2) */
PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
diff --git a/src/mame/drivers/popeye.cpp b/src/mame/drivers/popeye.cpp
index 605239d8b43..b8b738fe623 100644
--- a/src/mame/drivers/popeye.cpp
+++ b/src/mame/drivers/popeye.cpp
@@ -362,7 +362,7 @@ protected:
};
-CUSTOM_INPUT_MEMBER(tnx1_state::dsw1_read)
+READ_LINE_MEMBER(tnx1_state::dsw1_read)
{
return ioport("DSW1")->read() >> m_dswbit;
}
@@ -418,7 +418,7 @@ static INPUT_PORTS_START( skyskipr )
PORT_DIPSETTING( 0x08, "A 1/6 B 1/1" )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tnx1_state, dsw1_read, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(tnx1_state, dsw1_read)
PORT_START("DSW1") /* DSW1 */
PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
@@ -444,7 +444,7 @@ static INPUT_PORTS_START( skyskipr )
PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) )
INPUT_PORTS_END
-CUSTOM_INPUT_MEMBER( tnx1_state::pop_field_r )
+READ_LINE_MEMBER( tnx1_state::pop_field_r )
{
return m_field ^ 1;
}
@@ -475,7 +475,7 @@ static INPUT_PORTS_START( popeye )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tnx1_state,pop_field_r, nullptr) /* inverted init e/o signal (even odd) */
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(tnx1_state, pop_field_r) // inverted init e/o signal (even odd)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
@@ -497,7 +497,7 @@ static INPUT_PORTS_START( popeye )
PORT_CONFSETTING( 0x20, "Nintendo Co.,Ltd" )
PORT_CONFSETTING( 0x60, "Nintendo of America" )
// PORT_CONFSETTING( 0x00, "Nintendo of America" )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tnx1_state, dsw1_read, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(tnx1_state, dsw1_read)
PORT_START("DSW1") /* DSW1 */
PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
diff --git a/src/mame/drivers/psikyo.cpp b/src/mame/drivers/psikyo.cpp
index 574b4aafe5a..8b00d79f581 100644
--- a/src/mame/drivers/psikyo.cpp
+++ b/src/mame/drivers/psikyo.cpp
@@ -81,7 +81,7 @@ This was pointed out by Bart Puype
Strikers 1945 / Tengai MCU
***************************************************************************/
-CUSTOM_INPUT_MEMBER(psikyo_state::mcu_status_r)
+READ_LINE_MEMBER(psikyo_state::mcu_status_r)
{
int ret = 0x00;
@@ -419,7 +419,7 @@ void psikyo_state::s1945_sound_io_map(address_map &map)
***************************************************************************/
-CUSTOM_INPUT_MEMBER(psikyo_state::z80_nmi_r)
+READ_LINE_MEMBER(psikyo_state::z80_nmi_r)
{
int ret = 0x00;
@@ -539,7 +539,7 @@ static INPUT_PORTS_START( samuraia )
PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW )
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_TILT )
- PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, psikyo_state,z80_nmi_r, nullptr) // From Sound CPU
+ PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, z80_nmi_r) // From Sound CPU
PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
PORT_MODIFY("DSW") /* c00004 -> c00007 */
@@ -615,7 +615,7 @@ static INPUT_PORTS_START( btlkroad )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
- PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, psikyo_state,z80_nmi_r, nullptr) // From Sound CPU
+ PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, z80_nmi_r) // From Sound CPU
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
@@ -719,7 +719,7 @@ static INPUT_PORTS_START( gunbird )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
- PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, psikyo_state,z80_nmi_r, nullptr) // From Sound CPU
+ PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, z80_nmi_r) // From Sound CPU
PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("DSW") /* c00004 -> c00007 */
@@ -780,12 +780,12 @@ static INPUT_PORTS_START( s1945 )
PORT_MODIFY("P1_P2") /* c00000 -> c00003 */
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, psikyo_state,mcu_status_r, nullptr)
+ PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, mcu_status_r)
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
- PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, psikyo_state,z80_nmi_r, nullptr) // From Sound CPU
+ PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, z80_nmi_r) // From Sound CPU
PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("DSW") /* c00004 -> c00007 */
@@ -904,12 +904,12 @@ static INPUT_PORTS_START( tengai )
PORT_MODIFY("P1_P2") /* c00000 -> c00003 */
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, psikyo_state,mcu_status_r, nullptr)
+ PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, mcu_status_r)
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
- PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, psikyo_state,z80_nmi_r, nullptr) // From Sound CPU
+ PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, z80_nmi_r) // From Sound CPU
PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("DSW") /* c00004 -> c00007 */
diff --git a/src/mame/drivers/psikyo4.cpp b/src/mame/drivers/psikyo4.cpp
index cf7f3388dbc..0d0c17455f7 100644
--- a/src/mame/drivers/psikyo4.cpp
+++ b/src/mame/drivers/psikyo4.cpp
@@ -166,15 +166,15 @@ INTERRUPT_GEN_MEMBER(psikyo4_state::interrupt)
device.execute().set_input_line(4, HOLD_LINE);
}
+template <int P>
CUSTOM_INPUT_MEMBER(psikyo4_state::mahjong_ctrl_r)/* used by hotgmck/hgkairak */
{
- int player = (uintptr_t)param;
int ret = 0xff;
- if (m_io_select & 1) ret &= m_keys[player+0]->read();
- if (m_io_select & 2) ret &= m_keys[player+1]->read();
- if (m_io_select & 4) ret &= m_keys[player+2]->read();
- if (m_io_select & 8) ret &= m_keys[player+3]->read();
+ if (m_io_select & 1) ret &= m_keys[P+0]->read();
+ if (m_io_select & 2) ret &= m_keys[P+1]->read();
+ if (m_io_select & 4) ret &= m_keys[P+2]->read();
+ if (m_io_select & 8) ret &= m_keys[P+3]->read();
return ret;
}
@@ -305,14 +305,14 @@ CUSTOM_INPUT_MEMBER(psikyo4_state::system_r)
static INPUT_PORTS_START( hotgmck )
PORT_START("P1_P2")
- PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM_MEMBER(DEVICE_SELF, psikyo4_state, system_r, nullptr)
+ PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM_MEMBER(psikyo4_state, system_r)
PORT_BIT( 0x00ffff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM_MEMBER(DEVICE_SELF, psikyo4_state, mahjong_ctrl_r, (void *)0)
+ PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM_MEMBER(psikyo4_state, mahjong_ctrl_r<0>)
PORT_START("P3_P4")
- PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM_MEMBER(DEVICE_SELF, psikyo4_state, system_r, nullptr)
+ PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM_MEMBER(psikyo4_state, system_r)
PORT_BIT( 0x00ffff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM_MEMBER(DEVICE_SELF, psikyo4_state, mahjong_ctrl_r, (void *)4)
+ PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM_MEMBER(psikyo4_state, mahjong_ctrl_r<4>)
PORT_START("JP4")/* jumper pads 'JP4' on the PCB */
/* EEPROM is read here */
diff --git a/src/mame/drivers/pzletime.cpp b/src/mame/drivers/pzletime.cpp
index afa04dcf963..520cdfed016 100644
--- a/src/mame/drivers/pzletime.cpp
+++ b/src/mame/drivers/pzletime.cpp
@@ -47,7 +47,7 @@ public:
void pzletime(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(ticket_status_r);
+ DECLARE_READ_LINE_MEMBER(ticket_status_r);
private:
/* memory pointers */
@@ -219,7 +219,7 @@ WRITE16_MEMBER(pzletime_state::oki_bank_w)
m_oki->set_rom_bank(data & 0x3);
}
-CUSTOM_INPUT_MEMBER(pzletime_state::ticket_status_r)
+READ_LINE_MEMBER(pzletime_state::ticket_status_r)
{
return (m_ticket && !(m_screen->frame_number() % 128));
}
@@ -251,7 +251,7 @@ static INPUT_PORTS_START( pzletime )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) /* eeprom */
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, pzletime_state,ticket_status_r, nullptr) /* ticket dispenser */
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(pzletime_state, ticket_status_r) /* ticket dispenser */
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("INPUT")
diff --git a/src/mame/drivers/qdrmfgp.cpp b/src/mame/drivers/qdrmfgp.cpp
index 86f36d4686a..2262e9e6b36 100644
--- a/src/mame/drivers/qdrmfgp.cpp
+++ b/src/mame/drivers/qdrmfgp.cpp
@@ -382,7 +382,7 @@ static INPUT_PORTS_START( qdrmfgp )
PORT_DIPSETTING( 0x0000, DEF_STR( Very_Hard ) )
PORT_START("SENSOR")
- PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, qdrmfgp_state,battery_sensor_r, nullptr) /* battery power sensor */
+ PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(qdrmfgp_state, battery_sensor_r) /* battery power sensor */
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE2 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE3 )
PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -462,7 +462,7 @@ static INPUT_PORTS_START( qdrmfgp2 )
PORT_DIPSETTING( 0x0000, DEF_STR( Very_Hard ) )
PORT_START("SENSOR")
- PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, qdrmfgp_state,battery_sensor_r, nullptr) /* battery power sensor */
+ PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(qdrmfgp_state, battery_sensor_r) /* battery power sensor */
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE2 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE3 )
PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/quantum.cpp b/src/mame/drivers/quantum.cpp
index 07d19297ae3..89d16712a6e 100644
--- a/src/mame/drivers/quantum.cpp
+++ b/src/mame/drivers/quantum.cpp
@@ -188,7 +188,7 @@ void quantum_state::main_map(address_map &map)
static INPUT_PORTS_START( quantum )
PORT_START("SYSTEM")
/* YHALT here MUST BE ALWAYS 0 */
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("avg", avg_quantum_device, done_r, nullptr) /* vg YHALT */
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_quantum_device, done_r) // vg YHALT
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
diff --git a/src/mame/drivers/quizshow.cpp b/src/mame/drivers/quizshow.cpp
index 2bc43a9b89a..ca56abe0d43 100644
--- a/src/mame/drivers/quizshow.cpp
+++ b/src/mame/drivers/quizshow.cpp
@@ -279,7 +279,7 @@ INPUT_CHANGED_MEMBER(quizshow_state::category_select)
static INPUT_PORTS_START( quizshow )
PORT_START("IN0") // ADR strobe 0
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, quizshow_state, tape_headpos_r, nullptr)
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(quizshow_state, tape_headpos_r)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
diff --git a/src/mame/drivers/r2dtank.cpp b/src/mame/drivers/r2dtank.cpp
index f97d9f48f16..f0804a1f499 100644
--- a/src/mame/drivers/r2dtank.cpp
+++ b/src/mame/drivers/r2dtank.cpp
@@ -76,7 +76,7 @@ public:
void r2dtank(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(get_ttl74123_output);
+ DECLARE_READ_LINE_MEMBER(ttl74123_output_r);
protected:
virtual void machine_start() override;
@@ -239,7 +239,7 @@ WRITE_LINE_MEMBER(r2dtank_state::ttl74123_output_changed)
}
-CUSTOM_INPUT_MEMBER(r2dtank_state::get_ttl74123_output)
+READ_LINE_MEMBER(r2dtank_state::ttl74123_output_r)
{
return m_ttl74123_output;
}
@@ -372,7 +372,7 @@ static INPUT_PORTS_START( r2dtank )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, r2dtank_state,get_ttl74123_output, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(r2dtank_state, ttl74123_output_r)
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
diff --git a/src/mame/drivers/renegade.cpp b/src/mame/drivers/renegade.cpp
index 5628839b5e9..c7fb5d19008 100644
--- a/src/mame/drivers/renegade.cpp
+++ b/src/mame/drivers/renegade.cpp
@@ -303,7 +303,7 @@ static INPUT_PORTS_START( renegade )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) /* attack right */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) /* attack right */
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, renegade_state, mcu_status_r, nullptr)
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(renegade_state, mcu_status_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
diff --git a/src/mame/drivers/rgum.cpp b/src/mame/drivers/rgum.cpp
index c8595ba1840..bdc3839667d 100644
--- a/src/mame/drivers/rgum.cpp
+++ b/src/mame/drivers/rgum.cpp
@@ -37,7 +37,7 @@ public:
void rgum(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(rgum_heartbeat_r);
+ DECLARE_READ_LINE_MEMBER(heartbeat_r);
private:
required_shared_ptr<uint8_t> m_vram;
@@ -100,7 +100,7 @@ void rgum_state::rgum_map(address_map &map)
}
-CUSTOM_INPUT_MEMBER(rgum_state::rgum_heartbeat_r)
+READ_LINE_MEMBER(rgum_state::heartbeat_r)
{
m_hbeat ^= 1;
@@ -125,7 +125,7 @@ static INPUT_PORTS_START( rgum )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, rgum_state,rgum_heartbeat_r, nullptr)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(rgum_state, heartbeat_r)
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
diff --git a/src/mame/drivers/rpunch.cpp b/src/mame/drivers/rpunch.cpp
index 2e2b36e2ac7..56d9e4a7faa 100644
--- a/src/mame/drivers/rpunch.cpp
+++ b/src/mame/drivers/rpunch.cpp
@@ -257,7 +257,7 @@ static INPUT_PORTS_START( rpunch )
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, rpunch_state,hi_bits_r, nullptr)
+ PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(rpunch_state, hi_bits_r)
PORT_START("P2") /* c001a lower 8 bits */
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
@@ -267,7 +267,7 @@ static INPUT_PORTS_START( rpunch )
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, rpunch_state,hi_bits_r, nullptr)
+ PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(rpunch_state, hi_bits_r)
PORT_START("SERVICE") /* c0018/c001a upper 8 bits */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 )
diff --git a/src/mame/drivers/scobra.cpp b/src/mame/drivers/scobra.cpp
index dae7d2aa1e5..558ac585863 100644
--- a/src/mame/drivers/scobra.cpp
+++ b/src/mame/drivers/scobra.cpp
@@ -69,7 +69,7 @@ public:
void hustlerb(machine_config &config);
void rescuefe(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(stratgyx_coinage_r);
+ template <int Mask> DECLARE_READ_LINE_MEMBER(stratgyx_coinage_r);
private:
DECLARE_READ8_MEMBER(scobra_soundram_r);
@@ -406,10 +406,10 @@ void scobra_state::hustlerb_sound_io_map(address_map &map)
/* stratgyx coinage DIPs are spread across two input ports */
-CUSTOM_INPUT_MEMBER(scobra_state::stratgyx_coinage_r)
+template <int Mask>
+READ_LINE_MEMBER(scobra_state::stratgyx_coinage_r)
{
- int bit_mask = (uintptr_t)param;
- return (ioport("IN4")->read() & bit_mask) ? 0x01 : 0x00;
+ return (ioport("IN4")->read() & Mask) ? 1 : 0;
}
@@ -439,8 +439,8 @@ static INPUT_PORTS_START( stratgyx )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scobra_state,stratgyx_coinage_r, (void *)0x01) /* lower 2 coinage DIPs */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scobra_state,stratgyx_coinage_r, (void *)0x02) /* lower 2 coinage DIPs */
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(scobra_state, stratgyx_coinage_r<0x01>) /* lower 2 coinage DIPs */
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(scobra_state, stratgyx_coinage_r<0x02>) /* lower 2 coinage DIPs */
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) )
@@ -450,8 +450,8 @@ static INPUT_PORTS_START( stratgyx )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
PORT_START("IN3")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scobra_state,stratgyx_coinage_r, (void *)0x04) /* upper 2 coinage DIPs */
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scobra_state,stratgyx_coinage_r, (void *)0x08) /* upper 2 coinage DIPs */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(scobra_state, stratgyx_coinage_r<0x04>) /* upper 2 coinage DIPs */
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(scobra_state, stratgyx_coinage_r<0x08>) /* upper 2 coinage DIPs */
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* none of these appear to be used */
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -510,7 +510,7 @@ static INPUT_PORTS_START( darkplnt )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x02, "5" )
- PORT_BIT( 0xfc, 0x00, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,scobra_state, darkplnt_custom_r, "DIAL") /* scrambled dial */
+ PORT_BIT( 0xfc, 0x00, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(scobra_state, darkplnt_dial_r) // scrambled dial
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/scramble.cpp b/src/mame/drivers/scramble.cpp
index 7ba5e5890bb..31aec21692a 100644
--- a/src/mame/drivers/scramble.cpp
+++ b/src/mame/drivers/scramble.cpp
@@ -555,10 +555,10 @@ static INPUT_PORTS_START( knockoutb )
INPUT_PORTS_END
/* ckongs coinage DIPs are spread across two input ports */
-CUSTOM_INPUT_MEMBER(scramble_state::ckongs_coinage_r)
+template <int Mask>
+READ_LINE_MEMBER(scramble_state::ckongs_coinage_r)
{
- int bit_mask = (uintptr_t)param;
- return (ioport("FAKE")->read() & bit_mask) ? 0x01 : 0x00;
+ return (ioport("FAKE")->read() & Mask) ? 1 : 0;
}
static INPUT_PORTS_START( ckongs )
@@ -573,8 +573,8 @@ static INPUT_PORTS_START( ckongs )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scramble_state,ckongs_coinage_r, (void *)0x01)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scramble_state,ckongs_coinage_r, (void *)0x02)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(scramble_state, ckongs_coinage_r<0x01>)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(scramble_state, ckongs_coinage_r<0x02>)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
@@ -590,7 +590,7 @@ static INPUT_PORTS_START( ckongs )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
PORT_DIPSETTING( 0x04, "3" )
PORT_DIPSETTING( 0x00, "4" )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scramble_state,ckongs_coinage_r, (void *)0x04)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(scramble_state, ckongs_coinage_r<0x04>)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
diff --git a/src/mame/drivers/scyclone.cpp b/src/mame/drivers/scyclone.cpp
index c85861d269f..66da380809a 100644
--- a/src/mame/drivers/scyclone.cpp
+++ b/src/mame/drivers/scyclone.cpp
@@ -67,7 +67,7 @@ public:
void scyclone(machine_config &config);
- CUSTOM_INPUT_MEMBER(collision_r);
+ DECLARE_READ_LINE_MEMBER(collision_r);
private:
DECLARE_WRITE8_MEMBER(vidctrl_w);
@@ -353,7 +353,7 @@ void scyclone_state::scyclone_sub_iomap(address_map &map)
// appears to be when a white bitmap pixel (col 0x7) collides with a large sprite?
// if you simply set it to 1 and shoot in the left corner, the game gets stuck
// but if you have it set to 0 there are no collisions with large objects
-CUSTOM_INPUT_MEMBER(scyclone_state::collision_r)
+READ_LINE_MEMBER(scyclone_state::collision_r)
{
return m_hascollided;
}
@@ -371,7 +371,7 @@ static INPUT_PORTS_START( scyclone )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scyclone_state, collision_r, nullptr) // hw collision?
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(scyclone_state, collision_r) // hw collision?
// maybe these 4 are the 4xdsw bank?
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
diff --git a/src/mame/drivers/seattle.cpp b/src/mame/drivers/seattle.cpp
index e51977934c4..3568c2307d0 100644
--- a/src/mame/drivers/seattle.cpp
+++ b/src/mame/drivers/seattle.cpp
@@ -1351,7 +1351,7 @@ static INPUT_PORTS_START( sfrush )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("Track 2") PORT_PLAYER(1) /* track 2 */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_NAME("Track 3") PORT_PLAYER(1) /* track 3 */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON16 ) PORT_NAME("Track 4") PORT_PLAYER(1) /* track 4 */
- PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, seattle_state, gearshift_r, "GEAR" )
+ PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(seattle_state, gearshift_r)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_VOLUME_UP )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_VOLUME_DOWN )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1436,7 +1436,7 @@ static INPUT_PORTS_START( calspeed )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("View 2") PORT_PLAYER(1) /* tailgate cam */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("View 3") PORT_PLAYER(1) /* sky cam */
PORT_BIT( 0x0f80, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, seattle_state, gearshift_r, "GEAR" )
+ PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(seattle_state, gearshift_r)
PORT_START("GEAR")
PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("1st Gear") PORT_PLAYER(1) /* 1st gear */
diff --git a/src/mame/drivers/segag80v.cpp b/src/mame/drivers/segag80v.cpp
index c8a7a7238cf..d7856420afe 100644
--- a/src/mame/drivers/segag80v.cpp
+++ b/src/mame/drivers/segag80v.cpp
@@ -302,7 +302,7 @@ READ8_MEMBER(segag80v_state::spinner_input_r)
*
*************************************/
-CUSTOM_INPUT_MEMBER(segag80v_state::elim4_joint_coin_r)
+READ_LINE_MEMBER(segag80v_state::elim4_joint_coin_r)
{
return (ioport("COINS")->read() & 0xf) != 0xf;
}
@@ -577,7 +577,7 @@ static INPUT_PORTS_START( elim4 )
PORT_INCLUDE( g80v_generic )
PORT_MODIFY("D7D6")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, segag80v_state,elim4_joint_coin_r, nullptr) /* combination of all four coin inputs */
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(segag80v_state, elim4_joint_coin_r) // combination of all four coin inputs
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
diff --git a/src/mame/drivers/segajw.cpp b/src/mame/drivers/segajw.cpp
index cb591b430d6..e25c8f8f578 100644
--- a/src/mame/drivers/segajw.cpp
+++ b/src/mame/drivers/segajw.cpp
@@ -57,7 +57,7 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(coin_drop_start);
DECLARE_CUSTOM_INPUT_MEMBER(coin_sensors_r);
- DECLARE_CUSTOM_INPUT_MEMBER(hopper_sensors_r);
+ DECLARE_READ_LINE_MEMBER(hopper_sensors_r);
private:
DECLARE_READ8_MEMBER(coin_counter_r);
@@ -131,7 +131,7 @@ INPUT_CHANGED_MEMBER( segajw_state::coin_drop_start )
m_coin_start_cycles = m_maincpu->total_cycles();
}
-CUSTOM_INPUT_MEMBER( segajw_state::hopper_sensors_r )
+READ_LINE_MEMBER( segajw_state::hopper_sensors_r )
{
uint8_t data = 0;
@@ -241,13 +241,13 @@ static INPUT_PORTS_START( segajw )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Last Game") PORT_CODE(KEYCODE_T)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("M-Door")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("D-Door")
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, segajw_state, hopper_sensors_r, nullptr)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(segajw_state, hopper_sensors_r)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Full")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Fill")
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN3")
- PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, segajw_state, coin_sensors_r, nullptr)
+ PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(segajw_state, coin_sensors_r)
PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("COIN1") // start the coin drop sequence (see coin_sensors_r)
diff --git a/src/mame/drivers/segaorun.cpp b/src/mame/drivers/segaorun.cpp
index eb29ae78174..b17c0975289 100644
--- a/src/mame/drivers/segaorun.cpp
+++ b/src/mame/drivers/segaorun.cpp
@@ -951,7 +951,7 @@ static INPUT_PORTS_START( outrun_generic )
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40)
PORT_START("ADC.3")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, segaorun_state, bankmotor_pos_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(segaorun_state, bankmotor_pos_r)
INPUT_PORTS_END
diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp
index 62fd4e40737..054de70b024 100644
--- a/src/mame/drivers/segas16a.cpp
+++ b/src/mame/drivers/segas16a.cpp
@@ -1242,7 +1242,7 @@ static INPUT_PORTS_START( afighter_analog )
PORT_INCLUDE( afighter )
PORT_MODIFY("P1")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, afighter_16a_analog_state, afighter_accel_r, nullptr)
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(afighter_16a_analog_state, afighter_accel_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) // SHOT
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) // WEAPON1
@@ -1250,10 +1250,10 @@ static INPUT_PORTS_START( afighter_analog )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) // WEAPON3
PORT_MODIFY("P2")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, afighter_16a_analog_state, afighter_handl_left_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(afighter_16a_analog_state, afighter_handl_left_r)
PORT_MODIFY("UNUSED")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, afighter_16a_analog_state, afighter_handl_right_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(afighter_16a_analog_state, afighter_handl_right_r)
PORT_START("STEER") // steering
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
diff --git a/src/mame/drivers/segas16b.cpp b/src/mame/drivers/segas16b.cpp
index 88ed5bcb083..0647db49802 100644
--- a/src/mame/drivers/segas16b.cpp
+++ b/src/mame/drivers/segas16b.cpp
@@ -2271,7 +2271,7 @@ static INPUT_PORTS_START( afighter_analog )
PORT_INCLUDE( afighter )
PORT_MODIFY("P1")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, afighter_16b_analog_state, afighter_accel_r, nullptr)
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(afighter_16b_analog_state, afighter_accel_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) // SHOT
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) // WEAPON1
@@ -2279,10 +2279,10 @@ static INPUT_PORTS_START( afighter_analog )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) // WEAPON3
PORT_MODIFY("P2")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, afighter_16b_analog_state, afighter_handl_left_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(afighter_16b_analog_state, afighter_handl_left_r)
PORT_MODIFY("UNUSED")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, afighter_16b_analog_state, afighter_handl_right_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(afighter_16b_analog_state, afighter_handl_right_r)
PORT_START("STEER") // steering
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
diff --git a/src/mame/drivers/seibuspi.cpp b/src/mame/drivers/seibuspi.cpp
index 1440f20634a..1e3e0d4bd74 100644
--- a/src/mame/drivers/seibuspi.cpp
+++ b/src/mame/drivers/seibuspi.cpp
@@ -1203,6 +1203,7 @@ WRITE_LINE_MEMBER(seibuspi_state::ymf_irqhandler)
m_audiocpu->set_input_line(0, CLEAR_LINE);
}
+template <int N>
CUSTOM_INPUT_MEMBER(seibuspi_state::ejanhs_encode)
{
/* E-Jan Highschool has a keyboard with the following keys
@@ -1229,7 +1230,7 @@ CUSTOM_INPUT_MEMBER(seibuspi_state::ejanhs_encode)
Start - 111 port A
*/
static const u8 encoding[] = { 6, 5, 4, 3, 2, 7 };
- ioport_value state = ~m_key[(uintptr_t)param]->read();
+ ioport_value state = ~m_key[N]->read();
for (int bit = 0; bit < ARRAY_LENGTH(encoding); bit++)
if (state & (1 << bit))
@@ -1380,16 +1381,16 @@ static INPUT_PORTS_START( spi_ejanhs )
PORT_INCLUDE( spi_mahjong_keyboard )
PORT_START("INPUTS")
- PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)3)
- PORT_BIT( 0x00000038, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)4)
- PORT_BIT( 0x00000700, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)2)
- PORT_BIT( 0x00003800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)0)
+ PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(seibuspi_state, ejanhs_encode<3>)
+ PORT_BIT( 0x00000038, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(seibuspi_state, ejanhs_encode<4>)
+ PORT_BIT( 0x00000700, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(seibuspi_state, ejanhs_encode<2>)
+ PORT_BIT( 0x00003800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(seibuspi_state, ejanhs_encode<0>)
PORT_SPECIAL_ONOFF_DIPLOC( 0x00008000, 0x00000000, Flip_Screen, "SW1:1" )
PORT_BIT( 0xffff4000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SYSTEM")
// These need a noncontiguous encoding, but are nonfunctional in any case
- //PORT_BIT( 0x00000013, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)1)
+ //PORT_BIT( 0x00000013, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(seibuspi_state, ejanhs_encode<1>)
PORT_SERVICE_NO_TOGGLE( 0x00000004, IP_ACTIVE_LOW )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x000000f3, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp
index 1cc31cfafd6..a2292c8729f 100644
--- a/src/mame/drivers/seta.cpp
+++ b/src/mame/drivers/seta.cpp
@@ -4471,7 +4471,7 @@ static INPUT_PORTS_START( setaroul )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Attendant Pay") // att.pay (clears error)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Note") // note (same as 100 coins)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Coupon") // cupon (same as 10 coins)
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, setaroul_state, coin_sensors_r, nullptr)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(setaroul_state, coin_sensors_r)
PORT_START("COIN1") // start the coin drop sequence (see coin_sensors_r)
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, setaroul_state, coin_drop_start, 0)
@@ -6567,10 +6567,10 @@ INPUT_PORTS_END
static INPUT_PORTS_START( usclssic )
PORT_START("TRACKX")
- PORT_BIT( 0xfff, 0x000, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, usclssic_state, trackball_x_r, nullptr)
+ PORT_BIT( 0xfff, 0x000, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(usclssic_state, trackball_x_r)
PORT_START("TRACKY")
- PORT_BIT( 0xfff, 0x000, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, usclssic_state, trackball_y_r, nullptr)
+ PORT_BIT( 0xfff, 0x000, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(usclssic_state, trackball_y_r)
PORT_START("TRACK1_X") /* muxed port 0 */
PORT_BIT( 0xfff, 0x000, IPT_TRACKBALL_X ) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_RESET
diff --git a/src/mame/drivers/sk1.cpp b/src/mame/drivers/sk1.cpp
index f0635c4f80f..e71c36b3c07 100644
--- a/src/mame/drivers/sk1.cpp
+++ b/src/mame/drivers/sk1.cpp
@@ -173,14 +173,14 @@ INPUT_PORTS_START(sk1)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("G5#")
PORT_START("KO8")
- PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, sk1_state, mode_in, nullptr)
+ PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(sk1_state, mode_in)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("A5")
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("A5#")
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("B5")
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("C6")
PORT_START("KO9")
- PORT_BIT(0x83, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, sk1_state, function_in, nullptr)
+ PORT_BIT(0x83, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(sk1_state, function_in)
PORT_BIT(0x7c, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("TOGGLES")
diff --git a/src/mame/drivers/snk.cpp b/src/mame/drivers/snk.cpp
index 85309fbb9fd..8d4eae7df09 100644
--- a/src/mame/drivers/snk.cpp
+++ b/src/mame/drivers/snk.cpp
@@ -327,11 +327,6 @@ enum
/*********************************************************************/
-CUSTOM_INPUT_MEMBER(snk_state::marvins_sound_busy)
-{
- return m_soundlatch->pending_r() ? 1 : 0;
-}
-
READ8_MEMBER(snk_state::marvins_sound_nmi_ack_r)
{
m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
@@ -465,7 +460,7 @@ WRITE8_MEMBER(snk_state::snk_soundlatch_w)
machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), CMDIRQ_BUSY_ASSERT);
}
-CUSTOM_INPUT_MEMBER(snk_state::snk_sound_busy)
+READ_LINE_MEMBER(snk_state::sound_busy_r)
{
return (m_sound_status & 4) ? 1 : 0;
}
@@ -700,27 +695,28 @@ hand, always returning 0xf inbetween valid values confuses the game.
*****************************************************************************/
+template <int Which>
CUSTOM_INPUT_MEMBER(snk_state::gwar_rotary)
{
- int which = (int)(uintptr_t)param;
- int value = m_rot_io[which]->read();
+ int value = m_rot_io[Which]->read();
- if ((m_last_value[which] == 0x5 && value == 0x6) || (m_last_value[which] == 0x6 && value == 0x5))
+ if ((m_last_value[Which] == 0x5 && value == 0x6) || (m_last_value[Which] == 0x6 && value == 0x5))
{
- if (!m_cp_count[which])
+ if (!m_cp_count[Which])
value = 0xf;
- m_cp_count[which] = (m_cp_count[which] + 1) & 0x07;
+ m_cp_count[Which] = (m_cp_count[Which] + 1) & 0x07;
}
- m_last_value[which] = value;
+ m_last_value[Which] = value;
return value;
}
+template <int Which>
CUSTOM_INPUT_MEMBER(snk_state::gwarb_rotary)
{
if (m_joymode_io->read() == 1)
{
- return gwar_rotary(field, param);
+ return gwar_rotary<Which>();
}
else
{
@@ -776,24 +772,23 @@ CUSTOM_INPUT_MEMBER(snk_state::countryc_trackball_y)
/************************************************************************/
+template <int Mask>
CUSTOM_INPUT_MEMBER(snk_state::snk_bonus_r)
{
- int bit_mask = (uintptr_t)param;
-
- switch (bit_mask)
+ switch (Mask)
{
case 0x01: /* older games : "Occurrence" Dip Switch (DSW2:1) */
- return ((m_bonus_io->read() & bit_mask) >> 0);
+ return ((m_bonus_io->read() & Mask) >> 0);
case 0xc0: /* older games : "Bonus Life" Dip Switches (DSW1:7,8) */
- return ((m_bonus_io->read() & bit_mask) >> 6);
+ return ((m_bonus_io->read() & Mask) >> 6);
case 0x04: /* later games : "Occurrence" Dip Switch (DSW1:3) */
- return ((m_bonus_io->read() & bit_mask) >> 2);
+ return ((m_bonus_io->read() & Mask) >> 2);
case 0x30: /* later games : "Bonus Life" Dip Switches (DSW2:5,6) */
- return ((m_bonus_io->read() & bit_mask) >> 4);
+ return ((m_bonus_io->read() & Mask) >> 4);
default:
- logerror("snk_bonus_r : invalid %02X bit_mask\n",bit_mask);
+ logerror("snk_bonus_r : invalid %02X bit_mask\n",Mask);
return 0;
}
}
@@ -1518,7 +1513,7 @@ static INPUT_PORTS_START( marvins )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,marvins_sound_busy, nullptr) /* sound CPU status */
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // sound CPU status
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // service switch according to schematics, see code at 0x0453. Goes to garbage.
PORT_START("IN1")
@@ -1600,7 +1595,7 @@ static INPUT_PORTS_START( vangrd2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,marvins_sound_busy, nullptr) /* sound CPU status */
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // sound CPU status
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1684,8 +1679,8 @@ static INPUT_PORTS_START( madcrash )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,marvins_sound_busy, nullptr) /* sound CPU status */
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,marvins_sound_busy, nullptr) /* sound CPU status */
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // sound CPU status
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // sound CPU status
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE )
PORT_START("IN1")
@@ -1762,7 +1757,7 @@ static INPUT_PORTS_START( jcross )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1805,10 +1800,10 @@ static INPUT_PORTS_START( jcross )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
// PORT_DIPSETTING( 0x10, "INVALID !" ) /* settings table at 0x0378 is only 5 bytes wide */
// PORT_DIPSETTING( 0x08, "INVALID !" ) /* settings table at 0x0378 is only 5 bytes wide */
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0xc0)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0xc0>)
PORT_START("DSW2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x01>)
PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:2,3")
PORT_DIPSETTING( 0x06, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x04, DEF_STR( Normal ) )
@@ -1847,7 +1842,7 @@ static INPUT_PORTS_START( sgladiat )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) /* code at 0x054e */
@@ -1888,10 +1883,10 @@ static INPUT_PORTS_START( sgladiat )
PORT_DIPSETTING( 0x30, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x28, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0xc0)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0xc0>)
PORT_START("DSW2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x01>)
PORT_DIPNAME( 0x02, 0x02, "Time" ) PORT_DIPLOCATION("DSW2:2")
PORT_DIPSETTING( 0x02, "More" ) /* Hazard race 2:30 / Chariot race 3:30 */
PORT_DIPSETTING( 0x00, "Less" ) /* Hazard race 2:00 / Chariot race 3:00 */
@@ -1931,7 +1926,7 @@ static INPUT_PORTS_START( hal21 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1972,10 +1967,10 @@ static INPUT_PORTS_START( hal21 )
PORT_DIPSETTING( 0x30, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x28, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0xc0)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0xc0>)
PORT_START("DSW2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x01>)
PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:2,3")
PORT_DIPSETTING( 0x06, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x04, DEF_STR( Normal ) )
@@ -2014,7 +2009,7 @@ static INPUT_PORTS_START( aso )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coinage" settings - code at 0x2e04 */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2057,10 +2052,10 @@ static INPUT_PORTS_START( aso )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) )
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0xc0)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0xc0>)
PORT_START("DSW2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x01>)
PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:2,3")
PORT_DIPSETTING( 0x06, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x04, DEF_STR( Normal ) )
@@ -2100,7 +2095,7 @@ static INPUT_PORTS_START( alphamis )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x2e17 */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2147,7 +2142,7 @@ static INPUT_PORTS_START( alphamis )
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "DSW1:8" )
PORT_START("DSW2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x01>)
PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:2,3")
PORT_DIPSETTING( 0x06, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x04, DEF_STR( Normal ) )
@@ -2182,7 +2177,7 @@ static INPUT_PORTS_START( tnk3 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2228,10 +2223,10 @@ static INPUT_PORTS_START( tnk3 )
PORT_DIPSETTING( 0x30, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x28, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0xc0)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0xc0>)
PORT_START("DSW2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x01>)
PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:2,3")
PORT_DIPSETTING( 0x06, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x04, DEF_STR( Normal ) )
@@ -2265,7 +2260,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( athena )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x09d4 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2302,7 +2297,7 @@ static INPUT_PORTS_START( athena )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:2")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) /* Single Controls */
PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x04)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x04>)
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
PORT_DIPSETTING( 0x08, "3" )
PORT_DIPSETTING( 0x00, "5" )
@@ -2329,7 +2324,7 @@ static INPUT_PORTS_START( athena )
PORT_DIPNAME( 0x08, 0x08, "Freeze" ) PORT_DIPLOCATION("DSW2:4")
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x30)
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x30>)
PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "DSW2:7" )
PORT_DIPNAME( 0x80, 0x80, "Energy" ) PORT_DIPLOCATION("DSW2:8")
PORT_DIPSETTING( 0x80, "12" )
@@ -2350,7 +2345,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( fitegolf )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x045b */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) /* same as the dip switch */
@@ -2446,7 +2441,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( countryc )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x0450 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) /* same as the dip switch */
@@ -2456,10 +2451,10 @@ static INPUT_PORTS_START( countryc )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
PORT_START("IN1")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,countryc_trackball_x, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, countryc_trackball_x)
PORT_START("IN2")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,countryc_trackball_y, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, countryc_trackball_y)
PORT_START("IN3")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2528,7 +2523,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( ikari )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x0a15 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2568,7 +2563,7 @@ static INPUT_PORTS_START( ikari )
PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" ) PORT_DIPLOCATION("DSW1:2")
PORT_DIPSETTING( 0x02, "Separate" )
PORT_DIPSETTING( 0x00, "Common" )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x04)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x04>)
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
PORT_DIPSETTING( 0x08, "3" )
PORT_DIPSETTING( 0x00, "5" )
@@ -2594,7 +2589,7 @@ static INPUT_PORTS_START( ikari )
PORT_DIPSETTING( 0x08, "Demo Sounds On" )
PORT_DIPSETTING( 0x04, "Freeze" )
PORT_DIPSETTING( 0x00, "Infinite Lives (Cheat)")
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x30)
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x30>)
PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "DSW2:7" ) /* read at 0x07c4, but strange test at 0x07cc */
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW2:8")
PORT_DIPSETTING( 0x80, DEF_STR( No ) )
@@ -2623,7 +2618,7 @@ static INPUT_PORTS_START( ikaria )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x0a00 */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT ) /* reset */
INPUT_PORTS_END
@@ -2665,7 +2660,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( victroad )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x0a19 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2705,7 +2700,7 @@ static INPUT_PORTS_START( victroad )
PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" ) PORT_DIPLOCATION("DSW1:2")
PORT_DIPSETTING( 0x02, "Separate" )
PORT_DIPSETTING( 0x00, "Common" )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x04)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x04>)
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
PORT_DIPSETTING( 0x08, "3" )
PORT_DIPSETTING( 0x00, "5" )
@@ -2731,7 +2726,7 @@ static INPUT_PORTS_START( victroad )
PORT_DIPSETTING( 0x08, "Demo Sounds On" )
PORT_DIPSETTING( 0x00, "Freeze" )
PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)")
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x30)
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x30>)
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW2:7")
PORT_DIPSETTING( 0x40, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
@@ -2769,7 +2764,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( bermudat )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x0a0a */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2807,7 +2802,7 @@ static INPUT_PORTS_START( bermudat )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW1:2")
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x04)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x04>)
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
PORT_DIPSETTING( 0x08, "3" )
PORT_DIPSETTING( 0x00, "5" )
@@ -2833,7 +2828,7 @@ static INPUT_PORTS_START( bermudat )
PORT_DIPSETTING( 0x08, "Demo Sounds On" )
PORT_DIPSETTING( 0x00, "Freeze" )
PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)")
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x30)
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state,snk_bonus_r<0x30>)
PORT_DIPNAME( 0xc0, 0x80, "Game Style" ) PORT_DIPLOCATION("DSW2:7,8")
PORT_DIPSETTING( 0xc0, "Normal without continue" )
PORT_DIPSETTING( 0x80, "Normal with continue" )
@@ -2898,7 +2893,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( psychos )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2935,7 +2930,7 @@ static INPUT_PORTS_START( psychos )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW1:2")
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x04)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x04>)
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
PORT_DIPSETTING( 0x08, "3" )
PORT_DIPSETTING( 0x00, "5" )
@@ -2962,7 +2957,7 @@ static INPUT_PORTS_START( psychos )
PORT_DIPNAME( 0x08, 0x08, "Freeze" ) PORT_DIPLOCATION("DSW2:4")
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x30)
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x30>)
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW2:7")
PORT_DIPSETTING( 0x40, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
@@ -2983,7 +2978,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( gwar )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x08c8 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE )
@@ -2997,7 +2992,7 @@ static INPUT_PORTS_START( gwar )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,gwar_rotary, (void*)0)
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, gwar_rotary<0>)
PORT_START("P1ROT")
PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
@@ -3007,7 +3002,7 @@ static INPUT_PORTS_START( gwar )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,gwar_rotary, (void*)1)
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, gwar_rotary<1>)
PORT_START("P2ROT")
PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
@@ -3029,7 +3024,7 @@ static INPUT_PORTS_START( gwar )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW1:2")
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x04)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x04>)
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
PORT_DIPSETTING( 0x08, "3" )
PORT_DIPSETTING( 0x00, "5" )
@@ -3055,7 +3050,7 @@ static INPUT_PORTS_START( gwar )
PORT_DIPSETTING( 0x08, "Demo Sounds On" )
PORT_DIPSETTING( 0x00, "Freeze" )
PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)")
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x30)
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x30>)
PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "DSW2:7" )
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "DSW2:8" )
@@ -3078,10 +3073,10 @@ static INPUT_PORTS_START( gwarb )
// connected. If rotary is not connected, player fires in the direction he's facing.
PORT_MODIFY("IN1")
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,gwarb_rotary, (void*)0)
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, gwarb_rotary<0>)
PORT_MODIFY("IN2")
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,gwarb_rotary, (void*)1)
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, gwarb_rotary<1>)
PORT_START("JOYSTICK_MODE")
PORT_CONFNAME( 0x01, 0x00, "Joystick mode" )
@@ -3092,7 +3087,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( chopper )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x0849 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE )
@@ -3131,7 +3126,7 @@ static INPUT_PORTS_START( chopper )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:2")
PORT_DIPSETTING( 0x02, DEF_STR( Upright ) ) /* Single Controls */
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x04)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x04>)
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
PORT_DIPSETTING( 0x08, "3" )
PORT_DIPSETTING( 0x00, "5" )
@@ -3157,7 +3152,7 @@ static INPUT_PORTS_START( chopper )
PORT_DIPSETTING( 0x0c, "Demo Sounds On" )
PORT_DIPSETTING( 0x00, "Freeze" )
PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)")
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_bonus_r, (void *)0x30)
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk_state, snk_bonus_r<0x30>)
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW2:7")
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x40, DEF_STR( Yes ) )
@@ -3213,7 +3208,7 @@ static INPUT_PORTS_START( tdfever )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) /* also reset - code at 0x074a */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x1065 */
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A")
@@ -3355,7 +3350,7 @@ static INPUT_PORTS_START( fsoccer )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) /* same as the dip switch / also reset - code at 0x00cc */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x677f */
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk_state,snk_sound_busy, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(snk_state, sound_busy_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A")
diff --git a/src/mame/drivers/snk6502.cpp b/src/mame/drivers/snk6502.cpp
index d6952f936e0..94b5ed0b14f 100644
--- a/src/mame/drivers/snk6502.cpp
+++ b/src/mame/drivers/snk6502.cpp
@@ -529,12 +529,12 @@ static INPUT_PORTS_START( satansat )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x7c, IP_ACTIVE_HIGH, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("snk6502:custom", snk6502_sound_device,music0_playing, nullptr) /* music0 playing */
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("snk6502:custom", snk6502_sound_device, music0_playing) // music0 playing
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, snk6502_state,coin_inserted, 0)
PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* NC */
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, snk6502_state,sasuke_count_r, nullptr) /* connected to a binary counter */
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(snk6502_state, sasuke_count_r) // connected to a binary counter
PORT_START("DSW")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:!1")
@@ -594,7 +594,7 @@ static INPUT_PORTS_START( vanguard )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL /* fire left */
PORT_MODIFY("IN2")
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("snk6502:custom", snk6502_sound_device,music0_playing, nullptr) /* music0 playing */
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("snk6502:custom", snk6502_sound_device, music0_playing) // music0 playing
INPUT_PORTS_END
static INPUT_PORTS_START( fantasy )
diff --git a/src/mame/drivers/spdodgeb.cpp b/src/mame/drivers/spdodgeb.cpp
index 631fba29c21..75296735a6b 100644
--- a/src/mame/drivers/spdodgeb.cpp
+++ b/src/mame/drivers/spdodgeb.cpp
@@ -264,7 +264,7 @@ void spdodgeb_state::spdodgeb_sound_map(address_map &map)
}
-CUSTOM_INPUT_MEMBER(spdodgeb_state::mcu63705_busy_r)
+READ_LINE_MEMBER(spdodgeb_state::mcu63705_busy_r)
{
m_toggle ^= 0x01;
return m_toggle;
@@ -273,7 +273,7 @@ CUSTOM_INPUT_MEMBER(spdodgeb_state::mcu63705_busy_r)
static INPUT_PORTS_START( spdodgeb )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, spdodgeb_state, mcu63705_busy_r, nullptr) /* mcu63701_busy flag */
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(spdodgeb_state, mcu63705_busy_r) // mcu63701_busy flag
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
diff --git a/src/mame/drivers/spg110.cpp b/src/mame/drivers/spg110.cpp
index 263e67a5e0b..aa37aaf5bb0 100644
--- a/src/mame/drivers/spg110.cpp
+++ b/src/mame/drivers/spg110.cpp
@@ -196,7 +196,7 @@ static INPUT_PORTS_START( jak_capb )
PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("JOYY")
- PORT_BIT( 0x03ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, spg110_game_state, plunger_r, nullptr)
+ PORT_BIT( 0x03ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(spg110_game_state, plunger_r)
PORT_START("JOYY_REAL")
PORT_BIT(0x00ff, 0x0000, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x00ff) PORT_NAME("Plunger") PORT_CENTERDELTA(255)
diff --git a/src/mame/drivers/spoker.cpp b/src/mame/drivers/spoker.cpp
index e1123669dd5..f36d23a3a62 100644
--- a/src/mame/drivers/spoker.cpp
+++ b/src/mame/drivers/spoker.cpp
@@ -62,7 +62,7 @@ public:
void init_spk116it();
void init_3super8();
- DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
+ DECLARE_READ_LINE_MEMBER(hopper_r);
protected:
virtual void machine_start() override;
@@ -169,7 +169,7 @@ uint32_t spoker_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
Misc Handlers
***************************************************************************/
-CUSTOM_INPUT_MEMBER(spoker_state::hopper_r)
+READ_LINE_MEMBER(spoker_state::hopper_r)
{
if (m_hopper) return !(m_screen->frame_number()%10);
return machine().input().code_pressed(KEYCODE_H);
@@ -409,7 +409,7 @@ static INPUT_PORTS_START( spoker )
PORT_START("SERVICE")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Memory Clear") // stats, memory
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,spoker_state,hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(spoker_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
@@ -478,7 +478,7 @@ static INPUT_PORTS_START( 3super8 )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF,spoker_state,hopper_r, nullptr) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(spoker_state, hopper_r) PORT_NAME("HPSW") // hopper sensor
PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
diff --git a/src/mame/drivers/sprint4.cpp b/src/mame/drivers/sprint4.cpp
index ae2f80258ff..21a43489004 100644
--- a/src/mame/drivers/sprint4.cpp
+++ b/src/mame/drivers/sprint4.cpp
@@ -22,27 +22,24 @@ Atari Sprint 4 driver
#define PIXEL_CLOCK (MASTER_CLOCK / 2)
-CUSTOM_INPUT_MEMBER(sprint4_state::get_lever)
+template <int N>
+READ_LINE_MEMBER(sprint4_state::lever_r)
{
- int n = (uintptr_t) param;
-
- return 4 * m_gear[n] > m_da_latch;
+ return 4 * m_gear[N] > m_da_latch;
}
-CUSTOM_INPUT_MEMBER(sprint4_state::get_wheel)
+template <int N>
+READ_LINE_MEMBER(sprint4_state::wheel_r)
{
- int n = (uintptr_t) param;
-
- return 8 * m_steer_FF1[n] + 8 * m_steer_FF2[n] > m_da_latch;
+ return 8 * m_steer_FF1[N] + 8 * m_steer_FF2[N] > m_da_latch;
}
-CUSTOM_INPUT_MEMBER(sprint4_state::get_collision)
+template <int N>
+READ_LINE_MEMBER(sprint4_state::collision_flipflop_r)
{
- int n = (uintptr_t) param;
-
- return m_collision[n];
+ return m_collision[N];
}
@@ -257,13 +254,13 @@ static INPUT_PORTS_START( sprint4 )
PORT_START("COLLISION")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Player 1 Gas") PORT_PLAYER(1)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_collision, (void *)0 )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, collision_flipflop_r<0>)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Player 2 Gas") PORT_PLAYER(2)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_collision, (void *)1 )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, collision_flipflop_r<1>)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Player 3 Gas") PORT_PLAYER(3)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_collision, (void *)2 )
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, collision_flipflop_r<2>)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Player 4 Gas") PORT_PLAYER(4)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_collision, (void *)3 )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, collision_flipflop_r<3>)
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
@@ -294,14 +291,14 @@ static INPUT_PORTS_START( sprint4 )
PORT_DIPSETTING( 0xe0, "150 seconds" )
PORT_START("ANALOG")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_wheel, (void *)0)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_lever, (void *)0)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_wheel, (void *)1)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_lever, (void *)1)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_wheel, (void *)2)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_lever, (void *)2)
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_wheel, (void *)3)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sprint4_state, get_lever, (void *)3)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, wheel_r<0>)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, lever_r<0>)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, wheel_r<1>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, lever_r<1>)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, wheel_r<2>)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, lever_r<2>)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, wheel_r<3>)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(sprint4_state, lever_r<3>)
PORT_START("WHEEL1")
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(16) PORT_PLAYER(1)
diff --git a/src/mame/drivers/ssingles.cpp b/src/mame/drivers/ssingles.cpp
index c95a32a9c47..31d7041713b 100644
--- a/src/mame/drivers/ssingles.cpp
+++ b/src/mame/drivers/ssingles.cpp
@@ -433,7 +433,7 @@ static INPUT_PORTS_START( ssingles )
PORT_START("INPUTS")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) //must be LOW
- PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ssingles_state,controls_r, nullptr)
+ PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(ssingles_state, controls_r)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON4 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 )
diff --git a/src/mame/drivers/stactics.cpp b/src/mame/drivers/stactics.cpp
index 9221c11257c..95d09b4e60a 100644
--- a/src/mame/drivers/stactics.cpp
+++ b/src/mame/drivers/stactics.cpp
@@ -62,7 +62,7 @@ WRITE_LINE_MEMBER(stactics_state::motor_w)
}
-CUSTOM_INPUT_MEMBER(stactics_state::get_motor_not_ready)
+READ_LINE_MEMBER(stactics_state::motor_not_ready_r)
{
// if the motor is self-centering, but not centered yet
return (!m_motor_on && (m_horiz_pos != 0 || m_vert_pos != 0));
@@ -222,7 +222,7 @@ static INPUT_PORTS_START( stactics )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_motor_not_ready, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(stactics_state, motor_not_ready_r)
PORT_START("IN1") /* IN1 */
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) )
@@ -251,8 +251,8 @@ static INPUT_PORTS_START( stactics )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN2") /* IN2 */
- PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_rng, nullptr)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_frame_count_d3, nullptr)
+ PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(stactics_state, get_rng)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(stactics_state, frame_count_d3_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
@@ -262,7 +262,7 @@ static INPUT_PORTS_START( stactics )
PORT_START("IN3") /* IN3 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_shot_standby, nullptr)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(stactics_state, shot_standby_r)
PORT_DIPNAME( 0x04, 0x04, "Number of Barriers" )
PORT_DIPSETTING( 0x04, "4" )
PORT_DIPSETTING( 0x00, "6" )
@@ -274,7 +274,7 @@ static INPUT_PORTS_START( stactics )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_not_shot_arrive, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(stactics_state, not_shot_arrive_r)
PORT_START("FAKE") /* FAKE */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
diff --git a/src/mame/drivers/starshp1.cpp b/src/mame/drivers/starshp1.cpp
index 9ab274acc87..64bee936a86 100644
--- a/src/mame/drivers/starshp1.cpp
+++ b/src/mame/drivers/starshp1.cpp
@@ -201,12 +201,12 @@ static INPUT_PORTS_START( starshp1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_START("VBLANK")
- PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, starshp1_state,starshp1_analog_r, nullptr) /* analog in */
+ PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(starshp1_state, starshp1_analog_r) // analog in
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("COINAGE")
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, starshp1_state,collision_latch_r, nullptr) /* collision latch */
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(starshp1_state, collision_latch_r) // collision latch
PORT_DIPNAME( 0x70, 0x20, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 1C_1C ) )
diff --git a/src/mame/drivers/starwars.cpp b/src/mame/drivers/starwars.cpp
index d1db1db6f2d..54cd8cb277c 100644
--- a/src/mame/drivers/starwars.cpp
+++ b/src/mame/drivers/starwars.cpp
@@ -213,9 +213,9 @@ static INPUT_PORTS_START( starwars )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
/* Bit 6 is VG_HALT */
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("avg", avg_starwars_device, done_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_starwars_device, done_r)
/* Bit 7 is MATH_RUN - see machine/starwars.c */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, starwars_state,matrix_flag_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(starwars_state, matrix_flag_r)
PORT_START("DSW0")
PORT_DIPNAME( 0x03, 0x02, "Starting Shields" ) PORT_DIPLOCATION("10D:1,2")
diff --git a/src/mame/drivers/statriv2.cpp b/src/mame/drivers/statriv2.cpp
index 924a4d88e82..bf6c4c836cb 100644
--- a/src/mame/drivers/statriv2.cpp
+++ b/src/mame/drivers/statriv2.cpp
@@ -107,7 +107,7 @@ public:
void init_addr_xhl();
void init_laserdisc();
- DECLARE_CUSTOM_INPUT_MEMBER(latched_coin_r);
+ DECLARE_READ_LINE_MEMBER(latched_coin_r);
private:
required_device<cpu_device> m_maincpu;
@@ -291,7 +291,7 @@ READ8_MEMBER(statriv2_state::question_data_r)
*
*************************************/
-CUSTOM_INPUT_MEMBER(statriv2_state::latched_coin_r)
+READ_LINE_MEMBER(statriv2_state::latched_coin_r)
{
return m_latched_coin;
}
@@ -354,7 +354,7 @@ static INPUT_PORTS_START( statusbj )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, statriv2_state, latched_coin_r, "COIN")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(statriv2_state, latched_coin_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
@@ -387,7 +387,7 @@ static INPUT_PORTS_START( funcsino )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stand") PORT_CODE(KEYCODE_4)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Select Game") PORT_CODE(KEYCODE_S)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, statriv2_state, latched_coin_r, "COIN")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(statriv2_state, latched_coin_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x10, 0x10, "DIP switch? 10" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
@@ -423,7 +423,7 @@ static INPUT_PORTS_START( tripdraw )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stand") PORT_CODE(KEYCODE_4)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, statriv2_state, latched_coin_r, "COIN")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(statriv2_state, latched_coin_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x10, 0x10, "DIP switch? 10" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
@@ -459,7 +459,7 @@ static INPUT_PORTS_START( bigcsino ) // flyer shows 8 buttons on the cabinet
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, statriv2_state, latched_coin_r, "COIN")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(statriv2_state, latched_coin_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x10, 0x10, "DIP switch? 10" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
@@ -534,7 +534,7 @@ static INPUT_PORTS_START( statriv2 )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Play 1000")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, statriv2_state, latched_coin_r, "COIN")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(statriv2_state, latched_coin_r)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x10, IP_ACTIVE_HIGH )
PORT_DIPNAME( 0x20, 0x20, "Show Correct Answer" )
diff --git a/src/mame/drivers/superqix.cpp b/src/mame/drivers/superqix.cpp
index e94562ea990..682cdebc09b 100644
--- a/src/mame/drivers/superqix.cpp
+++ b/src/mame/drivers/superqix.cpp
@@ -226,12 +226,12 @@ The MCU acts this way:
**************************************************************************/
-CUSTOM_INPUT_MEMBER(superqix_state::fromz80_semaphore_input_r)
+READ_LINE_MEMBER(superqix_state::fromz80_semaphore_input_r)
{
return (m_z80_has_written ? 1 : 0);
}
-CUSTOM_INPUT_MEMBER(superqix_state::frommcu_semaphore_input_r)
+READ_LINE_MEMBER(superqix_state::frommcu_semaphore_input_r)
{
return (m_mcu_has_written ? 1 : 0);
}
@@ -1093,7 +1093,7 @@ static INPUT_PORTS_START( pbillian )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL // P2 fire (M powerup) + high score initials
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, hotsmash_state, pbillian_semaphore_input_r, nullptr) /* Z80 and MCU Semaphores */
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(hotsmash_state, pbillian_semaphore_input_r) // Z80 and MCU Semaphores
PORT_START("PLUNGER1")
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
@@ -1183,7 +1183,7 @@ static INPUT_PORTS_START( hotsmash )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL // p2 button 2, unused on this game?
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, hotsmash_state, pbillian_semaphore_input_r, nullptr) /* Z80 and MCU Semaphores */
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(hotsmash_state, pbillian_semaphore_input_r) // Z80 and MCU Semaphores
PORT_START("PLUNGER1") // plunger isn't present on hotsmash though the pins exist for it
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1)
@@ -1261,7 +1261,7 @@ static INPUT_PORTS_START( superqix )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) // JAMMA #R ("Service")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT ) // JAMMA #S ("Tilt")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE2 ) // JAMMA #15 ("Test")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, superqix_state, fromz80_semaphore_input_r, nullptr) // 74ls74 @C2 pin 8 (/Q2), this is the z80->mcu semaphore
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(superqix_state, fromz80_semaphore_input_r) // 74ls74 @C2 pin 8 (/Q2), this is the z80->mcu semaphore
PORT_START("P1") /* AY-3-8910 #1 @3P Port A */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY // JAMMA #18
@@ -1280,8 +1280,8 @@ static INPUT_PORTS_START( superqix )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL // JAMMA #Y
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL // JAMMA #Z
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL // JAMMA #a
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, superqix_state, frommcu_semaphore_input_r, nullptr) // 74ls174 @1J pin 5 (Q1), this is the mcu->z80 semaphore
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, superqix_state, fromz80_semaphore_input_r, nullptr) // 74ls74 @C2 pin 8 (/Q2), this is the z80->mcu semaphore
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(superqix_state, frommcu_semaphore_input_r) // 74ls174 @1J pin 5 (Q1), this is the mcu->z80 semaphore
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(superqix_state, fromz80_semaphore_input_r) // 74ls74 @C2 pin 8 (/Q2), this is the z80->mcu semaphore
INPUT_PORTS_END
diff --git a/src/mame/drivers/suprnova.cpp b/src/mame/drivers/suprnova.cpp
index fae1e70d3e6..1255842b58a 100644
--- a/src/mame/drivers/suprnova.cpp
+++ b/src/mame/drivers/suprnova.cpp
@@ -498,10 +498,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(skns_state::irq)
**********************************************************************************/
+template <int P>
CUSTOM_INPUT_MEMBER(skns_state::paddle_r)
{
- const char *tag = (const char *)param;
- return ioport(tag)->read();
+ return m_paddle[P]->read();
}
static INPUT_PORTS_START( skns ) /* 3 buttons, 2 players */
@@ -556,12 +556,12 @@ static INPUT_PORTS_START( skns ) /* 3 buttons, 2 players */
PORT_DIPNAME( 0x00000080, 0x00000080, "Freeze" )
PORT_DIPSETTING( 0x00000000, "Freezes the game")
PORT_DIPSETTING( 0x00000080, "Right value")
- PORT_BIT( 0x0000ff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, skns_state,paddle_r, "Paddle C")
- PORT_BIT( 0x00ff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, skns_state,paddle_r, "Paddle B")
- PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, skns_state,paddle_r, "Paddle A")
+ PORT_BIT( 0x0000ff00, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(skns_state, paddle_r<2>) // Paddle C
+ PORT_BIT( 0x00ff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(skns_state, paddle_r<1>) // Paddle B
+ PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(skns_state, paddle_r<0>) // Paddle A
PORT_START("40000c")
- PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, skns_state,paddle_r, "Paddle D")
+ PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(skns_state, paddle_r<3>) // Paddle D
PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("Paddle A")
diff --git a/src/mame/drivers/suprridr.cpp b/src/mame/drivers/suprridr.cpp
index 5c401d2e7a7..f4d3aaf4895 100644
--- a/src/mame/drivers/suprridr.cpp
+++ b/src/mame/drivers/suprridr.cpp
@@ -225,7 +225,7 @@ CUSTOM_INPUT_MEMBER(suprridr_state::control_r)
static INPUT_PORTS_START( suprridr )
PORT_START("INPUTS")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, suprridr_state, control_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(suprridr_state, control_r)
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
diff --git a/src/mame/drivers/system1.cpp b/src/mame/drivers/system1.cpp
index a303c351342..e88277272c0 100644
--- a/src/mame/drivers/system1.cpp
+++ b/src/mame/drivers/system1.cpp
@@ -2012,10 +2012,10 @@ static INPUT_PORTS_START( dakkochn )
PORT_INCLUDE( choplift )
PORT_MODIFY("P1")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, system1_state,dakkochn_mux_data_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(system1_state, dakkochn_mux_data_r)
PORT_MODIFY("P2")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, system1_state,dakkochn_mux_status_r, nullptr)
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(system1_state, dakkochn_mux_status_r)
PORT_MODIFY("SYSTEM")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) /* start 1 & 2 not connected. */
diff --git a/src/mame/drivers/tail2nos.cpp b/src/mame/drivers/tail2nos.cpp
index 06c6e75470e..9ef10460371 100644
--- a/src/mame/drivers/tail2nos.cpp
+++ b/src/mame/drivers/tail2nos.cpp
@@ -74,10 +74,10 @@ void tail2nos_state::sound_port_map(address_map &map)
#endif
}
+template <int N>
CUSTOM_INPUT_MEMBER(tail2nos_state::analog_in_r)
{
- int num = (uintptr_t)param;
- int delta = ioport(num ? "AN1" : "AN0")->read();
+ int delta = m_analog[N]->read();
return delta >> 5;
}
@@ -91,7 +91,7 @@ static INPUT_PORTS_START( tail2nos )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW", 0x4000, EQUALS, 0x4000) PORT_NAME("Brake (standard BD)")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("DSW", 0x4000, EQUALS, 0x4000) PORT_NAME("Accelerate (standard BD)")
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW", 0x4000, EQUALS, 0x4000)
- PORT_BIT( 0x0070, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tail2nos_state,analog_in_r, (void *)0) PORT_CONDITION("DSW", 0x4000, NOTEQUALS, 0x4000)
+ PORT_BIT( 0x0070, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(tail2nos_state, analog_in_r<0>) PORT_CONDITION("DSW", 0x4000, NOTEQUALS, 0x4000)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )
@@ -103,7 +103,7 @@ static INPUT_PORTS_START( tail2nos )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN1")
- PORT_BIT( 0x0070, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tail2nos_state,analog_in_r, (void *)1) PORT_CONDITION("DSW", 0x4000, NOTEQUALS, 0x4000)
+ PORT_BIT( 0x0070, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(tail2nos_state, analog_in_r<1>) PORT_CONDITION("DSW", 0x4000, NOTEQUALS, 0x4000)
PORT_BIT( 0x0070, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW", 0x4000, EQUALS, 0x4000)
PORT_BIT( 0xff8f, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/taito_f3.cpp b/src/mame/drivers/taito_f3.cpp
index 13db66e85d1..c867b19e8f8 100644
--- a/src/mame/drivers/taito_f3.cpp
+++ b/src/mame/drivers/taito_f3.cpp
@@ -42,18 +42,17 @@
/******************************************************************************/
+template <int Num>
CUSTOM_INPUT_MEMBER(taito_f3_state::f3_analog_r)
{
- const int num = (uintptr_t)param;
- const int data = m_dial[num]->read();
+ const int data = m_dial[Num]->read();
return ((data & 0xf) << 12) | ((data & 0xff0) >> 4);
}
-
+template <int Num>
CUSTOM_INPUT_MEMBER(taito_f3_state::f3_coin_r)
{
- const int num = (uintptr_t)param;
- return m_coin_word[num];
+ return m_coin_word[Num];
}
u32 taito_f3_state::f3_control_r(offs_t offset)
@@ -273,8 +272,8 @@ static INPUT_PORTS_START( f3 )
PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_START3 )
PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_START4 )
- PORT_BIT( 0x00ff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,eeprom_read, nullptr)
- PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,eeprom_read, nullptr)
+ PORT_BIT( 0x00ff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, eeprom_read)
+ PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, eeprom_read)
/* MSW: Coin counters/lockouts are readable, LSW: Joysticks (Player 1 & 2) */
PORT_START("IN.1")
@@ -287,7 +286,7 @@ static INPUT_PORTS_START( f3 )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0000ff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* These must be high */
- PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,f3_coin_r, (void *)0)
+ PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, f3_coin_r<0>)
/* Player 3 & 4 fire buttons (Player 2 top fire buttons in Kaiser Knuckle) */
PORT_START("IN.4")
@@ -313,16 +312,16 @@ static INPUT_PORTS_START( f3 )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,f3_coin_r, (void *)1)
+ PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, f3_coin_r<1>)
/* Analog control 1 */
PORT_START("IN.2")
- PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,f3_analog_r, (void*)0)
+ PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, f3_analog_r<0>)
PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* Analog control 2 */
PORT_START("IN.3")
- PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,f3_analog_r, (void *)1)
+ PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, f3_analog_r<1>)
PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* These are not read directly, but through PORT_CUSTOMs above */
diff --git a/src/mame/drivers/taito_z.cpp b/src/mame/drivers/taito_z.cpp
index 5a6d6f20efe..cc024428558 100644
--- a/src/mame/drivers/taito_z.cpp
+++ b/src/mame/drivers/taito_z.cpp
@@ -1392,11 +1392,16 @@ void taitoz_state::spacegun_eeprom_w(u8 data)
GAME INPUTS
**********************************************************/
-CUSTOM_INPUT_MEMBER(taitoz_state::taitoz_pedal_r)
+CUSTOM_INPUT_MEMBER(taitoz_state::gas_pedal_r)
{
static const u8 retval[8] = { 0,1,3,2,6,7,5,4 };
- ioport_port *port = ioport((const char *)param);
- return retval[port != nullptr ? port->read() & 7 : 0];
+ return retval[m_gas.read_safe(0) & 7];
+}
+
+CUSTOM_INPUT_MEMBER(taitoz_state::brake_pedal_r)
+{
+ static const u8 retval[8] = { 0,1,3,2,6,7,5,4 };
+ return retval[m_brake.read_safe(0) & 7];
}
@@ -2210,7 +2215,7 @@ static INPUT_PORTS_START( contcirc )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitoz_state, taitoz_pedal_r, "GAS") PORT_CONDITION("DSWA", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitoz_state, gas_pedal_r) PORT_CONDITION("DSWA", 0x01, EQUALS, 0x01)
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gas Switch") PORT_CONDITION("DSWA", 0x01, EQUALS, 0x00)
PORT_START("IN1")
@@ -2219,7 +2224,7 @@ static INPUT_PORTS_START( contcirc )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Shifter") PORT_TOGGLE
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitoz_state, taitoz_pedal_r, "BRAKE") PORT_CONDITION("DSWA", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitoz_state, brake_pedal_r) PORT_CONDITION("DSWA", 0x01, EQUALS, 0x01)
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Brake Switch") PORT_CONDITION("DSWA", 0x01, EQUALS, 0x00) // no function?
PORT_START("IN2") /* unused */
@@ -2292,7 +2297,7 @@ static INPUT_PORTS_START( chasehq ) // IN3-6 perhaps used with cockpit setup? //
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitoz_state, taitoz_pedal_r, "BRAKE") PORT_CONDITION("DSWA", 0x02, EQUALS, 0x00)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitoz_state, brake_pedal_r) PORT_CONDITION("DSWA", 0x02, EQUALS, 0x00)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Brake Switch") PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
PORT_START("IN1")
@@ -2301,7 +2306,7 @@ static INPUT_PORTS_START( chasehq ) // IN3-6 perhaps used with cockpit setup? //
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Calibrate") // ?
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Shifter") PORT_TOGGLE
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitoz_state, taitoz_pedal_r, "GAS") PORT_CONDITION("DSWA", 0x02, EQUALS, 0x00)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitoz_state, gas_pedal_r) PORT_CONDITION("DSWA", 0x02, EQUALS, 0x00)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gas Switch") PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
PORT_START("IN2") /* unused */
diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp
index b1c4a5dc7b3..401bea5bc28 100644
--- a/src/mame/drivers/taitosj.cpp
+++ b/src/mame/drivers/taitosj.cpp
@@ -254,23 +254,22 @@ void taitosj_state::taitosj_main_mcu_map(address_map &map)
/* seems the most logical way to do the gears */
+template <int Player>
CUSTOM_INPUT_MEMBER(taitosj_state::kikstart_gear_r)
{
const char *port_tag;
- int player = (int)(uintptr_t)param;
-
- if (player == 0)
+ if (Player == 0)
port_tag = "GEARP1";
else
port_tag = "GEARP2";
/* gear MUST be 1, 2 or 3 */
- if (ioport(port_tag)->read() & 0x01) m_kikstart_gears[player] = 0x02;
- if (ioport(port_tag)->read() & 0x02) m_kikstart_gears[player] = 0x03;
- if (ioport(port_tag)->read() & 0x04) m_kikstart_gears[player] = 0x01;
+ if (ioport(port_tag)->read() & 0x01) m_kikstart_gears[Player] = 0x02;
+ if (ioport(port_tag)->read() & 0x02) m_kikstart_gears[Player] = 0x03;
+ if (ioport(port_tag)->read() & 0x04) m_kikstart_gears[Player] = 0x01;
- return m_kikstart_gears[player];
+ return m_kikstart_gears[Player];
}
// TODO: merge with above
@@ -515,7 +514,7 @@ static INPUT_PORTS_START( spaceskr )
PORT_START("IN4")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
@@ -597,7 +596,7 @@ static INPUT_PORTS_START( spacecr )
PORT_START("IN4")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1") // according to the manual, dips 1, 2, 3 and 6 are unused but should be left off
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWA:1")
@@ -681,7 +680,7 @@ static INPUT_PORTS_START( junglek )
PORT_START("IN4")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, "Finish Bonus" )
@@ -803,7 +802,7 @@ static INPUT_PORTS_START( alpine )
PORT_START("IN4")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, "Jump Bonus" )
@@ -888,7 +887,7 @@ static INPUT_PORTS_START( alpinea )
PORT_START("IN4")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, "Jump Bonus" )
@@ -966,7 +965,7 @@ static INPUT_PORTS_START( timetunl )
PORT_START("IN4")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
@@ -1166,7 +1165,7 @@ static INPUT_PORTS_START( elevator )
PORT_START("IN4")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:1,2")
@@ -1249,7 +1248,7 @@ static INPUT_PORTS_START( tinstar )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_8WAY PORT_COCKTAIL
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, "Bonus Life?" )
@@ -1332,7 +1331,7 @@ static INPUT_PORTS_START( waterski )
PORT_START("IN4")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
@@ -1421,7 +1420,7 @@ static INPUT_PORTS_START( bioatack )
PORT_START("IN4")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1") /* d50a */
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) )
@@ -1488,7 +1487,7 @@ static INPUT_PORTS_START( sfposeid )
PORT_START("IN4")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
@@ -1556,7 +1555,7 @@ static INPUT_PORTS_START( hwrace )
PORT_START("IN4")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
@@ -1645,7 +1644,7 @@ static INPUT_PORTS_START( kikstart )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("IN3") /* Service */
- PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,kikstart_gear_r, (void *)0) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, kikstart_gear_r<0>) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x08)
PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x00)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* needs to be 0, otherwise cannot shift */
@@ -1655,7 +1654,7 @@ static INPUT_PORTS_START( kikstart )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN4")
- PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,kikstart_gear_r, (void *)1) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, kikstart_gear_r<1>) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x08)
PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x00)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* needs to be 0, otherwise cannot shift */
diff --git a/src/mame/drivers/tempest.cpp b/src/mame/drivers/tempest.cpp
index 6427c660f7c..0b3f08575cb 100644
--- a/src/mame/drivers/tempest.cpp
+++ b/src/mame/drivers/tempest.cpp
@@ -319,7 +319,7 @@ public:
DECLARE_CUSTOM_INPUT_MEMBER(tempest_knob_r);
DECLARE_CUSTOM_INPUT_MEMBER(tempest_buttons_r);
- DECLARE_CUSTOM_INPUT_MEMBER(clock_r);
+ DECLARE_READ_LINE_MEMBER(clock_r);
protected:
DECLARE_WRITE8_MEMBER(wdclr_w);
@@ -391,7 +391,7 @@ CUSTOM_INPUT_MEMBER(tempest_state::tempest_buttons_r)
}
-CUSTOM_INPUT_MEMBER(tempest_state::clock_r)
+READ_LINE_MEMBER(tempest_state::clock_r)
{
/* Emulate the 3kHz source on bit 7 (divide 1.5MHz by 512) */
return (m_maincpu->total_cycles() & 0x100) ? 1 : 0;
@@ -524,12 +524,12 @@ static INPUT_PORTS_START( tempest )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diagnostic Step")
/* bit 6 is the VG HALT bit. We set it to "low" */
/* per default (busy vector processor). */
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("avg", avg_tempest_device, done_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_tempest_device, done_r)
/* bit 7 is tied to a 3kHz (?) clock */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tempest_state,clock_r, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(tempest_state, clock_r)
PORT_START("IN1/DSW0")
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tempest_state,tempest_knob_r, nullptr)
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(tempest_state, tempest_knob_r)
/* The next one is reponsible for cocktail mode.
* According to the documentation, this is not a switch, although
* it may have been planned to put it on the Math Box PCB, D/E2 )
@@ -550,7 +550,7 @@ static INPUT_PORTS_START( tempest )
PORT_DIPNAME( 0x04, 0x04, "Rating" ) PORT_DIPLOCATION("DE2:2")
PORT_DIPSETTING( 0x04, "1, 3, 5, 7, 9" )
PORT_DIPSETTING( 0x00, "tied to high score" )
- PORT_BIT(0x18, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tempest_state,tempest_buttons_r, nullptr)
+ PORT_BIT(0x18, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(tempest_state, tempest_buttons_r)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/tetrisp2.cpp b/src/mame/drivers/tetrisp2.cpp
index ef53ea78535..2abc705b065 100644
--- a/src/mame/drivers/tetrisp2.cpp
+++ b/src/mame/drivers/tetrisp2.cpp
@@ -1081,7 +1081,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( rocknms )
PORT_START("PLAYERS") // IN0 - $be0002.w
- PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tetrisp2_state,rocknms_main2sub_status_r, nullptr) // MAIN -> SUB Communication
+ PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(tetrisp2_state, rocknms_main2sub_status_r) // MAIN -> SUB Communication
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
diff --git a/src/mame/drivers/thayers.cpp b/src/mame/drivers/thayers.cpp
index ab4d2e55db9..b0c9c7d7f76 100644
--- a/src/mame/drivers/thayers.cpp
+++ b/src/mame/drivers/thayers.cpp
@@ -52,8 +52,8 @@ public:
void thayers(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(laserdisc_enter_r);
- DECLARE_CUSTOM_INPUT_MEMBER(laserdisc_ready_r);
+ DECLARE_READ_LINE_MEMBER(laserdisc_enter_r);
+ DECLARE_READ_LINE_MEMBER(laserdisc_ready_r);
private:
enum
@@ -651,14 +651,14 @@ void thayers_state::thayers_io_map(address_map &map)
/* Input Ports */
-CUSTOM_INPUT_MEMBER(thayers_state::laserdisc_enter_r)
+READ_LINE_MEMBER(thayers_state::laserdisc_enter_r)
{
if (m_pr7820 != nullptr) return m_pr7820_enter;
if (m_ldv1000 != nullptr) return (m_ldv1000->status_strobe_r() == ASSERT_LINE) ? 0 : 1;
return 0;
}
-CUSTOM_INPUT_MEMBER(thayers_state::laserdisc_ready_r)
+READ_LINE_MEMBER(thayers_state::laserdisc_ready_r)
{
if (m_pr7820 != nullptr) return (m_pr7820->ready_r() == ASSERT_LINE) ? 0 : 1;
if (m_ldv1000 != nullptr) return (m_ldv1000->command_strobe_r() == ASSERT_LINE) ? 0 : 1;
@@ -702,8 +702,8 @@ static INPUT_PORTS_START( thayers )
PORT_START("COIN")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, thayers_state,laserdisc_enter_r, nullptr)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, thayers_state,laserdisc_ready_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(thayers_state, laserdisc_enter_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(thayers_state, laserdisc_ready_r)
PORT_START("ROW.0")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("1 YES") PORT_CODE(KEYCODE_1)
diff --git a/src/mame/drivers/timeplt.cpp b/src/mame/drivers/timeplt.cpp
index 17f32e54c5a..98708dd54c4 100644
--- a/src/mame/drivers/timeplt.cpp
+++ b/src/mame/drivers/timeplt.cpp
@@ -115,7 +115,7 @@ WRITE8_MEMBER(timeplt_state::chkun_sound_w)
m_tc8830f->reset();
}
-CUSTOM_INPUT_MEMBER(timeplt_state::chkun_hopper_status_r)
+READ_LINE_MEMBER(timeplt_state::chkun_hopper_status_r)
{
// temp workaround, needs hopper
return machine().rand();
@@ -272,7 +272,7 @@ static INPUT_PORTS_START( chkun )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Bet 3B")
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, timeplt_state, chkun_hopper_status_r, nullptr)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(timeplt_state, chkun_hopper_status_r)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Bet 1B")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Bet 2B")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
@@ -321,7 +321,7 @@ static INPUT_PORTS_START( bikkuric )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, timeplt_state, chkun_hopper_status_r, nullptr)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(timeplt_state, chkun_hopper_status_r)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
diff --git a/src/mame/drivers/toaplan2.cpp b/src/mame/drivers/toaplan2.cpp
index a3d3c742c36..892adeae76b 100644
--- a/src/mame/drivers/toaplan2.cpp
+++ b/src/mame/drivers/toaplan2.cpp
@@ -663,7 +663,7 @@ void toaplan2_state::shared_ram_w(offs_t offset, u8 data)
}
-CUSTOM_INPUT_MEMBER(toaplan2_state::c2map_r)
+READ_LINE_MEMBER(toaplan2_state::c2map_r)
{
// For Teki Paki hardware
// bit 4 high signifies secondary CPU is ready
@@ -1632,7 +1632,7 @@ static INPUT_PORTS_START( tekipaki )
// PORT_CONFSETTING( 0x000d, DEF_STR( Japan ) )
// PORT_CONFSETTING( 0x000e, DEF_STR( Japan ) )
PORT_CONFSETTING( 0x000f, "Japan (Distributed by Tecmo)" )
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, toaplan2_state,c2map_r, nullptr)
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(toaplan2_state, c2map_r)
INPUT_PORTS_END
@@ -2045,7 +2045,7 @@ static INPUT_PORTS_START( whoopee )
PORT_INCLUDE( pipibibs )
PORT_MODIFY("JMPR")
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, toaplan2_state,c2map_r, nullptr) // bit 0x10 sound ready
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(toaplan2_state, c2map_r) // bit 0x10 sound ready
INPUT_PORTS_END
diff --git a/src/mame/drivers/tomcat.cpp b/src/mame/drivers/tomcat.cpp
index a55a07d9e7a..a7933a14a57 100644
--- a/src/mame/drivers/tomcat.cpp
+++ b/src/mame/drivers/tomcat.cpp
@@ -276,7 +276,7 @@ void tomcat_state::sound_map(address_map &map)
static INPUT_PORTS_START( tomcat )
PORT_START("IN0") /* INPUTS */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER("avg", avg_tomcat_device, done_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_tomcat_device, done_r)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // SPARE
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) // DIAGNOSTIC
PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
diff --git a/src/mame/drivers/topspeed.cpp b/src/mame/drivers/topspeed.cpp
index 0c4098fc03b..377ea3738f0 100644
--- a/src/mame/drivers/topspeed.cpp
+++ b/src/mame/drivers/topspeed.cpp
@@ -207,11 +207,16 @@ u8 topspeed_state::input_bypass_r()
}
}
-CUSTOM_INPUT_MEMBER(topspeed_state::pedal_r)
+CUSTOM_INPUT_MEMBER(topspeed_state::gas_pedal_r)
{
static const u8 retval[8] = { 0,1,3,2,6,7,5,4 };
- ioport_port *port = ioport((const char *)param);
- return retval[port != nullptr ? port->read() & 7 : 0];
+ return retval[m_gas.read_safe(0) & 7];
+}
+
+CUSTOM_INPUT_MEMBER(topspeed_state::brake_pedal_r)
+{
+ static const u8 retval[8] = { 0,1,3,2,6,7,5,4 };
+ return retval[m_brake.read_safe(0) & 7];
}
// TODO: proper motorcpu hook-up
@@ -469,7 +474,7 @@ static INPUT_PORTS_START( topspeed )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, topspeed_state, pedal_r, "BRAKE") PORT_CONDITION("DSWA", 0x03, NOTEQUALS, 0x02)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(topspeed_state, brake_pedal_r) PORT_CONDITION("DSWA", 0x03, NOTEQUALS, 0x02)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Brake Switch") PORT_CONDITION("DSWA", 0x03, EQUALS, 0x02)
PORT_START("IN1")
@@ -478,7 +483,7 @@ static INPUT_PORTS_START( topspeed )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Calibrate") // ?
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Shifter") PORT_TOGGLE
- PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, topspeed_state, pedal_r, "GAS") PORT_CONDITION("DSWA", 0x03, NOTEQUALS, 0x02)
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(topspeed_state, gas_pedal_r) PORT_CONDITION("DSWA", 0x03, NOTEQUALS, 0x02)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gas Switch") PORT_CONDITION("DSWA", 0x03, EQUALS, 0x02)
PORT_START("IN2") // Unused
diff --git a/src/mame/drivers/ultratnk.cpp b/src/mame/drivers/ultratnk.cpp
index 6c5d28b1798..b4fae269996 100644
--- a/src/mame/drivers/ultratnk.cpp
+++ b/src/mame/drivers/ultratnk.cpp
@@ -23,15 +23,17 @@ Atari Ultra Tank driver
-CUSTOM_INPUT_MEMBER(ultratnk_state::get_collision)
+template <int N>
+READ_LINE_MEMBER(ultratnk_state::collision_flipflop_r)
{
- return m_collision[(uintptr_t) param];
+ return m_collision[N];
}
-CUSTOM_INPUT_MEMBER(ultratnk_state::get_joystick)
+template <int N>
+READ_LINE_MEMBER(ultratnk_state::joystick_r)
{
- uint8_t joy = ioport((const char *)param)->read() & 3;
+ uint8_t joy = m_joy[N]->read() & 3;
if (joy == 1)
{
@@ -192,13 +194,13 @@ static INPUT_PORTS_START( ultratnk )
PORT_START("COLLISION")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultratnk_state, get_collision, (void *)0 )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ultratnk_state, collision_flipflop_r<0>)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultratnk_state, get_collision, (void *)1 )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ultratnk_state, collision_flipflop_r<1>)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) /* VCC */
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultratnk_state, get_collision, (void *)2 )
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ultratnk_state, collision_flipflop_r<2>)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT ) /* SLAM */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultratnk_state, get_collision, (void *)3 )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ultratnk_state, collision_flipflop_r<3>)
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
@@ -231,13 +233,13 @@ static INPUT_PORTS_START( ultratnk )
PORT_START("ANALOG")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultratnk_state, get_joystick, "JOY-W" )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ultratnk_state, joystick_r<0>) // "JOY-W"
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultratnk_state, get_joystick, "JOY-Y" )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ultratnk_state, joystick_r<2>) // "JOY-Y"
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultratnk_state, get_joystick, "JOY-X" )
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ultratnk_state, joystick_r<1>) // "JOY-X"
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultratnk_state, get_joystick, "JOY-Z" )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(ultratnk_state, joystick_r<3>) // "JOY-Z"
PORT_START("JOY-W")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1)
diff --git a/src/mame/drivers/vamphalf.cpp b/src/mame/drivers/vamphalf.cpp
index f7c09126065..a1c19cca1a0 100644
--- a/src/mame/drivers/vamphalf.cpp
+++ b/src/mame/drivers/vamphalf.cpp
@@ -1050,7 +1050,7 @@ static INPUT_PORTS_START( boonggab )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_CUSTOM ) // sensor 1
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_CUSTOM ) // sensor 2
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_CUSTOM ) // sensor 3
- PORT_BIT( 0x3800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vamphalf_state,boonggab_photo_sensors_r, nullptr) // photo sensors 1, 2 and 3
+ PORT_BIT( 0x3800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(vamphalf_state, boonggab_photo_sensors_r) // photo sensors 1, 2 and 3
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/vegaeo.cpp b/src/mame/drivers/vegaeo.cpp
index a09279722bc..13e92abd15e 100644
--- a/src/mame/drivers/vegaeo.cpp
+++ b/src/mame/drivers/vegaeo.cpp
@@ -128,7 +128,7 @@ static INPUT_PORTS_START( crazywar )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
- PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vegaeo_state, eolith_speedup_getvblank, nullptr)
+ PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vegaeo_state, speedup_vblank_r)
PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/vegas.cpp b/src/mame/drivers/vegas.cpp
index 33a653a6183..e12909b2fd1 100644
--- a/src/mame/drivers/vegas.cpp
+++ b/src/mame/drivers/vegas.cpp
@@ -1516,7 +1516,7 @@ static INPUT_PORTS_START( nbashowt )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, vegas_state, i40_r, nullptr)
+ PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(vegas_state, i40_r)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
@@ -1575,8 +1575,8 @@ static INPUT_PORTS_START( sf2049 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("View 2") PORT_PLAYER(1) /* view 2 */
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("View 3") PORT_PLAYER(1) /* view 3 */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("Music") PORT_PLAYER(1) /* music */
- PORT_BIT( 0x0070, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, vegas_state, keypad_r, "KEYPAD" )
- PORT_BIT( 0x0f00, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, vegas_state, gearshift_r, "GEAR" )
+ PORT_BIT( 0x0070, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(vegas_state, keypad_r)
+ PORT_BIT( 0x0f00, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(vegas_state, gearshift_r)
PORT_START("GEAR")
PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("1st Gear") PORT_PLAYER(1) /* 1st gear */
@@ -1670,7 +1670,7 @@ static INPUT_PORTS_START( cartfury )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("View 2") PORT_PLAYER(1) /* view 2 */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("View 3") PORT_PLAYER(1) /* view 3 */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("Boost") PORT_PLAYER(1) /* boost */
- PORT_BIT( 0x0f00, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, vegas_state, gearshift_r, "GEAR" )
+ PORT_BIT( 0x0f00, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(vegas_state, gearshift_r)
PORT_START("GEAR")
PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("1st Gear") PORT_PLAYER(1) /* 1st gear */
diff --git a/src/mame/drivers/vertigo.cpp b/src/mame/drivers/vertigo.cpp
index e71ff96f89c..48a092ec38d 100644
--- a/src/mame/drivers/vertigo.cpp
+++ b/src/mame/drivers/vertigo.cpp
@@ -13,7 +13,6 @@
#include "emu.h"
#include "includes/vertigo.h"
-#include "includes/exidy440.h"
#include "audio/exidy440.h"
#include "speaker.h"
diff --git a/src/mame/drivers/vicdual.cpp b/src/mame/drivers/vicdual.cpp
index f93db10f607..482a9e6a321 100644
--- a/src/mame/drivers/vicdual.cpp
+++ b/src/mame/drivers/vicdual.cpp
@@ -96,7 +96,7 @@ void vicdual_state::assert_coin_status()
m_coin_status = 1;
}
-CUSTOM_INPUT_MEMBER(vicdual_state::read_coin_status)
+READ_LINE_MEMBER(vicdual_state::coin_status_r)
{
return m_coin_status;
}
@@ -171,25 +171,25 @@ int vicdual_state::get_vcounter()
}
-CUSTOM_INPUT_MEMBER(vicdual_state::get_64v)
+READ_LINE_MEMBER(vicdual_state::get_64v)
{
return (get_vcounter() >> 6) & 0x01;
}
-CUSTOM_INPUT_MEMBER(vicdual_state::get_vblank_comp)
+READ_LINE_MEMBER(vicdual_state::vblank_comp_r)
{
return (get_vcounter() < VICDUAL_VBSTART);
}
-CUSTOM_INPUT_MEMBER(vicdual_state::get_composite_blank_comp)
+READ_LINE_MEMBER(vicdual_state::cblank_comp_r)
{
- return (get_vblank_comp(field, nullptr) && !m_screen->hblank());
+ return (vblank_comp_r() && !m_screen->hblank());
}
-CUSTOM_INPUT_MEMBER(vicdual_state::get_timer_value)
+READ_LINE_MEMBER(vicdual_state::timer_value_r)
{
/* return the state of the timer (old code claims "4MHz square wave", but it was toggled once every 2msec, or 500Hz) */
return machine().time().as_ticks(500) & 1;
@@ -345,9 +345,9 @@ static INPUT_PORTS_START( depthch )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, get_64v)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -429,7 +429,7 @@ static INPUT_PORTS_START( safari )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, get_64v)
PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
@@ -437,7 +437,7 @@ static INPUT_PORTS_START( safari )
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -523,9 +523,9 @@ static INPUT_PORTS_START( frogs )
PORT_CONFSETTING( 0x40, DEF_STR( 1C_1C ) )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, get_64v)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_COIN_DEFAULT
@@ -654,9 +654,9 @@ static INPUT_PORTS_START( headon )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, get_64v)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_CABINET_COLOR_OR_BW
@@ -680,10 +680,10 @@ static INPUT_PORTS_START( headonmz )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, get_64v)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) // protection? (check on startup)
PORT_BIT( 0x7a, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_CABINET_COLOR_OR_BW
@@ -715,7 +715,7 @@ static INPUT_PORTS_START( headonsa )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("COIN")
@@ -740,7 +740,7 @@ static INPUT_PORTS_START( supcrash )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) // see comment above
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -748,7 +748,7 @@ static INPUT_PORTS_START( supcrash )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -766,9 +766,9 @@ static INPUT_PORTS_START( carnivalh )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_CABINET_COLOR_OR_BW
@@ -810,9 +810,9 @@ static INPUT_PORTS_START( sspaceat )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_CABINET_COLOR_OR_BW
@@ -954,7 +954,7 @@ static INPUT_PORTS_START( headon2 )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
PORT_BIT(0x7c, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -977,12 +977,12 @@ static INPUT_PORTS_START( car2 )
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* probably unused */
PORT_START("IN2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -995,7 +995,7 @@ static INPUT_PORTS_START( headon2s )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_MODIFY("IN2")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("COIN")
@@ -1034,10 +1034,10 @@ static INPUT_PORTS_START( digger )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN2")
-// PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr) // it's like this according to the schematics, but gameplay speed is too fast;
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr) // gameplay speed is correct now, there's likely an error in the schematics then...
+// PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r) // it's like this according to the schematics, but gameplay speed is too fast;
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r) // gameplay speed is correct now, there's likely an error in the schematics then...
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -1414,13 +1414,15 @@ void vicdual_state::headonn_io_map(address_map &map)
/* several of the games' lives DIPs are spread across two input ports */
-CUSTOM_INPUT_MEMBER(vicdual_state::fake_lives_r)
+template <int Param>
+READ_LINE_MEMBER(vicdual_state::fake_lives_r)
{
- /* use the low byte for the bitmask */
- uint8_t bit_mask = ((uintptr_t)param) & 0xff;
+ // FIXME: there should be two template parameters, but that makes port macros confused
+ // use the low byte for the bitmask
+ uint8_t bit_mask = (Param) & 0xff;
- /* and use d8 for the port */
- int port = ((uintptr_t)param) >> 8 & 1;
+ // and use d8 for the port
+ int port = (Param) >> 8 & 1;
return (m_fake_lives[port].read_safe(0) & bit_mask) ? 0 : 1;
}
@@ -1429,7 +1431,7 @@ static INPUT_PORTS_START( invho2 )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x001>)
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1440,8 +1442,8 @@ static INPUT_PORTS_START( invho2 )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x001>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1449,8 +1451,8 @@ static INPUT_PORTS_START( invho2 )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x101)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x101>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1458,8 +1460,8 @@ static INPUT_PORTS_START( invho2 )
PORT_START("IN3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x102)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x101>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Game Select") PORT_TOGGLE
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1492,7 +1494,7 @@ static INPUT_PORTS_START( carhntds )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x001>)
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1503,8 +1505,8 @@ static INPUT_PORTS_START( carhntds )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x002>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1512,8 +1514,8 @@ static INPUT_PORTS_START( carhntds )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x101)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x101>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1521,8 +1523,8 @@ static INPUT_PORTS_START( carhntds )
PORT_START("IN3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x102)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x102>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Game Select") PORT_TOGGLE
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1580,7 +1582,7 @@ static INPUT_PORTS_START( invds )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x001>)
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1591,8 +1593,8 @@ static INPUT_PORTS_START( invds )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x002>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1600,8 +1602,8 @@ static INPUT_PORTS_START( invds )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x101)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x101>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1609,8 +1611,8 @@ static INPUT_PORTS_START( invds )
PORT_START("IN3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x102)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x101>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Game Select") PORT_TOGGLE
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1638,7 +1640,7 @@ static INPUT_PORTS_START( sspacaho )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x001>)
PORT_DIPNAME( 0x08, 0x00, "Head On Lives" ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x08, "4" )
@@ -1649,8 +1651,8 @@ static INPUT_PORTS_START( sspacaho )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x002>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1661,7 +1663,7 @@ static INPUT_PORTS_START( sspacaho )
PORT_DIPNAME( 0x04, 0x00, "Space Attack Bonus Life" ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x00, "10000" )
PORT_DIPSETTING( 0x04, "15000" )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1672,7 +1674,7 @@ static INPUT_PORTS_START( sspacaho )
PORT_DIPNAME( 0x04, 0x00, "Space Attack Final UFO Bonus" ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Game Select") PORT_TOGGLE
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1708,7 +1710,7 @@ static INPUT_PORTS_START( tranqgun )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_vblank_comp, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, vblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1719,7 +1721,7 @@ static INPUT_PORTS_START( tranqgun )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1730,7 +1732,7 @@ static INPUT_PORTS_START( tranqgun )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1759,7 +1761,7 @@ static INPUT_PORTS_START( spacetrk )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") // unknown, but used
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1770,7 +1772,7 @@ static INPUT_PORTS_START( spacetrk )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1781,7 +1783,7 @@ static INPUT_PORTS_START( spacetrk )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1831,7 +1833,7 @@ static INPUT_PORTS_START( carnival )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1842,7 +1844,7 @@ static INPUT_PORTS_START( carnival )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1853,7 +1855,7 @@ static INPUT_PORTS_START( carnival )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1880,7 +1882,7 @@ static INPUT_PORTS_START( brdrline )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x001>)
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 8-pos (is 6-8 unconnected?)
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) )
@@ -1891,8 +1893,8 @@ static INPUT_PORTS_START( brdrline )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_vblank_comp, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x002>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, vblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1900,8 +1902,8 @@ static INPUT_PORTS_START( brdrline )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x004)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, nullptr) /* yes, this is different */
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x004>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, get_64v) /* yes, this is different */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1912,7 +1914,7 @@ static INPUT_PORTS_START( brdrline )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, "15000" )
PORT_DIPSETTING( 0x00, "20000" )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1953,7 +1955,7 @@ static INPUT_PORTS_START( pulsar )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x001>)
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1964,8 +1966,8 @@ static INPUT_PORTS_START( pulsar )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x002>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1976,7 +1978,7 @@ static INPUT_PORTS_START( pulsar )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1987,7 +1989,7 @@ static INPUT_PORTS_START( pulsar )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2023,7 +2025,7 @@ static INPUT_PORTS_START( heiankyo )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") // bonus life?
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2034,7 +2036,7 @@ static INPUT_PORTS_START( heiankyo )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") // bonus life?
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* has to be 0, protection? */
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2045,7 +2047,7 @@ static INPUT_PORTS_START( heiankyo )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x04, "5" )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2058,7 +2060,7 @@ static INPUT_PORTS_START( alphaho )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x001>)
PORT_DIPNAME( 0x08, 0x00, "Head On Lives" ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x08, "4" )
@@ -2069,8 +2071,8 @@ static INPUT_PORTS_START( alphaho )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, fake_lives_r<0x002>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2081,7 +2083,7 @@ static INPUT_PORTS_START( alphaho )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2092,7 +2094,7 @@ static INPUT_PORTS_START( alphaho )
PORT_DIPNAME( 0x04, 0x00, "Alpha Fighter Unknown" ) PORT_DIPLOCATION("SW1:4") // related to soccer frequency (code at 0x4950)
PORT_DIPSETTING( 0x00, DEF_STR ( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR ( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Game Select") PORT_TOGGLE
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2143,7 +2145,7 @@ static INPUT_PORTS_START( headonn )
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_4WAY PORT_COCKTAIL
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_START2)
PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED)
@@ -2337,9 +2339,9 @@ WRITE8_MEMBER(vicdual_state::samurai_protection_w)
}
-CUSTOM_INPUT_MEMBER(vicdual_state::samurai_protection_r)
+template <int Offset>
+READ_LINE_MEMBER(vicdual_state::samurai_protection_r)
{
- int offset = (uintptr_t)param;
uint32_t answer = 0;
if (m_samurai_protection_data == 0xab)
@@ -2347,7 +2349,7 @@ CUSTOM_INPUT_MEMBER(vicdual_state::samurai_protection_r)
else if (m_samurai_protection_data == 0x1d)
answer = 0x0c;
- return (answer >> offset) & 0x01;
+ return (answer >> Offset) & 0x01;
}
@@ -2400,33 +2402,33 @@ static INPUT_PORTS_START( samurai )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,samurai_protection_r, (void *)1)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, samurai_protection_r<1>)
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") // unknown, but used
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,samurai_protection_r, (void *)2)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, samurai_protection_r<2>)
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, timer_value_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,samurai_protection_r, (void *)3)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, samurai_protection_r<3>)
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2577,9 +2579,9 @@ static INPUT_PORTS_START( nsub )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nsub_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(nsub_state, cblank_comp_r)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nsub_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(nsub_state, coin_status_r)
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, nsub_state, nsub_coin_in, 0)
@@ -2734,9 +2736,9 @@ static INPUT_PORTS_START( invinco )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, cblank_comp_r)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, nullptr)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(vicdual_state, coin_status_r)
PORT_COIN_DEFAULT
INPUT_PORTS_END
diff --git a/src/mame/drivers/video21.cpp b/src/mame/drivers/video21.cpp
index 3ef2c9a66b7..699f0390d66 100644
--- a/src/mame/drivers/video21.cpp
+++ b/src/mame/drivers/video21.cpp
@@ -45,7 +45,7 @@ public:
{ }
void video21(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(hopper_coinout_r);
+ DECLARE_READ_LINE_MEMBER(hopper_coinout_r);
protected:
virtual void machine_start() override;
@@ -166,7 +166,7 @@ void video21_state::io_map(address_map &map) {
}
-CUSTOM_INPUT_MEMBER(video21_state::hopper_coinout_r)
+READ_LINE_MEMBER(video21_state::hopper_coinout_r)
{
return m_hopper_coin;
}
@@ -203,7 +203,7 @@ static INPUT_PORTS_START( video21 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Card")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_STAND ) PORT_NAME("Stop")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, video21_state, hopper_coinout_r, nullptr)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(video21_state, hopper_coinout_r)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN44")
diff --git a/src/mame/drivers/vii.cpp b/src/mame/drivers/vii.cpp
index 6dc3ee6c4a4..492d8368734 100644
--- a/src/mame/drivers/vii.cpp
+++ b/src/mame/drivers/vii.cpp
@@ -177,8 +177,6 @@ public:
void init_zeus();
void init_zone40();
- DECLARE_CUSTOM_INPUT_MEMBER(i2c_r);
-
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
@@ -251,7 +249,7 @@ public:
void jakks_gkr_mv_i2c(machine_config &config);
void jakks_gkr_wp(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(i2c_gkr_r);
+ DECLARE_READ_LINE_MEMBER(i2c_gkr_r);
private:
virtual void machine_start() override;
@@ -479,12 +477,7 @@ WRITE16_MEMBER(vii_state::vii_portb_w)
}
-CUSTOM_INPUT_MEMBER(spg2xx_game_state::i2c_r)
-{
- return m_i2cmem->read_sda();
-}
-
-CUSTOM_INPUT_MEMBER(jakks_gkr_state::i2c_gkr_r)
+READ_LINE_MEMBER(jakks_gkr_state::i2c_gkr_r)
{
if (m_cart && m_cart->exists())
{
@@ -650,7 +643,7 @@ static INPUT_PORTS_START( walle )
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("B Button")
PORT_START("P3")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, spg2xx_game_state,i2c_r, nullptr)
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda)
PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here)
INPUT_PORTS_END
@@ -663,7 +656,7 @@ static INPUT_PORTS_START( jak_sith_i2c )
PORT_BIT( 0xf3df, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("P3")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jakks_gkr_state,i2c_gkr_r, nullptr)
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here)
PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED )
@@ -702,7 +695,7 @@ static INPUT_PORTS_START( jak_nm_i2c )
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON1 )
PORT_START("P3")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jakks_gkr_state,i2c_gkr_r, nullptr)
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r)
PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC
@@ -727,7 +720,7 @@ static INPUT_PORTS_START( jak_wf_i2c )
PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("P3")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jakks_gkr_state,i2c_gkr_r, nullptr)
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r)
PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC
@@ -818,7 +811,7 @@ static INPUT_PORTS_START( jak_sdoo_i2c ) // GameKeyReady units had 2 main button
PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("P3")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jakks_gkr_state,i2c_gkr_r, nullptr) // is this correct? doesn't seem to work
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r) // is this correct? doesn't seem to work
PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
@@ -869,7 +862,7 @@ static INPUT_PORTS_START( jak_gkr_i2c )
PORT_INCLUDE(jak_gkr)
PORT_MODIFY("P3")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jakks_gkr_state,i2c_gkr_r, nullptr)
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r)
INPUT_PORTS_END
static INPUT_PORTS_START( jak_disp_i2c )
@@ -887,7 +880,7 @@ static INPUT_PORTS_START( jak_disp_i2c )
PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("P3")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jakks_gkr_state,i2c_gkr_r, nullptr)
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(jakks_gkr_state, i2c_gkr_r)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PAL/NTSC flag, set to NTSC (unverified here)
PORT_BIT( 0xfff6, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
diff --git a/src/mame/drivers/viper.cpp b/src/mame/drivers/viper.cpp
index 140a94cfa65..9cce29697d3 100644
--- a/src/mame/drivers/viper.cpp
+++ b/src/mame/drivers/viper.cpp
@@ -382,7 +382,7 @@ public:
m_ds2430_bit_timer(*this, "ds2430_timer2"),
m_workram(*this, "workram"),
m_ds2430_rom(*this, "ds2430"),
- m_io_ports(*this, {"IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7"})
+ m_io_ports(*this, "IN%u", 0U)
{
}
@@ -392,7 +392,7 @@ public:
void init_vipercf();
void init_viperhd();
- DECLARE_CUSTOM_INPUT_MEMBER(ds2430_unk_r);
+ DECLARE_READ_LINE_MEMBER(ds2430_unk_r);
private:
DECLARE_READ32_MEMBER(epic_r);
@@ -2132,7 +2132,7 @@ void viper_state::viper_map(address_map &map)
/*****************************************************************************/
-CUSTOM_INPUT_MEMBER(viper_state::ds2430_unk_r)
+READ_LINE_MEMBER(viper_state::ds2430_unk_r)
{
return m_ds2430_unk_status;
}
@@ -2159,7 +2159,7 @@ static INPUT_PORTS_START( viper )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, viper_state, ds2430_unk_r, nullptr)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(viper_state, ds2430_unk_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // if this bit is 0, loads a disk copier instead
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
diff --git a/src/mame/drivers/wacky_gator.cpp b/src/mame/drivers/wacky_gator.cpp
index 4859b884b5e..47c2331c9fd 100644
--- a/src/mame/drivers/wacky_gator.cpp
+++ b/src/mame/drivers/wacky_gator.cpp
@@ -213,13 +213,13 @@ void wackygtr_state::set_lamps(int p, uint8_t value)
static INPUT_PORTS_START( wackygtr )
PORT_START("IN0")
- PORT_BIT(0x1f, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, wackygtr_state, alligators_rear_sensors_r, nullptr)
+ PORT_BIT(0x1f, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(wackygtr_state, alligators_rear_sensors_r)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_SERVICE)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_SERVICE1)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_COIN1)
PORT_START("IN1")
- PORT_BIT(0x1f, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, wackygtr_state, alligators_front_sensors_r, nullptr)
+ PORT_BIT(0x1f, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(wackygtr_state, alligators_front_sensors_r)
PORT_DIPNAME( 0xe0, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW:1,2,3")
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 1C_1C ) )
diff --git a/src/mame/drivers/wecleman.cpp b/src/mame/drivers/wecleman.cpp
index 53e4233a2c7..09f16c90031 100644
--- a/src/mame/drivers/wecleman.cpp
+++ b/src/mame/drivers/wecleman.cpp
@@ -841,7 +841,7 @@ INPUT_PORTS_END
Hot Chase Input Ports
***************************************************************************/
-CUSTOM_INPUT_MEMBER(wecleman_state::hotchase_sound_status_r)
+READ_LINE_MEMBER(wecleman_state::hotchase_sound_status_r)
{
return m_hotchase_sound_hs;
}
@@ -862,7 +862,7 @@ static INPUT_PORTS_START( hotchase )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Left SW") // left sw
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE4 ) PORT_NAME("Thermo SW") // thermo
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) // from sound cpu
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wecleman_state,hotchase_sound_status_r, nullptr)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(wecleman_state, hotchase_sound_status_r)
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW2") /* $140015.b */
diff --git a/src/mame/drivers/williams.cpp b/src/mame/drivers/williams.cpp
index a90fbc89e48..f49a1e23239 100644
--- a/src/mame/drivers/williams.cpp
+++ b/src/mame/drivers/williams.cpp
@@ -1338,6 +1338,13 @@ static INPUT_PORTS_START( mysticm )
INPUT_PORTS_END
+template <int P>
+CUSTOM_INPUT_MEMBER(tshoot_state::gun_r)
+{
+ int data = m_gun[P]->read();
+ return (data & 0x3f) ^ ((data & 0x3f) >> 1);
+}
+
static INPUT_PORTS_START( tshoot )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Grenade")
@@ -1357,12 +1364,12 @@ static INPUT_PORTS_START( tshoot )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("INP1")
- PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tshoot_state, gun_r, (uintptr_t)0)
+ PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(tshoot_state, gun_r<0>)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Fire")
PORT_START("INP2")
- PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tshoot_state, gun_r, (uintptr_t)1)
+ PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(tshoot_state, gun_r<1>)
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("GUNX")
diff --git a/src/mame/drivers/wmg.cpp b/src/mame/drivers/wmg.cpp
index 030bc82d128..bc5ea81ecab 100644
--- a/src/mame/drivers/wmg.cpp
+++ b/src/mame/drivers/wmg.cpp
@@ -97,7 +97,7 @@ public:
void init_wmg();
- DECLARE_CUSTOM_INPUT_MEMBER(wmg_mux_r);
+ template <int N> DECLARE_CUSTOM_INPUT_MEMBER(wmg_mux_r);
private:
u8 wmg_nvram_r(offs_t offset);
@@ -179,10 +179,10 @@ void wmg_state::wmg_banked_map(address_map &map)
***************************************************************/
static INPUT_PORTS_START( wmg )
PORT_START("IN0")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wmg_state, wmg_mux_r, "0")
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(wmg_state, wmg_mux_r<0>)
PORT_START("IN1")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wmg_state, wmg_mux_r, "1")
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(wmg_state, wmg_mux_r<1>)
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Auto Up / Manual Down") PORT_TOGGLE
@@ -465,11 +465,10 @@ WRITE_LINE_MEMBER( wmg_state::wmg_port_select_w )
m_wmg_port_select = state | (m_wmg_c400 << 1);
}
+template <int N>
CUSTOM_INPUT_MEMBER(wmg_state::wmg_mux_r)
{
- const char *port = (const char *)param;
-
- if (port[0] == '0')
+ if (N == 0)
{
uint8_t ports[17] = { 0,0,2,2,5,4,7,7,9,9,11,11,14,13,9,9 };
return m_keyboard[ports[m_wmg_port_select]]->read();
diff --git a/src/mame/drivers/wolfpack.cpp b/src/mame/drivers/wolfpack.cpp
index 611f453464f..21d6d76776d 100644
--- a/src/mame/drivers/wolfpack.cpp
+++ b/src/mame/drivers/wolfpack.cpp
@@ -53,10 +53,10 @@ void wolfpack_state::machine_reset()
}
-CUSTOM_INPUT_MEMBER(wolfpack_state::dial_r)
+template <int Bit>
+READ_LINE_MEMBER(wolfpack_state::dial_r)
{
- int bit = (uintptr_t)param;
- return ((ioport("DIAL")->read() + bit) / 2) & 0x01;
+ return ((ioport("DIAL")->read() + Bit) / 2) & 0x01;
}
@@ -171,8 +171,8 @@ void wolfpack_state::main_map(address_map &map)
static INPUT_PORTS_START( wolfpack )
PORT_START("INPUTS")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wolfpack_state, dial_r, (void *)0) /* dial connects here */
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wolfpack_state, dial_r, (void *)1) /* dial connects here */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(wolfpack_state, dial_r<0>) // dial connects here
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(wolfpack_state, dial_r<1>) // dial connects here
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_SERVICE( 0x10, IP_ACTIVE_HIGH )
diff --git a/src/mame/drivers/wwfsstar.cpp b/src/mame/drivers/wwfsstar.cpp
index c7349d1c848..fc4c87dc1cf 100644
--- a/src/mame/drivers/wwfsstar.cpp
+++ b/src/mame/drivers/wwfsstar.cpp
@@ -280,7 +280,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(wwfsstar_state::scanline)
}
}
-CUSTOM_INPUT_MEMBER(wwfsstar_state::vblank_r)
+READ_LINE_MEMBER(wwfsstar_state::vblank_r)
{
return m_vblank;
}
@@ -315,7 +315,7 @@ static INPUT_PORTS_START( wwfsstar )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Button B (1P VS 2P - Buy-in)")
PORT_START("SYSTEM")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wwfsstar_state, vblank_r, nullptr) /* VBlank */
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(wwfsstar_state, vblank_r) // VBlank
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 )
diff --git a/src/mame/drivers/xain.cpp b/src/mame/drivers/xain.cpp
index f1e7ba5aa94..85cc2e224d2 100644
--- a/src/mame/drivers/xain.cpp
+++ b/src/mame/drivers/xain.cpp
@@ -245,7 +245,7 @@ WRITE8_MEMBER(xain_state::irqB_clear_w)
m_subcpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE);
}
-CUSTOM_INPUT_MEMBER(xain_state::vblank_r)
+READ_LINE_MEMBER(xain_state::vblank_r)
{
return m_vblank;
}
@@ -425,8 +425,8 @@ static INPUT_PORTS_START( xsleena )
PORT_START("VBLANK")
PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x18, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, xain_state, mcu_status_r, nullptr)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xain_state, vblank_r, nullptr) /* VBLANK */
+ PORT_BIT( 0x18, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(xain_state, mcu_status_r)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xain_state, vblank_r) // VBLANK
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
diff --git a/src/mame/drivers/xavix.cpp b/src/mame/drivers/xavix.cpp
index 7132cad5cfe..ffba3abe833 100644
--- a/src/mame/drivers/xavix.cpp
+++ b/src/mame/drivers/xavix.cpp
@@ -543,25 +543,25 @@ static INPUT_PORTS_START( xavix_i2c )
PORT_INCLUDE(xavix)
PORT_MODIFY("IN1")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_state,i2c_r, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda)
INPUT_PORTS_END
static INPUT_PORTS_START( ttv_lotr )
PORT_INCLUDE(xavix)
PORT_MODIFY("IN1")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_lotr_state,camera_r, nullptr)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_lotr_state,camera_r, nullptr)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_state,i2c_r, nullptr)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xavix_i2c_lotr_state, camera_r)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xavix_i2c_lotr_state, camera_r)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda)
INPUT_PORTS_END
static INPUT_PORTS_START( xavix_bowl )
PORT_INCLUDE(xavix)
PORT_MODIFY("IN1")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_bowl_state,camera_r, nullptr)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_bowl_state,camera_r, nullptr)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_state,i2c_r, nullptr)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xavix_i2c_bowl_state, camera_r)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xavix_i2c_bowl_state, camera_r)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda)
INPUT_PORTS_END
static INPUT_PORTS_START( epo_sdb )
@@ -631,7 +631,7 @@ static INPUT_PORTS_START( taikodp )
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_MODIFY("IN1")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_cart_state,i2c_r, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda)
INPUT_PORTS_END
static INPUT_PORTS_START( jpopira )
@@ -644,7 +644,7 @@ static INPUT_PORTS_START( jpopira )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Pad 4")
PORT_MODIFY("IN1")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_cart_state,i2c_r, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_NAME("Power Switch") // pressing this will turn the game off.
INPUT_PORTS_END
@@ -671,7 +671,7 @@ INPUT_PORTS_END
*/
-CUSTOM_INPUT_MEMBER( xavix_mtrk_state::mtrk_wheel_r )
+READ_LINE_MEMBER( xavix_mtrk_state::mtrk_wheel_r )
{
return m_wheel->read_direction();
}
@@ -686,7 +686,7 @@ static INPUT_PORTS_START( rad_mtrk )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Throttle Low")
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Reverse / Back")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_mtrk_state,mtrk_wheel_r, (void *)0)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xavix_mtrk_state, mtrk_wheel_r)
PORT_MODIFY("IN1")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Horn")
@@ -803,8 +803,8 @@ static INPUT_PORTS_START( ekara )
PORT_INCLUDE(xavix)
PORT_MODIFY("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_ekara_state,ekara_multi0_r, nullptr)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_ekara_state,ekara_multi1_r, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xavix_ekara_state, ekara_multi0_r)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xavix_ekara_state, ekara_multi1_r)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_NAME("Power Switch") // pressing this will turn the game off.
@@ -884,7 +884,7 @@ static INPUT_PORTS_START( popira2 ) // player 2 buttons have heavy latency, prob
PORT_MODIFY("IN1")
PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_popira2_cart_state,i2c_r, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xavix_popira2_cart_state, i2c_r)
PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_NAME("Power Switch") // pressing this will turn the game off.
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
diff --git a/src/mame/drivers/xmen.cpp b/src/mame/drivers/xmen.cpp
index 46c9ef7c47d..ed3b4543eb5 100644
--- a/src/mame/drivers/xmen.cpp
+++ b/src/mame/drivers/xmen.cpp
@@ -223,7 +223,7 @@ static INPUT_PORTS_START( xmen2p )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, cs_write)
INPUT_PORTS_END
-CUSTOM_INPUT_MEMBER(xmen_state::xmen_frame_r)
+READ_LINE_MEMBER(xmen_state::xmen_frame_r)
{
return m_screen->frame_number() & 1;
}
@@ -252,7 +252,7 @@ static INPUT_PORTS_START( xmen6p )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_START5 ) /* not verified */
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_START6 ) /* not verified */
PORT_SERVICE_NO_TOGGLE( 0x4000, IP_ACTIVE_LOW )
- PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xmen_state,xmen_frame_r, nullptr) /* screen indicator? */
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xmen_state, xmen_frame_r) // screen indicator?
PORT_START( "EEPROMOUT" )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, di_write)
diff --git a/src/mame/drivers/xxmissio.cpp b/src/mame/drivers/xxmissio.cpp
index fc3d551074a..5d54fc27d26 100644
--- a/src/mame/drivers/xxmissio.cpp
+++ b/src/mame/drivers/xxmissio.cpp
@@ -24,10 +24,10 @@ WRITE8_MEMBER(xxmissio_state::bank_sel_w)
membank("bank1")->set_entry(data & 7);
}
-CUSTOM_INPUT_MEMBER(xxmissio_state::status_r)
+template <int Mask>
+READ_LINE_MEMBER(xxmissio_state::status_r)
{
- int bit_mask = (uintptr_t)param;
- return (m_status & bit_mask) ? 1 : 0;
+ return (m_status & Mask) ? 1 : 0;
}
WRITE8_MEMBER(xxmissio_state::status_m_w)
@@ -208,14 +208,14 @@ static INPUT_PORTS_START( xxmissio )
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Shown as "Unused" in the manual */
PORT_START("STATUS")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state, status_r, (void *)0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xxmissio_state, status_r<0x01>)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state, status_r, (void *)0x04)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state, status_r, (void *)0x08)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state, status_r, (void *)0x10)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state, status_r, (void *)0x20)
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state, status_r, (void *)0x40)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state, status_r, (void *)0x80)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xxmissio_state, status_r<0x04>)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xxmissio_state, status_r<0x08>)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xxmissio_state, status_r<0x10>)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xxmissio_state, status_r<0x20>)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xxmissio_state, status_r<0x40>)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(xxmissio_state, status_r<0x80>)
INPUT_PORTS_END
/****************************************************************************/
diff --git a/src/mame/drivers/zaxxon.cpp b/src/mame/drivers/zaxxon.cpp
index e97815570a0..694b0a3fdf4 100644
--- a/src/mame/drivers/zaxxon.cpp
+++ b/src/mame/drivers/zaxxon.cpp
@@ -350,24 +350,24 @@ READ8_MEMBER(zaxxon_state::razmataz_counter_r)
}
+template <int Num>
CUSTOM_INPUT_MEMBER(zaxxon_state::razmataz_dial_r)
{
- int num = (uintptr_t)param;
int res;
- int delta = m_dials[num]->read();
+ int delta = m_dials[Num]->read();
if (delta < 0x80)
{
// right
- m_razmataz_dial_pos[num] -= delta;
- res = (m_razmataz_dial_pos[num] << 1) | 1;
+ m_razmataz_dial_pos[Num] -= delta;
+ res = (m_razmataz_dial_pos[Num] << 1) | 1;
}
else
{
// left
- m_razmataz_dial_pos[num] += delta;
- res = (m_razmataz_dial_pos[num] << 1);
+ m_razmataz_dial_pos[Num] += delta;
+ res = (m_razmataz_dial_pos[Num] << 1);
}
return res;
@@ -422,9 +422,10 @@ INPUT_CHANGED_MEMBER(zaxxon_state::zaxxon_coin_inserted)
}
-CUSTOM_INPUT_MEMBER(zaxxon_state::zaxxon_coin_r)
+template <int Num>
+READ_LINE_MEMBER(zaxxon_state::zaxxon_coin_r)
{
- return m_coin_status[(int)(uintptr_t)param];
+ return m_coin_status[Num];
}
@@ -535,9 +536,9 @@ static INPUT_PORTS_START( zaxxon )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,zaxxon_coin_r, (void *)0)
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,zaxxon_coin_r, (void *)1)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,zaxxon_coin_r, (void *)2)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(zaxxon_state, zaxxon_coin_r<0>)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(zaxxon_state, zaxxon_coin_r<1>)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(zaxxon_state, zaxxon_coin_r<2>)
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, zaxxon_state,zaxxon_coin_inserted, 0)
@@ -696,7 +697,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( razmataz )
PORT_START("SW00")
- PORT_BIT( 0xff, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,razmataz_dial_r, (void *)0)
+ PORT_BIT( 0xff, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(zaxxon_state, razmataz_dial_r<0>)
PORT_START("DIAL.0")
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_RESET PORT_PLAYER(1)
@@ -711,7 +712,7 @@ static INPUT_PORTS_START( razmataz )
PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("SW08")
- PORT_BIT( 0xff, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,razmataz_dial_r, (void *)1)
+ PORT_BIT( 0xff, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(zaxxon_state, razmataz_dial_r<1>)
PORT_START("DIAL.1")
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_RESET PORT_PLAYER(2)
@@ -724,9 +725,9 @@ static INPUT_PORTS_START( razmataz )
PORT_START("SW100")
PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,zaxxon_coin_r, (void *)0)
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,zaxxon_coin_r, (void *)1)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,zaxxon_coin_r, (void *)2)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(zaxxon_state, zaxxon_coin_r<0>)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(zaxxon_state, zaxxon_coin_r<1>)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(zaxxon_state, zaxxon_coin_r<2>)
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, zaxxon_state,zaxxon_coin_inserted, 0)
@@ -789,7 +790,7 @@ static INPUT_PORTS_START( ixion )
PORT_INCLUDE(zaxxon)
PORT_MODIFY("SW00")
- PORT_BIT( 0xff, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,razmataz_dial_r, (void *)0)
+ PORT_BIT( 0xff, 0x00, IPT_CUSTOM) PORT_CUSTOM_MEMBER(zaxxon_state, razmataz_dial_r<0>)
PORT_START("DIAL.0")
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_RESET
diff --git a/src/mame/drivers/zn.cpp b/src/mame/drivers/zn.cpp
index d2fb3176fda..34ac4c77a75 100644
--- a/src/mame/drivers/zn.cpp
+++ b/src/mame/drivers/zn.cpp
@@ -107,7 +107,7 @@ public:
void init_coh1000w();
void init_primrag2();
- DECLARE_CUSTOM_INPUT_MEMBER(jdredd_gun_mux_read);
+ DECLARE_READ_LINE_MEMBER(jdredd_gun_mux_r);
private:
template<int Chip> DECLARE_WRITE_LINE_MEMBER(cat702_dataout) { m_cat702_dataout[Chip] = state; update_sio0_rxd(); }
@@ -2037,7 +2037,7 @@ Notes:
* - Unpopulated DIP42 socket
*/
-CUSTOM_INPUT_MEMBER(zn_state::jdredd_gun_mux_read)
+READ_LINE_MEMBER(zn_state::jdredd_gun_mux_r)
{
return m_jdredd_gun_mux;
}
@@ -2892,7 +2892,7 @@ static INPUT_PORTS_START( jdredd )
PORT_BIT( 0x6f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("SERVICE")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, zn_state,jdredd_gun_mux_read, nullptr)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(zn_state, jdredd_gun_mux_r)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
diff --git a/src/mame/includes/8080bw.h b/src/mame/includes/8080bw.h
index 410afc2e340..fc7317155e9 100644
--- a/src/mame/includes/8080bw.h
+++ b/src/mame/includes/8080bw.h
@@ -80,10 +80,10 @@ public:
void init_attackfc();
void init_invrvnge();
- DECLARE_CUSTOM_INPUT_MEMBER(sflush_80_r);
+ DECLARE_READ_LINE_MEMBER(sflush_80_r);
uint8_t sflush_in0_r();
DECLARE_INPUT_CHANGED_MEMBER(claybust_gun_trigger);
- DECLARE_CUSTOM_INPUT_MEMBER(claybust_gun_on_r);
+ DECLARE_READ_LINE_MEMBER(claybust_gun_on_r);
private:
/* devices/memory pointers */
diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h
index 971c30fd287..304eba01c44 100644
--- a/src/mame/includes/amiga.h
+++ b/src/mame/includes/amiga.h
@@ -427,7 +427,7 @@ public:
TIMER_CALLBACK_MEMBER( amiga_blitter_proc );
void update_irqs();
- DECLARE_CUSTOM_INPUT_MEMBER( amiga_joystick_convert );
+ template <int P> DECLARE_CUSTOM_INPUT_MEMBER( amiga_joystick_convert );
DECLARE_CUSTOM_INPUT_MEMBER( floppy_drive_status );
DECLARE_WRITE_LINE_MEMBER( m68k_reset );
diff --git a/src/mame/includes/artmagic.h b/src/mame/includes/artmagic.h
index 67aaf477b7d..2256d3ce787 100644
--- a/src/mame/includes/artmagic.h
+++ b/src/mame/includes/artmagic.h
@@ -67,7 +67,7 @@ public:
TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline);
- DECLARE_CUSTOM_INPUT_MEMBER(prot_r);
+ DECLARE_READ_LINE_MEMBER(prot_r);
void init_shtstar();
void init_cheesech();
void init_ultennis();
diff --git a/src/mame/includes/asteroid.h b/src/mame/includes/asteroid.h
index 42054d2c125..adb9d2b2f27 100644
--- a/src/mame/includes/asteroid.h
+++ b/src/mame/includes/asteroid.h
@@ -57,7 +57,7 @@ public:
DECLARE_WRITE8_MEMBER(earom_write);
DECLARE_WRITE8_MEMBER(earom_control_w);
- DECLARE_CUSTOM_INPUT_MEMBER(clock_r);
+ DECLARE_READ_LINE_MEMBER(clock_r);
INTERRUPT_GEN_MEMBER(asteroid_interrupt);
INTERRUPT_GEN_MEMBER(asterock_interrupt);
diff --git a/src/mame/includes/astrocde.h b/src/mame/includes/astrocde.h
index 6599ca5d384..8642e16d11b 100644
--- a/src/mame/includes/astrocde.h
+++ b/src/mame/includes/astrocde.h
@@ -159,7 +159,7 @@ public:
virtual void machine_start() override;
DECLARE_WRITE8_MEMBER(votrax_speech_w);
- CUSTOM_INPUT_MEMBER( votrax_speech_status_r );
+ DECLARE_READ_LINE_MEMBER( votrax_speech_status_r );
void astrocade_base(machine_config &config);
void astrocade_16color_base(machine_config &config);
diff --git a/src/mame/includes/btoads.h b/src/mame/includes/btoads.h
index bfbe88dd255..f52d244c833 100644
--- a/src/mame/includes/btoads.h
+++ b/src/mame/includes/btoads.h
@@ -34,8 +34,8 @@ public:
m_tlc34076(*this, "tlc34076"),
m_screen(*this, "screen") { }
- DECLARE_CUSTOM_INPUT_MEMBER( main_to_sound_r );
- DECLARE_CUSTOM_INPUT_MEMBER( sound_to_main_r );
+ DECLARE_READ_LINE_MEMBER( main_to_sound_r );
+ DECLARE_READ_LINE_MEMBER( sound_to_main_r );
void btoads(machine_config &config);
diff --git a/src/mame/includes/bwidow.h b/src/mame/includes/bwidow.h
index bf3148bc548..8484bc6e014 100644
--- a/src/mame/includes/bwidow.h
+++ b/src/mame/includes/bwidow.h
@@ -31,7 +31,8 @@ public:
void bwidow_audio(machine_config &config);
void gravitar_audio(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(clock_r);
+ DECLARE_READ_LINE_MEMBER(clock_r);
+
protected:
DECLARE_READ8_MEMBER(spacduel_IN3_r);
DECLARE_READ8_MEMBER(bwidowp_in_r);
diff --git a/src/mame/includes/bzone.h b/src/mame/includes/bzone.h
index b72ce44ca3a..daba24c6ec1 100644
--- a/src/mame/includes/bzone.h
+++ b/src/mame/includes/bzone.h
@@ -31,7 +31,7 @@ public:
m_startled(*this, "startled")
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(clock_r);
+ DECLARE_READ_LINE_MEMBER(clock_r);
void init_bradley();
void bzone(machine_config &config);
diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h
index 5420a40b8b8..14cc4ce1b8d 100644
--- a/src/mame/includes/cave.h
+++ b/src/mame/includes/cave.h
@@ -53,8 +53,8 @@ public:
, m_led_outputs(*this, "led%u", 0U)
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(korokoro_hopper_r);
- DECLARE_CUSTOM_INPUT_MEMBER(tjumpman_hopper_r);
+ DECLARE_READ_LINE_MEMBER(korokoro_hopper_r);
+ DECLARE_READ_LINE_MEMBER(tjumpman_hopper_r);
void init_uopoko();
void init_donpachi();
diff --git a/src/mame/includes/ccastles.h b/src/mame/includes/ccastles.h
index a9f04bf671a..9cbaad33aa5 100644
--- a/src/mame/includes/ccastles.h
+++ b/src/mame/includes/ccastles.h
@@ -32,7 +32,7 @@ public:
m_palette(*this, "palette")
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(get_vblank);
+ DECLARE_READ_LINE_MEMBER(vblank_r);
void ccastles(machine_config &config);
protected:
diff --git a/src/mame/includes/champbas.h b/src/mame/includes/champbas.h
index 299ef351881..b6bc976e0b9 100644
--- a/src/mame/includes/champbas.h
+++ b/src/mame/includes/champbas.h
@@ -36,7 +36,7 @@ public:
{
}
- DECLARE_CUSTOM_INPUT_MEMBER(watchdog_bit2);
+ DECLARE_READ_LINE_MEMBER(watchdog_bit2);
void init_champbas();
diff --git a/src/mame/includes/cischeat.h b/src/mame/includes/cischeat.h
index 947392938af..bfbd9d7f94e 100644
--- a/src/mame/includes/cischeat.h
+++ b/src/mame/includes/cischeat.h
@@ -39,17 +39,8 @@ public:
, m_palette(*this, "palette")
, m_soundlatch(*this, "soundlatch")
, m_soundlatch2(*this, "soundlatch2")
- , m_captflag_hopper(*this, "hopper")
- , m_captflag_motor_left(*this, "motor_left")
- , m_captflag_motor_right(*this, "motor_right")
- , m_oki1_bank(*this, "oki1_bank")
- , m_oki2_bank(*this, "oki2_bank")
, m_leds(*this, "led%u", 0U)
- {
- for (int side = 0; side < 2; ++side)
- m_captflag_motor_command[side] = m_captflag_motor_pos[side] = 0;
- m_captflag_leds = 0;
- }
+ {}
DECLARE_WRITE16_MEMBER(scudhamm_motor_command_w);
DECLARE_WRITE16_MEMBER(scudhamm_leds_w);
@@ -105,32 +96,17 @@ public:
void bigrun_draw_sprites(bitmap_ind16 &bitmap , const rectangle &cliprect, int priority1, int priority2);
void cischeat_untangle_sprites(const char *region);
- DECLARE_WRITE16_MEMBER(captflag_motor_command_right_w);
- DECLARE_WRITE16_MEMBER(captflag_motor_command_left_w);
- void captflag_motor_move(int side, uint16_t data);
- DECLARE_CUSTOM_INPUT_MEMBER(captflag_motor_busy_r);
- DECLARE_CUSTOM_INPUT_MEMBER(captflag_motor_pos_r);
- DECLARE_WRITE16_MEMBER(captflag_oki_bank_w);
-
- DECLARE_WRITE16_MEMBER(captflag_leds_w);
-
- void init_captflag();
- TIMER_DEVICE_CALLBACK_MEMBER(captflag_scanline);
void scudhamm(machine_config &config);
void armchmp2(machine_config &config);
void cischeat(machine_config &config);
void f1gpstr2(machine_config &config);
void f1gpstar(machine_config &config);
- void captflag(machine_config &config);
void bigrun(machine_config &config);
void armchmp2_map(address_map &map);
void bigrun_map(address_map &map);
void bigrun_map2(address_map &map);
void bigrun_map3(address_map &map);
void bigrun_sound_map(address_map &map);
- void captflag_map(address_map &map);
- void captflag_oki1_map(address_map &map);
- void captflag_oki2_map(address_map &map);
void cischeat_map(address_map &map);
void cischeat_map2(address_map &map);
void cischeat_map3(address_map &map);
@@ -184,18 +160,6 @@ protected:
optional_device<generic_latch_16_device> m_soundlatch;
optional_device<generic_latch_16_device> m_soundlatch2;
- // captflag
- optional_device<ticket_dispenser_device> m_captflag_hopper;
-
- optional_device<timer_device> m_captflag_motor_left;
- optional_device<timer_device> m_captflag_motor_right;
- uint16_t m_captflag_motor_command[2];
- uint16_t m_captflag_motor_pos[2];
-
- optional_memory_bank m_oki1_bank;
- optional_memory_bank m_oki2_bank;
-
- uint16_t m_captflag_leds;
output_finder<5> m_leds;
};
@@ -218,4 +182,52 @@ private:
uint16_t m_sprite_dma_reg;
};
+class captflag_state : public cischeat_state
+{
+public:
+ captflag_state(const machine_config &mconfig, device_type type, const char *tag)
+ : cischeat_state(mconfig, type, tag)
+ , m_hopper(*this, "hopper")
+ , m_motor_left(*this, "motor_left")
+ , m_motor_right(*this, "motor_right")
+ , m_oki1_bank(*this, "oki1_bank")
+ , m_oki2_bank(*this, "oki2_bank")
+ {
+ for (int side = 0; side < 2; ++side)
+ m_motor_command[side] = m_motor_pos[side] = 0;
+ m_captflag_leds = 0;
+ }
+
+ void captflag(machine_config &config);
+ template <int N> DECLARE_READ_LINE_MEMBER(motor_busy_r);
+ template <int N> DECLARE_CUSTOM_INPUT_MEMBER(motor_pos_r);
+ void init_captflag();
+
+private:
+ DECLARE_WRITE16_MEMBER(motor_command_right_w);
+ DECLARE_WRITE16_MEMBER(motor_command_left_w);
+ void motor_move(int side, uint16_t data);
+ DECLARE_WRITE16_MEMBER(oki_bank_w);
+
+ DECLARE_WRITE16_MEMBER(leds_w);
+
+ TIMER_DEVICE_CALLBACK_MEMBER(captflag_scanline);
+
+ void captflag_map(address_map &map);
+ void oki1_map(address_map &map);
+ void oki2_map(address_map &map);
+
+ required_device<ticket_dispenser_device> m_hopper;
+
+ required_device<timer_device> m_motor_left;
+ required_device<timer_device> m_motor_right;
+
+ required_memory_bank m_oki1_bank;
+ required_memory_bank m_oki2_bank;
+
+ uint16_t m_captflag_leds;
+ uint16_t m_motor_command[2];
+ uint16_t m_motor_pos[2];
+};
+
#endif
diff --git a/src/mame/includes/cloud9.h b/src/mame/includes/cloud9.h
index 8c9dc970317..bdbafab66c2 100644
--- a/src/mame/includes/cloud9.h
+++ b/src/mame/includes/cloud9.h
@@ -31,7 +31,7 @@ public:
m_videolatch(*this, "videolatch")
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(get_vblank);
+ DECLARE_READ_LINE_MEMBER(vblank_r);
void cloud9(machine_config &config);
protected:
diff --git a/src/mame/includes/cop01.h b/src/mame/includes/cop01.h
index d7bd67d3458..76617d41940 100644
--- a/src/mame/includes/cop01.h
+++ b/src/mame/includes/cop01.h
@@ -62,7 +62,7 @@ public:
DECLARE_WRITE8_MEMBER(prot_address_w);
DECLARE_WRITE8_MEMBER(prot_data_w);
DECLARE_READ8_MEMBER(prot_data_r);
- DECLARE_CUSTOM_INPUT_MEMBER(mightguy_area_r);
+ template <int Mask> DECLARE_READ_LINE_MEMBER(mightguy_area_r);
void init_mightguy();
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
diff --git a/src/mame/includes/dcheese.h b/src/mame/includes/dcheese.h
index 9b93ffada37..a3fa7728da1 100644
--- a/src/mame/includes/dcheese.h
+++ b/src/mame/includes/dcheese.h
@@ -36,8 +36,6 @@ public:
void fredmem(machine_config &config);
void dcheese(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(sound_latch_state_r);
-
protected:
enum
{
diff --git a/src/mame/includes/ddragon.h b/src/mame/includes/ddragon.h
index bf659d5dd82..236744281c9 100644
--- a/src/mame/includes/ddragon.h
+++ b/src/mame/includes/ddragon.h
@@ -55,7 +55,7 @@ public:
void init_ddragon();
void init_ddragon6809();
- DECLARE_CUSTOM_INPUT_MEMBER(subcpu_bus_free);
+ DECLARE_READ_LINE_MEMBER(subcpu_bus_free_r);
protected:
required_device<cpu_device> m_maincpu;
diff --git a/src/mame/includes/ddragon3.h b/src/mame/includes/ddragon3.h
index 686f77c26e5..579d4f51b31 100644
--- a/src/mame/includes/ddragon3.h
+++ b/src/mame/includes/ddragon3.h
@@ -118,7 +118,8 @@ public:
wwfwfest_state(const machine_config &mconfig, device_type type, const char *tag) :
ddragon3_state(mconfig, type, tag),
m_fg0_videoram(*this, "fg0_videoram"),
- m_paletteram(*this, "palette")
+ m_paletteram(*this, "palette"),
+ m_dsw(*this, "DSW%u", 1U)
{
vblank_level = 3;
raster_level = 2;
@@ -127,13 +128,14 @@ public:
void wwfwfest(machine_config &config);
void wwfwfstb(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(dsw_3f_r);
- DECLARE_CUSTOM_INPUT_MEMBER(dsw_c0_r);
+ template <int N> DECLARE_CUSTOM_INPUT_MEMBER(dsw_3f_r);
+ template <int N> DECLARE_CUSTOM_INPUT_MEMBER(dsw_c0_r);
private:
/* wwfwfest has an extra layer */
required_shared_ptr<uint16_t> m_fg0_videoram;
required_shared_ptr<uint16_t> m_paletteram;
+ required_ioport_array<2> m_dsw;
tilemap_t *m_fg0_tilemap;
DECLARE_WRITE16_MEMBER(wwfwfest_fg0_videoram_w);
diff --git a/src/mame/includes/eolith.h b/src/mame/includes/eolith.h
index 82e8a035386..27a19b6a9d9 100644
--- a/src/mame/includes/eolith.h
+++ b/src/mame/includes/eolith.h
@@ -38,8 +38,8 @@ public:
void init_landbrka();
void init_landbrkb();
- DECLARE_CUSTOM_INPUT_MEMBER(eolith_speedup_getvblank);
- DECLARE_CUSTOM_INPUT_MEMBER(stealsee_speedup_getvblank);
+ DECLARE_READ_LINE_MEMBER(speedup_vblank_r);
+ DECLARE_READ_LINE_MEMBER(stealsee_speedup_vblank_r);
void speedup_read();
void init_speedup();
diff --git a/src/mame/includes/equites.h b/src/mame/includes/equites.h
index 139b6a1965e..8a98fd8e46f 100644
--- a/src/mame/includes/equites.h
+++ b/src/mame/includes/equites.h
@@ -143,7 +143,7 @@ class gekisou_state : public equites_state
{
public:
using equites_state::equites_state;
- DECLARE_CUSTOM_INPUT_MEMBER(gekisou_unknown_bit_r);
+ DECLARE_READ_LINE_MEMBER(gekisou_unknown_bit_r);
void bngotime(machine_config &config);
void gekisou(machine_config &config);
diff --git a/src/mame/includes/exidy440.h b/src/mame/includes/exidy440.h
index b44409785fe..af383dedcc5 100644
--- a/src/mame/includes/exidy440.h
+++ b/src/mame/includes/exidy440.h
@@ -31,8 +31,8 @@ public:
m_palette(*this, "palette")
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(firq_beam_r);
- DECLARE_CUSTOM_INPUT_MEMBER(firq_vblank_r);
+ DECLARE_READ_LINE_MEMBER(firq_beam_r);
+ DECLARE_READ_LINE_MEMBER(firq_vblank_r);
DECLARE_CUSTOM_INPUT_MEMBER(hitnmiss_button1_r);
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
void init_showdown();
@@ -98,7 +98,9 @@ private:
uint8_t m_firq_select;
uint8_t m_palettebank_io;
uint8_t m_palettebank_vis;
+ emu_timer *m_beam_firq_timer;
emu_timer *m_collide_firq_timer;
+ uint8_t m_beam_firq_count;
};
diff --git a/src/mame/includes/fantland.h b/src/mame/includes/fantland.h
index 3ffd2bd4750..6f7b3c56668 100644
--- a/src/mame/includes/fantland.h
+++ b/src/mame/includes/fantland.h
@@ -22,14 +22,15 @@ public:
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
m_spriteram(*this, "spriteram", 0),
- m_spriteram2(*this, "spriteram2", 0)
+ m_spriteram2(*this, "spriteram2", 0),
+ m_wheel(*this, "WHEEL%u", 0U)
{ }
void fantland(machine_config &config);
void wheelrun(machine_config &config);
void galaxygn(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(wheelrun_wheel_r);
+ template <int Player> DECLARE_CUSTOM_INPUT_MEMBER(wheelrun_wheel_r);
protected:
/* misc */
@@ -47,6 +48,8 @@ protected:
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<uint8_t> m_spriteram2;
+ optional_ioport_array<2> m_wheel;
+
DECLARE_WRITE8_MEMBER(nmi_enable_w);
DECLARE_WRITE8_MEMBER(soundlatch_w);
virtual void machine_start() override;
diff --git a/src/mame/includes/fgoal.h b/src/mame/includes/fgoal.h
index 5dd1ab62fef..b1f7063a411 100644
--- a/src/mame/includes/fgoal.h
+++ b/src/mame/includes/fgoal.h
@@ -24,7 +24,7 @@ public:
void fgoal(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(_80_r);
+ DECLARE_READ_LINE_MEMBER(_80_r);
protected:
enum
diff --git a/src/mame/includes/firetrk.h b/src/mame/includes/firetrk.h
index 447e7cb6e98..9e29dcce7f2 100644
--- a/src/mame/includes/firetrk.h
+++ b/src/mame/includes/firetrk.h
@@ -73,11 +73,11 @@ public:
void montecar(machine_config &config);
void superbug(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(steer_dir_r);
- DECLARE_CUSTOM_INPUT_MEMBER(steer_flag_r);
- DECLARE_CUSTOM_INPUT_MEMBER(skid_r);
- DECLARE_CUSTOM_INPUT_MEMBER(crash_r);
- DECLARE_CUSTOM_INPUT_MEMBER(gear_r);
+ template <int P> DECLARE_READ_LINE_MEMBER(steer_dir_r);
+ template <int P> DECLARE_READ_LINE_MEMBER(steer_flag_r);
+ template <int P> DECLARE_READ_LINE_MEMBER(skid_r);
+ template <int P> DECLARE_READ_LINE_MEMBER(crash_r);
+ template <int P> DECLARE_READ_LINE_MEMBER(gear_r);
DECLARE_INPUT_CHANGED_MEMBER(service_mode_switch_changed);
DECLARE_INPUT_CHANGED_MEMBER(firetrk_horn_changed);
DECLARE_INPUT_CHANGED_MEMBER(gear_changed);
diff --git a/src/mame/includes/fromanc2.h b/src/mame/includes/fromanc2.h
index 627dabf0362..c9ac17a0394 100644
--- a/src/mame/includes/fromanc2.h
+++ b/src/mame/includes/fromanc2.h
@@ -35,9 +35,9 @@ public:
void init_fromanc4();
void init_fromanc2();
- DECLARE_CUSTOM_INPUT_MEMBER(subcpu_int_r);
- DECLARE_CUSTOM_INPUT_MEMBER(sndcpu_nmi_r);
- DECLARE_CUSTOM_INPUT_MEMBER(subcpu_nmi_r);
+ DECLARE_READ_LINE_MEMBER(subcpu_int_r);
+ DECLARE_READ_LINE_MEMBER(sndcpu_nmi_r);
+ DECLARE_READ_LINE_MEMBER(subcpu_nmi_r);
private:
/* memory pointers */
diff --git a/src/mame/includes/gaelco2.h b/src/mame/includes/gaelco2.h
index a4a3de25b8b..e33d05831c3 100644
--- a/src/mame/includes/gaelco2.h
+++ b/src/mame/includes/gaelco2.h
@@ -149,7 +149,7 @@ public:
void wrally2(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(wrally2_analog_bit_r);
+ template <int N> DECLARE_READ_LINE_MEMBER(wrally2_analog_bit_r);
private:
required_ioport m_analog0;
diff --git a/src/mame/includes/gaelco3d.h b/src/mame/includes/gaelco3d.h
index f69298b3653..6d0f4dc8eb4 100644
--- a/src/mame/includes/gaelco3d.h
+++ b/src/mame/includes/gaelco3d.h
@@ -56,8 +56,8 @@ public:
void gaelco3d2(machine_config &config);
void gaelco3d(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(analog_bit_r);
- DECLARE_CUSTOM_INPUT_MEMBER(fp_analog_bit_r);
+ template <int N> DECLARE_READ_LINE_MEMBER(analog_bit_r);
+ template <int N> DECLARE_READ_LINE_MEMBER(fp_analog_bit_r);
private:
virtual void machine_start() override;
diff --git a/src/mame/includes/galastrm.h b/src/mame/includes/galastrm.h
index ebdd626e48b..f7f96a6a8ba 100644
--- a/src/mame/includes/galastrm.h
+++ b/src/mame/includes/galastrm.h
@@ -57,7 +57,7 @@ public:
{ }
void galastrm(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(frame_counter_r);
+ DECLARE_READ_LINE_MEMBER(frame_counter_r);
protected:
virtual void video_start() override;
diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h
index c21573a4123..d8a0a9bf26e 100644
--- a/src/mame/includes/galaxian.h
+++ b/src/mame/includes/galaxian.h
@@ -100,10 +100,9 @@ public:
DECLARE_WRITE8_MEMBER(scramble_background_green_w);
DECLARE_WRITE8_MEMBER(scramble_background_blue_w);
DECLARE_WRITE8_MEMBER(galaxian_gfxbank_w);
- DECLARE_CUSTOM_INPUT_MEMBER(gmgalax_port_r);
- DECLARE_CUSTOM_INPUT_MEMBER(azurian_port_r);
- DECLARE_CUSTOM_INPUT_MEMBER(kingball_muxbit_r);
- DECLARE_CUSTOM_INPUT_MEMBER(kingball_noise_r);
+ template <int N> DECLARE_READ_LINE_MEMBER(azurian_port_r);
+ DECLARE_READ_LINE_MEMBER(kingball_muxbit_r);
+ DECLARE_READ_LINE_MEMBER(kingball_noise_r);
DECLARE_CUSTOM_INPUT_MEMBER(moonwar_dial_r);
DECLARE_WRITE8_MEMBER(irq_enable_w);
DECLARE_WRITE8_MEMBER(start_lamp_w);
@@ -117,7 +116,7 @@ public:
DECLARE_WRITE8_MEMBER(theend_ppi8255_w);
DECLARE_WRITE8_MEMBER(theend_protection_w);
DECLARE_READ8_MEMBER(theend_protection_r);
- DECLARE_CUSTOM_INPUT_MEMBER(theend_protection_alt_r);
+ template <int N> DECLARE_READ_LINE_MEMBER(theend_protection_alt_r);
DECLARE_WRITE8_MEMBER(explorer_sound_control_w);
DECLARE_READ8_MEMBER(sfx_sample_io_r);
DECLARE_WRITE8_MEMBER(sfx_sample_io_w);
@@ -159,7 +158,6 @@ public:
DECLARE_WRITE8_MEMBER(froggeram_ppi8255_w);
DECLARE_WRITE8_MEMBER(artic_gfxbank_w);
DECLARE_READ8_MEMBER(tenspot_dsw_read);
- DECLARE_INPUT_CHANGED_MEMBER(gmgalax_game_changed);
DECLARE_WRITE8_MEMBER(konami_sound_control_w);
DECLARE_READ8_MEMBER(konami_sound_timer_r);
DECLARE_WRITE8_MEMBER(konami_portc_0_w);
@@ -181,7 +179,6 @@ public:
void init_galaxian();
void init_nolock();
void init_azurian();
- void init_gmgalax();
void init_pisces();
void init_batman2();
void init_frogg();
@@ -315,7 +312,6 @@ public:
void pacmanbl(machine_config &config);
void quaak(machine_config &config);
void galaxian(machine_config &config);
- void gmgalax(machine_config &config);
void tenspot(machine_config &config);
void froggers(machine_config &config);
void froggervd(machine_config &config);
@@ -442,7 +438,6 @@ protected:
int m_numspritegens;
int m_counter_74ls161[2];
int m_direction[2];
- uint8_t m_gmgalax_selected_game;
uint8_t m_zigzag_ay8910_latch;
uint8_t m_kingball_speech_dip;
uint8_t m_kingball_sound;
@@ -490,4 +485,26 @@ protected:
void videight_map(address_map &map);
};
+class gmgalax_state : public galaxian_state
+{
+public:
+ gmgalax_state(const machine_config &mconfig, device_type type, const char *tag)
+ : galaxian_state(mconfig, type, tag)
+ , m_glin(*this, "GLIN%u", 0U)
+ , m_gmin(*this, "GMIN%u", 0U)
+ { }
+
+ void gmgalax(machine_config &config);
+
+ DECLARE_INPUT_CHANGED_MEMBER(game_changed);
+ template <int N> DECLARE_CUSTOM_INPUT_MEMBER(port_r);
+
+ void init_gmgalax();
+
+private:
+ uint8_t m_selected_game;
+ required_ioport_array<3> m_glin;
+ required_ioport_array<3> m_gmin;
+};
+
#endif // MAME_INCLUDES_GALAXIAN_H
diff --git a/src/mame/includes/galaxold.h b/src/mame/includes/galaxold.h
index 3a098047430..b0ae0dd4ba8 100644
--- a/src/mame/includes/galaxold.h
+++ b/src/mame/includes/galaxold.h
@@ -156,10 +156,10 @@ public:
DECLARE_WRITE_LINE_MEMBER(galaxold_7474_9m_2_q_callback);
DECLARE_WRITE_LINE_MEMBER(galaxold_7474_9m_1_callback);
DECLARE_READ8_MEMBER(rescueb_a002_r) { return 0xfc; }
- DECLARE_CUSTOM_INPUT_MEMBER(_4in1_fake_port_r);
- DECLARE_CUSTOM_INPUT_MEMBER(vpool_lives_r);
- DECLARE_CUSTOM_INPUT_MEMBER(ckongg_coinage_r);
- DECLARE_CUSTOM_INPUT_MEMBER(dkongjrm_coinage_r);
+ template <int Mask> DECLARE_READ_LINE_MEMBER(_4in1_fake_port_r);
+ template <int Mask> DECLARE_READ_LINE_MEMBER(vpool_lives_r);
+ template <int Mask> DECLARE_CUSTOM_INPUT_MEMBER(ckongg_coinage_r);
+ template <int Mask> DECLARE_CUSTOM_INPUT_MEMBER(dkongjrm_coinage_r);
void init_bullsdrtg();
void init_ladybugg();
diff --git a/src/mame/includes/gottlieb.h b/src/mame/includes/gottlieb.h
index f0c86f5f0a9..36d6d76411b 100644
--- a/src/mame/includes/gottlieb.h
+++ b/src/mame/includes/gottlieb.h
@@ -69,7 +69,7 @@ public:
void init_qbert();
void init_qbertqub();
- DECLARE_CUSTOM_INPUT_MEMBER(analog_delta_r);
+ template <int N> DECLARE_CUSTOM_INPUT_MEMBER(track_delta_r);
DECLARE_CUSTOM_INPUT_MEMBER(stooges_joystick_r);
private:
diff --git a/src/mame/includes/homerun.h b/src/mame/includes/homerun.h
index 0b953c267df..d2ffeef345f 100644
--- a/src/mame/includes/homerun.h
+++ b/src/mame/includes/homerun.h
@@ -32,9 +32,9 @@ public:
void dynashot(machine_config &config);
void homerun(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(sprite0_r);
- DECLARE_CUSTOM_INPUT_MEMBER(homerun_d7756_busy_r);
- DECLARE_CUSTOM_INPUT_MEMBER(ganjaja_d7756_busy_r);
+ DECLARE_READ_LINE_MEMBER(sprite0_r);
+ DECLARE_READ_LINE_MEMBER(homerun_d7756_busy_r);
+ DECLARE_READ_LINE_MEMBER(ganjaja_d7756_busy_r);
DECLARE_CUSTOM_INPUT_MEMBER(ganjaja_hopper_status_r);
protected:
diff --git a/src/mame/includes/inufuku.h b/src/mame/includes/inufuku.h
index 6986ee213ba..9c3459be9fd 100644
--- a/src/mame/includes/inufuku.h
+++ b/src/mame/includes/inufuku.h
@@ -28,7 +28,7 @@ public:
void inufuku(machine_config &config);
void _3on3dunk(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(soundflag_r);
+ DECLARE_READ_LINE_MEMBER(soundflag_r);
private:
/* memory pointers */
diff --git a/src/mame/includes/itech32.h b/src/mame/includes/itech32.h
index 0dd727808d0..5db212c2ba3 100644
--- a/src/mame/includes/itech32.h
+++ b/src/mame/includes/itech32.h
@@ -75,7 +75,7 @@ public:
void init_gt3d();
void init_gt3dl();
- DECLARE_CUSTOM_INPUT_MEMBER(special_port_r);
+ DECLARE_READ_LINE_MEMBER(special_port_r);
protected:
required_device<cpu_device> m_maincpu;
diff --git a/src/mame/includes/itech8.h b/src/mame/includes/itech8.h
index 32b889bfe10..13e4ca70bf2 100644
--- a/src/mame/includes/itech8.h
+++ b/src/mame/includes/itech8.h
@@ -34,6 +34,8 @@ public:
m_an(*this, { { "AN_C", "AN_D", "AN_E", "AN_F" } }),
m_fakex(*this, "FAKEX"),
m_fakey(*this, "FAKEY"),
+ m_p1(*this, "P1"),
+ m_p2(*this, "P2"),
m_visarea(0, 0, 0, 0),
m_bankxor(0)
{}
@@ -58,7 +60,7 @@ public:
void init_arligntn();
void init_hstennis();
- DECLARE_CUSTOM_INPUT_MEMBER(special_r);
+ DECLARE_READ_LINE_MEMBER(special_r);
DECLARE_CUSTOM_INPUT_MEMBER(gtg_mux);
protected:
@@ -89,6 +91,8 @@ protected:
optional_ioport_array<4> m_an;
optional_ioport m_fakex;
optional_ioport m_fakey;
+ optional_ioport m_p1;
+ optional_ioport m_p2;
rectangle m_visarea;
diff --git a/src/mame/includes/m92.h b/src/mame/includes/m92.h
index bf057b6c95e..70cfe455663 100644
--- a/src/mame/includes/m92.h
+++ b/src/mame/includes/m92.h
@@ -72,7 +72,7 @@ public:
void init_bank();
- DECLARE_CUSTOM_INPUT_MEMBER(m92_sprite_busy_r);
+ DECLARE_READ_LINE_MEMBER(sprite_busy_r);
private:
required_device<buffered_spriteram16_device> m_spriteram;
diff --git a/src/mame/includes/metro.h b/src/mame/includes/metro.h
index 37c8f9b2c1e..214020bab22 100644
--- a/src/mame/includes/metro.h
+++ b/src/mame/includes/metro.h
@@ -96,7 +96,7 @@ public:
void init_metro();
void init_lastfortg();
- DECLARE_CUSTOM_INPUT_MEMBER(custom_soundstatus_r);
+ DECLARE_READ_LINE_MEMBER(custom_soundstatus_r);
private:
enum
diff --git a/src/mame/includes/mhavoc.h b/src/mame/includes/mhavoc.h
index d2653a0def9..949949ecc2e 100644
--- a/src/mame/includes/mhavoc.h
+++ b/src/mame/includes/mhavoc.h
@@ -32,7 +32,9 @@ public:
m_gamma(*this, "gamma"),
m_pokey(*this, "pokey%u", 1U),
m_tms(*this, "tms"),
- m_lamps(*this, "lamp%u", 0U)
+ m_lamps(*this, "lamp%u", 0U),
+ m_coin(*this, "COIN"),
+ m_service(*this, "SERVICE")
{ }
void alphaone(machine_config &config);
@@ -41,13 +43,12 @@ public:
void init_mhavocrv();
- DECLARE_CUSTOM_INPUT_MEMBER(tms5220_r);
- DECLARE_CUSTOM_INPUT_MEMBER(mhavoc_bit67_r);
- DECLARE_CUSTOM_INPUT_MEMBER(gamma_rcvd_r);
- DECLARE_CUSTOM_INPUT_MEMBER(gamma_xmtd_r);
- DECLARE_CUSTOM_INPUT_MEMBER(alpha_rcvd_r);
- DECLARE_CUSTOM_INPUT_MEMBER(alpha_xmtd_r);
- DECLARE_CUSTOM_INPUT_MEMBER(clock_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(coin_service_r);
+ DECLARE_READ_LINE_MEMBER(gamma_rcvd_r);
+ DECLARE_READ_LINE_MEMBER(gamma_xmtd_r);
+ DECLARE_READ_LINE_MEMBER(alpha_rcvd_r);
+ DECLARE_READ_LINE_MEMBER(alpha_xmtd_r);
+ DECLARE_READ_LINE_MEMBER(clock_r);
private:
DECLARE_READ8_MEMBER(dual_pokey_r);
@@ -84,6 +85,9 @@ private:
optional_device_array<pokey_device, 4> m_pokey;
optional_device<tms5220_device> m_tms;
output_finder<2> m_lamps;
+ optional_ioport m_coin;
+ optional_ioport m_service;
+
uint8_t m_alpha_data;
uint8_t m_alpha_rcvd;
uint8_t m_alpha_xmtd;
diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h
index 96053772ac8..20e802c9d1c 100644
--- a/src/mame/includes/micro3d.h
+++ b/src/mame/includes/micro3d.h
@@ -58,7 +58,7 @@ public:
void init_micro3d();
void init_botss();
- DECLARE_CUSTOM_INPUT_MEMBER(botss_hwchk_r);
+ DECLARE_READ_LINE_MEMBER(botss_hwchk_r);
protected:
enum
diff --git a/src/mame/includes/midyunit.h b/src/mame/includes/midyunit.h
index 9ac1c12b539..7e6b531bd1d 100644
--- a/src/mame/includes/midyunit.h
+++ b/src/mame/includes/midyunit.h
@@ -68,9 +68,9 @@ public:
void init_mkyturbo();
void init_term2la2();
- DECLARE_CUSTOM_INPUT_MEMBER(narc_talkback_strobe_r);
+ DECLARE_READ_LINE_MEMBER(narc_talkback_strobe_r);
DECLARE_CUSTOM_INPUT_MEMBER(narc_talkback_data_r);
- DECLARE_CUSTOM_INPUT_MEMBER(adpcm_irq_state_r);
+ DECLARE_READ_LINE_MEMBER(adpcm_irq_state_r);
private:
/* protection data types */
diff --git a/src/mame/includes/namcos22.h b/src/mame/includes/namcos22.h
index 398385c3cb8..c1c4a0fb27e 100644
--- a/src/mame/includes/namcos22.h
+++ b/src/mame/includes/namcos22.h
@@ -533,7 +533,7 @@ public:
void init_alpiner();
void init_alpinesa();
- DECLARE_CUSTOM_INPUT_MEMBER(alpine_motor_read);
+ template <int N> DECLARE_READ_LINE_MEMBER(alpine_motor_r);
protected:
virtual void machine_start() override;
diff --git a/src/mame/includes/naomi.h b/src/mame/includes/naomi.h
index 8486f35e6fa..11160f45f98 100644
--- a/src/mame/includes/naomi.h
+++ b/src/mame/includes/naomi.h
@@ -43,7 +43,8 @@ class naomi_state : public dc_state
naomi_state(const machine_config &mconfig, device_type type, const char *tag)
: dc_state(mconfig, type, tag),
m_eeprom(*this, "main_eeprom"),
- m_rombase(*this, "rombase")
+ m_rombase(*this, "rombase"),
+ m_mp(*this, "KEY%u", 1U)
{ }
void naomi_base(machine_config &config);
@@ -66,6 +67,7 @@ class naomi_state : public dc_state
void init_naomi_mp();
DECLARE_CUSTOM_INPUT_MEMBER(naomi_mp_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(suchie3_mp_r);
DECLARE_CUSTOM_INPUT_MEMBER(naomi_kb_r);
DECLARE_INPUT_CHANGED_MEMBER(naomi_mp_w);
@@ -74,6 +76,7 @@ class naomi_state : public dc_state
protected:
required_device<eeprom_serial_93cxx_device> m_eeprom;
optional_shared_ptr<uint64_t> m_rombase;
+ optional_ioport_array<5> m_mp;
DECLARE_MACHINE_RESET(naomi);
diff --git a/src/mame/includes/nbmj8891.h b/src/mame/includes/nbmj8891.h
index b1dd9640600..4896972bad2 100644
--- a/src/mame/includes/nbmj8891.h
+++ b/src/mame/includes/nbmj8891.h
@@ -63,7 +63,7 @@ public:
void init_pairsnb();
void init_mjnanpas();
- DECLARE_CUSTOM_INPUT_MEMBER(nb1413m3_outcoin_flag_r);
+ DECLARE_READ_LINE_MEMBER(nb1413m3_outcoin_flag_r);
private:
required_device<cpu_device> m_maincpu;
diff --git a/src/mame/includes/niyanpai.h b/src/mame/includes/niyanpai.h
index 3f3a73be2ba..aeb56fcf22f 100644
--- a/src/mame/includes/niyanpai.h
+++ b/src/mame/includes/niyanpai.h
@@ -25,7 +25,7 @@ public:
void init_niyanpai();
- DECLARE_CUSTOM_INPUT_MEMBER(musobana_outcoin_flag_r);
+ DECLARE_READ_LINE_MEMBER(musobana_outcoin_flag_r);
private:
enum
diff --git a/src/mame/includes/phoenix.h b/src/mame/includes/phoenix.h
index 05c8dce06cb..45bae1ca4a7 100644
--- a/src/mame/includes/phoenix.h
+++ b/src/mame/includes/phoenix.h
@@ -29,7 +29,7 @@ public:
DECLARE_WRITE8_MEMBER(phoenix_scroll_w);
DECLARE_READ8_MEMBER(survival_input_port_0_r);
DECLARE_CUSTOM_INPUT_MEMBER(player_input_r);
- DECLARE_CUSTOM_INPUT_MEMBER(pleiads_protection_r);
+ DECLARE_READ_LINE_MEMBER(pleiads_protection_r);
void init_oneprom();
void init_coindsw();
void init_oneprom_coindsw();
diff --git a/src/mame/includes/pirates.h b/src/mame/includes/pirates.h
index fc6133d51dc..2a47a3cbb2c 100644
--- a/src/mame/includes/pirates.h
+++ b/src/mame/includes/pirates.h
@@ -32,7 +32,7 @@ public:
void init_pirates();
void init_genix();
- DECLARE_CUSTOM_INPUT_MEMBER(prot_r);
+ DECLARE_READ_LINE_MEMBER(prot_r);
private:
required_device<cpu_device> m_maincpu;
diff --git a/src/mame/includes/playch10.h b/src/mame/includes/playch10.h
index 6a1efd3072b..9c300ce4866 100644
--- a/src/mame/includes/playch10.h
+++ b/src/mame/includes/playch10.h
@@ -52,7 +52,7 @@ public:
void init_pckboard();
void init_pc_hrz();
- DECLARE_CUSTOM_INPUT_MEMBER(pc10_int_detect_r);
+ DECLARE_READ_LINE_MEMBER(int_detect_r);
private:
DECLARE_WRITE_LINE_MEMBER(up8w_w);
diff --git a/src/mame/includes/polepos.h b/src/mame/includes/polepos.h
index 1bf2f37aa84..af7dde9f267 100644
--- a/src/mame/includes/polepos.h
+++ b/src/mame/includes/polepos.h
@@ -40,7 +40,7 @@ public:
m_palette(*this, "palette")
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(auto_start_r);
+ DECLARE_READ_LINE_MEMBER(auto_start_r);
void init_polepos2();
diff --git a/src/mame/includes/policetr.h b/src/mame/includes/policetr.h
index 91721667693..4a6cadd1086 100644
--- a/src/mame/includes/policetr.h
+++ b/src/mame/includes/policetr.h
@@ -25,7 +25,7 @@ public:
void driver_init() override;
- DECLARE_CUSTOM_INPUT_MEMBER(bsmt_status_r);
+ DECLARE_READ_LINE_MEMBER(bsmt_status_r);
protected:
policetr_state(const machine_config &mconfig, device_type type, const char *tag, uint32_t speedup_pc, uint32_t speedup_addr) :
diff --git a/src/mame/includes/popeye.h b/src/mame/includes/popeye.h
index 30954700aad..de3d341a735 100644
--- a/src/mame/includes/popeye.h
+++ b/src/mame/includes/popeye.h
@@ -28,8 +28,8 @@ public:
m_color_prom_spr(*this, "sprpal")
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(dsw1_read);
- DECLARE_CUSTOM_INPUT_MEMBER(pop_field_r);
+ DECLARE_READ_LINE_MEMBER(dsw1_read);
+ DECLARE_READ_LINE_MEMBER(pop_field_r);
virtual void config(machine_config &config);
diff --git a/src/mame/includes/psikyo.h b/src/mame/includes/psikyo.h
index 9f9e0815e58..d16e50509ba 100644
--- a/src/mame/includes/psikyo.h
+++ b/src/mame/includes/psikyo.h
@@ -59,8 +59,8 @@ public:
void init_tengai();
void init_gunbird();
- DECLARE_CUSTOM_INPUT_MEMBER(z80_nmi_r);
- DECLARE_CUSTOM_INPUT_MEMBER(mcu_status_r);
+ DECLARE_READ_LINE_MEMBER(z80_nmi_r);
+ DECLARE_READ_LINE_MEMBER(mcu_status_r);
private:
/* memory pointers */
diff --git a/src/mame/includes/psikyo4.h b/src/mame/includes/psikyo4.h
index a9540ac5946..f6b0e48f207 100644
--- a/src/mame/includes/psikyo4.h
+++ b/src/mame/includes/psikyo4.h
@@ -37,7 +37,7 @@ public:
void ps4small(machine_config &config);
DECLARE_CUSTOM_INPUT_MEMBER(system_r);
- DECLARE_CUSTOM_INPUT_MEMBER(mahjong_ctrl_r);
+ template <int P> DECLARE_CUSTOM_INPUT_MEMBER(mahjong_ctrl_r);
private:
/* memory pointers */
diff --git a/src/mame/includes/scramble.h b/src/mame/includes/scramble.h
index d7a6745d972..a57266e9d2e 100644
--- a/src/mame/includes/scramble.h
+++ b/src/mame/includes/scramble.h
@@ -24,7 +24,8 @@ public:
m_tmsprom(*this, "tmsprom"),
m_soundram(*this, "soundram"),
m_digitalker(*this, "digitalker"),
- m_soundlatch(*this, "soundlatch")
+ m_soundlatch(*this, "soundlatch"),
+ m_dial(*this, "DIAL")
{
}
@@ -36,8 +37,10 @@ public:
optional_device<digitalker_device> m_digitalker;
required_device<generic_latch_8_device> m_soundlatch;
- DECLARE_CUSTOM_INPUT_MEMBER(darkplnt_custom_r);
- DECLARE_CUSTOM_INPUT_MEMBER(ckongs_coinage_r);
+ optional_ioport m_dial;
+
+ DECLARE_CUSTOM_INPUT_MEMBER(darkplnt_dial_r);
+ template <int Mask> DECLARE_READ_LINE_MEMBER(ckongs_coinage_r);
DECLARE_READ8_MEMBER(hncholms_prot_r);
DECLARE_READ8_MEMBER(scramble_soundram_r);
DECLARE_READ8_MEMBER(mars_ppi8255_0_r);
diff --git a/src/mame/includes/segag80v.h b/src/mame/includes/segag80v.h
index 15c35e03917..ca0430a995f 100644
--- a/src/mame/includes/segag80v.h
+++ b/src/mame/includes/segag80v.h
@@ -45,7 +45,7 @@ public:
void init_spacfury();
DECLARE_INPUT_CHANGED_MEMBER(service_switch);
- DECLARE_CUSTOM_INPUT_MEMBER(elim4_joint_coin_r);
+ DECLARE_READ_LINE_MEMBER(elim4_joint_coin_r);
private:
required_shared_ptr<uint8_t> m_mainram;
diff --git a/src/mame/includes/seibuspi.h b/src/mame/includes/seibuspi.h
index f0ccdc21003..3d31ba14f52 100644
--- a/src/mame/includes/seibuspi.h
+++ b/src/mame/includes/seibuspi.h
@@ -52,7 +52,7 @@ public:
void init_ejanhs();
void init_sys386f();
- DECLARE_CUSTOM_INPUT_MEMBER(ejanhs_encode);
+ template <int N> DECLARE_CUSTOM_INPUT_MEMBER(ejanhs_encode);
IRQ_CALLBACK_MEMBER(spi_irq_callback);
INTERRUPT_GEN_MEMBER(spi_interrupt);
diff --git a/src/mame/includes/snk.h b/src/mame/includes/snk.h
index 928f44eda8f..b37f68e3810 100644
--- a/src/mame/includes/snk.h
+++ b/src/mame/includes/snk.h
@@ -63,13 +63,12 @@ public:
void sgladiat(machine_config &config);
void madcrush(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(marvins_sound_busy);
- DECLARE_CUSTOM_INPUT_MEMBER(snk_sound_busy);
- DECLARE_CUSTOM_INPUT_MEMBER(gwar_rotary);
- DECLARE_CUSTOM_INPUT_MEMBER(gwarb_rotary);
+ DECLARE_READ_LINE_MEMBER(sound_busy_r);
+ template <int Which> DECLARE_CUSTOM_INPUT_MEMBER(gwar_rotary);
+ template <int Which> DECLARE_CUSTOM_INPUT_MEMBER(gwarb_rotary);
DECLARE_CUSTOM_INPUT_MEMBER(countryc_trackball_x);
DECLARE_CUSTOM_INPUT_MEMBER(countryc_trackball_y);
- DECLARE_CUSTOM_INPUT_MEMBER(snk_bonus_r);
+ template <int Mask> DECLARE_CUSTOM_INPUT_MEMBER(snk_bonus_r);
private:
required_device<cpu_device> m_maincpu;
diff --git a/src/mame/includes/spdodgeb.h b/src/mame/includes/spdodgeb.h
index 9de7b4407bb..2c1e32a5c20 100644
--- a/src/mame/includes/spdodgeb.h
+++ b/src/mame/includes/spdodgeb.h
@@ -36,7 +36,7 @@ public:
void spdodgeb(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(mcu63705_busy_r);
+ DECLARE_READ_LINE_MEMBER(mcu63705_busy_r);
protected:
virtual void machine_start() override;
diff --git a/src/mame/includes/sprint4.h b/src/mame/includes/sprint4.h
index 802a0db5d88..ee7aa3dbe44 100644
--- a/src/mame/includes/sprint4.h
+++ b/src/mame/includes/sprint4.h
@@ -32,9 +32,9 @@ public:
void sprint4(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(get_lever);
- DECLARE_CUSTOM_INPUT_MEMBER(get_wheel);
- DECLARE_CUSTOM_INPUT_MEMBER(get_collision);
+ template <int N> DECLARE_READ_LINE_MEMBER(lever_r);
+ template <int N> DECLARE_READ_LINE_MEMBER(wheel_r);
+ template <int N> DECLARE_READ_LINE_MEMBER(collision_flipflop_r);
private:
DECLARE_READ8_MEMBER(wram_r);
diff --git a/src/mame/includes/stactics.h b/src/mame/includes/stactics.h
index bb9ed627e85..021300e3936 100644
--- a/src/mame/includes/stactics.h
+++ b/src/mame/includes/stactics.h
@@ -43,10 +43,10 @@ public:
void stactics(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(get_frame_count_d3);
- DECLARE_CUSTOM_INPUT_MEMBER(get_shot_standby);
- DECLARE_CUSTOM_INPUT_MEMBER(get_not_shot_arrive);
- DECLARE_CUSTOM_INPUT_MEMBER(get_motor_not_ready);
+ DECLARE_READ_LINE_MEMBER(frame_count_d3_r);
+ DECLARE_READ_LINE_MEMBER(shot_standby_r);
+ DECLARE_READ_LINE_MEMBER(not_shot_arrive_r);
+ DECLARE_READ_LINE_MEMBER(motor_not_ready_r);
DECLARE_CUSTOM_INPUT_MEMBER(get_rng);
private:
diff --git a/src/mame/includes/starwars.h b/src/mame/includes/starwars.h
index 7177faab06d..ec1cd37a17b 100644
--- a/src/mame/includes/starwars.h
+++ b/src/mame/includes/starwars.h
@@ -41,7 +41,7 @@ public:
void init_esb();
void init_starwars();
- DECLARE_CUSTOM_INPUT_MEMBER(matrix_flag_r);
+ DECLARE_READ_LINE_MEMBER(matrix_flag_r);
private:
required_device<generic_latch_8_device> m_soundlatch;
diff --git a/src/mame/includes/superqix.h b/src/mame/includes/superqix.h
index deea3f3b15b..1a44b4639c4 100644
--- a/src/mame/includes/superqix.h
+++ b/src/mame/includes/superqix.h
@@ -93,8 +93,8 @@ public:
void sqix_8031(machine_config &config);
void sqix_nomcu(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(fromz80_semaphore_input_r);
- DECLARE_CUSTOM_INPUT_MEMBER(frommcu_semaphore_input_r);
+ DECLARE_READ_LINE_MEMBER(fromz80_semaphore_input_r);
+ DECLARE_READ_LINE_MEMBER(frommcu_semaphore_input_r);
protected:
virtual void machine_start() override;
diff --git a/src/mame/includes/suprnova.h b/src/mame/includes/suprnova.h
index cd64317a0c1..be618fb2d57 100644
--- a/src/mame/includes/suprnova.h
+++ b/src/mame/includes/suprnova.h
@@ -45,7 +45,9 @@ public:
m_palette_ram(*this, "palette_ram"),
m_v3t_ram(*this, "v3t_ram"),
m_main_ram(*this, "main_ram"),
- m_cache_ram(*this, "cache_ram") { }
+ m_cache_ram(*this, "cache_ram"),
+ m_paddle(*this, "Paddle %c", 'A')
+ { }
void sknsk(machine_config &config);
void sknsu(machine_config &config);
@@ -74,7 +76,7 @@ public:
void init_galpani4();
void init_ryouran();
- DECLARE_CUSTOM_INPUT_MEMBER(paddle_r);
+ template <int P> DECLARE_CUSTOM_INPUT_MEMBER(paddle_r);
private:
required_device<sh2_device> m_maincpu;
@@ -94,6 +96,8 @@ private:
required_shared_ptr<uint32_t> m_main_ram;
required_shared_ptr<uint32_t> m_cache_ram;
+ optional_ioport_array<4> m_paddle;
+
hit_t m_hit;
bitmap_ind16 m_sprite_bitmap;
bitmap_ind16 m_tilemap_bitmap_lower;
diff --git a/src/mame/includes/tail2nos.h b/src/mame/includes/tail2nos.h
index 78d013b8838..bdd610799c0 100644
--- a/src/mame/includes/tail2nos.h
+++ b/src/mame/includes/tail2nos.h
@@ -30,12 +30,13 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
- m_acia(*this, "acia")
+ m_acia(*this, "acia"),
+ m_analog(*this, "AN%u", 0U)
{ }
void tail2nos(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(analog_in_r);
+ template <int N> DECLARE_CUSTOM_INPUT_MEMBER(analog_in_r);
protected:
virtual void machine_start() override;
@@ -63,6 +64,7 @@ private:
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
required_device<acia6850_device> m_acia;
+ required_ioport_array<2> m_analog;
DECLARE_WRITE16_MEMBER(tail2nos_txvideoram_w);
DECLARE_WRITE16_MEMBER(tail2nos_zoomdata_w);
diff --git a/src/mame/includes/taito_f3.h b/src/mame/includes/taito_f3.h
index 2b2cb2758c0..6bdd37be8eb 100644
--- a/src/mame/includes/taito_f3.h
+++ b/src/mame/includes/taito_f3.h
@@ -132,8 +132,8 @@ public:
void init_scfinals();
void init_pbobbl2x();
- DECLARE_CUSTOM_INPUT_MEMBER(f3_analog_r);
- DECLARE_CUSTOM_INPUT_MEMBER(f3_coin_r);
+ template <int Num> DECLARE_CUSTOM_INPUT_MEMBER(f3_analog_r);
+ template <int Num> DECLARE_CUSTOM_INPUT_MEMBER(f3_coin_r);
DECLARE_CUSTOM_INPUT_MEMBER(eeprom_read);
protected:
diff --git a/src/mame/includes/taito_z.h b/src/mame/includes/taito_z.h
index 8787fe44e62..488192463ff 100644
--- a/src/mame/includes/taito_z.h
+++ b/src/mame/includes/taito_z.h
@@ -43,12 +43,15 @@ public:
m_tc0140syt(*this, "tc0140syt"),
m_gfxdecode(*this, "gfxdecode"),
m_filter(*this, {"2610.1.r", "2610.1.l", "2610.2.r", "2610.2.l"}),
+ m_gas(*this, "GAS"),
+ m_brake(*this, "BRAKE"),
m_steer(*this, "STEER"),
m_io_eepromout(*this, "EEPROMOUT"),
m_lamps(*this, "lamp%u", 0U)
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(taitoz_pedal_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(gas_pedal_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(brake_pedal_r);
void bshark_base(machine_config &config);
void sci(machine_config &config);
@@ -108,6 +111,8 @@ private:
optional_device<tc0140syt_device> m_tc0140syt; // bshark & spacegun miss the CPUs which shall use TC0140
required_device<gfxdecode_device> m_gfxdecode;
optional_device_array<filter_volume_device, 4> m_filter;
+ optional_ioport m_gas;
+ optional_ioport m_brake;
optional_ioport m_steer;
optional_ioport m_io_eepromout;
output_finder<2> m_lamps;
diff --git a/src/mame/includes/taitosj.h b/src/mame/includes/taitosj.h
index 4736857f79d..56a1de866a7 100644
--- a/src/mame/includes/taitosj.h
+++ b/src/mame/includes/taitosj.h
@@ -58,7 +58,7 @@ public:
void init_spacecr();
DECLARE_CUSTOM_INPUT_MEMBER(input_port_4_f0_r);
- DECLARE_CUSTOM_INPUT_MEMBER(kikstart_gear_r);
+ template <int Player> DECLARE_CUSTOM_INPUT_MEMBER(kikstart_gear_r);
private:
required_shared_ptr<uint8_t> m_videoram_1;
diff --git a/src/mame/includes/timeplt.h b/src/mame/includes/timeplt.h
index 97e64a6a347..32f04cb2927 100644
--- a/src/mame/includes/timeplt.h
+++ b/src/mame/includes/timeplt.h
@@ -38,7 +38,7 @@ public:
void psurge(machine_config &config);
void bikkuric(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(chkun_hopper_status_r);
+ DECLARE_READ_LINE_MEMBER(chkun_hopper_status_r);
private:
required_device<cpu_device> m_maincpu;
diff --git a/src/mame/includes/toaplan2.h b/src/mame/includes/toaplan2.h
index 604b759c489..5144fb0aee9 100644
--- a/src/mame/includes/toaplan2.h
+++ b/src/mame/includes/toaplan2.h
@@ -86,7 +86,7 @@ public:
void init_batrider();
void init_enmadaio();
- DECLARE_CUSTOM_INPUT_MEMBER(c2map_r);
+ DECLARE_READ_LINE_MEMBER(c2map_r);
protected:
virtual void device_post_load() override;
diff --git a/src/mame/includes/topspeed.h b/src/mame/includes/topspeed.h
index f6b554850c3..6a5c418df73 100644
--- a/src/mame/includes/topspeed.h
+++ b/src/mame/includes/topspeed.h
@@ -36,13 +36,16 @@ public:
, m_filter2(*this, "filter2")
, m_filter3(*this, "filter3")
, m_gfxdecode(*this, "gfxdecode")
+ , m_gas(*this, "GAS")
+ , m_brake(*this, "BRAKE")
, m_steer(*this, "STEER")
, m_msm_rom(*this, "adpcm_%u", 0U)
{ }
void topspeed(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(pedal_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(gas_pedal_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(brake_pedal_r);
protected:
virtual void machine_start() override;
@@ -66,6 +69,8 @@ private:
required_device<filter_volume_device> m_filter2;
required_device<filter_volume_device> m_filter3;
required_device<gfxdecode_device> m_gfxdecode;
+ required_ioport m_gas;
+ required_ioport m_brake;
required_ioport m_steer;
// Misc
diff --git a/src/mame/includes/ultratnk.h b/src/mame/includes/ultratnk.h
index 8c2943e1f58..49078cba7ad 100644
--- a/src/mame/includes/ultratnk.h
+++ b/src/mame/includes/ultratnk.h
@@ -27,11 +27,12 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
- m_videoram(*this, "videoram")
+ m_videoram(*this, "videoram"),
+ m_joy(*this, "JOY-%c", 'W')
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(get_collision);
- DECLARE_CUSTOM_INPUT_MEMBER(get_joystick);
+ template <int N> DECLARE_READ_LINE_MEMBER(collision_flipflop_r);
+ template <int N> DECLARE_READ_LINE_MEMBER(joystick_r);
void ultratnk(machine_config &config);
protected:
@@ -75,6 +76,8 @@ protected:
required_shared_ptr<uint8_t> m_videoram;
+ required_ioport_array<4> m_joy;
+
int m_da_latch;
int m_collision[4];
tilemap_t* m_playfield;
diff --git a/src/mame/includes/vicdual.h b/src/mame/includes/vicdual.h
index 0a453acdba8..2be56d113ec 100644
--- a/src/mame/includes/vicdual.h
+++ b/src/mame/includes/vicdual.h
@@ -72,13 +72,13 @@ public:
void tranqgun(machine_config &config);
void tranqgun_audio(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(read_coin_status);
- DECLARE_CUSTOM_INPUT_MEMBER(get_64v);
- DECLARE_CUSTOM_INPUT_MEMBER(get_vblank_comp);
- DECLARE_CUSTOM_INPUT_MEMBER(get_composite_blank_comp);
- DECLARE_CUSTOM_INPUT_MEMBER(get_timer_value);
- DECLARE_CUSTOM_INPUT_MEMBER(fake_lives_r);
- DECLARE_CUSTOM_INPUT_MEMBER(samurai_protection_r);
+ DECLARE_READ_LINE_MEMBER(coin_status_r);
+ DECLARE_READ_LINE_MEMBER(get_64v);
+ DECLARE_READ_LINE_MEMBER(vblank_comp_r);
+ DECLARE_READ_LINE_MEMBER(cblank_comp_r);
+ DECLARE_READ_LINE_MEMBER(timer_value_r);
+ template <int Param> DECLARE_READ_LINE_MEMBER(fake_lives_r);
+ template <int N> DECLARE_READ_LINE_MEMBER(samurai_protection_r);
DECLARE_INPUT_CHANGED_MEMBER(coin_changed);
protected:
diff --git a/src/mame/includes/wecleman.h b/src/mame/includes/wecleman.h
index a6625413b96..6b9fb170249 100644
--- a/src/mame/includes/wecleman.h
+++ b/src/mame/includes/wecleman.h
@@ -43,7 +43,7 @@ public:
void init_wecleman();
void init_hotchase();
- DECLARE_CUSTOM_INPUT_MEMBER(hotchase_sound_status_r);
+ DECLARE_READ_LINE_MEMBER(hotchase_sound_status_r);
private:
enum
diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h
index f574732ea73..1a8d2c7d9f2 100644
--- a/src/mame/includes/williams.h
+++ b/src/mame/includes/williams.h
@@ -287,7 +287,7 @@ public:
void tshoot(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(gun_r);
+ template <int P> DECLARE_CUSTOM_INPUT_MEMBER(gun_r);
private:
DECLARE_WRITE_LINE_MEMBER(maxvol_w);
diff --git a/src/mame/includes/wolfpack.h b/src/mame/includes/wolfpack.h
index ecccb0c69f4..52d09e7e6e7 100644
--- a/src/mame/includes/wolfpack.h
+++ b/src/mame/includes/wolfpack.h
@@ -30,7 +30,7 @@ public:
void wolfpack(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(dial_r);
+ template <int Bit> DECLARE_READ_LINE_MEMBER(dial_r);
private:
enum
diff --git a/src/mame/includes/wwfsstar.h b/src/mame/includes/wwfsstar.h
index 7372e9385af..94c813f0bf1 100644
--- a/src/mame/includes/wwfsstar.h
+++ b/src/mame/includes/wwfsstar.h
@@ -29,7 +29,7 @@ public:
void wwfsstar(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(vblank_r);
+ DECLARE_READ_LINE_MEMBER(vblank_r);
protected:
virtual void video_start() override;
diff --git a/src/mame/includes/xain.h b/src/mame/includes/xain.h
index 55b91e03d9c..0e87f3701d2 100644
--- a/src/mame/includes/xain.h
+++ b/src/mame/includes/xain.h
@@ -38,7 +38,7 @@ public:
void xsleena(machine_config &config);
void xsleenab(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(vblank_r);
+ DECLARE_READ_LINE_MEMBER(vblank_r);
DECLARE_CUSTOM_INPUT_MEMBER(mcu_status_r);
protected:
diff --git a/src/mame/includes/xavix.h b/src/mame/includes/xavix.h
index 3f60c7ce8b7..b9074189bd1 100644
--- a/src/mame/includes/xavix.h
+++ b/src/mame/includes/xavix.h
@@ -643,8 +643,6 @@ public:
hackaddress2 = 0x8524;
}
- DECLARE_CUSTOM_INPUT_MEMBER(i2c_r);
-
protected:
virtual void write_io1(uint8_t data, uint8_t direction) override;
@@ -701,7 +699,7 @@ public:
: xavix_i2c_state(mconfig, type, tag)
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(camera_r);
+ DECLARE_READ_LINE_MEMBER(camera_r);
protected:
//virtual void write_io1(uint8_t data, uint8_t direction) override;
@@ -714,7 +712,7 @@ public:
: xavix_i2c_state(mconfig, type, tag)
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(camera_r);
+ DECLARE_READ_LINE_MEMBER(camera_r);
};
@@ -730,7 +728,7 @@ public:
void xavix_mtrk(machine_config &config);
void xavix_mtrkp(machine_config &config);
- CUSTOM_INPUT_MEMBER( mtrk_wheel_r );
+ DECLARE_READ_LINE_MEMBER( mtrk_wheel_r );
protected:
required_device<xavix_mtrk_wheel_device> m_wheel;
@@ -939,8 +937,6 @@ public:
void xavix_i2c_taiko(machine_config &config);
void xavix_i2c_jpopira(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(i2c_r);
-
protected:
virtual void write_io1(uint8_t data, uint8_t direction) override;
@@ -957,7 +953,7 @@ public:
void xavix_cart_popira2(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(i2c_r);
+ DECLARE_READ_LINE_MEMBER(i2c_r);
protected:
virtual void write_io1(uint8_t data, uint8_t direction) override;
@@ -981,8 +977,8 @@ public:
m_extraiowrite(0)
{ }
- DECLARE_CUSTOM_INPUT_MEMBER(ekara_multi0_r);
- DECLARE_CUSTOM_INPUT_MEMBER(ekara_multi1_r);
+ DECLARE_READ_LINE_MEMBER(ekara_multi0_r);
+ DECLARE_READ_LINE_MEMBER(ekara_multi1_r);
// void xavix_ekara(machine_config &config);
diff --git a/src/mame/includes/xmen.h b/src/mame/includes/xmen.h
index 53700d05ee8..1f7529c0c0d 100644
--- a/src/mame/includes/xmen.h
+++ b/src/mame/includes/xmen.h
@@ -38,7 +38,7 @@ public:
void xmen(machine_config &config);
void xmen6p(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(xmen_frame_r);
+ DECLARE_READ_LINE_MEMBER(xmen_frame_r);
private:
/* video-related */
diff --git a/src/mame/includes/xxmissio.h b/src/mame/includes/xxmissio.h
index 5dcbbc64c65..604a18a1893 100644
--- a/src/mame/includes/xxmissio.h
+++ b/src/mame/includes/xxmissio.h
@@ -24,7 +24,7 @@ public:
void xxmissio(machine_config &config);
- DECLARE_CUSTOM_INPUT_MEMBER(status_r);
+ template <int Mask> DECLARE_READ_LINE_MEMBER(status_r);
protected:
virtual void machine_start() override;
diff --git a/src/mame/includes/zaxxon.h b/src/mame/includes/zaxxon.h
index 5a0e113ff8d..0754acac279 100644
--- a/src/mame/includes/zaxxon.h
+++ b/src/mame/includes/zaxxon.h
@@ -48,8 +48,8 @@ public:
void init_razmataz();
void init_zaxxonj();
- DECLARE_CUSTOM_INPUT_MEMBER(razmataz_dial_r);
- DECLARE_CUSTOM_INPUT_MEMBER(zaxxon_coin_r);
+ template <int Num> DECLARE_CUSTOM_INPUT_MEMBER(razmataz_dial_r);
+ template <int Num> DECLARE_READ_LINE_MEMBER(zaxxon_coin_r);
DECLARE_INPUT_CHANGED_MEMBER(service_switch);
DECLARE_INPUT_CHANGED_MEMBER(zaxxon_coin_inserted);
diff --git a/src/mame/machine/amiga.cpp b/src/mame/machine/amiga.cpp
index 70ed2ff292c..74e26418e78 100644
--- a/src/mame/machine/amiga.cpp
+++ b/src/mame/machine/amiga.cpp
@@ -413,21 +413,6 @@ uint16_t amiga_state::joy1dat_r()
return (m_p2_mouse_y.read_safe(0xff) << 8) | m_p2_mouse_x.read_safe(0xff);
}
-CUSTOM_INPUT_MEMBER( amiga_state::amiga_joystick_convert )
-{
- uint8_t bits = m_joy_ports[(int)(uintptr_t)param].read_safe(0xff);
-
- int up = (bits >> 0) & 1;
- int down = (bits >> 1) & 1;
- int left = (bits >> 2) & 1;
- int right = (bits >> 3) & 1;
-
- if (left) up ^= 1;
- if (right) down ^= 1;
-
- return down | (right << 1) | (up << 8) | (left << 9);
-}
-
/*************************************
diff --git a/src/mame/machine/cmi_ankbd.h b/src/mame/machine/cmi_ankbd.h
index 2cc497d9d56..77c2d987b2b 100644
--- a/src/mame/machine/cmi_ankbd.h
+++ b/src/mame/machine/cmi_ankbd.h
@@ -7,7 +7,7 @@
***************************************************************************/
#ifndef MAME_MACHINE_CMI_ANKBD_H
-#define MAME_MACHINE_CMI_ANKBD_H 1
+#define MAME_MACHINE_CMI_ANKBD_H
#pragma once
diff --git a/src/mame/machine/cmi_mkbd.h b/src/mame/machine/cmi_mkbd.h
index 37b4debd0a9..df235aaa28f 100644
--- a/src/mame/machine/cmi_mkbd.h
+++ b/src/mame/machine/cmi_mkbd.h
@@ -7,7 +7,7 @@
***************************************************************************/
#ifndef MAME_MACHINE_CMI_MKBD_H
-#define MAME_MACHINE_CMI_MKBD_H 1
+#define MAME_MACHINE_CMI_MKBD_H
#pragma once
diff --git a/src/mame/machine/gaelco2.cpp b/src/mame/machine/gaelco2.cpp
index 99afde75ec8..4e206995643 100644
--- a/src/mame/machine/gaelco2.cpp
+++ b/src/mame/machine/gaelco2.cpp
@@ -252,51 +252,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(bang_state::bang_irq)
/***************************************************************************
- World Rally 2 analog controls
- - added by Mirko Mattioli <els@fastwebnet.it>
- ---------------------------------------------------------------
- WR2 pcb has two ADC, one for each player. The ADCs have in common
- the clock signal line (adc_clk) and the chip enable signal line
- (adc_cs) and, of course, two different data out signal lines.
- When "Pot Wheel" option is selected via dip-switch, then the gear
- is enabled (low/high shifter); the gear is disabled in joy mode by
- the CPU program code. No brakes are present in this game.
- Analog controls routines come from modified code wrote by Aaron
- Giles for gaelco3d driver.
-
-***************************************************************************/
-
-
-CUSTOM_INPUT_MEMBER(wrally2_state::wrally2_analog_bit_r)
-{
- int which = (uintptr_t)param;
- return (m_analog_ports[which] >> 7) & 0x01;
-}
-
-
-WRITE_LINE_MEMBER(wrally2_state::wrally2_adc_clk)
-{
- /* a zero/one combo is written here to clock the next analog port bit */
- if (!state)
- {
- m_analog_ports[0] <<= 1;
- m_analog_ports[1] <<= 1;
- }
-}
-
-
-WRITE_LINE_MEMBER(wrally2_state::wrally2_adc_cs)
-{
- /* a zero is written here to read the analog ports, and a one is written when finished */
- if (!state)
- {
- m_analog_ports[0] = m_analog0->read();
- m_analog_ports[1] = m_analog1->read();
- }
-}
-
-/***************************************************************************
-
Protection
***************************************************************************/
diff --git a/src/mame/machine/galaxold.cpp b/src/mame/machine/galaxold.cpp
index 488ec27dd8d..c94628c1427 100644
--- a/src/mame/machine/galaxold.cpp
+++ b/src/mame/machine/galaxold.cpp
@@ -142,14 +142,6 @@ WRITE8_MEMBER(galaxold_state::_4in1_bank_w)
membank("bank1")->set_entry(m__4in1_bank);
}
-CUSTOM_INPUT_MEMBER(galaxold_state::_4in1_fake_port_r)
-{
- static const char *const portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" };
- int bit_mask = (uintptr_t)param;
-
- return (ioport(portnames[m__4in1_bank])->read() & bit_mask) ? 0x01 : 0x00;
-}
-
void galaxold_state::init_4in1()
{
address_space &space = m_maincpu->space(AS_PROGRAM);
diff --git a/src/mame/machine/mhavoc.cpp b/src/mame/machine/mhavoc.cpp
index 69f341fd71a..65e9a99a3a6 100644
--- a/src/mame/machine/mhavoc.cpp
+++ b/src/mame/machine/mhavoc.cpp
@@ -204,37 +204,30 @@ WRITE8_MEMBER(mhavoc_state::mhavoc_rom_banksel_w)
*
*************************************/
-CUSTOM_INPUT_MEMBER(mhavoc_state::tms5220_r)
+CUSTOM_INPUT_MEMBER(mhavoc_state::coin_service_r)
{
- return m_tms->readyq_r() ? 1 : 0;
+ return (m_player_1 ? m_service : m_coin)->read() & 0x03;
}
-CUSTOM_INPUT_MEMBER(mhavoc_state::mhavoc_bit67_r)
-{
- const char *tag1 = (const char *)param;
- const char *tag2 = tag1 + strlen(tag1) + 1;
- return ioport(m_player_1 ? tag2 : tag1)->read() & 0x03;
-}
-
-CUSTOM_INPUT_MEMBER(mhavoc_state::gamma_rcvd_r)
+READ_LINE_MEMBER(mhavoc_state::gamma_rcvd_r)
{
/* Gamma rcvd flag */
return m_gamma_rcvd;
}
-CUSTOM_INPUT_MEMBER(mhavoc_state::gamma_xmtd_r)
+READ_LINE_MEMBER(mhavoc_state::gamma_xmtd_r)
{
/* Gamma xmtd flag */
return m_gamma_xmtd;
}
-CUSTOM_INPUT_MEMBER(mhavoc_state::alpha_rcvd_r)
+READ_LINE_MEMBER(mhavoc_state::alpha_rcvd_r)
{
/* Alpha rcvd flag */
return (m_has_gamma_cpu && m_alpha_rcvd);
}
-CUSTOM_INPUT_MEMBER(mhavoc_state::alpha_xmtd_r)
+READ_LINE_MEMBER(mhavoc_state::alpha_xmtd_r)
{
/* Alpha xmtd flag */
return (m_has_gamma_cpu && m_alpha_xmtd);
diff --git a/src/mame/machine/micro3d.cpp b/src/mame/machine/micro3d.cpp
index 4d1c52ddbec..1eb182ea07f 100644
--- a/src/mame/machine/micro3d.cpp
+++ b/src/mame/machine/micro3d.cpp
@@ -370,7 +370,7 @@ READ8_MEMBER( micro3d_state::adc_volume_r )
return (uint8_t)((255.0/100.0) * m_volume->read() + 0.5);
}
-CUSTOM_INPUT_MEMBER(micro3d_state::botss_hwchk_r)
+READ_LINE_MEMBER(micro3d_state::botss_hwchk_r)
{
return m_botss_latch;
}
diff --git a/src/mame/machine/naomi.cpp b/src/mame/machine/naomi.cpp
index e4ecf881d6a..4d1f2ddfd6a 100644
--- a/src/mame/machine/naomi.cpp
+++ b/src/mame/machine/naomi.cpp
@@ -232,18 +232,34 @@ INPUT_CHANGED_MEMBER(naomi_state::naomi_mp_w)
CUSTOM_INPUT_MEMBER(naomi_state::naomi_mp_r)
{
- const char *tagptr = (const char *)param;
uint8_t retval = 0;
- for (int i = 0x80; i >= 0x08; i >>= 1)
+ int port = 0;
+ for (int i = 0x80; i >= 0x08; i >>= 1, port++)
+ {
+ if (m_mp_mux & i)
+ retval |= m_mp[port].read_safe(0);
+ }
+ return retval;
+}
+
+CUSTOM_INPUT_MEMBER(naomi_state::suchie3_mp_r)
+{
+ uint8_t retval = 0;
+
+ int port = 0;
+ for (int i = 0x80; i >= 0x08; i >>= 1, port++)
{
if (m_mp_mux & i)
{
- ioport_port *port = ioport(tagptr);
- if (port != nullptr)
- retval |= port->read();
+ // KEY1 and KEY5 are swapped
+ if (port == 0)
+ retval |= m_mp[4].read_safe(0);
+ else if (port == 4)
+ retval |= m_mp[0].read_safe(0);
+ else
+ retval |= m_mp[port].read_safe(0);
}
- tagptr += strlen(tagptr) + 1;
}
return retval;
}
@@ -251,7 +267,6 @@ CUSTOM_INPUT_MEMBER(naomi_state::naomi_mp_r)
CUSTOM_INPUT_MEMBER(naomi_state::naomi_kb_r)
{
// TODO: player 2 input reading
-// const int *tagptr = (const int *)param;
uint8_t retval = 0;
static const char *const keynames[] =
{
diff --git a/src/mame/machine/playch10.cpp b/src/mame/machine/playch10.cpp
index 80f67f75444..d38a4fc87f1 100644
--- a/src/mame/machine/playch10.cpp
+++ b/src/mame/machine/playch10.cpp
@@ -79,7 +79,7 @@ MACHINE_START_MEMBER(playch10_state,playch10_hboard)
*
*************************************/
-CUSTOM_INPUT_MEMBER(playch10_state::pc10_int_detect_r)
+READ_LINE_MEMBER(playch10_state::int_detect_r)
{
return ~m_pc10_int_detect & 1;
}
diff --git a/src/mame/machine/scramble.cpp b/src/mame/machine/scramble.cpp
index 1ba4da7f7c0..0bf08f83f78 100644
--- a/src/mame/machine/scramble.cpp
+++ b/src/mame/machine/scramble.cpp
@@ -32,7 +32,7 @@ MACHINE_RESET_MEMBER(scramble_state,explorer)
}
-CUSTOM_INPUT_MEMBER(scramble_state::darkplnt_custom_r)
+CUSTOM_INPUT_MEMBER(scramble_state::darkplnt_dial_r)
{
static const uint8_t remap[] = {0x03, 0x02, 0x00, 0x01, 0x21, 0x20, 0x22, 0x23,
0x33, 0x32, 0x30, 0x31, 0x11, 0x10, 0x12, 0x13,
@@ -42,7 +42,7 @@ CUSTOM_INPUT_MEMBER(scramble_state::darkplnt_custom_r)
0x2b, 0x2a, 0x28, 0x29, 0x09, 0x08, 0x0a, 0x0b,
0x0f, 0x0e, 0x0c, 0x0d, 0x2d, 0x2c, 0x2e, 0x2f,
0x27, 0x26, 0x24, 0x25, 0x05, 0x04, 0x06, 0x07 };
- uint8_t val = ioport((const char *)param)->read();
+ uint8_t val = m_dial->read();
return remap[val >> 2];
}
diff --git a/src/mame/machine/starwars.cpp b/src/mame/machine/starwars.cpp
index 43b1ed4d56a..e5bae0674ea 100644
--- a/src/mame/machine/starwars.cpp
+++ b/src/mame/machine/starwars.cpp
@@ -78,7 +78,7 @@ WRITE_LINE_MEMBER(starwars_state::coin2_counter_w)
*
*************************************/
-CUSTOM_INPUT_MEMBER(starwars_state::matrix_flag_r)
+READ_LINE_MEMBER(starwars_state::matrix_flag_r)
{
/* set the matrix processor flag */
return m_math_run ? 1 : 0;
diff --git a/src/mame/machine/taito68705interface.h b/src/mame/machine/taito68705interface.h
index 30c3b30dbc0..e1a7716a1c1 100644
--- a/src/mame/machine/taito68705interface.h
+++ b/src/mame/machine/taito68705interface.h
@@ -21,10 +21,8 @@ public:
DECLARE_READ8_MEMBER(data_r);
DECLARE_WRITE8_MEMBER(data_w);
DECLARE_WRITE_LINE_MEMBER(reset_w);
- DECLARE_READ_LINE_MEMBER(host_semaphore_r) { return m_host_flag ? ASSERT_LINE : CLEAR_LINE; }
- DECLARE_READ_LINE_MEMBER(mcu_semaphore_r) { return m_mcu_flag ? ASSERT_LINE : CLEAR_LINE; }
- DECLARE_CUSTOM_INPUT_MEMBER(host_semaphore_r) { return m_host_flag ? 1 : 0; }
- DECLARE_CUSTOM_INPUT_MEMBER(mcu_semaphore_r) { return m_mcu_flag ? 1 : 0; }
+ DECLARE_READ_LINE_MEMBER(host_semaphore_r) { return m_host_flag ? 1 : 0; }
+ DECLARE_READ_LINE_MEMBER(mcu_semaphore_r) { return m_mcu_flag ? 1 : 0; }
protected:
taito68705_mcu_device_base(
diff --git a/src/mame/machine/williams.cpp b/src/mame/machine/williams.cpp
index 34576e80b34..1c03c4f60ee 100644
--- a/src/mame/machine/williams.cpp
+++ b/src/mame/machine/williams.cpp
@@ -467,13 +467,6 @@ MACHINE_START_MEMBER(tshoot_state,tshoot)
}
-CUSTOM_INPUT_MEMBER(tshoot_state::gun_r)
-{
- int data = m_gun[(uintptr_t)param]->read();
- return (data & 0x3f) ^ ((data & 0x3f) >> 1);
-}
-
-
WRITE_LINE_MEMBER(tshoot_state::maxvol_w)
{
/* something to do with the sound volume */
diff --git a/src/mame/machine/xavix.cpp b/src/mame/machine/xavix.cpp
index 480e5155cfd..dcd39e04957 100644
--- a/src/mame/machine/xavix.cpp
+++ b/src/mame/machine/xavix.cpp
@@ -379,27 +379,17 @@ WRITE8_MEMBER(xavix_state::dispctrl_posirq_y_w)
/* Per Game IO port callbacks */
-CUSTOM_INPUT_MEMBER(xavix_i2c_state::i2c_r)
-{
- return m_i2cmem->read_sda();
-}
-
-CUSTOM_INPUT_MEMBER(xavix_i2c_cart_state::i2c_r)
-{
- return m_i2cmem->read_sda();
-}
-
-CUSTOM_INPUT_MEMBER(xavix_i2c_lotr_state::camera_r) // seems to be some kind of camera status bits
+READ_LINE_MEMBER(xavix_i2c_lotr_state::camera_r) // seems to be some kind of camera status bits
{
return machine().rand();
}
-CUSTOM_INPUT_MEMBER(xavix_i2c_bowl_state::camera_r) // seems to be some kind of camera status bits
+READ_LINE_MEMBER(xavix_i2c_bowl_state::camera_r) // seems to be some kind of camera status bits
{
return machine().rand();
}
-CUSTOM_INPUT_MEMBER(xavix_ekara_state::ekara_multi0_r)
+READ_LINE_MEMBER(xavix_ekara_state::ekara_multi0_r)
{
switch (m_extraioselect & 0x7f)
{
@@ -417,7 +407,7 @@ CUSTOM_INPUT_MEMBER(xavix_ekara_state::ekara_multi0_r)
return 0x00;
}
-CUSTOM_INPUT_MEMBER(xavix_ekara_state::ekara_multi1_r)
+READ_LINE_MEMBER(xavix_ekara_state::ekara_multi1_r)
{
switch (m_extraioselect & 0x7f)
{
@@ -566,7 +556,7 @@ WRITE8_MEMBER(xavix_i2c_jmat_state::write_extended_io2)
// the cart pins Popira 2 uses for IO with cart gc0010 are not controllable by the CPU on other ekara systems
-CUSTOM_INPUT_MEMBER(xavix_popira2_cart_state::i2c_r)
+READ_LINE_MEMBER(xavix_popira2_cart_state::i2c_r)
{
if (m_cartslot->has_cart())
return m_cartslot->read_sda();
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index ec2face386a..b1d850496c6 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -2453,6 +2453,7 @@ pcd4x // Siemens-Nixdorf PCD-4H and other 486 desktops
pcd4nl // 1995 Siemens-Nixdorf PCD-4NL 486 subnotebook
pcd4nd // 1993 Siemens-Nixdorf 486 notebook
ct386sx //
+wy220001 // WYSEpc
cxsxd //
ec1842 //
ec1849 //
@@ -2464,6 +2465,15 @@ ficvipio // FIC 486-VIP-IO
ficvipio2 // FIC 486-VIP-IO2
ftsserv // 1991 Apricot FTs (Scorpion)
aubam12s2 // AUVA COMPUTER, INC. BAM/12-S2 motherboard (286)
+bi025c // BI-025C HT 12 286 motherboard (286)
+kma202f // KMA-202F-12R motherboard (286)
+cdtekg2 // CDTEK motherboard with Headland G2 chipset (286)
+octekg2 // Octek motherboard with Headland G2 chipset (286)
+olim203 // Olivetti 286 motherboard
+headg2 // 286 motherboards with Headland G2 chipset
+mb1212c // Biostar MB-1212C motherboard (286)
+bam16a0 // VIP-M21502A BAM16-A0 motherboard (286)
+cmpa286 // CMP enterprise CO.LTD. motherboard (286)
suntac5 // 286 motherboards using the 5-chip SUNTAC chipset
ht12a // 286 motherboards using the Headland HT12/A chipset
vlsi5 // 286 motherboards using the 5-chip VLSI chipset
@@ -12833,6 +12843,7 @@ targc // (c) 1980
teetert // (c) 1981
venture // (c) 1981
venture2 // (c) 1981
+venture2b // bootleg
venture4 // (c) 1981
@source:exidy440.cpp
@@ -15341,6 +15352,7 @@ gnw_flagman // Nintendo
gnw_gcliff // Nintendo
gnw_ghouse // Nintendo
gnw_helmet // Nintendo
+gnw_judge // Nintendo
gnw_lboat // Nintendo
gnw_manhole // Nintendo
gnw_mario // Nintendo
@@ -31643,6 +31655,10 @@ sicpc1605 // Siemens Sicomp PC16-05
ssam88s //
sx16 // Sanyo SX-16
zdsupers //
+ledgmodm // Leading Edge Model M
+eaglepc2 // Eagle PC-2
+mpx16 // Ciarcia's Circuit Cellar Micromint MPX-16
+hstrtpls // Vendex HeadStart Plus
@source:pc100.cpp
pc100 //
diff --git a/src/mame/video/733_asr.cpp b/src/mame/video/733_asr.cpp
index 80995c2f415..bd88c43416f 100644
--- a/src/mame/video/733_asr.cpp
+++ b/src/mame/video/733_asr.cpp
@@ -28,6 +28,8 @@
#include "emu.h"
#include "733_asr.h"
+#include <algorithm>
+
enum
{
/*ASROutQueueSize = 32,*/
@@ -201,9 +203,11 @@ void asr733_device::linefeed()
{
uint8_t buf[asr_window_width];
+ assert(asr_window_offset_x + asr_window_width <= m_bitmap->width());
+ assert(asr_window_offset_y + asr_window_height <= m_bitmap->height());
for (int y=asr_window_offset_y; y<asr_window_offset_y+asr_window_height-asr_scroll_step; y++)
{
- extract_scanline8(*m_bitmap, asr_window_offset_x, y+asr_scroll_step, asr_window_width, buf);
+ std::copy_n(&m_bitmap->pix16(y+asr_scroll_step, asr_window_offset_x), asr_window_width, buf);
draw_scanline8(*m_bitmap, asr_window_offset_x, y, asr_window_width, buf, palette().pens());
}
diff --git a/src/mame/video/apexc.cpp b/src/mame/video/apexc.cpp
index 174a665a4f4..095763b9c40 100644
--- a/src/mame/video/apexc.cpp
+++ b/src/mame/video/apexc.cpp
@@ -11,6 +11,8 @@
#include "emu.h"
#include "includes/apexc.h"
+#include <algorithm>
+
const rgb_t apexc_state::palette_table[] =
{
rgb_t::white(),
@@ -128,9 +130,11 @@ void apexc_state::teletyper_linefeed()
{
uint8_t buf[teletyper_window_width];
+ assert(teletyper_window_offset_x + teletyper_window_width <= m_bitmap->width());
+ assert(teletyper_window_offset_y + teletyper_window_height <= m_bitmap->height());
for (int y = teletyper_window_offset_y; y < teletyper_window_offset_y + teletyper_window_height - teletyper_scroll_step; y++)
{
- extract_scanline8(*m_bitmap, teletyper_window_offset_x, y+teletyper_scroll_step, teletyper_window_width, buf);
+ std::copy_n(&m_bitmap->pix16(y+teletyper_scroll_step, teletyper_window_offset_x), teletyper_window_width, buf);
draw_scanline8(*m_bitmap, teletyper_window_offset_x, y, teletyper_window_width, buf, m_palette->pens());
}
diff --git a/src/mame/video/avgdvg.cpp b/src/mame/video/avgdvg.cpp
index 48272460fb2..45badf975a5 100644
--- a/src/mame/video/avgdvg.cpp
+++ b/src/mame/video/avgdvg.cpp
@@ -1281,9 +1281,9 @@ TIMER_CALLBACK_MEMBER(avgdvg_device::run_state_machine)
*
************************************/
-CUSTOM_INPUT_MEMBER(avgdvg_device::done_r)
+READ_LINE_MEMBER(avgdvg_device::done_r)
{
- return m_sync_halt ? 0x01 : 0x00;
+ return m_sync_halt ? 1 : 0;
}
void avgdvg_device::go_w(u8 data)
diff --git a/src/mame/video/avgdvg.h b/src/mame/video/avgdvg.h
index 85270edd618..af75d1b8f81 100644
--- a/src/mame/video/avgdvg.h
+++ b/src/mame/video/avgdvg.h
@@ -16,7 +16,7 @@ class avgdvg_device : public device_t
public:
template <typename T> void set_vector_tag(T &&tag) { m_vector.set_tag(std::forward<T>(tag)); }
- DECLARE_CUSTOM_INPUT_MEMBER(done_r);
+ DECLARE_READ_LINE_MEMBER(done_r);
void go_w(u8 data = 0);
void reset_w(u8 data = 0);
diff --git a/src/mame/video/exidy440.cpp b/src/mame/video/exidy440.cpp
index 57ad8a06d80..f1173334a47 100644
--- a/src/mame/video/exidy440.cpp
+++ b/src/mame/video/exidy440.cpp
@@ -42,6 +42,7 @@ void exidy440_state::video_start()
m_palettebank_vis = 0;
m_firq_vblank = 0;
m_firq_beam = 0;
+ m_beam_firq_count = 0;
/* allocate a buffer for VRAM */
m_local_videoram = std::make_unique<uint8_t[]>(256 * 256 * 2);
@@ -51,6 +52,7 @@ void exidy440_state::video_start()
m_local_paletteram = std::make_unique<uint8_t[]>(512 * 2);
memset(m_local_paletteram.get(), 0, 512 * 2);
+ m_beam_firq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(exidy440_state::beam_firq_callback), this));
m_collide_firq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(exidy440_state::collide_firq_callback), this));
}
@@ -258,10 +260,13 @@ TIMER_CALLBACK_MEMBER(exidy440_state::beam_firq_callback)
}
/* round the x value to the nearest byte */
- param = (param + 1) / 2;
+ uint8_t rounded_x = (param + 1) / 2;
/* latch the x value; this convolution comes from the read routine */
- m_latched_x = (param + 3) ^ 2;
+ m_latched_x = (rounded_x + 3) ^ 2;
+
+ if (m_beam_firq_count++ < 12)
+ m_beam_firq_timer->adjust(m_screen->scan_period(), param);
}
@@ -420,8 +425,6 @@ uint32_t exidy440_state::screen_update_exidy440(screen_device &screen, bitmap_in
/* generate an interrupt once/frame for the beam */
if (cliprect.bottom() == screen.visible_area().bottom())
{
- int i;
-
int beamx = ((ioport("AN0")->read() & 0xff) * (HBSTART - HBEND)) >> 8;
int beamy = ((ioport("AN1")->read() & 0xff) * (VBSTART - VBEND)) >> 8;
@@ -433,11 +436,9 @@ uint32_t exidy440_state::screen_update_exidy440(screen_device &screen, bitmap_in
This is how it is implemented. */
attotime increment = screen.scan_period();
attotime time = screen.time_until_pos(beamy, beamx) - increment * 6;
- for (i = 0; i <= 12; i++)
- {
- machine().scheduler().timer_set(time, timer_expired_delegate(FUNC(exidy440_state::beam_firq_callback),this), beamx);
- time += increment;
- }
+
+ m_beam_firq_count = 0;
+ m_beam_firq_timer->adjust(time, beamx);
}
return 0;
diff --git a/src/mame/video/homerun.cpp b/src/mame/video/homerun.cpp
index f376ec0290d..95878483c04 100644
--- a/src/mame/video/homerun.cpp
+++ b/src/mame/video/homerun.cpp
@@ -12,7 +12,7 @@
/**************************************************************************/
-CUSTOM_INPUT_MEMBER(homerun_state::sprite0_r)
+READ_LINE_MEMBER(homerun_state::sprite0_r)
{
// sprite-0 vs background collision status, similar to NES
return (m_screen->vpos() > (m_spriteram[0] - 16 + 1)) ? 1 : 0;
diff --git a/src/mame/video/pdp1.cpp b/src/mame/video/pdp1.cpp
index 0a4597fd3be..f04aa496d83 100644
--- a/src/mame/video/pdp1.cpp
+++ b/src/mame/video/pdp1.cpp
@@ -17,12 +17,13 @@
Based on earlier work by Chris Salomon
*/
-#include <math.h>
-
#include "emu.h"
#include "cpu/pdp1/pdp1.h"
#include "includes/pdp1.h"
+#include <math.h>
+#include <algorithm>
+
@@ -357,9 +358,11 @@ void pdp1_state::pdp1_typewriter_linefeed()
uint8_t buf[typewriter_window_width];
int y;
+ assert(typewriter_window_width <= m_typewriter_bitmap.width());
+ assert(typewriter_window_height <= m_typewriter_bitmap.height());
for (y=0; y<typewriter_window_height-typewriter_scroll_step; y++)
{
- extract_scanline8(m_typewriter_bitmap, 0, y+typewriter_scroll_step, typewriter_window_width, buf);
+ std::copy_n(&m_typewriter_bitmap.pix16(y+typewriter_scroll_step, 0), typewriter_window_width, buf);
draw_scanline8(m_typewriter_bitmap, 0, y, typewriter_window_width, buf, m_palette->pens());
}
diff --git a/src/mame/video/phoenix.cpp b/src/mame/video/phoenix.cpp
index dcea2d63bd9..defbfc285d9 100644
--- a/src/mame/video/phoenix.cpp
+++ b/src/mame/video/phoenix.cpp
@@ -302,7 +302,7 @@ CUSTOM_INPUT_MEMBER(phoenix_state::player_input_r)
return (ioport("CTRL")->read() & 0x0f) >> 0;
}
-CUSTOM_INPUT_MEMBER(phoenix_state::pleiads_protection_r)
+READ_LINE_MEMBER(phoenix_state::pleiads_protection_r)
{
/* handle Pleiads protection */
switch (m_pleiads_protection_question)
diff --git a/src/mame/video/psikyosh.cpp b/src/mame/video/psikyosh.cpp
index 18c7aee1b7a..7b97e5b98e2 100644
--- a/src/mame/video/psikyosh.cpp
+++ b/src/mame/video/psikyosh.cpp
@@ -65,16 +65,18 @@ The only viable way to do this is to have one tilemap per bank (0x0a-0x20), and
*/
#include "emu.h"
-#include "drawgfxm.h"
+#include "drawgfxt.ipp"
#include "includes/psikyosh.h"
+#include <algorithm>
+
static constexpr u32 BG_TRANSPEN = 0x00ff00ff; // used for representing transparency in temporary bitmaps
//#define DEBUG_KEYS
//#define DEBUG_MESSAGE
// take ARGB pixel with stored alpha and blend in to RGB32 bitmap
-#define PIXEL_OP_COPY_TRANSPEN_ARGBRENDER32(DEST, PRIORITY, SOURCE) \
+#define PIXEL_OP_COPY_TRANSPEN_ARGBRENDER32(DEST, SOURCE) \
do \
{ \
const rgb_t srcdata = (SOURCE); \
@@ -83,7 +85,7 @@ do
} \
while (0)
// take RGB pixel with separate alpha and blend in to RGB32 bitmap
-#define PIXEL_OP_COPY_TRANSPEN_ALPHARENDER32(DEST, PRIORITY, SOURCE) \
+#define PIXEL_OP_COPY_TRANSPEN_ALPHARENDER32(DEST, SOURCE) \
do \
{ \
const u32 srcdata = (SOURCE); \
@@ -92,7 +94,7 @@ do
} \
while (0)
// take ARGB pixel with stored alpha and copy in to RGB32 bitmap, scipping BG_TRANSPEN
-#define PIXEL_OP_COPY_TRANSPEN_RENDER32(DEST, PRIORITY, SOURCE) \
+#define PIXEL_OP_COPY_TRANSPEN_RENDER32(DEST, SOURCE) \
do \
{ \
const u32 srcdata = (SOURCE); \
@@ -169,10 +171,7 @@ static inline void pixop_transparent_alphatable(u8 source, u32 *dest, const pen_
-------------------------------------------------*/
void psikyosh_state::draw_scanline32_alpha(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u32 *srcptr, int alpha)
{
- DECLARE_NO_PRIORITY;
- u32 const transpen = BG_TRANSPEN;
-
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_TRANSPEN_ALPHARENDER32, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [alpha, transpen = BG_TRANSPEN](u32 &destp, const u32 &srcp) { PIXEL_OP_COPY_TRANSPEN_ALPHARENDER32(destp, srcp); });
}
/*-------------------------------------------------
@@ -181,10 +180,7 @@ void psikyosh_state::draw_scanline32_alpha(bitmap_rgb32 &bitmap, s32 destx, s32
-------------------------------------------------*/
void psikyosh_state::draw_scanline32_argb(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u32 *srcptr)
{
- DECLARE_NO_PRIORITY;
- u32 const transpen = BG_TRANSPEN;
-
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_TRANSPEN_ARGBRENDER32, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [transpen = BG_TRANSPEN](u32 &destp, const u32 &srcp) { PIXEL_OP_COPY_TRANSPEN_ARGBRENDER32(destp, srcp); });
}
/*-------------------------------------------------
@@ -193,10 +189,7 @@ void psikyosh_state::draw_scanline32_argb(bitmap_rgb32 &bitmap, s32 destx, s32 d
-------------------------------------------------*/
void psikyosh_state::draw_scanline32_transpen(bitmap_rgb32 &bitmap, s32 destx, s32 desty, s32 length, const u32 *srcptr)
{
- DECLARE_NO_PRIORITY;
- u32 const transpen = BG_TRANSPEN;
-
- DRAWSCANLINE_CORE(u32, PIXEL_OP_COPY_TRANSPEN_RENDER32, NO_PRIORITY);
+ drawscanline_core(bitmap, destx, desty, length, srcptr, [transpen = BG_TRANSPEN](u32 &destp, const u32 &srcp) { PIXEL_OP_COPY_TRANSPEN_RENDER32(destp, srcp); });
}
@@ -340,7 +333,7 @@ void psikyosh_state::draw_bglayerscroll(u8 const layer, bitmap_rgb32 &bitmap, co
if ((tilebank >= 0x0a) && (tilebank <= 0x1f)) /* 20 banks of 0x800 bytes. filter garbage. */
{
- s16 const tilemap_scanline = (scanline - scrolly + 0x400) & (height - 1);
+ u16 const tilemap_scanline = (scanline - scrolly + 0x400) & (height - 1);
// render reelvant tiles to temp bitmap, assume bank changes infrequently/never. render alpha as per-pen
cache_bitmap(tilemap_scanline, gfx, size, tilebank, alpha, last_bank);
@@ -349,7 +342,7 @@ void psikyosh_state::draw_bglayerscroll(u8 const layer, bitmap_rgb32 &bitmap, co
g_profiler.start(PROFILER_USER2);
u32 tilemap_line[32 * 16];
u32 scr_line[64 * 8];
- extract_scanline32(m_bg_bitmap, 0, tilemap_scanline, 0x200, tilemap_line);
+ std::copy_n(&m_bg_bitmap.pix32(tilemap_scanline, 0), 0x200, tilemap_line);
g_profiler.stop();
/* slow bit, needs optimising. apply scrollx and zoomx by assembling scanline from row */
diff --git a/src/mame/video/stactics.cpp b/src/mame/video/stactics.cpp
index ed74bb411e2..185f4657d30 100644
--- a/src/mame/video/stactics.cpp
+++ b/src/mame/video/stactics.cpp
@@ -119,7 +119,7 @@ WRITE8_MEMBER(stactics_state::scroll_ram_w)
*
*************************************/
-CUSTOM_INPUT_MEMBER(stactics_state::get_frame_count_d3)
+READ_LINE_MEMBER(stactics_state::frame_count_d3_r)
{
return (m_frame_count >> 3) & 0x01;
}
@@ -169,13 +169,13 @@ WRITE8_MEMBER(stactics_state::shot_flag_clear_w)
}
-CUSTOM_INPUT_MEMBER(stactics_state::get_shot_standby)
+READ_LINE_MEMBER(stactics_state::shot_standby_r)
{
return m_shot_standby;
}
-CUSTOM_INPUT_MEMBER(stactics_state::get_not_shot_arrive)
+READ_LINE_MEMBER(stactics_state::not_shot_arrive_r)
{
return !m_shot_arrive;
}
diff --git a/src/mame/video/suna8.cpp b/src/mame/video/suna8.cpp
index c12dbeb9d85..f1e4cd650b2 100644
--- a/src/mame/video/suna8.cpp
+++ b/src/mame/video/suna8.cpp
@@ -29,7 +29,7 @@
#include "emu.h"
#include "includes/suna8.h"
-#include "drawgfxm.h"
+#include "drawgfxt.ipp"
/***************************************************************************
For Debug: there's no tilemap, just sprites.
@@ -188,19 +188,6 @@ do
} \
while (0)
-class mygfx_element : public gfx_element
-{
-public:
- void prio_mask_transpen(bitmap_ind16 &dest, const rectangle &cliprect,
- uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty,
- bitmap_ind8 &priority, uint32_t trans_pen)
- {
- color = colorbase() + granularity() * (color % colors());
- code %= elements();
- DRAWGFX_CORE(uint16_t, PIXEL_OP_REBASE_TRANSPEN_PRIORITY_MASK, uint8_t);
- }
-};
-
/***************************************************************************
[ Sprites Format ]
@@ -434,8 +421,13 @@ void suna8_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, cons
int color = (((attr >> 2) & 0xf) ^ colorbank) + 0x10 * m_palettebank; // player2 in hardhea2 and sparkman
if (read_mask)
- ((mygfx_element*)(m_gfxdecode->gfx(which)))->prio_mask_transpen(bitmap, cliprect,
- code, color, tile_flipx, tile_flipy, sx, sy, screen.priority(), 0xf);
+ {
+ gfx_element *mygfx = m_gfxdecode->gfx(which);
+ color = mygfx->colorbase() + mygfx->granularity() * (color % mygfx->colors());
+ mygfx->drawgfx_core(bitmap, cliprect, code % mygfx->elements(),
+ tile_flipx, tile_flipy, sx, sy, screen.priority(),
+ [color, trans_pen = 0xf](uint16_t &destp, uint8_t &pri, const uint8_t &srcp) { PIXEL_OP_REBASE_TRANSPEN_PRIORITY_MASK(destp, pri, srcp); });
+ }
else
m_gfxdecode->gfx(which)->transpen(bitmap, cliprect,
code, color, tile_flipx, tile_flipy, sx, sy, 0xf);
diff --git a/src/mame/video/tc0080vco.cpp b/src/mame/video/tc0080vco.cpp
index fcc725abd69..e935ed2264c 100644
--- a/src/mame/video/tc0080vco.cpp
+++ b/src/mame/video/tc0080vco.cpp
@@ -64,7 +64,7 @@ this seems to be the only zoom feature actually used in the games.
#include "tc0080vco.h"
#include "video/taito_helper.h"
-#include "drawgfxm.h"
+#include "drawgfxt.ipp"
#include "screen.h"
@@ -710,25 +710,7 @@ void tc0080vco_device::bg1_tilemap_draw(screen_device &screen, bitmap_ind16 &bit
sy = (( 0x3fe - m_scroll_ram[layer + 3]) << 16) - (max_y + min_y) * (zy - 0x10000);
}
- {
- bitmap_ind16 &dest = bitmap;
- bitmap_ind16 &src = srcbitmap;
- s32 startx = sx;
- s32 starty = sy;
- s32 incxx = zx;
- s32 incxy = 0;
- s32 incyx = 0;
- s32 incyy = zy;
- int wraparound = 0;
- u8 privalue = priority;
- u8 primask = pmask;
- bitmap_ind8 &priority = screen.priority();
-
- if (dest.bpp() == 16)
- COPYROZBITMAP_CORE(u16, PIXEL_OP_COPY_TRANS0_SET_PRIORITY, u8);
- else
- COPYROZBITMAP_CORE(u32, PIXEL_OP_COPY_TRANS0_SET_PRIORITY, u8);
- }
+ copyrozbitmap_core(bitmap, cliprect, srcbitmap, sx, sy, zx, 0, 0, zy, 0, screen.priority(), [privalue = priority, primask = pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_TRANS0_SET_PRIORITY(destp, pri, srcp); });
}
}
diff --git a/src/mame/video/tx0.cpp b/src/mame/video/tx0.cpp
index 1c02e8636d4..1e7c5c0a147 100644
--- a/src/mame/video/tx0.cpp
+++ b/src/mame/video/tx0.cpp
@@ -12,6 +12,8 @@
#include "includes/tx0.h"
#include "video/crt.h"
+#include <algorithm>
+
@@ -346,9 +348,11 @@ void tx0_state::tx0_typewriter_linefeed()
uint8_t buf[typewriter_window_width];
int y;
+ assert(typewriter_window_width <= m_typewriter_bitmap.width());
+ assert(typewriter_window_height <= m_typewriter_bitmap.height());
for (y=0; y<typewriter_window_height-typewriter_scroll_step; y++)
{
- extract_scanline8(m_typewriter_bitmap, 0, y+typewriter_scroll_step, typewriter_window_width, buf);
+ std::copy_n(&m_typewriter_bitmap.pix16(y+typewriter_scroll_step, 0), typewriter_window_width, buf);
draw_scanline8(m_typewriter_bitmap, 0, y, typewriter_window_width, buf, m_palette->pens());
}
diff --git a/src/osd/mac/appdelegate.h b/src/osd/mac/appdelegate.h
new file mode 100644
index 00000000000..31daea1240a
--- /dev/null
+++ b/src/osd/mac/appdelegate.h
@@ -0,0 +1,15 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// appdelegate.h - Cocoa app delegate
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#import <Cocoa/Cocoa.h>
+
+@interface MAMEAppDelegate : NSObject <NSApplicationDelegate>
+
+@end
diff --git a/src/osd/mac/appdelegate.mm b/src/osd/mac/appdelegate.mm
new file mode 100644
index 00000000000..4207f515beb
--- /dev/null
+++ b/src/osd/mac/appdelegate.mm
@@ -0,0 +1,54 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// appdelegate.mm - Cocoa app delegate
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#import "appdelegate.h"
+
+extern int mac_run_emulator();
+
+@interface MAMEThread : NSThread
+@end
+
+@implementation MAMEThread
+- (void)main
+{
+ mac_run_emulator();
+}
+@end
+
+@interface MAMEAppDelegate ()
+@end
+
+@implementation MAMEAppDelegate
+MAMEThread *appThread;
+
+- (void)applicationDidFinishLaunching:(NSNotification *)notification
+{
+ // run MAME on a thread so event dispatching happens normally
+ appThread = [[MAMEThread alloc] init];
+ [appThread start];
+}
+
+- (void)applicationWillTerminate:(NSNotification *)notification
+{
+}
+
+- (void)applicationDidBecomeActive:(NSNotification *)notification
+{
+}
+
+- (void)applicationDidResignActive:(NSNotification *)notification
+{
+}
+
+- (NSApplicationTerminateReply)applicationShouldTerminate:(NSNotification *)notification
+{
+ return NSTerminateNow;
+}
+@end
diff --git a/src/osd/mac/macmain.cpp b/src/osd/mac/macmain.cpp
new file mode 100644
index 00000000000..8e50361a2b1
--- /dev/null
+++ b/src/osd/mac/macmain.cpp
@@ -0,0 +1,271 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// macmain.cpp - C++ side main file for MAME on the Mac
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+// oslog callback
+#include <functional>
+
+#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
+#include <Carbon/Carbon.h>
+#include <crt_externs.h>
+#include <unistd.h>
+
+// MAME headers
+#include "osdepend.h"
+#include "emu.h"
+#include "emuopts.h"
+#include "strconv.h"
+
+// OSD headers
+#include "video.h"
+#include "osdmac.h"
+#include "modules/lib/osdlib.h"
+#include "modules/diagnostics/diagnostics_module.h"
+
+//============================================================
+// OPTIONS
+//============================================================
+
+#ifndef INI_PATH
+#define INI_PATH "$HOME/Library/Application Support/APP_NAME;$HOME/.APP_NAME;.;ini"
+#endif // INI_PATH
+
+//============================================================
+// Local variables
+//============================================================
+
+const options_entry mac_options::s_option_entries[] =
+{
+ { MACOPTION_INIPATH, INI_PATH, OPTION_STRING, "path to ini files" },
+
+ // End of list
+ { nullptr }
+};
+
+//============================================================
+// mac_options
+//============================================================
+
+mac_options::mac_options()
+: osd_options()
+{
+ std::string ini_path(INI_PATH);
+ add_entries(mac_options::s_option_entries);
+ strreplace(ini_path,"APP_NAME", emulator_info::get_appname_lower());
+ set_default_value(MACOPTION_INIPATH, ini_path.c_str());
+}
+
+//============================================================
+// main
+//============================================================
+
+// we do some special sauce on Win32...
+int mac_run_emulator()
+{
+ int argc = *_NSGetArgc();
+ char **argv = *_NSGetArgv();
+
+ std::vector<std::string> args = osd_get_command_line(argc, argv);
+ int res = 0;
+
+ // disable I/O buffering
+ setvbuf(stdout, (char *) nullptr, _IONBF, 0);
+ setvbuf(stderr, (char *) nullptr, _IONBF, 0);
+
+ // Initialize crash diagnostics
+ diagnostics_module::get_instance()->init_crash_diagnostics();
+
+ {
+ mac_options options;
+ mac_osd_interface osd(options);
+ osd.register_options();
+ res = emulator_info::start_frontend(options, osd, args);
+ }
+
+ exit(res);
+}
+
+//============================================================
+// constructor
+//============================================================
+
+mac_osd_interface::mac_osd_interface(mac_options &options)
+: osd_common_t(options), m_options(options)
+{
+}
+
+
+//============================================================
+// destructor
+//============================================================
+
+mac_osd_interface::~mac_osd_interface()
+{
+}
+
+
+//============================================================
+// osd_exit
+//============================================================
+
+void mac_osd_interface::osd_exit()
+{
+ osd_common_t::osd_exit();
+}
+
+//============================================================
+// defines_verbose
+//============================================================
+
+#define MAC_EXPAND_STR(_m) #_m
+#define MACRO_VERBOSE(_mac) \
+ do { \
+ if (strcmp(MAC_EXPAND_STR(_mac), #_mac) != 0) \
+ osd_printf_verbose("%s=%s ", #_mac, MAC_EXPAND_STR(_mac)); \
+ } while (0)
+
+#define _mac_VER #mac_MAJOR_VERSION "." #mac_MINOR_VERSION "." #mac_PATCHLEVEL
+
+static void defines_verbose(void)
+{
+ osd_printf_verbose("Build version: %s\n", emulator_info::get_build_version());
+ osd_printf_verbose("Build architecure: ");
+ MACRO_VERBOSE(SDLMAME_ARCH);
+ osd_printf_verbose("\n");
+ osd_printf_verbose("Build defines 1: ");
+ MACRO_VERBOSE(SDLMAME_UNIX);
+ MACRO_VERBOSE(SDLMAME_X11);
+ MACRO_VERBOSE(SDLMAME_WIN32);
+ MACRO_VERBOSE(SDLMAME_MACOSX);
+ MACRO_VERBOSE(SDLMAME_DARWIN);
+ MACRO_VERBOSE(SDLMAME_LINUX);
+ MACRO_VERBOSE(SDLMAME_SOLARIS);
+ MACRO_VERBOSE(SDLMAME_IRIX);
+ MACRO_VERBOSE(SDLMAME_BSD);
+ osd_printf_verbose("\n");
+ osd_printf_verbose("Build defines 1: ");
+ MACRO_VERBOSE(LSB_FIRST);
+ MACRO_VERBOSE(PTR64);
+ MACRO_VERBOSE(MAME_NOASM);
+ MACRO_VERBOSE(MAME_DEBUG);
+ MACRO_VERBOSE(BIGENDIAN);
+ MACRO_VERBOSE(CPP_COMPILE);
+ MACRO_VERBOSE(SYNC_IMPLEMENTATION);
+ osd_printf_verbose("\n");
+ osd_printf_verbose("OpenGL defines: ");
+ MACRO_VERBOSE(USE_OPENGL);
+ MACRO_VERBOSE(USE_DISPATCH_GL);
+ osd_printf_verbose("\n");
+ osd_printf_verbose("Compiler defines A: ");
+ MACRO_VERBOSE(__GNUC__);
+ MACRO_VERBOSE(__GNUC_MINOR__);
+ MACRO_VERBOSE(__GNUC_PATCHLEVEL__);
+ MACRO_VERBOSE(__VERSION__);
+ osd_printf_verbose("\n");
+ osd_printf_verbose("Compiler defines B: ");
+ MACRO_VERBOSE(__amd64__);
+ MACRO_VERBOSE(__x86_64__);
+ MACRO_VERBOSE(__unix__);
+ MACRO_VERBOSE(__i386__);
+ MACRO_VERBOSE(__ppc__);
+ MACRO_VERBOSE(__ppc64__);
+ osd_printf_verbose("\n");
+ osd_printf_verbose("Compiler defines C: ");
+ MACRO_VERBOSE(_FORTIFY_SOURCE);
+ MACRO_VERBOSE(__USE_FORTIFY_LEVEL);
+ osd_printf_verbose("\n");
+}
+
+//============================================================
+// osd_mac_info
+//============================================================
+
+static void osd_mac_info(void)
+{
+}
+
+
+//============================================================
+// video_register
+//============================================================
+
+void mac_osd_interface::video_register()
+{
+ video_options_add("opengl", nullptr);
+ video_options_add("bgfx", nullptr);
+}
+
+//============================================================
+// output_oslog
+//============================================================
+
+void mac_osd_interface::output_oslog(const char *buffer)
+{
+ fputs(buffer, stderr);
+}
+
+
+//============================================================
+// osd_setup_osd_specific_emu_options
+//============================================================
+
+void osd_setup_osd_specific_emu_options(emu_options &opts)
+{
+ opts.add_entries(osd_options::s_option_entries);
+}
+
+
+//============================================================
+// init
+//============================================================
+
+void mac_osd_interface::init(running_machine &machine)
+{
+ // call our parent
+ osd_common_t::init(machine);
+
+ const char *stemp;
+
+ // determine if we are benchmarking, and adjust options appropriately
+ int bench = options().bench();
+ if (bench > 0)
+ {
+ options().set_value(OPTION_THROTTLE, false, OPTION_PRIORITY_MAXIMUM);
+ options().set_value(OSDOPTION_SOUND, "none", OPTION_PRIORITY_MAXIMUM);
+ options().set_value(OSDOPTION_VIDEO, "none", OPTION_PRIORITY_MAXIMUM);
+ options().set_value(OPTION_SECONDS_TO_RUN, bench, OPTION_PRIORITY_MAXIMUM);
+ }
+
+ /* get number of processors */
+ stemp = options().numprocessors();
+
+ osd_num_processors = 0;
+
+ if (strcmp(stemp, "auto") != 0)
+ {
+ osd_num_processors = atoi(stemp);
+ if (osd_num_processors < 1)
+ {
+ osd_printf_warning("numprocessors < 1 doesn't make much sense. Assuming auto ...\n");
+ osd_num_processors = 0;
+ }
+ }
+
+ osd_mac_info();
+
+ defines_verbose();
+
+ osd_common_t::init_subsystems();
+
+ if (options().oslog())
+ {
+ using namespace std::placeholders;
+ machine.add_logerror_callback(std::bind(&mac_osd_interface::output_oslog, this, _1));
+ }
+}
diff --git a/src/osd/mac/main.mm b/src/osd/mac/main.mm
new file mode 100644
index 00000000000..fdc50be53fe
--- /dev/null
+++ b/src/osd/mac/main.mm
@@ -0,0 +1,19 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// main.mm - main file for MAME on Mac
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#import "appdelegate.h"
+
+int main(int argc, char * argv[])
+{
+ [NSApplication sharedApplication];
+ [NSApp setDelegate: [MAMEAppDelegate new]];
+
+ return NSApplicationMain(argc, (const char**)argv);
+}
diff --git a/src/osd/mac/mamefswindow.h b/src/osd/mac/mamefswindow.h
new file mode 100644
index 00000000000..d326b9dfb37
--- /dev/null
+++ b/src/osd/mac/mamefswindow.h
@@ -0,0 +1,15 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// mamefswindow.h - our fullscreen window, subclassed from NSWindow
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#import <Cocoa/Cocoa.h>
+
+@interface MAMEFSWindow : NSWindow
+
+@end
diff --git a/src/osd/mac/mamefswindow.mm b/src/osd/mac/mamefswindow.mm
new file mode 100644
index 00000000000..1fcbdcd02c3
--- /dev/null
+++ b/src/osd/mac/mamefswindow.mm
@@ -0,0 +1,41 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// mamewfsindow.mm - our fullscreen window, subclassed from NSWindow
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#import "mamefswindow.h"
+
+@implementation MAMEFSWindow
+
+-(instancetype)init
+{
+ NSRect screenRect = [[NSScreen mainScreen] frame];
+ self = [super initWithContentRect:screenRect
+ styleMask:NSBorderlessWindowMask
+ backing:NSBackingStoreBuffered
+ defer:YES];
+
+ // Set the window level to be above the menu bar
+ [self setLevel:NSMainMenuWindowLevel+1];
+ [self setOpaque:YES];
+ [self setHidesOnDeactivate:YES];
+
+ return self;
+}
+
+-(BOOL)canBecomeKeyWindow
+{
+ return YES;
+}
+
+- (void)keyDown:(NSEvent *)event
+{
+ [[self windowController] keyDown:event];
+}
+
+@end
diff --git a/src/osd/mac/oglview.h b/src/osd/mac/oglview.h
new file mode 100644
index 00000000000..2f876952cba
--- /dev/null
+++ b/src/osd/mac/oglview.h
@@ -0,0 +1,19 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// oglview.h - our OpenGL view
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#define GL_SILENCE_DEPRECATION (1)
+
+#import <Cocoa/Cocoa.h>
+
+@interface MAMEGLView : NSOpenGLView
+{
+}
+
+@end
diff --git a/src/osd/mac/oglview.mm b/src/osd/mac/oglview.mm
new file mode 100644
index 00000000000..8ef0a94f880
--- /dev/null
+++ b/src/osd/mac/oglview.mm
@@ -0,0 +1,106 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// oglview.mm - our OpenGL view
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#import "oglview.h"
+
+#define SUPPORT_RETINA_RESOLUTION 1
+
+@interface MAMEGLView ()
+{
+}
+@end
+
+@implementation MAMEGLView
+
+- (void) awakeFromNib
+{
+ NSOpenGLPixelFormatAttribute attrs[] =
+ {
+ NSOpenGLPFADoubleBuffer,
+ NSOpenGLPFADepthSize, 24,
+ 0
+ };
+
+ NSOpenGLPixelFormat *pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
+ NSOpenGLContext* context = [[NSOpenGLContext alloc] initWithFormat:pf shareContext:nil];
+
+ [self setPixelFormat:pf];
+ [self setOpenGLContext:context];
+
+#if SUPPORT_RETINA_RESOLUTION
+ // Opt-In to Retina resolution
+ [self setWantsBestResolutionOpenGLSurface:YES];
+#endif // SUPPORT_RETINA_RESOLUTION
+}
+
+- (void) prepareOpenGL
+{
+ [super prepareOpenGL];
+
+ [self initGL];
+}
+
+- (void) windowWillClose:(NSNotification*)notification
+{
+}
+
+- (void) initGL
+{
+ [[self openGLContext] makeCurrentContext];
+ GLint swapInt = 1;
+ [[self openGLContext] setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];
+}
+
+- (void)reshape
+{
+ [super reshape];
+
+ CGLLockContext([[self openGLContext] CGLContextObj]);
+
+// NSRect viewRectPoints = [self bounds];
+
+//#if SUPPORT_RETINA_RESOLUTION
+// NSRect viewRectPixels = [self convertRectToBacking:viewRectPoints];
+//#else
+// NSRect viewRectPixels = viewRectPoints;
+//#endif
+
+ CGLUnlockContext([[self openGLContext] CGLContextObj]);
+}
+
+
+- (void)renewGState
+{
+ [[self window] disableScreenUpdatesUntilFlush];
+ [super renewGState];
+}
+
+- (void) drawRect: (NSRect) theRect
+{
+}
+
+- (void) startDrawView
+{
+ [[self openGLContext] makeCurrentContext];
+
+ CGLLockContext([[self openGLContext] CGLContextObj]);
+}
+
+- (void) completeDrawView
+{
+ CGLFlushDrawable([[self openGLContext] CGLContextObj]);
+ CGLUnlockContext([[self openGLContext] CGLContextObj]);
+}
+
+- (void) dealloc
+{
+ [super dealloc];
+}
+@end
diff --git a/src/osd/mac/osdmac.h b/src/osd/mac/osdmac.h
new file mode 100644
index 00000000000..1ed9e6b8a5b
--- /dev/null
+++ b/src/osd/mac/osdmac.h
@@ -0,0 +1,86 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+#ifndef _osdmac_h_
+#define _osdmac_h_
+
+#include "modules/lib/osdobj_common.h"
+#include "modules/osdmodule.h"
+#include "modules/font/font_module.h"
+
+//============================================================
+// Defines
+//============================================================
+
+#define MACOPTION_INIPATH "inipath"
+
+#define MACOPTVAL_OPENGL "opengl"
+#define MACOPTVAL_BGFX "bgfx"
+#define MACOPTVAL_METAL "metal"
+
+#define MACOPTVAL_GLLIB "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"
+
+//============================================================
+// TYPE DEFINITIONS
+//============================================================
+
+class mac_options : public osd_options
+{
+public:
+ // construction/destruction
+ mac_options();
+
+private:
+ static const options_entry s_option_entries[];
+};
+
+
+class mac_osd_interface : public osd_common_t
+{
+public:
+ // construction/destruction
+ mac_osd_interface(mac_options &options);
+ virtual ~mac_osd_interface();
+
+ // general overridables
+ virtual void init(running_machine &machine) override;
+ virtual void update(bool skip_redraw) override;
+
+ // input overridables
+ virtual void customize_input_type_list(simple_list<input_type_entry> &typelist) override;
+
+ virtual void video_register() override;
+
+ virtual bool video_init() override;
+ virtual bool window_init() override;
+
+ virtual void video_exit() override;
+ virtual void window_exit() override;
+
+ // sdl specific
+ void poll_inputs(running_machine &machine);
+ void release_keys();
+ bool should_hide_mouse();
+ void process_events_buf();
+
+ virtual mac_options &options() override { return m_options; }
+
+protected:
+ virtual void build_slider_list() override;
+ virtual void update_slider_list() override;
+
+private:
+ virtual void osd_exit() override;
+
+ void extract_video_config();
+ void output_oslog(const char *buffer);
+
+ mac_options &m_options;
+};
+
+//============================================================
+// macwork.cpp
+//============================================================
+
+extern int osd_num_processors;
+
+#endif
diff --git a/src/osd/mac/video.cpp b/src/osd/mac/video.cpp
new file mode 100644
index 00000000000..638e7a949b3
--- /dev/null
+++ b/src/osd/mac/video.cpp
@@ -0,0 +1,316 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert, R. Belmont
+//============================================================
+//
+// video.cpp - Mac video handling
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+// MAME headers
+#include "emu.h"
+#include "rendutil.h"
+#include "ui/uimain.h"
+#include "emuopts.h"
+#include "uiinput.h"
+
+
+// MAMEOS headers
+#include "video.h"
+#include "window.h"
+#include "osdmac.h"
+#include "modules/lib/osdlib.h"
+
+//============================================================
+// CONSTANTS
+//============================================================
+
+
+//============================================================
+// GLOBAL VARIABLES
+//============================================================
+
+osd_video_config video_config;
+
+//============================================================
+// LOCAL VARIABLES
+//============================================================
+
+
+//============================================================
+// PROTOTYPES
+//============================================================
+
+static void check_osd_inputs(running_machine &machine);
+
+static void get_resolution(const char *defdata, const char *data, osd_window_config *config, int report_error);
+
+
+//============================================================
+// video_init
+//============================================================
+
+bool mac_osd_interface::video_init()
+{
+ int index;
+
+ // extract data from the options
+ extract_video_config();
+
+ // we need the beam width in a float, contrary to what the core does.
+ video_config.beamwidth = options().beam_width_min();
+
+ // initialize the window system so we can make windows
+ if (!window_init())
+ return false;
+
+ // create the windows
+ for (index = 0; index < video_config.numscreens; index++)
+ {
+ osd_window_config conf;
+ memset(&conf, 0, sizeof(conf));
+ get_resolution(options().resolution(), options().resolution(index), &conf, true);
+
+ // create window ...
+ std::shared_ptr<mac_window_info> win = std::make_shared<mac_window_info>(machine(), index, m_monitor_module->pick_monitor(reinterpret_cast<osd_options &>(options()), index), &conf);
+
+ if (win->window_init())
+ return false;
+ }
+
+ return true;
+}
+
+//============================================================
+// video_exit
+//============================================================
+
+void mac_osd_interface::video_exit()
+{
+ window_exit();
+}
+
+//============================================================
+// update
+//============================================================
+
+void mac_osd_interface::update(bool skip_redraw)
+{
+ osd_common_t::update(skip_redraw);
+
+ // if we're not skipping this redraw, update all windows
+ if (!skip_redraw)
+ {
+// profiler_mark(PROFILER_BLIT);
+ for (auto window : osd_common_t::s_window_list)
+ window->update();
+// profiler_mark(PROFILER_END);
+ }
+
+ // poll the joystick values here
+ downcast<mac_osd_interface&>(machine().osd()).poll_inputs(machine());
+
+ check_osd_inputs(machine());
+ // if we're running, disable some parts of the debugger
+ if ((machine().debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0)
+ debugger_update();
+}
+
+//============================================================
+// check_osd_inputs
+//============================================================
+
+static void check_osd_inputs(running_machine &machine)
+{
+ // check for toggling fullscreen mode
+ if (machine.ui_input().pressed(IPT_OSD_1))
+ {
+ for (auto curwin : osd_common_t::s_window_list)
+ std::static_pointer_cast<mac_window_info>(curwin)->toggle_full_screen();
+ }
+
+ auto window = osd_common_t::s_window_list.front();
+ if (machine.ui_input().pressed(IPT_OSD_2))
+ {
+ //FIXME: on a per window basis
+ video_config.fullstretch = !video_config.fullstretch;
+ window->target()->set_scale_mode(video_config.fullstretch? SCALE_FRACTIONAL : SCALE_INTEGER);
+ machine.ui().popup_time(1, "Uneven stretch %s", video_config.fullstretch? "enabled":"disabled");
+ }
+
+ if (machine.ui_input().pressed(IPT_OSD_4))
+ {
+ //FIXME: on a per window basis
+ video_config.keepaspect = !video_config.keepaspect;
+ window->target()->set_keepaspect(video_config.keepaspect);
+ machine.ui().popup_time(1, "Keepaspect %s", video_config.keepaspect? "enabled":"disabled");
+ }
+
+ //FIXME: on a per window basis
+ if (machine.ui_input().pressed(IPT_OSD_5))
+ {
+ video_config.filter = !video_config.filter;
+ machine.ui().popup_time(1, "Filter %s", video_config.filter? "enabled":"disabled");
+ }
+
+ if (machine.ui_input().pressed(IPT_OSD_6))
+ std::static_pointer_cast<mac_window_info>(window)->modify_prescale(-1);
+
+ if (machine.ui_input().pressed(IPT_OSD_7))
+ std::static_pointer_cast<mac_window_info>(window)->modify_prescale(1);
+
+ if (machine.ui_input().pressed(IPT_OSD_8))
+ window->renderer().record();
+}
+
+//============================================================
+// extract_video_config
+//============================================================
+
+void mac_osd_interface::extract_video_config()
+{
+ const char *stemp;
+
+ // global options: extract the data
+ video_config.windowed = options().window();
+ video_config.prescale = options().prescale();
+ video_config.filter = options().filter();
+ video_config.keepaspect = options().keep_aspect();
+ video_config.numscreens = options().numscreens();
+ video_config.fullstretch = options().uneven_stretch();
+
+ // if we are in debug mode, never go full screen
+ if (machine().debug_flags & DEBUG_FLAG_OSD_ENABLED)
+ video_config.windowed = true;
+
+ // default to working video please
+ video_config.novideo = 0;
+
+ // d3d options: extract the data
+ stemp = options().video();
+ if (strcmp(stemp, "auto") == 0)
+ {
+ stemp = "opengl";
+ }
+
+ if (strcmp(stemp, OSDOPTVAL_NONE) == 0)
+ {
+ video_config.mode = VIDEO_MODE_SOFT;
+ video_config.novideo = 1;
+
+ if (!emulator_info::standalone() && options().seconds_to_run() == 0)
+ osd_printf_warning("Warning: -video none doesn't make much sense without -seconds_to_run\n");
+ }
+
+ else if (strcmp(stemp, MACOPTVAL_OPENGL) == 0)
+ video_config.mode = VIDEO_MODE_OPENGL;
+ else if (strcmp(stemp, MACOPTVAL_BGFX) == 0)
+ {
+ video_config.mode = VIDEO_MODE_BGFX;
+ }
+ else
+ {
+ osd_printf_warning("Invalid video value %s; reverting to OpenGL\n", stemp);
+ video_config.mode = VIDEO_MODE_OPENGL;
+ }
+
+ video_config.switchres = options().switch_res();
+ video_config.waitvsync = options().wait_vsync();
+ video_config.syncrefresh = options().sync_refresh();
+ if (!video_config.waitvsync && video_config.syncrefresh)
+ {
+ osd_printf_warning("-syncrefresh specified without -waitvsync. Reverting to -nosyncrefresh\n");
+ video_config.syncrefresh = 0;
+ }
+
+ if (video_config.prescale < 1 || video_config.prescale > 3)
+ {
+ osd_printf_warning("Invalid prescale option, reverting to '1'\n");
+ video_config.prescale = 1;
+ }
+
+ // default to working video please
+ video_config.forcepow2texture = options().gl_force_pow2_texture();
+ video_config.allowtexturerect = !(options().gl_no_texture_rect());
+ video_config.vbo = options().gl_vbo();
+ video_config.pbo = options().gl_pbo();
+ video_config.glsl = options().gl_glsl();
+ if ( video_config.glsl )
+ {
+ int i;
+ video_config.glsl_filter = options().glsl_filter();
+ video_config.glsl_shader_mamebm_num=0;
+ for(i=0; i<GLSL_SHADER_MAX; i++)
+ {
+ stemp = options().shader_mame(i);
+ if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
+ {
+ video_config.glsl_shader_mamebm[i] = (char *) malloc(strlen(stemp)+1);
+ strcpy(video_config.glsl_shader_mamebm[i], stemp);
+ video_config.glsl_shader_mamebm_num++;
+ } else {
+ video_config.glsl_shader_mamebm[i] = nullptr;
+ }
+ }
+ video_config.glsl_shader_scrn_num=0;
+ for(i=0; i<GLSL_SHADER_MAX; i++)
+ {
+ stemp = options().shader_screen(i);
+ if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
+ {
+ video_config.glsl_shader_scrn[i] = (char *) malloc(strlen(stemp)+1);
+ strcpy(video_config.glsl_shader_scrn[i], stemp);
+ video_config.glsl_shader_scrn_num++;
+ } else {
+ video_config.glsl_shader_scrn[i] = nullptr;
+ }
+ }
+ } else {
+ int i;
+ video_config.glsl_filter = 0;
+ video_config.glsl_shader_mamebm_num=0;
+ for(i=0; i<GLSL_SHADER_MAX; i++)
+ {
+ video_config.glsl_shader_mamebm[i] = nullptr;
+ }
+ video_config.glsl_shader_scrn_num=0;
+ for(i=0; i<GLSL_SHADER_MAX; i++)
+ {
+ video_config.glsl_shader_scrn[i] = nullptr;
+ }
+ }
+
+ // misc options: sanity check values
+
+ // global options: sanity check values
+ if (video_config.numscreens < 1 || video_config.numscreens > MAX_VIDEO_WINDOWS)
+ {
+ osd_printf_warning("Invalid numscreens value %d; reverting to 1\n", video_config.numscreens);
+ video_config.numscreens = 1;
+ }
+}
+
+
+//============================================================
+// get_resolution
+//============================================================
+
+static void get_resolution(const char *defdata, const char *data, osd_window_config *config, int report_error)
+{
+ config->width = config->height = config->depth = config->refresh = 0;
+ if (strcmp(data, OSDOPTVAL_AUTO) == 0)
+ {
+ if (strcmp(defdata, OSDOPTVAL_AUTO) == 0)
+ return;
+ data = defdata;
+ }
+
+ if (sscanf(data, "%dx%dx%d", &config->width, &config->height, &config->depth) < 2 && report_error)
+ osd_printf_error("Illegal resolution value = %s\n", data);
+
+ const char * at_pos = strchr(data, '@');
+ if (at_pos)
+ if (sscanf(at_pos + 1, "%d", &config->refresh) < 1 && report_error)
+ osd_printf_error("Illegal refresh rate in resolution value = %s\n", data);
+}
diff --git a/src/osd/mac/window.cpp b/src/osd/mac/window.cpp
new file mode 100644
index 00000000000..3993b3502d2
--- /dev/null
+++ b/src/osd/mac/window.cpp
@@ -0,0 +1,970 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert, R. Belmont
+//============================================================
+//
+// window.cpp - Mac window handling
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+// standard C headers
+#include <math.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+#include <list>
+#include <memory>
+
+// MAME headers
+#include "emu.h"
+#include "emuopts.h"
+#include "render.h"
+#include "ui/uimain.h"
+
+// OSD headers
+
+#include "window.h"
+#include "osdmac.h"
+#include "modules/render/drawbgfx.h"
+#include "modules/render/drawogl.h"
+#include "modules/monitor/monitor_common.h"
+
+//============================================================
+// PARAMETERS
+//============================================================
+
+// these are arbitrary values since AFAIK there's no way to make X/SDL tell you
+#define WINDOW_DECORATION_WIDTH (8) // should be more than plenty
+#define WINDOW_DECORATION_HEIGHT (48) // title bar + bottom drag region
+
+// minimum window dimension
+#define MIN_WINDOW_DIM 200
+
+#define WMSZ_TOP (0)
+#define WMSZ_BOTTOM (1)
+#define WMSZ_BOTTOMLEFT (2)
+#define WMSZ_BOTTOMRIGHT (3)
+#define WMSZ_LEFT (4)
+#define WMSZ_TOPLEFT (5)
+#define WMSZ_TOPRIGHT (6)
+#define WMSZ_RIGHT (7)
+
+// debugger
+//static int in_background;
+
+
+//============================================================
+// PROTOTYPES
+//============================================================
+
+
+//============================================================
+// window_init
+// (main thread)
+//============================================================
+
+bool mac_osd_interface::window_init()
+{
+ osd_printf_verbose("Enter macwindow_init\n");
+
+ // initialize the drawers
+
+ switch (video_config.mode)
+ {
+ case VIDEO_MODE_BGFX:
+ renderer_bgfx::init(machine());
+ break;
+ case VIDEO_MODE_OPENGL:
+ renderer_ogl::init(machine());
+ break;
+ }
+
+ // set up the window list
+ osd_printf_verbose("Leave macwindow_init\n");
+ return true;
+}
+
+
+void mac_osd_interface::update_slider_list()
+{
+ for (auto window : osd_common_t::s_window_list)
+ {
+ // check if any window has dirty sliders
+ if (window->renderer().sliders_dirty())
+ {
+ build_slider_list();
+ return;
+ }
+ }
+}
+
+void mac_osd_interface::build_slider_list()
+{
+ m_sliders.clear();
+
+ for (auto window : osd_common_t::s_window_list)
+ {
+ std::vector<ui::menu_item> window_sliders = window->renderer().get_slider_list();
+ m_sliders.insert(m_sliders.end(), window_sliders.begin(), window_sliders.end());
+ }
+}
+
+//============================================================
+// macwindow_exit
+// (main thread)
+//============================================================
+
+void mac_osd_interface::window_exit()
+{
+ osd_printf_verbose("Enter macwindow_exit\n");
+
+ // free all the windows
+ while (!osd_common_t::s_window_list.empty())
+ {
+ auto window = osd_common_t::s_window_list.front();
+
+ // Part of destroy removes the window from the list
+ window->destroy();
+ }
+
+ switch(video_config.mode)
+ {
+ case VIDEO_MODE_BGFX:
+ renderer_bgfx::exit();
+ break;
+ case VIDEO_MODE_OPENGL:
+ renderer_ogl::exit();
+ break;
+ default:
+ break;
+ }
+ osd_printf_verbose("Leave macwindow_exit\n");
+}
+
+void mac_window_info::capture_pointer()
+{
+ if (!m_mouse_captured)
+ {
+ m_mouse_captured = true;
+ }
+}
+
+void mac_window_info::release_pointer()
+{
+ if (m_mouse_captured)
+ {
+ m_mouse_captured = false;
+ }
+}
+
+void mac_window_info::hide_pointer()
+{
+ if (!m_mouse_hidden)
+ {
+ m_mouse_hidden = true;
+ }
+}
+
+void mac_window_info::show_pointer()
+{
+ if (m_mouse_hidden)
+ {
+ m_mouse_hidden = false;
+ }
+}
+
+
+//============================================================
+// macwindow_resize
+//============================================================
+
+void mac_window_info::resize(int32_t width, int32_t height)
+{
+ osd_dim cd = get_size();
+
+ if (width != cd.width() || height != cd.height())
+ {
+ // TODO: change window size here
+ renderer().notify_changed();
+ }
+}
+
+
+//============================================================
+// notify_changed
+//============================================================
+
+void mac_window_info::notify_changed()
+{
+ renderer().notify_changed();
+}
+
+
+//============================================================
+// toggle_full_screen
+//============================================================
+
+void mac_window_info::toggle_full_screen()
+{
+ // if we are in debug mode, never go full screen
+ if (machine().debug_flags & DEBUG_FLAG_OSD_ENABLED)
+ return;
+
+ // If we are going fullscreen (leaving windowed) remember our windowed size
+ if (!fullscreen())
+ {
+ m_windowed_dim = get_size();
+ }
+
+ // reset UI to main menu
+ machine().ui().menu_reset();
+ // kill off the drawers
+ renderer_reset();
+ if (fullscreen() && video_config.switchres)
+ {
+ }
+ //SDL_DestroyWindow(platform_window());
+ //set_platform_window(nullptr);
+
+ downcast<mac_osd_interface &>(machine().osd()).release_keys();
+
+ set_renderer(osd_renderer::make_for_type(video_config.mode, shared_from_this()));
+
+ // toggle the window mode
+ set_fullscreen(!fullscreen());
+
+ complete_create();
+}
+
+void mac_window_info::modify_prescale(int dir)
+{
+ int new_prescale = prescale();
+
+ if (dir > 0 && prescale() < 3)
+ new_prescale = prescale() + 1;
+ if (dir < 0 && prescale() > 1)
+ new_prescale = prescale() - 1;
+
+ if (new_prescale != prescale())
+ {
+ if (m_fullscreen && video_config.switchres)
+ {
+ complete_destroy();
+
+ m_prescale = new_prescale;
+
+ complete_create();
+ }
+ else
+ {
+ notify_changed();
+ m_prescale = new_prescale;
+ }
+ machine().ui().popup_time(1, "Prescale %d", prescale());
+ }
+}
+
+//============================================================
+// update_cursor_state
+// (main or window thread)
+//============================================================
+
+void mac_window_info::update_cursor_state()
+{
+ // do not do mouse capture if the debugger's enabled to avoid
+ // the possibility of losing control
+ if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
+ {
+ bool should_hide_mouse = downcast<mac_osd_interface&>(machine().osd()).should_hide_mouse();
+
+ if (!fullscreen() && !should_hide_mouse)
+ {
+ show_pointer();
+ release_pointer();
+ }
+ else
+ {
+ hide_pointer();
+ capture_pointer();
+ }
+ }
+}
+
+int mac_window_info::xy_to_render_target(int x, int y, int *xt, int *yt)
+{
+ return renderer().xy_to_render_target(x, y, xt, yt);
+}
+
+//============================================================
+// mac_window_info::window_init
+// (main thread)
+//============================================================
+
+int mac_window_info::window_init()
+{
+ int result;
+
+ // set the initial maximized state
+ // FIXME: Does not belong here
+ mac_options &options = downcast<mac_options &>(m_machine.options());
+ m_startmaximized = options.maximize();
+
+ // add us to the list
+ osd_common_t::s_window_list.push_back(std::static_pointer_cast<mac_window_info>(shared_from_this()));
+
+ set_renderer(osd_renderer::make_for_type(video_config.mode, static_cast<osd_window*>(this)->shared_from_this()));
+
+ // load the layout
+ m_target = m_machine.render().target_alloc();
+
+ // set the specific view
+ set_starting_view(m_index, options.view(), options.view(m_index));
+
+ // make the window title
+ if (video_config.numscreens == 1)
+ sprintf(m_title, "%s: %s [%s]", emulator_info::get_appname(), m_machine.system().type.fullname(), m_machine.system().name);
+ else
+ sprintf(m_title, "%s: %s [%s] - Screen %d", emulator_info::get_appname(), m_machine.system().type.fullname(), m_machine.system().name, m_index);
+
+ result = complete_create();
+
+ // handle error conditions
+ if (result == 1)
+ goto error;
+
+ return 0;
+
+error:
+ destroy();
+ return 1;
+}
+
+
+//============================================================
+// mac_window_info::complete_destroy
+//============================================================
+
+void mac_window_info::complete_destroy()
+{
+ // Release pointer grab and hide if needed
+ show_pointer();
+ release_pointer();
+
+ if (fullscreen() && video_config.switchres)
+ {
+ }
+
+ //SDL_DestroyWindow(platform_window());
+ // release all keys ...
+ downcast<mac_osd_interface &>(machine().osd()).release_keys();
+}
+
+void mac_window_info::destroy()
+{
+ // remove us from the list
+ osd_common_t::s_window_list.remove(std::static_pointer_cast<mac_window_info>(shared_from_this()));
+
+ // free the textures etc
+ complete_destroy();
+
+ // free the render target, after the textures!
+ machine().render().target_free(m_target);
+}
+
+
+//============================================================
+// pick_best_mode
+//============================================================
+
+osd_dim mac_window_info::pick_best_mode()
+{
+// int minimum_width, minimum_height, target_width, target_height;
+// int i;
+// int num;
+// float size_score, best_score = 0.0f;
+ osd_dim ret(0,0);
+#if 0
+ // determine the minimum width/height for the selected target
+ m_target->compute_minimum_size(minimum_width, minimum_height);
+
+ // use those as the target for now
+ target_width = minimum_width * std::max(1, prescale());
+ target_height = minimum_height * std::max(1, prescale());
+
+ // if we're not stretching, allow some slop on the minimum since we can handle it
+ {
+ minimum_width -= 4;
+ minimum_height -= 4;
+ }
+
+ // FIXME: this should be provided by monitor !
+ num = SDL_GetNumDisplayModes(m_monitor->oshandle());
+
+ if (num == 0)
+ {
+ osd_printf_error("SDL: No modes available?!\n");
+ exit(-1);
+ }
+ else
+ {
+ for (i = 0; i < num; ++i)
+ {
+ SDL_DisplayMode mode;
+ SDL_GetDisplayMode(m_monitor->oshandle(), i, &mode);
+
+ // compute initial score based on difference between target and current
+ size_score = 1.0f / (1.0f + abs((int32_t)mode.w - target_width) + abs((int32_t)mode.h - target_height));
+
+ // if the mode is too small, give a big penalty
+ if (mode.w < minimum_width || mode.h < minimum_height)
+ size_score *= 0.01f;
+
+ // if mode is smaller than we'd like, it only scores up to 0.1
+ if (mode.w < target_width || mode.h < target_height)
+ size_score *= 0.1f;
+
+ // if we're looking for a particular mode, that's a winner
+ if (mode.w == m_win_config.width && mode.h == m_win_config.height)
+ size_score = 2.0f;
+
+ // refresh adds some points
+ if (m_win_config.refresh)
+ size_score *= 1.0f / (1.0f + abs(m_win_config.refresh - mode.refresh_rate) / 10.0f);
+
+ osd_printf_verbose("%4dx%4d@%2d -> %f\n", (int)mode.w, (int)mode.h, (int) mode.refresh_rate, (double) size_score);
+
+ // best so far?
+ if (size_score > best_score)
+ {
+ best_score = size_score;
+ ret = osd_dim(mode.w, mode.h);
+ }
+
+ }
+ }
+#endif
+ return ret;
+}
+
+//============================================================
+// sdlwindow_video_window_update
+// (main thread)
+//============================================================
+
+void mac_window_info::update()
+{
+ osd_ticks_t event_wait_ticks;
+
+ // adjust the cursor state
+ //sdlwindow_update_cursor_state(machine, window);
+
+ update_cursor_state();
+
+ // if we're visible and running and not in the middle of a resize, draw
+ if (m_target != nullptr)
+ {
+ int tempwidth, tempheight;
+
+ // see if the games video mode has changed
+ m_target->compute_minimum_size(tempwidth, tempheight);
+ if (osd_dim(tempwidth, tempheight) != m_minimum_dim)
+ {
+ m_minimum_dim = osd_dim(tempwidth, tempheight);
+
+ if (!this->m_fullscreen)
+ {
+ //Don't resize window without user interaction;
+ //window_resize(blitwidth, blitheight);
+ }
+ else if (video_config.switchres)
+ {
+ osd_dim tmp = this->pick_best_mode();
+ resize(tmp.width(), tmp.height());
+ }
+ }
+
+ if (video_config.waitvsync && video_config.syncrefresh)
+ event_wait_ticks = osd_ticks_per_second(); // block at most a second
+ else
+ event_wait_ticks = 0;
+
+ if (m_rendered_event.wait(event_wait_ticks))
+ {
+ const int update = 1;
+
+ // ensure the target bounds are up-to-date, and then get the primitives
+
+ render_primitive_list &primlist = *renderer().get_primitives();
+
+ // and redraw now
+
+ // Some configurations require events to be polled in the worker thread
+ downcast< mac_osd_interface& >(machine().osd()).process_events_buf();
+
+ // Check whether window has vector screens
+
+ {
+ const screen_device *screen = screen_device_iterator(machine().root_device()).byindex(m_index);
+ if ((screen != nullptr) && (screen->screen_type() == SCREEN_TYPE_VECTOR))
+ renderer().set_flags(osd_renderer::FLAG_HAS_VECTOR_SCREEN);
+ else
+ renderer().clear_flags(osd_renderer::FLAG_HAS_VECTOR_SCREEN);
+ }
+
+ m_primlist = &primlist;
+
+ // if no bitmap, just fill
+ if (m_primlist == nullptr)
+ {
+ }
+ // otherwise, render with our drawing system
+ else
+ {
+ if( video_config.perftest )
+ measure_fps(update);
+ else
+ renderer().draw(update);
+ }
+
+ /* all done, ready for next */
+ m_rendered_event.set();
+ }
+ }
+}
+
+
+//============================================================
+// set_starting_view
+// (main thread)
+//============================================================
+
+void mac_window_info::set_starting_view(int index, const char *defview, const char *view)
+{
+ int viewindex;
+
+ // choose non-auto over auto
+ if (strcmp(view, "auto") == 0 && strcmp(defview, "auto") != 0)
+ view = defview;
+
+ // query the video system to help us pick a view
+ viewindex = target()->configured_view(view, index, video_config.numscreens);
+
+ // set the view
+ target()->set_view(viewindex);
+}
+
+
+//============================================================
+// complete_create
+//============================================================
+
+extern void *CreateMAMEWindow(char *title, int x, int y, int w, int h, bool isFullscreen);
+extern void *GetOSWindow(void *wincontroller);
+
+int mac_window_info::complete_create()
+{
+ osd_dim temp(0,0);
+
+ // clear out original mode. Needed on OSX
+ if (fullscreen())
+ {
+ // default to the current mode exactly
+ temp = monitor()->position_size().dim();
+
+ // if we're allowed to switch resolutions, override with something better
+ if (video_config.switchres)
+ temp = pick_best_mode();
+ }
+ else if (m_windowed_dim.width() > 0)
+ {
+ // if we have a remembered size force the new window size to it
+ temp = m_windowed_dim;
+ }
+ else if (m_startmaximized)
+ temp = get_max_bounds(video_config.keepaspect );
+ else
+ temp = get_min_bounds(video_config.keepaspect );
+
+ // create the window .....
+ osd_printf_verbose("Enter mac_window_info::complete_create\n");
+
+ // get monitor work area for centering
+ osd_rect work = monitor()->usuable_position_size();
+
+ auto window = CreateMAMEWindow(m_title,
+ work.left() + (work.width() - temp.width()) / 2,
+ work.top() + (work.height() - temp.height()) / 2,
+ temp.width(), temp.height(), fullscreen());
+
+ if (window == nullptr)
+ {
+ osd_printf_error("Window creation failed!\n");
+ return 1;
+ }
+
+ set_platform_window(window);
+
+ // set main window
+ if (m_index > 0)
+ {
+ for (auto w : osd_common_t::s_window_list)
+ {
+ if (w->m_index == 0)
+ {
+ set_main_window(std::dynamic_pointer_cast<osd_window>(w));
+ break;
+ }
+ }
+ }
+ else
+ {
+ // We must be the main window
+ set_main_window(shared_from_this());
+ }
+
+ // update monitor resolution after mode change to ensure proper pixel aspect
+ monitor()->refresh();
+ if (fullscreen() && video_config.switchres)
+ monitor()->update_resolution(temp.width(), temp.height());
+
+ // initialize the drawing backend
+ if (renderer().create())
+ {
+ osd_printf_verbose("Exiting mac_window_info::complete_create\n");
+ return 1;
+ }
+
+ return 0;
+}
+
+
+//============================================================
+// draw_video_contents
+// (window thread)
+//============================================================
+
+void mac_window_info::measure_fps(int update)
+{
+ const unsigned long frames_skip4fps = 100;
+ static int64_t lastTime=0, sumdt=0, startTime=0;
+ static unsigned long frames = 0;
+ int64_t currentTime, t0;
+ double dt;
+ double tps;
+ osd_ticks_t tps_t;
+
+ tps_t = osd_ticks_per_second();
+ tps = (double) tps_t;
+
+ t0 = osd_ticks();
+
+ renderer().draw(update);
+
+ frames++;
+ currentTime = osd_ticks();
+ if(startTime==0||frames==frames_skip4fps)
+ startTime=currentTime;
+ if( frames>=frames_skip4fps )
+ sumdt+=currentTime-t0;
+ if( (currentTime-lastTime)>1L*osd_ticks_per_second() && frames>frames_skip4fps )
+ {
+ dt = (double) (currentTime-startTime) / tps; // in decimale sec.
+ osd_printf_info("%6.2lfs, %4lu F, "
+ "avrg game: %5.2lf FPS %.2lf ms/f, "
+ "avrg video: %5.2lf FPS %.2lf ms/f, "
+ "last video: %5.2lf FPS %.2lf ms/f\n",
+ dt, frames-frames_skip4fps,
+ (double)(frames-frames_skip4fps)/dt, // avrg game fps
+ ( (currentTime-startTime) / ((frames-frames_skip4fps)) ) * 1000.0 / osd_ticks_per_second(),
+ (double)(frames-frames_skip4fps)/((double)(sumdt) / tps), // avrg vid fps
+ ( sumdt / ((frames-frames_skip4fps)) ) * 1000.0 / tps,
+ 1.0/((currentTime-t0) / osd_ticks_per_second()), // this vid fps
+ (currentTime-t0) * 1000.0 / tps
+ );
+ lastTime = currentTime;
+ }
+}
+
+int mac_window_info::wnd_extra_width()
+{
+ return m_fullscreen ? 0 : WINDOW_DECORATION_WIDTH;
+}
+
+int mac_window_info::wnd_extra_height()
+{
+ return m_fullscreen ? 0 : WINDOW_DECORATION_HEIGHT;
+}
+
+
+//============================================================
+// constrain_to_aspect_ratio
+// (window thread)
+//============================================================
+
+osd_rect mac_window_info::constrain_to_aspect_ratio(const osd_rect &rect, int adjustment)
+{
+ int32_t extrawidth = wnd_extra_width();
+ int32_t extraheight = wnd_extra_height();
+ int32_t propwidth, propheight;
+ int32_t minwidth, minheight;
+ int32_t maxwidth, maxheight;
+ int32_t viswidth, visheight;
+ int32_t adjwidth, adjheight;
+ float pixel_aspect;
+ std::shared_ptr<osd_monitor_info> monitor = m_monitor;
+
+ // do not constrain aspect ratio for integer scaled views
+ if (m_target->scale_mode() != SCALE_FRACTIONAL)
+ return rect;
+
+ // get the pixel aspect ratio for the target monitor
+ pixel_aspect = monitor->pixel_aspect();
+
+ // determine the proposed width/height
+ propwidth = rect.width() - extrawidth;
+ propheight = rect.height() - extraheight;
+
+ // based on which edge we are adjusting, take either the width, height, or both as gospel
+ // and scale to fit using that as our parameter
+ switch (adjustment)
+ {
+ case WMSZ_BOTTOM:
+ case WMSZ_TOP:
+ m_target->compute_visible_area(10000, propheight, pixel_aspect, m_target->orientation(), propwidth, propheight);
+ break;
+
+ case WMSZ_LEFT:
+ case WMSZ_RIGHT:
+ m_target->compute_visible_area(propwidth, 10000, pixel_aspect, m_target->orientation(), propwidth, propheight);
+ break;
+
+ default:
+ m_target->compute_visible_area(propwidth, propheight, pixel_aspect, m_target->orientation(), propwidth, propheight);
+ break;
+ }
+
+ // get the minimum width/height for the current layout
+ m_target->compute_minimum_size(minwidth, minheight);
+
+ // clamp against the absolute minimum
+ propwidth = std::max(propwidth, MIN_WINDOW_DIM);
+ propheight = std::max(propheight, MIN_WINDOW_DIM);
+
+ // clamp against the minimum width and height
+ propwidth = std::max(propwidth, minwidth);
+ propheight = std::max(propheight, minheight);
+
+ // clamp against the maximum (fit on one screen for full screen mode)
+ if (m_fullscreen)
+ {
+ maxwidth = monitor->position_size().width() - extrawidth;
+ maxheight = monitor->position_size().height() - extraheight;
+ }
+ else
+ {
+ maxwidth = monitor->usuable_position_size().width() - extrawidth;
+ maxheight = monitor->usuable_position_size().height() - extraheight;
+
+ // further clamp to the maximum width/height in the window
+ if (m_win_config.width != 0)
+ maxwidth = std::min(maxwidth, m_win_config.width + extrawidth);
+ if (m_win_config.height != 0)
+ maxheight = std::min(maxheight, m_win_config.height + extraheight);
+ }
+
+ // clamp to the maximum
+ propwidth = std::min(propwidth, maxwidth);
+ propheight = std::min(propheight, maxheight);
+
+ // compute the visible area based on the proposed rectangle
+ m_target->compute_visible_area(propwidth, propheight, pixel_aspect, m_target->orientation(), viswidth, visheight);
+
+ // compute the adjustments we need to make
+ adjwidth = (viswidth + extrawidth) - rect.width();
+ adjheight = (visheight + extraheight) - rect.height();
+
+ // based on which corner we're adjusting, constrain in different ways
+ osd_rect ret(rect);
+
+ switch (adjustment)
+ {
+ case WMSZ_BOTTOM:
+ case WMSZ_BOTTOMRIGHT:
+ case WMSZ_RIGHT:
+ ret = rect.resize(rect.width() + adjwidth, rect.height() + adjheight);
+ break;
+
+ case WMSZ_BOTTOMLEFT:
+ ret = rect.move_by(-adjwidth, 0).resize(rect.width() + adjwidth, rect.height() + adjheight);
+ break;
+
+ case WMSZ_LEFT:
+ case WMSZ_TOPLEFT:
+ case WMSZ_TOP:
+ ret = rect.move_by(-adjwidth, -adjheight).resize(rect.width() + adjwidth, rect.height() + adjheight);
+ break;
+
+ case WMSZ_TOPRIGHT:
+ ret = rect.move_by(0, -adjheight).resize(rect.width() + adjwidth, rect.height() + adjheight);
+ break;
+}
+ return ret;
+}
+
+
+
+//============================================================
+// get_min_bounds
+// (window thread)
+//============================================================
+
+osd_dim mac_window_info::get_min_bounds(int constrain)
+{
+ int32_t minwidth, minheight;
+
+ //assert(GetCurrentThreadId() == window_threadid);
+
+ // get the minimum target size
+ m_target->compute_minimum_size(minwidth, minheight);
+
+ // expand to our minimum dimensions
+ if (minwidth < MIN_WINDOW_DIM)
+ minwidth = MIN_WINDOW_DIM;
+ if (minheight < MIN_WINDOW_DIM)
+ minheight = MIN_WINDOW_DIM;
+
+ // account for extra window stuff
+ minwidth += wnd_extra_width();
+ minheight += wnd_extra_height();
+
+ // if we want it constrained, figure out which one is larger
+ if (constrain && m_target->scale_mode() == SCALE_FRACTIONAL)
+ {
+ // first constrain with no height limit
+ osd_rect test1(0,0,minwidth,10000);
+ test1 = constrain_to_aspect_ratio(test1, WMSZ_BOTTOMRIGHT);
+
+ // then constrain with no width limit
+ osd_rect test2(0,0,10000,minheight);
+ test2 = constrain_to_aspect_ratio(test2, WMSZ_BOTTOMRIGHT);
+
+ // pick the larger
+ if (test1.width() > test2.width())
+ {
+ minwidth = test1.width();
+ minheight = test1.height();
+ }
+ else
+ {
+ minwidth = test2.width();
+ minheight = test2.height();
+ }
+ }
+
+ // remove extra window stuff
+ minwidth -= wnd_extra_width();
+ minheight -= wnd_extra_height();
+
+ return osd_dim(minwidth, minheight);
+}
+
+//============================================================
+// get_size
+//============================================================
+
+osd_dim mac_window_info::get_size()
+{
+ int w=0; int h=0;
+ // TODO: get window size from ObjC
+// SDL_GetWindowSize(platform_window(), &w, &h);
+ return osd_dim(w,h);
+}
+
+
+//============================================================
+// get_max_bounds
+// (window thread)
+//============================================================
+
+osd_dim mac_window_info::get_max_bounds(int constrain)
+{
+ //assert(GetCurrentThreadId() == window_threadid);
+
+ // compute the maximum client area
+ // m_monitor->refresh();
+ osd_rect maximum = m_monitor->usuable_position_size();
+
+ // clamp to the window's max
+ int tempw = maximum.width();
+ int temph = maximum.height();
+ if (m_win_config.width != 0)
+ {
+ int temp = m_win_config.width + wnd_extra_width();
+ if (temp < maximum.width())
+ tempw = temp;
+ }
+ if (m_win_config.height != 0)
+ {
+ int temp = m_win_config.height + wnd_extra_height();
+ if (temp < maximum.height())
+ temph = temp;
+ }
+
+ maximum = maximum.resize(tempw, temph);
+
+ // constrain to fit
+ if (constrain && m_target->scale_mode() == SCALE_FRACTIONAL)
+ maximum = constrain_to_aspect_ratio(maximum, WMSZ_BOTTOMRIGHT);
+
+ // remove extra window stuff
+ maximum = maximum.resize(maximum.width() - wnd_extra_width(), maximum.height() - wnd_extra_height());
+
+ return maximum.dim();
+}
+
+//============================================================
+// construction and destruction
+//============================================================
+
+mac_window_info::mac_window_info(
+ running_machine &a_machine,
+ int index,
+ std::shared_ptr<osd_monitor_info> a_monitor,
+ const osd_window_config *config)
+ : osd_window_t(*config)
+ , m_next(nullptr)
+ , m_startmaximized(0)
+ // Following three are used by input code to defer resizes
+ , m_minimum_dim(0, 0)
+ , m_windowed_dim(0, 0)
+ , m_rendered_event(0, 1)
+ , m_target(nullptr)
+ , m_machine(a_machine)
+ , m_monitor(a_monitor)
+ , m_fullscreen(0)
+ , m_mouse_captured(false)
+ , m_mouse_hidden(false)
+{
+ m_index = index;
+
+ //FIXME: these should be per_window in config-> or even better a bit set
+ m_fullscreen = !video_config.windowed;
+ m_prescale = video_config.prescale;
+
+ m_windowed_dim = osd_dim(config->width, config->height);
+}
+
+mac_window_info::~mac_window_info()
+{
+}
+
+
+//============================================================
+// osd_set_aggressive_input_focus
+//============================================================
+
+void osd_set_aggressive_input_focus(bool aggressive_focus)
+{
+ // dummy implementation for now
+}
diff --git a/src/osd/mac/window.h b/src/osd/mac/window.h
new file mode 100644
index 00000000000..24e749a425b
--- /dev/null
+++ b/src/osd/mac/window.h
@@ -0,0 +1,134 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert, R. Belmont
+//============================================================
+//
+// window.h - SDL window handling
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#ifndef __MACWINDOW__
+#define __MACWINDOW__
+
+#include "osdmac.h"
+#include "video.h"
+
+#include "modules/osdwindow.h"
+
+#include <cstdint>
+#include <memory>
+#include <list>
+
+//============================================================
+// TYPE DEFINITIONS
+//============================================================
+
+class render_target;
+
+typedef uintptr_t HashT;
+
+#define OSDWORK_CALLBACK(name) void *name(void *param, ATTR_UNUSED int threadid)
+
+class mac_window_info : public osd_window_t<void *>
+{
+public:
+ mac_window_info(running_machine &a_machine, int index, std::shared_ptr<osd_monitor_info> a_monitor,
+ const osd_window_config *config);
+
+ ~mac_window_info();
+
+ int window_init();
+
+ void update() override;
+ void toggle_full_screen();
+ void modify_prescale(int dir);
+ void resize(int32_t width, int32_t height);
+ void destroy() override;
+
+ void capture_pointer() override;
+ void release_pointer() override;
+ void show_pointer() override;
+ void hide_pointer() override;
+
+ void notify_changed();
+
+ osd_dim get_size() override;
+
+ int xy_to_render_target(int x, int y, int *xt, int *yt);
+
+ running_machine &machine() const override { return m_machine; }
+ osd_monitor_info *monitor() const override { return m_monitor.get(); }
+ int fullscreen() const override { return m_fullscreen; }
+
+ render_target *target() override { return m_target; }
+
+ int prescale() const { return m_prescale; }
+
+ // Pointer to next window
+ mac_window_info * m_next;
+
+private:
+ // window handle and info
+ char m_title[256];
+ int m_startmaximized;
+
+ // dimensions
+ osd_dim m_minimum_dim;
+ osd_dim m_windowed_dim;
+
+ // rendering info
+ osd_event m_rendered_event;
+ render_target * m_target;
+
+ //int m_extra_flags;
+
+ // returns 0 on success, else 1
+ int complete_create();
+ void complete_destroy();
+
+private:
+ int wnd_extra_width();
+ int wnd_extra_height();
+ void set_starting_view(int index, const char *defview, const char *view);
+ osd_rect constrain_to_aspect_ratio(const osd_rect &rect, int adjustment);
+ osd_dim get_min_bounds(int constrain);
+ osd_dim get_max_bounds(int constrain);
+ void update_cursor_state();
+ osd_dim pick_best_mode();
+ void set_fullscreen(int afullscreen) { m_fullscreen = afullscreen; }
+
+ // Pointer to machine
+ running_machine & m_machine;
+
+ // monitor info
+ std::shared_ptr<osd_monitor_info> m_monitor;
+ int m_fullscreen;
+ bool m_mouse_captured;
+ bool m_mouse_hidden;
+
+ void measure_fps(int update);
+};
+
+struct osd_draw_callbacks
+{
+ osd_renderer *(*create)(osd_window *window);
+};
+
+//============================================================
+// PROTOTYPES
+//============================================================
+
+//============================================================
+// PROTOTYPES - drawogl.c
+//============================================================
+
+int drawogl_init(running_machine &machine, osd_draw_callbacks *callbacks);
+
+//============================================================
+// PROTOTYPES - drawbgfx.c
+//============================================================
+
+int drawbgfx_init(running_machine &machine, osd_draw_callbacks *callbacks);
+
+#endif /* __MACWINDOW__ */
diff --git a/src/osd/mac/windowcontroller.h b/src/osd/mac/windowcontroller.h
new file mode 100644
index 00000000000..54f0b3376e1
--- /dev/null
+++ b/src/osd/mac/windowcontroller.h
@@ -0,0 +1,16 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// windowcontroller.mm - our window/fullscreen manager
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#import <Cocoa/Cocoa.h>
+#import "oglview.h"
+
+@interface MAMEWindowController : NSWindowController
+
+@end
diff --git a/src/osd/mac/windowcontroller.mm b/src/osd/mac/windowcontroller.mm
new file mode 100644
index 00000000000..aa09e96b0d5
--- /dev/null
+++ b/src/osd/mac/windowcontroller.mm
@@ -0,0 +1,131 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// windowcontroller.mm - our window/fullscreen manager
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#import "windowcontroller.h"
+#import "mamefswindow.h"
+
+@interface MAMEWindowController ()
+{
+ MAMEFSWindow *_fullscreenWindow;
+ NSWindow* _standardWindow;
+}
+@end
+
+@implementation MAMEWindowController
+
+- (instancetype)initWithWindow:(NSWindow *)window
+{
+ self = [super initWithWindow:window];
+
+ if (self)
+ {
+ _fullscreenWindow = nil;
+ _standardWindow = window;
+ }
+
+ return self;
+}
+
+- (void) goFullscreen
+{
+ if(_fullscreenWindow)
+ {
+ return;
+ }
+
+ _fullscreenWindow = [[MAMEFSWindow alloc] init];
+
+ NSRect viewRect = [_fullscreenWindow frame];
+ [self.window.contentView setFrameSize: viewRect.size];
+ [_fullscreenWindow setContentView:self.window.contentView];
+
+ _standardWindow = [self window];
+ [_standardWindow orderOut:self];
+
+ [self setWindow:_fullscreenWindow];
+ [_fullscreenWindow makeKeyAndOrderFront:self];
+}
+
+- (void) goWindow
+{
+ if(_fullscreenWindow == nil)
+ {
+ return;
+ }
+
+ NSRect viewRect = [_standardWindow frame];
+ [self.window.contentView setFrame:viewRect];
+
+ [self setWindow:_standardWindow];
+ [[self window] setContentView:_fullscreenWindow.contentView];
+ [[self window] makeKeyAndOrderFront:self];
+
+ _fullscreenWindow = nil;
+}
+
+
+- (void) keyDown:(NSEvent *)event
+{
+// unichar c = [[event charactersIgnoringModifiers] characterAtIndex:0];
+ [super keyDown:event];
+}
+
+- (NSWindow *) getWindow
+{
+ if(_fullscreenWindow == nil)
+ {
+ return _standardWindow;
+ }
+
+ return _fullscreenWindow;
+}
+@end
+
+void *GetOSWindow(void *wincontroller)
+{
+ MAMEWindowController *wc = (MAMEWindowController *)wincontroller;
+
+ return [wc getWindow];
+}
+
+void *CreateMAMEWindow(char *title, int x, int y, int w, int h, bool isFullscreen)
+{
+ NSRect bounds = NSMakeRect(x, y, w, h);
+ NSUInteger style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
+ NSWindow *window = [NSWindow alloc];
+ MAMEWindowController *controller = [MAMEWindowController alloc];
+
+ /* To avoid event handling issues like SDL has, we run MAME in
+ a separate NSThread. This means all UI calls from MAME
+ must be delegated over to the main thread because the
+ Cocoa UI stuff is not thread-safe */
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ [window initWithContentRect:bounds
+ styleMask:style
+ backing:NSBackingStoreBuffered
+ defer:NO];
+ [controller initWithWindow:window];
+
+ NSString *nstitle = [[NSString alloc] initWithUTF8String:title];
+ [window setTitle:nstitle];
+ [nstitle release];
+
+ if (isFullscreen)
+ {
+ [controller goFullscreen];
+ }
+ else
+ {
+ [window makeKeyAndOrderFront:nil];
+ }
+ });
+
+ return (void *)controller;
+}
diff --git a/src/osd/modules/debugger/debugosx.mm b/src/osd/modules/debugger/debugosx.mm
index adb32fea199..def790ef939 100644
--- a/src/osd/modules/debugger/debugosx.mm
+++ b/src/osd/modules/debugger/debugosx.mm
@@ -24,7 +24,11 @@
// MAMEOS headers
#include "modules/lib/osdobj_common.h"
#include "osx/debugosx.h"
+#ifdef OSD_MAC
+#include "osdmac.h"
+#else
#include "osdsdl.h"
+#endif
#include "debug_module.h"
#import "osx/debugconsole.h"
diff --git a/src/osd/modules/input/input_mac.cpp b/src/osd/modules/input/input_mac.cpp
new file mode 100644
index 00000000000..ac2d4e4e5b6
--- /dev/null
+++ b/src/osd/modules/input/input_mac.cpp
@@ -0,0 +1,55 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// input_mac.cpp - Mac input
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#include "input_module.h"
+#include "modules/osdmodule.h"
+
+#if defined(OSD_MAC)
+
+// System headers
+#include <ctype.h>
+#include <stddef.h>
+#include <mutex>
+#include <memory>
+#include <algorithm>
+
+// MAME headers
+#include "emu.h"
+#include "osdepend.h"
+#include "ui/uimain.h"
+#include "uiinput.h"
+#include "window.h"
+#include "strconv.h"
+
+#include "../../mac/osdmac.h"
+#include "input_common.h"
+
+void mac_osd_interface::customize_input_type_list(simple_list<input_type_entry> &typelist)
+{
+}
+
+void mac_osd_interface::poll_inputs(running_machine &machine)
+{
+}
+
+void mac_osd_interface::release_keys()
+{
+}
+
+bool mac_osd_interface::should_hide_mouse()
+{
+ return false;
+}
+
+void mac_osd_interface::process_events_buf()
+{
+}
+
+#endif
diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp
index 4e2d73f6336..51474b810b0 100644
--- a/src/osd/modules/lib/osdobj_common.cpp
+++ b/src/osd/modules/lib/osdobj_common.cpp
@@ -16,7 +16,7 @@
const options_entry osd_options::s_option_entries[] =
{
{ nullptr, nullptr, OPTION_HEADER, "OSD KEYBOARD MAPPING OPTIONS" },
-#ifdef SDLMAME_MACOSX
+#if defined(SDLMAME_MACOSX) || defined(OSD_MAC)
{ OSDOPTION_UIMODEKEY, "DEL", OPTION_STRING, "key to enable/disable MAME controls when emulated system has keyboard inputs" },
#else
{ OSDOPTION_UIMODEKEY, "SCRLOCK", OPTION_STRING, "key to enable/disable MAME controls when emulated system has keyboard inputs" },
@@ -228,6 +228,7 @@ void osd_common_t::register_options()
REGISTER_MODULE(m_mod_man, MONITOR_SDL);
REGISTER_MODULE(m_mod_man, MONITOR_WIN32);
REGISTER_MODULE(m_mod_man, MONITOR_DXGI);
+ REGISTER_MODULE(m_mod_man, MONITOR_MAC);
#ifdef SDLMAME_MACOSX
REGISTER_MODULE(m_mod_man, DEBUG_OSX);
diff --git a/src/osd/modules/monitor/monitor_mac.cpp b/src/osd/modules/monitor/monitor_mac.cpp
new file mode 100644
index 00000000000..338911cafdb
--- /dev/null
+++ b/src/osd/modules/monitor/monitor_mac.cpp
@@ -0,0 +1,189 @@
+// license:BSD-3-Clause
+// copyright-holders: R. Belmont
+//============================================================
+//
+// monitor_mac.cpp - Mac monitor info provider
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#include "emu.h"
+#include "modules/osdmodule.h"
+#include "monitor_module.h"
+
+#if defined(OSD_MAC)
+
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreGraphics/CoreGraphics.h>
+
+#include <algorithm>
+
+#include "modules/osdwindow.h"
+#include "monitor_common.h"
+#include "window.h"
+
+ //============================================================
+ // mac_monitor_info
+ //============================================================
+
+class mac_monitor_info : public osd_monitor_info
+{
+public:
+ mac_monitor_info(monitor_module &module, CGDirectDisplayID handle, const char *monitor_device, float aspect)
+ : osd_monitor_info(module, handle, monitor_device, aspect)
+ {
+ mac_monitor_info::refresh();
+ }
+
+private:
+ void refresh() override
+ {
+ CGRect dimensions;
+ dimensions = CGDisplayBounds((CGDirectDisplayID)oshandle());
+
+ m_pos_size = osd_rect(dimensions.origin.x, dimensions.origin.y, dimensions.size.width, dimensions.size.height);
+ m_usuable_pos_size = osd_rect(dimensions.origin.x, dimensions.origin.y, dimensions.size.width, dimensions.size.height);
+ m_is_primary = CGDisplayIsMain((CGDirectDisplayID)oshandle());
+ }
+};
+
+//============================================================
+// mac_monitor_module
+//============================================================
+
+class mac_monitor_module : public monitor_module_base
+{
+public:
+ mac_monitor_module()
+ : monitor_module_base(OSD_MONITOR_PROVIDER, "sdl")
+ {
+ }
+
+ //
+ // Given a proposed rect, returns the monitor whose bounds intersect the most with it
+ //
+ std::shared_ptr<osd_monitor_info> monitor_from_rect(const osd_rect& proposed) override
+ {
+ if (!m_initialized)
+ return nullptr;
+
+ // Determines whether the first intersects less with the proposed rect than the second
+ auto intersects_less = [&proposed](std::shared_ptr<osd_monitor_info> mon1, std::shared_ptr<osd_monitor_info> mon2)
+ {
+ int value1 = compute_intersection(mon1->usuable_position_size(), proposed);
+ int value2 = compute_intersection(mon2->usuable_position_size(), proposed);
+
+ return value1 < value2;
+ };
+
+ // Find the one that intersects with the proposed rect the most
+ auto monitor = std::max_element(std::begin(list()), std::end(list()), intersects_less);
+ return *monitor;
+ }
+
+ std::shared_ptr<osd_monitor_info> monitor_from_window(const osd_window& window) override
+ {
+// if (!m_initialized)
+ return nullptr;
+
+// std::uint64_t display = SDL_GetWindowDisplayIndex(static_cast<const mac_window_info &>(window).platform_window());
+// return monitor_from_handle(display);
+ }
+
+protected:
+ int init_internal(const osd_options& options) override
+ {
+ // make a list of monitors
+ {
+ uint32_t uNumDisplays;
+ CGDirectDisplayID *displayList;
+
+ osd_printf_verbose("Enter init_monitors\n");
+
+ // pass NULL to get the number of displays
+ CGGetActiveDisplayList(1, NULL, &uNumDisplays);
+
+ displayList = (CGDirectDisplayID *)malloc(sizeof(CGDirectDisplayID) * uNumDisplays);
+ CGGetActiveDisplayList(uNumDisplays, displayList, &uNumDisplays);
+
+ for (uint32_t disp = 0; disp < uNumDisplays; disp++)
+ {
+ char temp[64];
+ snprintf(temp, sizeof(temp) - 1, "%s%d", OSDOPTION_SCREEN, disp);
+
+ // allocate a new monitor info
+ std::shared_ptr<osd_monitor_info> monitor = std::make_shared<mac_monitor_info>(*this, displayList[disp], temp, 1.0f);
+
+ osd_printf_verbose("Adding monitor %s (%d x %d)\n", monitor->devicename().c_str(),
+ monitor->position_size().width(), monitor->position_size().height());
+
+ // guess the aspect ratio assuming square pixels
+ monitor->set_aspect(static_cast<float>(monitor->position_size().width()) / static_cast<float>(monitor->position_size().height()));
+
+ // hook us into the list
+ add_monitor(monitor);
+ }
+
+ free(displayList);
+ }
+ osd_printf_verbose("Leave init_monitors\n");
+
+ return 0;
+ }
+
+ static int compute_intersection(const osd_rect &rect1, const osd_rect &rect2)
+ {
+ int min0, min1, max0, max1, result = 0;
+
+ // if either rect is empty, bail early (shouldn't happen, but...)
+ if (rect1.width() + rect1.height() == 0)
+ {
+ return 0;
+ }
+ if (rect2.width() + rect2.height() == 0)
+ {
+ return 0;
+ }
+
+ // do the X intersection
+ min0 = rect1.left();
+ max0 = min0 + rect1.width();
+ min1 = rect2.left();
+ max1 = min1 + rect2.width();
+ if (min1 > min0)
+ {
+ min0 = min1;
+ }
+ if (max1 > max0)
+ {
+ max0 = max1;
+ }
+ result = max0 - min0;
+
+ // and now the Y intersection
+ min0 = rect1.top();
+ max0 = min0 + rect1.height();
+ min1 = rect2.top();
+ max1 = min1 + rect2.height();
+ if (min1 > min0)
+ {
+ min0 = min1;
+ }
+ if (max1 > max0)
+ {
+ max0 = max1;
+ }
+ result += max0 - min0;
+
+ return result;
+ }
+
+private:
+};
+
+#else
+MODULE_NOT_SUPPORTED(mac_monitor_module, OSD_MONITOR_PROVIDER, "sdl")
+#endif
+
+MODULE_DEFINITION(MONITOR_MAC, mac_monitor_module)
diff --git a/src/osd/modules/opengl/osd_opengl.h b/src/osd/modules/opengl/osd_opengl.h
index 26f577f343e..47d0b3c429c 100644
--- a/src/osd/modules/opengl/osd_opengl.h
+++ b/src/osd/modules/opengl/osd_opengl.h
@@ -32,6 +32,9 @@
#include "GL/wglext.h"
#endif
#endif
+ #elif defined(OSD_MAC)
+ #include <OpenGL/gl.h>
+ #include <OpenGL/glext.h>
#else
#include <SDL2/SDL_version.h>
diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp
index 0c483d9eb59..3c15bc3cf96 100644
--- a/src/osd/modules/render/drawbgfx.cpp
+++ b/src/osd/modules/render/drawbgfx.cpp
@@ -15,8 +15,12 @@
#include <SDL2/SDL_syswm.h>
#endif
#else
+#if defined(OSD_MAC)
+extern void *GetOSWindow(void *wincontroller);
+#else
#include <SDL2/SDL_syswm.h>
#endif
+#endif
// MAMEOS headers
#include "emu.h"
@@ -143,6 +147,17 @@ inline void winSetHwnd(::HWND _window)
pd.backBufferDS = NULL;
bgfx::setPlatformData(pd);
}
+#elif defined(OSD_MAC)
+inline void macSetWindow(void *_window)
+{
+ bgfx::PlatformData pd;
+ pd.ndt = NULL;
+ pd.nwh = GetOSWindow(_window);
+ pd.context = NULL;
+ pd.backBuffer = NULL;
+ pd.backBufferDS = NULL;
+ bgfx::setPlatformData(pd);
+}
#elif defined(OSD_SDL)
static void* sdlNativeWindowHandle(SDL_Window* _window)
{
@@ -240,6 +255,8 @@ int renderer_bgfx::create()
#elif defined(OSD_UWP)
winrtSetWindow(AsInspectable(std::static_pointer_cast<uwp_window_info>(win)->platform_window()));
+#elif defined(OSD_MAC)
+ macSetWindow(std::static_pointer_cast<mac_window_info>(win)->platform_window());
#else
sdlSetWindow(std::dynamic_pointer_cast<sdl_window_info>(win)->platform_window());
#endif
@@ -296,6 +313,8 @@ int renderer_bgfx::create()
m_framebuffer = m_targets->create_backbuffer(std::static_pointer_cast<win_window_info>(win)->platform_window(), m_width[win->m_index], m_height[win->m_index]);
#elif defined(OSD_UWP)
m_framebuffer = m_targets->create_backbuffer(AsInspectable(std::static_pointer_cast<uwp_window_info>(win)->platform_window()), m_width[win->m_index], m_height[win->m_index]);
+#elif defined(OSD_MAC)
+ m_framebuffer = m_targets->create_backbuffer(GetOSWindow(std::static_pointer_cast<mac_window_info>(win)->platform_window()), m_width[win->m_index], m_height[win->m_index]);
#else
m_framebuffer = m_targets->create_backbuffer(sdlNativeWindowHandle(std::dynamic_pointer_cast<sdl_window_info>(win)->platform_window()), m_width[win->m_index], m_height[win->m_index]);
#endif
@@ -949,6 +968,8 @@ bool renderer_bgfx::update_dimensions()
m_framebuffer = m_targets->create_backbuffer(std::static_pointer_cast<win_window_info>(win)->platform_window(), width, height);
#elif defined(OSD_UWP)
m_framebuffer = m_targets->create_backbuffer(AsInspectable(std::static_pointer_cast<uwp_window_info>(win)->platform_window()), width, height);
+#elif defined(OSD_MAC)
+ m_framebuffer = m_targets->create_backbuffer(GetOSWindow(std::static_pointer_cast<mac_window_info>(win)->platform_window()), width, height);
#else
m_framebuffer = m_targets->create_backbuffer(sdlNativeWindowHandle(std::dynamic_pointer_cast<sdl_window_info>(win)->platform_window()), width, height);
#endif
diff --git a/src/osd/modules/render/drawogl.cpp b/src/osd/modules/render/drawogl.cpp
index 6c1cb405316..bd4648be474 100644
--- a/src/osd/modules/render/drawogl.cpp
+++ b/src/osd/modules/render/drawogl.cpp
@@ -21,7 +21,11 @@
#include "emu.h"
#include "emuopts.h"
-#ifndef OSD_WINDOWS
+#ifdef OSD_MAC
+#define GL_SILENCE_DEPRECATION (1)
+#endif
+
+#if !defined(OSD_WINDOWS) && !defined(OSD_MAC)
// standard SDL headers
#define TOBEMIGRATED 1
#include <SDL2/SDL.h>
@@ -36,7 +40,7 @@
#include "modules/opengl/gl_shader_tool.h"
#include "modules/opengl/gl_shader_mgr.h"
-#if defined(SDLMAME_MACOSX)
+#if defined(SDLMAME_MACOSX) || defined(OSD_MAC)
#ifndef APIENTRY
#define APIENTRY
#endif
@@ -237,7 +241,7 @@ void renderer_ogl::set_blendmode(int blendmode)
//============================================================
// OGL 1.3
-#ifdef GL_ARB_multitexture
+#if defined(GL_ARB_multitexture) && !defined(OSD_MAC)
static PFNGLACTIVETEXTUREARBPROC pfn_glActiveTexture = nullptr;
#else
static PFNGLACTIVETEXTUREPROC pfn_glActiveTexture = nullptr;
@@ -558,6 +562,9 @@ int renderer_ogl::create()
// create renderer
#if defined(OSD_WINDOWS)
m_gl_context = global_alloc(win_gl_context(std::static_pointer_cast<win_window_info>(win)->platform_window()));
+#elif defined(OSD_MAC)
+// TODO
+// m_gl_context = global_alloc(mac_gl_context(std::static_pointer_cast<mac_window_info>(win)->platform_window()));
#else
m_gl_context = global_alloc(sdl_gl_context(std::static_pointer_cast<sdl_window_info>(win)->platform_window()));
#endif
@@ -886,7 +893,7 @@ void renderer_ogl::loadGLExtensions()
if ( m_useglsl )
{
- #ifdef GL_ARB_multitexture
+ #if defined(GL_ARB_multitexture) && !defined(OSD_MAC)
pfn_glActiveTexture = (PFNGLACTIVETEXTUREARBPROC) m_gl_context->getProcAddress("glActiveTextureARB");
#else
pfn_glActiveTexture = (PFNGLACTIVETEXTUREPROC) m_gl_context->getProcAddress("glActiveTexture");
diff --git a/src/osd/modules/render/drawogl.h b/src/osd/modules/render/drawogl.h
index 5444f203141..525ba0c3ffa 100644
--- a/src/osd/modules/render/drawogl.h
+++ b/src/osd/modules/render/drawogl.h
@@ -15,7 +15,11 @@
// OSD headers
#ifndef OSD_WINDOWS
+#ifdef OSD_MAC
+#include "osdmac.h"
+#else
#include "osdsdl.h"
+#endif
#include "window.h"
#else
#include "../windows/window.h"
@@ -24,6 +28,7 @@ typedef uint64_t HashT;
#if defined(OSD_WINDOWS)
#include "winglcontext.h"
+#elif defined (OSD_MAC)
#else
#include "sdlglcontext.h"
#endif