summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mame/drivers/1942.c6
-rw-r--r--src/mame/drivers/1943.c15
-rw-r--r--src/mame/drivers/20pacgal.c63
-rw-r--r--src/mame/drivers/40love.c221
-rw-r--r--src/mame/drivers/4enraya.c34
-rw-r--r--src/mame/drivers/88games.c82
-rw-r--r--src/mame/drivers/actfancr.c42
-rw-r--r--src/mame/drivers/aeroboto.c31
-rw-r--r--src/mame/drivers/aerofgt.c73
-rw-r--r--src/mame/drivers/airbustr.c98
-rw-r--r--src/mame/drivers/ajax.c11
-rw-r--r--src/mame/drivers/aliens.c62
-rw-r--r--src/mame/drivers/alpha68k.c432
-rw-r--r--src/mame/drivers/ambush.c14
-rw-r--r--src/mame/drivers/ampoker2.c34
-rw-r--r--src/mame/drivers/amspdwy.c25
-rw-r--r--src/mame/drivers/angelkds.c50
-rw-r--r--src/mame/drivers/appoooh.c11
-rw-r--r--src/mame/drivers/aquarium.c47
-rw-r--r--src/mame/drivers/arabian.c49
-rw-r--r--src/mame/drivers/argus.c12
-rw-r--r--src/mame/drivers/armedf.c206
-rw-r--r--src/mame/drivers/artmagic.c77
-rw-r--r--src/mame/drivers/ashnojoe.c32
-rw-r--r--src/mame/drivers/asterix.c64
-rw-r--r--src/mame/drivers/asteroid.c10
-rw-r--r--src/mame/drivers/astrocde.c238
-rw-r--r--src/mame/drivers/astrof.c110
-rw-r--r--src/mame/drivers/asuka.c19
-rw-r--r--src/mame/drivers/atetris.c57
-rw-r--r--src/mame/drivers/avalnche.c41
-rw-r--r--src/mame/drivers/aztarac.c15
-rw-r--r--src/mame/drivers/bagman.c17
-rw-r--r--src/mame/drivers/baraduke.c59
-rw-r--r--src/mame/drivers/battlane.c19
-rw-r--r--src/mame/drivers/battlera.c35
-rw-r--r--src/mame/drivers/battlnts.c17
-rw-r--r--src/mame/drivers/bbusters.c65
-rw-r--r--src/mame/drivers/bigevglf.c139
-rw-r--r--src/mame/drivers/bionicc.c47
-rw-r--r--src/mame/drivers/bishi.c34
-rw-r--r--src/mame/drivers/bking.c90
-rw-r--r--src/mame/drivers/bladestl.c35
-rw-r--r--src/mame/drivers/blktiger.c48
-rw-r--r--src/mame/drivers/blmbycar.c48
-rw-r--r--src/mame/drivers/blockade.c20
-rw-r--r--src/mame/drivers/blockhl.c49
-rw-r--r--src/mame/drivers/blockout.c27
-rw-r--r--src/mame/drivers/blueprnt.c22
-rw-r--r--src/mame/drivers/bogeyman.c24
-rw-r--r--src/mame/drivers/bombjack.c22
-rw-r--r--src/mame/drivers/bottom9.c104
-rw-r--r--src/mame/drivers/brkthru.c27
-rw-r--r--src/mame/drivers/btime.c171
-rw-r--r--src/mame/drivers/buggychl.c38
-rw-r--r--src/mame/drivers/bwing.c81
-rw-r--r--src/mame/drivers/bzone.c21
-rw-r--r--src/mame/drivers/cabal.c65
-rw-r--r--src/mame/drivers/canyon.c20
-rw-r--r--src/mame/drivers/capbowl.c44
-rw-r--r--src/mame/drivers/carjmbre.c7
-rw-r--r--src/mame/drivers/cave.c361
-rw-r--r--src/mame/drivers/cbasebal.c45
-rw-r--r--src/mame/drivers/cbuster.c48
-rw-r--r--src/mame/drivers/ccastles.c77
-rw-r--r--src/mame/drivers/cclimber.c64
-rw-r--r--src/mame/drivers/centiped.c125
-rw-r--r--src/mame/drivers/chaknpop.c6
-rw-r--r--src/mame/drivers/champbas.c49
-rw-r--r--src/mame/drivers/changela.c159
-rw-r--r--src/mame/drivers/chqflag.c90
-rw-r--r--src/mame/drivers/cinemat.c96
-rw-r--r--src/mame/drivers/circus.c8
-rw-r--r--src/mame/drivers/circusc.c48
-rw-r--r--src/mame/drivers/cischeat.c167
-rw-r--r--src/mame/drivers/citycon.c13
-rw-r--r--src/mame/drivers/cloak.c37
-rw-r--r--src/mame/drivers/cloud9.c51
-rw-r--r--src/mame/drivers/clshroad.c12
-rw-r--r--src/mame/drivers/cninja.c104
-rw-r--r--src/mame/drivers/combatsc.c160
-rw-r--r--src/mame/drivers/compgolf.c15
-rw-r--r--src/mame/drivers/contra.c25
-rw-r--r--src/mame/drivers/coolpool.c303
-rw-r--r--src/mame/drivers/cop01.c47
-rw-r--r--src/mame/drivers/copsnrob.c15
-rw-r--r--src/mame/drivers/cosmic.c227
-rw-r--r--src/mame/drivers/cps1.c102
-rw-r--r--src/mame/drivers/cps3.c268
-rw-r--r--src/mame/drivers/crbaloon.c39
-rw-r--r--src/mame/drivers/crgolf.c68
-rw-r--r--src/mame/drivers/crimfght.c39
-rw-r--r--src/mame/drivers/crospang.c6
-rw-r--r--src/mame/drivers/crshrace.c36
-rw-r--r--src/mame/drivers/cvs.c64
-rw-r--r--src/mame/drivers/darius.c161
-rw-r--r--src/mame/drivers/darkmist.c9
-rw-r--r--src/mame/drivers/darkseal.c17
-rw-r--r--src/mame/drivers/dassault.c69
-rw-r--r--src/mame/drivers/dbz.c31
-rw-r--r--src/mame/drivers/dcheese.c54
-rw-r--r--src/mame/drivers/ddragon3.c25
-rw-r--r--src/mame/drivers/ddribble.c38
-rw-r--r--src/mame/drivers/deadang.c13
-rw-r--r--src/mame/drivers/dec0.c68
-rw-r--r--src/mame/drivers/dec8.c509
-rw-r--r--src/mame/drivers/deco32.c420
-rw-r--r--src/mame/drivers/deco_mlc.c103
-rw-r--r--src/mame/drivers/deniam.c15
-rw-r--r--src/mame/drivers/djboy.c150
-rw-r--r--src/mame/drivers/djmain.c158
-rw-r--r--src/mame/drivers/dkong.c206
-rw-r--r--src/mame/drivers/dogfgt.c50
-rw-r--r--src/mame/drivers/dooyong.c20
-rw-r--r--src/mame/drivers/dragrace.c49
-rw-r--r--src/mame/drivers/drgnmst.c106
-rw-r--r--src/mame/drivers/dribling.c20
-rw-r--r--src/mame/drivers/drmicro.c20
-rw-r--r--src/mame/drivers/dynax.c912
-rw-r--r--src/mame/drivers/eolith.c42
-rw-r--r--src/mame/drivers/epos.c13
-rw-r--r--src/mame/drivers/equites.c137
-rw-r--r--src/mame/drivers/esd16.c83
-rw-r--r--src/mame/drivers/espial.c18
-rw-r--r--src/mame/drivers/esripsys.c230
-rw-r--r--src/mame/drivers/exerion.c11
-rw-r--r--src/mame/drivers/exidy.c11
-rw-r--r--src/mame/drivers/exidy440.c82
-rw-r--r--src/mame/drivers/exprraid.c24
-rw-r--r--src/mame/drivers/exterm.c88
-rw-r--r--src/mame/drivers/exzisus.c80
-rw-r--r--src/mame/drivers/f1gp.c79
-rw-r--r--src/mame/drivers/fantland.c139
-rw-r--r--src/mame/drivers/fastlane.c22
-rw-r--r--src/mame/drivers/fcombat.c61
-rw-r--r--src/mame/drivers/fgoal.c89
-rw-r--r--src/mame/drivers/finalizr.c48
-rw-r--r--src/mame/drivers/firetrap.c131
-rw-r--r--src/mame/drivers/firetrk.c164
-rw-r--r--src/mame/drivers/fitfight.c74
-rw-r--r--src/mame/drivers/flkatck.c35
-rw-r--r--src/mame/drivers/flower.c39
-rw-r--r--src/mame/drivers/flstory.c165
-rw-r--r--src/mame/drivers/freekick.c127
-rw-r--r--src/mame/drivers/fromanc2.c139
-rw-r--r--src/mame/drivers/fromance.c107
-rw-r--r--src/mame/drivers/funkybee.c12
-rw-r--r--src/mame/drivers/funworld.c10
-rw-r--r--src/mame/drivers/funybubl.c19
-rw-r--r--src/mame/drivers/fuukifg2.c34
-rw-r--r--src/mame/drivers/fuukifg3.c84
-rw-r--r--src/mame/drivers/gaelco.c65
-rw-r--r--src/mame/drivers/gaelco2.c20
-rw-r--r--src/mame/drivers/gaelco3d.c185
-rw-r--r--src/mame/drivers/gaiden.c106
-rw-r--r--src/mame/drivers/galaga.c62
-rw-r--r--src/mame/drivers/galastrm.c70
-rw-r--r--src/mame/drivers/galaxold.c35
-rw-r--r--src/mame/drivers/galivan.c70
-rw-r--r--src/mame/drivers/galspnbl.c7
-rw-r--r--src/mame/drivers/gaplus.c69
-rw-r--r--src/mame/drivers/gatron.c4
-rw-r--r--src/mame/drivers/gberet.c60
-rw-r--r--src/mame/drivers/gbusters.c79
-rw-r--r--src/mame/drivers/gcpinbal.c72
-rw-r--r--src/mame/drivers/gijoe.c31
-rw-r--r--src/mame/drivers/glass.c21
-rw-r--r--src/mame/drivers/gng.c19
-rw-r--r--src/mame/drivers/goal92.c30
-rw-r--r--src/mame/drivers/goindol.c64
-rw-r--r--src/mame/drivers/goldstar.c162
-rw-r--r--src/mame/drivers/gomoku.c6
-rw-r--r--src/mame/drivers/gotcha.c4
-rw-r--r--src/mame/drivers/gottlieb.c96
-rw-r--r--src/mame/drivers/gradius3.c90
-rw-r--r--src/mame/drivers/grchamp.c105
-rw-r--r--src/mame/drivers/gridlee.c44
-rw-r--r--src/mame/drivers/groundfx.c68
-rw-r--r--src/mame/drivers/gstriker.c99
-rw-r--r--src/mame/drivers/gunbustr.c67
-rw-r--r--src/mame/drivers/gundealr.c6
-rw-r--r--src/mame/drivers/gunsmoke.c4
-rw-r--r--src/mame/drivers/gyruss.c35
-rw-r--r--src/mame/drivers/hanaawas.c20
-rw-r--r--src/mame/drivers/hcastle.c21
-rw-r--r--src/mame/drivers/hexion.c12
-rw-r--r--src/mame/drivers/himesiki.c13
-rw-r--r--src/mame/drivers/hitme.c41
-rw-r--r--src/mame/drivers/hnayayoi.c32
-rw-r--r--src/mame/drivers/hng64.c330
-rw-r--r--src/mame/drivers/homedata.c249
-rw-r--r--src/mame/drivers/hyperspt.c17
-rw-r--r--src/mame/drivers/hyprduel.c147
-rw-r--r--src/mame/drivers/ikki.c15
-rw-r--r--src/mame/drivers/inufuku.c22
-rw-r--r--src/mame/drivers/iqblock.c34
-rw-r--r--src/mame/drivers/irobot.c19
-rw-r--r--src/mame/drivers/ironhors.c11
-rw-r--r--src/mame/drivers/itech32.c348
-rw-r--r--src/mame/drivers/itech8.c94
-rw-r--r--src/mame/drivers/jack.c37
-rw-r--r--src/mame/drivers/jackal.c70
-rw-r--r--src/mame/drivers/jailbrek.c11
-rw-r--r--src/mame/drivers/jedi.c56
-rw-r--r--src/mame/drivers/jpmimpct.c190
-rw-r--r--src/mame/drivers/kaneko16.c109
-rw-r--r--src/mame/drivers/kangaroo.c21
-rw-r--r--src/mame/drivers/karnov.c72
-rw-r--r--src/mame/drivers/kchamp.c46
-rw-r--r--src/mame/drivers/kickgoal.c18
-rw-r--r--src/mame/drivers/kingobox.c32
-rw-r--r--src/mame/drivers/kncljoe.c14
-rw-r--r--src/mame/drivers/konamigx.c272
-rw-r--r--src/mame/drivers/kopunch.c22
-rw-r--r--src/mame/drivers/ksayakyu.c27
-rw-r--r--src/mame/drivers/kyugo.c26
-rw-r--r--src/mame/drivers/labyrunr.c10
-rw-r--r--src/mame/drivers/ladybug.c45
-rw-r--r--src/mame/drivers/ladyfrog.c56
-rw-r--r--src/mame/drivers/laserbat.c71
-rw-r--r--src/mame/drivers/lasso.c41
-rw-r--r--src/mame/drivers/lastduel.c12
-rw-r--r--src/mame/drivers/lazercmd.c88
-rw-r--r--src/mame/drivers/legionna.c6
-rw-r--r--src/mame/drivers/lemmings.c58
-rw-r--r--src/mame/drivers/lethal.c84
-rw-r--r--src/mame/drivers/lethalj.c27
-rw-r--r--src/mame/drivers/liberate.c133
-rw-r--r--src/mame/drivers/lkage.c69
-rw-r--r--src/mame/drivers/lordgun.c45
-rw-r--r--src/mame/drivers/lsasquad.c12
-rw-r--r--src/mame/drivers/lucky74.c36
-rw-r--r--src/mame/drivers/lvcards.c39
-rw-r--r--src/mame/drivers/lwings.c77
-rw-r--r--src/mame/drivers/m10.c139
-rw-r--r--src/mame/drivers/m107.c60
-rw-r--r--src/mame/drivers/m62.c72
-rw-r--r--src/mame/drivers/m72.c234
-rw-r--r--src/mame/drivers/m90.c29
-rw-r--r--src/mame/drivers/m92.c78
-rw-r--r--src/mame/drivers/macrossp.c81
-rw-r--r--src/mame/drivers/madalien.c34
-rw-r--r--src/mame/drivers/madmotor.c7
-rw-r--r--src/mame/drivers/magmax.c29
-rw-r--r--src/mame/drivers/mainevt.c100
-rw-r--r--src/mame/drivers/mainsnk.c20
-rw-r--r--src/mame/drivers/malzak.c52
-rw-r--r--src/mame/drivers/mappy.c84
-rw-r--r--src/mame/drivers/marineb.c7
-rw-r--r--src/mame/drivers/mario.c9
-rw-r--r--src/mame/drivers/markham.c4
-rw-r--r--src/mame/drivers/matmania.c14
-rw-r--r--src/mame/drivers/mcatadv.c31
-rw-r--r--src/mame/drivers/mcr68.c157
-rw-r--r--src/mame/drivers/meadows.c63
-rw-r--r--src/mame/drivers/megasys1.c189
-rw-r--r--src/mame/drivers/megazone.c29
-rw-r--r--src/mame/drivers/mermaid.c56
-rw-r--r--src/mame/drivers/metalmx.c111
-rw-r--r--src/mame/drivers/metlclsh.c41
-rw-r--r--src/mame/drivers/metro.c550
-rw-r--r--src/mame/drivers/mexico86.c4
-rw-r--r--src/mame/drivers/mhavoc.c14
-rw-r--r--src/mame/drivers/midzeus.c129
-rw-r--r--src/mame/drivers/mikie.c31
-rw-r--r--src/mame/drivers/mitchell.c99
-rw-r--r--src/mame/drivers/mjkjidai.c28
-rw-r--r--src/mame/drivers/model1.c154
-rw-r--r--src/mame/drivers/momoko.c6
-rw-r--r--src/mame/drivers/moo.c92
-rw-r--r--src/mame/drivers/mosaic.c42
-rw-r--r--src/mame/drivers/mouser.c32
-rw-r--r--src/mame/drivers/mpu4.c158
-rw-r--r--src/mame/drivers/mrdo.c8
-rw-r--r--src/mame/drivers/mrflea.c72
-rw-r--r--src/mame/drivers/mrjong.c4
-rw-r--r--src/mame/drivers/ms32.c193
-rw-r--r--src/mame/drivers/msisaac.c81
-rw-r--r--src/mame/drivers/mugsmash.c23
-rw-r--r--src/mame/drivers/munchmo.c21
-rw-r--r--src/mame/drivers/mw8080bw.c124
-rw-r--r--src/mame/drivers/mystston.c21
-rw-r--r--src/mame/drivers/mystwarr.c174
-rw-r--r--src/mame/drivers/n8080.c21
-rw-r--r--src/mame/drivers/namcofl.c124
-rw-r--r--src/mame/drivers/namcona1.c204
-rw-r--r--src/mame/drivers/namcond1.c25
-rw-r--r--src/mame/drivers/namcos1.c71
-rw-r--r--src/mame/drivers/namcos21.c523
-rw-r--r--src/mame/drivers/namcos86.c128
-rw-r--r--src/mame/drivers/naughtyb.c81
-rw-r--r--src/mame/drivers/nbmj8688.c32
-rw-r--r--src/mame/drivers/nbmj8891.c4
-rw-r--r--src/mame/drivers/nbmj8991.c16
-rw-r--r--src/mame/drivers/nbmj9195.c473
-rw-r--r--src/mame/drivers/nemesis.c141
-rw-r--r--src/mame/drivers/neogeo.c126
-rw-r--r--src/mame/drivers/ninjakd2.c81
-rw-r--r--src/mame/drivers/ninjaw.c74
-rw-r--r--src/mame/drivers/niyanpai.c204
-rw-r--r--src/mame/drivers/nmk16.c210
-rw-r--r--src/mame/drivers/norautp.c27
-rw-r--r--src/mame/drivers/nova2001.c18
-rw-r--r--src/mame/drivers/nycaptor.c174
-rw-r--r--src/mame/drivers/ohmygod.c17
-rw-r--r--src/mame/drivers/ojankohs.c126
-rw-r--r--src/mame/drivers/oneshot.c47
-rw-r--r--src/mame/drivers/opwolf.c63
-rw-r--r--src/mame/drivers/orbit.c9
-rw-r--r--src/mame/drivers/othldrby.c26
-rw-r--r--src/mame/drivers/othunder.c95
-rw-r--r--src/mame/drivers/overdriv.c58
-rw-r--r--src/mame/drivers/pacland.c64
-rw-r--r--src/mame/drivers/pacman.c347
-rw-r--r--src/mame/drivers/pandoras.c70
-rw-r--r--src/mame/drivers/paradise.c18
-rw-r--r--src/mame/drivers/parodius.c84
-rw-r--r--src/mame/drivers/pastelg.c55
-rw-r--r--src/mame/drivers/pbaction.c24
-rw-r--r--src/mame/drivers/pcktgal.c33
-rw-r--r--src/mame/drivers/pgm.c76
-rw-r--r--src/mame/drivers/pingpong.c32
-rw-r--r--src/mame/drivers/pirates.c15
-rw-r--r--src/mame/drivers/pitnrun.c19
-rw-r--r--src/mame/drivers/pktgaldx.c12
-rw-r--r--src/mame/drivers/playch10.c44
-rw-r--r--src/mame/drivers/playmark.c115
-rw-r--r--src/mame/drivers/plygonet.c218
-rw-r--r--src/mame/drivers/pokechmp.c42
-rw-r--r--src/mame/drivers/polepos.c68
-rw-r--r--src/mame/drivers/policetr.c81
-rw-r--r--src/mame/drivers/polyplay.c62
-rw-r--r--src/mame/drivers/poolshrk.c38
-rw-r--r--src/mame/drivers/pooyan.c11
-rw-r--r--src/mame/drivers/popeye.c18
-rw-r--r--src/mame/drivers/popper.c34
-rw-r--r--src/mame/drivers/portrait.c28
-rw-r--r--src/mame/drivers/powerins.c21
-rw-r--r--src/mame/drivers/prehisle.c6
-rw-r--r--src/mame/drivers/psikyo.c206
-rw-r--r--src/mame/drivers/psikyo4.c95
-rw-r--r--src/mame/drivers/psikyosh.c48
-rw-r--r--src/mame/drivers/psychic5.c47
-rw-r--r--src/mame/drivers/punchout.c89
-rw-r--r--src/mame/drivers/pushman.c106
-rw-r--r--src/mame/drivers/qdrmfgp.c96
-rw-r--r--src/mame/drivers/quizdna.c18
-rw-r--r--src/mame/drivers/raiden.c11
-rw-r--r--src/mame/drivers/rainbow.c16
-rw-r--r--src/mame/drivers/rallyx.c60
-rw-r--r--src/mame/drivers/rastan.c7
-rw-r--r--src/mame/drivers/realbrk.c103
-rw-r--r--src/mame/drivers/redalert.c28
-rw-r--r--src/mame/drivers/renegade.c148
-rw-r--r--src/mame/drivers/retofinv.c76
-rw-r--r--src/mame/drivers/rltennis.c21
-rw-r--r--src/mame/drivers/rockrage.c17
-rw-r--r--src/mame/drivers/rocnrope.c13
-rw-r--r--src/mame/drivers/rohga.c18
-rw-r--r--src/mame/drivers/rollerg.c46
-rw-r--r--src/mame/drivers/rollrace.c20
-rw-r--r--src/mame/drivers/route16.c81
-rw-r--r--src/mame/drivers/rpunch.c24
-rw-r--r--src/mame/drivers/runaway.c20
-rw-r--r--src/mame/drivers/rungun.c76
-rw-r--r--src/mame/drivers/sauro.c36
-rw-r--r--src/mame/drivers/sbasketb.c19
-rw-r--r--src/mame/drivers/scotrsht.c15
-rw-r--r--src/mame/drivers/sderby.c50
-rw-r--r--src/mame/drivers/segag80r.c73
-rw-r--r--src/mame/drivers/segag80v.c105
-rw-r--r--src/mame/drivers/senjyo.c36
-rw-r--r--src/mame/drivers/sf.c135
-rw-r--r--src/mame/drivers/shadfrce.c59
-rw-r--r--src/mame/drivers/shangha3.c69
-rw-r--r--src/mame/drivers/shangkid.c54
-rw-r--r--src/mame/drivers/shisen.c18
-rw-r--r--src/mame/drivers/shootout.c30
-rw-r--r--src/mame/drivers/sidearms.c24
-rw-r--r--src/mame/drivers/sidepckt.c87
-rw-r--r--src/mame/drivers/silkroad.c16
-rw-r--r--src/mame/drivers/simpl156.c204
-rw-r--r--src/mame/drivers/simpsons.c15
-rw-r--r--src/mame/drivers/skydiver.c7
-rw-r--r--src/mame/drivers/skykid.c76
-rw-r--r--src/mame/drivers/skyraid.c32
-rw-r--r--src/mame/drivers/slapfght.c26
-rw-r--r--src/mame/drivers/slapshot.c71
-rw-r--r--src/mame/drivers/snk.c413
-rw-r--r--src/mame/drivers/snk68.c68
-rw-r--r--src/mame/drivers/snookr10.c108
-rw-r--r--src/mame/drivers/snowbros.c131
-rw-r--r--src/mame/drivers/solomon.c25
-rw-r--r--src/mame/drivers/sonson.c23
-rw-r--r--src/mame/drivers/spbactn.c8
-rw-r--r--src/mame/drivers/spcforce.c48
-rw-r--r--src/mame/drivers/spdodgeb.c62
-rw-r--r--src/mame/drivers/speedatk.c46
-rw-r--r--src/mame/drivers/speedbal.c10
-rw-r--r--src/mame/drivers/speedspn.c18
-rw-r--r--src/mame/drivers/splash.c126
-rw-r--r--src/mame/drivers/sprcros2.c28
-rw-r--r--src/mame/drivers/sprint2.c107
-rw-r--r--src/mame/drivers/sprint4.c60
-rw-r--r--src/mame/drivers/sprint8.c35
-rw-r--r--src/mame/drivers/spy.c113
-rw-r--r--src/mame/drivers/srmp2.c138
-rw-r--r--src/mame/drivers/srumbler.c15
-rw-r--r--src/mame/drivers/sshangha.c53
-rw-r--r--src/mame/drivers/sslam.c37
-rw-r--r--src/mame/drivers/ssozumo.c13
-rw-r--r--src/mame/drivers/sspeedr.c30
-rw-r--r--src/mame/drivers/ssrj.c11
-rw-r--r--src/mame/drivers/ssv.c348
-rw-r--r--src/mame/drivers/st0016.c52
-rw-r--r--src/mame/drivers/stactics.c20
-rw-r--r--src/mame/drivers/stadhero.c18
-rw-r--r--src/mame/drivers/starfire.c45
-rw-r--r--src/mame/drivers/starshp1.c33
-rw-r--r--src/mame/drivers/starwars.c19
-rw-r--r--src/mame/drivers/strnskil.c39
-rw-r--r--src/mame/drivers/suna16.c103
-rw-r--r--src/mame/drivers/suna8.c318
-rw-r--r--src/mame/drivers/supbtime.c23
-rw-r--r--src/mame/drivers/superchs.c116
-rw-r--r--src/mame/drivers/superqix.c220
-rw-r--r--src/mame/drivers/suprloco.c8
-rw-r--r--src/mame/drivers/suprnova.c215
-rw-r--r--src/mame/drivers/suprridr.c25
-rw-r--r--src/mame/drivers/suprslam.c27
-rw-r--r--src/mame/drivers/surpratk.c54
-rw-r--r--src/mame/drivers/system1.c156
-rw-r--r--src/mame/drivers/system16.c550
-rw-r--r--src/mame/drivers/tagteam.c19
-rw-r--r--src/mame/drivers/tail2nos.c7
-rw-r--r--src/mame/drivers/taito_b.c139
-rw-r--r--src/mame/drivers/taito_f2.c190
-rw-r--r--src/mame/drivers/taito_f3.c78
-rw-r--r--src/mame/drivers/taito_h.c34
-rw-r--r--src/mame/drivers/taito_l.c297
-rw-r--r--src/mame/drivers/taito_o.c14
-rw-r--r--src/mame/drivers/taito_z.c250
-rw-r--r--src/mame/drivers/taitoair.c109
-rw-r--r--src/mame/drivers/taitojc.c367
-rw-r--r--src/mame/drivers/taitosj.c11
-rw-r--r--src/mame/drivers/tank8.c22
-rw-r--r--src/mame/drivers/tankbatt.c91
-rw-r--r--src/mame/drivers/tankbust.c47
-rw-r--r--src/mame/drivers/taotaido.c31
-rw-r--r--src/mame/drivers/targeth.c12
-rw-r--r--src/mame/drivers/tatsumi.c112
-rw-r--r--src/mame/drivers/tbowl.c70
-rw-r--r--src/mame/drivers/tceptor.c77
-rw-r--r--src/mame/drivers/tecmo.c71
-rw-r--r--src/mame/drivers/tecmo16.c8
-rw-r--r--src/mame/drivers/tecmosys.c54
-rw-r--r--src/mame/drivers/tehkanwc.c48
-rw-r--r--src/mame/drivers/terracre.c36
-rw-r--r--src/mame/drivers/tetrisp2.c163
-rw-r--r--src/mame/drivers/thedeep.c115
-rw-r--r--src/mame/drivers/thepit.c40
-rw-r--r--src/mame/drivers/thief.c22
-rw-r--r--src/mame/drivers/thoop2.c18
-rw-r--r--src/mame/drivers/thunderx.c151
-rw-r--r--src/mame/drivers/tiamc1.c8
-rw-r--r--src/mame/drivers/tigeroad.c17
-rw-r--r--src/mame/drivers/timelimt.c13
-rw-r--r--src/mame/drivers/timeplt.c27
-rw-r--r--src/mame/drivers/tmnt.c435
-rw-r--r--src/mame/drivers/tnzs.c25
-rw-r--r--src/mame/drivers/toaplan2.c395
-rw-r--r--src/mame/drivers/toki.c17
-rw-r--r--src/mame/drivers/topspeed.c50
-rw-r--r--src/mame/drivers/toypop.c97
-rw-r--r--src/mame/drivers/tp84.c34
-rw-r--r--src/mame/drivers/trackfld.c42
-rw-r--r--src/mame/drivers/triplhnt.c39
-rw-r--r--src/mame/drivers/trucocl.c7
-rw-r--r--src/mame/drivers/tryout.c26
-rw-r--r--src/mame/drivers/tsamurai.c144
-rw-r--r--src/mame/drivers/tubep.c91
-rw-r--r--src/mame/drivers/tumbleb.c119
-rw-r--r--src/mame/drivers/tumblep.c24
-rw-r--r--src/mame/drivers/tunhunt.c19
-rw-r--r--src/mame/drivers/turbo.c78
-rw-r--r--src/mame/drivers/tutankhm.c29
-rw-r--r--src/mame/drivers/twin16.c147
-rw-r--r--src/mame/drivers/ultraman.c11
-rw-r--r--src/mame/drivers/ultratnk.c68
-rw-r--r--src/mame/drivers/undrfire.c113
-rw-r--r--src/mame/drivers/unico.c76
-rw-r--r--src/mame/drivers/usgames.c32
-rw-r--r--src/mame/drivers/vaportra.c26
-rw-r--r--src/mame/drivers/vastar.c33
-rw-r--r--src/mame/drivers/vball.c55
-rw-r--r--src/mame/drivers/vendetta.c65
-rw-r--r--src/mame/drivers/vicdual.c293
-rw-r--r--src/mame/drivers/victory.c12
-rw-r--r--src/mame/drivers/videopin.c18
-rw-r--r--src/mame/drivers/vigilant.c26
-rw-r--r--src/mame/drivers/vsnes.c40
-rw-r--r--src/mame/drivers/warpwarp.c97
-rw-r--r--src/mame/drivers/warriorb.c55
-rw-r--r--src/mame/drivers/wc90.c22
-rw-r--r--src/mame/drivers/wc90b.c29
-rw-r--r--src/mame/drivers/wecleman.c131
-rw-r--r--src/mame/drivers/welltris.c24
-rw-r--r--src/mame/drivers/wgp.c79
-rw-r--r--src/mame/drivers/wiping.c26
-rw-r--r--src/mame/drivers/wiz.c51
-rw-r--r--src/mame/drivers/wolfpack.c70
-rw-r--r--src/mame/drivers/wrally.c12
-rw-r--r--src/mame/drivers/wwfsstar.c37
-rw-r--r--src/mame/drivers/wwfwfest.c60
-rw-r--r--src/mame/drivers/xain.c67
-rw-r--r--src/mame/drivers/xexex.c84
-rw-r--r--src/mame/drivers/xmen.c56
-rw-r--r--src/mame/drivers/xorworld.c12
-rw-r--r--src/mame/drivers/xxmissio.c32
-rw-r--r--src/mame/drivers/xyonix.c54
-rw-r--r--src/mame/drivers/yunsun16.c14
-rw-r--r--src/mame/drivers/yunsung8.c20
-rw-r--r--src/mame/drivers/zac2650.c8
-rw-r--r--src/mame/drivers/zaccaria.c42
-rw-r--r--src/mame/drivers/zaxxon.c42
-rw-r--r--src/mame/includes/1942.h1
-rw-r--r--src/mame/includes/1943.h2
-rw-r--r--src/mame/includes/20pacgal.h8
-rw-r--r--src/mame/includes/40love.h15
-rw-r--r--src/mame/includes/4enraya.h3
-rw-r--r--src/mame/includes/88games.h8
-rw-r--r--src/mame/includes/actfancr.h4
-rw-r--r--src/mame/includes/aeroboto.h4
-rw-r--r--src/mame/includes/aerofgt.h7
-rw-r--r--src/mame/includes/airbustr.h12
-rw-r--r--src/mame/includes/ajax.h1
-rw-r--r--src/mame/includes/aliens.h6
-rw-r--r--src/mame/includes/alpha68k.h21
-rw-r--r--src/mame/includes/ambush.h2
-rw-r--r--src/mame/includes/ampoker2.h8
-rw-r--r--src/mame/includes/amspdwy.h4
-rw-r--r--src/mame/includes/angelkds.h6
-rw-r--r--src/mame/includes/appoooh.h1
-rw-r--r--src/mame/includes/aquarium.h6
-rw-r--r--src/mame/includes/arabian.h5
-rw-r--r--src/mame/includes/argus.h1
-rw-r--r--src/mame/includes/armedf.h17
-rw-r--r--src/mame/includes/artmagic.h6
-rw-r--r--src/mame/includes/ashnojoe.h5
-rw-r--r--src/mame/includes/asterix.h5
-rw-r--r--src/mame/includes/asteroid.h2
-rw-r--r--src/mame/includes/astrocde.h22
-rw-r--r--src/mame/includes/astrof.h11
-rw-r--r--src/mame/includes/asuka.h4
-rw-r--r--src/mame/includes/atetris.h5
-rw-r--r--src/mame/includes/avalnche.h5
-rw-r--r--src/mame/includes/aztarac.h2
-rw-r--r--src/mame/includes/bagman.h2
-rw-r--r--src/mame/includes/baraduke.h6
-rw-r--r--src/mame/includes/battlane.h1
-rw-r--r--src/mame/includes/battlera.h4
-rw-r--r--src/mame/includes/battlnts.h2
-rw-r--r--src/mame/includes/bbusters.h10
-rw-r--r--src/mame/includes/bigevglf.h18
-rw-r--r--src/mame/includes/bionicc.h5
-rw-r--r--src/mame/includes/bishi.h5
-rw-r--r--src/mame/includes/bking.h14
-rw-r--r--src/mame/includes/bladestl.h3
-rw-r--r--src/mame/includes/blktiger.h6
-rw-r--r--src/mame/includes/blmbycar.h6
-rw-r--r--src/mame/includes/blockade.h2
-rw-r--r--src/mame/includes/blockhl.h5
-rw-r--r--src/mame/includes/blockout.h3
-rw-r--r--src/mame/includes/blueprnt.h3
-rw-r--r--src/mame/includes/bogeyman.h2
-rw-r--r--src/mame/includes/bombjack.h3
-rw-r--r--src/mame/includes/bottom9.h11
-rw-r--r--src/mame/includes/brkthru.h3
-rw-r--r--src/mame/includes/btime.h11
-rw-r--r--src/mame/includes/buggychl.h5
-rw-r--r--src/mame/includes/bwing.h7
-rw-r--r--src/mame/includes/bzone.h3
-rw-r--r--src/mame/includes/cabal.h8
-rw-r--r--src/mame/includes/canyon.h3
-rw-r--r--src/mame/includes/capbowl.h5
-rw-r--r--src/mame/includes/carjmbre.h1
-rw-r--r--src/mame/includes/cave.h30
-rw-r--r--src/mame/includes/cbasebal.h4
-rw-r--r--src/mame/includes/cbuster.h2
-rw-r--r--src/mame/includes/ccastles.h9
-rw-r--r--src/mame/includes/cclimber.h7
-rw-r--r--src/mame/includes/centiped.h13
-rw-r--r--src/mame/includes/chaknpop.h1
-rw-r--r--src/mame/includes/champbas.h5
-rw-r--r--src/mame/includes/changela.h21
-rw-r--r--src/mame/includes/chqflag.h6
-rw-r--r--src/mame/includes/cinemat.h11
-rw-r--r--src/mame/includes/circus.h1
-rw-r--r--src/mame/includes/circusc.h5
-rw-r--r--src/mame/includes/cischeat.h16
-rw-r--r--src/mame/includes/citycon.h2
-rw-r--r--src/mame/includes/cloak.h6
-rw-r--r--src/mame/includes/cloud9.h6
-rw-r--r--src/mame/includes/clshroad.h1
-rw-r--r--src/mame/includes/cninja.h7
-rw-r--r--src/mame/includes/combatsc.h13
-rw-r--r--src/mame/includes/compgolf.h1
-rw-r--r--src/mame/includes/contra.h4
-rw-r--r--src/mame/includes/coolpool.h20
-rw-r--r--src/mame/includes/cop01.h5
-rw-r--r--src/mame/includes/copsnrob.h2
-rw-r--r--src/mame/includes/cosmic.h9
-rw-r--r--src/mame/includes/cps1.h14
-rw-r--r--src/mame/includes/cps3.h30
-rw-r--r--src/mame/includes/crbaloon.h3
-rw-r--r--src/mame/includes/crgolf.h9
-rw-r--r--src/mame/includes/crimfght.h4
-rw-r--r--src/mame/includes/crospang.h1
-rw-r--r--src/mame/includes/crshrace.h5
-rw-r--r--src/mame/includes/cvs.h6
-rw-r--r--src/mame/includes/darius.h17
-rw-r--r--src/mame/includes/darkmist.h1
-rw-r--r--src/mame/includes/darkseal.h2
-rw-r--r--src/mame/includes/dassault.h8
-rw-r--r--src/mame/includes/dbz.h4
-rw-r--r--src/mame/includes/dcheese.h6
-rw-r--r--src/mame/includes/ddragon3.h1
-rw-r--r--src/mame/includes/ddribble.h6
-rw-r--r--src/mame/includes/deadang.h2
-rw-r--r--src/mame/includes/dec0.h6
-rw-r--r--src/mame/includes/dec8.h22
-rw-r--r--src/mame/includes/deco32.h30
-rw-r--r--src/mame/includes/deco_mlc.h10
-rw-r--r--src/mame/includes/deniam.h2
-rw-r--r--src/mame/includes/djboy.h17
-rw-r--r--src/mame/includes/djmain.h18
-rw-r--r--src/mame/includes/dkong.h17
-rw-r--r--src/mame/includes/dogfgt.h6
-rw-r--r--src/mame/includes/dooyong.h2
-rw-r--r--src/mame/includes/dragrace.h5
-rw-r--r--src/mame/includes/drgnmst.h10
-rw-r--r--src/mame/includes/dribling.h2
-rw-r--r--src/mame/includes/drmicro.h2
-rw-r--r--src/mame/includes/dynax.h74
-rw-r--r--src/mame/includes/eolith.h4
-rw-r--r--src/mame/includes/epos.h1
-rw-r--r--src/mame/includes/equites.h13
-rw-r--r--src/mame/includes/esd16.h7
-rw-r--r--src/mame/includes/espial.h2
-rw-r--r--src/mame/includes/esripsys.h20
-rw-r--r--src/mame/includes/exerion.h1
-rw-r--r--src/mame/includes/exidy.h1
-rw-r--r--src/mame/includes/exidy440.h10
-rw-r--r--src/mame/includes/exprraid.h3
-rw-r--r--src/mame/includes/exterm.h11
-rw-r--r--src/mame/includes/exzisus.h8
-rw-r--r--src/mame/includes/f1gp.h9
-rw-r--r--src/mame/includes/fantland.h11
-rw-r--r--src/mame/includes/fastlane.h2
-rw-r--r--src/mame/includes/fcombat.h9
-rw-r--r--src/mame/includes/fgoal.h12
-rw-r--r--src/mame/includes/finalizr.h6
-rw-r--r--src/mame/includes/firetrap.h10
-rw-r--r--src/mame/includes/firetrk.h13
-rw-r--r--src/mame/includes/fitfight.h10
-rw-r--r--src/mame/includes/flkatck.h5
-rw-r--r--src/mame/includes/flower.h6
-rw-r--r--src/mame/includes/flstory.h8
-rw-r--r--src/mame/includes/freekick.h11
-rw-r--r--src/mame/includes/fromanc2.h15
-rw-r--r--src/mame/includes/fromance.h10
-rw-r--r--src/mame/includes/funkybee.h2
-rw-r--r--src/mame/includes/funworld.h2
-rw-r--r--src/mame/includes/funybubl.h3
-rw-r--r--src/mame/includes/fuukifg2.h3
-rw-r--r--src/mame/includes/fuukifg3.h8
-rw-r--r--src/mame/includes/gaelco.h7
-rw-r--r--src/mame/includes/gaelco2.h5
-rw-r--r--src/mame/includes/gaelco3d.h19
-rw-r--r--src/mame/includes/gaiden.h6
-rw-r--r--src/mame/includes/galaga.h4
-rw-r--r--src/mame/includes/galastrm.h6
-rw-r--r--src/mame/includes/galaxold.h7
-rw-r--r--src/mame/includes/galivan.h9
-rw-r--r--src/mame/includes/galspnbl.h1
-rw-r--r--src/mame/includes/gaplus.h7
-rw-r--r--src/mame/includes/gatron.h1
-rw-r--r--src/mame/includes/gberet.h7
-rw-r--r--src/mame/includes/gbusters.h8
-rw-r--r--src/mame/includes/gcpinbal.h2
-rw-r--r--src/mame/includes/gijoe.h5
-rw-r--r--src/mame/includes/glass.h3
-rw-r--r--src/mame/includes/gng.h3
-rw-r--r--src/mame/includes/goal92.h3
-rw-r--r--src/mame/includes/goindol.h6
-rw-r--r--src/mame/includes/goldstar.h31
-rw-r--r--src/mame/includes/gomoku.h1
-rw-r--r--src/mame/includes/gotcha.h1
-rw-r--r--src/mame/includes/gottlieb.h8
-rw-r--r--src/mame/includes/gradius3.h11
-rw-r--r--src/mame/includes/grchamp.h11
-rw-r--r--src/mame/includes/gridlee.h5
-rw-r--r--src/mame/includes/groundfx.h7
-rw-r--r--src/mame/includes/gstriker.h11
-rw-r--r--src/mame/includes/gunbustr.h6
-rw-r--r--src/mame/includes/gundealr.h1
-rw-r--r--src/mame/includes/gunsmoke.h1
-rw-r--r--src/mame/includes/gyruss.h5
-rw-r--r--src/mame/includes/hanaawas.h2
-rw-r--r--src/mame/includes/hcastle.h3
-rw-r--r--src/mame/includes/hexion.h1
-rw-r--r--src/mame/includes/himesiki.h2
-rw-r--r--src/mame/includes/hitme.h5
-rw-r--r--src/mame/includes/hnayayoi.h3
-rw-r--r--src/mame/includes/hng64.h30
-rw-r--r--src/mame/includes/homedata.h23
-rw-r--r--src/mame/includes/hyperspt.h2
-rw-r--r--src/mame/includes/hyprduel.h9
-rw-r--r--src/mame/includes/ikki.h2
-rw-r--r--src/mame/includes/inufuku.h3
-rw-r--r--src/mame/includes/iqblock.h4
-rw-r--r--src/mame/includes/irobot.h3
-rw-r--r--src/mame/includes/ironhors.h1
-rw-r--r--src/mame/includes/itech32.h33
-rw-r--r--src/mame/includes/itech8.h10
-rw-r--r--src/mame/includes/jack.h3
-rw-r--r--src/mame/includes/jackal.h9
-rw-r--r--src/mame/includes/jailbrek.h1
-rw-r--r--src/mame/includes/jedi.h7
-rw-r--r--src/mame/includes/jpmimpct.h18
-rw-r--r--src/mame/includes/kaneko16.h10
-rw-r--r--src/mame/includes/kangaroo.h3
-rw-r--r--src/mame/includes/karnov.h2
-rw-r--r--src/mame/includes/kchamp.h6
-rw-r--r--src/mame/includes/kickgoal.h2
-rw-r--r--src/mame/includes/kingobox.h4
-rw-r--r--src/mame/includes/kncljoe.h2
-rw-r--r--src/mame/includes/konamigx.h23
-rw-r--r--src/mame/includes/kopunch.h3
-rw-r--r--src/mame/includes/ksayakyu.h4
-rw-r--r--src/mame/includes/kyugo.h3
-rw-r--r--src/mame/includes/labyrunr.h1
-rw-r--r--src/mame/includes/ladybug.h6
-rw-r--r--src/mame/includes/ladyfrog.h7
-rw-r--r--src/mame/includes/laserbat.h7
-rw-r--r--src/mame/includes/lasso.h4
-rw-r--r--src/mame/includes/lastduel.h2
-rw-r--r--src/mame/includes/lazercmd.h8
-rw-r--r--src/mame/includes/legionna.h1
-rw-r--r--src/mame/includes/lemmings.h6
-rw-r--r--src/mame/includes/lethal.h10
-rw-r--r--src/mame/includes/lethalj.h3
-rw-r--r--src/mame/includes/liberate.h10
-rw-r--r--src/mame/includes/lkage.h8
-rw-r--r--src/mame/includes/lordgun.h6
-rw-r--r--src/mame/includes/lsasquad.h1
-rw-r--r--src/mame/includes/lucky74.h6
-rw-r--r--src/mame/includes/lvcards.h3
-rw-r--r--src/mame/includes/lwings.h7
-rw-r--r--src/mame/includes/m10.h8
-rw-r--r--src/mame/includes/m107.h9
-rw-r--r--src/mame/includes/m62.h9
-rw-r--r--src/mame/includes/m72.h26
-rw-r--r--src/mame/includes/m90.h4
-rw-r--r--src/mame/includes/m92.h10
-rw-r--r--src/mame/includes/macrossp.h7
-rw-r--r--src/mame/includes/madalien.h5
-rw-r--r--src/mame/includes/madmotor.h1
-rw-r--r--src/mame/includes/magmax.h4
-rw-r--r--src/mame/includes/mainevt.h9
-rw-r--r--src/mame/includes/mainsnk.h3
-rw-r--r--src/mame/includes/malzak.h7
-rw-r--r--src/mame/includes/mappy.h3
-rw-r--r--src/mame/includes/marineb.h1
-rw-r--r--src/mame/includes/mario.h1
-rw-r--r--src/mame/includes/markham.h1
-rw-r--r--src/mame/includes/matmania.h2
-rw-r--r--src/mame/includes/mcatadv.h4
-rw-r--r--src/mame/includes/mcr68.h13
-rw-r--r--src/mame/includes/meadows.h6
-rw-r--r--src/mame/includes/megasys1.h14
-rw-r--r--src/mame/includes/megazone.h4
-rw-r--r--src/mame/includes/mermaid.h6
-rw-r--r--src/mame/includes/metalmx.h18
-rw-r--r--src/mame/includes/metlclsh.h6
-rw-r--r--src/mame/includes/metro.h31
-rw-r--r--src/mame/includes/mexico86.h1
-rw-r--r--src/mame/includes/mhavoc.h2
-rw-r--r--src/mame/includes/midzeus.h19
-rw-r--r--src/mame/includes/mikie.h4
-rw-r--r--src/mame/includes/mitchell.h10
-rw-r--r--src/mame/includes/mjkjidai.h2
-rw-r--r--src/mame/includes/model1.h16
-rw-r--r--src/mame/includes/momoko.h1
-rw-r--r--src/mame/includes/moo.h10
-rw-r--r--src/mame/includes/mosaic.h4
-rw-r--r--src/mame/includes/mouser.h4
-rw-r--r--src/mame/includes/mpu4.h11
-rw-r--r--src/mame/includes/mrdo.h1
-rw-r--r--src/mame/includes/mrflea.h10
-rw-r--r--src/mame/includes/mrjong.h1
-rw-r--r--src/mame/includes/ms32.h28
-rw-r--r--src/mame/includes/msisaac.h10
-rw-r--r--src/mame/includes/mugsmash.h2
-rw-r--r--src/mame/includes/munchmo.h3
-rw-r--r--src/mame/includes/mw8080bw.h14
-rw-r--r--src/mame/includes/mystston.h2
-rw-r--r--src/mame/includes/mystwarr.h19
-rw-r--r--src/mame/includes/n8080.h3
-rw-r--r--src/mame/includes/namcofl.h19
-rw-r--r--src/mame/includes/namcona1.h23
-rw-r--r--src/mame/includes/namcond1.h5
-rw-r--r--src/mame/includes/namcos1.h8
-rw-r--r--src/mame/includes/namcos21.h69
-rw-r--r--src/mame/includes/namcos86.h13
-rw-r--r--src/mame/includes/naughtyb.h6
-rw-r--r--src/mame/includes/nbmj8688.h2
-rw-r--r--src/mame/includes/nbmj8891.h1
-rw-r--r--src/mame/includes/nbmj8991.h3
-rw-r--r--src/mame/includes/nbmj9195.h49
-rw-r--r--src/mame/includes/nemesis.h13
-rw-r--r--src/mame/includes/neogeo.h15
-rw-r--r--src/mame/includes/ninjakd2.h6
-rw-r--r--src/mame/includes/ninjaw.h6
-rw-r--r--src/mame/includes/niyanpai.h28
-rw-r--r--src/mame/includes/nmk16.h23
-rw-r--r--src/mame/includes/norautp.h5
-rw-r--r--src/mame/includes/nova2001.h2
-rw-r--r--src/mame/includes/nycaptor.h20
-rw-r--r--src/mame/includes/ohmygod.h1
-rw-r--r--src/mame/includes/ojankohs.h11
-rw-r--r--src/mame/includes/oneshot.h5
-rw-r--r--src/mame/includes/opwolf.h9
-rw-r--r--src/mame/includes/orbit.h1
-rw-r--r--src/mame/includes/othldrby.h4
-rw-r--r--src/mame/includes/othunder.h9
-rw-r--r--src/mame/includes/overdriv.h7
-rw-r--r--src/mame/includes/pacland.h8
-rw-r--r--src/mame/includes/pacman.h40
-rw-r--r--src/mame/includes/pandoras.h6
-rw-r--r--src/mame/includes/paradise.h2
-rw-r--r--src/mame/includes/parodius.h8
-rw-r--r--src/mame/includes/pastelg.h5
-rw-r--r--src/mame/includes/pbaction.h3
-rw-r--r--src/mame/includes/pcktgal.h4
-rw-r--r--src/mame/includes/pgm.h8
-rw-r--r--src/mame/includes/pingpong.h3
-rw-r--r--src/mame/includes/pirates.h2
-rw-r--r--src/mame/includes/pitnrun.h3
-rw-r--r--src/mame/includes/pktgaldx.h2
-rw-r--r--src/mame/includes/playch10.h5
-rw-r--r--src/mame/includes/playmark.h10
-rw-r--r--src/mame/includes/plygonet.h24
-rw-r--r--src/mame/includes/pokechmp.h4
-rw-r--r--src/mame/includes/polepos.h5
-rw-r--r--src/mame/includes/policetr.h5
-rw-r--r--src/mame/includes/polyplay.h3
-rw-r--r--src/mame/includes/poolshrk.h5
-rw-r--r--src/mame/includes/pooyan.h1
-rw-r--r--src/mame/includes/popeye.h2
-rw-r--r--src/mame/includes/popper.h3
-rw-r--r--src/mame/includes/portrait.h3
-rw-r--r--src/mame/includes/powerins.h3
-rw-r--r--src/mame/includes/prehisle.h1
-rw-r--r--src/mame/includes/psikyo.h14
-rw-r--r--src/mame/includes/psikyo4.h7
-rw-r--r--src/mame/includes/psikyosh.h4
-rw-r--r--src/mame/includes/psychic5.h5
-rw-r--r--src/mame/includes/punchout.h6
-rw-r--r--src/mame/includes/pushman.h8
-rw-r--r--src/mame/includes/qdrmfgp.h10
-rw-r--r--src/mame/includes/quizdna.h2
-rw-r--r--src/mame/includes/raiden.h1
-rw-r--r--src/mame/includes/rainbow.h2
-rw-r--r--src/mame/includes/rallyx.h4
-rw-r--r--src/mame/includes/rastan.h1
-rw-r--r--src/mame/includes/realbrk.h6
-rw-r--r--src/mame/includes/redalert.h4
-rw-r--r--src/mame/includes/renegade.h7
-rw-r--r--src/mame/includes/retofinv.h10
-rw-r--r--src/mame/includes/rltennis.h3
-rw-r--r--src/mame/includes/rockrage.h2
-rw-r--r--src/mame/includes/rocnrope.h2
-rw-r--r--src/mame/includes/rohga.h2
-rw-r--r--src/mame/includes/rollerg.h5
-rw-r--r--src/mame/includes/rollrace.h4
-rw-r--r--src/mame/includes/route16.h8
-rw-r--r--src/mame/includes/rpunch.h3
-rw-r--r--src/mame/includes/runaway.h3
-rw-r--r--src/mame/includes/rungun.h8
-rw-r--r--src/mame/includes/sauro.h5
-rw-r--r--src/mame/includes/sbasketb.h3
-rw-r--r--src/mame/includes/scotrsht.h2
-rw-r--r--src/mame/includes/sderby.h7
-rw-r--r--src/mame/includes/segag80r.h9
-rw-r--r--src/mame/includes/segag80v.h10
-rw-r--r--src/mame/includes/senjyo.h4
-rw-r--r--src/mame/includes/sf.h7
-rw-r--r--src/mame/includes/shadfrce.h6
-rw-r--r--src/mame/includes/shangha3.h7
-rw-r--r--src/mame/includes/shangkid.h5
-rw-r--r--src/mame/includes/shisen.h2
-rw-r--r--src/mame/includes/shootout.h4
-rw-r--r--src/mame/includes/sidearms.h3
-rw-r--r--src/mame/includes/sidepckt.h4
-rw-r--r--src/mame/includes/silkroad.h2
-rw-r--r--src/mame/includes/simpl156.h18
-rw-r--r--src/mame/includes/simpsons.h2
-rw-r--r--src/mame/includes/skydiver.h1
-rw-r--r--src/mame/includes/skykid.h8
-rw-r--r--src/mame/includes/skyraid.h4
-rw-r--r--src/mame/includes/slapfght.h2
-rw-r--r--src/mame/includes/slapshot.h8
-rw-r--r--src/mame/includes/snk.h48
-rw-r--r--src/mame/includes/snk68.h10
-rw-r--r--src/mame/includes/snookr10.h3
-rw-r--r--src/mame/includes/snowbros.h15
-rw-r--r--src/mame/includes/solomon.h3
-rw-r--r--src/mame/includes/sonson.h3
-rw-r--r--src/mame/includes/spbactn.h1
-rw-r--r--src/mame/includes/spcforce.h6
-rw-r--r--src/mame/includes/spdodgeb.h5
-rw-r--r--src/mame/includes/speedatk.h4
-rw-r--r--src/mame/includes/speedbal.h1
-rw-r--r--src/mame/includes/speedspn.h3
-rw-r--r--src/mame/includes/splash.h16
-rw-r--r--src/mame/includes/sprcros2.h2
-rw-r--r--src/mame/includes/sprint2.h12
-rw-r--r--src/mame/includes/sprint4.h10
-rw-r--r--src/mame/includes/sprint8.h4
-rw-r--r--src/mame/includes/spy.h8
-rw-r--r--src/mame/includes/srmp2.h16
-rw-r--r--src/mame/includes/srumbler.h1
-rw-r--r--src/mame/includes/sshangha.h6
-rw-r--r--src/mame/includes/sslam.h4
-rw-r--r--src/mame/includes/ssozumo.h2
-rw-r--r--src/mame/includes/sspeedr.h5
-rw-r--r--src/mame/includes/ssrj.h1
-rw-r--r--src/mame/includes/ssv.h35
-rw-r--r--src/mame/includes/st0016.h6
-rw-r--r--src/mame/includes/stactics.h3
-rw-r--r--src/mame/includes/stadhero.h2
-rw-r--r--src/mame/includes/starfire.h6
-rw-r--r--src/mame/includes/starshp1.h3
-rw-r--r--src/mame/includes/starwars.h3
-rw-r--r--src/mame/includes/strnskil.h4
-rw-r--r--src/mame/includes/suna16.h9
-rw-r--r--src/mame/includes/suna8.h34
-rw-r--r--src/mame/includes/supbtime.h2
-rw-r--r--src/mame/includes/superchs.h10
-rw-r--r--src/mame/includes/superqix.h18
-rw-r--r--src/mame/includes/suprloco.h1
-rw-r--r--src/mame/includes/suprnova.h20
-rw-r--r--src/mame/includes/suprridr.h4
-rw-r--r--src/mame/includes/suprslam.h4
-rw-r--r--src/mame/includes/surpratk.h4
-rw-r--r--src/mame/includes/system1.h15
-rw-r--r--src/mame/includes/system16.h38
-rw-r--r--src/mame/includes/tagteam.h3
-rw-r--r--src/mame/includes/tail2nos.h1
-rw-r--r--src/mame/includes/taito_b.h17
-rw-r--r--src/mame/includes/taito_f2.h14
-rw-r--r--src/mame/includes/taito_f3.h8
-rw-r--r--src/mame/includes/taito_h.h2
-rw-r--r--src/mame/includes/taito_l.h32
-rw-r--r--src/mame/includes/taito_o.h2
-rw-r--r--src/mame/includes/taito_z.h25
-rw-r--r--src/mame/includes/taitoair.h12
-rw-r--r--src/mame/includes/taitojc.h38
-rw-r--r--src/mame/includes/taitosj.h1
-rw-r--r--src/mame/includes/tank8.h3
-rw-r--r--src/mame/includes/tankbatt.h12
-rw-r--r--src/mame/includes/tankbust.h5
-rw-r--r--src/mame/includes/taotaido.h4
-rw-r--r--src/mame/includes/targeth.h2
-rw-r--r--src/mame/includes/tatsumi.h11
-rw-r--r--src/mame/includes/tbowl.h10
-rw-r--r--src/mame/includes/tceptor.h12
-rw-r--r--src/mame/includes/tecmo.h7
-rw-r--r--src/mame/includes/tecmo16.h1
-rw-r--r--src/mame/includes/tecmosys.h6
-rw-r--r--src/mame/includes/tehkanwc.h7
-rw-r--r--src/mame/includes/terracre.h5
-rw-r--r--src/mame/includes/tetrisp2.h16
-rw-r--r--src/mame/includes/thedeep.h11
-rw-r--r--src/mame/includes/thepit.h4
-rw-r--r--src/mame/includes/thief.h2
-rw-r--r--src/mame/includes/thoop2.h3
-rw-r--r--src/mame/includes/thunderx.h11
-rw-r--r--src/mame/includes/tiamc1.h1
-rw-r--r--src/mame/includes/tigeroad.h2
-rw-r--r--src/mame/includes/timelimt.h2
-rw-r--r--src/mame/includes/timeplt.h3
-rw-r--r--src/mame/includes/tmnt.h34
-rw-r--r--src/mame/includes/tnzs.h3
-rw-r--r--src/mame/includes/toaplan2.h36
-rw-r--r--src/mame/includes/toki.h3
-rw-r--r--src/mame/includes/topspeed.h6
-rw-r--r--src/mame/includes/toypop.h13
-rw-r--r--src/mame/includes/tp84.h4
-rw-r--r--src/mame/includes/trackfld.h4
-rw-r--r--src/mame/includes/triplhnt.h5
-rw-r--r--src/mame/includes/trucocl.h1
-rw-r--r--src/mame/includes/tryout.h4
-rw-r--r--src/mame/includes/tsamurai.h18
-rw-r--r--src/mame/includes/tubep.h12
-rw-r--r--src/mame/includes/tumbleb.h14
-rw-r--r--src/mame/includes/tumblep.h4
-rw-r--r--src/mame/includes/tunhunt.h2
-rw-r--r--src/mame/includes/turbo.h9
-rw-r--r--src/mame/includes/tutankhm.h4
-rw-r--r--src/mame/includes/twin16.h13
-rw-r--r--src/mame/includes/ultraman.h2
-rw-r--r--src/mame/includes/ultratnk.h11
-rw-r--r--src/mame/includes/undrfire.h13
-rw-r--r--src/mame/includes/unico.h11
-rw-r--r--src/mame/includes/usgames.h3
-rw-r--r--src/mame/includes/vaportra.h3
-rw-r--r--src/mame/includes/vastar.h5
-rw-r--r--src/mame/includes/vball.h5
-rw-r--r--src/mame/includes/vendetta.h7
-rw-r--r--src/mame/includes/vicdual.h30
-rw-r--r--src/mame/includes/victory.h1
-rw-r--r--src/mame/includes/videopin.h2
-rw-r--r--src/mame/includes/vigilant.h3
-rw-r--r--src/mame/includes/vsnes.h5
-rw-r--r--src/mame/includes/warpwarp.h6
-rw-r--r--src/mame/includes/warriorb.h5
-rw-r--r--src/mame/includes/wc90.h3
-rw-r--r--src/mame/includes/wc90b.h4
-rw-r--r--src/mame/includes/wecleman.h10
-rw-r--r--src/mame/includes/welltris.h3
-rw-r--r--src/mame/includes/wgp.h10
-rw-r--r--src/mame/includes/wiping.h4
-rw-r--r--src/mame/includes/wiz.h5
-rw-r--r--src/mame/includes/wolfpack.h14
-rw-r--r--src/mame/includes/wrally.h2
-rw-r--r--src/mame/includes/wwfsstar.h4
-rw-r--r--src/mame/includes/wwfwfest.h7
-rw-r--r--src/mame/includes/xain.h8
-rw-r--r--src/mame/includes/xexex.h12
-rw-r--r--src/mame/includes/xmen.h6
-rw-r--r--src/mame/includes/xorworld.h2
-rw-r--r--src/mame/includes/xxmissio.h3
-rw-r--r--src/mame/includes/xyonix.h3
-rw-r--r--src/mame/includes/yunsun16.h2
-rw-r--r--src/mame/includes/yunsung8.h2
-rw-r--r--src/mame/includes/zac2650.h1
-rw-r--r--src/mame/includes/zaccaria.h7
-rw-r--r--src/mame/includes/zaxxon.h4
1050 files changed, 22644 insertions, 20888 deletions
diff --git a/src/mame/drivers/1942.c b/src/mame/drivers/1942.c
index 5a3c2c7a53a..5b804318d17 100644
--- a/src/mame/drivers/1942.c
+++ b/src/mame/drivers/1942.c
@@ -69,9 +69,9 @@ correctly.
#include "includes/1942.h"
-static WRITE8_HANDLER( c1942_bankswitch_w )
+WRITE8_MEMBER(_1942_state::c1942_bankswitch_w)
{
- memory_set_bank(space->machine(), "bank1", data & 0x03);
+ memory_set_bank(machine(), "bank1", data & 0x03);
}
static TIMER_DEVICE_CALLBACK( c1942_scanline )
@@ -98,7 +98,7 @@ static ADDRESS_MAP_START( c1942_map, AS_PROGRAM, 8, _1942_state )
AM_RANGE(0xc802, 0xc803) AM_WRITE_LEGACY(c1942_scroll_w)
AM_RANGE(0xc804, 0xc804) AM_WRITE_LEGACY(c1942_c804_w)
AM_RANGE(0xc805, 0xc805) AM_WRITE_LEGACY(c1942_palette_bank_w)
- AM_RANGE(0xc806, 0xc806) AM_WRITE_LEGACY(c1942_bankswitch_w)
+ AM_RANGE(0xc806, 0xc806) AM_WRITE(c1942_bankswitch_w)
AM_RANGE(0xcc00, 0xcc7f) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size)
AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE_LEGACY(c1942_fgvideoram_w) AM_BASE(m_fg_videoram)
AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE_LEGACY(c1942_bgvideoram_w) AM_BASE(m_bg_videoram)
diff --git a/src/mame/drivers/1943.c b/src/mame/drivers/1943.c
index 7aae43d8f94..40333a2178f 100644
--- a/src/mame/drivers/1943.c
+++ b/src/mame/drivers/1943.c
@@ -36,15 +36,15 @@
/* Read/Write Handlers */
-static READ8_HANDLER( c1943_protection_r )
+READ8_MEMBER(_1943_state::c1943_protection_r)
{
/*
This is a protection check. The game crashes (thru a jump to 0x8000)
if a read from this address doesn't return the value it expects.
*/
- int data = cpu_get_reg(&space->device(), Z80_BC) >> 8;
-// logerror("protection read, PC: %04x Result:%02x\n", cpu_get_pc(&space->device()), data);
+ int data = cpu_get_reg(&space.device(), Z80_BC) >> 8;
+// logerror("protection read, PC: %04x Result:%02x\n", cpu_get_pc(&space.device()), data);
return data;
}
@@ -58,7 +58,7 @@ static ADDRESS_MAP_START( c1943_map, AS_PROGRAM, 8, _1943_state )
AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2")
AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSWA")
AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSWB")
- AM_RANGE(0xc007, 0xc007) AM_READ_LEGACY(c1943_protection_r)
+ AM_RANGE(0xc007, 0xc007) AM_READ(c1943_protection_r)
AM_RANGE(0xc800, 0xc800) AM_WRITE_LEGACY(soundlatch_w)
AM_RANGE(0xc804, 0xc804) AM_WRITE_LEGACY(c1943_c804_w) // ROM bank switch, screen flip
AM_RANGE(0xc806, 0xc806) AM_WRITE_LEGACY(watchdog_reset_w)
@@ -647,14 +647,15 @@ static DRIVER_INIT( 1943 )
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
}
-static READ8_HANDLER( _1943b_c007_r ) { return 0; }
+READ8_MEMBER(_1943_state::_1943b_c007_r){ return 0; }
static DRIVER_INIT( 1943b )
{
+ _1943_state *state = machine.driver_data<_1943_state>();
DRIVER_INIT_CALL( 1943 );
//it expects 0x00 to be returned from the protection reads because the protection has been patched out.
- //AM_RANGE(0xc007, 0xc007) AM_READ_LEGACY(c1943_protection_r)
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc007, 0xc007, FUNC(_1943b_c007_r));
+ //AM_RANGE(0xc007, 0xc007) AM_READ(c1943_protection_r)
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc007, 0xc007, read8_delegate(FUNC(_1943_state::_1943b_c007_r),state));
}
diff --git a/src/mame/drivers/20pacgal.c b/src/mame/drivers/20pacgal.c
index 97db72f073f..4cc64943cee 100644
--- a/src/mame/drivers/20pacgal.c
+++ b/src/mame/drivers/20pacgal.c
@@ -74,19 +74,17 @@
*
*************************************/
-static WRITE8_HANDLER( irqack_w )
+WRITE8_MEMBER(_20pacgal_state::irqack_w)
{
- _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
- state->m_irq_mask = data & 1;
+ m_irq_mask = data & 1;
- if (!state->m_irq_mask)
- device_set_input_line(state->m_maincpu, 0, CLEAR_LINE);
+ if (!m_irq_mask)
+ device_set_input_line(m_maincpu, 0, CLEAR_LINE);
}
-static WRITE8_HANDLER( timer_pulse_w )
+WRITE8_MEMBER(_20pacgal_state::timer_pulse_w)
{
- //_20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
//printf("timer pulse %02x\n", data);
}
@@ -128,9 +126,9 @@ static const eeprom_interface _20pacgal_eeprom_intf =
*
*************************************/
-static WRITE8_HANDLER( _20pacgal_coin_counter_w )
+WRITE8_MEMBER(_20pacgal_state::_20pacgal_coin_counter_w)
{
- coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(machine(), 0, data & 1);
}
@@ -153,24 +151,22 @@ static void set_bankptr(running_machine &machine)
memory_set_bankptr(machine, "bank1", state->m_ram_48000);
}
-static WRITE8_HANDLER( ram_bank_select_w )
+WRITE8_MEMBER(_20pacgal_state::ram_bank_select_w)
{
- _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
- state->m_game_selected = data & 1;
- set_bankptr(space->machine());
+ m_game_selected = data & 1;
+ set_bankptr(machine());
}
-static WRITE8_HANDLER( ram_48000_w )
+WRITE8_MEMBER(_20pacgal_state::ram_48000_w)
{
- _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
- if (state->m_game_selected)
+ if (m_game_selected)
{
if (offset < 0x0800)
- state->m_video_ram[offset & 0x07ff] = data;
+ m_video_ram[offset & 0x07ff] = data;
- state->m_ram_48000[offset] = data;
+ m_ram_48000[offset] = data;
}
}
@@ -180,22 +176,19 @@ static WRITE8_HANDLER( ram_48000_w )
*
*************************************/
-static WRITE8_HANDLER( sprite_gfx_w )
+WRITE8_MEMBER(_20pacgal_state::sprite_gfx_w)
{
- _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
- state->m_sprite_gfx_ram[offset] = data;
+ m_sprite_gfx_ram[offset] = data;
}
-static WRITE8_HANDLER( sprite_ram_w )
+WRITE8_MEMBER(_20pacgal_state::sprite_ram_w)
{
- _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
- state->m_sprite_ram[offset] = data;
+ m_sprite_ram[offset] = data;
}
-static WRITE8_HANDLER( sprite_lookup_w )
+WRITE8_MEMBER(_20pacgal_state::sprite_lookup_w)
{
- _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
- state->m_sprite_color_lookup[offset] = data;
+ m_sprite_color_lookup[offset] = data;
}
static ADDRESS_MAP_START( 20pacgal_map, AS_PROGRAM, 8, _20pacgal_state )
@@ -210,11 +203,11 @@ static ADDRESS_MAP_START( 20pacgal_map, AS_PROGRAM, 8, _20pacgal_state )
AM_RANGE(0x45f00, 0x45fff) AM_DEVWRITE_LEGACY("namco", namcos1_cus30_w)
AM_RANGE(0x46000, 0x46fff) AM_WRITEONLY AM_BASE(m_char_gfx_ram)
AM_RANGE(0x47100, 0x47100) AM_RAM /* leftover from original Galaga code */
- AM_RANGE(0x48000, 0x49fff) AM_READ_BANK("bank1") AM_WRITE_LEGACY(ram_48000_w) /* this should be a mirror of 08000-09ffff */
- AM_RANGE(0x4c000, 0x4dfff) AM_WRITE_LEGACY(sprite_gfx_w)
- AM_RANGE(0x4e000, 0x4e17f) AM_WRITE_LEGACY(sprite_ram_w)
+ AM_RANGE(0x48000, 0x49fff) AM_READ_BANK("bank1") AM_WRITE(ram_48000_w) /* this should be a mirror of 08000-09ffff */
+ AM_RANGE(0x4c000, 0x4dfff) AM_WRITE(sprite_gfx_w)
+ AM_RANGE(0x4e000, 0x4e17f) AM_WRITE(sprite_ram_w)
AM_RANGE(0x4e180, 0x4feff) AM_WRITENOP
- AM_RANGE(0x4ff00, 0x4ffff) AM_WRITE_LEGACY(sprite_lookup_w)
+ AM_RANGE(0x4ff00, 0x4ffff) AM_WRITE(sprite_lookup_w)
ADDRESS_MAP_END
@@ -233,16 +226,16 @@ static ADDRESS_MAP_START( 20pacgal_io_map, AS_IO, 8, _20pacgal_state )
AM_RANGE(0x81, 0x81) AM_READ_PORT("P2")
AM_RANGE(0x82, 0x82) AM_READ_PORT("SERVICE")
AM_RANGE(0x80, 0x80) AM_WRITE_LEGACY(watchdog_reset_w)
- AM_RANGE(0x81, 0x81) AM_WRITE_LEGACY(timer_pulse_w) /* ??? pulsed by the timer irq */
- AM_RANGE(0x82, 0x82) AM_WRITE_LEGACY(irqack_w)
+ AM_RANGE(0x81, 0x81) AM_WRITE(timer_pulse_w) /* ??? pulsed by the timer irq */
+ AM_RANGE(0x82, 0x82) AM_WRITE(irqack_w)
AM_RANGE(0x84, 0x84) AM_NOP /* ?? */
AM_RANGE(0x85, 0x86) AM_WRITEONLY AM_BASE(m_stars_seed) /* stars: rng seed (lo/hi) */
AM_RANGE(0x87, 0x87) AM_READ_PORT("EEPROMIN") AM_WRITE_PORT("EEPROMOUT")
- AM_RANGE(0x88, 0x88) AM_WRITE_LEGACY(ram_bank_select_w)
+ AM_RANGE(0x88, 0x88) AM_WRITE(ram_bank_select_w)
AM_RANGE(0x89, 0x89) AM_DEVWRITE_LEGACY("dac", dac_signed_w)
AM_RANGE(0x8a, 0x8a) AM_WRITEONLY AM_BASE(m_stars_ctrl) /* stars: bits 3-4 = active set; bit 5 = enable */
AM_RANGE(0x8b, 0x8b) AM_WRITEONLY AM_BASE(m_flip)
- AM_RANGE(0x8f, 0x8f) AM_WRITE_LEGACY(_20pacgal_coin_counter_w)
+ AM_RANGE(0x8f, 0x8f) AM_WRITE(_20pacgal_coin_counter_w)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/40love.c b/src/mame/drivers/40love.c
index 028be1fc933..788a9f9397f 100644
--- a/src/mame/drivers/40love.c
+++ b/src/mame/drivers/40love.c
@@ -234,40 +234,38 @@ static TIMER_CALLBACK( nmi_callback )
state->m_pending_nmi = 1;
}
-static WRITE8_HANDLER( sound_command_w )
+WRITE8_MEMBER(fortyl_state::sound_command_w)
{
soundlatch_w(space, 0, data);
- space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
+ machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
-static WRITE8_HANDLER( nmi_disable_w )
+WRITE8_MEMBER(fortyl_state::nmi_disable_w)
{
- fortyl_state *state = space->machine().driver_data<fortyl_state>();
- state->m_sound_nmi_enable = 0;
+ m_sound_nmi_enable = 0;
}
-static WRITE8_HANDLER( nmi_enable_w )
+WRITE8_MEMBER(fortyl_state::nmi_enable_w)
{
- fortyl_state *state = space->machine().driver_data<fortyl_state>();
- state->m_sound_nmi_enable = 1;
- if (state->m_pending_nmi)
+ m_sound_nmi_enable = 1;
+ if (m_pending_nmi)
{
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
- state->m_pending_nmi = 0;
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ m_pending_nmi = 0;
}
}
#if 0
-static WRITE8_HANDLER( fortyl_coin_counter_w )
+WRITE8_MEMBER(fortyl_state::fortyl_coin_counter_w)
{
- coin_counter_w(space->machine(), offset,data);
+ coin_counter_w(machine(), offset,data);
}
#endif
-static WRITE8_HANDLER( bank_select_w )
+WRITE8_MEMBER(fortyl_state::bank_select_w)
{
if ((data != 0x02) && (data != 0xfd))
@@ -276,16 +274,15 @@ static WRITE8_HANDLER( bank_select_w )
// popmessage("WRONG BANK SELECT = %x !!!!\n",data);
}
- memory_set_bank(space->machine(), "bank1", data & 1);
+ memory_set_bank(machine(), "bank1", data & 1);
}
-static WRITE8_HANDLER( pix1_w )
+WRITE8_MEMBER(fortyl_state::pix1_w)
{
- fortyl_state *state = space->machine().driver_data<fortyl_state>();
// if (data > 7)
// logerror("pix1 = %2x\n", data);
- state->m_pix1 = data;
+ m_pix1 = data;
}
static WRITE8_DEVICE_HANDLER( pix1_mcu_w )
@@ -297,31 +294,28 @@ static WRITE8_DEVICE_HANDLER( pix1_mcu_w )
state->m_pix1 = data;
}
-static WRITE8_HANDLER( pix2_w )
+WRITE8_MEMBER(fortyl_state::pix2_w)
{
- fortyl_state *state = space->machine().driver_data<fortyl_state>();
// if ((data!=0x00) && (data != 0xff))
// logerror("pix2 = %2x\n", data);
- state->m_pix2[0] = state->m_pix2[1];
- state->m_pix2[1] = data;
+ m_pix2[0] = m_pix2[1];
+ m_pix2[1] = data;
}
#if 0
-static READ8_HANDLER( pix1_r )
+READ8_MEMBER(fortyl_state::pix1_r)
{
- fortyl_state *state = space->machine().driver_data<fortyl_state>();
- return state->m_pix1;
+ return m_pix1;
}
#endif
-static READ8_HANDLER( pix2_r )
+READ8_MEMBER(fortyl_state::pix2_r)
{
- fortyl_state *state = space->machine().driver_data<fortyl_state>();
int res;
- int d1 = state->m_pix1 & 7;
+ int d1 = m_pix1 & 7;
- res = (((state->m_pix2[1] << (d1 + 8)) | (state->m_pix2[0] << d1)) & 0xff00) >> 8;
+ res = (((m_pix2[1] << (d1 + 8)) | (m_pix2[0] << d1)) & 0xff00) >> 8;
return res;
}
@@ -393,20 +387,19 @@ static const UINT8 mcu_data2[0x80] =
};
-static WRITE8_HANDLER( undoukai_mcu_w )
+WRITE8_MEMBER(fortyl_state::undoukai_mcu_w)
{
- fortyl_state *state = space->machine().driver_data<fortyl_state>();
- int ram_adr = state->m_mcu_ram[0x1b5] * 0x100 + state->m_mcu_ram[0x1b4];
+ int ram_adr = m_mcu_ram[0x1b5] * 0x100 + m_mcu_ram[0x1b4];
int d, i;
// logerror("mcu_w %02x\n", data);
- if (state->m_mcu_cmd != -1)
+ if (m_mcu_cmd != -1)
{
- state->m_mcu_in[(state->m_mcu_cmd & 0x10) >> 4][state->m_mcu_cmd & 0x0f] = data;
- state->m_mcu_cmd = -1;
+ m_mcu_in[(m_mcu_cmd & 0x10) >> 4][m_mcu_cmd & 0x0f] = data;
+ m_mcu_cmd = -1;
}
else
{
@@ -420,14 +413,14 @@ static WRITE8_HANDLER( undoukai_mcu_w )
case 0xc5:
case 0xc6:
case 0xc7:
- state->m_mcu_cmd = (data & 0x0f) | 0x10;
+ m_mcu_cmd = (data & 0x0f) | 0x10;
break;
case 0xb0:
case 0xb1:
case 0xb2:
case 0xb3:
- state->m_mcu_cmd = data & 0x0f;
+ m_mcu_cmd = data & 0x0f;
break;
case 0x30:
@@ -440,96 +433,96 @@ static WRITE8_HANDLER( undoukai_mcu_w )
case 0x37:
case 0x38:
case 0x39:
- state->m_from_mcu = state->m_mcu_out[0][data & 0x0f];
+ m_from_mcu = m_mcu_out[0][data & 0x0f];
break;
case 0x40:
case 0x41:
case 0x42:
- state->m_from_mcu = state->m_mcu_out[1][data & 0x0f];
+ m_from_mcu = m_mcu_out[1][data & 0x0f];
break;
case 0x01:
- state->m_mcu_out[0][0] = (state->m_mcu_in[0][0] ^ (state->m_mcu_in[0][0] >> 4)) & 0x0f;
+ m_mcu_out[0][0] = (m_mcu_in[0][0] ^ (m_mcu_in[0][0] >> 4)) & 0x0f;
break;
case 0x02:
- if (state->m_mcu_in[0][3] != 0x00)
+ if (m_mcu_in[0][3] != 0x00)
{
- state->m_mcu_out[0][1] = 0x0c;
- state->m_mcu_out[0][2] = 0x00;
+ m_mcu_out[0][1] = 0x0c;
+ m_mcu_out[0][2] = 0x00;
}
else
{
- state->m_mcu_out[0][2] = 0xa2;
- switch (state->m_mcu_in[0][0] & 0x03)
+ m_mcu_out[0][2] = 0xa2;
+ switch (m_mcu_in[0][0] & 0x03)
{
- case 0: state->m_mcu_out[0][1] = 0x55; break;
- case 1: state->m_mcu_out[0][1] = 0x3d; break;
- case 2: state->m_mcu_out[0][1] = 0x45; break;
- case 3: state->m_mcu_out[0][1] = 0x4d; break;
+ case 0: m_mcu_out[0][1] = 0x55; break;
+ case 1: m_mcu_out[0][1] = 0x3d; break;
+ case 2: m_mcu_out[0][1] = 0x45; break;
+ case 3: m_mcu_out[0][1] = 0x4d; break;
}
}
break;
case 0x03:
- state->m_mcu_out[0][1] = (((state->m_mcu_in[0][0] * 8) & 0x38) -1) & 0xff ;
+ m_mcu_out[0][1] = (((m_mcu_in[0][0] * 8) & 0x38) -1) & 0xff ;
- if (state->m_mcu_in[0][1] | state->m_mcu_in[0][2])
+ if (m_mcu_in[0][1] | m_mcu_in[0][2])
d = 0x40;
else
d = 0x00;
for (i = 0; i < 8; i++)
- state->m_mcu_out[0][i + 2] = mcu_data0[((state->m_mcu_out[0][1] + i) & 0x3f) + d];
+ m_mcu_out[0][i + 2] = mcu_data0[((m_mcu_out[0][1] + i) & 0x3f) + d];
break;
case 0x04:
- state->m_mcu_out[0][0] = ((state->m_mcu_in[0][0] & 0x0f) << 4) + (state->m_mcu_in[0][1] & 0x0f);
- state->m_mcu_out[0][1] = ((state->m_mcu_in[0][2] & 0x0f) << 4) + (state->m_mcu_in[0][3] & 0x0f);
+ m_mcu_out[0][0] = ((m_mcu_in[0][0] & 0x0f) << 4) + (m_mcu_in[0][1] & 0x0f);
+ m_mcu_out[0][1] = ((m_mcu_in[0][2] & 0x0f) << 4) + (m_mcu_in[0][3] & 0x0f);
break;
case 0x05:
-// state->m_mcu_out[0][0] = 255 * cos(PI * state->m_mcu_in[0][0] / 180);
-// state->m_mcu_out[0][1] = 255 * sin(PI * state->m_mcu_in[0][0] / 180);
+// m_mcu_out[0][0] = 255 * cos(PI * m_mcu_in[0][0] / 180);
+// m_mcu_out[0][1] = 255 * sin(PI * m_mcu_in[0][0] / 180);
- d = state->m_mcu_in[0][0] & 0x7f;
- state->m_mcu_out[0][0] = mcu_data1[d];
- state->m_mcu_out[0][1] = mcu_data2[d];
+ d = m_mcu_in[0][0] & 0x7f;
+ m_mcu_out[0][0] = mcu_data1[d];
+ m_mcu_out[0][1] = mcu_data2[d];
break;
case 0x06:
- if (state->m_mcu_in[0][0] != 0x00)
- state->m_mcu_out[0][0] = 0xfa;
+ if (m_mcu_in[0][0] != 0x00)
+ m_mcu_out[0][0] = 0xfa;
else
- switch (state->m_mcu_in[0][1])
+ switch (m_mcu_in[0][1])
{
- case 0x00: state->m_mcu_out[0][0] = 0x02; break;
- case 0x01: state->m_mcu_out[0][0] = 0x01; break;
- case 0x02: state->m_mcu_out[0][0] = 0x01; break;
- case 0x03: state->m_mcu_out[0][0] = 0x04; break;
- case 0x04: state->m_mcu_out[0][0] = 0x01; break;
- case 0x05: state->m_mcu_out[0][0] = 0x14; break;
- case 0x06: state->m_mcu_out[0][0] = 0x14; break;
- case 0x07: state->m_mcu_out[0][0] = 0xb6; break;
+ case 0x00: m_mcu_out[0][0] = 0x02; break;
+ case 0x01: m_mcu_out[0][0] = 0x01; break;
+ case 0x02: m_mcu_out[0][0] = 0x01; break;
+ case 0x03: m_mcu_out[0][0] = 0x04; break;
+ case 0x04: m_mcu_out[0][0] = 0x01; break;
+ case 0x05: m_mcu_out[0][0] = 0x14; break;
+ case 0x06: m_mcu_out[0][0] = 0x14; break;
+ case 0x07: m_mcu_out[0][0] = 0xb6; break;
default:
- // popmessage("cmd06: %02x %02x", state->m_mcu_in[0][0], state->m_mcu_in[0][1]);
- logerror("cmd06: %02x %02x\n", state->m_mcu_in[0][0], state->m_mcu_in[0][1]);
+ // popmessage("cmd06: %02x %02x", m_mcu_in[0][0], m_mcu_in[0][1]);
+ logerror("cmd06: %02x %02x\n", m_mcu_in[0][0], m_mcu_in[0][1]);
}
break;
case 0x07:
- switch (state->m_mcu_in[0][0] & 7)
+ switch (m_mcu_in[0][0] & 7)
{
- case 0: state->m_mcu_out[0][0] = 0x1d; break;
- case 1: state->m_mcu_out[0][0] = 0x1b; break;
- case 2: state->m_mcu_out[0][0] = 0x15; break;
- case 3: state->m_mcu_out[0][0] = 0x13; break;
- case 4: state->m_mcu_out[0][0] = 0x25; break;
- case 5: state->m_mcu_out[0][0] = 0x23; break;
- case 6: state->m_mcu_out[0][0] = 0xff; break;
- case 7: state->m_mcu_out[0][0] = 0xff; break;
+ case 0: m_mcu_out[0][0] = 0x1d; break;
+ case 1: m_mcu_out[0][0] = 0x1b; break;
+ case 2: m_mcu_out[0][0] = 0x15; break;
+ case 3: m_mcu_out[0][0] = 0x13; break;
+ case 4: m_mcu_out[0][0] = 0x25; break;
+ case 5: m_mcu_out[0][0] = 0x23; break;
+ case 6: m_mcu_out[0][0] = 0xff; break;
+ case 7: m_mcu_out[0][0] = 0xff; break;
}
break;
@@ -538,31 +531,30 @@ static WRITE8_HANDLER( undoukai_mcu_w )
if(ram_adr >= 0xa000 && ram_adr < 0xa800)
{
ram_adr = ram_adr - 0xa000;
- state->m_mcu_out[1][0] = state->m_mcu_ram[ram_adr];
- state->m_mcu_out[1][1] = state->m_mcu_ram[ram_adr + 1];
- state->m_mcu_out[1][2] = state->m_mcu_ram[ram_adr + 2] & 0x0f;
+ m_mcu_out[1][0] = m_mcu_ram[ram_adr];
+ m_mcu_out[1][1] = m_mcu_ram[ram_adr + 1];
+ m_mcu_out[1][2] = m_mcu_ram[ram_adr + 2] & 0x0f;
}
break;
default:
- state->m_from_mcu = 0x5d;
+ m_from_mcu = 0x5d;
-// popmessage("unknown cmd%02x: %02x %02x %02x %02x", data, state->m_mcu_in[0][0], state->m_mcu_in[0][1], state->m_mcu_in[0][2], state->m_mcu_in[0][3]);
-// logerror("unknown cmd%02x: %02x %02x %02x %02x\n", data, state->m_mcu_in[0][0], state->m_mcu_in[0][1], state->m_mcu_in[0][2], state->m_mcu_in[0][3]);
+// popmessage("unknown cmd%02x: %02x %02x %02x %02x", data, m_mcu_in[0][0], m_mcu_in[0][1], m_mcu_in[0][2], m_mcu_in[0][3]);
+// logerror("unknown cmd%02x: %02x %02x %02x %02x\n", data, m_mcu_in[0][0], m_mcu_in[0][1], m_mcu_in[0][2], m_mcu_in[0][3]);
}
}
}
-static READ8_HANDLER( undoukai_mcu_r )
+READ8_MEMBER(fortyl_state::undoukai_mcu_r)
{
- fortyl_state *state = space->machine().driver_data<fortyl_state>();
- // logerror("mcu_r %02x\n", state->m_from_mcu);
+ // logerror("mcu_r %02x\n", m_from_mcu);
- return state->m_from_mcu;
+ return m_from_mcu;
}
-static READ8_HANDLER( undoukai_mcu_status_r )
+READ8_MEMBER(fortyl_state::undoukai_mcu_status_r)
{
int res = 3;
@@ -609,24 +601,21 @@ static DRIVER_INIT( 40love )
/***************************************************************************/
-static READ8_HANDLER( from_snd_r )
+READ8_MEMBER(fortyl_state::from_snd_r)
{
- fortyl_state *state = space->machine().driver_data<fortyl_state>();
- state->m_snd_flag = 0;
- return state->m_snd_data;
+ m_snd_flag = 0;
+ return m_snd_data;
}
-static READ8_HANDLER( snd_flag_r )
+READ8_MEMBER(fortyl_state::snd_flag_r)
{
- fortyl_state *state = space->machine().driver_data<fortyl_state>();
- return state->m_snd_flag | 0xfd;
+ return m_snd_flag | 0xfd;
}
-static WRITE8_HANDLER( to_main_w )
+WRITE8_MEMBER(fortyl_state::to_main_w)
{
- fortyl_state *state = space->machine().driver_data<fortyl_state>();
- state->m_snd_data = data;
- state->m_snd_flag = 2;
+ m_snd_data = data;
+ m_snd_flag = 2;
}
/***************************************************************************/
@@ -636,10 +625,10 @@ static ADDRESS_MAP_START( 40love_map, AS_PROGRAM, 8, fortyl_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM /* M5517P on main board */
AM_RANGE(0x8800, 0x8800) AM_DEVREADWRITE_LEGACY("bmcu", buggychl_mcu_r, buggychl_mcu_w)
AM_RANGE(0x8801, 0x8801) AM_DEVREADWRITE_LEGACY("bmcu", buggychl_mcu_status_r, pix1_mcu_w) //pixel layer related
- AM_RANGE(0x8802, 0x8802) AM_WRITE_LEGACY(bank_select_w)
- AM_RANGE(0x8803, 0x8803) AM_READWRITE_LEGACY(pix2_r, pix2_w) //pixel layer related
- AM_RANGE(0x8804, 0x8804) AM_READWRITE_LEGACY(from_snd_r, sound_command_w)
- AM_RANGE(0x8805, 0x8805) AM_READ_LEGACY(snd_flag_r) AM_WRITENOP /*sound_reset*/ //????
+ AM_RANGE(0x8802, 0x8802) AM_WRITE(bank_select_w)
+ AM_RANGE(0x8803, 0x8803) AM_READWRITE(pix2_r, pix2_w) //pixel layer related
+ AM_RANGE(0x8804, 0x8804) AM_READWRITE(from_snd_r, sound_command_w)
+ AM_RANGE(0x8805, 0x8805) AM_READ(snd_flag_r) AM_WRITENOP /*sound_reset*/ //????
AM_RANGE(0x8807, 0x8807) AM_READNOP /* unknown */
AM_RANGE(0x8808, 0x8808) AM_READ_PORT("DSW3")
AM_RANGE(0x8809, 0x8809) AM_READ_PORT("P1")
@@ -660,12 +649,12 @@ static ADDRESS_MAP_START( undoukai_map, AS_PROGRAM, 8, fortyl_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1")
AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_BASE(m_mcu_ram) /* M5517P on main board */
- AM_RANGE(0xa800, 0xa800) AM_READWRITE_LEGACY(undoukai_mcu_r, undoukai_mcu_w)
- AM_RANGE(0xa801, 0xa801) AM_READWRITE_LEGACY(undoukai_mcu_status_r, pix1_w) //pixel layer related
- AM_RANGE(0xa802, 0xa802) AM_WRITE_LEGACY(bank_select_w)
- AM_RANGE(0xa803, 0xa803) AM_READWRITE_LEGACY(pix2_r, pix2_w) //pixel layer related
- AM_RANGE(0xa804, 0xa804) AM_READWRITE_LEGACY(from_snd_r, sound_command_w)
- AM_RANGE(0xa805, 0xa805) AM_READ_LEGACY(snd_flag_r) AM_WRITENOP /*sound_reset*/ //????
+ AM_RANGE(0xa800, 0xa800) AM_READWRITE(undoukai_mcu_r, undoukai_mcu_w)
+ AM_RANGE(0xa801, 0xa801) AM_READWRITE(undoukai_mcu_status_r, pix1_w) //pixel layer related
+ AM_RANGE(0xa802, 0xa802) AM_WRITE(bank_select_w)
+ AM_RANGE(0xa803, 0xa803) AM_READWRITE(pix2_r, pix2_w) //pixel layer related
+ AM_RANGE(0xa804, 0xa804) AM_READWRITE(from_snd_r, sound_command_w)
+ AM_RANGE(0xa805, 0xa805) AM_READ(snd_flag_r) AM_WRITENOP /*sound_reset*/ //????
AM_RANGE(0xa807, 0xa807) AM_READNOP AM_WRITENOP /* unknown */
AM_RANGE(0xa808, 0xa808) AM_READ_PORT("DSW3")
AM_RANGE(0xa809, 0xa809) AM_READ_PORT("P1")
@@ -761,9 +750,9 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, fortyl_state )
AM_RANGE(0xca00, 0xca0d) AM_DEVWRITE_LEGACY("msm", msm5232_w)
AM_RANGE(0xcc00, 0xcc00) AM_DEVWRITE_LEGACY("msm", sound_control_0_w)
AM_RANGE(0xce00, 0xce00) AM_DEVWRITE_LEGACY("msm", sound_control_1_w)
- AM_RANGE(0xd800, 0xd800) AM_READWRITE_LEGACY(soundlatch_r, to_main_w)
- AM_RANGE(0xda00, 0xda00) AM_READNOP AM_WRITE_LEGACY(nmi_enable_w) /* unknown read */
- AM_RANGE(0xdc00, 0xdc00) AM_WRITE_LEGACY(nmi_disable_w)
+ AM_RANGE(0xd800, 0xd800) AM_READ_LEGACY(soundlatch_r) AM_WRITE(to_main_w)
+ AM_RANGE(0xda00, 0xda00) AM_READNOP AM_WRITE(nmi_enable_w) /* unknown read */
+ AM_RANGE(0xdc00, 0xdc00) AM_WRITE(nmi_disable_w)
AM_RANGE(0xde00, 0xde00) AM_READNOP AM_DEVWRITE_LEGACY("dac", dac_signed_w) /* signed 8-bit DAC - unknown read */
AM_RANGE(0xe000, 0xefff) AM_ROM /* space for diagnostics ROM */
ADDRESS_MAP_END
diff --git a/src/mame/drivers/4enraya.c b/src/mame/drivers/4enraya.c
index 3c8b979212c..19d8c7de8ac 100644
--- a/src/mame/drivers/4enraya.c
+++ b/src/mame/drivers/4enraya.c
@@ -62,10 +62,9 @@ Sound :
#define MAIN_CLOCK XTAL_8MHz
-static WRITE8_HANDLER( sound_data_w )
+WRITE8_MEMBER(_4enraya_state::sound_data_w)
{
- _4enraya_state *state = space->machine().driver_data<_4enraya_state>();
- state->m_soundlatch = data;
+ m_soundlatch = data;
}
static WRITE8_DEVICE_HANDLER( sound_control_w )
@@ -78,9 +77,9 @@ static WRITE8_DEVICE_HANDLER( sound_control_w )
state->m_last_snd_ctrl = data;
}
-static READ8_HANDLER( fenraya_custom_map_r )
+READ8_MEMBER(_4enraya_state::fenraya_custom_map_r)
{
- UINT8 *prom = space->machine().region("pal_prom")->base();
+ UINT8 *prom = machine().region("pal_prom")->base();
UINT8 prom_routing = (prom[offset >> 12] & 0xf) ^ 0xf;
UINT8 res;
@@ -88,34 +87,32 @@ static READ8_HANDLER( fenraya_custom_map_r )
if(prom_routing & 1) //ROM5
{
- UINT8 *rom = space->machine().region("maincpu")->base();
+ UINT8 *rom = machine().region("maincpu")->base();
res |= rom[offset & 0x7fff];
}
if(prom_routing & 2) //ROM4
{
- UINT8 *rom = space->machine().region("maincpu")->base();
+ UINT8 *rom = machine().region("maincpu")->base();
res |= rom[(offset & 0x7fff) | 0x8000];
}
if(prom_routing & 4) //RAM
{
- _4enraya_state *state = space->machine().driver_data<_4enraya_state>();
- res |= state->m_workram[offset & 0xfff];
+ res |= m_workram[offset & 0xfff];
}
if(prom_routing & 8) //gfx control / RAM wait
{
- _4enraya_state *state = space->machine().driver_data<_4enraya_state>();
- res |= state->m_videoram[offset & 0xfff];
+ res |= m_videoram[offset & 0xfff];
}
return res;
}
-static WRITE8_HANDLER( fenraya_custom_map_w )
+WRITE8_MEMBER(_4enraya_state::fenraya_custom_map_w)
{
- UINT8 *prom = space->machine().region("pal_prom")->base();
+ UINT8 *prom = machine().region("pal_prom")->base();
UINT8 prom_routing = (prom[offset >> 12] & 0xf) ^ 0xf;
if(prom_routing & 1) //ROM5
@@ -130,18 +127,17 @@ static WRITE8_HANDLER( fenraya_custom_map_w )
if(prom_routing & 4) //RAM
{
- _4enraya_state *state = space->machine().driver_data<_4enraya_state>();
- state->m_workram[offset & 0xfff] = data;
+ m_workram[offset & 0xfff] = data;
}
if(prom_routing & 8) //gfx control / RAM wait
{
- fenraya_videoram_w(space,offset & 0xfff,data);
+ fenraya_videoram_w(&space,offset & 0xfff,data);
}
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, _4enraya_state )
- AM_RANGE(0x0000, 0xffff) AM_READWRITE_LEGACY(fenraya_custom_map_r,fenraya_custom_map_w)
+ AM_RANGE(0x0000, 0xffff) AM_READWRITE(fenraya_custom_map_r,fenraya_custom_map_w)
#if 0
AM_RANGE(0x0000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xcfff) AM_RAM
@@ -156,7 +152,7 @@ static ADDRESS_MAP_START( main_portmap, AS_IO, 8, _4enraya_state )
AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW")
AM_RANGE(0x01, 0x01) AM_READ_PORT("INPUTS")
AM_RANGE(0x02, 0x02) AM_READ_PORT("SYSTEM")
- AM_RANGE(0x23, 0x23) AM_WRITE_LEGACY(sound_data_w)
+ AM_RANGE(0x23, 0x23) AM_WRITE(sound_data_w)
AM_RANGE(0x33, 0x33) AM_DEVWRITE_LEGACY("aysnd", sound_control_w)
ADDRESS_MAP_END
@@ -172,7 +168,7 @@ static ADDRESS_MAP_START( unkpacg_main_portmap, AS_IO, 8, _4enraya_state )
AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW1")
AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")
- AM_RANGE(0x20, 0x20) AM_WRITE_LEGACY(sound_data_w)
+ AM_RANGE(0x20, 0x20) AM_WRITE(sound_data_w)
AM_RANGE(0x30, 0x30) AM_DEVWRITE_LEGACY("aysnd", sound_control_w)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c
index 7d22765d2cf..64b8d9e2a8e 100644
--- a/src/mame/drivers/88games.c
+++ b/src/mame/drivers/88games.c
@@ -30,102 +30,94 @@ static INTERRUPT_GEN( k88games_interrupt )
irq0_line_hold(device);
}
-static READ8_HANDLER( bankedram_r )
+READ8_MEMBER(_88games_state::bankedram_r)
{
- _88games_state *state = space->machine().driver_data<_88games_state>();
- if (state->m_videobank)
- return state->m_ram[offset];
+ if (m_videobank)
+ return m_ram[offset];
else
{
- if (state->m_zoomreadroms)
- return k051316_rom_r(state->m_k051316, offset);
+ if (m_zoomreadroms)
+ return k051316_rom_r(m_k051316, offset);
else
- return k051316_r(state->m_k051316, offset);
+ return k051316_r(m_k051316, offset);
}
}
-static WRITE8_HANDLER( bankedram_w )
+WRITE8_MEMBER(_88games_state::bankedram_w)
{
- _88games_state *state = space->machine().driver_data<_88games_state>();
- if (state->m_videobank)
- state->m_ram[offset] = data;
+ if (m_videobank)
+ m_ram[offset] = data;
else
- k051316_w(state->m_k051316, offset, data);
+ k051316_w(m_k051316, offset, data);
}
-static WRITE8_HANDLER( k88games_5f84_w )
+WRITE8_MEMBER(_88games_state::k88games_5f84_w)
{
- _88games_state *state = space->machine().driver_data<_88games_state>();
/* bits 0/1 coin counters */
- coin_counter_w(space->machine(), 0, data & 0x01);
- coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(machine(), 0, data & 0x01);
+ coin_counter_w(machine(), 1, data & 0x02);
/* bit 2 enables ROM reading from the 051316 */
/* also 5fce == 2 read roms, == 3 read ram */
- state->m_zoomreadroms = data & 0x04;
+ m_zoomreadroms = data & 0x04;
if (data & 0xf8)
popmessage("5f84 = %02x", data);
}
-static WRITE8_HANDLER( k88games_sh_irqtrigger_w )
+WRITE8_MEMBER(_88games_state::k88games_sh_irqtrigger_w)
{
- _88games_state *state = space->machine().driver_data<_88games_state>();
- device_set_input_line_and_vector(state->m_audiocpu, 0, HOLD_LINE, 0xff);
+ device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff);
}
-static WRITE8_HANDLER( speech_control_w )
+WRITE8_MEMBER(_88games_state::speech_control_w)
{
- _88games_state *state = space->machine().driver_data<_88games_state>();
device_t *upd;
- state->m_speech_chip = (data & 4) ? 1 : 0;
- upd = state->m_speech_chip ? state->m_upd_2 : state->m_upd_1;
+ m_speech_chip = (data & 4) ? 1 : 0;
+ upd = m_speech_chip ? m_upd_2 : m_upd_1;
upd7759_reset_w(upd, data & 2);
upd7759_start_w(upd, data & 1);
}
-static WRITE8_HANDLER( speech_msg_w )
+WRITE8_MEMBER(_88games_state::speech_msg_w)
{
- _88games_state *state = space->machine().driver_data<_88games_state>();
- device_t *upd = state->m_speech_chip ? state->m_upd_2 : state->m_upd_1;
+ device_t *upd = m_speech_chip ? m_upd_2 : m_upd_1;
upd7759_port_w(upd, 0, data);
}
/* special handlers to combine 052109 & 051960 */
-static READ8_HANDLER( k052109_051960_r )
+READ8_MEMBER(_88games_state::k052109_051960_r)
{
- _88games_state *state = space->machine().driver_data<_88games_state>();
- if (k052109_get_rmrd_line(state->m_k052109) == CLEAR_LINE)
+ if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
- return k051937_r(state->m_k051960, offset - 0x3800);
+ return k051937_r(m_k051960, offset - 0x3800);
else if (offset < 0x3c00)
- return k052109_r(state->m_k052109, offset);
+ return k052109_r(m_k052109, offset);
else
- return k051960_r(state->m_k051960, offset - 0x3c00);
+ return k051960_r(m_k051960, offset - 0x3c00);
}
else
- return k052109_r(state->m_k052109, offset);
+ return k052109_r(m_k052109, offset);
}
-static WRITE8_HANDLER( k052109_051960_w )
+WRITE8_MEMBER(_88games_state::k052109_051960_w)
{
- _88games_state *state = space->machine().driver_data<_88games_state>();
if (offset >= 0x3800 && offset < 0x3808)
- k051937_w(state->m_k051960, offset - 0x3800, data);
+ k051937_w(m_k051960, offset - 0x3800, data);
else if (offset < 0x3c00)
- k052109_w(state->m_k052109, offset, data);
+ k052109_w(m_k052109, offset, data);
else
- k051960_w(state->m_k051960, offset - 0x3c00, data);
+ k051960_w(m_k051960, offset - 0x3c00, data);
}
/*************************************
@@ -139,28 +131,28 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, _88games_state )
AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE_LEGACY(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(m_paletteram_1000) /* banked ROM + palette RAM */
AM_RANGE(0x2000, 0x2fff) AM_RAM
AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("nvram")
- AM_RANGE(0x3800, 0x3fff) AM_READWRITE_LEGACY(bankedram_r, bankedram_w) AM_BASE(m_ram)
- AM_RANGE(0x5f84, 0x5f84) AM_WRITE_LEGACY(k88games_5f84_w)
+ AM_RANGE(0x3800, 0x3fff) AM_READWRITE(bankedram_r, bankedram_w) AM_BASE(m_ram)
+ AM_RANGE(0x5f84, 0x5f84) AM_WRITE(k88games_5f84_w)
AM_RANGE(0x5f88, 0x5f88) AM_WRITE_LEGACY(watchdog_reset_w)
AM_RANGE(0x5f8c, 0x5f8c) AM_WRITE_LEGACY(soundlatch_w)
- AM_RANGE(0x5f90, 0x5f90) AM_WRITE_LEGACY(k88games_sh_irqtrigger_w)
+ AM_RANGE(0x5f90, 0x5f90) AM_WRITE(k88games_sh_irqtrigger_w)
AM_RANGE(0x5f94, 0x5f94) AM_READ_PORT("IN0")
AM_RANGE(0x5f95, 0x5f95) AM_READ_PORT("IN1")
AM_RANGE(0x5f96, 0x5f96) AM_READ_PORT("IN2")
AM_RANGE(0x5f97, 0x5f97) AM_READ_PORT("DSW1")
AM_RANGE(0x5f9b, 0x5f9b) AM_READ_PORT("DSW2")
AM_RANGE(0x5fc0, 0x5fcf) AM_DEVWRITE_LEGACY("k051316", k051316_ctrl_w)
- AM_RANGE(0x4000, 0x7fff) AM_READWRITE_LEGACY(k052109_051960_r, k052109_051960_w)
+ AM_RANGE(0x4000, 0x7fff) AM_READWRITE(k052109_051960_r, k052109_051960_w)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, _88games_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0x9000, 0x9000) AM_WRITE_LEGACY(speech_msg_w)
+ AM_RANGE(0x9000, 0x9000) AM_WRITE(speech_msg_w)
AM_RANGE(0xa000, 0xa000) AM_READ_LEGACY(soundlatch_r)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
- AM_RANGE(0xe000, 0xe000) AM_WRITE_LEGACY(speech_control_w)
+ AM_RANGE(0xe000, 0xe000) AM_WRITE(speech_control_w)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/actfancr.c b/src/mame/drivers/actfancr.c
index 5dd2f83c46c..9ad328fe9d1 100644
--- a/src/mame/drivers/actfancr.c
+++ b/src/mame/drivers/actfancr.c
@@ -34,45 +34,41 @@
/******************************************************************************/
-static WRITE8_HANDLER( triothep_control_select_w )
+WRITE8_MEMBER(actfancr_state::triothep_control_select_w)
{
- actfancr_state *state = space->machine().driver_data<actfancr_state>();
- state->m_trio_control_select = data;
+ m_trio_control_select = data;
}
-static READ8_HANDLER( triothep_control_r )
+READ8_MEMBER(actfancr_state::triothep_control_r)
{
- actfancr_state *state = space->machine().driver_data<actfancr_state>();
- switch (state->m_trio_control_select)
+ switch (m_trio_control_select)
{
- case 0: return input_port_read(space->machine(), "P1");
- case 1: return input_port_read(space->machine(), "P2");
- case 2: return input_port_read(space->machine(), "DSW1");
- case 3: return input_port_read(space->machine(), "DSW2");
- case 4: return input_port_read(space->machine(), "SYSTEM"); /* VBL */
+ case 0: return input_port_read(machine(), "P1");
+ case 1: return input_port_read(machine(), "P2");
+ case 2: return input_port_read(machine(), "DSW1");
+ case 3: return input_port_read(machine(), "DSW2");
+ case 4: return input_port_read(machine(), "SYSTEM"); /* VBL */
}
return 0xff;
}
-static WRITE8_HANDLER( actfancr_sound_w )
+WRITE8_MEMBER(actfancr_state::actfancr_sound_w)
{
- actfancr_state *state = space->machine().driver_data<actfancr_state>();
soundlatch_w(space, 0, data & 0xff);
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
/******************************************************************************/
-static WRITE8_HANDLER( actfancr_buffer_spriteram_w)
+WRITE8_MEMBER(actfancr_state::actfancr_buffer_spriteram_w)
{
- actfancr_state *state = space->machine().driver_data<actfancr_state>();
- UINT8 *src = reinterpret_cast<UINT8 *>(memory_get_shared(space->machine(), "spriteram"));
+ UINT8 *src = reinterpret_cast<UINT8 *>(memory_get_shared(machine(), "spriteram"));
// copy to a 16-bit region for our sprite draw code too
for (int i=0;i<0x800/2;i++)
{
- state->m_spriteram16[i] = src[i*2] | (src[(i*2)+1] <<8);
+ m_spriteram16[i] = src[i*2] | (src[(i*2)+1] <<8);
}
}
@@ -85,14 +81,14 @@ static ADDRESS_MAP_START( actfan_map, AS_PROGRAM, 8, actfancr_state )
AM_RANGE(0x070010, 0x07001f) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control1_8bit_swap_w)
AM_RANGE(0x072000, 0x0727ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x110000, 0x110001) AM_WRITE_LEGACY(actfancr_buffer_spriteram_w)
+ AM_RANGE(0x110000, 0x110001) AM_WRITE(actfancr_buffer_spriteram_w)
AM_RANGE(0x120000, 0x1205ff) AM_RAM_WRITE_LEGACY(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0x130000, 0x130000) AM_READ_PORT("P1")
AM_RANGE(0x130001, 0x130001) AM_READ_PORT("P2")
AM_RANGE(0x130002, 0x130002) AM_READ_PORT("DSW1")
AM_RANGE(0x130003, 0x130003) AM_READ_PORT("DSW2")
AM_RANGE(0x140000, 0x140001) AM_READ_PORT("SYSTEM") /* VBL */
- AM_RANGE(0x150000, 0x150001) AM_WRITE_LEGACY(actfancr_sound_w)
+ AM_RANGE(0x150000, 0x150001) AM_WRITE(actfancr_sound_w)
AM_RANGE(0x1f0000, 0x1f3fff) AM_RAM AM_BASE(m_main_ram) /* Main ram */
ADDRESS_MAP_END
@@ -106,13 +102,13 @@ static ADDRESS_MAP_START( triothep_map, AS_PROGRAM, 8, actfancr_state )
AM_RANGE(0x060010, 0x06001f) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control1_8bit_swap_w)
AM_RANGE(0x064000, 0x0647ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
AM_RANGE(0x066400, 0x0667ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_rowscroll_8bit_swap_r, deco_bac06_pf_rowscroll_8bit_swap_w)
- AM_RANGE(0x100000, 0x100001) AM_WRITE_LEGACY(actfancr_sound_w)
- AM_RANGE(0x110000, 0x110001) AM_WRITE_LEGACY(actfancr_buffer_spriteram_w)
+ AM_RANGE(0x100000, 0x100001) AM_WRITE(actfancr_sound_w)
+ AM_RANGE(0x110000, 0x110001) AM_WRITE(actfancr_buffer_spriteram_w)
AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x130000, 0x1305ff) AM_RAM_WRITE_LEGACY(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0x140000, 0x140001) AM_READNOP /* Value doesn't matter */
AM_RANGE(0x1f0000, 0x1f3fff) AM_RAM AM_BASE(m_main_ram) /* Main ram */
- AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE_LEGACY(triothep_control_r, triothep_control_select_w)
+ AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE(triothep_control_r, triothep_control_select_w)
AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/aeroboto.c b/src/mame/drivers/aeroboto.c
index ee18bbb4061..7c7cb72cfb5 100644
--- a/src/mame/drivers/aeroboto.c
+++ b/src/mame/drivers/aeroboto.c
@@ -28,15 +28,14 @@ Revisions:
#include "includes/aeroboto.h"
-static READ8_HANDLER( aeroboto_201_r )
+READ8_MEMBER(aeroboto_state::aeroboto_201_r)
{
- aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
/* if you keep a button pressed during boot, the game will expect this */
/* serie of values to be returned from 3004, and display "PASS 201" if it is */
static const UINT8 res[4] = { 0xff, 0x9f, 0x1b, 0x03 };
- logerror("PC %04x: read 3004\n", cpu_get_pc(&space->device()));
- return res[(state->m_count++) & 3];
+ logerror("PC %04x: read 3004\n", cpu_get_pc(&space.device()));
+ return res[(m_count++) & 3];
}
@@ -50,31 +49,29 @@ static INTERRUPT_GEN( aeroboto_interrupt )
state->m_disable_irq--;
}
-static READ8_HANDLER( aeroboto_irq_ack_r )
+READ8_MEMBER(aeroboto_state::aeroboto_irq_ack_r)
{
- cputag_set_input_line(space->machine(),"maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(machine(),"maincpu", 0, CLEAR_LINE);
return 0xff;
}
-static READ8_HANDLER( aeroboto_2973_r )
+READ8_MEMBER(aeroboto_state::aeroboto_2973_r)
{
- aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
- state->m_mainram[0x02be] = 0;
+ m_mainram[0x02be] = 0;
return 0xff;
}
-static WRITE8_HANDLER ( aeroboto_1a2_w )
+WRITE8_MEMBER(aeroboto_state::aeroboto_1a2_w)
{
- aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
- state->m_mainram[0x01a2] = data;
+ m_mainram[0x01a2] = data;
if (data)
- state->m_disable_irq = 1;
+ m_disable_irq = 1;
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, aeroboto_state )
- AM_RANGE(0x01a2, 0x01a2) AM_WRITE_LEGACY(aeroboto_1a2_w) // affects IRQ line (more protection?)
+ AM_RANGE(0x01a2, 0x01a2) AM_WRITE(aeroboto_1a2_w) // affects IRQ line (more protection?)
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(m_mainram) // main RAM
AM_RANGE(0x0800, 0x08ff) AM_RAM // tile color buffer; copied to 0x2000
AM_RANGE(0x0900, 0x09ff) AM_WRITEONLY // a backup of default tile colors
@@ -84,15 +81,15 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, aeroboto_state )
AM_RANGE(0x1840, 0x27ff) AM_WRITENOP // cleared during custom LSI test
AM_RANGE(0x2800, 0x28ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // sprite RAM
AM_RANGE(0x2900, 0x2fff) AM_WRITENOP // cleared along with sprite RAM
- AM_RANGE(0x2973, 0x2973) AM_READ_LEGACY(aeroboto_2973_r) // protection read
+ AM_RANGE(0x2973, 0x2973) AM_READ(aeroboto_2973_r) // protection read
AM_RANGE(0x3000, 0x3000) AM_READWRITE_LEGACY(aeroboto_in0_r, aeroboto_3000_w)
AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_WRITE_LEGACY(soundlatch_w)
AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_WRITE_LEGACY(soundlatch2_w)
AM_RANGE(0x3003, 0x3003) AM_WRITEONLY AM_BASE(m_vscroll)
- AM_RANGE(0x3004, 0x3004) AM_READ_LEGACY(aeroboto_201_r) AM_WRITEONLY AM_BASE(m_starx)
+ AM_RANGE(0x3004, 0x3004) AM_READ(aeroboto_201_r) AM_WRITEONLY AM_BASE(m_starx)
AM_RANGE(0x3005, 0x3005) AM_WRITEONLY AM_BASE(m_stary) // usable but probably wrong
AM_RANGE(0x3006, 0x3006) AM_WRITEONLY AM_BASE(m_bgcolor)
- AM_RANGE(0x3800, 0x3800) AM_READ_LEGACY(aeroboto_irq_ack_r) // watchdog or IRQ ack
+ AM_RANGE(0x3800, 0x3800) AM_READ(aeroboto_irq_ack_r) // watchdog or IRQ ack
AM_RANGE(0x4000, 0xffff) AM_ROM // main ROM
ADDRESS_MAP_END
diff --git a/src/mame/drivers/aerofgt.c b/src/mame/drivers/aerofgt.c
index 94889fb6265..50c66b4c594 100644
--- a/src/mame/drivers/aerofgt.c
+++ b/src/mame/drivers/aerofgt.c
@@ -66,53 +66,48 @@ Verification still needed for the other PCBs.
#include "sound/okim6295.h"
#include "includes/aerofgt.h"
-static WRITE16_HANDLER( sound_command_w )
+WRITE16_MEMBER(aerofgt_state::sound_command_w)
{
- aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if (ACCESSING_BITS_0_7)
{
- state->m_pending_command = 1;
+ m_pending_command = 1;
soundlatch_w(space, offset, data & 0xff);
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
}
-static WRITE16_HANDLER( turbofrc_sound_command_w )
+WRITE16_MEMBER(aerofgt_state::turbofrc_sound_command_w)
{
- aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if (ACCESSING_BITS_8_15)
{
- state->m_pending_command = 1;
+ m_pending_command = 1;
soundlatch_w(space, offset, (data >> 8) & 0xff);
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
}
-static WRITE16_HANDLER( aerfboot_soundlatch_w )
+WRITE16_MEMBER(aerofgt_state::aerfboot_soundlatch_w)
{
- aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if(ACCESSING_BITS_8_15)
{
soundlatch_w(space, 0, (data >> 8) & 0xff);
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
}
-static READ16_HANDLER( pending_command_r )
+READ16_MEMBER(aerofgt_state::pending_command_r)
{
- aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
- return state->m_pending_command;
+ return m_pending_command;
}
-static WRITE8_HANDLER( pending_command_clear_w )
+WRITE8_MEMBER(aerofgt_state::pending_command_clear_w)
{
- aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
- state->m_pending_command = 0;
+ m_pending_command = 0;
}
-static WRITE8_HANDLER( aerofgt_sh_bankswitch_w )
+WRITE8_MEMBER(aerofgt_state::aerofgt_sh_bankswitch_w)
{
- memory_set_bank(space->machine(), "bank1", data & 0x03);
+ memory_set_bank(machine(), "bank1", data & 0x03);
}
@@ -132,9 +127,9 @@ static WRITE16_DEVICE_HANDLER( aerfboo2_okim6295_banking_w )
// }
}
-static WRITE8_HANDLER( aerfboot_okim6295_banking_w )
+WRITE8_MEMBER(aerofgt_state::aerfboot_okim6295_banking_w)
{
- UINT8 *oki = space->machine().region("oki")->base();
+ UINT8 *oki = machine().region("oki")->base();
/*bit 2 (0x4) setted too?*/
if (data & 0x4)
memcpy(&oki[0x20000], &oki[((data & 0x3) * 0x20000) + 0x40000], 0x20000);
@@ -151,7 +146,7 @@ static ADDRESS_MAP_START( pspikes_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE_LEGACY(pspikes_palette_bank_w)
AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") AM_WRITE_LEGACY(pspikes_gfxbank_w)
AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW") AM_WRITE_LEGACY(aerofgt_bg1scrolly_w)
- AM_RANGE(0xfff006, 0xfff007) AM_READWRITE_LEGACY(pending_command_r, sound_command_w)
+ AM_RANGE(0xfff006, 0xfff007) AM_READWRITE(pending_command_r, sound_command_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( pspikesb_map, AS_PROGRAM, 16, aerofgt_state )
@@ -220,9 +215,9 @@ static ADDRESS_MAP_START( karatblz_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0x0ff000, 0x0ff001) AM_READ_PORT("IN0")
AM_RANGE(0x0ff002, 0x0ff003) AM_READ_PORT("IN1") AM_WRITE_LEGACY(karatblz_gfxbank_w)
AM_RANGE(0x0ff004, 0x0ff005) AM_READ_PORT("IN2")
- AM_RANGE(0x0ff006, 0x0ff007) AM_READ_PORT("IN3") AM_WRITE_LEGACY(sound_command_w)
+ AM_RANGE(0x0ff006, 0x0ff007) AM_READ_PORT("IN3") AM_WRITE(sound_command_w)
AM_RANGE(0x0ff008, 0x0ff009) AM_READ_PORT("DSW") AM_WRITE_LEGACY(aerofgt_bg1scrollx_w)
- AM_RANGE(0x0ff00a, 0x0ff00b) AM_READWRITE_LEGACY(pending_command_r, aerofgt_bg1scrolly_w)
+ AM_RANGE(0x0ff00a, 0x0ff00b) AM_READ(pending_command_r) AM_WRITE_LEGACY(aerofgt_bg1scrolly_w)
AM_RANGE(0x0ff00c, 0x0ff00d) AM_WRITE_LEGACY(aerofgt_bg2scrollx_w)
AM_RANGE(0x0ff00e, 0x0ff00f) AM_WRITE_LEGACY(aerofgt_bg2scrolly_w)
ADDRESS_MAP_END
@@ -238,7 +233,7 @@ static ADDRESS_MAP_START( spinlbrk_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE_LEGACY(spinlbrk_gfxbank_w)
AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") AM_WRITE_LEGACY(aerofgt_bg2scrollx_w)
AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW")
- AM_RANGE(0xfff006, 0xfff007) AM_WRITE_LEGACY(sound_command_w)
+ AM_RANGE(0xfff006, 0xfff007) AM_WRITE(sound_command_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( turbofrc_map, AS_PROGRAM, 16, aerofgt_state )
@@ -256,11 +251,11 @@ static ADDRESS_MAP_START( turbofrc_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0x0ff000, 0x0ff001) AM_READ_PORT("IN0")
AM_RANGE(0x0ff002, 0x0ff003) AM_READ_PORT("IN1") AM_WRITE_LEGACY(aerofgt_bg1scrolly_w)
AM_RANGE(0x0ff004, 0x0ff005) AM_READ_PORT("DSW") AM_WRITE_LEGACY(aerofgt_bg2scrollx_w)
- AM_RANGE(0x0ff006, 0x0ff007) AM_READWRITE_LEGACY(pending_command_r, aerofgt_bg2scrolly_w)
+ AM_RANGE(0x0ff006, 0x0ff007) AM_READ(pending_command_r) AM_WRITE_LEGACY(aerofgt_bg2scrolly_w)
AM_RANGE(0x0ff008, 0x0ff009) AM_READ_PORT("IN2")
AM_RANGE(0x0ff008, 0x0ff00b) AM_WRITE_LEGACY(turbofrc_gfxbank_w)
AM_RANGE(0x0ff00c, 0x0ff00d) AM_WRITENOP /* related to bg2 (written together with the scroll registers) */
- AM_RANGE(0x0ff00e, 0x0ff00f) AM_WRITE_LEGACY(turbofrc_sound_command_w)
+ AM_RANGE(0x0ff00e, 0x0ff00f) AM_WRITE(turbofrc_sound_command_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( aerofgtb_map, AS_PROGRAM, 16, aerofgt_state )
@@ -276,10 +271,10 @@ static ADDRESS_MAP_START( aerofgtb_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0x0fe000, 0x0fe001) AM_READ_PORT("IN0")
AM_RANGE(0x0fe002, 0x0fe003) AM_READ_PORT("IN1") AM_WRITE_LEGACY(aerofgt_bg1scrolly_w)
AM_RANGE(0x0fe004, 0x0fe005) AM_READ_PORT("DSW1") AM_WRITE_LEGACY(aerofgt_bg2scrollx_w)
- AM_RANGE(0x0fe006, 0x0fe007) AM_READWRITE_LEGACY(pending_command_r, aerofgt_bg2scrolly_w)
+ AM_RANGE(0x0fe006, 0x0fe007) AM_READ(pending_command_r) AM_WRITE_LEGACY(aerofgt_bg2scrolly_w)
AM_RANGE(0x0fe008, 0x0fe009) AM_READ_PORT("DSW2")
AM_RANGE(0x0fe008, 0x0fe00b) AM_WRITE_LEGACY(turbofrc_gfxbank_w)
- AM_RANGE(0x0fe00e, 0x0fe00f) AM_WRITE_LEGACY(turbofrc_sound_command_w)
+ AM_RANGE(0x0fe00e, 0x0fe00f) AM_WRITE(turbofrc_sound_command_w)
AM_RANGE(0x0ff000, 0x0fffff) AM_RAM AM_BASE(m_rasterram) /* used only for the scroll registers */
ADDRESS_MAP_END
@@ -303,9 +298,9 @@ static ADDRESS_MAP_START( aerofgt_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0xffffa4, 0xffffa5) AM_READ_PORT("SYSTEM")
AM_RANGE(0xffffa6, 0xffffa7) AM_READ_PORT("DSW1")
AM_RANGE(0xffffa8, 0xffffa9) AM_READ_PORT("DSW2")
- AM_RANGE(0xffffac, 0xffffad) AM_READ_LEGACY(pending_command_r) AM_WRITENOP /* ??? */
+ AM_RANGE(0xffffac, 0xffffad) AM_READ(pending_command_r) AM_WRITENOP /* ??? */
AM_RANGE(0xffffae, 0xffffaf) AM_READ_PORT("DSW3")
- AM_RANGE(0xffffc0, 0xffffc1) AM_WRITE_LEGACY(sound_command_w)
+ AM_RANGE(0xffffc0, 0xffffc1) AM_WRITE(sound_command_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( aerfboot_map, AS_PROGRAM, 16, aerofgt_state )
@@ -326,7 +321,7 @@ static ADDRESS_MAP_START( aerfboot_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0x0fe004, 0x0fe005) AM_WRITE_LEGACY(aerofgt_bg2scrollx_w)
AM_RANGE(0x0fe006, 0x0fe007) AM_WRITE_LEGACY(aerofgt_bg2scrolly_w)
AM_RANGE(0x0fe008, 0x0fe00b) AM_WRITE_LEGACY(turbofrc_gfxbank_w)
- AM_RANGE(0x0fe00e, 0x0fe00f) AM_WRITE_LEGACY(aerfboot_soundlatch_w)
+ AM_RANGE(0x0fe00e, 0x0fe00f) AM_WRITE(aerfboot_soundlatch_w)
AM_RANGE(0x0fe010, 0x0fe011) AM_WRITENOP
AM_RANGE(0x0fe012, 0x0fe013) AM_WRITENOP
AM_RANGE(0x0fe400, 0x0fe401) AM_WRITENOP
@@ -359,7 +354,7 @@ static ADDRESS_MAP_START( aerfboo2_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0x0fe00e, 0x0fe00f) AM_DEVWRITE8("oki", okim6295_device, write, 0xff00)
AM_RANGE(0x0fe01e, 0x0fe01f) AM_DEVWRITE_LEGACY("oki", aerfboo2_okim6295_banking_w)
// AM_RANGE(0x0fe010, 0x0fe011) AM_WRITENOP
-// AM_RANGE(0x0fe012, 0x0fe013) AM_WRITE_LEGACY(aerfboot_soundlatch_w)
+// AM_RANGE(0x0fe012, 0x0fe013) AM_WRITE(aerfboot_soundlatch_w)
AM_RANGE(0x0fe400, 0x0fe401) AM_WRITENOP // data for a crtc?
AM_RANGE(0x0fe402, 0x0fe403) AM_WRITENOP // address for a crtc?
AM_RANGE(0x0ff000, 0x0fffff) AM_RAM AM_BASE(m_rasterram) /* used only for the scroll registers */
@@ -377,7 +372,7 @@ static ADDRESS_MAP_START( wbbc97_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE_LEGACY(pspikes_palette_bank_w)
AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") AM_WRITE_LEGACY(pspikes_gfxbank_w)
AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW") AM_WRITE_LEGACY(aerofgt_bg1scrolly_w)
- AM_RANGE(0xfff006, 0xfff007) AM_READNOP AM_WRITE_LEGACY(sound_command_w)
+ AM_RANGE(0xfff006, 0xfff007) AM_READNOP AM_WRITE(sound_command_w)
AM_RANGE(0xfff00e, 0xfff00f) AM_WRITE_LEGACY(wbbc97_bitmap_enable_w)
ADDRESS_MAP_END
@@ -389,23 +384,23 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( turbofrc_sound_portmap, AS_IO, 8, aerofgt_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE_LEGACY(aerofgt_sh_bankswitch_w)
- AM_RANGE(0x14, 0x14) AM_READWRITE_LEGACY(soundlatch_r, pending_command_clear_w)
+ AM_RANGE(0x00, 0x00) AM_WRITE(aerofgt_sh_bankswitch_w)
+ AM_RANGE(0x14, 0x14) AM_READ_LEGACY(soundlatch_r) AM_WRITE(pending_command_clear_w)
AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( aerofgt_sound_portmap, AS_IO, 8, aerofgt_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
- AM_RANGE(0x04, 0x04) AM_WRITE_LEGACY(aerofgt_sh_bankswitch_w)
- AM_RANGE(0x08, 0x08) AM_WRITE_LEGACY(pending_command_clear_w)
+ AM_RANGE(0x04, 0x04) AM_WRITE(aerofgt_sh_bankswitch_w)
+ AM_RANGE(0x08, 0x08) AM_WRITE(pending_command_clear_w)
AM_RANGE(0x0c, 0x0c) AM_READ_LEGACY(soundlatch_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( aerfboot_sound_map, AS_PROGRAM, 8, aerofgt_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0x9000, 0x9000) AM_WRITE_LEGACY(aerfboot_okim6295_banking_w)
+ AM_RANGE(0x9000, 0x9000) AM_WRITE(aerfboot_okim6295_banking_w)
AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
AM_RANGE(0xa000, 0xa000) AM_READ_LEGACY(soundlatch_r)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/airbustr.c b/src/mame/drivers/airbustr.c
index 3eb4f770fa0..01fa6125313 100644
--- a/src/mame/drivers/airbustr.c
+++ b/src/mame/drivers/airbustr.c
@@ -225,9 +225,8 @@ Code at 505: waits for bit 1 to go low, writes command, waits for bit
#include "includes/airbustr.h"
/* Read/Write Handlers */
-static READ8_HANDLER( devram_r )
+READ8_MEMBER(airbustr_state::devram_r)
{
- airbustr_state *state = space->machine().driver_data<airbustr_state>();
// There's an MCU here, possibly
switch (offset)
@@ -243,7 +242,7 @@ static READ8_HANDLER( devram_r )
case 0xff2:
case 0xff3:
{
- int x = (state->m_devram[0xff0] + state->m_devram[0xff1] * 256) * (state->m_devram[0xff2] + state->m_devram[0xff3] * 256);
+ int x = (m_devram[0xff0] + m_devram[0xff1] * 256) * (m_devram[0xff2] + m_devram[0xff3] * 256);
if (offset == 0xff2)
return (x & 0x00ff) >> 0;
else
@@ -253,99 +252,91 @@ static READ8_HANDLER( devram_r )
/* Reading eff4, F0 times must yield at most 80-1 consecutive
equal values */
case 0xff4:
- return space->machine().rand();
+ return machine().rand();
default:
- return state->m_devram[offset];
+ return m_devram[offset];
}
}
-static WRITE8_HANDLER( master_nmi_trigger_w )
+WRITE8_MEMBER(airbustr_state::master_nmi_trigger_w)
{
- airbustr_state *state = space->machine().driver_data<airbustr_state>();
- device_set_input_line(state->m_slave, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_slave, INPUT_LINE_NMI, PULSE_LINE);
}
-static WRITE8_HANDLER( master_bankswitch_w )
+WRITE8_MEMBER(airbustr_state::master_bankswitch_w)
{
- memory_set_bank(space->machine(), "bank1", data & 0x07);
+ memory_set_bank(machine(), "bank1", data & 0x07);
}
-static WRITE8_HANDLER( slave_bankswitch_w )
+WRITE8_MEMBER(airbustr_state::slave_bankswitch_w)
{
- airbustr_state *state = space->machine().driver_data<airbustr_state>();
- memory_set_bank(space->machine(), "bank2", data & 0x07);
+ memory_set_bank(machine(), "bank2", data & 0x07);
- flip_screen_set(space->machine(), data & 0x10);
+ flip_screen_set(machine(), data & 0x10);
// used at the end of levels, after defeating the boss, to leave trails
- pandora_set_clear_bitmap(state->m_pandora, data & 0x20);
+ pandora_set_clear_bitmap(m_pandora, data & 0x20);
}
-static WRITE8_HANDLER( sound_bankswitch_w )
+WRITE8_MEMBER(airbustr_state::sound_bankswitch_w)
{
- memory_set_bank(space->machine(), "bank3", data & 0x07);
+ memory_set_bank(machine(), "bank3", data & 0x07);
}
-static READ8_HANDLER( soundcommand_status_r )
+READ8_MEMBER(airbustr_state::soundcommand_status_r)
{
- airbustr_state *state = space->machine().driver_data<airbustr_state>();
// bits: 2 <-> ? 1 <-> soundlatch full 0 <-> soundlatch2 empty
- return 4 + state->m_soundlatch_status * 2 + (1 - state->m_soundlatch2_status);
+ return 4 + m_soundlatch_status * 2 + (1 - m_soundlatch2_status);
}
-static READ8_HANDLER( soundcommand_r )
+READ8_MEMBER(airbustr_state::soundcommand_r)
{
- airbustr_state *state = space->machine().driver_data<airbustr_state>();
- state->m_soundlatch_status = 0; // soundlatch has been read
+ m_soundlatch_status = 0; // soundlatch has been read
return soundlatch_r(space, 0);
}
-static READ8_HANDLER( soundcommand2_r )
+READ8_MEMBER(airbustr_state::soundcommand2_r)
{
- airbustr_state *state = space->machine().driver_data<airbustr_state>();
- state->m_soundlatch2_status = 0; // soundlatch2 has been read
+ m_soundlatch2_status = 0; // soundlatch2 has been read
return soundlatch2_r(space, 0);
}
-static WRITE8_HANDLER( soundcommand_w )
+WRITE8_MEMBER(airbustr_state::soundcommand_w)
{
- airbustr_state *state = space->machine().driver_data<airbustr_state>();
soundlatch_w(space, 0, data);
- state->m_soundlatch_status = 1; // soundlatch has been written
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu
+ m_soundlatch_status = 1; // soundlatch has been written
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu
}
-static WRITE8_HANDLER( soundcommand2_w )
+WRITE8_MEMBER(airbustr_state::soundcommand2_w)
{
- airbustr_state *state = space->machine().driver_data<airbustr_state>();
soundlatch2_w(space, 0, data);
- state->m_soundlatch2_status = 1; // soundlatch2 has been written
+ m_soundlatch2_status = 1; // soundlatch2 has been written
}
-static WRITE8_HANDLER( airbustr_paletteram_w )
+WRITE8_MEMBER(airbustr_state::airbustr_paletteram_w)
{
- airbustr_state *state = space->machine().driver_data<airbustr_state>();
int val;
/* ! byte 1 ! ! byte 0 ! */
/* xGGG GGRR RRRB BBBB */
/* x432 1043 2104 3210 */
- state->m_paletteram[offset] = data;
- val = (state->m_paletteram[offset | 1] << 8) | state->m_paletteram[offset & ~1];
+ m_paletteram[offset] = data;
+ val = (m_paletteram[offset | 1] << 8) | m_paletteram[offset & ~1];
- palette_set_color_rgb(space->machine(), offset / 2, pal5bit(val >> 5), pal5bit(val >> 10), pal5bit(val >> 0));
+ palette_set_color_rgb(machine(), offset / 2, pal5bit(val >> 5), pal5bit(val >> 10), pal5bit(val >> 0));
}
-static WRITE8_HANDLER( airbustr_coin_counter_w )
+WRITE8_MEMBER(airbustr_state::airbustr_coin_counter_w)
{
- coin_counter_w(space->machine(), 0, data & 1);
- coin_counter_w(space->machine(), 1, data & 2);
- coin_lockout_w(space->machine(), 0, ~data & 4);
- coin_lockout_w(space->machine(), 1, ~data & 8);
+ coin_counter_w(machine(), 0, data & 1);
+ coin_counter_w(machine(), 1, data & 2);
+ coin_lockout_w(machine(), 0, ~data & 4);
+ coin_lockout_w(machine(), 1, ~data & 8);
}
/* Memory Maps */
@@ -360,9 +351,9 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( master_io_map, AS_IO, 8, airbustr_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE_LEGACY(master_bankswitch_w)
+ AM_RANGE(0x00, 0x00) AM_WRITE(master_bankswitch_w)
AM_RANGE(0x01, 0x01) AM_WRITENOP // ???
- AM_RANGE(0x02, 0x02) AM_WRITE_LEGACY(master_nmi_trigger_w)
+ AM_RANGE(0x02, 0x02) AM_WRITE(master_nmi_trigger_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( slave_map, AS_PROGRAM, 8, airbustr_state )
@@ -372,7 +363,7 @@ static ADDRESS_MAP_START( slave_map, AS_PROGRAM, 8, airbustr_state )
AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE_LEGACY(airbustr_colorram2_w) AM_BASE(m_colorram2)
AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE_LEGACY(airbustr_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0xcc00, 0xcfff) AM_RAM_WRITE_LEGACY(airbustr_colorram_w) AM_BASE(m_colorram)
- AM_RANGE(0xd000, 0xd5ff) AM_RAM_WRITE_LEGACY(airbustr_paletteram_w) AM_BASE(m_paletteram)
+ AM_RANGE(0xd000, 0xd5ff) AM_RAM_WRITE(airbustr_paletteram_w) AM_BASE(m_paletteram)
AM_RANGE(0xd600, 0xdfff) AM_RAM
AM_RANGE(0xe000, 0xefff) AM_RAM
AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("share1")
@@ -380,14 +371,14 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( slave_io_map, AS_IO, 8, airbustr_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE_LEGACY(slave_bankswitch_w)
- AM_RANGE(0x02, 0x02) AM_READWRITE_LEGACY(soundcommand2_r, soundcommand_w)
+ AM_RANGE(0x00, 0x00) AM_WRITE(slave_bankswitch_w)
+ AM_RANGE(0x02, 0x02) AM_READWRITE(soundcommand2_r, soundcommand_w)
AM_RANGE(0x04, 0x0c) AM_WRITE_LEGACY(airbustr_scrollregs_w)
- AM_RANGE(0x0e, 0x0e) AM_READ_LEGACY(soundcommand_status_r)
+ AM_RANGE(0x0e, 0x0e) AM_READ(soundcommand_status_r)
AM_RANGE(0x20, 0x20) AM_READ_PORT("P1")
AM_RANGE(0x22, 0x22) AM_READ_PORT("P2")
AM_RANGE(0x24, 0x24) AM_READ_PORT("SYSTEM")
- AM_RANGE(0x28, 0x28) AM_WRITE_LEGACY(airbustr_coin_counter_w)
+ AM_RANGE(0x28, 0x28) AM_WRITE(airbustr_coin_counter_w)
AM_RANGE(0x38, 0x38) AM_WRITENOP // irq ack / irq mask
ADDRESS_MAP_END
@@ -399,10 +390,10 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, airbustr_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE_LEGACY(sound_bankswitch_w)
+ AM_RANGE(0x00, 0x00) AM_WRITE(sound_bankswitch_w)
AM_RANGE(0x02, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w)
AM_RANGE(0x04, 0x04) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0x06, 0x06) AM_READWRITE_LEGACY(soundcommand_r, soundcommand2_w)
+ AM_RANGE(0x06, 0x06) AM_READWRITE(soundcommand_r, soundcommand2_w)
ADDRESS_MAP_END
/* Input Ports */
@@ -797,7 +788,8 @@ ROM_END
static DRIVER_INIT( airbustr )
{
- machine.device("master")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe000, 0xefff, FUNC(devram_r)); // protection device lives here
+ airbustr_state *state = machine.driver_data<airbustr_state>();
+ machine.device("master")->memory().space(AS_PROGRAM)->install_read_handler(0xe000, 0xefff, read8_delegate(FUNC(airbustr_state::devram_r),state)); // protection device lives here
}
diff --git a/src/mame/drivers/ajax.c b/src/mame/drivers/ajax.c
index 07c6c205892..0dda8aa3add 100644
--- a/src/mame/drivers/ajax.c
+++ b/src/mame/drivers/ajax.c
@@ -21,7 +21,7 @@
#include "includes/konamipt.h"
static WRITE8_DEVICE_HANDLER( k007232_extvol_w );
-static WRITE8_HANDLER( sound_bank_w );
+
/****************************************************************************/
@@ -50,7 +50,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( ajax_sound_map, AS_PROGRAM, 8, ajax_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM F6 */
AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM 2128SL at D16 */
- AM_RANGE(0x9000, 0x9000) AM_WRITE_LEGACY(sound_bank_w) /* 007232 bankswitch */
+ AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w) /* 007232 bankswitch */
AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE_LEGACY("k007232_1", k007232_r, k007232_w) /* 007232 registers (chip 1) */
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232_2", k007232_r, k007232_w) /* 007232 registers (chip 2) */
AM_RANGE(0xb80c, 0xb80c) AM_DEVWRITE_LEGACY("k007232_2", k007232_extvol_w) /* extra volume, goes to the 007232 w/ A11 */
@@ -135,20 +135,19 @@ INPUT_PORTS_END
0 / 2MBANK
*/
-static WRITE8_HANDLER( sound_bank_w )
+WRITE8_MEMBER(ajax_state::sound_bank_w)
{
- ajax_state *state = space->machine().driver_data<ajax_state>();
int bank_A, bank_B;
/* banks # for the 007232 (chip 1) */
bank_A = BIT(data, 1);
bank_B = BIT(data, 0);
- k007232_set_bank(state->m_k007232_1, bank_A, bank_B);
+ k007232_set_bank(m_k007232_1, bank_A, bank_B);
/* banks # for the 007232 (chip 2) */
bank_A = ((data >> 4) & 0x03);
bank_B = ((data >> 2) & 0x03);
- k007232_set_bank(state->m_k007232_2, bank_A, bank_B);
+ k007232_set_bank(m_k007232_2, bank_A, bank_B);
}
static void volume_callback0(device_t *device, int v)
diff --git a/src/mame/drivers/aliens.c b/src/mame/drivers/aliens.c
index f9ec1dad4a5..425c9468060 100644
--- a/src/mame/drivers/aliens.c
+++ b/src/mame/drivers/aliens.c
@@ -27,39 +27,36 @@ static INTERRUPT_GEN( aliens_interrupt )
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
}
-static READ8_HANDLER( bankedram_r )
+READ8_MEMBER(aliens_state::bankedram_r)
{
- aliens_state *state = space->machine().driver_data<aliens_state>();
- if (state->m_palette_selected)
- return space->machine().generic.paletteram.u8[offset];
+ if (m_palette_selected)
+ return machine().generic.paletteram.u8[offset];
else
- return state->m_ram[offset];
+ return m_ram[offset];
}
-static WRITE8_HANDLER( bankedram_w )
+WRITE8_MEMBER(aliens_state::bankedram_w)
{
- aliens_state *state = space->machine().driver_data<aliens_state>();
- if (state->m_palette_selected)
+ if (m_palette_selected)
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
else
- state->m_ram[offset] = data;
+ m_ram[offset] = data;
}
-static WRITE8_HANDLER( aliens_coin_counter_w )
+WRITE8_MEMBER(aliens_state::aliens_coin_counter_w)
{
- aliens_state *state = space->machine().driver_data<aliens_state>();
/* bits 0-1 = coin counters */
- coin_counter_w(space->machine(), 0, data & 0x01);
- coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(machine(), 0, data & 0x01);
+ coin_counter_w(machine(), 1, data & 0x02);
/* bit 5 = select work RAM or palette */
- state->m_palette_selected = data & 0x20;
+ m_palette_selected = data & 0x20;
/* bit 6 = enable char ROM reading through the video RAM */
- k052109_set_rmrd_line(state->m_k052109, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
+ k052109_set_rmrd_line(m_k052109, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
/* other bits unknown */
#if 0
@@ -71,12 +68,11 @@ static WRITE8_HANDLER( aliens_coin_counter_w )
#endif
}
-static WRITE8_HANDLER( aliens_sh_irqtrigger_w )
+WRITE8_MEMBER(aliens_state::aliens_sh_irqtrigger_w)
{
- aliens_state *state = space->machine().driver_data<aliens_state>();
soundlatch_w(space, offset, data);
- device_set_input_line_and_vector(state->m_audiocpu, 0, HOLD_LINE, 0xff);
+ device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_DEVICE_HANDLER( aliens_snd_bankswitch_w )
@@ -93,37 +89,35 @@ static WRITE8_DEVICE_HANDLER( aliens_snd_bankswitch_w )
}
-static READ8_HANDLER( k052109_051960_r )
+READ8_MEMBER(aliens_state::k052109_051960_r)
{
- aliens_state *state = space->machine().driver_data<aliens_state>();
- if (k052109_get_rmrd_line(state->m_k052109) == CLEAR_LINE)
+ if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
- return k051937_r(state->m_k051960, offset - 0x3800);
+ return k051937_r(m_k051960, offset - 0x3800);
else if (offset < 0x3c00)
- return k052109_r(state->m_k052109, offset);
+ return k052109_r(m_k052109, offset);
else
- return k051960_r(state->m_k051960, offset - 0x3c00);
+ return k051960_r(m_k051960, offset - 0x3c00);
}
else
- return k052109_r(state->m_k052109, offset);
+ return k052109_r(m_k052109, offset);
}
-static WRITE8_HANDLER( k052109_051960_w )
+WRITE8_MEMBER(aliens_state::k052109_051960_w)
{
- aliens_state *state = space->machine().driver_data<aliens_state>();
if (offset >= 0x3800 && offset < 0x3808)
- k051937_w(state->m_k051960, offset - 0x3800, data);
+ k051937_w(m_k051960, offset - 0x3800, data);
else if (offset < 0x3c00)
- k052109_w(state->m_k052109, offset, data);
+ k052109_w(m_k052109, offset, data);
else
- k051960_w(state->m_k051960, offset - 0x3c00, data);
+ k051960_w(m_k051960, offset - 0x3c00, data);
}
static ADDRESS_MAP_START( aliens_map, AS_PROGRAM, 8, aliens_state )
- AM_RANGE(0x0000, 0x03ff) AM_READWRITE_LEGACY(bankedram_r, bankedram_w) AM_BASE(m_ram) /* palette + work RAM */
+ AM_RANGE(0x0000, 0x03ff) AM_READWRITE(bankedram_r, bankedram_w) AM_BASE(m_ram) /* palette + work RAM */
AM_RANGE(0x0400, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x3fff) AM_ROMBANK("bank1") /* banked ROM */
AM_RANGE(0x5f80, 0x5f80) AM_READ_PORT("DSW3")
@@ -131,9 +125,9 @@ static ADDRESS_MAP_START( aliens_map, AS_PROGRAM, 8, aliens_state )
AM_RANGE(0x5f82, 0x5f82) AM_READ_PORT("P2")
AM_RANGE(0x5f83, 0x5f83) AM_READ_PORT("DSW2")
AM_RANGE(0x5f84, 0x5f84) AM_READ_PORT("DSW1")
- AM_RANGE(0x5f88, 0x5f88) AM_READWRITE_LEGACY(watchdog_reset_r, aliens_coin_counter_w) /* coin counters */
- AM_RANGE(0x5f8c, 0x5f8c) AM_WRITE_LEGACY(aliens_sh_irqtrigger_w) /* cause interrupt on audio CPU */
- AM_RANGE(0x4000, 0x7fff) AM_READWRITE_LEGACY(k052109_051960_r, k052109_051960_w)
+ AM_RANGE(0x5f88, 0x5f88) AM_READ_LEGACY(watchdog_reset_r) AM_WRITE(aliens_coin_counter_w) /* coin counters */
+ AM_RANGE(0x5f8c, 0x5f8c) AM_WRITE(aliens_sh_irqtrigger_w) /* cause interrupt on audio CPU */
+ AM_RANGE(0x4000, 0x7fff) AM_READWRITE(k052109_051960_r, k052109_051960_w)
AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM e24_j02.bin */
ADDRESS_MAP_END
diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c
index 2001504f9f7..55bd0bad031 100644
--- a/src/mame/drivers/alpha68k.c
+++ b/src/mame/drivers/alpha68k.c
@@ -209,140 +209,134 @@ DIP locations verified from manuals for:
/******************************************************************************/
-static WRITE16_HANDLER( tnextspc_coin_counters_w )
+WRITE16_MEMBER(alpha68k_state::tnextspc_coin_counters_w)
{
- coin_counter_w(space->machine(), offset, data & 0x01);
+ coin_counter_w(machine(), offset, data & 0x01);
}
-static WRITE16_HANDLER( tnextspc_unknown_w )
+WRITE16_MEMBER(alpha68k_state::tnextspc_unknown_w)
{
- logerror("tnextspc_unknown_w : PC = %04x - offset = %04x - data = %04x\n", cpu_get_pc(&space->device()), offset, data);
+ logerror("tnextspc_unknown_w : PC = %04x - offset = %04x - data = %04x\n", cpu_get_pc(&space.device()), offset, data);
if (offset == 0)
- alpha68k_flipscreen_w(space->machine(), data & 0x100);
+ alpha68k_flipscreen_w(machine(), data & 0x100);
}
-static WRITE16_HANDLER( alpha_microcontroller_w )
+WRITE16_MEMBER(alpha68k_state::alpha_microcontroller_w)
{
- logerror("%04x: Alpha write trigger at %04x (%04x)\n", cpu_get_pc(&space->device()), offset, data);
+ logerror("%04x: Alpha write trigger at %04x (%04x)\n", cpu_get_pc(&space.device()), offset, data);
/* 0x44 = coin clear signal to microcontroller? */
if (offset == 0x2d && ACCESSING_BITS_0_7)
- alpha68k_flipscreen_w(space->machine(), data & 1);
+ alpha68k_flipscreen_w(machine(), data & 1);
}
/******************************************************************************/
-static READ16_HANDLER( kyros_dip_r )
+READ16_MEMBER(alpha68k_state::kyros_dip_r)
{
- return input_port_read(space->machine(), "IN1") << 8;
+ return input_port_read(machine(), "IN1") << 8;
}
-static READ16_HANDLER( control_1_r )
+READ16_MEMBER(alpha68k_state::control_1_r)
{
- alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
- if (state->m_invert_controls)
- return ~(input_port_read(space->machine(), "IN0") + (input_port_read(space->machine(), "IN1") << 8));
+ if (m_invert_controls)
+ return ~(input_port_read(machine(), "IN0") + (input_port_read(machine(), "IN1") << 8));
- return (input_port_read(space->machine(), "IN0") + (input_port_read(space->machine(), "IN1") << 8));
+ return (input_port_read(machine(), "IN0") + (input_port_read(machine(), "IN1") << 8));
}
-static READ16_HANDLER( control_2_r )
+READ16_MEMBER(alpha68k_state::control_2_r)
{
- alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
- if (state->m_invert_controls)
- return ~(input_port_read(space->machine(), "IN3") + ((~(1 << input_port_read(space->machine(), "IN5"))) << 8));
+ if (m_invert_controls)
+ return ~(input_port_read(machine(), "IN3") + ((~(1 << input_port_read(machine(), "IN5"))) << 8));
- return input_port_read(space->machine(), "IN3") + /* Low byte of CN1 */
- ((~(1 << input_port_read(space->machine(), "IN5"))) << 8);
+ return input_port_read(machine(), "IN3") + /* Low byte of CN1 */
+ ((~(1 << input_port_read(machine(), "IN5"))) << 8);
}
-static READ16_HANDLER( control_2_V_r )
+READ16_MEMBER(alpha68k_state::control_2_V_r)
{
- return input_port_read(space->machine(), "IN3");
+ return input_port_read(machine(), "IN3");
}
-static READ16_HANDLER( control_3_r )
+READ16_MEMBER(alpha68k_state::control_3_r)
{
- alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
- if (state->m_invert_controls)
- return ~(((~(1 << input_port_read(space->machine(), "IN6"))) << 8) & 0xff00);
+ if (m_invert_controls)
+ return ~(((~(1 << input_port_read(machine(), "IN6"))) << 8) & 0xff00);
- return ((~(1 << input_port_read(space->machine(), "IN6"))) << 8) & 0xff00;
+ return ((~(1 << input_port_read(machine(), "IN6"))) << 8) & 0xff00;
}
/* High 4 bits of CN1 & CN2 */
-static READ16_HANDLER( control_4_r )
+READ16_MEMBER(alpha68k_state::control_4_r)
{
- alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
- if (state->m_invert_controls)
- return ~((((~(1 << input_port_read(space->machine(), "IN6"))) << 4) & 0xf000)
- + (((~(1 << input_port_read(space->machine(), "IN5")))) & 0x0f00));
+ if (m_invert_controls)
+ return ~((((~(1 << input_port_read(machine(), "IN6"))) << 4) & 0xf000)
+ + (((~(1 << input_port_read(machine(), "IN5")))) & 0x0f00));
- return (((~(1 << input_port_read(space->machine(), "IN6"))) << 4) & 0xf000)
- + (((~(1 << input_port_read(space->machine(), "IN5")))) & 0x0f00);
+ return (((~(1 << input_port_read(machine(), "IN6"))) << 4) & 0xf000)
+ + (((~(1 << input_port_read(machine(), "IN5")))) & 0x0f00);
}
-static READ16_HANDLER( jongbou_inputs_r )
+READ16_MEMBER(alpha68k_state::jongbou_inputs_r)
{
- UINT8 inp1 = input_port_read(space->machine(), "IN3");
- UINT8 inp2 = input_port_read(space->machine(), "IN4");
+ UINT8 inp1 = input_port_read(machine(), "IN3");
+ UINT8 inp2 = input_port_read(machine(), "IN4");
inp1 = ((inp1 & 0x01) << 3) + ((inp1 & 0x02) << 1) + ((inp1 & 0x04) >> 1) + ((inp1 & 0x08) >> 3);
inp2 = ((inp2 & 0x01) << 3) + ((inp2 & 0x02) << 1) + ((inp2 & 0x04) >> 1) + ((inp2 & 0x08) >> 3);
- return input_port_read(space->machine(), "IN0") | inp1 | inp2 << 4;
+ return input_port_read(machine(), "IN0") | inp1 | inp2 << 4;
}
/******************************************************************************/
-static WRITE16_HANDLER( kyros_sound_w )
+WRITE16_MEMBER(alpha68k_state::kyros_sound_w)
{
if(ACCESSING_BITS_8_15)
soundlatch_w(space, 0, (data >> 8) & 0xff);
}
-static WRITE16_HANDLER( alpha68k_II_sound_w )
+WRITE16_MEMBER(alpha68k_state::alpha68k_II_sound_w)
{
if(ACCESSING_BITS_0_7)
soundlatch_w(space, 0, data & 0xff);
}
-static WRITE16_HANDLER( alpha68k_V_sound_w )
+WRITE16_MEMBER(alpha68k_state::alpha68k_V_sound_w)
{
/* Sound & fix bank select are in the same word */
if(ACCESSING_BITS_0_7)
soundlatch_w(space, 0, data & 0xff);
if(ACCESSING_BITS_8_15)
- alpha68k_V_video_bank_w(space->machine(), (data >> 8) & 0xff);
+ alpha68k_V_video_bank_w(machine(), (data >> 8) & 0xff);
}
//AT
-static WRITE16_HANDLER( paddlema_soundlatch_w )
+WRITE16_MEMBER(alpha68k_state::paddlema_soundlatch_w)
{
- alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data);
- device_set_input_line(state->m_audiocpu, 0, HOLD_LINE);
+ device_set_input_line(m_audiocpu, 0, HOLD_LINE);
}
}
-static WRITE16_HANDLER( tnextspc_soundlatch_w )
+WRITE16_MEMBER(alpha68k_state::tnextspc_soundlatch_w)
{
- alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data);
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
}
//ZT
/******************************************************************************/
-static READ16_HANDLER( kyros_alpha_trigger_r )
+READ16_MEMBER(alpha68k_state::kyros_alpha_trigger_r)
{
/* possible jump codes:
- Kyros : 0x22
@@ -350,80 +344,79 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
*/
static const UINT8 coinage1[8][2]={{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}};
static const UINT8 coinage2[8][2]={{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}};
- alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
- int source = state->m_shared_ram[offset];
+ int source = m_shared_ram[offset];
switch (offset)
{
case 0x22: /* Coin value */
- state->m_shared_ram[0x22] = (source & 0xff00) | (state->m_credits & 0x00ff);
+ m_shared_ram[0x22] = (source & 0xff00) | (m_credits & 0x00ff);
return 0;
case 0x29: /* Query microcontroller for coin insert */
- state->m_trigstate++;
- if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
- state->m_latch = 0;
- if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->m_latch)
+ m_trigstate++;
+ if ((input_port_read(machine(), "IN2") & 0x3) == 3)
+ m_latch = 0;
+ if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
{
- state->m_shared_ram[0x29] = (source & 0xff00) | (state->m_coin_id & 0xff); // coinA
- state->m_shared_ram[0x22] = (source & 0xff00) | 0x0;
- state->m_latch = 1;
+ m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
+ m_shared_ram[0x22] = (source & 0xff00) | 0x0;
+ m_latch = 1;
- state->m_coinvalue = (~input_port_read(space->machine(), "IN1") >> 1) & 7;
- state->m_deposits1++;
- if (state->m_deposits1 == coinage1[state->m_coinvalue][0])
+ m_coinvalue = (~input_port_read(machine(), "IN1") >> 1) & 7;
+ m_deposits1++;
+ if (m_deposits1 == coinage1[m_coinvalue][0])
{
- state->m_credits = coinage1[state->m_coinvalue][1];
- state->m_deposits1 = 0;
+ m_credits = coinage1[m_coinvalue][1];
+ m_deposits1 = 0;
}
else
- state->m_credits = 0;
+ m_credits = 0;
}
- else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->m_latch)
+ else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
{
- state->m_shared_ram[0x29] = (source & 0xff00) | (state->m_coin_id >> 8); // coinB
- state->m_shared_ram[0x22] = (source & 0xff00) | 0x0;
- state->m_latch = 1;
+ m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id >> 8); // coinB
+ m_shared_ram[0x22] = (source & 0xff00) | 0x0;
+ m_latch = 1;
- state->m_coinvalue = (~input_port_read(space->machine(), "IN1") >>1 ) & 7;
- state->m_deposits2++;
- if (state->m_deposits2 == coinage2[state->m_coinvalue][0])
+ m_coinvalue = (~input_port_read(machine(), "IN1") >>1 ) & 7;
+ m_deposits2++;
+ if (m_deposits2 == coinage2[m_coinvalue][0])
{
- state->m_credits = coinage2[state->m_coinvalue][1];
- state->m_deposits2 = 0;
+ m_credits = coinage2[m_coinvalue][1];
+ m_deposits2 = 0;
}
else
- state->m_credits = 0;
+ m_credits = 0;
}
else
{
- if (state->m_microcontroller_id == 0x00ff) /* Super Stingry */
+ if (m_microcontroller_id == 0x00ff) /* Super Stingry */
{
- if (state->m_trigstate >= 12 || state->m_game_id == ALPHA68K_JONGBOU) /* arbitrary value ! */
+ if (m_trigstate >= 12 || m_game_id == ALPHA68K_JONGBOU) /* arbitrary value ! */
{
- state->m_trigstate = 0;
- state->m_microcontroller_data = 0x21; // timer
+ m_trigstate = 0;
+ m_microcontroller_data = 0x21; // timer
}
else
- state->m_microcontroller_data = 0x00;
+ m_microcontroller_data = 0x00;
}
else
- state->m_microcontroller_data = 0x00;
+ m_microcontroller_data = 0x00;
- state->m_shared_ram[0x29] = (source & 0xff00) | state->m_microcontroller_data;
+ m_shared_ram[0x29] = (source & 0xff00) | m_microcontroller_data;
}
return 0;
case 0xff: /* Custom check, only used at bootup */
- state->m_shared_ram[0xff] = (source & 0xff00) | state->m_microcontroller_id;
+ m_shared_ram[0xff] = (source & 0xff00) | m_microcontroller_id;
break;
}
- logerror("%04x: Alpha read trigger at %04x\n", cpu_get_pc(&space->device()), offset);
+ logerror("%04x: Alpha read trigger at %04x\n", cpu_get_pc(&space.device()), offset);
return 0; /* Values returned don't matter */
}
/* Time Soldiers, Sky Soldiers, Gold Medalist */
-static READ16_HANDLER( alpha_II_trigger_r )
+READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
{
/* possible jump codes:
- Time Soldiers : 0x21,0x22,0x23,0x24,0x34,0x37,0x3a,0x3d,0x40,0x43,0x46,0x49
@@ -432,93 +425,92 @@ static READ16_HANDLER( alpha_II_trigger_r )
*/
static const UINT8 coinage1[8][2] = {{1,1}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {2,3}, {3,2}};
static const UINT8 coinage2[8][2] = {{1,1}, {2,1}, {3,1}, {4,1}, {5,1}, {6,1}, {7,1}, {8,1}};
- alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
- int source = state->m_shared_ram[offset];
+ int source = m_shared_ram[offset];
switch (offset)
{
case 0: /* Dipswitch 2 */
- state->m_shared_ram[0] = (source & 0xff00) | input_port_read(space->machine(), "IN4");
+ m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "IN4");
return 0;
case 0x22: /* Coin value */
- state->m_shared_ram[0x22] = (source & 0xff00) | (state->m_credits & 0x00ff);
+ m_shared_ram[0x22] = (source & 0xff00) | (m_credits & 0x00ff);
return 0;
case 0x29: /* Query microcontroller for coin insert */
- if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
- state->m_latch = 0;
- if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->m_latch)
+ if ((input_port_read(machine(), "IN2") & 0x3) == 3)
+ m_latch = 0;
+ if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
{
- state->m_shared_ram[0x29] = (source & 0xff00) | (state->m_coin_id & 0xff); // coinA
- state->m_shared_ram[0x22] = (source & 0xff00) | 0x0;
- state->m_latch = 1;
+ m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
+ m_shared_ram[0x22] = (source & 0xff00) | 0x0;
+ m_latch = 1;
- if ((state->m_coin_id & 0xff) == 0x22)
+ if ((m_coin_id & 0xff) == 0x22)
{
- if (state->m_game_id == ALPHA68K_BTLFIELDB)
- state->m_coinvalue = (input_port_read(space->machine(), "IN4") >> 0) & 7;
+ if (m_game_id == ALPHA68K_BTLFIELDB)
+ m_coinvalue = (input_port_read(machine(), "IN4") >> 0) & 7;
else
- state->m_coinvalue = (~input_port_read(space->machine(), "IN4") >> 0) & 7;
+ m_coinvalue = (~input_port_read(machine(), "IN4") >> 0) & 7;
- state->m_deposits1++;
- if (state->m_deposits1 == coinage1[state->m_coinvalue][0])
+ m_deposits1++;
+ if (m_deposits1 == coinage1[m_coinvalue][0])
{
- state->m_credits = coinage1[state->m_coinvalue][1];
- state->m_deposits1 = 0;
+ m_credits = coinage1[m_coinvalue][1];
+ m_deposits1 = 0;
}
else
- state->m_credits = 0;
+ m_credits = 0;
}
}
- else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->m_latch)
+ else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
{
- state->m_shared_ram[0x29] = (source & 0xff00) | (state->m_coin_id >> 8); // coinB
- state->m_shared_ram[0x22] = (source & 0xff00) | 0x0;
- state->m_latch = 1;
+ m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id >> 8); // coinB
+ m_shared_ram[0x22] = (source & 0xff00) | 0x0;
+ m_latch = 1;
- if ((state->m_coin_id >> 8) == 0x22)
+ if ((m_coin_id >> 8) == 0x22)
{
- if (state->m_game_id == ALPHA68K_BTLFIELDB)
- state->m_coinvalue = (input_port_read(space->machine(), "IN4") >> 0) & 7;
+ if (m_game_id == ALPHA68K_BTLFIELDB)
+ m_coinvalue = (input_port_read(machine(), "IN4") >> 0) & 7;
else
- state->m_coinvalue = (~input_port_read(space->machine(), "IN4") >> 0) & 7;
+ m_coinvalue = (~input_port_read(machine(), "IN4") >> 0) & 7;
- state->m_deposits2++;
- if (state->m_deposits2 == coinage2[state->m_coinvalue][0])
+ m_deposits2++;
+ if (m_deposits2 == coinage2[m_coinvalue][0])
{
- state->m_credits = coinage2[state->m_coinvalue][1];
- state->m_deposits2 = 0;
+ m_credits = coinage2[m_coinvalue][1];
+ m_deposits2 = 0;
}
else
- state->m_credits = 0;
+ m_credits = 0;
}
}
else
{
- if (state->m_microcontroller_id == 0x8803) /* Gold Medalist */
- state->m_microcontroller_data = 0x21; // timer
+ if (m_microcontroller_id == 0x8803) /* Gold Medalist */
+ m_microcontroller_data = 0x21; // timer
else
- state->m_microcontroller_data = 0x00;
- state->m_shared_ram[0x29] = (source & 0xff00) | state->m_microcontroller_data;
+ m_microcontroller_data = 0x00;
+ m_shared_ram[0x29] = (source & 0xff00) | m_microcontroller_data;
}
return 0;
case 0xfe: /* Custom ID check, same for all games */
- state->m_shared_ram[0xfe] = (source & 0xff00) | 0x87;
+ m_shared_ram[0xfe] = (source & 0xff00) | 0x87;
break;
case 0xff: /* Custom ID check, same for all games */
- state->m_shared_ram[0xff] = (source & 0xff00) | 0x13;
+ m_shared_ram[0xff] = (source & 0xff00) | 0x13;
break;
}
- logerror("%04x: Alpha read trigger at %04x\n", cpu_get_pc(&space->device()), offset);
+ logerror("%04x: Alpha read trigger at %04x\n", cpu_get_pc(&space.device()), offset);
return 0; /* Values returned don't matter */
}
/* Sky Adventure, Gang Wars, Super Champion Baseball */
-static READ16_HANDLER( alpha_V_trigger_r )
+READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
{
/* possible jump codes:
- Sky Adventure : 0x21,0x22,0x23,0x24,0x34,0x37,0x3a,0x3d,0x40,0x43,0x46,0x49
@@ -527,138 +519,137 @@ static READ16_HANDLER( alpha_V_trigger_r )
*/
static const UINT8 coinage1[8][2] = {{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}};
static const UINT8 coinage2[8][2] = {{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}};
- alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
- int source = state->m_shared_ram[offset];
+ int source = m_shared_ram[offset];
switch (offset)
{
case 0: /* Dipswitch 1 */
- state->m_shared_ram[0] = (source & 0xff00) | input_port_read(space->machine(), "IN4");
+ m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "IN4");
return 0;
case 0x22: /* Coin value */
- state->m_shared_ram[0x22] = (source & 0xff00) | (state->m_credits & 0x00ff);
+ m_shared_ram[0x22] = (source & 0xff00) | (m_credits & 0x00ff);
return 0;
case 0x29: /* Query microcontroller for coin insert */
- if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
- state->m_latch = 0;
- if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->m_latch)
+ if ((input_port_read(machine(), "IN2") & 0x3) == 3)
+ m_latch = 0;
+ if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
{
- state->m_shared_ram[0x29] = (source & 0xff00) | (state->m_coin_id & 0xff); // coinA
- state->m_shared_ram[0x22] = (source & 0xff00) | 0x0;
- state->m_latch = 1;
+ m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
+ m_shared_ram[0x22] = (source & 0xff00) | 0x0;
+ m_latch = 1;
- if ((state->m_coin_id & 0xff) == 0x22)
+ if ((m_coin_id & 0xff) == 0x22)
{
- state->m_coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
- state->m_deposits1++;
- if (state->m_deposits1 == coinage1[state->m_coinvalue][0])
+ m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
+ m_deposits1++;
+ if (m_deposits1 == coinage1[m_coinvalue][0])
{
- state->m_credits = coinage1[state->m_coinvalue][1];
- state->m_deposits1 = 0;
+ m_credits = coinage1[m_coinvalue][1];
+ m_deposits1 = 0;
}
else
- state->m_credits = 0;
+ m_credits = 0;
}
}
- else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->m_latch)
+ else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
{
- state->m_shared_ram[0x29] = (source & 0xff00) | (state->m_coin_id>>8); // coinB
- state->m_shared_ram[0x22] = (source & 0xff00) | 0x0;
- state->m_latch = 1;
+ m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id>>8); // coinB
+ m_shared_ram[0x22] = (source & 0xff00) | 0x0;
+ m_latch = 1;
- if ((state->m_coin_id >> 8) == 0x22)
+ if ((m_coin_id >> 8) == 0x22)
{
- state->m_coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
- state->m_deposits2++;
- if (state->m_deposits2 == coinage2[state->m_coinvalue][0])
+ m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
+ m_deposits2++;
+ if (m_deposits2 == coinage2[m_coinvalue][0])
{
- state->m_credits = coinage2[state->m_coinvalue][1];
- state->m_deposits2 = 0;
+ m_credits = coinage2[m_coinvalue][1];
+ m_deposits2 = 0;
}
else
- state->m_credits = 0;
+ m_credits = 0;
}
}
else
{
- state->m_microcontroller_data = 0x00;
- state->m_shared_ram[0x29] = (source & 0xff00) | state->m_microcontroller_data;
+ m_microcontroller_data = 0x00;
+ m_shared_ram[0x29] = (source & 0xff00) | m_microcontroller_data;
}
return 0;
case 0xfe: /* Custom ID check */
- state->m_shared_ram[0xfe] = (source & 0xff00) | (state->m_microcontroller_id >> 8);
+ m_shared_ram[0xfe] = (source & 0xff00) | (m_microcontroller_id >> 8);
break;
case 0xff: /* Custom ID check */
- state->m_shared_ram[0xff] = (source & 0xff00) | (state->m_microcontroller_id & 0xff);
+ m_shared_ram[0xff] = (source & 0xff00) | (m_microcontroller_id & 0xff);
break;
case 0x1f00: /* Dipswitch 1 */
- state->m_shared_ram[0x1f00] = (source & 0xff00) | input_port_read(space->machine(), "IN4");
+ m_shared_ram[0x1f00] = (source & 0xff00) | input_port_read(machine(), "IN4");
return 0;
case 0x1f29: /* Query microcontroller for coin insert */
- if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
- state->m_latch = 0;
- if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->m_latch)
+ if ((input_port_read(machine(), "IN2") & 0x3) == 3)
+ m_latch = 0;
+ if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
{
- state->m_shared_ram[0x1f29] = (source & 0xff00) | (state->m_coin_id & 0xff); // coinA
- state->m_shared_ram[0x1f22] = (source & 0xff00) | 0x0;
- state->m_latch = 1;
+ m_shared_ram[0x1f29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
+ m_shared_ram[0x1f22] = (source & 0xff00) | 0x0;
+ m_latch = 1;
- if ((state->m_coin_id & 0xff) == 0x22)
+ if ((m_coin_id & 0xff) == 0x22)
{
- state->m_coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
- state->m_deposits1++;
- if (state->m_deposits1 == coinage1[state->m_coinvalue][0])
+ m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
+ m_deposits1++;
+ if (m_deposits1 == coinage1[m_coinvalue][0])
{
- state->m_credits = coinage1[state->m_coinvalue][1];
- state->m_deposits1 = 0;
+ m_credits = coinage1[m_coinvalue][1];
+ m_deposits1 = 0;
}
else
- state->m_credits = 0;
+ m_credits = 0;
}
}
- else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->m_latch)
+ else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
{
- state->m_shared_ram[0x1f29] = (source & 0xff00) | (state->m_coin_id >> 8); // coinB
- state->m_shared_ram[0x1f22] = (source & 0xff00) | 0x0;
- state->m_latch = 1;
+ m_shared_ram[0x1f29] = (source & 0xff00) | (m_coin_id >> 8); // coinB
+ m_shared_ram[0x1f22] = (source & 0xff00) | 0x0;
+ m_latch = 1;
- if ((state->m_coin_id >> 8) == 0x22)
+ if ((m_coin_id >> 8) == 0x22)
{
- state->m_coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
- state->m_deposits2++;
- if (state->m_deposits2 == coinage2[state->m_coinvalue][0])
+ m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
+ m_deposits2++;
+ if (m_deposits2 == coinage2[m_coinvalue][0])
{
- state->m_credits = coinage2[state->m_coinvalue][1];
- state->m_deposits2 = 0;
+ m_credits = coinage2[m_coinvalue][1];
+ m_deposits2 = 0;
}
else
- state->m_credits = 0;
+ m_credits = 0;
}
}
else
{
- state->m_microcontroller_data = 0x00;
- state->m_shared_ram[0x1f29] = (source & 0xff00) | state->m_microcontroller_data;
+ m_microcontroller_data = 0x00;
+ m_shared_ram[0x1f29] = (source & 0xff00) | m_microcontroller_data;
}
/* Gang Wars expects the first dip to appear in RAM at 0x02c6,
the microcontroller supplies it (it does for all the other games,
but usually to 0x0 in RAM) when 0x21 is read (code at 0x009332) */
- source = state->m_shared_ram[0x0163];
- state->m_shared_ram[0x0163] = (source & 0x00ff) | (input_port_read(space->machine(), "IN4") << 8);
+ source = m_shared_ram[0x0163];
+ m_shared_ram[0x0163] = (source & 0x00ff) | (input_port_read(machine(), "IN4") << 8);
return 0;
case 0x1ffe: /* Custom ID check */
- state->m_shared_ram[0x1ffe] = (source & 0xff00) | (state->m_microcontroller_id >> 8);
+ m_shared_ram[0x1ffe] = (source & 0xff00) | (m_microcontroller_id >> 8);
break;
case 0x1fff: /* Custom ID check */
- state->m_shared_ram[0x1fff] = (source & 0xff00) | (state->m_microcontroller_id & 0xff);
+ m_shared_ram[0x1fff] = (source & 0xff00) | (m_microcontroller_id & 0xff);
break;
}
- logerror("%04x: Alpha read trigger at %04x\n", cpu_get_pc(&space->device()), offset);
+ logerror("%04x: Alpha read trigger at %04x\n", cpu_get_pc(&space.device()), offset);
return 0; /* Values returned don't matter */
}
@@ -670,9 +661,9 @@ static ADDRESS_MAP_START( kyros_map, AS_PROGRAM, 16, alpha68k_state )
AM_RANGE(0x020000, 0x020fff) AM_RAM AM_BASE(m_shared_ram) // work RAM
AM_RANGE(0x040000, 0x041fff) AM_RAM AM_BASE(m_spriteram) // sprite RAM
AM_RANGE(0x060000, 0x060001) AM_RAM AM_BASE(m_videoram) // MSB: watchdog, LSB: BGC
- AM_RANGE(0x080000, 0x0801ff) AM_READWRITE_LEGACY(kyros_alpha_trigger_r, alpha_microcontroller_w)
+ AM_RANGE(0x080000, 0x0801ff) AM_READWRITE(kyros_alpha_trigger_r, alpha_microcontroller_w)
AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("IN0")
- AM_RANGE(0x0e0000, 0x0e0001) AM_READWRITE_LEGACY(kyros_dip_r, kyros_sound_w)
+ AM_RANGE(0x0e0000, 0x0e0001) AM_READWRITE(kyros_dip_r, kyros_sound_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( alpha68k_I_map, AS_PROGRAM, 16, alpha68k_state )
@@ -683,24 +674,24 @@ static ADDRESS_MAP_START( alpha68k_I_map, AS_PROGRAM, 16, alpha68k_state )
AM_RANGE(0x180008, 0x180009) AM_READ_PORT("IN4") // LSB: DSW1
AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0") // joy1, joy2
AM_RANGE(0x340000, 0x340001) AM_READ_PORT("IN1") // coin, start, service
- AM_RANGE(0x380000, 0x380001) AM_READ_PORT("IN2") AM_WRITE_LEGACY(paddlema_soundlatch_w) // LSB: sound latch write and RST38 trigger, joy3, joy4
+ AM_RANGE(0x380000, 0x380001) AM_READ_PORT("IN2") AM_WRITE(paddlema_soundlatch_w) // LSB: sound latch write and RST38 trigger, joy3, joy4
ADDRESS_MAP_END
static ADDRESS_MAP_START( alpha68k_II_map, AS_PROGRAM, 16, alpha68k_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(m_shared_ram)
- AM_RANGE(0x080000, 0x080001) AM_READ_LEGACY(control_1_r) /* Joysticks */
- AM_RANGE(0x080000, 0x080001) AM_WRITE_LEGACY(alpha68k_II_sound_w)
- AM_RANGE(0x0c0000, 0x0c0001) AM_READ_LEGACY(control_2_r) /* CN1 & Dip 1 */
+ AM_RANGE(0x080000, 0x080001) AM_READ(control_1_r) /* Joysticks */
+ AM_RANGE(0x080000, 0x080001) AM_WRITE(alpha68k_II_sound_w)
+ AM_RANGE(0x0c0000, 0x0c0001) AM_READ(control_2_r) /* CN1 & Dip 1 */
AM_RANGE(0x0c0000, 0x0c00ff) AM_WRITE_LEGACY(alpha68k_II_video_bank_w)
- AM_RANGE(0x0c8000, 0x0c8001) AM_READ_LEGACY(control_3_r) /* Bottom of CN2 */
- AM_RANGE(0x0d0000, 0x0d0001) AM_READ_LEGACY(control_4_r) /* Top of CN1 & CN2 */
+ AM_RANGE(0x0c8000, 0x0c8001) AM_READ(control_3_r) /* Bottom of CN2 */
+ AM_RANGE(0x0d0000, 0x0d0001) AM_READ(control_4_r) /* Top of CN1 & CN2 */
AM_RANGE(0x0d8000, 0x0d8001) AM_READNOP /* IRQ ack? */
AM_RANGE(0x0e0000, 0x0e0001) AM_READNOP /* IRQ ack? */
AM_RANGE(0x0e8000, 0x0e8001) AM_READNOP /* watchdog? */
AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE_LEGACY(alpha68k_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE(m_spriteram)
- AM_RANGE(0x300000, 0x3001ff) AM_READWRITE_LEGACY(alpha_II_trigger_r, alpha_microcontroller_w)
+ AM_RANGE(0x300000, 0x3001ff) AM_READWRITE(alpha_II_trigger_r, alpha_microcontroller_w)
AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE_LEGACY(alpha68k_paletteram_w) AM_BASE(m_paletteram)
AM_RANGE(0x800000, 0x83ffff) AM_ROMBANK("bank8")
ADDRESS_MAP_END
@@ -708,22 +699,22 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( alpha68k_V_map, AS_PROGRAM, 16, alpha68k_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x040000, 0x043fff) AM_RAM AM_BASE(m_shared_ram)
- AM_RANGE(0x080000, 0x080001) AM_READWRITE_LEGACY(control_1_r, alpha68k_V_sound_w) /* Joysticks */
- AM_RANGE(0x0c0000, 0x0c0001) AM_READ_LEGACY(control_2_V_r) /* Dip 2 */
+ AM_RANGE(0x080000, 0x080001) AM_READWRITE(control_1_r, alpha68k_V_sound_w) /* Joysticks */
+ AM_RANGE(0x0c0000, 0x0c0001) AM_READ(control_2_V_r) /* Dip 2 */
AM_RANGE(0x0c0000, 0x0c00ff) AM_WRITE_LEGACY(alpha68k_V_video_control_w)
AM_RANGE(0x0d8000, 0x0d8001) AM_READNOP /* IRQ ack? */
AM_RANGE(0x0e0000, 0x0e0001) AM_READNOP /* IRQ ack? */
AM_RANGE(0x0e8000, 0x0e8001) AM_READNOP /* watchdog? */
AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE_LEGACY(alpha68k_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE(m_spriteram)
- AM_RANGE(0x300000, 0x303fff) AM_READ_LEGACY(alpha_V_trigger_r)
- AM_RANGE(0x300000, 0x3001ff) AM_WRITE_LEGACY(alpha_microcontroller_w)
- AM_RANGE(0x303e00, 0x303fff) AM_WRITE_LEGACY(alpha_microcontroller_w) /* Gang Wars mirror */
+ AM_RANGE(0x300000, 0x303fff) AM_READ(alpha_V_trigger_r)
+ AM_RANGE(0x300000, 0x3001ff) AM_WRITE(alpha_microcontroller_w)
+ AM_RANGE(0x303e00, 0x303fff) AM_WRITE(alpha_microcontroller_w) /* Gang Wars mirror */
AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE_LEGACY(alpha68k_paletteram_w) AM_BASE(m_paletteram)
AM_RANGE(0x800000, 0x83ffff) AM_ROMBANK("bank8")
ADDRESS_MAP_END
-static READ16_HANDLER(sound_cpu_r) { return 1; }
+READ16_MEMBER(alpha68k_state::sound_cpu_r){ return 1; }
static ADDRESS_MAP_START( tnextspc_map, AS_PROGRAM, 16, alpha68k_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
@@ -737,17 +728,17 @@ static ADDRESS_MAP_START( tnextspc_map, AS_PROGRAM, 16, alpha68k_state )
AM_RANGE(0x0e0008, 0x0e0009) AM_READ_PORT("DSW1")
AM_RANGE(0x0e000a, 0x0e000b) AM_READ_PORT("DSW2")
AM_RANGE(0x0e000e, 0x0e000f) AM_WRITENOP // unknown write port (0)
- AM_RANGE(0x0e0018, 0x0e0019) AM_READ_LEGACY(sound_cpu_r)
- AM_RANGE(0x0f0000, 0x0f0001) AM_WRITE_LEGACY(tnextspc_unknown_w)
- AM_RANGE(0x0f0002, 0x0f0005) AM_WRITE_LEGACY(tnextspc_coin_counters_w)
- AM_RANGE(0x0f0008, 0x0f0009) AM_WRITE_LEGACY(tnextspc_soundlatch_w)
+ AM_RANGE(0x0e0018, 0x0e0019) AM_READ(sound_cpu_r)
+ AM_RANGE(0x0f0000, 0x0f0001) AM_WRITE(tnextspc_unknown_w)
+ AM_RANGE(0x0f0002, 0x0f0005) AM_WRITE(tnextspc_coin_counters_w)
+ AM_RANGE(0x0f0008, 0x0f0009) AM_WRITE(tnextspc_soundlatch_w)
ADDRESS_MAP_END
/******************************************************************************/
-static WRITE8_HANDLER( sound_bank_w )
+WRITE8_MEMBER(alpha68k_state::sound_bank_w)
{
- memory_set_bank(space->machine(), "bank7", data);
+ memory_set_bank(machine(), "bank7", data);
}
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, alpha68k_state )
@@ -808,7 +799,7 @@ static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, alpha68k_state )
AM_RANGE(0x08, 0x08) AM_DEVWRITE_LEGACY("dac", dac_signed_w)
AM_RANGE(0x0a, 0x0b) AM_DEVWRITE_LEGACY("ym2", ym2413_w)
AM_RANGE(0x0c, 0x0d) AM_DEVWRITE_LEGACY("ym1", ym2203_w)
- AM_RANGE(0x0e, 0x0e) AM_WRITE_LEGACY(sound_bank_w)
+ AM_RANGE(0x0e, 0x0e) AM_WRITE(sound_bank_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( kyros_sound_portmap, AS_IO, 8, alpha68k_state )
@@ -1835,21 +1826,20 @@ static const ay8910_interface ay8910_config =
DEVCB_MEMORY_HANDLER("audiocpu", PROGRAM, soundlatch_r)
};
-static WRITE8_HANDLER( porta_w )
+WRITE8_MEMBER(alpha68k_state::porta_w)
{
- alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if(data == 0xff)
return; // skip
/* guess */
- if(data == 0 && state->m_sound_pa_latch) // 1 -> 0 transition = enables NMI
- state->m_sound_nmi_mask = 1;
+ if(data == 0 && m_sound_pa_latch) // 1 -> 0 transition = enables NMI
+ m_sound_nmi_mask = 1;
- if(data && state->m_sound_pa_latch == 0) // 0 -> 1 transition = disables NMI
- state->m_sound_nmi_mask = 0;
+ if(data && m_sound_pa_latch == 0) // 0 -> 1 transition = disables NMI
+ m_sound_nmi_mask = 0;
- state->m_sound_pa_latch = data & 1;
+ m_sound_pa_latch = data & 1;
}
static const ym2203_interface ym2203_config =
@@ -1859,7 +1849,7 @@ static const ym2203_interface ym2203_config =
AY8910_DEFAULT_LOADS,
DEVCB_MEMORY_HANDLER("audiocpu", PROGRAM, soundlatch_r),
DEVCB_NULL,
- DEVCB_MEMORY_HANDLER("audiocpu", PROGRAM, porta_w),
+ DEVCB_DRIVER_MEMBER(alpha68k_state, porta_w),
DEVCB_NULL
},
NULL
@@ -3178,7 +3168,7 @@ static DRIVER_INIT( kyros )
static DRIVER_INIT( jongbou )
{
alpha68k_state *state = machine.driver_data<alpha68k_state>();
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0c0000, 0x0c0001, FUNC(jongbou_inputs_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x0c0000, 0x0c0001, read16_delegate(FUNC(alpha68k_state::jongbou_inputs_r),state));
state->m_invert_controls = 0;
state->m_microcontroller_id = 0x00ff;
state->m_coin_id = 0x23 | (0x24 << 8);
diff --git a/src/mame/drivers/ambush.c b/src/mame/drivers/ambush.c
index b8af5195cad..649e6a9aed8 100644
--- a/src/mame/drivers/ambush.c
+++ b/src/mame/drivers/ambush.c
@@ -45,15 +45,15 @@
*
*************************************/
-static WRITE8_HANDLER( ambush_coin_counter_w )
+WRITE8_MEMBER(ambush_state::ambush_coin_counter_w)
{
- coin_counter_w(space->machine(), 0, data & 0x01);
- coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(machine(), 0, data & 0x01);
+ coin_counter_w(machine(), 1, data & 0x02);
}
-static WRITE8_HANDLER( flip_screen_w )
+WRITE8_MEMBER(ambush_state::flip_screen_w)
{
- flip_screen_set(space->machine(), data);
+ flip_screen_set(machine(), data);
}
@@ -74,9 +74,9 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, ambush_state )
AM_RANGE(0xc400, 0xc7ff) AM_BASE_SIZE(m_videoram, m_videoram_size)
AM_RANGE(0xc800, 0xc800) AM_READ_PORT("DSW1")
AM_RANGE(0xcc00, 0xcc03) AM_WRITENOP
- AM_RANGE(0xcc04, 0xcc04) AM_WRITE_LEGACY(flip_screen_w)
+ AM_RANGE(0xcc04, 0xcc04) AM_WRITE(flip_screen_w)
AM_RANGE(0xcc05, 0xcc05) AM_WRITEONLY AM_BASE(m_colorbank)
- AM_RANGE(0xcc07, 0xcc07) AM_WRITE_LEGACY(ambush_coin_counter_w)
+ AM_RANGE(0xcc07, 0xcc07) AM_WRITE(ambush_coin_counter_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( main_portmap, AS_IO, 8, ambush_state )
diff --git a/src/mame/drivers/ampoker2.c b/src/mame/drivers/ampoker2.c
index a7abf2e510d..44e23793d27 100644
--- a/src/mame/drivers/ampoker2.c
+++ b/src/mame/drivers/ampoker2.c
@@ -469,7 +469,7 @@
*/
-static WRITE8_HANDLER( ampoker2_port30_w )
+WRITE8_MEMBER(ampoker2_state::ampoker2_port30_w)
/*-------------------------------------------------
PORT_30 C000H ;OUTPUT PORT 30H
---------------------------------------------------
@@ -483,7 +483,7 @@ static WRITE8_HANDLER( ampoker2_port30_w )
}
-static WRITE8_HANDLER( ampoker2_port31_w )
+WRITE8_MEMBER(ampoker2_state::ampoker2_port31_w)
/*-------------------------------------------------
PORT_31 C001H ;OUTPUT PORT 31H
---------------------------------------------------
@@ -501,7 +501,7 @@ static WRITE8_HANDLER( ampoker2_port31_w )
}
-static WRITE8_HANDLER( ampoker2_port32_w )
+WRITE8_MEMBER(ampoker2_state::ampoker2_port32_w)
/*-------------------------------------------------
PORT_32 C002H ;OUTPUT PORT 32H
---------------------------------------------------
@@ -516,7 +516,7 @@ static WRITE8_HANDLER( ampoker2_port32_w )
}
-static WRITE8_HANDLER( ampoker2_port33_w )
+WRITE8_MEMBER(ampoker2_state::ampoker2_port33_w)
/*-------------------------------------------------
PORT_33 C003H ;OUTPUT PORT 33H
---------------------------------------------------
@@ -530,7 +530,7 @@ static WRITE8_HANDLER( ampoker2_port33_w )
}
-static WRITE8_HANDLER( ampoker2_port34_w )
+WRITE8_MEMBER(ampoker2_state::ampoker2_port34_w)
/*-------------------------------------------------
PORT_34 C004H ;OUTPUT PORT 34H
---------------------------------------------------
@@ -545,7 +545,7 @@ static WRITE8_HANDLER( ampoker2_port34_w )
}
-static WRITE8_HANDLER( ampoker2_port35_w )
+WRITE8_MEMBER(ampoker2_state::ampoker2_port35_w)
/*-------------------------------------------------
PORT_35 C005H ;OUTPUT PORT 35H
---------------------------------------------------
@@ -559,7 +559,7 @@ static WRITE8_HANDLER( ampoker2_port35_w )
}
-static WRITE8_HANDLER( ampoker2_port36_w )
+WRITE8_MEMBER(ampoker2_state::ampoker2_port36_w)
/*-------------------------------------------------
PORT_36 C006H ;OUTPUT PORT 36H
---------------------------------------------------
@@ -577,7 +577,7 @@ static WRITE8_HANDLER( ampoker2_port36_w )
}
-static WRITE8_HANDLER( ampoker2_watchdog_reset_w )
+WRITE8_MEMBER(ampoker2_state::ampoker2_watchdog_reset_w)
/*-------------------------------------------------
PORT_37 C007H ;OUTPUT PORT 37H
---------------------------------------------------
@@ -588,7 +588,7 @@ static WRITE8_HANDLER( ampoker2_watchdog_reset_w )
if (((data >> 3) & 0x01) == 0) /* check for refresh value (0x08) */
{
- watchdog_reset(space->machine());
+ watchdog_reset(machine());
// popmessage("%02x", data);
}
else
@@ -620,14 +620,14 @@ static ADDRESS_MAP_START( ampoker2_io_map, AS_IO, 8, ampoker2_state )
AM_RANGE(0x16, 0x16) AM_READ_PORT("IN6")
AM_RANGE(0x17, 0x17) AM_READ_PORT("IN7")
// AM_RANGE(0x21, 0x21) AM_WRITENOP /* undocumented, write 0x1a after each reset */
- AM_RANGE(0x30, 0x30) AM_WRITE_LEGACY(ampoker2_port30_w) /* see write handlers */
- AM_RANGE(0x31, 0x31) AM_WRITE_LEGACY(ampoker2_port31_w) /* see write handlers */
- AM_RANGE(0x32, 0x32) AM_WRITE_LEGACY(ampoker2_port32_w) /* see write handlers */
- AM_RANGE(0x33, 0x33) AM_WRITE_LEGACY(ampoker2_port33_w) /* see write handlers */
- AM_RANGE(0x34, 0x34) AM_WRITE_LEGACY(ampoker2_port34_w) /* see write handlers */
- AM_RANGE(0x35, 0x35) AM_WRITE_LEGACY(ampoker2_port35_w) /* see write handlers */
- AM_RANGE(0x36, 0x36) AM_WRITE_LEGACY(ampoker2_port36_w) /* see write handlers */
- AM_RANGE(0x37, 0x37) AM_WRITE_LEGACY(ampoker2_watchdog_reset_w)
+ AM_RANGE(0x30, 0x30) AM_WRITE(ampoker2_port30_w) /* see write handlers */
+ AM_RANGE(0x31, 0x31) AM_WRITE(ampoker2_port31_w) /* see write handlers */
+ AM_RANGE(0x32, 0x32) AM_WRITE(ampoker2_port32_w) /* see write handlers */
+ AM_RANGE(0x33, 0x33) AM_WRITE(ampoker2_port33_w) /* see write handlers */
+ AM_RANGE(0x34, 0x34) AM_WRITE(ampoker2_port34_w) /* see write handlers */
+ AM_RANGE(0x35, 0x35) AM_WRITE(ampoker2_port35_w) /* see write handlers */
+ AM_RANGE(0x36, 0x36) AM_WRITE(ampoker2_port36_w) /* see write handlers */
+ AM_RANGE(0x37, 0x37) AM_WRITE(ampoker2_watchdog_reset_w)
AM_RANGE(0x38, 0x39) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
AM_RANGE(0x3A, 0x3A) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c
index 49ecc6fd0f2..48842a96c71 100644
--- a/src/mame/drivers/amspdwy.c
+++ b/src/mame/drivers/amspdwy.c
@@ -52,14 +52,14 @@ static UINT8 amspdwy_wheel_r( running_machine &machine, int index )
return state->m_wheel_return[index] | input_port_read(machine, portnames[index]);
}
-static READ8_HANDLER( amspdwy_wheel_0_r )
+READ8_MEMBER(amspdwy_state::amspdwy_wheel_0_r)
{
- return amspdwy_wheel_r(space->machine(), 0);
+ return amspdwy_wheel_r(machine(), 0);
}
-static READ8_HANDLER( amspdwy_wheel_1_r )
+READ8_MEMBER(amspdwy_state::amspdwy_wheel_1_r)
{
- return amspdwy_wheel_r(space->machine(), 1);
+ return amspdwy_wheel_r(machine(), 1);
}
static READ8_DEVICE_HANDLER( amspdwy_sound_r )
@@ -67,11 +67,10 @@ static READ8_DEVICE_HANDLER( amspdwy_sound_r )
return (ym2151_status_port_r(device, 0) & ~ 0x30) | input_port_read(device->machine(), "IN0");
}
-static WRITE8_HANDLER( amspdwy_sound_w )
+WRITE8_MEMBER(amspdwy_state::amspdwy_sound_w)
{
- amspdwy_state *state = space->machine().driver_data<amspdwy_state>();
soundlatch_w(space, 0, data);
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( amspdwy_map, AS_PROGRAM, 8, amspdwy_state )
@@ -83,23 +82,23 @@ static ADDRESS_MAP_START( amspdwy_map, AS_PROGRAM, 8, amspdwy_state )
// AM_RANGE(0xa000, 0xa000) AM_WRITENOP // ?
AM_RANGE(0xa000, 0xa000) AM_READ_PORT("DSW1")
AM_RANGE(0xa400, 0xa400) AM_READ_PORT("DSW2") AM_WRITE_LEGACY(amspdwy_flipscreen_w) // DSW 2 + Toggle Flip Screen?
- AM_RANGE(0xa800, 0xa800) AM_READ_LEGACY(amspdwy_wheel_0_r) // Player 1
- AM_RANGE(0xac00, 0xac00) AM_READ_LEGACY(amspdwy_wheel_1_r) // Player 2
+ AM_RANGE(0xa800, 0xa800) AM_READ(amspdwy_wheel_0_r) // Player 1
+ AM_RANGE(0xac00, 0xac00) AM_READ(amspdwy_wheel_1_r) // Player 2
AM_RANGE(0xb000, 0xb000) AM_WRITENOP // ? Exiting IRQ
- AM_RANGE(0xb400, 0xb400) AM_DEVREAD_LEGACY("ymsnd", amspdwy_sound_r) AM_WRITE_LEGACY(amspdwy_sound_w) // YM2151 status, To Sound CPU
+ AM_RANGE(0xb400, 0xb400) AM_DEVREAD_LEGACY("ymsnd", amspdwy_sound_r) AM_WRITE(amspdwy_sound_w) // YM2151 status, To Sound CPU
AM_RANGE(0xc000, 0xc0ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size)// Sprites
AM_RANGE(0xe000, 0xe7ff) AM_RAM // Work RAM
ADDRESS_MAP_END
-static READ8_HANDLER( amspdwy_port_r )
+READ8_MEMBER(amspdwy_state::amspdwy_port_r)
{
- UINT8 *tracks = space->machine().region("maincpu")->base() + 0x10000;
+ UINT8 *tracks = machine().region("maincpu")->base() + 0x10000;
return tracks[offset];
}
static ADDRESS_MAP_START( amspdwy_portmap, AS_IO, 8, amspdwy_state )
- AM_RANGE(0x0000, 0x7fff) AM_READ_LEGACY(amspdwy_port_r)
+ AM_RANGE(0x0000, 0x7fff) AM_READ(amspdwy_port_r)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/angelkds.c b/src/mame/drivers/angelkds.c
index 760f4bcb8c3..9f6069f89c0 100644
--- a/src/mame/drivers/angelkds.c
+++ b/src/mame/drivers/angelkds.c
@@ -129,18 +129,18 @@ Dumped by Chackn
#include "sound/2203intf.h"
#include "includes/angelkds.h"
-static READ8_HANDLER( angelkds_main_sound_r );
-static WRITE8_HANDLER( angelkds_main_sound_w );
-static READ8_HANDLER( angelkds_sub_sound_r );
-static WRITE8_HANDLER( angelkds_sub_sound_w );
+
+
+
+
/*** CPU Banking
*/
-static WRITE8_HANDLER( angelkds_cpu_bank_write )
+WRITE8_MEMBER(angelkds_state::angelkds_cpu_bank_write)
{
- memory_set_bank(space->machine(), "bank1", data & 0x0f); // shall we check (data & 0x0f) < # of available banks (8 or 10 resp.)?
+ memory_set_bank(machine(), "bank1", data & 0x0f); // shall we check (data & 0x0f) < # of available banks (8 or 10 resp.)?
}
@@ -154,24 +154,24 @@ these make the game a bit easier for testing purposes
#if FAKEINPUTS
-static READ8_HANDLER( angelkds_input_r )
+READ8_MEMBER(angelkds_state::angelkds_input_r)
{
int fake;
static const char *const portnames[] = { "I81", "I82" };
static const char *const fakenames[] = { "FAKE1", "FAKE2" };
- fake = input_port_read(space->machine(), fakenames[offset]);
+ fake = input_port_read(machine(), fakenames[offset]);
- return ((fake & 0x01) ? fake : input_port_read(space->machine(), portnames[offset]));
+ return ((fake & 0x01) ? fake : input_port_read(machine(), portnames[offset]));
}
#else
-static READ8_HANDLER( angelkds_input_r )
+READ8_MEMBER(angelkds_state::angelkds_input_r)
{
static const char *const portnames[] = { "I81", "I82" };
- return input_port_read(space->machine(), portnames[offset]);
+ return input_port_read(machine(), portnames[offset]);
}
#endif
@@ -213,15 +213,15 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( main_portmap, AS_IO, 8, angelkds_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITENOP // 00 on start-up, not again
- AM_RANGE(0x42, 0x42) AM_WRITE_LEGACY(angelkds_cpu_bank_write)
+ AM_RANGE(0x42, 0x42) AM_WRITE(angelkds_cpu_bank_write)
AM_RANGE(0x43, 0x43) AM_WRITENOP // 9a on start-up, not again
AM_RANGE(0x40, 0x40) AM_READ_PORT("I40") /* "Coinage" Dip Switches */
AM_RANGE(0x41, 0x41) AM_READ_PORT("I41") /* Other Dip Switches */
AM_RANGE(0x42, 0x42) AM_READ_PORT("I42") /* Players inputs (not needed ?) */
AM_RANGE(0x80, 0x80) AM_READ_PORT("I80") /* System inputs */
- AM_RANGE(0x81, 0x82) AM_READ_LEGACY(angelkds_input_r) /* Players inputs */
+ AM_RANGE(0x81, 0x82) AM_READ(angelkds_input_r) /* Players inputs */
AM_RANGE(0x83, 0x83) AM_WRITENOP // 9b on start-up, not again
- AM_RANGE(0xc0, 0xc3) AM_READWRITE_LEGACY(angelkds_main_sound_r, angelkds_main_sound_w) // 02 various points
+ AM_RANGE(0xc0, 0xc3) AM_READWRITE(angelkds_main_sound_r, angelkds_main_sound_w) // 02 various points
ADDRESS_MAP_END
/* sub cpu */
@@ -238,7 +238,7 @@ static ADDRESS_MAP_START( sub_portmap, AS_IO, 8, angelkds_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w)
AM_RANGE(0x40, 0x41) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r, ym2203_w)
- AM_RANGE(0x80, 0x83) AM_READWRITE_LEGACY(angelkds_sub_sound_r, angelkds_sub_sound_w) // spcpostn
+ AM_RANGE(0x80, 0x83) AM_READWRITE(angelkds_sub_sound_r, angelkds_sub_sound_w) // spcpostn
ADDRESS_MAP_END
@@ -486,28 +486,24 @@ sound related ?
*/
-static WRITE8_HANDLER( angelkds_main_sound_w )
+WRITE8_MEMBER(angelkds_state::angelkds_main_sound_w)
{
- angelkds_state *state = space->machine().driver_data<angelkds_state>();
- state->m_sound[offset] = data;
+ m_sound[offset] = data;
}
-static READ8_HANDLER( angelkds_main_sound_r )
+READ8_MEMBER(angelkds_state::angelkds_main_sound_r)
{
- angelkds_state *state = space->machine().driver_data<angelkds_state>();
- return state->m_sound2[offset];
+ return m_sound2[offset];
}
-static WRITE8_HANDLER( angelkds_sub_sound_w )
+WRITE8_MEMBER(angelkds_state::angelkds_sub_sound_w)
{
- angelkds_state *state = space->machine().driver_data<angelkds_state>();
- state->m_sound2[offset] = data;
+ m_sound2[offset] = data;
}
-static READ8_HANDLER( angelkds_sub_sound_r )
+READ8_MEMBER(angelkds_state::angelkds_sub_sound_r)
{
- angelkds_state *state = space->machine().driver_data<angelkds_state>();
- return state->m_sound[offset];
+ return m_sound[offset];
}
diff --git a/src/mame/drivers/appoooh.c b/src/mame/drivers/appoooh.c
index 4810bf4fc0f..20178f6692d 100644
--- a/src/mame/drivers/appoooh.c
+++ b/src/mame/drivers/appoooh.c
@@ -197,13 +197,12 @@ static void appoooh_adpcm_int(device_t *device)
}
/* adpcm address write */
-static WRITE8_HANDLER( appoooh_adpcm_w )
+WRITE8_MEMBER(appoooh_state::appoooh_adpcm_w)
{
- appoooh_state *state = space->machine().driver_data<appoooh_state>();
- state->m_adpcm_address = data << 8;
- msm5205_reset_w(state->m_adpcm, 0);
- state->m_adpcm_data = 0xffffffff;
+ m_adpcm_address = data << 8;
+ msm5205_reset_w(m_adpcm, 0);
+ m_adpcm_data = 0xffffffff;
}
@@ -234,7 +233,7 @@ static ADDRESS_MAP_START( main_portmap, AS_IO, 8, appoooh_state )
AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_DEVWRITE_LEGACY("sn1", sn76496_w)
AM_RANGE(0x01, 0x01) AM_READ_PORT("P2") AM_DEVWRITE_LEGACY("sn2", sn76496_w)
AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("sn3", sn76496_w)
- AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1") AM_WRITE_LEGACY(appoooh_adpcm_w)
+ AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1") AM_WRITE(appoooh_adpcm_w)
AM_RANGE(0x04, 0x04) AM_READ_PORT("BUTTON3") AM_WRITE_LEGACY(appoooh_out_w)
AM_RANGE(0x05, 0x05) AM_WRITE_LEGACY(appoooh_scroll_w) /* unknown */
ADDRESS_MAP_END
diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c
index 94123678fa8..321f843f225 100644
--- a/src/mame/drivers/aquarium.c
+++ b/src/mame/drivers/aquarium.c
@@ -42,36 +42,33 @@ Notes:
#include "includes/aquarium.h"
-static READ16_HANDLER( aquarium_coins_r )
+READ16_MEMBER(aquarium_state::aquarium_coins_r)
{
- aquarium_state *state = space->machine().driver_data<aquarium_state>();
int data;
- data = (input_port_read(space->machine(), "SYSTEM") & 0x7fff);
- data |= state->m_aquarium_snd_ack;
- state->m_aquarium_snd_ack = 0;
+ data = (input_port_read(machine(), "SYSTEM") & 0x7fff);
+ data |= m_aquarium_snd_ack;
+ m_aquarium_snd_ack = 0;
return data;
}
-static WRITE8_HANDLER( aquarium_snd_ack_w )
+WRITE8_MEMBER(aquarium_state::aquarium_snd_ack_w)
{
- aquarium_state *state = space->machine().driver_data<aquarium_state>();
- state->m_aquarium_snd_ack = 0x8000;
+ m_aquarium_snd_ack = 0x8000;
}
-static WRITE16_HANDLER( aquarium_sound_w )
+WRITE16_MEMBER(aquarium_state::aquarium_sound_w)
{
// popmessage("sound write %04x",data);
- aquarium_state *state = space->machine().driver_data<aquarium_state>();
soundlatch_w(space, 1, data & 0xff);
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE );
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE );
}
-static WRITE8_HANDLER( aquarium_z80_bank_w )
+WRITE8_MEMBER(aquarium_state::aquarium_z80_bank_w)
{
- memory_set_bank(space->machine(), "bank1", data & 0x07);
+ memory_set_bank(machine(), "bank1", data & 0x07);
}
static UINT8 aquarium_snd_bitswap( UINT8 scrambled_data )
@@ -90,17 +87,17 @@ static UINT8 aquarium_snd_bitswap( UINT8 scrambled_data )
return data;
}
-static READ8_HANDLER( aquarium_oki_r )
+READ8_MEMBER(aquarium_state::aquarium_oki_r)
{
- okim6295_device *oki = space->machine().device<okim6295_device>("oki");
- return aquarium_snd_bitswap(oki->read(*space, offset));
+ okim6295_device *oki = machine().device<okim6295_device>("oki");
+ return aquarium_snd_bitswap(oki->read(*&space, offset));
}
-static WRITE8_HANDLER( aquarium_oki_w )
+WRITE8_MEMBER(aquarium_state::aquarium_oki_w)
{
- logerror("%s:Writing %04x to the OKI M6295\n", space->machine().describe_context(), aquarium_snd_bitswap(data));
- okim6295_device *oki = space->machine().device<okim6295_device>("oki");
- oki->write(*space, offset, (aquarium_snd_bitswap(data)));
+ logerror("%s:Writing %04x to the OKI M6295\n", machine().describe_context(), aquarium_snd_bitswap(data));
+ okim6295_device *oki = machine().device<okim6295_device>("oki");
+ oki->write(*&space, offset, (aquarium_snd_bitswap(data)));
}
@@ -118,9 +115,9 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, aquarium_state )
AM_RANGE(0xd80080, 0xd80081) AM_READ_PORT("DSW")
AM_RANGE(0xd80082, 0xd80083) AM_READNOP /* stored but not read back ? check code at 0x01f440 */
AM_RANGE(0xd80084, 0xd80085) AM_READ_PORT("INPUTS")
- AM_RANGE(0xd80086, 0xd80087) AM_READ_LEGACY(aquarium_coins_r)
+ AM_RANGE(0xd80086, 0xd80087) AM_READ(aquarium_coins_r)
AM_RANGE(0xd80088, 0xd80089) AM_WRITENOP /* ?? video related */
- AM_RANGE(0xd8008a, 0xd8008b) AM_WRITE_LEGACY(aquarium_sound_w)
+ AM_RANGE(0xd8008a, 0xd8008b) AM_WRITE(aquarium_sound_w)
AM_RANGE(0xff0000, 0xffffff) AM_RAM
ADDRESS_MAP_END
@@ -133,10 +130,10 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( snd_portmap, AS_IO, 8, aquarium_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
- AM_RANGE(0x02, 0x02) AM_READWRITE_LEGACY(aquarium_oki_r, aquarium_oki_w)
+ AM_RANGE(0x02, 0x02) AM_READWRITE(aquarium_oki_r, aquarium_oki_w)
AM_RANGE(0x04, 0x04) AM_READ_LEGACY(soundlatch_r)
- AM_RANGE(0x06, 0x06) AM_WRITE_LEGACY(aquarium_snd_ack_w)
- AM_RANGE(0x08, 0x08) AM_WRITE_LEGACY(aquarium_z80_bank_w)
+ AM_RANGE(0x06, 0x06) AM_WRITE(aquarium_snd_ack_w)
+ AM_RANGE(0x08, 0x08) AM_WRITE(aquarium_z80_bank_w)
ADDRESS_MAP_END
static INPUT_PORTS_START( aquarium )
diff --git a/src/mame/drivers/arabian.c b/src/mame/drivers/arabian.c
index b4044ff7b9e..41b94c5cac3 100644
--- a/src/mame/drivers/arabian.c
+++ b/src/mame/drivers/arabian.c
@@ -98,11 +98,10 @@ static WRITE8_DEVICE_HANDLER( ay8910_portb_w )
*
*************************************/
-static READ8_HANDLER( mcu_port_r_r )
+READ8_MEMBER(arabian_state::mcu_port_r_r)
{
- arabian_state *state = space->machine().driver_data<arabian_state>();
- UINT8 val = state->m_mcu_port_r[offset];
+ UINT8 val = m_mcu_port_r[offset];
/* RAM mode is enabled */
if (offset == 0)
@@ -111,44 +110,42 @@ static READ8_HANDLER( mcu_port_r_r )
return val;
}
-static WRITE8_HANDLER( mcu_port_r_w )
+WRITE8_MEMBER(arabian_state::mcu_port_r_w)
{
- arabian_state *state = space->machine().driver_data<arabian_state>();
if (offset == 0)
{
- UINT32 ram_addr = ((state->m_mcu_port_p & 7) << 8) | state->m_mcu_port_o;
+ UINT32 ram_addr = ((m_mcu_port_p & 7) << 8) | m_mcu_port_o;
if (~data & 2)
- state->m_custom_cpu_ram[ram_addr] = 0xf0 | state->m_mcu_port_r[3];
+ m_custom_cpu_ram[ram_addr] = 0xf0 | m_mcu_port_r[3];
- state->m_flip_screen = data & 8;
+ m_flip_screen = data & 8;
}
- state->m_mcu_port_r[offset] = data & 0x0f;
+ m_mcu_port_r[offset] = data & 0x0f;
}
-static READ8_HANDLER( mcu_portk_r )
+READ8_MEMBER(arabian_state::mcu_portk_r)
{
- arabian_state *state = space->machine().driver_data<arabian_state>();
UINT8 val = 0xf;
- if (~state->m_mcu_port_r[0] & 1)
+ if (~m_mcu_port_r[0] & 1)
{
- UINT32 ram_addr = ((state->m_mcu_port_p & 7) << 8) | state->m_mcu_port_o;
- val = state->m_custom_cpu_ram[ram_addr];
+ UINT32 ram_addr = ((m_mcu_port_p & 7) << 8) | m_mcu_port_o;
+ val = m_custom_cpu_ram[ram_addr];
}
else
{
static const char *const comnames[] = { "COM0", "COM1", "COM2", "COM3", "COM4", "COM5" };
- UINT8 sel = ((state->m_mcu_port_r[2] << 4) | state->m_mcu_port_r[1]) & 0x3f;
+ UINT8 sel = ((m_mcu_port_r[2] << 4) | m_mcu_port_r[1]) & 0x3f;
int i;
for (i = 0; i < 6; ++i)
{
if (~sel & (1 << i))
{
- val = input_port_read(space->machine(), comnames[i]);
+ val = input_port_read(machine(), comnames[i]);
break;
}
}
@@ -157,21 +154,19 @@ static READ8_HANDLER( mcu_portk_r )
return val & 0x0f;
}
-static WRITE8_HANDLER( mcu_port_o_w )
+WRITE8_MEMBER(arabian_state::mcu_port_o_w)
{
- arabian_state *state = space->machine().driver_data<arabian_state>();
UINT8 out = data & 0x0f;
if (data & 0x10)
- state->m_mcu_port_o = (state->m_mcu_port_o & 0x0f) | (out << 4);
+ m_mcu_port_o = (m_mcu_port_o & 0x0f) | (out << 4);
else
- state->m_mcu_port_o = (state->m_mcu_port_o & 0xf0) | out;
+ m_mcu_port_o = (m_mcu_port_o & 0xf0) | out;
}
-static WRITE8_HANDLER( mcu_port_p_w )
+WRITE8_MEMBER(arabian_state::mcu_port_p_w)
{
- arabian_state *state = space->machine().driver_data<arabian_state>();
- state->m_mcu_port_p = data & 0x0f;
+ m_mcu_port_p = data & 0x0f;
}
@@ -213,10 +208,10 @@ ADDRESS_MAP_END
*************************************/
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, arabian_state )
- AM_RANGE(MB88_PORTK, MB88_PORTK ) AM_READ_LEGACY(mcu_portk_r)
- AM_RANGE(MB88_PORTO, MB88_PORTO ) AM_WRITE_LEGACY(mcu_port_o_w)
- AM_RANGE(MB88_PORTP, MB88_PORTP ) AM_WRITE_LEGACY(mcu_port_p_w)
- AM_RANGE(MB88_PORTR0, MB88_PORTR3) AM_READWRITE_LEGACY(mcu_port_r_r, mcu_port_r_w)
+ AM_RANGE(MB88_PORTK, MB88_PORTK ) AM_READ(mcu_portk_r)
+ AM_RANGE(MB88_PORTO, MB88_PORTO ) AM_WRITE(mcu_port_o_w)
+ AM_RANGE(MB88_PORTP, MB88_PORTP ) AM_WRITE(mcu_port_p_w)
+ AM_RANGE(MB88_PORTR0, MB88_PORTR3) AM_READWRITE(mcu_port_r_r, mcu_port_r_w)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/argus.c b/src/mame/drivers/argus.c
index 85174e5d671..4f74a463404 100644
--- a/src/mame/drivers/argus.c
+++ b/src/mame/drivers/argus.c
@@ -174,13 +174,13 @@ static const ym2203_interface ym2203_config =
***************************************************************************/
-static WRITE8_HANDLER( argus_bankselect_w )
+WRITE8_MEMBER(argus_state::argus_bankselect_w)
{
- UINT8 *RAM = space->machine().region("maincpu")->base();
+ UINT8 *RAM = machine().region("maincpu")->base();
int bankaddress;
bankaddress = 0x10000 + ((data & 7) * 0x4000);
- memory_set_bankptr(space->machine(), "bank1", &RAM[bankaddress]); /* Select 8 banks of 16k */
+ memory_set_bankptr(machine(), "bank1", &RAM[bankaddress]); /* Select 8 banks of 16k */
}
@@ -200,7 +200,7 @@ static ADDRESS_MAP_START( argus_map, AS_PROGRAM, 8, argus_state )
AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2")
AM_RANGE(0xc200, 0xc200) AM_WRITE_LEGACY(soundlatch_w)
AM_RANGE(0xc201, 0xc201) AM_WRITE_LEGACY(argus_flipscreen_w)
- AM_RANGE(0xc202, 0xc202) AM_WRITE_LEGACY(argus_bankselect_w)
+ AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w)
AM_RANGE(0xc300, 0xc301) AM_RAM AM_BASE(m_bg0_scrollx)
AM_RANGE(0xc302, 0xc303) AM_RAM AM_BASE(m_bg0_scrolly)
AM_RANGE(0xc308, 0xc309) AM_RAM AM_BASE(m_bg1_scrollx)
@@ -224,7 +224,7 @@ static ADDRESS_MAP_START( valtric_map, AS_PROGRAM, 8, argus_state )
AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2")
AM_RANGE(0xc200, 0xc200) AM_WRITE_LEGACY(soundlatch_w)
AM_RANGE(0xc201, 0xc201) AM_WRITE_LEGACY(argus_flipscreen_w)
- AM_RANGE(0xc202, 0xc202) AM_WRITE_LEGACY(argus_bankselect_w)
+ AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w)
AM_RANGE(0xc300, 0xc300) AM_WRITE_LEGACY(valtric_unknown_w)
AM_RANGE(0xc308, 0xc309) AM_RAM AM_BASE(m_bg1_scrollx)
AM_RANGE(0xc30a, 0xc30b) AM_RAM AM_BASE(m_bg1_scrolly)
@@ -249,7 +249,7 @@ static ADDRESS_MAP_START( butasan_map, AS_PROGRAM, 8, argus_state )
AM_RANGE(0xc100, 0xc100) AM_WRITE_LEGACY(butasan_unknown_w)
AM_RANGE(0xc200, 0xc200) AM_WRITE_LEGACY(soundlatch_w)
AM_RANGE(0xc201, 0xc201) AM_WRITE_LEGACY(argus_flipscreen_w)
- AM_RANGE(0xc202, 0xc202) AM_WRITE_LEGACY(argus_bankselect_w)
+ AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w)
AM_RANGE(0xc203, 0xc203) AM_WRITE_LEGACY(butasan_pageselect_w)
AM_RANGE(0xc300, 0xc301) AM_RAM AM_BASE(m_bg0_scrollx)
AM_RANGE(0xc302, 0xc303) AM_RAM AM_BASE(m_bg0_scrolly)
diff --git a/src/mame/drivers/armedf.c b/src/mame/drivers/armedf.c
index 65669c1f9d9..6ef2d017c15 100644
--- a/src/mame/drivers/armedf.c
+++ b/src/mame/drivers/armedf.c
@@ -313,74 +313,71 @@ Notes:
---- ---- ---- ---x coin counter 0
*/
-static WRITE16_HANDLER( terraf_io_w )
+WRITE16_MEMBER(armedf_state::terraf_io_w)
{
- armedf_state *state = space->machine().driver_data<armedf_state>();
- if(data & 0x4000 && ((state->m_vreg & 0x4000) == 0)) //0 -> 1 transition
- nb_1414m4_exec(space,(state->m_text_videoram[0] << 8) | (state->m_text_videoram[1] & 0xff),state->m_text_videoram,state->m_fg_scrollx,state->m_fg_scrolly,state->m_tx_tilemap);
+ if(data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition
+ nb_1414m4_exec(&space,(m_text_videoram[0] << 8) | (m_text_videoram[1] & 0xff),m_text_videoram,m_fg_scrollx,m_fg_scrolly,m_tx_tilemap);
- COMBINE_DATA(&state->m_vreg);
+ COMBINE_DATA(&m_vreg);
- coin_counter_w(space->machine(), 0, (data & 1) >> 0);
- coin_counter_w(space->machine(), 1, (data & 2) >> 1);
+ coin_counter_w(machine(), 0, (data & 1) >> 0);
+ coin_counter_w(machine(), 1, (data & 2) >> 1);
- flip_screen_set(space->machine(), state->m_vreg & 0x1000);
+ flip_screen_set(machine(), m_vreg & 0x1000);
}
-static WRITE16_HANDLER( terrafb_io_w )
+WRITE16_MEMBER(armedf_state::terrafb_io_w)
{
- armedf_state *state = space->machine().driver_data<armedf_state>();
- if(data & 0x4000 && ((state->m_vreg & 0x4000) == 0)) //0 -> 1 transition
- cputag_set_input_line(space->machine(), "extra", 0, HOLD_LINE);
+ if(data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition
+ cputag_set_input_line(machine(), "extra", 0, HOLD_LINE);
- COMBINE_DATA(&state->m_vreg);
+ COMBINE_DATA(&m_vreg);
- coin_counter_w(space->machine(), 0, (data & 1) >> 0);
- coin_counter_w(space->machine(), 1, (data & 2) >> 1);
+ coin_counter_w(machine(), 0, (data & 1) >> 0);
+ coin_counter_w(machine(), 1, (data & 2) >> 1);
- flip_screen_set(space->machine(), state->m_vreg & 0x1000);
+ flip_screen_set(machine(), m_vreg & 0x1000);
}
-static WRITE16_HANDLER( bootleg_io_w )
+WRITE16_MEMBER(armedf_state::bootleg_io_w)
{
- armedf_state *state = space->machine().driver_data<armedf_state>();
- if(data & 0x4000 && ((state->m_vreg & 0x4000) == 0)) //0 -> 1 transition
+ if(data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition
{
// NOP
}
- COMBINE_DATA(&state->m_vreg);
+ COMBINE_DATA(&m_vreg);
- coin_counter_w(space->machine(), 0, (data & 1) >> 0);
- coin_counter_w(space->machine(), 1, (data & 2) >> 1);
+ coin_counter_w(machine(), 0, (data & 1) >> 0);
+ coin_counter_w(machine(), 1, (data & 2) >> 1);
- flip_screen_set(space->machine(), state->m_vreg & 0x1000);
+ flip_screen_set(machine(), m_vreg & 0x1000);
}
-static WRITE16_HANDLER( sound_command_w )
+WRITE16_MEMBER(armedf_state::sound_command_w)
{
if (ACCESSING_BITS_0_7)
soundlatch_w(space, 0, ((data & 0x7f) << 1) | 1);
}
-static READ8_HANDLER( soundlatch_clear_r )
+READ8_MEMBER(armedf_state::soundlatch_clear_r)
{
soundlatch_clear_w(space, 0, 0);
return 0;
}
-static WRITE16_HANDLER( irq_lv1_ack_w )
+WRITE16_MEMBER(armedf_state::irq_lv1_ack_w)
{
- cputag_set_input_line(space->machine(), "maincpu", 1, CLEAR_LINE);
+ cputag_set_input_line(machine(), "maincpu", 1, CLEAR_LINE);
}
-static WRITE16_HANDLER( irq_lv2_ack_w )
+WRITE16_MEMBER(armedf_state::irq_lv2_ack_w)
{
- cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE);
+ cputag_set_input_line(machine(), "maincpu", 2, CLEAR_LINE);
}
@@ -405,12 +402,12 @@ static ADDRESS_MAP_START( terraf_map, AS_PROGRAM, 16, armedf_state )
AM_RANGE(0x078002, 0x078003) AM_READ_PORT("P2")
AM_RANGE(0x078004, 0x078005) AM_READ_PORT("DSW1")
AM_RANGE(0x078006, 0x078007) AM_READ_PORT("DSW2")
-// AM_RANGE(0x07c000, 0x07c001) AM_WRITE_LEGACY(terraf_io_w) handled in DRIVER_INIT
+// AM_RANGE(0x07c000, 0x07c001) AM_WRITE(terraf_io_w) handled in DRIVER_INIT
AM_RANGE(0x07c002, 0x07c003) AM_WRITE_LEGACY(armedf_bg_scrollx_w)
AM_RANGE(0x07c004, 0x07c005) AM_WRITE_LEGACY(armedf_bg_scrolly_w)
- AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE_LEGACY(sound_command_w)
+ AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w)
AM_RANGE(0x07c00c, 0x07c00d) AM_WRITENOP /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */
- AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE_LEGACY(irq_lv1_ack_w)
+ AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(irq_lv1_ack_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( kozure_map, AS_PROGRAM, 16, armedf_state )
@@ -439,9 +436,9 @@ static ADDRESS_MAP_START( cclimbr2_map, AS_PROGRAM, 16, armedf_state )
// AM_RANGE(0x07c000, 0x07c001) AM_WRITE_LEGACY(io_w)
AM_RANGE(0x07c002, 0x07c003) AM_WRITE_LEGACY(armedf_bg_scrollx_w)
AM_RANGE(0x07c004, 0x07c005) AM_WRITE_LEGACY(armedf_bg_scrolly_w)
- AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE_LEGACY(sound_command_w)
+ AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w)
AM_RANGE(0x07c00c, 0x07c00d) AM_WRITENOP /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */
- AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE_LEGACY(irq_lv2_ack_w)
+ AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(irq_lv2_ack_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( legion_map, AS_PROGRAM, 16, armedf_state )
@@ -461,24 +458,23 @@ static ADDRESS_MAP_START( legion_map, AS_PROGRAM, 16, armedf_state )
// AM_RANGE(0x07c000, 0x07c001) AM_WRITE_LEGACY(legion_io_w)
AM_RANGE(0x07c002, 0x07c003) AM_WRITE_LEGACY(armedf_bg_scrollx_w)
AM_RANGE(0x07c004, 0x07c005) AM_WRITE_LEGACY(armedf_bg_scrolly_w)
- AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE_LEGACY(sound_command_w)
+ AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w)
AM_RANGE(0x07c00c, 0x07c00d) AM_WRITENOP /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */
- AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE_LEGACY(irq_lv2_ack_w)
+ AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(irq_lv2_ack_w)
ADDRESS_MAP_END
-static WRITE8_HANDLER( legiono_fg_scroll_w )
+WRITE8_MEMBER(armedf_state::legiono_fg_scroll_w)
{
- armedf_state *state = space->machine().driver_data<armedf_state>();
if(offset >= 0xb && offset < 0xf)
- state->m_legion_cmd[offset-0xb] = data & 0xff;
+ m_legion_cmd[offset-0xb] = data & 0xff;
- state->m_fg_scrollx = (state->m_legion_cmd[0x02] & 0xff) | ((state->m_legion_cmd[0x03] & 0x3) << 8);
- state->m_fg_scrolly = (state->m_legion_cmd[0x00] & 0xff) | ((state->m_legion_cmd[0x01] & 0x3) << 8);
+ m_fg_scrollx = (m_legion_cmd[0x02] & 0xff) | ((m_legion_cmd[0x03] & 0x3) << 8);
+ m_fg_scrolly = (m_legion_cmd[0x00] & 0xff) | ((m_legion_cmd[0x01] & 0x3) << 8);
}
static ADDRESS_MAP_START( legiono_map, AS_PROGRAM, 16, armedf_state )
- AM_RANGE(0x040000, 0x04003f) AM_WRITE8_LEGACY(legiono_fg_scroll_w,0x00ff)
+ AM_RANGE(0x040000, 0x04003f) AM_WRITE8(legiono_fg_scroll_w,0x00ff)
AM_RANGE(0x000000, 0x05ffff) AM_ROM
AM_RANGE(0x060000, 0x060fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x061000, 0x063fff) AM_RAM
@@ -492,12 +488,12 @@ static ADDRESS_MAP_START( legiono_map, AS_PROGRAM, 16, armedf_state )
AM_RANGE(0x078002, 0x078003) AM_READ_PORT("P2")
AM_RANGE(0x078004, 0x078005) AM_READ_PORT("DSW1")
AM_RANGE(0x078006, 0x078007) AM_READ_PORT("DSW2")
-// AM_RANGE(0x07c000, 0x07c001) AM_WRITE_LEGACY(bootleg_io_w)
+// AM_RANGE(0x07c000, 0x07c001) AM_WRITE(bootleg_io_w)
AM_RANGE(0x07c002, 0x07c003) AM_WRITE_LEGACY(armedf_bg_scrollx_w)
AM_RANGE(0x07c004, 0x07c005) AM_WRITE_LEGACY(armedf_bg_scrolly_w)
- AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE_LEGACY(sound_command_w)
+ AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w)
AM_RANGE(0x07c00c, 0x07c00d) AM_WRITENOP /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */
- AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE_LEGACY(irq_lv2_ack_w)
+ AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(irq_lv2_ack_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( armedf_map, AS_PROGRAM, 16, armedf_state )
@@ -514,90 +510,87 @@ static ADDRESS_MAP_START( armedf_map, AS_PROGRAM, 16, armedf_state )
AM_RANGE(0x06c004, 0x06c005) AM_READ_PORT("DSW1")
AM_RANGE(0x06c006, 0x06c007) AM_READ_PORT("DSW2")
AM_RANGE(0x06c000, 0x06c7ff) AM_RAM
- AM_RANGE(0x06d000, 0x06d001) AM_WRITE_LEGACY(terraf_io_w)
+ AM_RANGE(0x06d000, 0x06d001) AM_WRITE(terraf_io_w)
AM_RANGE(0x06d002, 0x06d003) AM_WRITE_LEGACY(armedf_bg_scrollx_w)
AM_RANGE(0x06d004, 0x06d005) AM_WRITE_LEGACY(armedf_bg_scrolly_w)
AM_RANGE(0x06d006, 0x06d007) AM_WRITE_LEGACY(armedf_fg_scrollx_w)
AM_RANGE(0x06d008, 0x06d009) AM_WRITE_LEGACY(armedf_fg_scrolly_w)
- AM_RANGE(0x06d00a, 0x06d00b) AM_WRITE_LEGACY(sound_command_w)
+ AM_RANGE(0x06d00a, 0x06d00b) AM_WRITE(sound_command_w)
AM_RANGE(0x06d00c, 0x06d00d) AM_WRITENOP //watchdog
- AM_RANGE(0x06d00e, 0x06d00f) AM_WRITE_LEGACY(irq_lv1_ack_w)
+ AM_RANGE(0x06d00e, 0x06d00f) AM_WRITE(irq_lv1_ack_w)
ADDRESS_MAP_END
-static READ16_HANDLER( latch_r )
+READ16_MEMBER(bigfghtr_state::latch_r)
{
- bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
- state->m_read_latch = 1;
+ m_read_latch = 1;
return 0;
}
-static WRITE16_HANDLER( sharedram_w )
+WRITE16_MEMBER(bigfghtr_state::sharedram_w)
{
- bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
- COMBINE_DATA(&state->m_sharedram[offset]);
+ COMBINE_DATA(&m_sharedram[offset]);
switch(offset)
{
case 0x40/2:
- state->m_mcu_input_snippet = (data == 0x100);
- state->m_mcu_jsr_snippet = (data == 0x300);
+ m_mcu_input_snippet = (data == 0x100);
+ m_mcu_jsr_snippet = (data == 0x300);
break;
}
}
-static READ16_HANDLER(sharedram_r)
+READ16_MEMBER(bigfghtr_state::sharedram_r)
{
- bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
- if(state->m_mcu_input_snippet)
+ if(m_mcu_input_snippet)
{
switch(offset+0x600/2)
{
case 0x640/2:
- if(state->m_read_latch)
+ if(m_read_latch)
{
- state->m_read_latch = 0;
- return space->machine().rand(); // TODO
+ m_read_latch = 0;
+ return machine().rand(); // TODO
}
break;
case 0x642/2:
- return (input_port_read(space->machine(), "DSW0") & 0xffff) ^ 0xffff;
+ return (input_port_read(machine(), "DSW0") & 0xffff) ^ 0xffff;
case 0x644/2:
- return (input_port_read(space->machine(), "DSW1") & 0xffff) ^ 0xffff;
+ return (input_port_read(machine(), "DSW1") & 0xffff) ^ 0xffff;
case 0x646/2:
- return (input_port_read(space->machine(), "P1") & 0xffff) ^ 0xffff;
+ return (input_port_read(machine(), "P1") & 0xffff) ^ 0xffff;
case 0x648/2:
- return (input_port_read(space->machine(), "P2") & 0xffff) ^ 0xffff;
+ return (input_port_read(machine(), "P2") & 0xffff) ^ 0xffff;
}
}
- if(state->m_mcu_jsr_snippet)
+ if(m_mcu_jsr_snippet)
{
switch(offset+0x600/2)
{
case 0x640/2:
- if(state->m_read_latch)
+ if(m_read_latch)
{
- state->m_read_latch = 0;
- return space->machine().rand(); // TODO
+ m_read_latch = 0;
+ return machine().rand(); // TODO
}
break;
case 0x642/2:
- return (input_port_read(space->machine(), "DSW0") & 0xffff) ^ 0xffff;
+ return (input_port_read(machine(), "DSW0") & 0xffff) ^ 0xffff;
case 0x644/2:
- return (input_port_read(space->machine(), "DSW1") & 0xffff) ^ 0xffff;
+ return (input_port_read(machine(), "DSW1") & 0xffff) ^ 0xffff;
case 0x646/2:
- return (input_port_read(space->machine(), "P1") & 0xffff) ^ 0xffff;
+ return (input_port_read(machine(), "P1") & 0xffff) ^ 0xffff;
case 0x648/2:
- return (input_port_read(space->machine(), "P2") & 0xffff) ^ 0xffff;
+ return (input_port_read(machine(), "P2") & 0xffff) ^ 0xffff;
/*
protection controls where the program code should jump to.
@@ -674,13 +667,13 @@ static READ16_HANDLER(sharedram_r)
}
}
- return state->m_sharedram[offset];
+ return m_sharedram[offset];
}
static ADDRESS_MAP_START( bigfghtr_map, AS_PROGRAM, 16, bigfghtr_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
AM_RANGE(0x080000, 0x0805ff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x080600, 0x083fff) AM_READWRITE_LEGACY(sharedram_r, sharedram_w) AM_BASE(m_sharedram)
+ AM_RANGE(0x080600, 0x083fff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(m_sharedram)
AM_RANGE(0x084000, 0x085fff) AM_RAM //work ram
AM_RANGE(0x086000, 0x086fff) AM_RAM_WRITE_LEGACY(armedf_bg_videoram_w) AM_BASE(m_bg_videoram)
AM_RANGE(0x087000, 0x087fff) AM_RAM_WRITE_LEGACY(armedf_fg_videoram_w) AM_BASE(m_fg_videoram)
@@ -691,16 +684,16 @@ static ADDRESS_MAP_START( bigfghtr_map, AS_PROGRAM, 16, bigfghtr_state )
AM_RANGE(0x08c002, 0x08c003) AM_READ_PORT("P2")
AM_RANGE(0x08c004, 0x08c005) AM_READ_PORT("DSW0")
AM_RANGE(0x08c006, 0x08c007) AM_READ_PORT("DSW1")
- AM_RANGE(0x08d000, 0x08d001) AM_WRITE_LEGACY(terraf_io_w) //807b0
+ AM_RANGE(0x08d000, 0x08d001) AM_WRITE(terraf_io_w) //807b0
AM_RANGE(0x08d002, 0x08d003) AM_WRITE_LEGACY(armedf_bg_scrollx_w)
AM_RANGE(0x08d004, 0x08d005) AM_WRITE_LEGACY(armedf_bg_scrolly_w)
AM_RANGE(0x08d006, 0x08d007) AM_WRITE_LEGACY(armedf_fg_scrollx_w)
AM_RANGE(0x08d008, 0x08d009) AM_WRITE_LEGACY(armedf_fg_scrolly_w)
- AM_RANGE(0x08d00a, 0x08d00b) AM_WRITE_LEGACY(sound_command_w)
+ AM_RANGE(0x08d00a, 0x08d00b) AM_WRITE(sound_command_w)
AM_RANGE(0x08d00c, 0x08d00d) AM_WRITENOP //watchdog
- AM_RANGE(0x08d00e, 0x08d00f) AM_WRITE_LEGACY(irq_lv1_ack_w)
+ AM_RANGE(0x08d00e, 0x08d00f) AM_WRITE(irq_lv1_ack_w)
- AM_RANGE(0x400000, 0x400001) AM_READ_LEGACY(latch_r)
+ AM_RANGE(0x400000, 0x400001) AM_READ(latch_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, armedf_state )
@@ -713,55 +706,50 @@ static ADDRESS_MAP_START( cclimbr2_soundmap, AS_PROGRAM, 8, armedf_state )
AM_RANGE(0xc000, 0xffff) AM_RAM
ADDRESS_MAP_END
-static READ8_HANDLER( blitter_txram_r )
+READ8_MEMBER(armedf_state::blitter_txram_r)
{
- armedf_state *state = space->machine().driver_data<armedf_state>();
- return state->m_text_videoram[offset] & 0xff;
+ return m_text_videoram[offset] & 0xff;
}
-static WRITE8_HANDLER( blitter_txram_w )
+WRITE8_MEMBER(armedf_state::blitter_txram_w)
{
- armedf_state *state = space->machine().driver_data<armedf_state>();
- state->m_text_videoram[offset] = (data & 0xff) | (state->m_text_videoram[offset] & 0xff00);
- state->m_tx_tilemap->mark_tile_dirty(offset);
+ m_text_videoram[offset] = (data & 0xff) | (m_text_videoram[offset] & 0xff00);
+ m_tx_tilemap->mark_tile_dirty(offset);
}
-static WRITE8_HANDLER( fg_scrollx_w )
+WRITE8_MEMBER(armedf_state::fg_scrollx_w)
{
- armedf_state *state = space->machine().driver_data<armedf_state>();
- state->m_fg_scrollx = (data & 0xff) | (state->m_fg_scrollx & 0x300);
+ m_fg_scrollx = (data & 0xff) | (m_fg_scrollx & 0x300);
}
-static WRITE8_HANDLER( fg_scrolly_w )
+WRITE8_MEMBER(armedf_state::fg_scrolly_w)
{
- armedf_state *state = space->machine().driver_data<armedf_state>();
- state->m_fg_scrolly = (data & 0xff) | (state->m_fg_scrolly & 0x300);
+ m_fg_scrolly = (data & 0xff) | (m_fg_scrolly & 0x300);
}
-static WRITE8_HANDLER( fg_scroll_msb_w )
+WRITE8_MEMBER(armedf_state::fg_scroll_msb_w)
{
- armedf_state *state = space->machine().driver_data<armedf_state>();
- state->m_fg_scrolly = (((data & 0x03) >> 0) << 8) | (state->m_fg_scrolly & 0xff);
- state->m_fg_scrollx = (((data & 0x0c) >> 2) << 8) | (state->m_fg_scrollx & 0xff);
+ m_fg_scrolly = (((data & 0x03) >> 0) << 8) | (m_fg_scrolly & 0xff);
+ m_fg_scrollx = (((data & 0x0c) >> 2) << 8) | (m_fg_scrollx & 0xff);
}
static ADDRESS_MAP_START( terrafb_extraz80_map, AS_PROGRAM, 8, armedf_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x4000, 0x5fff) AM_READWRITE_LEGACY(blitter_txram_r,blitter_txram_w)
+ AM_RANGE(0x4000, 0x5fff) AM_READWRITE(blitter_txram_r,blitter_txram_w)
AM_RANGE(0x8000, 0x87ff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( terrafb_extraz80_portmap, AS_IO, 8, armedf_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00,0x00) AM_WRITE_LEGACY(fg_scrollx_w)
- AM_RANGE(0x01,0x01) AM_WRITE_LEGACY(fg_scrolly_w)
- AM_RANGE(0x02,0x02) AM_WRITE_LEGACY(fg_scroll_msb_w)
+ AM_RANGE(0x00,0x00) AM_WRITE(fg_scrollx_w)
+ AM_RANGE(0x01,0x01) AM_WRITE(fg_scrolly_w)
+ AM_RANGE(0x02,0x02) AM_WRITE(fg_scroll_msb_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, armedf_state )
@@ -769,7 +757,7 @@ static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, armedf_state )
AM_RANGE(0x0, 0x1) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w)
AM_RANGE(0x2, 0x2) AM_DEVWRITE_LEGACY("dac1", dac_signed_w)
AM_RANGE(0x3, 0x3) AM_DEVWRITE_LEGACY("dac2", dac_signed_w)
- AM_RANGE(0x4, 0x4) AM_READ_LEGACY(soundlatch_clear_r)
+ AM_RANGE(0x4, 0x4) AM_READ(soundlatch_clear_r)
AM_RANGE(0x6, 0x6) AM_READ_LEGACY(soundlatch_r)
ADDRESS_MAP_END
@@ -2053,7 +2041,7 @@ static DRIVER_INIT( terraf )
armedf_state *state = machine.driver_data<armedf_state>();
state->m_scroll_type = 0;
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(bootleg_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::bootleg_io_w),state));
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c006, 0x07c007, FUNC(terraf_fg_scrolly_w) );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c008, 0x07c009, FUNC(terraf_fg_scrollx_w) );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0c0001, FUNC(terraf_fg_scroll_msb_arm_w) );
@@ -2064,7 +2052,7 @@ static DRIVER_INIT( terrafu )
armedf_state *state = machine.driver_data<armedf_state>();
state->m_scroll_type = 0;
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(terraf_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::terraf_io_w),state));
}
static DRIVER_INIT( terrafb )
@@ -2072,7 +2060,7 @@ static DRIVER_INIT( terrafb )
armedf_state *state = machine.driver_data<armedf_state>();
state->m_scroll_type = 0;
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(terrafb_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::terrafb_io_w),state));
}
static DRIVER_INIT( armedf )
@@ -2087,7 +2075,7 @@ static DRIVER_INIT( kozure )
armedf_state *state = machine.driver_data<armedf_state>();
state->m_scroll_type = 0;
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(terraf_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::terraf_io_w),state));
}
@@ -2103,7 +2091,7 @@ static DRIVER_INIT( legion )
RAM[0x000488 / 2] = 0x4e71;
#endif
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(terraf_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::terraf_io_w),state));
state->m_scroll_type = 2;
}
@@ -2119,7 +2107,7 @@ static DRIVER_INIT( legiono )
/* No need to patch the checksum routine (see notes) ! */
#endif
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(bootleg_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::bootleg_io_w),state));
state->m_scroll_type = 2;
}
@@ -2128,7 +2116,7 @@ static DRIVER_INIT( cclimbr2 )
{
armedf_state *state = machine.driver_data<armedf_state>();
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07c000, 0x07c001, FUNC(terraf_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::terraf_io_w),state));
state->m_scroll_type = 3;
}
diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c
index 6d9a92f71e2..b229ac8a842 100644
--- a/src/mame/drivers/artmagic.c
+++ b/src/mame/drivers/artmagic.c
@@ -94,15 +94,15 @@ static MACHINE_RESET( artmagic )
*
*************************************/
-static READ16_HANDLER( tms_host_r )
+READ16_MEMBER(artmagic_state::tms_host_r)
{
- return tms34010_host_r(space->machine().device("tms"), offset);
+ return tms34010_host_r(machine().device("tms"), offset);
}
-static WRITE16_HANDLER( tms_host_w )
+WRITE16_MEMBER(artmagic_state::tms_host_w)
{
- tms34010_host_w(space->machine().device("tms"), offset, data);
+ tms34010_host_w(machine().device("tms"), offset, data);
}
@@ -113,19 +113,18 @@ static WRITE16_HANDLER( tms_host_w )
*
*************************************/
-static WRITE16_HANDLER( control_w )
+WRITE16_MEMBER(artmagic_state::control_w)
{
- artmagic_state *state = space->machine().driver_data<artmagic_state>();
- COMBINE_DATA(&state->m_control[offset]);
+ COMBINE_DATA(&m_control[offset]);
/* OKI banking here */
if (offset == 0)
{
- okim6295_device *oki = space->machine().device<okim6295_device>("oki");
+ okim6295_device *oki = machine().device<okim6295_device>("oki");
oki->set_bank_base((((data >> 4) & 1) * 0x40000) % oki->region()->bytes());
}
- logerror("%06X:control_w(%d) = %04X\n", cpu_get_pc(&space->device()), offset, data);
+ logerror("%06X:control_w(%d) = %04X\n", cpu_get_pc(&space.device()), offset, data);
}
@@ -143,18 +142,17 @@ static TIMER_CALLBACK( irq_off )
update_irq_state(machine);
}
-static READ16_HANDLER( ultennis_hack_r )
+READ16_MEMBER(artmagic_state::ultennis_hack_r)
{
- artmagic_state *state = space->machine().driver_data<artmagic_state>();
/* IRQ5 points to: jsr (a5); rte */
- UINT32 pc = cpu_get_pc(&space->device());
+ UINT32 pc = cpu_get_pc(&space.device());
if (pc == 0x18c2 || pc == 0x18e4)
{
- state->m_hack_irq = 1;
- update_irq_state(space->machine());
- space->machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
+ m_hack_irq = 1;
+ update_irq_state(machine());
+ machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
}
- return input_port_read(space->machine(), "300000");
+ return input_port_read(machine(), "300000");
}
@@ -392,27 +390,26 @@ static CUSTOM_INPUT( prot_r )
}
-static WRITE16_HANDLER( protection_bit_w )
+WRITE16_MEMBER(artmagic_state::protection_bit_w)
{
- artmagic_state *state = space->machine().driver_data<artmagic_state>();
/* shift in the new bit based on the offset */
- state->m_prot_input[state->m_prot_input_index] <<= 1;
- state->m_prot_input[state->m_prot_input_index] |= offset;
+ m_prot_input[m_prot_input_index] <<= 1;
+ m_prot_input[m_prot_input_index] |= offset;
/* clock out the next bit based on the offset */
- state->m_prot_output_bit = state->m_prot_output[state->m_prot_output_index] & 0x01;
- state->m_prot_output[state->m_prot_output_index] >>= 1;
+ m_prot_output_bit = m_prot_output[m_prot_output_index] & 0x01;
+ m_prot_output[m_prot_output_index] >>= 1;
/* are we done with a whole byte? */
- if (++state->m_prot_bit_index == 8)
+ if (++m_prot_bit_index == 8)
{
/* add the data and process it */
- state->m_prot_input_index++;
- state->m_prot_output_index++;
- state->m_prot_bit_index = 0;
+ m_prot_input_index++;
+ m_prot_output_index++;
+ m_prot_bit_index = 0;
/* update the protection state */
- (*state->m_protection_handler)(space->machine());
+ (*m_protection_handler)(machine());
}
}
@@ -434,10 +431,10 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, artmagic_state )
AM_RANGE(0x300006, 0x300007) AM_READ_PORT("300006")
AM_RANGE(0x300008, 0x300009) AM_READ_PORT("300008")
AM_RANGE(0x30000a, 0x30000b) AM_READ_PORT("30000a")
- AM_RANGE(0x300000, 0x300003) AM_WRITE_LEGACY(control_w) AM_BASE(m_control)
- AM_RANGE(0x300004, 0x300007) AM_WRITE_LEGACY(protection_bit_w)
+ AM_RANGE(0x300000, 0x300003) AM_WRITE(control_w) AM_BASE(m_control)
+ AM_RANGE(0x300004, 0x300007) AM_WRITE(protection_bit_w)
AM_RANGE(0x360000, 0x360001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
- AM_RANGE(0x380000, 0x380007) AM_READWRITE_LEGACY(tms_host_r, tms_host_w)
+ AM_RANGE(0x380000, 0x380007) AM_READWRITE(tms_host_r, tms_host_w)
ADDRESS_MAP_END
@@ -453,15 +450,15 @@ static ADDRESS_MAP_START( stonebal_map, AS_PROGRAM, 16, artmagic_state )
AM_RANGE(0x30000a, 0x30000b) AM_READ_PORT("30000a")
AM_RANGE(0x30000c, 0x30000d) AM_READ_PORT("30000c")
AM_RANGE(0x30000e, 0x30000f) AM_READ_PORT("30000e")
- AM_RANGE(0x300000, 0x300003) AM_WRITE_LEGACY(control_w) AM_BASE(m_control)
- AM_RANGE(0x300004, 0x300007) AM_WRITE_LEGACY(protection_bit_w)
+ AM_RANGE(0x300000, 0x300003) AM_WRITE(control_w) AM_BASE(m_control)
+ AM_RANGE(0x300004, 0x300007) AM_WRITE(protection_bit_w)
AM_RANGE(0x340000, 0x340001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
- AM_RANGE(0x380000, 0x380007) AM_READWRITE_LEGACY(tms_host_r, tms_host_w)
+ AM_RANGE(0x380000, 0x380007) AM_READWRITE(tms_host_r, tms_host_w)
ADDRESS_MAP_END
-static READ16_HANDLER(unk_r)
+READ16_MEMBER(artmagic_state::unk_r)
{
- return space->machine().rand();
+ return machine().rand();
}
static ADDRESS_MAP_START( shtstar_map, AS_PROGRAM, 16, artmagic_state )
@@ -476,13 +473,13 @@ static ADDRESS_MAP_START( shtstar_map, AS_PROGRAM, 16, artmagic_state )
AM_RANGE(0x3c0008, 0x3c0009) AM_READ_PORT("3c0008")
AM_RANGE(0x3c000a, 0x3c000b) AM_READ_PORT("3c000a")
- AM_RANGE(0x3c0012, 0x3c0013) AM_READ_LEGACY(unk_r)
+ AM_RANGE(0x3c0012, 0x3c0013) AM_READ(unk_r)
AM_RANGE(0x3c0014, 0x3c0015) AM_NOP
- AM_RANGE(0x300000, 0x300003) AM_WRITE_LEGACY(control_w) AM_BASE(m_control)
- AM_RANGE(0x3c0004, 0x3c0007) AM_WRITE_LEGACY(protection_bit_w)
+ AM_RANGE(0x300000, 0x300003) AM_WRITE(control_w) AM_BASE(m_control)
+ AM_RANGE(0x3c0004, 0x3c0007) AM_WRITE(protection_bit_w)
AM_RANGE(0x340000, 0x340001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
- AM_RANGE(0x380000, 0x380007) AM_READWRITE_LEGACY(tms_host_r, tms_host_w)
+ AM_RANGE(0x380000, 0x380007) AM_READWRITE(tms_host_r, tms_host_w)
ADDRESS_MAP_END
@@ -1172,7 +1169,7 @@ static DRIVER_INIT( ultennis )
state->m_protection_handler = ultennis_protection;
/* additional (protection?) hack */
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x300000, 0x300001, FUNC(ultennis_hack_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x300000, 0x300001, read16_delegate(FUNC(artmagic_state::ultennis_hack_r),state));
}
diff --git a/src/mame/drivers/ashnojoe.c b/src/mame/drivers/ashnojoe.c
index 90322c263b2..29ffb53a61a 100644
--- a/src/mame/drivers/ashnojoe.c
+++ b/src/mame/drivers/ashnojoe.c
@@ -79,19 +79,18 @@ Coin B is not used
#include "sound/msm5205.h"
#include "includes/ashnojoe.h"
-static READ16_HANDLER(fake_4a00a_r)
+READ16_MEMBER(ashnojoe_state::fake_4a00a_r)
{
/* If it returns 1 there's no sound. Is it used to sync the game and sound?
or just a debug enable/disable register? */
return 0;
}
-static WRITE16_HANDLER( ashnojoe_soundlatch_w )
+WRITE16_MEMBER(ashnojoe_state::ashnojoe_soundlatch_w)
{
- ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
if (ACCESSING_BITS_0_7)
{
- state->m_soundlatch_status = 1;
+ m_soundlatch_status = 1;
soundlatch_w(space, 0, data & 0xff);
}
}
@@ -110,8 +109,8 @@ static ADDRESS_MAP_START( ashnojoe_map, AS_PROGRAM, 16, ashnojoe_state )
AM_RANGE(0x04a002, 0x04a003) AM_READ_PORT("P2")
AM_RANGE(0x04a004, 0x04a005) AM_READ_PORT("DSW")
AM_RANGE(0x04a006, 0x04a007) AM_WRITEONLY AM_BASE(m_tilemap_reg)
- AM_RANGE(0x04a008, 0x04a009) AM_WRITE_LEGACY(ashnojoe_soundlatch_w)
- AM_RANGE(0x04a00a, 0x04a00b) AM_READ_LEGACY(fake_4a00a_r) // ??
+ AM_RANGE(0x04a008, 0x04a009) AM_WRITE(ashnojoe_soundlatch_w)
+ AM_RANGE(0x04a00a, 0x04a00b) AM_READ(fake_4a00a_r) // ??
AM_RANGE(0x04a010, 0x04a019) AM_WRITE_LEGACY(joe_tilemaps_xscroll_w)
AM_RANGE(0x04a020, 0x04a029) AM_WRITE_LEGACY(joe_tilemaps_yscroll_w)
AM_RANGE(0x04c000, 0x04ffff) AM_RAM
@@ -119,23 +118,20 @@ static ADDRESS_MAP_START( ashnojoe_map, AS_PROGRAM, 16, ashnojoe_state )
ADDRESS_MAP_END
-static WRITE8_HANDLER( adpcm_w )
+WRITE8_MEMBER(ashnojoe_state::adpcm_w)
{
- ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
- state->m_adpcm_byte = data;
+ m_adpcm_byte = data;
}
-static READ8_HANDLER( sound_latch_r )
+READ8_MEMBER(ashnojoe_state::sound_latch_r)
{
- ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
- state->m_soundlatch_status = 0;
+ m_soundlatch_status = 0;
return soundlatch_r(space, 0);
}
-static READ8_HANDLER( sound_latch_status_r )
+READ8_MEMBER(ashnojoe_state::sound_latch_status_r)
{
- ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
- return state->m_soundlatch_status;
+ return m_soundlatch_status;
}
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, ashnojoe_state )
@@ -147,9 +143,9 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, ashnojoe_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w)
- AM_RANGE(0x02, 0x02) AM_WRITE_LEGACY(adpcm_w)
- AM_RANGE(0x04, 0x04) AM_READ_LEGACY(sound_latch_r)
- AM_RANGE(0x06, 0x06) AM_READ_LEGACY(sound_latch_status_r)
+ AM_RANGE(0x02, 0x02) AM_WRITE(adpcm_w)
+ AM_RANGE(0x04, 0x04) AM_READ(sound_latch_r)
+ AM_RANGE(0x06, 0x06) AM_READ(sound_latch_status_r)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/asterix.c b/src/mame/drivers/asterix.c
index 1306be386f3..1d1389d159e 100644
--- a/src/mame/drivers/asterix.c
+++ b/src/mame/drivers/asterix.c
@@ -31,27 +31,25 @@ static const eeprom_interface eeprom_intf =
};
#if 0
-static READ16_HANDLER( control2_r )
+READ16_MEMBER(asterix_state::control2_r)
{
- asterix_state *state = space->machine().driver_data<asterix_state>();
- return state->m_cur_control2;
+ return m_cur_control2;
}
#endif
-static WRITE16_HANDLER( control2_w )
+WRITE16_MEMBER(asterix_state::control2_w)
{
- asterix_state *state = space->machine().driver_data<asterix_state>();
if (ACCESSING_BITS_0_7)
{
- state->m_cur_control2 = data;
+ m_cur_control2 = data;
/* bit 0 is data */
/* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */
- input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
+ input_port_write(machine(), "EEPROMOUT", data, 0xff);
/* bit 5 is select tile bank */
- k056832_set_tile_bank(state->m_k056832, (data & 0x20) >> 5);
+ k056832_set_tile_bank(m_k056832, (data & 0x20) >> 5);
}
}
@@ -77,38 +75,35 @@ static TIMER_CALLBACK( nmi_callback )
device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
}
-static WRITE8_HANDLER( sound_arm_nmi_w )
+WRITE8_MEMBER(asterix_state::sound_arm_nmi_w)
{
- asterix_state *state = space->machine().driver_data<asterix_state>();
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
- space->machine().scheduler().timer_set(attotime::from_usec(5), FUNC(nmi_callback));
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
+ machine().scheduler().timer_set(attotime::from_usec(5), FUNC(nmi_callback));
}
-static WRITE16_HANDLER( sound_irq_w )
+WRITE16_MEMBER(asterix_state::sound_irq_w)
{
- asterix_state *state = space->machine().driver_data<asterix_state>();
- device_set_input_line(state->m_audiocpu, 0, HOLD_LINE);
+ device_set_input_line(m_audiocpu, 0, HOLD_LINE);
}
// Check the routine at 7f30 in the ead version.
// You're not supposed to laugh.
// This emulation is grossly overkill but hey, I'm having fun.
#if 0
-static WRITE16_HANDLER( protection_w )
+WRITE16_MEMBER(asterix_state::protection_w)
{
- asterix_state *state = space->machine().driver_data<asterix_state>();
- COMBINE_DATA(state->m_prot + offset);
+ COMBINE_DATA(m_prot + offset);
if (offset == 1)
{
- UINT32 cmd = (state->m_prot[0] << 16) | state->m_prot[1];
+ UINT32 cmd = (m_prot[0] << 16) | m_prot[1];
switch (cmd >> 24)
{
case 0x64:
{
- UINT32 param1 = (space->read_word(cmd & 0xffffff) << 16) | space->read_word((cmd & 0xffffff) + 2);
- UINT32 param2 = (space->read_word((cmd & 0xffffff) + 4) << 16) | space->read_word((cmd & 0xffffff) + 6);
+ UINT32 param1 = (read_word(cmd & 0xffffff) << 16) | read_word((cmd & 0xffffff) + 2);
+ UINT32 param2 = (read_word((cmd & 0xffffff) + 4) << 16) | read_word((cmd & 0xffffff) + 6);
switch (param1 >> 24)
{
@@ -119,7 +114,7 @@ static WRITE16_HANDLER( protection_w )
param2 &= 0xffffff;
while(size >= 0)
{
- space->write_word(param2, space->read_word(param1));
+ write_word(param2, read_word(param1));
param1 += 2;
param2 += 2;
size--;
@@ -134,22 +129,21 @@ static WRITE16_HANDLER( protection_w )
}
#endif
-static WRITE16_HANDLER( protection_w )
+WRITE16_MEMBER(asterix_state::protection_w)
{
- asterix_state *state = space->machine().driver_data<asterix_state>();
- COMBINE_DATA(state->m_prot + offset);
+ COMBINE_DATA(m_prot + offset);
if (offset == 1)
{
- UINT32 cmd = (state->m_prot[0] << 16) | state->m_prot[1];
+ UINT32 cmd = (m_prot[0] << 16) | m_prot[1];
switch (cmd >> 24)
{
case 0x64:
{
- UINT32 param1 = (space->read_word(cmd & 0xffffff) << 16)
- | space->read_word((cmd & 0xffffff) + 2);
- UINT32 param2 = (space->read_word((cmd & 0xffffff) + 4) << 16)
- | space->read_word((cmd & 0xffffff) + 6);
+ UINT32 param1 = (space.read_word(cmd & 0xffffff) << 16)
+ | space.read_word((cmd & 0xffffff) + 2);
+ UINT32 param2 = (space.read_word((cmd & 0xffffff) + 4) << 16)
+ | space.read_word((cmd & 0xffffff) + 6);
switch (param1 >> 24)
{
@@ -160,7 +154,7 @@ static WRITE16_HANDLER( protection_w )
param2 &= 0xffffff;
while(size >= 0)
{
- space->write_word(param2, space->read_word(param1));
+ space.write_word(param2, space.read_word(param1));
param1 += 2;
param2 += 2;
size--;
@@ -184,14 +178,14 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, asterix_state )
AM_RANGE(0x300000, 0x30001f) AM_DEVREADWRITE_LEGACY("k053244", k053244_lsb_r, k053244_lsb_w)
AM_RANGE(0x380000, 0x380001) AM_READ_PORT("IN0")
AM_RANGE(0x380002, 0x380003) AM_READ_PORT("IN1")
- AM_RANGE(0x380100, 0x380101) AM_WRITE_LEGACY(control2_w)
+ AM_RANGE(0x380100, 0x380101) AM_WRITE(control2_w)
AM_RANGE(0x380200, 0x380203) AM_DEVREADWRITE8_LEGACY("k053260", asterix_sound_r, k053260_w, 0x00ff)
- AM_RANGE(0x380300, 0x380301) AM_WRITE_LEGACY(sound_irq_w)
+ AM_RANGE(0x380300, 0x380301) AM_WRITE(sound_irq_w)
AM_RANGE(0x380400, 0x380401) AM_WRITE_LEGACY(asterix_spritebank_w)
AM_RANGE(0x380500, 0x38051f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x380600, 0x380601) AM_NOP // Watchdog
AM_RANGE(0x380700, 0x380707) AM_DEVWRITE_LEGACY("k056832", k056832_b_word_w)
- AM_RANGE(0x380800, 0x380803) AM_WRITE_LEGACY(protection_w)
+ AM_RANGE(0x380800, 0x380803) AM_WRITE(protection_w)
AM_RANGE(0x400000, 0x400fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_half_word_r, k056832_ram_half_word_w)
AM_RANGE(0x420000, 0x421fff) AM_DEVREAD_LEGACY("k056832", k056832_old_rom_word_r) // Passthrough to tile roms
AM_RANGE(0x440000, 0x44003f) AM_DEVWRITE_LEGACY("k056832", k056832_word_w)
@@ -202,7 +196,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, asterix_state )
AM_RANGE(0xf000, 0xf7ff) AM_RAM
AM_RANGE(0xf801, 0xf801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_status_port_r, ym2151_data_port_w)
AM_RANGE(0xfa00, 0xfa2f) AM_DEVREADWRITE_LEGACY("k053260", k053260_r, k053260_w)
- AM_RANGE(0xfc00, 0xfc00) AM_WRITE_LEGACY(sound_arm_nmi_w)
+ AM_RANGE(0xfc00, 0xfc00) AM_WRITE(sound_arm_nmi_w)
AM_RANGE(0xfe00, 0xfe00) AM_DEVWRITE_LEGACY("ymsnd", ym2151_register_port_w)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/asteroid.c b/src/mame/drivers/asteroid.c
index 35477385140..5213575a072 100644
--- a/src/mame/drivers/asteroid.c
+++ b/src/mame/drivers/asteroid.c
@@ -202,9 +202,9 @@ There is not a rev 03 known or dumped. An Asteroids rev 03 is not mentioned in a
*
*************************************/
-static WRITE8_HANDLER( astdelux_coin_counter_w )
+WRITE8_MEMBER(asteroid_state::astdelux_coin_counter_w)
{
- coin_counter_w(space->machine(), offset,data);
+ coin_counter_w(machine(), offset,data);
}
@@ -215,7 +215,7 @@ static WRITE8_HANDLER( astdelux_coin_counter_w )
*
*************************************/
-static WRITE8_HANDLER( llander_led_w )
+WRITE8_MEMBER(asteroid_state::llander_led_w)
{
static const char *const lampname[] =
{
@@ -273,7 +273,7 @@ static ADDRESS_MAP_START( astdelux_map, AS_PROGRAM, 8, asteroid_state )
AM_RANGE(0x3c00, 0x3c01) AM_WRITE_LEGACY(astdelux_led_w)
AM_RANGE(0x3c03, 0x3c03) AM_DEVWRITE_LEGACY("discrete", astdelux_sounds_w)
AM_RANGE(0x3c04, 0x3c04) AM_WRITE_LEGACY(astdelux_bank_switch_w)
- AM_RANGE(0x3c05, 0x3c07) AM_WRITE_LEGACY(astdelux_coin_counter_w)
+ AM_RANGE(0x3c05, 0x3c07) AM_WRITE(astdelux_coin_counter_w)
AM_RANGE(0x3e00, 0x3e00) AM_DEVWRITE_LEGACY("discrete", asteroid_noise_reset_w)
AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE_LEGACY(&avgdvg_vectorram) AM_SIZE_LEGACY(&avgdvg_vectorram_size) AM_REGION("maincpu", 0x4000)
AM_RANGE(0x4800, 0x57ff) AM_ROM /* vector rom */
@@ -289,7 +289,7 @@ static ADDRESS_MAP_START( llander_map, AS_PROGRAM, 8, asteroid_state )
AM_RANGE(0x2800, 0x2803) AM_READ_LEGACY(asteroid_DSW1_r) /* DSW1 */
AM_RANGE(0x2c00, 0x2c00) AM_READ_PORT("THRUST")
AM_RANGE(0x3000, 0x3000) AM_WRITE_LEGACY(avgdvg_go_w)
- AM_RANGE(0x3200, 0x3200) AM_WRITE_LEGACY(llander_led_w)
+ AM_RANGE(0x3200, 0x3200) AM_WRITE(llander_led_w)
AM_RANGE(0x3400, 0x3400) AM_WRITE_LEGACY(watchdog_reset_w)
AM_RANGE(0x3c00, 0x3c00) AM_DEVWRITE_LEGACY("discrete", llander_sounds_w)
AM_RANGE(0x3e00, 0x3e00) AM_DEVWRITE_LEGACY("discrete", llander_snd_reset_w)
diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c
index 229201a67e1..db7cf05aa75 100644
--- a/src/mame/drivers/astrocde.c
+++ b/src/mame/drivers/astrocde.c
@@ -152,27 +152,24 @@ static MACHINE_START( astrocde )
*
*************************************/
-static WRITE8_HANDLER( protected_ram_enable_w )
+WRITE8_MEMBER(astrocde_state::protected_ram_enable_w)
{
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
- state->m_ram_write_enable = TRUE;
+ m_ram_write_enable = TRUE;
}
-static READ8_HANDLER( protected_ram_r )
+READ8_MEMBER(astrocde_state::protected_ram_r)
{
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
- state->m_ram_write_enable = FALSE;
- return state->m_protected_ram[offset];
+ m_ram_write_enable = FALSE;
+ return m_protected_ram[offset];
}
-static WRITE8_HANDLER( protected_ram_w )
+WRITE8_MEMBER(astrocde_state::protected_ram_w)
{
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
- if (state->m_ram_write_enable)
- state->m_protected_ram[offset] = data;
- state->m_ram_write_enable = FALSE;
+ if (m_ram_write_enable)
+ m_protected_ram[offset] = data;
+ m_ram_write_enable = FALSE;
}
@@ -183,7 +180,7 @@ static WRITE8_HANDLER( protected_ram_w )
*
*************************************/
-static WRITE8_HANDLER( seawolf2_lamps_w )
+WRITE8_MEMBER(astrocde_state::seawolf2_lamps_w)
{
/* 0x42 = player 2 (left), 0x43 = player 1 (right) */
/* --x----- explosion */
@@ -203,12 +200,11 @@ static WRITE8_HANDLER( seawolf2_lamps_w )
}
-static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40
+WRITE8_MEMBER(astrocde_state::seawolf2_sound_1_w)// Port 40
{
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
- samples_device *samples = space->machine().device<samples_device>("samples");
- UINT8 rising_bits = data & ~state->m_port_1_last;
- state->m_port_1_last = data;
+ samples_device *samples = machine().device<samples_device>("samples");
+ UINT8 rising_bits = data & ~m_port_1_last;
+ m_port_1_last = data;
if (rising_bits & 0x01) samples->start(1, 1); /* Left Torpedo */
if (rising_bits & 0x02) samples->start(0, 0); /* Left Ship Hit */
@@ -219,12 +215,11 @@ static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40
}
-static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41
+WRITE8_MEMBER(astrocde_state::seawolf2_sound_2_w)// Port 41
{
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
- samples_device *samples = space->machine().device<samples_device>("samples");
- UINT8 rising_bits = data & ~state->m_port_2_last;
- state->m_port_2_last = data;
+ samples_device *samples = machine().device<samples_device>("samples");
+ UINT8 rising_bits = data & ~m_port_2_last;
+ m_port_2_last = data;
samples->set_volume(0, (data & 0x80) ? 1.0 : 0.0);
samples->set_volume(1, (data & 0x80) ? 1.0 : 0.0);
@@ -247,7 +242,7 @@ static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41
if (rising_bits & 0x10) samples->start(8, 3); /* Right Sonar */
if (rising_bits & 0x20) samples->start(3, 3); /* Left Sonar */
- coin_counter_w(space->machine(), 0, data & 0x40); /* Coin Counter */
+ coin_counter_w(machine(), 0, data & 0x40); /* Coin Counter */
}
@@ -266,16 +261,15 @@ static CUSTOM_INPUT( ebases_trackball_r )
}
-static WRITE8_HANDLER( ebases_trackball_select_w )
+WRITE8_MEMBER(astrocde_state::ebases_trackball_select_w)
{
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
- state->m_input_select = data & 3;
+ m_input_select = data & 3;
}
-static WRITE8_HANDLER( ebases_coin_w )
+WRITE8_MEMBER(astrocde_state::ebases_coin_w)
{
- coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(machine(), 0, data & 1);
}
@@ -286,11 +280,11 @@ static WRITE8_HANDLER( ebases_coin_w )
*
*************************************/
-static READ8_HANDLER( spacezap_io_r )
+READ8_MEMBER(astrocde_state::spacezap_io_r)
{
- coin_counter_w(space->machine(), 0, (offset >> 8) & 1);
- coin_counter_w(space->machine(), 1, (offset >> 9) & 1);
- return input_port_read_safe(space->machine(), "P3HANDLE", 0xff);
+ coin_counter_w(machine(), 0, (offset >> 8) & 1);
+ coin_counter_w(machine(), 1, (offset >> 9) & 1);
+ return input_port_read_safe(machine(), "P3HANDLE", 0xff);
}
@@ -301,20 +295,19 @@ static READ8_HANDLER( spacezap_io_r )
*
*************************************/
-static READ8_HANDLER( wow_io_r )
+READ8_MEMBER(astrocde_state::wow_io_r)
{
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
UINT8 data = (offset >> 8) & 1;
switch ((offset >> 9) & 7)
{
- case 0: coin_counter_w(space->machine(), 0, data); break;
- case 1: coin_counter_w(space->machine(), 1, data); break;
- case 2: state->m_sparkle[0] = data; break;
- case 3: state->m_sparkle[1] = data; break;
- case 4: state->m_sparkle[2] = data; break;
- case 5: state->m_sparkle[3] = data; break;
- case 7: coin_counter_w(space->machine(), 2, data); break;
+ case 0: coin_counter_w(machine(), 0, data); break;
+ case 1: coin_counter_w(machine(), 1, data); break;
+ case 2: m_sparkle[0] = data; break;
+ case 3: m_sparkle[1] = data; break;
+ case 4: m_sparkle[2] = data; break;
+ case 5: m_sparkle[3] = data; break;
+ case 7: coin_counter_w(machine(), 2, data); break;
}
return 0xff;
}
@@ -327,25 +320,24 @@ static READ8_HANDLER( wow_io_r )
*
*************************************/
-static READ8_HANDLER( gorf_io_1_r )
+READ8_MEMBER(astrocde_state::gorf_io_1_r)
{
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
UINT8 data = (offset >> 8) & 1;
switch ((offset >> 9) & 7)
{
- case 0: coin_counter_w(space->machine(), 0, data); break;
- case 1: coin_counter_w(space->machine(), 1, data); break;
- case 2: state->m_sparkle[0] = data; break;
- case 3: state->m_sparkle[1] = data; break;
- case 4: state->m_sparkle[2] = data; break;
- case 5: state->m_sparkle[3] = data; break;
+ case 0: coin_counter_w(machine(), 0, data); break;
+ case 1: coin_counter_w(machine(), 1, data); break;
+ case 2: m_sparkle[0] = data; break;
+ case 3: m_sparkle[1] = data; break;
+ case 4: m_sparkle[2] = data; break;
+ case 5: m_sparkle[3] = data; break;
case 6:
- space->machine().device<astrocade_device>("astrocade1")->set_output_gain(0, data ? 0.0 : 1.0);
+ machine().device<astrocade_device>("astrocade1")->set_output_gain(0, data ? 0.0 : 1.0);
#if USE_FAKE_VOTRAX
- space->machine().device<samples_device>("samples")->set_output_gain(0, data ? 1.0 : 0.0);
+ machine().device<samples_device>("samples")->set_output_gain(0, data ? 1.0 : 0.0);
#else
- space->machine().device<votrax_sc01_device>("votrax")->set_output_gain(0, data ? 1.0 : 0.0);
+ machine().device<votrax_sc01_device>("votrax")->set_output_gain(0, data ? 1.0 : 0.0);
#endif
break;
case 7: mame_printf_debug("io_1:%d\n", data); break;
@@ -354,7 +346,7 @@ static READ8_HANDLER( gorf_io_1_r )
}
-static READ8_HANDLER( gorf_io_2_r )
+READ8_MEMBER(astrocde_state::gorf_io_2_r)
{
UINT8 data = (offset >> 8) & 1;
@@ -380,17 +372,17 @@ static READ8_HANDLER( gorf_io_2_r )
*
*************************************/
-static READ8_HANDLER( robby_io_r )
+READ8_MEMBER(astrocde_state::robby_io_r)
{
UINT8 data = (offset >> 8) & 1;
switch ((offset >> 9) & 7)
{
- case 0: coin_counter_w(space->machine(), 0, data); break;
- case 1: coin_counter_w(space->machine(), 1, data); break;
- case 2: coin_counter_w(space->machine(), 2, data); break;
- case 6: set_led_status(space->machine(), 0, data); break;
- case 7: set_led_status(space->machine(), 1, data); break;
+ case 0: coin_counter_w(machine(), 0, data); break;
+ case 1: coin_counter_w(machine(), 1, data); break;
+ case 2: coin_counter_w(machine(), 2, data); break;
+ case 6: set_led_status(machine(), 0, data); break;
+ case 7: set_led_status(machine(), 1, data); break;
}
return 0xff;
}
@@ -403,17 +395,17 @@ static READ8_HANDLER( robby_io_r )
*
*************************************/
-static READ8_HANDLER( profpac_io_1_r )
+READ8_MEMBER(astrocde_state::profpac_io_1_r)
{
- coin_counter_w(space->machine(), 0, (offset >> 8) & 1);
- coin_counter_w(space->machine(), 1, (offset >> 9) & 1);
- set_led_status(space->machine(), 0, (offset >> 10) & 1);
- set_led_status(space->machine(), 1, (offset >> 11) & 1);
+ coin_counter_w(machine(), 0, (offset >> 8) & 1);
+ coin_counter_w(machine(), 1, (offset >> 9) & 1);
+ set_led_status(machine(), 0, (offset >> 10) & 1);
+ set_led_status(machine(), 1, (offset >> 11) & 1);
return 0xff;
}
-static READ8_HANDLER( profpac_io_2_r )
+READ8_MEMBER(astrocde_state::profpac_io_2_r)
{
output_set_lamp_value(0, (offset >> 8) & 1); /* left lamp A */
output_set_lamp_value(1, (offset >> 9) & 1); /* left lamp B */
@@ -425,27 +417,26 @@ static READ8_HANDLER( profpac_io_2_r )
}
-static WRITE8_HANDLER( profpac_banksw_w )
+WRITE8_MEMBER(astrocde_state::profpac_banksw_w)
{
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
int bank = (data >> 5) & 3;
- /* this is accessed from I/O space but modifies program space, so we normalize here */
- space = space->device().memory().space(AS_PROGRAM);
+ /* this is accessed from I/O &space but modifies program &space, so we normalize here */
+ address_space *prog_space = space.device().memory().space(AS_PROGRAM);
/* remember the banking bits for save state support */
- state->m_profpac_bank = data;
+ m_profpac_bank = data;
/* set the main banking */
- space->install_read_bank(0x4000, 0xbfff, "bank1");
- memory_set_bankptr(space->machine(), "bank1", space->machine().region("user1")->base() + 0x8000 * bank);
+ prog_space->install_read_bank(0x4000, 0xbfff, "bank1");
+ memory_set_bankptr(machine(), "bank1", machine().region("user1")->base() + 0x8000 * bank);
/* bank 0 reads video RAM in the 4000-7FFF range */
if (bank == 0)
- space->install_legacy_read_handler(0x4000, 0x7fff, FUNC(profpac_videoram_r));
+ prog_space->install_legacy_read_handler(0x4000, 0x7fff, FUNC(profpac_videoram_r));
/* if we have a 640k EPROM board, map that on top of the 4000-7FFF range if specified */
- if ((data & 0x80) && space->machine().region("user2")->base() != NULL)
+ if ((data & 0x80) && machine().region("user2")->base() != NULL)
{
/* Note: There is a jumper which could change the base offset to 0xa8 instead */
bank = data - 0x80;
@@ -453,11 +444,11 @@ static WRITE8_HANDLER( profpac_banksw_w )
/* if the bank is in range, map the appropriate bank */
if (bank < 0x28)
{
- space->install_read_bank(0x4000, 0x7fff, "bank2");
- memory_set_bankptr(space->machine(), "bank2", space->machine().region("user2")->base() + 0x4000 * bank);
+ prog_space->install_read_bank(0x4000, 0x7fff, "bank2");
+ memory_set_bankptr(machine(), "bank2", machine().region("user2")->base() + 0x4000 * bank);
}
else
- space->unmap_read(0x4000, 0x7fff);
+ prog_space->unmap_read(0x4000, 0x7fff);
}
}
@@ -467,7 +458,7 @@ static void profbank_banksw_restore(running_machine &machine)
astrocde_state *state = machine.driver_data<astrocde_state>();
address_space *space = machine.device("maincpu")->memory().space(AS_IO);
- profpac_banksw_w(space, 0, state->m_profpac_bank);
+ state->profpac_banksw_w(*space, 0, state->m_profpac_bank);
}
@@ -478,14 +469,13 @@ static void profbank_banksw_restore(running_machine &machine)
*
*************************************/
-static READ8_HANDLER( demndrgn_io_r )
+READ8_MEMBER(astrocde_state::demndrgn_io_r)
{
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
- coin_counter_w(space->machine(), 0, (offset >> 8) & 1);
- coin_counter_w(space->machine(), 1, (offset >> 9) & 1);
- set_led_status(space->machine(), 0, (offset >> 10) & 1);
- set_led_status(space->machine(), 1, (offset >> 11) & 1);
- state->m_input_select = (offset >> 12) & 1;
+ coin_counter_w(machine(), 0, (offset >> 8) & 1);
+ coin_counter_w(machine(), 1, (offset >> 9) & 1);
+ set_led_status(machine(), 0, (offset >> 10) & 1);
+ set_led_status(machine(), 1, (offset >> 11) & 1);
+ m_input_select = (offset >> 12) & 1;
return 0xff;
}
@@ -498,7 +488,7 @@ static CUSTOM_INPUT( demndragn_joystick_r )
}
-static WRITE8_HANDLER( demndrgn_sound_w )
+WRITE8_MEMBER(astrocde_state::demndrgn_sound_w)
{
logerror("Trigger sound sample 0x%02x\n",data);
}
@@ -532,14 +522,14 @@ static const ay8910_interface ay8912_interface =
};
-static WRITE8_HANDLER( tenpindx_sound_w )
+WRITE8_MEMBER(astrocde_state::tenpindx_sound_w)
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine(), "sub", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(machine(), "sub", INPUT_LINE_NMI, PULSE_LINE);
}
-static WRITE8_HANDLER( tenpindx_lamp_w )
+WRITE8_MEMBER(astrocde_state::tenpindx_lamp_w)
{
/* lamps */
if (offset == 0)
@@ -561,14 +551,14 @@ static WRITE8_HANDLER( tenpindx_lamp_w )
}
-static WRITE8_HANDLER( tenpindx_counter_w )
+WRITE8_MEMBER(astrocde_state::tenpindx_counter_w)
{
- coin_counter_w(space->machine(), 0, (data >> 0) & 1);
+ coin_counter_w(machine(), 0, (data >> 0) & 1);
if (data & 0xfc) mame_printf_debug("tenpindx_counter_w = %02X\n", data);
}
-static WRITE8_HANDLER( tenpindx_lights_w )
+WRITE8_MEMBER(astrocde_state::tenpindx_lights_w)
{
/* "flashlights" */
int which = data >> 4;
@@ -611,7 +601,7 @@ static ADDRESS_MAP_START( spacezap_map, AS_PROGRAM, 8, astrocde_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x0000, 0x3fff) AM_WRITE_LEGACY(astrocade_funcgen_w)
AM_RANGE(0x4000, 0x7fff) AM_RAM AM_BASE(m_videoram)
- AM_RANGE(0xd000, 0xd03f) AM_READWRITE_LEGACY(protected_ram_r, protected_ram_w) AM_BASE(m_protected_ram)
+ AM_RANGE(0xd000, 0xd03f) AM_READWRITE(protected_ram_r, protected_ram_w) AM_BASE(m_protected_ram)
AM_RANGE(0xd040, 0xd7ff) AM_RAM
ADDRESS_MAP_END
@@ -621,7 +611,7 @@ static ADDRESS_MAP_START( wow_map, AS_PROGRAM, 8, astrocde_state )
AM_RANGE(0x0000, 0x3fff) AM_WRITE_LEGACY(astrocade_funcgen_w)
AM_RANGE(0x4000, 0x7fff) AM_RAM AM_BASE(m_videoram)
AM_RANGE(0x8000, 0xcfff) AM_ROM
- AM_RANGE(0xd000, 0xd03f) AM_READWRITE_LEGACY(protected_ram_r, protected_ram_w) AM_BASE(m_protected_ram)
+ AM_RANGE(0xd000, 0xd03f) AM_READWRITE(protected_ram_r, protected_ram_w) AM_BASE(m_protected_ram)
AM_RANGE(0xd040, 0xdfff) AM_RAM
ADDRESS_MAP_END
@@ -631,7 +621,7 @@ static ADDRESS_MAP_START( robby_map, AS_PROGRAM, 8, astrocde_state )
AM_RANGE(0x0000, 0x3fff) AM_WRITE_LEGACY(astrocade_funcgen_w)
AM_RANGE(0x4000, 0x7fff) AM_RAM AM_BASE(m_videoram)
AM_RANGE(0x8000, 0xdfff) AM_ROM
- AM_RANGE(0xe000, 0xe1ff) AM_READWRITE_LEGACY(protected_ram_r, protected_ram_w) AM_BASE(m_protected_ram)
+ AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(protected_ram_r, protected_ram_w) AM_BASE(m_protected_ram)
AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0xe800, 0xffff) AM_RAM
ADDRESS_MAP_END
@@ -643,7 +633,7 @@ static ADDRESS_MAP_START( profpac_map, AS_PROGRAM, 8, astrocde_state )
AM_RANGE(0x4000, 0x7fff) AM_READWRITE_LEGACY(profpac_videoram_r, profpac_videoram_w)
AM_RANGE(0x4000, 0xbfff) AM_ROMBANK("bank1")
AM_RANGE(0xc000, 0xdfff) AM_ROM
- AM_RANGE(0xe000, 0xe1ff) AM_READWRITE_LEGACY(protected_ram_r, protected_ram_w) AM_BASE(m_protected_ram)
+ AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(protected_ram_r, protected_ram_w) AM_BASE(m_protected_ram)
AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0xe800, 0xffff) AM_RAM
ADDRESS_MAP_END
@@ -682,7 +672,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( port_map_mono_pattern, AS_IO, 8, astrocde_state )
AM_RANGE(0x0000, 0x0019) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE_LEGACY(astrocade_data_chip_register_r, astrocade_data_chip_register_w)
AM_RANGE(0x0078, 0x007e) AM_MIRROR(0xff00) AM_WRITE_LEGACY(astrocade_pattern_board_w)
- AM_RANGE(0xa55b, 0xa55b) AM_WRITE_LEGACY(protected_ram_enable_w)
+ AM_RANGE(0xa55b, 0xa55b) AM_WRITE(protected_ram_enable_w)
ADDRESS_MAP_END
@@ -690,7 +680,7 @@ static ADDRESS_MAP_START( port_map_stereo_pattern, AS_IO, 8, astrocde_state )
AM_RANGE(0x0000, 0x0019) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE_LEGACY(astrocade_data_chip_register_r, astrocade_data_chip_register_w)
AM_RANGE(0x0050, 0x0058) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_DEVWRITE_LEGACY("astrocade2", astrocade_sound_w)
AM_RANGE(0x0078, 0x007e) AM_MIRROR(0xff00) AM_WRITE_LEGACY(astrocade_pattern_board_w)
- AM_RANGE(0xa55b, 0xa55b) AM_WRITE_LEGACY(protected_ram_enable_w)
+ AM_RANGE(0xa55b, 0xa55b) AM_WRITE(protected_ram_enable_w)
ADDRESS_MAP_END
@@ -701,8 +691,8 @@ static ADDRESS_MAP_START( port_map_16col_pattern, AS_IO, 8, astrocde_state )
AM_RANGE(0x00bf, 0x00bf) AM_MIRROR(0xff00) AM_WRITE_LEGACY(profpac_page_select_w)
AM_RANGE(0x00c3, 0x00c3) AM_MIRROR(0xff00) AM_READ_LEGACY(profpac_intercept_r)
AM_RANGE(0x00c0, 0x00c5) AM_MIRROR(0xff00) AM_WRITE_LEGACY(profpac_screenram_ctrl_w)
- AM_RANGE(0x00f3, 0x00f3) AM_MIRROR(0xff00) AM_WRITE_LEGACY(profpac_banksw_w)
- AM_RANGE(0xa55b, 0xa55b) AM_WRITE_LEGACY(protected_ram_enable_w)
+ AM_RANGE(0x00f3, 0x00f3) AM_MIRROR(0xff00) AM_WRITE(profpac_banksw_w)
+ AM_RANGE(0xa55b, 0xa55b) AM_WRITE(protected_ram_enable_w)
ADDRESS_MAP_END
@@ -712,8 +702,8 @@ static ADDRESS_MAP_START( port_map_16col_pattern_nosound, AS_IO, 8, astrocde_sta
AM_RANGE(0x00bf, 0x00bf) AM_MIRROR(0xff00) AM_WRITE_LEGACY(profpac_page_select_w)
AM_RANGE(0x00c3, 0x00c3) AM_MIRROR(0xff00) AM_READ_LEGACY(profpac_intercept_r)
AM_RANGE(0x00c0, 0x00c5) AM_MIRROR(0xff00) AM_WRITE_LEGACY(profpac_screenram_ctrl_w)
- AM_RANGE(0x00f3, 0x00f3) AM_MIRROR(0xff00) AM_WRITE_LEGACY(profpac_banksw_w)
- AM_RANGE(0xa55b, 0xa55b) AM_WRITE_LEGACY(protected_ram_enable_w)
+ AM_RANGE(0x00f3, 0x00f3) AM_MIRROR(0xff00) AM_WRITE(profpac_banksw_w)
+ AM_RANGE(0xa55b, 0xa55b) AM_WRITE(protected_ram_enable_w)
ADDRESS_MAP_END
@@ -1751,9 +1741,9 @@ static DRIVER_INIT( seawolf2 )
{
astrocde_state *state = machine.driver_data<astrocde_state>();
state->m_video_config = 0x00;
- machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x40, 0x40, 0, 0xff18, FUNC(seawolf2_sound_1_w));
- machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x41, 0x41, 0, 0xff18, FUNC(seawolf2_sound_2_w));
- machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x42, 0x43, 0, 0xff18, FUNC(seawolf2_lamps_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x40, 0x40, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_sound_1_w),state));
+ machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x41, 0x41, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_sound_2_w),state));
+ machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x42, 0x43, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_lamps_w),state));
}
@@ -1761,8 +1751,8 @@ static DRIVER_INIT( ebases )
{
astrocde_state *state = machine.driver_data<astrocde_state>();
state->m_video_config = AC_SOUND_PRESENT;
- machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x20, 0x20, 0, 0xff07, FUNC(ebases_coin_w));
- machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x28, 0x28, 0, 0xff07, FUNC(ebases_trackball_select_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x20, 0x20, 0, 0xff07, write8_delegate(FUNC(astrocde_state::ebases_coin_w),state));
+ machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x28, 0x28, 0, 0xff07, write8_delegate(FUNC(astrocde_state::ebases_trackball_select_w),state));
}
@@ -1770,7 +1760,7 @@ static DRIVER_INIT( spacezap )
{
astrocde_state *state = machine.driver_data<astrocde_state>();
state->m_video_config = AC_SOUND_PRESENT | AC_MONITOR_BW;
- machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x13, 0x13, 0x03ff, 0xff00, FUNC(spacezap_io_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x13, 0x13, 0x03ff, 0xff00, read8_delegate(FUNC(astrocde_state::spacezap_io_r),state));
}
@@ -1778,7 +1768,7 @@ static DRIVER_INIT( wow )
{
astrocde_state *state = machine.driver_data<astrocde_state>();
state->m_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
- machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(wow_io_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::wow_io_r),state));
machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(wow_speech_r));
}
@@ -1787,8 +1777,8 @@ static DRIVER_INIT( gorf )
{
astrocde_state *state = machine.driver_data<astrocde_state>();
state->m_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
- machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(gorf_io_1_r));
- machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, 0x0fff, 0xff00, FUNC(gorf_io_2_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::gorf_io_1_r),state));
+ machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x16, 0x16, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::gorf_io_2_r),state));
machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(gorf_speech_r));
}
@@ -1797,7 +1787,7 @@ static DRIVER_INIT( robby )
{
astrocde_state *state = machine.driver_data<astrocde_state>();
state->m_video_config = AC_SOUND_PRESENT;
- machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(robby_io_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::robby_io_r),state));
}
@@ -1807,11 +1797,11 @@ static DRIVER_INIT( profpac )
address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
state->m_video_config = AC_SOUND_PRESENT;
- iospace->install_legacy_read_handler(0x14, 0x14, 0x0fff, 0xff00, FUNC(profpac_io_1_r));
- iospace->install_legacy_read_handler(0x15, 0x15, 0x77ff, 0xff00, FUNC(profpac_io_2_r));
+ iospace->install_read_handler(0x14, 0x14, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_1_r),state));
+ iospace->install_read_handler(0x15, 0x15, 0x77ff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_2_r),state));
/* reset banking */
- profpac_banksw_w(iospace, 0, 0);
+ state->profpac_banksw_w(*iospace, 0, 0);
machine.save().register_postload(save_prepost_delegate(FUNC(profbank_banksw_restore), &machine));
}
@@ -1822,13 +1812,13 @@ static DRIVER_INIT( demndrgn )
address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
state->m_video_config = 0x00;
- iospace->install_legacy_read_handler(0x14, 0x14, 0x1fff, 0xff00, FUNC(demndrgn_io_r));
+ iospace->install_read_handler(0x14, 0x14, 0x1fff, 0xff00, read8_delegate(FUNC(astrocde_state::demndrgn_io_r),state));
iospace->install_read_port(0x1c, 0x1c, 0x0000, 0xff00, "FIREX");
iospace->install_read_port(0x1d, 0x1d, 0x0000, 0xff00, "FIREY");
- iospace->install_legacy_write_handler(0x97, 0x97, 0x0000, 0xff00, FUNC(demndrgn_sound_w));
+ iospace->install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::demndrgn_sound_w),state));
/* reset banking */
- profpac_banksw_w(iospace, 0, 0);
+ state->profpac_banksw_w(*iospace, 0, 0);
machine.save().register_postload(save_prepost_delegate(FUNC(profbank_banksw_restore), &machine));
}
@@ -1844,13 +1834,13 @@ static DRIVER_INIT( tenpindx )
iospace->install_read_port(0x62, 0x62, 0x0000, 0xff00, "P62");
iospace->install_read_port(0x63, 0x63, 0x0000, 0xff00, "P63");
iospace->install_read_port(0x64, 0x64, 0x0000, 0xff00, "P64");
- iospace->install_legacy_write_handler(0x65, 0x66, 0x0000, 0xff00, FUNC(tenpindx_lamp_w));
- iospace->install_legacy_write_handler(0x67, 0x67, 0x0000, 0xff00, FUNC(tenpindx_counter_w));
- iospace->install_legacy_write_handler(0x68, 0x68, 0x0000, 0xff00, FUNC(tenpindx_lights_w));
- iospace->install_legacy_write_handler(0x97, 0x97, 0x0000, 0xff00, FUNC(tenpindx_sound_w));
+ iospace->install_write_handler(0x65, 0x66, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_lamp_w),state));
+ iospace->install_write_handler(0x67, 0x67, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_counter_w),state));
+ iospace->install_write_handler(0x68, 0x68, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_lights_w),state));
+ iospace->install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_sound_w),state));
/* reset banking */
- profpac_banksw_w(iospace, 0, 0);
+ state->profpac_banksw_w(*iospace, 0, 0);
machine.save().register_postload(save_prepost_delegate(FUNC(profbank_banksw_restore), &machine));
}
diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c
index 0472e91060f..fcf83b41d87 100644
--- a/src/mame/drivers/astrof.c
+++ b/src/mame/drivers/astrof.c
@@ -79,10 +79,9 @@
*
*************************************/
-static READ8_HANDLER( irq_clear_r )
+READ8_MEMBER(astrof_state::irq_clear_r)
{
- astrof_state *state = space->machine().driver_data<astrof_state>();
- device_set_input_line(state->m_maincpu, 0, CLEAR_LINE);
+ device_set_input_line(m_maincpu, 0, CLEAR_LINE);
return 0;
}
@@ -280,37 +279,34 @@ static void tomahawk_get_pens( running_machine &machine, pen_t *pens )
}
-static WRITE8_HANDLER( astrof_videoram_w )
+WRITE8_MEMBER(astrof_state::astrof_videoram_w)
{
- astrof_state *state = space->machine().driver_data<astrof_state>();
- state->m_videoram[offset] = data;
- state->m_colorram[offset >> 1] = *state->m_astrof_color & 0x0e;
+ m_videoram[offset] = data;
+ m_colorram[offset >> 1] = *m_astrof_color & 0x0e;
}
-static WRITE8_HANDLER( tomahawk_videoram_w )
+WRITE8_MEMBER(astrof_state::tomahawk_videoram_w)
{
- astrof_state *state = space->machine().driver_data<astrof_state>();
- state->m_videoram[offset] = data;
- state->m_colorram[offset >> 1] = (*state->m_astrof_color & 0x0e) | ((*state->m_astrof_color & 0x01) << 4);
+ m_videoram[offset] = data;
+ m_colorram[offset >> 1] = (*m_astrof_color & 0x0e) | ((*m_astrof_color & 0x01) << 4);
}
-static WRITE8_HANDLER( video_control_1_w )
+WRITE8_MEMBER(astrof_state::video_control_1_w)
{
- astrof_state *state = space->machine().driver_data<astrof_state>();
- state->m_flipscreen = ((data >> 0) & 0x01) & input_port_read(space->machine(), "CAB");
+ m_flipscreen = ((data >> 0) & 0x01) & input_port_read(machine(), "CAB");
/* this ties to the CLR pin of the shift registers */
- state->m_screen_off = (data & 0x02) ? TRUE : FALSE;
+ m_screen_off = (data & 0x02) ? TRUE : FALSE;
/* D2 - not connected in the schematics, but at one point Astro Fighter sets it to 1 */
/* D3-D7 - not connected */
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ machine().primary_screen->update_partial(machine().primary_screen->vpos());
}
@@ -330,10 +326,10 @@ static void astrof_set_video_control_2( running_machine &machine, UINT8 data )
/* D4-D7 - not connected */
}
-static WRITE8_HANDLER( astrof_video_control_2_w )
+WRITE8_MEMBER(astrof_state::astrof_video_control_2_w)
{
- astrof_set_video_control_2(space->machine(), data);
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ astrof_set_video_control_2(machine(), data);
+ machine().primary_screen->update_partial(machine().primary_screen->vpos());
}
@@ -350,10 +346,10 @@ static void spfghmk2_set_video_control_2( running_machine &machine, UINT8 data )
/* D3-D7 - not connected */
}
-static WRITE8_HANDLER( spfghmk2_video_control_2_w )
+WRITE8_MEMBER(astrof_state::spfghmk2_video_control_2_w)
{
- spfghmk2_set_video_control_2(space->machine(), data);
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ spfghmk2_set_video_control_2(machine(), data);
+ machine().primary_screen->update_partial(machine().primary_screen->vpos());
}
@@ -369,10 +365,10 @@ static void tomahawk_set_video_control_2( running_machine &machine, UINT8 data )
state->m_red_on = (data & 0x08) ? TRUE : FALSE;
}
-static WRITE8_HANDLER( tomahawk_video_control_2_w )
+WRITE8_MEMBER(astrof_state::tomahawk_video_control_2_w)
{
- tomahawk_set_video_control_2(space->machine(), data);
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ tomahawk_set_video_control_2(machine(), data);
+ machine().primary_screen->update_partial(machine().primary_screen->vpos());
}
@@ -452,37 +448,34 @@ static SCREEN_UPDATE_RGB32( tomahawk )
*
*************************************/
-static READ8_HANDLER( shoot_r )
+READ8_MEMBER(astrof_state::shoot_r)
{
/* not really sure about this */
- return space->machine().rand() & 8;
+ return machine().rand() & 8;
}
-static READ8_HANDLER( abattle_coin_prot_r )
+READ8_MEMBER(astrof_state::abattle_coin_prot_r)
{
- astrof_state *state = space->machine().driver_data<astrof_state>();
- state->m_abattle_count = (state->m_abattle_count + 1) % 0x0101;
- return state->m_abattle_count ? 0x07 : 0x00;
+ m_abattle_count = (m_abattle_count + 1) % 0x0101;
+ return m_abattle_count ? 0x07 : 0x00;
}
-static READ8_HANDLER( afire_coin_prot_r )
+READ8_MEMBER(astrof_state::afire_coin_prot_r)
{
- astrof_state *state = space->machine().driver_data<astrof_state>();
- state->m_abattle_count = state->m_abattle_count ^ 0x01;
- return state->m_abattle_count ? 0x07 : 0x00;
+ m_abattle_count = m_abattle_count ^ 0x01;
+ return m_abattle_count ? 0x07 : 0x00;
}
-static READ8_HANDLER( tomahawk_protection_r )
+READ8_MEMBER(astrof_state::tomahawk_protection_r)
{
- astrof_state *state = space->machine().driver_data<astrof_state>();
/* flip the byte */
- return BITSWAP8(*state->m_tomahawk_protection, 0, 1, 2, 3, 4, 5, 6, 7);
+ return BITSWAP8(*m_tomahawk_protection, 0, 1, 2, 3, 4, 5, 6, 7);
}
@@ -587,17 +580,17 @@ static MACHINE_RESET( abattle )
static ADDRESS_MAP_START( astrof_map, AS_PROGRAM, 8, astrof_state )
AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM
AM_RANGE(0x2000, 0x3fff) AM_NOP
- AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE_LEGACY(astrof_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size)
+ AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(astrof_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size)
AM_RANGE(0x6000, 0x7fff) AM_NOP
AM_RANGE(0x8000, 0x8002) AM_MIRROR(0x1ff8) AM_NOP
AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(m_astrof_color)
- AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(video_control_1_w)
- AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(astrof_video_control_2_w)
+ AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(video_control_1_w)
+ AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(astrof_video_control_2_w)
AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(astrof_audio_1_w)
AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(astrof_audio_2_w)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READ_PORT("IN") AM_WRITENOP
AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READ_PORT("DSW") AM_WRITENOP
- AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READ_LEGACY(irq_clear_r) AM_WRITENOP
+ AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READ(irq_clear_r) AM_WRITENOP
AM_RANGE(0xa003, 0xa007) AM_MIRROR(0x1ff8) AM_NOP
AM_RANGE(0xc000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -606,17 +599,17 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( spfghmk2_map, AS_PROGRAM, 8, astrof_state )
AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM
AM_RANGE(0x2000, 0x3fff) AM_NOP
- AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE_LEGACY(astrof_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size)
+ AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(astrof_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size)
AM_RANGE(0x6000, 0x7fff) AM_NOP
AM_RANGE(0x8000, 0x8002) AM_MIRROR(0x1ff8) AM_NOP
AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(m_astrof_color)
- AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(video_control_1_w)
- AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(spfghmk2_video_control_2_w)
+ AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(video_control_1_w)
+ AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(spfghmk2_video_control_2_w)
AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(spfghmk2_audio_w)
AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_NOP
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READ_PORT("IN") AM_WRITENOP
AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READ_PORT("DSW") AM_WRITENOP
- AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READ_LEGACY(irq_clear_r) AM_WRITENOP
+ AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READ(irq_clear_r) AM_WRITENOP
AM_RANGE(0xa003, 0xa007) AM_MIRROR(0x1ff8) AM_NOP
AM_RANGE(0xc000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -625,18 +618,18 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( tomahawk_map, AS_PROGRAM, 8, astrof_state )
AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM
AM_RANGE(0x2000, 0x3fff) AM_NOP
- AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE_LEGACY(tomahawk_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size)
+ AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(tomahawk_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size)
AM_RANGE(0x6000, 0x7fff) AM_NOP
AM_RANGE(0x8000, 0x8002) AM_MIRROR(0x1ff8) AM_NOP
AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(m_astrof_color)
- AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(video_control_1_w)
- AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(tomahawk_video_control_2_w)
+ AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(video_control_1_w)
+ AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(tomahawk_video_control_2_w)
AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(tomahawk_audio_w)
AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(m_tomahawk_protection)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READ_PORT("IN") AM_WRITENOP
AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READ_PORT("DSW") AM_WRITENOP
- AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READ_LEGACY(irq_clear_r) AM_WRITENOP
- AM_RANGE(0xa003, 0xa003) AM_MIRROR(0x1ff8) AM_READ_LEGACY(tomahawk_protection_r) AM_WRITENOP
+ AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READ(irq_clear_r) AM_WRITENOP
+ AM_RANGE(0xa003, 0xa003) AM_MIRROR(0x1ff8) AM_READ(tomahawk_protection_r) AM_WRITENOP
AM_RANGE(0xa004, 0xa007) AM_MIRROR(0x1ff8) AM_NOP
AM_RANGE(0xc000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -1307,8 +1300,9 @@ static DRIVER_INIT( abattle )
rom[i] = prom[rom[i]];
/* set up protection handlers */
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(abattle_coin_prot_r));
+ astrof_state *state = machine.driver_data<astrof_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),state));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::abattle_coin_prot_r),state));
}
@@ -1321,8 +1315,9 @@ static DRIVER_INIT( afire )
rom[i] = ~rom[i];
/* set up protection handlers */
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(afire_coin_prot_r));
+ astrof_state *state = machine.driver_data<astrof_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),state));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::afire_coin_prot_r),state));
}
@@ -1335,8 +1330,9 @@ static DRIVER_INIT( sstarbtl )
rom[i] = ~rom[i];
/* set up protection handlers */
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(abattle_coin_prot_r));
+ astrof_state *state = machine.driver_data<astrof_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),state));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::abattle_coin_prot_r),state));
}
diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c
index 187d38217b9..ae6459c3b39 100644
--- a/src/mame/drivers/asuka.c
+++ b/src/mame/drivers/asuka.c
@@ -247,9 +247,9 @@ static INTERRUPT_GEN( cadash_interrupt )
SOUND
************************************************/
-static WRITE8_HANDLER( sound_bankswitch_w )
+WRITE8_MEMBER(asuka_state::sound_bankswitch_w)
{
- memory_set_bank(space->machine(), "bank1", data & 0x03);
+ memory_set_bank(machine(), "bank1", data & 0x03);
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_2151_w )
@@ -276,10 +276,9 @@ static void asuka_msm5205_vck( device_t *device )
}
}
-static WRITE8_HANDLER( asuka_msm5205_address_w )
+WRITE8_MEMBER(asuka_state::asuka_msm5205_address_w)
{
- asuka_state *state = space->machine().driver_data<asuka_state>();
- state->m_adpcm_pos = (state->m_adpcm_pos & 0x00ff) | (data << 8);
+ m_adpcm_pos = (m_adpcm_pos & 0x00ff) | (data << 8);
}
static WRITE8_DEVICE_HANDLER( asuka_msm5205_start_w )
@@ -296,12 +295,12 @@ static WRITE8_DEVICE_HANDLER( asuka_msm5205_stop_w )
static UINT8 *cadash_shared_ram;
-static READ16_HANDLER( cadash_share_r )
+READ16_MEMBER(asuka_state::cadash_share_r)
{
return cadash_shared_ram[offset];
}
-static WRITE16_HANDLER( cadash_share_w )
+WRITE16_MEMBER(asuka_state::cadash_share_w)
{
cadash_shared_ram[offset] = data & 0xff;
}
@@ -352,7 +351,7 @@ static ADDRESS_MAP_START( cadash_map, AS_PROGRAM, 16, asuka_state )
AM_RANGE(0x0c0000, 0x0c0001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
AM_RANGE(0x0c0002, 0x0c0003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
AM_RANGE(0x100000, 0x107fff) AM_RAM
- AM_RANGE(0x800000, 0x800fff) AM_READWRITE_LEGACY(cadash_share_r,cadash_share_w) /* network ram */
+ AM_RANGE(0x800000, 0x800fff) AM_READWRITE(cadash_share_r,cadash_share_w) /* network ram */
AM_RANGE(0x900000, 0x90000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
AM_RANGE(0xa00000, 0xa0000f) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_4bpg_word_w)
AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("pc090oj", pc090oj_word_r, pc090oj_word_w) /* sprite ram */
@@ -389,7 +388,7 @@ static ADDRESS_MAP_START( bonzeadv_z80_map, AS_PROGRAM, 8, asuka_state )
AM_RANGE(0xe600, 0xe600) AM_WRITENOP
AM_RANGE(0xee00, 0xee00) AM_WRITENOP
AM_RANGE(0xf000, 0xf000) AM_WRITENOP
- AM_RANGE(0xf200, 0xf200) AM_WRITE_LEGACY(sound_bankswitch_w)
+ AM_RANGE(0xf200, 0xf200) AM_WRITE(sound_bankswitch_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( z80_map, AS_PROGRAM, 8, asuka_state )
@@ -400,7 +399,7 @@ static ADDRESS_MAP_START( z80_map, AS_PROGRAM, 8, asuka_state )
// AM_RANGE(0x9002, 0x9100) AM_READNOP
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
- AM_RANGE(0xb000, 0xb000) AM_WRITE_LEGACY(asuka_msm5205_address_w)
+ AM_RANGE(0xb000, 0xb000) AM_WRITE(asuka_msm5205_address_w)
AM_RANGE(0xc000, 0xc000) AM_DEVWRITE_LEGACY("msm", asuka_msm5205_start_w)
AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("msm", asuka_msm5205_stop_w)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/atetris.c b/src/mame/drivers/atetris.c
index 6c3323ef553..ae790f480a6 100644
--- a/src/mame/drivers/atetris.c
+++ b/src/mame/drivers/atetris.c
@@ -82,9 +82,9 @@ static TIMER_CALLBACK( interrupt_gen )
}
-static WRITE8_HANDLER( irq_ack_w )
+WRITE8_MEMBER(atetris_state::irq_ack_w)
{
- cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -138,17 +138,16 @@ static MACHINE_RESET( atetris )
*
*************************************/
-static READ8_HANDLER( atetris_slapstic_r )
+READ8_MEMBER(atetris_state::atetris_slapstic_r)
{
- atetris_state *state = space->machine().driver_data<atetris_state>();
- int result = state->m_slapstic_base[0x2000 + offset];
- int new_bank = slapstic_tweak(space, offset) & 1;
+ int result = m_slapstic_base[0x2000 + offset];
+ int new_bank = slapstic_tweak(&space, offset) & 1;
/* update for the new bank */
- if (new_bank != state->m_current_bank)
+ if (new_bank != m_current_bank)
{
- state->m_current_bank = new_bank;
- memcpy(state->m_slapstic_base, &state->m_slapstic_source[state->m_current_bank * 0x4000], 0x4000);
+ m_current_bank = new_bank;
+ memcpy(m_slapstic_base, &m_slapstic_source[m_current_bank * 0x4000], 0x4000);
}
return result;
}
@@ -161,10 +160,10 @@ static READ8_HANDLER( atetris_slapstic_r )
*
*************************************/
-static WRITE8_HANDLER( coincount_w )
+WRITE8_MEMBER(atetris_state::coincount_w)
{
- coin_counter_w(space->machine(), 0, (data >> 5) & 1);
- coin_counter_w(space->machine(), 1, (data >> 4) & 1);
+ coin_counter_w(machine(), 0, (data >> 5) & 1);
+ coin_counter_w(machine(), 1, (data >> 4) & 1);
}
@@ -175,21 +174,19 @@ static WRITE8_HANDLER( coincount_w )
*
*************************************/
-static WRITE8_HANDLER( nvram_w )
+WRITE8_MEMBER(atetris_state::nvram_w)
{
- atetris_state *state = space->machine().driver_data<atetris_state>();
- if (state->m_nvram_write_enable)
- state->m_nvram[offset] = data;
- state->m_nvram_write_enable = 0;
+ if (m_nvram_write_enable)
+ m_nvram[offset] = data;
+ m_nvram_write_enable = 0;
}
-static WRITE8_HANDLER( nvram_enable_w )
+WRITE8_MEMBER(atetris_state::nvram_enable_w)
{
- atetris_state *state = space->machine().driver_data<atetris_state>();
- state->m_nvram_write_enable = 1;
+ m_nvram_write_enable = 1;
}
@@ -205,15 +202,15 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, atetris_state )
AM_RANGE(0x0000, 0x0fff) AM_RAM
AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE_LEGACY(atetris_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0x2000, 0x20ff) AM_MIRROR(0x0300) AM_RAM_WRITE_LEGACY(paletteram_RRRGGGBB_w) AM_BASE_GENERIC(paletteram)
- AM_RANGE(0x2400, 0x25ff) AM_MIRROR(0x0200) AM_RAM_WRITE_LEGACY(nvram_w) AM_SHARE("nvram")
+ AM_RANGE(0x2400, 0x25ff) AM_MIRROR(0x0200) AM_RAM_WRITE(nvram_w) AM_SHARE("nvram")
AM_RANGE(0x2800, 0x280f) AM_MIRROR(0x03e0) AM_DEVREADWRITE_LEGACY("pokey1", pokey_r, pokey_w)
AM_RANGE(0x2810, 0x281f) AM_MIRROR(0x03e0) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w)
AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(watchdog_reset_w)
- AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(nvram_enable_w)
- AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(irq_ack_w)
- AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(coincount_w)
+ AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_WRITE(nvram_enable_w)
+ AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE(irq_ack_w)
+ AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE(coincount_w)
AM_RANGE(0x4000, 0x5fff) AM_ROM
- AM_RANGE(0x6000, 0x7fff) AM_READ_LEGACY(atetris_slapstic_r)
+ AM_RANGE(0x6000, 0x7fff) AM_READ(atetris_slapstic_r)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -222,18 +219,18 @@ static ADDRESS_MAP_START( atetrisb2_map, AS_PROGRAM, 8, atetris_state )
AM_RANGE(0x0000, 0x0fff) AM_RAM
AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE_LEGACY(atetris_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE_LEGACY(paletteram_RRRGGGBB_w) AM_BASE_GENERIC(paletteram)
- AM_RANGE(0x2400, 0x25ff) AM_RAM_WRITE_LEGACY(nvram_w) AM_SHARE("nvram")
+ AM_RANGE(0x2400, 0x25ff) AM_RAM_WRITE(nvram_w) AM_SHARE("nvram")
AM_RANGE(0x2802, 0x2802) AM_DEVWRITE_LEGACY("sn1", sn76496_w)
AM_RANGE(0x2804, 0x2804) AM_DEVWRITE_LEGACY("sn2", sn76496_w)
AM_RANGE(0x2806, 0x2806) AM_DEVWRITE_LEGACY("sn3", sn76496_w)
AM_RANGE(0x2808, 0x2808) AM_READ_PORT("IN0")
AM_RANGE(0x2818, 0x2818) AM_READ_PORT("IN1")
AM_RANGE(0x3000, 0x3000) AM_WRITE_LEGACY(watchdog_reset_w)
- AM_RANGE(0x3400, 0x3400) AM_WRITE_LEGACY(nvram_enable_w)
- AM_RANGE(0x3800, 0x3800) AM_WRITE_LEGACY(irq_ack_w)
- AM_RANGE(0x3c00, 0x3c00) AM_WRITE_LEGACY(coincount_w)
+ AM_RANGE(0x3400, 0x3400) AM_WRITE(nvram_enable_w)
+ AM_RANGE(0x3800, 0x3800) AM_WRITE(irq_ack_w)
+ AM_RANGE(0x3c00, 0x3c00) AM_WRITE(coincount_w)
AM_RANGE(0x4000, 0x5fff) AM_ROM
- AM_RANGE(0x6000, 0x7fff) AM_READ_LEGACY(atetris_slapstic_r)
+ AM_RANGE(0x6000, 0x7fff) AM_READ(atetris_slapstic_r)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
diff --git a/src/mame/drivers/avalnche.c b/src/mame/drivers/avalnche.c
index efec6cf57c1..1763d0105f2 100644
--- a/src/mame/drivers/avalnche.c
+++ b/src/mame/drivers/avalnche.c
@@ -83,31 +83,30 @@ static SCREEN_UPDATE_RGB32( avalnche )
*
*************************************/
-static WRITE8_HANDLER( avalance_video_invert_w )
+WRITE8_MEMBER(avalnche_state::avalance_video_invert_w)
{
- avalnche_state *state = space->machine().driver_data<avalnche_state>();
- state->m_avalance_video_inverted = data & 0x01;
+ m_avalance_video_inverted = data & 0x01;
}
-static WRITE8_HANDLER( catch_coin_counter_w )
+WRITE8_MEMBER(avalnche_state::catch_coin_counter_w)
{
- coin_counter_w(space->machine(), 0, data & 1);
- coin_counter_w(space->machine(), 1, data & 2);
+ coin_counter_w(machine(), 0, data & 1);
+ coin_counter_w(machine(), 1, data & 2);
}
-static WRITE8_HANDLER( avalance_credit_1_lamp_w )
+WRITE8_MEMBER(avalnche_state::avalance_credit_1_lamp_w)
{
- set_led_status(space->machine(), 0, data & 1);
+ set_led_status(machine(), 0, data & 1);
}
-static WRITE8_HANDLER( avalance_credit_2_lamp_w )
+WRITE8_MEMBER(avalnche_state::avalance_credit_2_lamp_w)
{
- set_led_status(space->machine(), 1, data & 1);
+ set_led_status(machine(), 1, data & 1);
}
-static WRITE8_HANDLER( avalance_start_lamp_w )
+WRITE8_MEMBER(avalnche_state::avalance_start_lamp_w)
{
- set_led_status(space->machine(), 2, data & 1);
+ set_led_status(machine(), 2, data & 1);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, avalnche_state )
@@ -118,12 +117,12 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, avalnche_state )
AM_RANGE(0x2002, 0x2002) AM_MIRROR(0x0ffc) AM_READ_PORT("PADDLE")
AM_RANGE(0x2003, 0x2003) AM_MIRROR(0x0ffc) AM_READNOP
AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0fff) AM_WRITE_LEGACY(watchdog_reset_w)
- AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0ff8) AM_WRITE_LEGACY(avalance_credit_1_lamp_w)
+ AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0ff8) AM_WRITE(avalance_credit_1_lamp_w)
AM_RANGE(0x4001, 0x4001) AM_MIRROR(0x0ff8) AM_DEVWRITE_LEGACY("discrete", avalnche_attract_enable_w)
- AM_RANGE(0x4002, 0x4002) AM_MIRROR(0x0ff8) AM_WRITE_LEGACY(avalance_video_invert_w)
- AM_RANGE(0x4003, 0x4003) AM_MIRROR(0x0ff8) AM_WRITE_LEGACY(avalance_credit_2_lamp_w)
+ AM_RANGE(0x4002, 0x4002) AM_MIRROR(0x0ff8) AM_WRITE(avalance_video_invert_w)
+ AM_RANGE(0x4003, 0x4003) AM_MIRROR(0x0ff8) AM_WRITE(avalance_credit_2_lamp_w)
AM_RANGE(0x4004, 0x4006) AM_MIRROR(0x0ff8) AM_DEVWRITE_LEGACY("discrete", avalnche_audio_w)
- AM_RANGE(0x4007, 0x4007) AM_MIRROR(0x0ff8) AM_WRITE_LEGACY(avalance_start_lamp_w)
+ AM_RANGE(0x4007, 0x4007) AM_MIRROR(0x0ff8) AM_WRITE(avalance_start_lamp_w)
AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("discrete", avalnche_noise_amplitude_w)
AM_RANGE(0x6000, 0x7fff) AM_ROM
ADDRESS_MAP_END
@@ -136,13 +135,13 @@ static ADDRESS_MAP_START( catch_map, AS_PROGRAM, 8, avalnche_state )
AM_RANGE(0x2002, 0x2002) AM_MIRROR(0x0ffc) AM_READ_PORT("PADDLE")
AM_RANGE(0x2003, 0x2003) AM_MIRROR(0x0ffc) AM_READNOP
AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0fff) AM_WRITE_LEGACY(watchdog_reset_w)
- AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0ff8) AM_WRITE_LEGACY(avalance_credit_1_lamp_w)
+ AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0ff8) AM_WRITE(avalance_credit_1_lamp_w)
// AM_RANGE(0x4001, 0x4001) AM_MIRROR(0x0ff8) AM_DEVWRITE_LEGACY("discrete", avalnche_attract_enable_w) /* It is attract_enable just like avalnche, but not hooked up yet. */
- AM_RANGE(0x4002, 0x4002) AM_MIRROR(0x0ff8) AM_WRITE_LEGACY(avalance_video_invert_w)
- AM_RANGE(0x4003, 0x4003) AM_MIRROR(0x0ff8) AM_WRITE_LEGACY(avalance_credit_2_lamp_w)
+ AM_RANGE(0x4002, 0x4002) AM_MIRROR(0x0ff8) AM_WRITE(avalance_video_invert_w)
+ AM_RANGE(0x4003, 0x4003) AM_MIRROR(0x0ff8) AM_WRITE(avalance_credit_2_lamp_w)
AM_RANGE(0x4004, 0x4006) AM_MIRROR(0x0ff8) AM_WRITE_LEGACY(catch_audio_w)
- AM_RANGE(0x4007, 0x4007) AM_MIRROR(0x0ff8) AM_WRITE_LEGACY(avalance_start_lamp_w)
- AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_WRITE_LEGACY(catch_coin_counter_w)
+ AM_RANGE(0x4007, 0x4007) AM_MIRROR(0x0ff8) AM_WRITE(avalance_start_lamp_w)
+ AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_WRITE(catch_coin_counter_w)
AM_RANGE(0x7000, 0x7fff) AM_ROM
ADDRESS_MAP_END
diff --git a/src/mame/drivers/aztarac.c b/src/mame/drivers/aztarac.c
index 360cf767127..020a3a9370c 100644
--- a/src/mame/drivers/aztarac.c
+++ b/src/mame/drivers/aztarac.c
@@ -48,10 +48,9 @@ static MACHINE_RESET( aztarac )
*
*************************************/
-static READ16_HANDLER( nvram_r )
+READ16_MEMBER(aztarac_state::nvram_r)
{
- aztarac_state *state = space->machine().driver_data<aztarac_state>();
- return state->m_nvram[offset] | 0xfff0;
+ return m_nvram[offset] | 0xfff0;
}
@@ -62,10 +61,10 @@ static READ16_HANDLER( nvram_r )
*
*************************************/
-static READ16_HANDLER( joystick_r )
+READ16_MEMBER(aztarac_state::joystick_r)
{
- return (((input_port_read(space->machine(), "STICKZ") - 0xf) << 8) |
- ((input_port_read(space->machine(), "STICKY") - 0xf) & 0xff));
+ return (((input_port_read(machine(), "STICKZ") - 0xf) << 8) |
+ ((input_port_read(machine(), "STICKY") - 0xf) & 0xff));
}
@@ -78,8 +77,8 @@ static READ16_HANDLER( joystick_r )
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, aztarac_state )
AM_RANGE(0x000000, 0x00bfff) AM_ROM
- AM_RANGE(0x022000, 0x0220ff) AM_READ_LEGACY(nvram_r) AM_WRITEONLY AM_SHARE("nvram")
- AM_RANGE(0x027000, 0x027001) AM_READ_LEGACY(joystick_r)
+ AM_RANGE(0x022000, 0x0220ff) AM_READ(nvram_r) AM_WRITEONLY AM_SHARE("nvram")
+ AM_RANGE(0x027000, 0x027001) AM_READ(joystick_r)
AM_RANGE(0x027004, 0x027005) AM_READ_PORT("INPUTS")
AM_RANGE(0x027008, 0x027009) AM_READWRITE_LEGACY(aztarac_sound_r, aztarac_sound_w)
AM_RANGE(0x02700c, 0x02700d) AM_READ_PORT("DIAL")
diff --git a/src/mame/drivers/bagman.c b/src/mame/drivers/bagman.c
index 8c26014d631..4f8ad08633b 100644
--- a/src/mame/drivers/bagman.c
+++ b/src/mame/drivers/bagman.c
@@ -97,16 +97,15 @@ static WRITE8_DEVICE_HANDLER( bagman_ls259_w )
}
}
-static WRITE8_HANDLER( bagman_coin_counter_w )
+WRITE8_MEMBER(bagman_state::bagman_coin_counter_w)
{
- coin_counter_w(space->machine(), offset,data);
+ coin_counter_w(machine(), offset,data);
}
-static WRITE8_HANDLER( irq_mask_w )
+WRITE8_MEMBER(bagman_state::irq_mask_w)
{
- bagman_state *state = space->machine().driver_data<bagman_state>();
- state->m_irq_mask = data & 1;
+ m_irq_mask = data & 1;
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, bagman_state )
@@ -117,7 +116,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, bagman_state )
AM_RANGE(0x9c00, 0x9fff) AM_WRITENOP /* written to, but unused */
AM_RANGE(0xa000, 0xa000) AM_READ_LEGACY(bagman_pal16r6_r)
//AM_RANGE(0xa800, 0xa805) AM_READ_LEGACY(bagman_ls259_r) /*just for debugging purposes*/
- AM_RANGE(0xa000, 0xa000) AM_WRITE_LEGACY(irq_mask_w)
+ AM_RANGE(0xa000, 0xa000) AM_WRITE(irq_mask_w)
AM_RANGE(0xa001, 0xa002) AM_WRITE_LEGACY(bagman_flipscreen_w)
AM_RANGE(0xa003, 0xa003) AM_WRITEONLY AM_BASE(m_video_enable)
AM_RANGE(0xc000, 0xffff) AM_ROM /* Super Bagman only */
@@ -125,7 +124,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, bagman_state )
/* here only to initialize the pointer, */
/* writes are handled by bagman_colorram_w */
AM_RANGE(0xa800, 0xa805) AM_DEVWRITE_LEGACY("tmsprom", bagman_ls259_w) /* TMS5110 driving state machine */
- AM_RANGE(0xa004, 0xa004) AM_WRITE_LEGACY(bagman_coin_counter_w)
+ AM_RANGE(0xa004, 0xa004) AM_WRITE(bagman_coin_counter_w)
AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW")
AM_RANGE(0xb800, 0xb800) AM_READNOP /* looks like watchdog from schematics */
@@ -147,10 +146,10 @@ static ADDRESS_MAP_START( pickin_map, AS_PROGRAM, 8, bagman_state )
/* here only to initialize the pointer, */
/* writes are handled by bagman_colorram_w */
AM_RANGE(0x9c00, 0x9fff) AM_WRITENOP /* written to, but unused */
- AM_RANGE(0xa000, 0xa000) AM_WRITE_LEGACY(irq_mask_w)
+ AM_RANGE(0xa000, 0xa000) AM_WRITE(irq_mask_w)
AM_RANGE(0xa001, 0xa002) AM_WRITE_LEGACY(bagman_flipscreen_w)
AM_RANGE(0xa003, 0xa003) AM_WRITEONLY AM_BASE(m_video_enable)
- AM_RANGE(0xa004, 0xa004) AM_WRITE_LEGACY(bagman_coin_counter_w)
+ AM_RANGE(0xa004, 0xa004) AM_WRITE(bagman_coin_counter_w)
AM_RANGE(0xa800, 0xa800) AM_READ_PORT("DSW")
diff --git a/src/mame/drivers/baraduke.c b/src/mame/drivers/baraduke.c
index 13740ed678f..7b156cf2e71 100644
--- a/src/mame/drivers/baraduke.c
+++ b/src/mame/drivers/baraduke.c
@@ -112,52 +112,50 @@ DIP locations verified for:
#include "includes/baraduke.h"
-static WRITE8_HANDLER( inputport_select_w )
+WRITE8_MEMBER(baraduke_state::inputport_select_w)
{
- baraduke_state *state = space->machine().driver_data<baraduke_state>();
if ((data & 0xe0) == 0x60)
- state->m_inputport_selected = data & 0x07;
+ m_inputport_selected = data & 0x07;
else if ((data & 0xe0) == 0xc0)
{
- coin_lockout_global_w(space->machine(), ~data & 1);
- coin_counter_w(space->machine(), 0,data & 2);
- coin_counter_w(space->machine(), 1,data & 4);
+ coin_lockout_global_w(machine(), ~data & 1);
+ coin_counter_w(machine(), 0,data & 2);
+ coin_counter_w(machine(), 1,data & 4);
}
}
-static READ8_HANDLER( inputport_r )
+READ8_MEMBER(baraduke_state::inputport_r)
{
- baraduke_state *state = space->machine().driver_data<baraduke_state>();
- switch (state->m_inputport_selected)
+ switch (m_inputport_selected)
{
case 0x00: /* DSW A (bits 0-4) */
- return (input_port_read(space->machine(), "DSWA") & 0xf8) >> 3;
+ return (input_port_read(machine(), "DSWA") & 0xf8) >> 3;
case 0x01: /* DSW A (bits 5-7), DSW B (bits 0-1) */
- return ((input_port_read(space->machine(), "DSWA") & 0x07) << 2) | ((input_port_read(space->machine(), "DSWB") & 0xc0) >> 6);
+ return ((input_port_read(machine(), "DSWA") & 0x07) << 2) | ((input_port_read(machine(), "DSWB") & 0xc0) >> 6);
case 0x02: /* DSW B (bits 2-6) */
- return (input_port_read(space->machine(), "DSWB") & 0x3e) >> 1;
+ return (input_port_read(machine(), "DSWB") & 0x3e) >> 1;
case 0x03: /* DSW B (bit 7), DSW C (bits 0-3) */
- return ((input_port_read(space->machine(), "DSWB") & 0x01) << 4) | (input_port_read(space->machine(), "EDGE") & 0x0f);
+ return ((input_port_read(machine(), "DSWB") & 0x01) << 4) | (input_port_read(machine(), "EDGE") & 0x0f);
case 0x04: /* coins, start */
- return input_port_read(space->machine(), "IN0");
+ return input_port_read(machine(), "IN0");
case 0x05: /* 2P controls */
- return input_port_read(space->machine(), "IN2");
+ return input_port_read(machine(), "IN2");
case 0x06: /* 1P controls */
- return input_port_read(space->machine(), "IN1");
+ return input_port_read(machine(), "IN1");
default:
return 0xff;
}
}
-static WRITE8_HANDLER( baraduke_lamps_w )
+WRITE8_MEMBER(baraduke_state::baraduke_lamps_w)
{
- set_led_status(space->machine(), 0,data & 0x08);
- set_led_status(space->machine(), 1,data & 0x10);
+ set_led_status(machine(), 0,data & 0x08);
+ set_led_status(machine(), 1,data & 0x10);
}
-static WRITE8_HANDLER( baraduke_irq_ack_w )
+WRITE8_MEMBER(baraduke_state::baraduke_irq_ack_w)
{
- cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -168,23 +166,22 @@ static ADDRESS_MAP_START( baraduke_map, AS_PROGRAM, 8, baraduke_state )
AM_RANGE(0x4000, 0x43ff) AM_DEVREADWRITE_LEGACY("namco", namcos1_cus30_r,namcos1_cus30_w) /* PSG device, shared RAM */
AM_RANGE(0x4800, 0x4fff) AM_READWRITE_LEGACY(baraduke_textram_r,baraduke_textram_w) AM_BASE(m_textram)/* video RAM (text layer) */
AM_RANGE(0x8000, 0x8000) AM_WRITE_LEGACY(watchdog_reset_w) /* watchdog reset */
- AM_RANGE(0x8800, 0x8800) AM_WRITE_LEGACY(baraduke_irq_ack_w) /* irq acknowledge */
+ AM_RANGE(0x8800, 0x8800) AM_WRITE(baraduke_irq_ack_w) /* irq acknowledge */
AM_RANGE(0xb000, 0xb002) AM_WRITE_LEGACY(baraduke_scroll0_w) /* scroll (layer 0) */
AM_RANGE(0xb004, 0xb006) AM_WRITE_LEGACY(baraduke_scroll1_w) /* scroll (layer 1) */
AM_RANGE(0x6000, 0xffff) AM_ROM /* ROM */
ADDRESS_MAP_END
-static READ8_HANDLER( soundkludge_r )
+READ8_MEMBER(baraduke_state::soundkludge_r)
{
- baraduke_state *state = space->machine().driver_data<baraduke_state>();
- return ((state->m_counter++) >> 4) & 0xff;
+ return ((m_counter++) >> 4) & 0xff;
}
static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, baraduke_state )
AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r,m6801_io_w)/* internal registers */
AM_RANGE(0x0080, 0x00ff) AM_RAM /* built in RAM */
- AM_RANGE(0x1105, 0x1105) AM_READ_LEGACY(soundkludge_r) /* cures speech */
+ AM_RANGE(0x1105, 0x1105) AM_READ(soundkludge_r) /* cures speech */
AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE_LEGACY("namco", namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */
AM_RANGE(0x8000, 0xbfff) AM_ROM /* MCU external ROM */
AM_RANGE(0x8000, 0x8000) AM_WRITENOP /* watchdog reset? */
@@ -194,16 +191,16 @@ static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, baraduke_state )
ADDRESS_MAP_END
-static READ8_HANDLER( readFF )
+READ8_MEMBER(baraduke_state::readFF)
{
return 0xff;
}
static ADDRESS_MAP_START( mcu_port_map, AS_IO, 8, baraduke_state )
- AM_RANGE(M6801_PORT1, M6801_PORT1) AM_READ_LEGACY(inputport_r) /* input ports read */
- AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE_LEGACY(inputport_select_w) /* input port select */
- AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READ_LEGACY(readFF) /* leds won't work otherwise */
- AM_RANGE(M6801_PORT2, M6801_PORT2) AM_WRITE_LEGACY(baraduke_lamps_w) /* lamps */
+ AM_RANGE(M6801_PORT1, M6801_PORT1) AM_READ(inputport_r) /* input ports read */
+ AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(inputport_select_w) /* input port select */
+ AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READ(readFF) /* leds won't work otherwise */
+ AM_RANGE(M6801_PORT2, M6801_PORT2) AM_WRITE(baraduke_lamps_w) /* lamps */
ADDRESS_MAP_END
diff --git a/src/mame/drivers/battlane.c b/src/mame/drivers/battlane.c
index e7e969922ca..6e5edfbc66e 100644
--- a/src/mame/drivers/battlane.c
+++ b/src/mame/drivers/battlane.c
@@ -20,11 +20,10 @@
*
*************************************/
-static WRITE8_HANDLER( battlane_cpu_command_w )
+WRITE8_MEMBER(battlane_state::battlane_cpu_command_w)
{
- battlane_state *state = space->machine().driver_data<battlane_state>();
- state->m_cpu_control = data;
+ m_cpu_control = data;
/*
CPU control register
@@ -36,7 +35,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w )
0x01 = Y Scroll MSB
*/
- flip_screen_set(space->machine(), data & 0x80);
+ flip_screen_set(machine(), data & 0x80);
/*
I think that the NMI is an inhibitor. It is constantly set
@@ -47,10 +46,10 @@ static WRITE8_HANDLER( battlane_cpu_command_w )
*/
/*
- if (~state->m_cpu_control & 0x08)
+ if (~m_cpu_control & 0x08)
{
- device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, PULSE_LINE);
- device_set_input_line(state->m_subcpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_maincpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_subcpu, INPUT_LINE_NMI, PULSE_LINE);
}
*/
@@ -58,7 +57,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w )
CPU2's SWI will trigger an 6809 IRQ on the master by resetting 0x04
Master will respond by setting the bit back again
*/
- device_set_input_line(state->m_maincpu, M6809_IRQ_LINE, data & 0x04 ? CLEAR_LINE : HOLD_LINE);
+ device_set_input_line(m_maincpu, M6809_IRQ_LINE, data & 0x04 ? CLEAR_LINE : HOLD_LINE);
/*
Slave function call (e.g. ROM test):
@@ -76,7 +75,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w )
FA96: 27 FA BEQ $FA92 ; Wait for bit to be set
*/
- device_set_input_line(state->m_subcpu, M6809_IRQ_LINE, data & 0x02 ? CLEAR_LINE : HOLD_LINE);
+ device_set_input_line(m_subcpu, M6809_IRQ_LINE, data & 0x02 ? CLEAR_LINE : HOLD_LINE);
}
static INTERRUPT_GEN( battlane_cpu1_interrupt )
@@ -105,7 +104,7 @@ static ADDRESS_MAP_START( battlane_map, AS_PROGRAM, 8, battlane_state )
AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("P1") AM_WRITE_LEGACY(battlane_video_ctrl_w)
AM_RANGE(0x1c01, 0x1c01) AM_READ_PORT("P2") AM_WRITE_LEGACY(battlane_scrollx_w)
AM_RANGE(0x1c02, 0x1c02) AM_READ_PORT("DSW1") AM_WRITE_LEGACY(battlane_scrolly_w)
- AM_RANGE(0x1c03, 0x1c03) AM_READ_PORT("DSW2") AM_WRITE_LEGACY(battlane_cpu_command_w)
+ AM_RANGE(0x1c03, 0x1c03) AM_READ_PORT("DSW2") AM_WRITE(battlane_cpu_command_w)
AM_RANGE(0x1c04, 0x1c05) AM_DEVREADWRITE_LEGACY("ymsnd", ym3526_r, ym3526_w)
AM_RANGE(0x1e00, 0x1e3f) AM_WRITE_LEGACY(battlane_palette_w)
AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE_LEGACY(battlane_bitmap_w) AM_SHARE("share4")
diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c
index 17907a74df0..5e430a92442 100644
--- a/src/mame/drivers/battlera.c
+++ b/src/mame/drivers/battlera.c
@@ -31,33 +31,31 @@
/******************************************************************************/
-static WRITE8_HANDLER( battlera_sound_w )
+WRITE8_MEMBER(battlera_state::battlera_sound_w)
{
if (offset == 0)
{
soundlatch_w(space,0,data);
- cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE);
}
}
/******************************************************************************/
-static WRITE8_HANDLER( control_data_w )
+WRITE8_MEMBER(battlera_state::control_data_w)
{
- battlera_state *state = space->machine().driver_data<battlera_state>();
- state->m_control_port_select=data;
+ m_control_port_select=data;
}
-static READ8_HANDLER( control_data_r )
+READ8_MEMBER(battlera_state::control_data_r)
{
- battlera_state *state = space->machine().driver_data<battlera_state>();
- switch (state->m_control_port_select)
+ switch (m_control_port_select)
{
- case 0xfe: return input_port_read(space->machine(), "IN0"); /* Player 1 */
- case 0xfd: return input_port_read(space->machine(), "IN1"); /* Player 2 */
- case 0xfb: return input_port_read(space->machine(), "IN2"); /* Coins */
- case 0xf7: return input_port_read(space->machine(), "DSW2"); /* Dip 2 */
- case 0xef: return input_port_read(space->machine(), "DSW1"); /* Dip 1 */
+ case 0xfe: return input_port_read(machine(), "IN0"); /* Player 1 */
+ case 0xfd: return input_port_read(machine(), "IN1"); /* Player 2 */
+ case 0xfb: return input_port_read(machine(), "IN2"); /* Coins */
+ case 0xf7: return input_port_read(machine(), "DSW2"); /* Dip 2 */
+ case 0xef: return input_port_read(machine(), "DSW1"); /* Dip 1 */
}
return 0xff;
@@ -68,12 +66,12 @@ static READ8_HANDLER( control_data_r )
static ADDRESS_MAP_START( battlera_map, AS_PROGRAM, 8, battlera_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x10ffff) AM_READWRITE_LEGACY(HuC6270_debug_r, HuC6270_debug_w) /* Cheat to edit vram data */
- AM_RANGE(0x1e0800, 0x1e0801) AM_WRITE_LEGACY(battlera_sound_w)
+ AM_RANGE(0x1e0800, 0x1e0801) AM_WRITE(battlera_sound_w)
AM_RANGE(0x1e1000, 0x1e13ff) AM_WRITE_LEGACY(battlera_palette_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") /* Main ram */
AM_RANGE(0x1fe000, 0x1fe001) AM_READWRITE_LEGACY(HuC6270_register_r, HuC6270_register_w)
AM_RANGE(0x1fe002, 0x1fe003) AM_WRITE_LEGACY(HuC6270_data_w)
- AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE_LEGACY(control_data_r, control_data_w)
+ AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE(control_data_r, control_data_w)
AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w)
ADDRESS_MAP_END
@@ -97,10 +95,9 @@ static void battlera_adpcm_int(device_t *device)
cputag_set_input_line(device->machine(), "audiocpu", 1, HOLD_LINE);
}
-static WRITE8_HANDLER( battlera_adpcm_data_w )
+WRITE8_MEMBER(battlera_state::battlera_adpcm_data_w)
{
- battlera_state *state = space->machine().driver_data<battlera_state>();
- state->m_msm5205next = data;
+ m_msm5205next = data;
}
static WRITE8_DEVICE_HANDLER( battlera_adpcm_reset_w )
@@ -111,7 +108,7 @@ static WRITE8_DEVICE_HANDLER( battlera_adpcm_reset_w )
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, battlera_state )
AM_RANGE(0x000000, 0x00ffff) AM_ROM
AM_RANGE(0x040000, 0x040001) AM_DEVWRITE_LEGACY("ymsnd", ym2203_w)
- AM_RANGE(0x080000, 0x080001) AM_WRITE_LEGACY(battlera_adpcm_data_w)
+ AM_RANGE(0x080000, 0x080001) AM_WRITE(battlera_adpcm_data_w)
AM_RANGE(0x1fe800, 0x1fe80f) AM_DEVWRITE_LEGACY("c6280", c6280_w)
AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank7") /* Main ram */
AM_RANGE(0x1ff000, 0x1ff001) AM_READ_LEGACY(soundlatch_r) AM_DEVWRITE_LEGACY("msm", battlera_adpcm_reset_w)
diff --git a/src/mame/drivers/battlnts.c b/src/mame/drivers/battlnts.c
index 4106586157d..5df3ab46a9f 100644
--- a/src/mame/drivers/battlnts.c
+++ b/src/mame/drivers/battlnts.c
@@ -32,20 +32,19 @@ static INTERRUPT_GEN( battlnts_interrupt )
device_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
}
-static WRITE8_HANDLER( battlnts_sh_irqtrigger_w )
+WRITE8_MEMBER(battlnts_state::battlnts_sh_irqtrigger_w)
{
- battlnts_state *state = space->machine().driver_data<battlnts_state>();
- device_set_input_line_and_vector(state->m_audiocpu, 0, HOLD_LINE, 0xff);
+ device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff);
}
-static WRITE8_HANDLER( battlnts_bankswitch_w )
+WRITE8_MEMBER(battlnts_state::battlnts_bankswitch_w)
{
/* bits 6 & 7 = bank number */
- memory_set_bank(space->machine(), "bank1", (data & 0xc0) >> 6);
+ memory_set_bank(machine(), "bank1", (data & 0xc0) >> 6);
/* bits 4 & 5 = coin counters */
- coin_counter_w(space->machine(), 0, data & 0x10);
- coin_counter_w(space->machine(), 1, data & 0x20);
+ coin_counter_w(machine(), 0, data & 0x10);
+ coin_counter_w(machine(), 1, data & 0x20);
/* other bits unknown */
}
@@ -68,11 +67,11 @@ static ADDRESS_MAP_START( battlnts_map, AS_PROGRAM, 8, battlnts_state )
AM_RANGE(0x2e02, 0x2e02) AM_READ_PORT("P1")
AM_RANGE(0x2e03, 0x2e03) AM_READ_PORT("DSW3") /* coinsw, testsw, startsw */
AM_RANGE(0x2e04, 0x2e04) AM_READ_PORT("DSW2")
- AM_RANGE(0x2e08, 0x2e08) AM_WRITE_LEGACY(battlnts_bankswitch_w) /* bankswitch control */
+ AM_RANGE(0x2e08, 0x2e08) AM_WRITE(battlnts_bankswitch_w) /* bankswitch control */
AM_RANGE(0x2e0c, 0x2e0c) AM_WRITE_LEGACY(battlnts_spritebank_w) /* sprite bank select */
AM_RANGE(0x2e10, 0x2e10) AM_WRITE_LEGACY(watchdog_reset_w) /* watchdog reset */
AM_RANGE(0x2e14, 0x2e14) AM_WRITE_LEGACY(soundlatch_w) /* sound code # */
- AM_RANGE(0x2e18, 0x2e18) AM_WRITE_LEGACY(battlnts_sh_irqtrigger_w) /* cause interrupt on audio CPU */
+ AM_RANGE(0x2e18, 0x2e18) AM_WRITE(battlnts_sh_irqtrigger_w) /* cause interrupt on audio CPU */
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") /* banked ROM */
AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM 777e02.bin */
ADDRESS_MAP_END
diff --git a/src/mame/drivers/bbusters.c b/src/mame/drivers/bbusters.c
index 95e3885cb76..1e0efe53430 100644
--- a/src/mame/drivers/bbusters.c
+++ b/src/mame/drivers/bbusters.c
@@ -237,85 +237,80 @@ Country :
/******************************************************************************/
-static READ16_HANDLER( sound_status_r )
+READ16_MEMBER(bbusters_state::sound_status_r)
{
- bbusters_state *state = space->machine().driver_data<bbusters_state>();
- return state->m_sound_status;
+ return m_sound_status;
}
-static WRITE8_HANDLER( sound_status_w )
+WRITE8_MEMBER(bbusters_state::sound_status_w)
{
- bbusters_state *state = space->machine().driver_data<bbusters_state>();
- state->m_sound_status = data;
+ m_sound_status = data;
}
-static WRITE16_HANDLER( sound_cpu_w )
+WRITE16_MEMBER(bbusters_state::sound_cpu_w)
{
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data&0xff);
- cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
/* Eprom is byte wide, top half of word _must_ be 0xff */
-static READ16_HANDLER( eprom_r )
+READ16_MEMBER(bbusters_state::eprom_r)
{
- bbusters_state *state = space->machine().driver_data<bbusters_state>();
- return (state->m_eprom_data[offset]&0xff) | 0xff00;
+ return (m_eprom_data[offset]&0xff) | 0xff00;
}
-static READ16_HANDLER( control_3_r )
+READ16_MEMBER(bbusters_state::control_3_r)
{
- bbusters_state *state = space->machine().driver_data<bbusters_state>();
static const char *const port[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2", "GUNX3", "GUNY3" };
- UINT16 retdata = input_port_read(space->machine(), port[state->m_gun_select]);
+ UINT16 retdata = input_port_read(machine(), port[m_gun_select]);
retdata >>=1; // by lowering the precision of the gun reading hardware the game seems to work better
return retdata;
}
-static WRITE16_HANDLER( gun_select_w )
+WRITE16_MEMBER(bbusters_state::gun_select_w)
{
- bbusters_state *state = space->machine().driver_data<bbusters_state>();
- logerror("%08x: gun r\n",cpu_get_pc(&space->device()));
+ logerror("%08x: gun r\n",cpu_get_pc(&space.device()));
- device_set_input_line(&space->device(), 2, HOLD_LINE);
+ device_set_input_line(&space.device(), 2, HOLD_LINE);
- state->m_gun_select = data & 0xff;
+ m_gun_select = data & 0xff;
}
-static WRITE16_HANDLER( two_gun_output_w )
+WRITE16_MEMBER(bbusters_state::two_gun_output_w)
{
output_set_value("Player1_Gun_Recoil",(data & 0x01));
output_set_value("Player2_Gun_Recoil",(data & 0x02)>>1);
}
-static WRITE16_HANDLER( three_gun_output_w )
+WRITE16_MEMBER(bbusters_state::three_gun_output_w)
{
output_set_value("Player1_Gun_Recoil",(data & 0x01));
output_set_value("Player2_Gun_Recoil",(data & 0x02)>>1);
output_set_value("Player3_Gun_Recoil",(data & 0x04)>>2);
}
-static READ16_HANDLER( kludge_r )
+READ16_MEMBER(bbusters_state::kludge_r)
{
// might latch the gun value?
return 0x0000;
}
-static READ16_HANDLER( mechatt_gun_r )
+READ16_MEMBER(bbusters_state::mechatt_gun_r)
{
int x, y;
- x = input_port_read(space->machine(), offset ? "GUNX2" : "GUNX1");
- y = input_port_read(space->machine(), offset ? "GUNY2" : "GUNY1");
+ x = input_port_read(machine(), offset ? "GUNX2" : "GUNX1");
+ y = input_port_read(machine(), offset ? "GUNY2" : "GUNY1");
/* Todo - does the hardware really clamp like this? */
x += 0x18;
@@ -346,13 +341,13 @@ static ADDRESS_MAP_START( bbusters_map, AS_PROGRAM, 16, bbusters_state )
AM_RANGE(0x0e0004, 0x0e0005) AM_READ_PORT("IN1") /* Player 3 */
AM_RANGE(0x0e0008, 0x0e0009) AM_READ_PORT("DSW1") /* Dip 1 */
AM_RANGE(0x0e000a, 0x0e000b) AM_READ_PORT("DSW2") /* Dip 2 */
- AM_RANGE(0x0e0018, 0x0e0019) AM_READ_LEGACY(sound_status_r)
- AM_RANGE(0x0e8000, 0x0e8001) AM_READWRITE_LEGACY(kludge_r, gun_select_w)
- AM_RANGE(0x0e8002, 0x0e8003) AM_READ_LEGACY(control_3_r)
+ AM_RANGE(0x0e0018, 0x0e0019) AM_READ(sound_status_r)
+ AM_RANGE(0x0e8000, 0x0e8001) AM_READWRITE(kludge_r, gun_select_w)
+ AM_RANGE(0x0e8002, 0x0e8003) AM_READ(control_3_r)
/* AM_RANGE(0x0f0008, 0x0f0009) AM_WRITENOP */
- AM_RANGE(0x0f0008, 0x0f0009) AM_WRITE_LEGACY(three_gun_output_w)
- AM_RANGE(0x0f0018, 0x0f0019) AM_WRITE_LEGACY(sound_cpu_w)
- AM_RANGE(0x0f8000, 0x0f80ff) AM_READ_LEGACY(eprom_r) AM_WRITEONLY AM_SHARE("eeprom") /* Eeprom */
+ AM_RANGE(0x0f0008, 0x0f0009) AM_WRITE(three_gun_output_w)
+ AM_RANGE(0x0f0018, 0x0f0019) AM_WRITE(sound_cpu_w)
+ AM_RANGE(0x0f8000, 0x0f80ff) AM_READ(eprom_r) AM_WRITEONLY AM_SHARE("eeprom") /* Eeprom */
ADDRESS_MAP_END
/*******************************************************************************/
@@ -370,10 +365,10 @@ static ADDRESS_MAP_START( mechatt_map, AS_PROGRAM, 16, bbusters_state )
AM_RANGE(0x0d0000, 0x0d07ff) AM_RAM_WRITE_LEGACY(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0x0e0000, 0x0e0001) AM_READ_PORT("IN0")
AM_RANGE(0x0e0002, 0x0e0003) AM_READ_PORT("DSW1")
- AM_RANGE(0x0e0004, 0x0e0007) AM_READ_LEGACY(mechatt_gun_r)
+ AM_RANGE(0x0e0004, 0x0e0007) AM_READ(mechatt_gun_r)
/* AM_RANGE(0x0e4002, 0x0e4003) AM_WRITENOP Gun force feedback? */
- AM_RANGE(0x0e4002, 0x0e4003) AM_WRITE_LEGACY(two_gun_output_w)
- AM_RANGE(0x0e8000, 0x0e8001) AM_READWRITE_LEGACY(sound_status_r, sound_cpu_w)
+ AM_RANGE(0x0e4002, 0x0e4003) AM_WRITE(two_gun_output_w)
+ AM_RANGE(0x0e8000, 0x0e8001) AM_READWRITE(sound_status_r, sound_cpu_w)
ADDRESS_MAP_END
/******************************************************************************/
@@ -381,7 +376,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, bbusters_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
AM_RANGE(0xf000, 0xf7ff) AM_RAM
- AM_RANGE(0xf800, 0xf800) AM_READWRITE_LEGACY(soundlatch_r, sound_status_w)
+ AM_RANGE(0xf800, 0xf800) AM_READ_LEGACY(soundlatch_r) AM_WRITE(sound_status_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, bbusters_state )
diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c
index 7f522fa86ce..823542f00a1 100644
--- a/src/mame/drivers/bigevglf.c
+++ b/src/mame/drivers/bigevglf.c
@@ -63,15 +63,14 @@ J1100072A
#include "includes/bigevglf.h"
-static WRITE8_HANDLER( beg_banking_w )
+WRITE8_MEMBER(bigevglf_state::beg_banking_w)
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
- state->m_beg_bank = data;
+ m_beg_bank = data;
/* d0-d3 connect to A11-A14 of the ROMs (via ls273 latch)
d4-d7 select one of ROMs (via ls273(above) and then ls154)
*/
- memory_set_bank(space->machine(), "bank1", state->m_beg_bank & 0xff); /* empty sockets for IC37-IC44 ROMS */
+ memory_set_bank(machine(), "bank1", m_beg_bank & 0xff); /* empty sockets for IC37-IC44 ROMS */
}
static TIMER_CALLBACK( from_sound_latch_callback )
@@ -80,35 +79,32 @@ static TIMER_CALLBACK( from_sound_latch_callback )
state->m_from_sound = param & 0xff;
state->m_sound_state |= 2;
}
-static WRITE8_HANDLER( beg_fromsound_w ) /* write to D800 sets bit 1 in status */
+WRITE8_MEMBER(bigevglf_state::beg_fromsound_w)/* write to D800 sets bit 1 in status */
{
- space->machine().scheduler().synchronize(FUNC(from_sound_latch_callback), (cpu_get_pc(&space->device()) << 16) | data);
+ machine().scheduler().synchronize(FUNC(from_sound_latch_callback), (cpu_get_pc(&space.device()) << 16) | data);
}
-static READ8_HANDLER( beg_fromsound_r )
+READ8_MEMBER(bigevglf_state::beg_fromsound_r)
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/* set a timer to force synchronization after the read */
- space->machine().scheduler().synchronize();
- return state->m_from_sound;
+ machine().scheduler().synchronize();
+ return m_from_sound;
}
-static READ8_HANDLER( beg_soundstate_r )
+READ8_MEMBER(bigevglf_state::beg_soundstate_r)
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
- UINT8 ret = state->m_sound_state;
+ UINT8 ret = m_sound_state;
/* set a timer to force synchronization after the read */
- space->machine().scheduler().synchronize();
- state->m_sound_state &= ~2; /* read from port 21 clears bit 1 in status */
+ machine().scheduler().synchronize();
+ m_sound_state &= ~2; /* read from port 21 clears bit 1 in status */
return ret;
}
-static READ8_HANDLER( soundstate_r )
+READ8_MEMBER(bigevglf_state::soundstate_r)
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/* set a timer to force synchronization after the read */
- space->machine().scheduler().synchronize();
- return state->m_sound_state;
+ machine().scheduler().synchronize();
+ return m_sound_state;
}
static TIMER_CALLBACK( nmi_callback )
@@ -122,34 +118,30 @@ static TIMER_CALLBACK( nmi_callback )
state->m_sound_state &= ~1;
}
-static WRITE8_HANDLER( sound_command_w ) /* write to port 20 clears bit 0 in status */
+WRITE8_MEMBER(bigevglf_state::sound_command_w)/* write to port 20 clears bit 0 in status */
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
- state->m_for_sound = data;
- space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
+ m_for_sound = data;
+ machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
-static READ8_HANDLER( sound_command_r ) /* read from D800 sets bit 0 in status */
+READ8_MEMBER(bigevglf_state::sound_command_r)/* read from D800 sets bit 0 in status */
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
- state->m_sound_state |= 1;
- return state->m_for_sound;
+ m_sound_state |= 1;
+ return m_for_sound;
}
-static WRITE8_HANDLER( nmi_disable_w )
+WRITE8_MEMBER(bigevglf_state::nmi_disable_w)
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
- state->m_sound_nmi_enable = 0;
+ m_sound_nmi_enable = 0;
}
-static WRITE8_HANDLER( nmi_enable_w )
+WRITE8_MEMBER(bigevglf_state::nmi_enable_w)
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
- state->m_sound_nmi_enable = 1;
- if (state->m_pending_nmi)
+ m_sound_nmi_enable = 1;
+ if (m_pending_nmi)
{
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
- state->m_pending_nmi = 0;
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ m_pending_nmi = 0;
}
}
@@ -162,29 +154,28 @@ static TIMER_CALLBACK( deferred_ls74_w )
}
/* do this on a timer to let the CPUs synchronize */
-static WRITE8_HANDLER( beg13_a_clr_w )
+WRITE8_MEMBER(bigevglf_state::beg13_a_clr_w)
{
- space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 0);
+ machine().scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 0);
}
-static WRITE8_HANDLER( beg13_b_clr_w )
+WRITE8_MEMBER(bigevglf_state::beg13_b_clr_w)
{
- space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 0);
+ machine().scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 0);
}
-static WRITE8_HANDLER( beg13_a_set_w )
+WRITE8_MEMBER(bigevglf_state::beg13_a_set_w)
{
- space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 1);
+ machine().scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 1);
}
-static WRITE8_HANDLER( beg13_b_set_w )
+WRITE8_MEMBER(bigevglf_state::beg13_b_set_w)
{
- space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 1);
+ machine().scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 1);
}
-static READ8_HANDLER( beg_status_r )
+READ8_MEMBER(bigevglf_state::beg_status_r)
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/* d0 = Q of 74ls74 IC13(partA)
d1 = Q of 74ls74 IC13(partB)
@@ -196,31 +187,28 @@ static READ8_HANDLER( beg_status_r )
*/
/* set a timer to force synchronization after the read */
- space->machine().scheduler().synchronize();
- return (state->m_beg13_ls74[0] << 0) | (state->m_beg13_ls74[1] << 1);
+ machine().scheduler().synchronize();
+ return (m_beg13_ls74[0] << 0) | (m_beg13_ls74[1] << 1);
}
-static READ8_HANDLER( beg_trackball_x_r )
+READ8_MEMBER(bigevglf_state::beg_trackball_x_r)
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
static const char *const portx_name[2] = { "P1X", "P2X" };
- return input_port_read(space->machine(), portx_name[state->m_port_select]);
+ return input_port_read(machine(), portx_name[m_port_select]);
}
-static READ8_HANDLER( beg_trackball_y_r )
+READ8_MEMBER(bigevglf_state::beg_trackball_y_r)
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
static const char *const porty_name[2] = { "P1Y", "P2Y" };
- return input_port_read(space->machine(), porty_name[state->m_port_select]);
+ return input_port_read(machine(), porty_name[m_port_select]);
}
-static WRITE8_HANDLER( beg_port08_w )
+WRITE8_MEMBER(bigevglf_state::beg_port08_w)
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
- state->m_port_select = (data & 0x04) >> 2;
+ m_port_select = (data & 0x04) >> 2;
}
@@ -321,11 +309,11 @@ static ADDRESS_MAP_START( bigevglf_portmap, AS_IO, 8, bigevglf_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITENOP /* video ram enable ???*/
AM_RANGE(0x01, 0x01) AM_WRITE_LEGACY(bigevglf_gfxcontrol_w) /* plane select */
- AM_RANGE(0x02, 0x02) AM_WRITE_LEGACY(beg_banking_w)
- AM_RANGE(0x03, 0x03) AM_WRITE_LEGACY(beg13_a_set_w)
- AM_RANGE(0x04, 0x04) AM_WRITE_LEGACY(beg13_b_clr_w)
+ AM_RANGE(0x02, 0x02) AM_WRITE(beg_banking_w)
+ AM_RANGE(0x03, 0x03) AM_WRITE(beg13_a_set_w)
+ AM_RANGE(0x04, 0x04) AM_WRITE(beg13_b_clr_w)
AM_RANGE(0x05, 0x05) AM_WRITE_LEGACY(bigevglf_vidram_addr_w) /* video banking (256 banks) for f000-f0ff area */
- AM_RANGE(0x06, 0x06) AM_READ_LEGACY(beg_status_r)
+ AM_RANGE(0x06, 0x06) AM_READ(beg_status_r)
ADDRESS_MAP_END
@@ -339,37 +327,36 @@ static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, bigevglf_state )
ADDRESS_MAP_END
-static READ8_HANDLER( sub_cpu_mcu_coin_port_r )
+READ8_MEMBER(bigevglf_state::sub_cpu_mcu_coin_port_r)
{
- bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/*
bit 0 and bit 1 = coin inputs
bit 3 and bit 4 = MCU status
bit 5 = must toggle, vblank ?
*/
- state->m_mcu_coin_bit5 ^= 0x20;
- return bigevglf_mcu_status_r(space, 0) | (input_port_read(space->machine(), "PORT04") & 3) | state->m_mcu_coin_bit5; /* bit 0 and bit 1 - coin inputs */
+ m_mcu_coin_bit5 ^= 0x20;
+ return bigevglf_mcu_status_r(&space, 0) | (input_port_read(machine(), "PORT04") & 3) | m_mcu_coin_bit5; /* bit 0 and bit 1 - coin inputs */
}
static ADDRESS_MAP_START( bigevglf_sub_portmap, AS_IO, 8, bigevglf_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READ_PORT("PORT00")
AM_RANGE(0x01, 0x01) AM_READNOP
- AM_RANGE(0x02, 0x02) AM_READ_LEGACY(beg_trackball_x_r)
- AM_RANGE(0x03, 0x03) AM_READ_LEGACY(beg_trackball_y_r)
- AM_RANGE(0x04, 0x04) AM_READ_LEGACY(sub_cpu_mcu_coin_port_r)
+ AM_RANGE(0x02, 0x02) AM_READ(beg_trackball_x_r)
+ AM_RANGE(0x03, 0x03) AM_READ(beg_trackball_y_r)
+ AM_RANGE(0x04, 0x04) AM_READ(sub_cpu_mcu_coin_port_r)
AM_RANGE(0x05, 0x05) AM_READ_PORT("DSW1")
AM_RANGE(0x06, 0x06) AM_READ_PORT("DSW2")
AM_RANGE(0x07, 0x07) AM_READNOP
- AM_RANGE(0x08, 0x08) AM_WRITE_LEGACY(beg_port08_w) /* muxed port select + other unknown stuff */
+ AM_RANGE(0x08, 0x08) AM_WRITE(beg_port08_w) /* muxed port select + other unknown stuff */
AM_RANGE(0x0b, 0x0b) AM_READ_LEGACY(bigevglf_mcu_r)
AM_RANGE(0x0c, 0x0c) AM_WRITE_LEGACY(bigevglf_mcu_w)
AM_RANGE(0x0e, 0x0e) AM_WRITENOP /* 0-enable MCU, 1-keep reset line ASSERTED; D0 goes to the input of ls74 and the /Q of this ls74 goes to reset line on 68705 */
- AM_RANGE(0x10, 0x17) AM_WRITE_LEGACY(beg13_a_clr_w)
- AM_RANGE(0x18, 0x1f) AM_WRITE_LEGACY(beg13_b_set_w)
- AM_RANGE(0x20, 0x20) AM_READWRITE_LEGACY(beg_fromsound_r, sound_command_w)
- AM_RANGE(0x21, 0x21) AM_READ_LEGACY(beg_soundstate_r)
+ AM_RANGE(0x10, 0x17) AM_WRITE(beg13_a_clr_w)
+ AM_RANGE(0x18, 0x1f) AM_WRITE(beg13_b_set_w)
+ AM_RANGE(0x20, 0x20) AM_READWRITE(beg_fromsound_r, sound_command_w)
+ AM_RANGE(0x21, 0x21) AM_READ(beg_soundstate_r)
ADDRESS_MAP_END
@@ -385,9 +372,9 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, bigevglf_state )
AM_RANGE(0xca00, 0xca0d) AM_DEVWRITE_LEGACY("msm", msm5232_w)
AM_RANGE(0xcc00, 0xcc00) AM_WRITENOP
AM_RANGE(0xce00, 0xce00) AM_WRITENOP
- AM_RANGE(0xd800, 0xd800) AM_READWRITE_LEGACY(sound_command_r, beg_fromsound_w) /* write to D800 sets bit 1 in status */
- AM_RANGE(0xda00, 0xda00) AM_READWRITE_LEGACY(soundstate_r, nmi_enable_w)
- AM_RANGE(0xdc00, 0xdc00) AM_WRITE_LEGACY(nmi_disable_w)
+ AM_RANGE(0xd800, 0xd800) AM_READWRITE(sound_command_r, beg_fromsound_w) /* write to D800 sets bit 1 in status */
+ AM_RANGE(0xda00, 0xda00) AM_READWRITE(soundstate_r, nmi_enable_w)
+ AM_RANGE(0xdc00, 0xdc00) AM_WRITE(nmi_disable_w)
AM_RANGE(0xde00, 0xde00) AM_WRITENOP
AM_RANGE(0xe000, 0xefff) AM_READNOP /* space for diagnostics ROM */
ADDRESS_MAP_END
diff --git a/src/mame/drivers/bionicc.c b/src/mame/drivers/bionicc.c
index e055dca4469..cfcb5ac9db3 100644
--- a/src/mame/drivers/bionicc.c
+++ b/src/mame/drivers/bionicc.c
@@ -70,50 +70,45 @@
*
*************************************/
-static WRITE16_HANDLER( hacked_controls_w )
+WRITE16_MEMBER(bionicc_state::hacked_controls_w)
{
- bionicc_state *state = space->machine().driver_data<bionicc_state>();
- logerror("%06x: hacked_controls_w %04x %02x\n", cpu_get_pc(&space->device()), offset, data);
- COMBINE_DATA(&state->m_inp[offset]);
+ logerror("%06x: hacked_controls_w %04x %02x\n", cpu_get_pc(&space.device()), offset, data);
+ COMBINE_DATA(&m_inp[offset]);
}
-static READ16_HANDLER( hacked_controls_r )
+READ16_MEMBER(bionicc_state::hacked_controls_r)
{
- bionicc_state *state = space->machine().driver_data<bionicc_state>();
- logerror("%06x: hacked_controls_r %04x %04x\n", cpu_get_pc(&space->device()), offset, state->m_inp[offset]);
- return state->m_inp[offset];
+ logerror("%06x: hacked_controls_r %04x %04x\n", cpu_get_pc(&space.device()), offset, m_inp[offset]);
+ return m_inp[offset];
}
-static WRITE16_HANDLER( bionicc_mpu_trigger_w )
+WRITE16_MEMBER(bionicc_state::bionicc_mpu_trigger_w)
{
- bionicc_state *state = space->machine().driver_data<bionicc_state>();
- data = input_port_read(space->machine(), "SYSTEM") >> 12;
- state->m_inp[0] = data ^ 0x0f;
+ data = input_port_read(machine(), "SYSTEM") >> 12;
+ m_inp[0] = data ^ 0x0f;
- data = input_port_read(space->machine(), "P2");
- state->m_inp[1] = data ^ 0xff;
+ data = input_port_read(machine(), "P2");
+ m_inp[1] = data ^ 0xff;
- data = input_port_read(space->machine(), "P1");
- state->m_inp[2] = data ^ 0xff;
+ data = input_port_read(machine(), "P1");
+ m_inp[2] = data ^ 0xff;
}
-static WRITE16_HANDLER( hacked_soundcommand_w )
+WRITE16_MEMBER(bionicc_state::hacked_soundcommand_w)
{
- bionicc_state *state = space->machine().driver_data<bionicc_state>();
- COMBINE_DATA(&state->m_soundcommand);
- soundlatch_w(space, 0, state->m_soundcommand & 0xff);
+ COMBINE_DATA(&m_soundcommand);
+ soundlatch_w(space, 0, m_soundcommand & 0xff);
}
-static READ16_HANDLER( hacked_soundcommand_r )
+READ16_MEMBER(bionicc_state::hacked_soundcommand_r)
{
- bionicc_state *state = space->machine().driver_data<bionicc_state>();
- return state->m_soundcommand;
+ return m_soundcommand;
}
@@ -155,14 +150,14 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, bionicc_state )
AM_RANGE(0xfe4000, 0xfe4001) AM_READ_PORT("SYSTEM")
AM_RANGE(0xfe4002, 0xfe4003) AM_READ_PORT("DSW")
AM_RANGE(0xfe8010, 0xfe8017) AM_WRITE_LEGACY(bionicc_scroll_w)
- AM_RANGE(0xfe801a, 0xfe801b) AM_WRITE_LEGACY(bionicc_mpu_trigger_w) /* ??? not sure, but looks like it */
+ AM_RANGE(0xfe801a, 0xfe801b) AM_WRITE(bionicc_mpu_trigger_w) /* ??? not sure, but looks like it */
AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE_LEGACY(bionicc_txvideoram_w) AM_BASE(m_txvideoram)
AM_RANGE(0xff0000, 0xff3fff) AM_RAM_WRITE_LEGACY(bionicc_fgvideoram_w) AM_BASE(m_fgvideoram)
AM_RANGE(0xff4000, 0xff7fff) AM_RAM_WRITE_LEGACY(bionicc_bgvideoram_w) AM_BASE(m_bgvideoram)
AM_RANGE(0xff8000, 0xff87ff) AM_RAM_WRITE_LEGACY(bionicc_paletteram_w) AM_BASE(m_paletteram)
AM_RANGE(0xffc000, 0xfffff7) AM_RAM /* working RAM */
- AM_RANGE(0xfffff8, 0xfffff9) AM_READWRITE_LEGACY(hacked_soundcommand_r, hacked_soundcommand_w) /* hack */
- AM_RANGE(0xfffffa, 0xffffff) AM_READWRITE_LEGACY(hacked_controls_r, hacked_controls_w) /* hack */
+ AM_RANGE(0xfffff8, 0xfffff9) AM_READWRITE(hacked_soundcommand_r, hacked_soundcommand_w) /* hack */
+ AM_RANGE(0xfffffa, 0xffffff) AM_READWRITE(hacked_controls_r, hacked_controls_w) /* hack */
ADDRESS_MAP_END
diff --git a/src/mame/drivers/bishi.c b/src/mame/drivers/bishi.c
index f70c72f7ee7..70f7a9c0586 100644
--- a/src/mame/drivers/bishi.c
+++ b/src/mame/drivers/bishi.c
@@ -89,24 +89,21 @@ Notes:
#include "sound/ymz280b.h"
#include "includes/bishi.h"
-static READ16_HANDLER( control_r )
+READ16_MEMBER(bishi_state::control_r)
{
- bishi_state *state = space->machine().driver_data<bishi_state>();
- return state->m_cur_control;
+ return m_cur_control;
}
-static WRITE16_HANDLER( control_w )
+WRITE16_MEMBER(bishi_state::control_w)
{
// bit 8 = interrupt gate
- bishi_state *state = space->machine().driver_data<bishi_state>();
- COMBINE_DATA(&state->m_cur_control);
+ COMBINE_DATA(&m_cur_control);
}
-static WRITE16_HANDLER( control2_w )
+WRITE16_MEMBER(bishi_state::control2_w)
{
// bit 12 = part of the banking calculation for the K056832 ROM readback
- bishi_state *state = space->machine().driver_data<bishi_state>();
- COMBINE_DATA(&state->m_cur_control2);
+ COMBINE_DATA(&m_cur_control2);
}
static TIMER_DEVICE_CALLBACK( bishi_scanline )
@@ -125,34 +122,33 @@ static TIMER_DEVICE_CALLBACK( bishi_scanline )
}
/* compensate for a bug in the ram/rom test */
-static READ16_HANDLER( bishi_mirror_r )
+READ16_MEMBER(bishi_state::bishi_mirror_r)
{
- return space->machine().generic.paletteram.u16[offset];
+ return machine().generic.paletteram.u16[offset];
}
-static READ16_HANDLER( bishi_K056832_rom_r )
+READ16_MEMBER(bishi_state::bishi_K056832_rom_r)
{
- bishi_state *state = space->machine().driver_data<bishi_state>();
UINT16 ouroffs;
ouroffs = (offset >> 1) * 8;
if (offset & 1)
ouroffs++;
- if (state->m_cur_control2 & 0x1000)
+ if (m_cur_control2 & 0x1000)
ouroffs += 4;
- return k056832_bishi_rom_word_r(state->m_k056832, ouroffs, mem_mask);
+ return k056832_bishi_rom_word_r(m_k056832, ouroffs, mem_mask);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, bishi_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x400000, 0x407fff) AM_RAM // Work RAM
- AM_RANGE(0x800000, 0x800001) AM_READWRITE_LEGACY(control_r, control_w)
+ AM_RANGE(0x800000, 0x800001) AM_READWRITE(control_r, control_w)
AM_RANGE(0x800004, 0x800005) AM_READ_PORT("DSW")
AM_RANGE(0x800006, 0x800007) AM_READ_PORT("SYSTEM")
AM_RANGE(0x800008, 0x800009) AM_READ_PORT("INPUTS")
- AM_RANGE(0x810000, 0x810003) AM_WRITE_LEGACY(control2_w) // bank switch for K056832 character ROM test
+ AM_RANGE(0x810000, 0x810003) AM_WRITE(control2_w) // bank switch for K056832 character ROM test
AM_RANGE(0x820000, 0x820001) AM_WRITENOP // lamps (see lamp test in service menu)
AM_RANGE(0x830000, 0x83003f) AM_DEVWRITE_LEGACY("k056832", k056832_word_w)
AM_RANGE(0x840000, 0x840007) AM_DEVWRITE_LEGACY("k056832", k056832_b_word_w) // VSCCS
@@ -161,8 +157,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, bishi_state )
AM_RANGE(0x880000, 0x880003) AM_DEVREADWRITE8_LEGACY("ymz", ymz280b_r, ymz280b_w, 0xff00)
AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_word_r, k056832_ram_word_w) // Graphic planes
AM_RANGE(0xb00000, 0xb03fff) AM_RAM_WRITE_LEGACY(paletteram16_xbgr_word_be_w) AM_BASE_GENERIC(paletteram)
- AM_RANGE(0xb04000, 0xb047ff) AM_READ_LEGACY(bishi_mirror_r) // bug in the ram/rom test?
- AM_RANGE(0xc00000, 0xc01fff) AM_READ_LEGACY(bishi_K056832_rom_r)
+ AM_RANGE(0xb04000, 0xb047ff) AM_READ(bishi_mirror_r) // bug in the ram/rom test?
+ AM_RANGE(0xc00000, 0xc01fff) AM_READ(bishi_K056832_rom_r)
ADDRESS_MAP_END
static INPUT_PORTS_START( bishi )
diff --git a/src/mame/drivers/bking.c b/src/mame/drivers/bking.c
index 67b1f2f04d6..66145304a37 100644
--- a/src/mame/drivers/bking.c
+++ b/src/mame/drivers/bking.c
@@ -23,22 +23,19 @@ DIP Locations verified for:
#include "machine/buggychl.h"
#include "includes/bking.h"
-static READ8_HANDLER( bking_sndnmi_disable_r )
+READ8_MEMBER(bking_state::bking_sndnmi_disable_r)
{
- bking_state *state = space->machine().driver_data<bking_state>();
- state->m_sound_nmi_enable = 0;
+ m_sound_nmi_enable = 0;
return 0;
}
-static WRITE8_HANDLER( bking_sndnmi_enable_w )
+WRITE8_MEMBER(bking_state::bking_sndnmi_enable_w)
{
- bking_state *state = space->machine().driver_data<bking_state>();
- state->m_sound_nmi_enable = 1;
+ m_sound_nmi_enable = 1;
}
-static WRITE8_HANDLER( bking_soundlatch_w )
+WRITE8_MEMBER(bking_state::bking_soundlatch_w)
{
- bking_state *state = space->machine().driver_data<bking_state>();
int i, code = 0;
for (i = 0;i < 8;i++)
@@ -46,27 +43,24 @@ static WRITE8_HANDLER( bking_soundlatch_w )
code |= 0x80 >> i;
soundlatch_w(space, offset, code);
- if (state->m_sound_nmi_enable)
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ if (m_sound_nmi_enable)
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
-static WRITE8_HANDLER( bking3_addr_l_w )
+WRITE8_MEMBER(bking_state::bking3_addr_l_w)
{
- bking_state *state = space->machine().driver_data<bking_state>();
- state->m_addr_l = data;
+ m_addr_l = data;
}
-static WRITE8_HANDLER( bking3_addr_h_w )
+WRITE8_MEMBER(bking_state::bking3_addr_h_w)
{
- bking_state *state = space->machine().driver_data<bking_state>();
- state->m_addr_h = data;
+ m_addr_h = data;
}
-static READ8_HANDLER( bking3_extrarom_r )
+READ8_MEMBER(bking_state::bking3_extrarom_r)
{
- bking_state *state = space->machine().driver_data<bking_state>();
- UINT8 *rom = space->machine().region("user2")->base();
- return rom[state->m_addr_h * 256 + state->m_addr_l];
+ UINT8 *rom = machine().region("user2")->base();
+ return rom[m_addr_h * 256 + m_addr_l];
}
static WRITE8_DEVICE_HANDLER( unk_w )
@@ -77,7 +71,7 @@ static WRITE8_DEVICE_HANDLER( unk_w )
*/
}
-static READ8_HANDLER( bking3_ext_check_r )
+READ8_MEMBER(bking_state::bking3_ext_check_r)
{
return 0x31; //no "bad rom.", no "bad ext."
}
@@ -101,7 +95,7 @@ static ADDRESS_MAP_START( bking_io_map, AS_IO, 8, bking_state )
AM_RANGE(0x08, 0x08) AM_WRITE_LEGACY(bking_cont1_w)
AM_RANGE(0x09, 0x09) AM_WRITE_LEGACY(bking_cont2_w)
AM_RANGE(0x0a, 0x0a) AM_WRITE_LEGACY(bking_cont3_w)
- AM_RANGE(0x0b, 0x0b) AM_WRITE_LEGACY(bking_soundlatch_w)
+ AM_RANGE(0x0b, 0x0b) AM_WRITE(bking_soundlatch_w)
// AM_RANGE(0x0c, 0x0c) AM_WRITE_LEGACY(bking_eport2_w) this is not shown to be connected anywhere
AM_RANGE(0x0d, 0x0d) AM_WRITE_LEGACY(bking_hitclr_w)
AM_RANGE(0x07, 0x1f) AM_READ_LEGACY(bking_pos_r)
@@ -120,15 +114,15 @@ static ADDRESS_MAP_START( bking3_io_map, AS_IO, 8, bking_state )
AM_RANGE(0x08, 0x08) AM_WRITE_LEGACY(bking_cont1_w)
AM_RANGE(0x09, 0x09) AM_WRITE_LEGACY(bking_cont2_w)
AM_RANGE(0x0a, 0x0a) AM_WRITE_LEGACY(bking_cont3_w)
- AM_RANGE(0x0b, 0x0b) AM_WRITE_LEGACY(bking_soundlatch_w)
+ AM_RANGE(0x0b, 0x0b) AM_WRITE(bking_soundlatch_w)
// AM_RANGE(0x0c, 0x0c) AM_WRITE_LEGACY(bking_eport2_w) this is not shown to be connected anywhere
AM_RANGE(0x0d, 0x0d) AM_WRITE_LEGACY(bking_hitclr_w)
AM_RANGE(0x07, 0x1f) AM_READ_LEGACY(bking_pos_r)
AM_RANGE(0x2f, 0x2f) AM_DEVREADWRITE_LEGACY("bmcu", buggychl_mcu_r, buggychl_mcu_w)
AM_RANGE(0x4f, 0x4f) AM_DEVREADWRITE_LEGACY("bmcu", buggychl_mcu_status_r, unk_w)
- AM_RANGE(0x60, 0x60) AM_READ_LEGACY(bking3_extrarom_r)
- AM_RANGE(0x6f, 0x6f) AM_READWRITE_LEGACY(bking3_ext_check_r, bking3_addr_h_w)
- AM_RANGE(0x8f, 0x8f) AM_WRITE_LEGACY(bking3_addr_l_w)
+ AM_RANGE(0x60, 0x60) AM_READ(bking3_extrarom_r)
+ AM_RANGE(0x6f, 0x6f) AM_READWRITE(bking3_ext_check_r, bking3_addr_h_w)
+ AM_RANGE(0x8f, 0x8f) AM_WRITE(bking3_addr_l_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( bking_audio_map, AS_PROGRAM, 8, bking_state )
@@ -140,75 +134,69 @@ static ADDRESS_MAP_START( bking_audio_map, AS_PROGRAM, 8, bking_state )
AM_RANGE(0x4402, 0x4403) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
AM_RANGE(0x4403, 0x4403) AM_DEVREAD_LEGACY("ay2", ay8910_r)
AM_RANGE(0x4800, 0x4800) AM_READ_LEGACY(soundlatch_r)
- AM_RANGE(0x4802, 0x4802) AM_READWRITE_LEGACY(bking_sndnmi_disable_r, bking_sndnmi_enable_w)
+ AM_RANGE(0x4802, 0x4802) AM_READWRITE(bking_sndnmi_disable_r, bking_sndnmi_enable_w)
AM_RANGE(0xe000, 0xefff) AM_ROM /* Space for diagnostic ROM */
ADDRESS_MAP_END
#if 0
-static READ8_HANDLER( bking3_68705_port_a_r )
+READ8_MEMBER(bking_state::bking3_68705_port_a_r)
{
- bking_state *state = space->machine().driver_data<bking_state>();
- //printf("port_a_r = %02X\n",(state->m_port_a_out & state->m_ddr_a) | (state->m_port_a_in & ~state->m_ddr_a));
- return (state->m_port_a_out & state->m_ddr_a) | (state->m_port_a_in & ~state->m_ddr_a);
+ //printf("port_a_r = %02X\n",(m_port_a_out & m_ddr_a) | (m_port_a_in & ~m_ddr_a));
+ return (m_port_a_out & m_ddr_a) | (m_port_a_in & ~m_ddr_a);
}
-static WRITE8_HANDLER( bking3_68705_port_a_w )
+WRITE8_MEMBER(bking_state::bking3_68705_port_a_w)
{
- bking_state *state = space->machine().driver_data<bking_state>();
- state->m_port_a_out = data;
+ m_port_a_out = data;
// printf("port_a_out = %02X\n",data);
}
-static WRITE8_HANDLER( bking3_68705_ddr_a_w )
+WRITE8_MEMBER(bking_state::bking3_68705_ddr_a_w)
{
- bking_state *state = space->machine().driver_data<bking_state>();
- state->m_ddr_a = data;
+ m_ddr_a = data;
}
-static READ8_HANDLER( bking3_68705_port_b_r )
+READ8_MEMBER(bking_state::bking3_68705_port_b_r)
{
- bking_state *state = space->machine().driver_data<bking_state>();
- return (state->m_port_b_out & state->m_ddr_b) | (state->m_port_b_in & ~state->m_ddr_b);
+ return (m_port_b_out & m_ddr_b) | (m_port_b_in & ~m_ddr_b);
}
-static WRITE8_HANDLER( bking3_68705_port_b_w )
+WRITE8_MEMBER(bking_state::bking3_68705_port_b_w)
{
- bking_state *state = space->machine().driver_data<bking_state>();
// if(data != 0xff)
// printf("port_b_out = %02X\n",data);
if (~data & 0x02)
{
- state->m_port_a_in = from_main;
- if (main_sent) cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
+ m_port_a_in = from_main;
+ if (main_sent) cputag_set_input_line(machine(), "mcu", 0, CLEAR_LINE);
main_sent = 0;
}
if (~data & 0x04)
{
/* 68705 is writing data for the Z80 */
- from_mcu = state->m_port_a_out;
+ from_mcu = m_port_a_out;
mcu_sent = 1;
}
if(data != 0xff && data != 0xfb && data != 0xfd)
printf("port_b_w = %X\n",data);
- state->m_port_b_out = data;
+ m_port_b_out = data;
}
-static WRITE8_HANDLER( bking3_68705_ddr_b_w )
+WRITE8_MEMBER(bking_state::bking3_68705_ddr_b_w)
{
- bking_state *state = space->machine().driver_data<bking_state>();
- state->m_ddr_b = data;
+ m_ddr_b = data;
}
-static READ8_HANDLER( bking3_68705_port_c_r )
+READ8_MEMBER(bking_state::bking3_68705_port_c_r)
{
int port_c_in = 0;
if (main_sent) port_c_in |= 0x01;
if (!mcu_sent) port_c_in |= 0x02;
-//logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(&space->device()),port_c_in);
+//logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(&space.device()),port_c_in);
return port_c_in;
}
#endif
diff --git a/src/mame/drivers/bladestl.c b/src/mame/drivers/bladestl.c
index 1e378507736..63662590fb5 100644
--- a/src/mame/drivers/bladestl.c
+++ b/src/mame/drivers/bladestl.c
@@ -54,47 +54,44 @@ static TIMER_DEVICE_CALLBACK( bladestl_scanline )
*
*************************************/
-static READ8_HANDLER( trackball_r )
+READ8_MEMBER(bladestl_state::trackball_r)
{
- bladestl_state *state = space->machine().driver_data<bladestl_state>();
static const char *const port[] = { "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P1_2" };
int curr, delta;
- curr = input_port_read(space->machine(), port[offset]);
- delta = (curr - state->m_last_track[offset]) & 0xff;
- state->m_last_track[offset] = curr;
+ curr = input_port_read(machine(), port[offset]);
+ delta = (curr - m_last_track[offset]) & 0xff;
+ m_last_track[offset] = curr;
return (delta & 0x80) | (curr >> 1);
}
-static WRITE8_HANDLER( bladestl_bankswitch_w )
+WRITE8_MEMBER(bladestl_state::bladestl_bankswitch_w)
{
- bladestl_state *state = space->machine().driver_data<bladestl_state>();
/* bits 0 & 1 = coin counters */
- coin_counter_w(space->machine(), 0,data & 0x01);
- coin_counter_w(space->machine(), 1,data & 0x02);
+ coin_counter_w(machine(), 0,data & 0x01);
+ coin_counter_w(machine(), 1,data & 0x02);
/* bits 2 & 3 = lamps */
- set_led_status(space->machine(), 0,data & 0x04);
- set_led_status(space->machine(), 1,data & 0x08);
+ set_led_status(machine(), 0,data & 0x04);
+ set_led_status(machine(), 1,data & 0x08);
/* bit 4 = relay (???) */
/* bits 5-6 = bank number */
- memory_set_bank(space->machine(), "bank1", (data & 0x60) >> 5);
+ memory_set_bank(machine(), "bank1", (data & 0x60) >> 5);
/* bit 7 = select sprite bank */
- state->m_spritebank = (data & 0x80) << 3;
+ m_spritebank = (data & 0x80) << 3;
}
-static WRITE8_HANDLER( bladestl_sh_irqtrigger_w )
+WRITE8_MEMBER(bladestl_state::bladestl_sh_irqtrigger_w)
{
- bladestl_state *state = space->machine().driver_data<bladestl_state>();
soundlatch_w(space, offset, data);
- device_set_input_line(state->m_audiocpu, M6809_IRQ_LINE, HOLD_LINE);
+ device_set_input_line(m_audiocpu, M6809_IRQ_LINE, HOLD_LINE);
//logerror("(sound) write %02x\n", data);
}
@@ -132,10 +129,10 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, bladestl_state )
AM_RANGE(0x2e02, 0x2e02) AM_READ_PORT("P2") /* 2P controls */
AM_RANGE(0x2e03, 0x2e03) AM_READ_PORT("DSW2") /* DISPW #2 */
AM_RANGE(0x2e40, 0x2e40) AM_READ_PORT("DSW1") /* DIPSW #1 */
- AM_RANGE(0x2e80, 0x2e80) AM_WRITE_LEGACY(bladestl_sh_irqtrigger_w) /* cause interrupt on audio CPU */
+ AM_RANGE(0x2e80, 0x2e80) AM_WRITE(bladestl_sh_irqtrigger_w) /* cause interrupt on audio CPU */
AM_RANGE(0x2ec0, 0x2ec0) AM_WRITE_LEGACY(watchdog_reset_w) /* watchdog reset */
- AM_RANGE(0x2f00, 0x2f03) AM_READ_LEGACY(trackball_r) /* Trackballs */
- AM_RANGE(0x2f40, 0x2f40) AM_WRITE_LEGACY(bladestl_bankswitch_w) /* bankswitch control */
+ AM_RANGE(0x2f00, 0x2f03) AM_READ(trackball_r) /* Trackballs */
+ AM_RANGE(0x2f40, 0x2f40) AM_WRITE(bladestl_bankswitch_w) /* bankswitch control */
AM_RANGE(0x2f80, 0x2f9f) AM_DEVREADWRITE_LEGACY("k051733", k051733_r, k051733_w) /* Protection: 051733 */
AM_RANGE(0x2fc0, 0x2fc0) AM_WRITENOP /* ??? */
AM_RANGE(0x4000, 0x5fff) AM_RAM /* Work RAM */
diff --git a/src/mame/drivers/blktiger.c b/src/mame/drivers/blktiger.c
index 30baee24cf3..965669c793e 100644
--- a/src/mame/drivers/blktiger.c
+++ b/src/mame/drivers/blktiger.c
@@ -26,47 +26,43 @@ Protection comms between main cpu and i8751
**************************************************/
-static READ8_HANDLER( blktiger_from_mcu_r )
+READ8_MEMBER(blktiger_state::blktiger_from_mcu_r)
{
- blktiger_state *state = space->machine().driver_data<blktiger_state>();
- return state->m_i8751_latch;
+ return m_i8751_latch;
}
-static WRITE8_HANDLER( blktiger_to_mcu_w )
+WRITE8_MEMBER(blktiger_state::blktiger_to_mcu_w)
{
- blktiger_state *state = space->machine().driver_data<blktiger_state>();
- device_set_input_line(state->m_mcu, MCS51_INT1_LINE, ASSERT_LINE);
- state->m_z80_latch = data;
+ device_set_input_line(m_mcu, MCS51_INT1_LINE, ASSERT_LINE);
+ m_z80_latch = data;
}
-static READ8_HANDLER( blktiger_from_main_r )
+READ8_MEMBER(blktiger_state::blktiger_from_main_r)
{
- blktiger_state *state = space->machine().driver_data<blktiger_state>();
- device_set_input_line(state->m_mcu, MCS51_INT1_LINE, CLEAR_LINE);
+ device_set_input_line(m_mcu, MCS51_INT1_LINE, CLEAR_LINE);
//printf("%02x read\n",latch);
- return state->m_z80_latch;
+ return m_z80_latch;
}
-static WRITE8_HANDLER( blktiger_to_main_w )
+WRITE8_MEMBER(blktiger_state::blktiger_to_main_w)
{
- blktiger_state *state = space->machine().driver_data<blktiger_state>();
//printf("%02x write\n",data);
- state->m_i8751_latch = data;
+ m_i8751_latch = data;
}
-static WRITE8_HANDLER( blktiger_bankswitch_w )
+WRITE8_MEMBER(blktiger_state::blktiger_bankswitch_w)
{
- memory_set_bank(space->machine(), "bank1", data & 0x0f);
+ memory_set_bank(machine(), "bank1", data & 0x0f);
}
-static WRITE8_HANDLER( blktiger_coinlockout_w )
+WRITE8_MEMBER(blktiger_state::blktiger_coinlockout_w)
{
- if (input_port_read(space->machine(), "COIN_LOCKOUT") & 0x01)
+ if (input_port_read(machine(), "COIN_LOCKOUT") & 0x01)
{
- coin_lockout_w(space->machine(), 0,~data & 0x01);
- coin_lockout_w(space->machine(), 1,~data & 0x02);
+ coin_lockout_w(machine(), 0,~data & 0x01);
+ coin_lockout_w(machine(), 1,~data & 0x02);
}
}
@@ -85,13 +81,13 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( blktiger_io_map, AS_IO, 8, blktiger_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE_LEGACY(soundlatch_w)
- AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITE_LEGACY(blktiger_bankswitch_w)
+ AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITE(blktiger_bankswitch_w)
AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")
- AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW0") AM_WRITE_LEGACY(blktiger_coinlockout_w)
+ AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW0") AM_WRITE(blktiger_coinlockout_w)
AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1") AM_WRITE_LEGACY(blktiger_video_control_w)
AM_RANGE(0x05, 0x05) AM_READ_PORT("FREEZE")
AM_RANGE(0x06, 0x06) AM_WRITE_LEGACY(watchdog_reset_w)
- AM_RANGE(0x07, 0x07) AM_READWRITE_LEGACY(blktiger_from_mcu_r,blktiger_to_mcu_w) /* Software protection (7) */
+ AM_RANGE(0x07, 0x07) AM_READWRITE(blktiger_from_mcu_r,blktiger_to_mcu_w) /* Software protection (7) */
AM_RANGE(0x08, 0x09) AM_WRITE_LEGACY(blktiger_scrollx_w)
AM_RANGE(0x0a, 0x0b) AM_WRITE_LEGACY(blktiger_scrolly_w)
AM_RANGE(0x0c, 0x0c) AM_WRITE_LEGACY(blktiger_video_enable_w)
@@ -102,9 +98,9 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( blktigerbl_io_map, AS_IO, 8, blktiger_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE_LEGACY(soundlatch_w)
- AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITE_LEGACY(blktiger_bankswitch_w)
+ AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITE(blktiger_bankswitch_w)
AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")
- AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW0") AM_WRITE_LEGACY(blktiger_coinlockout_w)
+ AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW0") AM_WRITE(blktiger_coinlockout_w)
AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1") AM_WRITE_LEGACY(blktiger_video_control_w)
AM_RANGE(0x05, 0x05) AM_READ_PORT("FREEZE")
AM_RANGE(0x06, 0x06) AM_WRITE_LEGACY(watchdog_reset_w)
@@ -129,7 +125,7 @@ static ADDRESS_MAP_START( blktiger_mcu_map, AS_PROGRAM, 8, blktiger_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( blktiger_mcu_io_map, AS_IO, 8, blktiger_state )
- AM_RANGE(MCS51_PORT_P0,MCS51_PORT_P0) AM_READWRITE_LEGACY(blktiger_from_main_r,blktiger_to_main_w)
+ AM_RANGE(MCS51_PORT_P0,MCS51_PORT_P0) AM_READWRITE(blktiger_from_main_r,blktiger_to_main_w)
AM_RANGE(MCS51_PORT_P1,MCS51_PORT_P3) AM_WRITENOP /* other ports unknown */
ADDRESS_MAP_END
diff --git a/src/mame/drivers/blmbycar.c b/src/mame/drivers/blmbycar.c
index 0edaac800f3..92c0f43732b 100644
--- a/src/mame/drivers/blmbycar.c
+++ b/src/mame/drivers/blmbycar.c
@@ -39,11 +39,11 @@ Check game speed, it depends on a bit we toggle..
/* The top 64k of samples are banked (16 banks total) */
-static WRITE16_HANDLER( blmbycar_okibank_w )
+WRITE16_MEMBER(blmbycar_state::blmbycar_okibank_w)
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *RAM = space->machine().region("oki")->base();
+ UINT8 *RAM = machine().region("oki")->base();
memcpy(&RAM[0x30000], &RAM[0x40000 + 0x10000 * (data & 0xf)], 0x10000);
}
}
@@ -58,38 +58,35 @@ static WRITE16_HANDLER( blmbycar_okibank_w )
/* Preliminary potentiometric wheel support */
-static WRITE16_HANDLER( blmbycar_pot_wheel_reset_w )
+WRITE16_MEMBER(blmbycar_state::blmbycar_pot_wheel_reset_w)
{
- blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
if (ACCESSING_BITS_0_7)
- state->m_pot_wheel = ~input_port_read(space->machine(), "WHEEL") & 0xff;
+ m_pot_wheel = ~input_port_read(machine(), "WHEEL") & 0xff;
}
-static WRITE16_HANDLER( blmbycar_pot_wheel_shift_w )
+WRITE16_MEMBER(blmbycar_state::blmbycar_pot_wheel_shift_w)
{
- blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
if (ACCESSING_BITS_0_7)
{
- if ( ((state->m_old_val & 0xff) == 0xff) && ((data & 0xff) == 0) )
- state->m_pot_wheel <<= 1;
- state->m_old_val = data;
+ if ( ((m_old_val & 0xff) == 0xff) && ((data & 0xff) == 0) )
+ m_pot_wheel <<= 1;
+ m_old_val = data;
}
}
-static READ16_HANDLER( blmbycar_pot_wheel_r )
+READ16_MEMBER(blmbycar_state::blmbycar_pot_wheel_r)
{
- blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
- return ((state->m_pot_wheel & 0x80) ? 0x04 : 0) | (space->machine().rand() & 0x08);
+ return ((m_pot_wheel & 0x80) ? 0x04 : 0) | (machine().rand() & 0x08);
}
/* Preliminary optical wheel support */
-static READ16_HANDLER( blmbycar_opt_wheel_r )
+READ16_MEMBER(blmbycar_state::blmbycar_opt_wheel_r)
{
- return (~input_port_read(space->machine(), "WHEEL") & 0xff) << 8;
+ return (~input_port_read(machine(), "WHEEL") & 0xff) << 8;
}
@@ -118,22 +115,21 @@ static ADDRESS_MAP_START( blmbycar_map, AS_PROGRAM, 16, blmbycar_state )
AM_RANGE(0x444000, 0x445fff) AM_WRITEONLY AM_BASE_SIZE(m_spriteram, m_spriteram_size)// Sprites (size?)
AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW")
AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P1_P2")
- AM_RANGE(0x700004, 0x700005) AM_READ_LEGACY(blmbycar_opt_wheel_r) // Wheel (optical)
+ AM_RANGE(0x700004, 0x700005) AM_READ(blmbycar_opt_wheel_r) // Wheel (optical)
AM_RANGE(0x700006, 0x700007) AM_READ_PORT("UNK")
- AM_RANGE(0x700008, 0x700009) AM_READ_LEGACY(blmbycar_pot_wheel_r) // Wheel (potentiometer)
+ AM_RANGE(0x700008, 0x700009) AM_READ(blmbycar_pot_wheel_r) // Wheel (potentiometer)
AM_RANGE(0x70000a, 0x70000b) AM_WRITENOP // ? Wheel
- AM_RANGE(0x70000c, 0x70000d) AM_WRITE_LEGACY(blmbycar_okibank_w) // Sound
+ AM_RANGE(0x70000c, 0x70000d) AM_WRITE(blmbycar_okibank_w) // Sound
AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // Sound
- AM_RANGE(0x70006a, 0x70006b) AM_WRITE_LEGACY(blmbycar_pot_wheel_reset_w) // Wheel (potentiometer)
- AM_RANGE(0x70007a, 0x70007b) AM_WRITE_LEGACY(blmbycar_pot_wheel_shift_w) //
+ AM_RANGE(0x70006a, 0x70006b) AM_WRITE(blmbycar_pot_wheel_reset_w) // Wheel (potentiometer)
+ AM_RANGE(0x70007a, 0x70007b) AM_WRITE(blmbycar_pot_wheel_shift_w) //
ADDRESS_MAP_END
-static READ16_HANDLER( waterball_unk_r )
+READ16_MEMBER(blmbycar_state::waterball_unk_r)
{
- blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
- state->m_retvalue ^= 0x0008; // must toggle.. but not vblank?
- return state->m_retvalue;
+ m_retvalue ^= 0x0008; // must toggle.. but not vblank?
+ return m_retvalue;
}
static ADDRESS_MAP_START( watrball_map, AS_PROGRAM, 16, blmbycar_state )
@@ -154,9 +150,9 @@ static ADDRESS_MAP_START( watrball_map, AS_PROGRAM, 16, blmbycar_state )
AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW")
AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P1_P2")
AM_RANGE(0x700006, 0x700007) AM_READNOP // read
- AM_RANGE(0x700008, 0x700009) AM_READ_LEGACY(waterball_unk_r) // 0x0008 must toggle
+ AM_RANGE(0x700008, 0x700009) AM_READ(waterball_unk_r) // 0x0008 must toggle
AM_RANGE(0x70000a, 0x70000b) AM_WRITEONLY // ?? busy
- AM_RANGE(0x70000c, 0x70000d) AM_WRITE_LEGACY(blmbycar_okibank_w) // Sound
+ AM_RANGE(0x70000c, 0x70000d) AM_WRITE(blmbycar_okibank_w) // Sound
AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) //
ADDRESS_MAP_END
diff --git a/src/mame/drivers/blockade.c b/src/mame/drivers/blockade.c
index 66ace17a714..a34acebbb54 100644
--- a/src/mame/drivers/blockade.c
+++ b/src/mame/drivers/blockade.c
@@ -76,29 +76,27 @@ static INTERRUPT_GEN( blockade_interrupt )
*
*************************************/
-static READ8_HANDLER( blockade_input_port_0_r )
+READ8_MEMBER(blockade_state::blockade_input_port_0_r)
{
- blockade_state *state = space->machine().driver_data<blockade_state>();
/* coin latch is bit 7 */
- UINT8 temp = (input_port_read(space->machine(), "IN0") & 0x7f);
+ UINT8 temp = (input_port_read(machine(), "IN0") & 0x7f);
- return (state->m_coin_latch << 7) | temp;
+ return (m_coin_latch << 7) | temp;
}
-static WRITE8_HANDLER( blockade_coin_latch_w )
+WRITE8_MEMBER(blockade_state::blockade_coin_latch_w)
{
- blockade_state *state = space->machine().driver_data<blockade_state>();
if (data & 0x80)
{
if (BLOCKADE_LOG) mame_printf_debug("Reset Coin Latch\n");
- if (state->m_just_been_reset)
+ if (m_just_been_reset)
{
- state->m_just_been_reset = 0;
- state->m_coin_latch = 0;
+ m_just_been_reset = 0;
+ m_coin_latch = 0;
}
else
- state->m_coin_latch = 1;
+ m_coin_latch = 1;
}
if (data & 0x20)
@@ -127,7 +125,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, blockade_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( main_io_map, AS_IO, 8, blockade_state )
- AM_RANGE(0x01, 0x01) AM_READWRITE_LEGACY(blockade_input_port_0_r, blockade_coin_latch_w)
+ AM_RANGE(0x01, 0x01) AM_READWRITE(blockade_input_port_0_r, blockade_coin_latch_w)
AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1")
AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("discrete", blockade_sound_freq_w)
AM_RANGE(0x04, 0x04) AM_READ_PORT("IN2")
diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c
index 14a65e43650..407a807873b 100644
--- a/src/mame/drivers/blockhl.c
+++ b/src/mame/drivers/blockhl.c
@@ -38,76 +38,71 @@ static INTERRUPT_GEN( blockhl_interrupt )
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
}
-static READ8_HANDLER( bankedram_r )
+READ8_MEMBER(blockhl_state::bankedram_r)
{
- blockhl_state *state = space->machine().driver_data<blockhl_state>();
- if (state->m_palette_selected)
- return space->machine().generic.paletteram.u8[offset];
+ if (m_palette_selected)
+ return machine().generic.paletteram.u8[offset];
else
- return state->m_ram[offset];
+ return m_ram[offset];
}
-static WRITE8_HANDLER( bankedram_w )
+WRITE8_MEMBER(blockhl_state::bankedram_w)
{
- blockhl_state *state = space->machine().driver_data<blockhl_state>();
- if (state->m_palette_selected)
+ if (m_palette_selected)
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
else
- state->m_ram[offset] = data;
+ m_ram[offset] = data;
}
-static WRITE8_HANDLER( blockhl_sh_irqtrigger_w )
+WRITE8_MEMBER(blockhl_state::blockhl_sh_irqtrigger_w)
{
- blockhl_state *state = space->machine().driver_data<blockhl_state>();
- device_set_input_line_and_vector(state->m_audiocpu, 0, HOLD_LINE, 0xff);
+ device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff);
}
/* special handlers to combine 052109 & 051960 */
-static READ8_HANDLER( k052109_051960_r )
+READ8_MEMBER(blockhl_state::k052109_051960_r)
{
- blockhl_state *state = space->machine().driver_data<blockhl_state>();
- if (k052109_get_rmrd_line(state->m_k052109) == CLEAR_LINE)
+ if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
- return k051937_r(state->m_k051960, offset - 0x3800);
+ return k051937_r(m_k051960, offset - 0x3800);
else if (offset < 0x3c00)
- return k052109_r(state->m_k052109, offset);
+ return k052109_r(m_k052109, offset);
else
- return k051960_r(state->m_k051960, offset - 0x3c00);
+ return k051960_r(m_k051960, offset - 0x3c00);
}
else
- return k052109_r(state->m_k052109, offset);
+ return k052109_r(m_k052109, offset);
}
-static WRITE8_HANDLER( k052109_051960_w )
+WRITE8_MEMBER(blockhl_state::k052109_051960_w)
{
- blockhl_state *state = space->machine().driver_data<blockhl_state>();
if (offset >= 0x3800 && offset < 0x3808)
- k051937_w(state->m_k051960, offset - 0x3800, data);
+ k051937_w(m_k051960, offset - 0x3800, data);
else if (offset < 0x3c00)
- k052109_w(state->m_k052109, offset, data);
+ k052109_w(m_k052109, offset, data);
else
- k051960_w(state->m_k051960, offset - 0x3c00, data);
+ k051960_w(m_k051960, offset - 0x3c00, data);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, blockhl_state )
AM_RANGE(0x1f84, 0x1f84) AM_WRITE_LEGACY(soundlatch_w)
- AM_RANGE(0x1f88, 0x1f88) AM_WRITE_LEGACY(blockhl_sh_irqtrigger_w)
+ AM_RANGE(0x1f88, 0x1f88) AM_WRITE(blockhl_sh_irqtrigger_w)
AM_RANGE(0x1f8c, 0x1f8c) AM_WRITE_LEGACY(watchdog_reset_w)
AM_RANGE(0x1f94, 0x1f94) AM_READ_PORT("DSW3")
AM_RANGE(0x1f95, 0x1f95) AM_READ_PORT("P1")
AM_RANGE(0x1f96, 0x1f96) AM_READ_PORT("P2")
AM_RANGE(0x1f97, 0x1f97) AM_READ_PORT("DSW1")
AM_RANGE(0x1f98, 0x1f98) AM_READ_PORT("DSW2")
- AM_RANGE(0x0000, 0x3fff) AM_READWRITE_LEGACY(k052109_051960_r, k052109_051960_w)
+ AM_RANGE(0x0000, 0x3fff) AM_READWRITE(k052109_051960_r, k052109_051960_w)
AM_RANGE(0x4000, 0x57ff) AM_RAM
- AM_RANGE(0x5800, 0x5fff) AM_READWRITE_LEGACY(bankedram_r, bankedram_w) AM_BASE(m_ram)
+ AM_RANGE(0x5800, 0x5fff) AM_READWRITE(bankedram_r, bankedram_w) AM_BASE(m_ram)
AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank1")
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
diff --git a/src/mame/drivers/blockout.c b/src/mame/drivers/blockout.c
index 9290b8755d5..72264a1e304 100644
--- a/src/mame/drivers/blockout.c
+++ b/src/mame/drivers/blockout.c
@@ -74,29 +74,26 @@
#define MAIN_CLOCK XTAL_10MHz
#define AUDIO_CLOCK XTAL_3_579545MHz
-static WRITE16_HANDLER( blockout_sound_command_w )
+WRITE16_MEMBER(blockout_state::blockout_sound_command_w)
{
- blockout_state *state = space->machine().driver_data<blockout_state>();
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, offset, data & 0xff);
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
}
-static WRITE16_HANDLER( blockout_irq6_ack_w )
+WRITE16_MEMBER(blockout_state::blockout_irq6_ack_w)
{
- blockout_state *state = space->machine().driver_data<blockout_state>();
- device_set_input_line(state->m_maincpu, 6, CLEAR_LINE);
+ device_set_input_line(m_maincpu, 6, CLEAR_LINE);
}
-static WRITE16_HANDLER( blockout_irq5_ack_w )
+WRITE16_MEMBER(blockout_state::blockout_irq5_ack_w)
{
- blockout_state *state = space->machine().driver_data<blockout_state>();
- device_set_input_line(state->m_maincpu, 5, CLEAR_LINE);
+ device_set_input_line(m_maincpu, 5, CLEAR_LINE);
}
/*************************************
@@ -112,9 +109,9 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, blockout_state )
AM_RANGE(0x100004, 0x100005) AM_READ_PORT("SYSTEM")
AM_RANGE(0x100006, 0x100007) AM_READ_PORT("DSW1")
AM_RANGE(0x100008, 0x100009) AM_READ_PORT("DSW2")
- AM_RANGE(0x100010, 0x100011) AM_WRITE_LEGACY(blockout_irq6_ack_w)
- AM_RANGE(0x100012, 0x100013) AM_WRITE_LEGACY(blockout_irq5_ack_w)
- AM_RANGE(0x100014, 0x100015) AM_WRITE_LEGACY(blockout_sound_command_w)
+ AM_RANGE(0x100010, 0x100011) AM_WRITE(blockout_irq6_ack_w)
+ AM_RANGE(0x100012, 0x100013) AM_WRITE(blockout_irq5_ack_w)
+ AM_RANGE(0x100014, 0x100015) AM_WRITE(blockout_sound_command_w)
AM_RANGE(0x100016, 0x100017) AM_WRITENOP /* don't know, maybe reset sound CPU */
AM_RANGE(0x180000, 0x1bffff) AM_RAM_WRITE_LEGACY(blockout_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0x1d4000, 0x1dffff) AM_RAM /* work RAM */
@@ -132,9 +129,9 @@ static ADDRESS_MAP_START( agress_map, AS_PROGRAM, 16, blockout_state )
AM_RANGE(0x100004, 0x100005) AM_READ_PORT("SYSTEM")
AM_RANGE(0x100006, 0x100007) AM_READ_PORT("DSW1")
AM_RANGE(0x100008, 0x100009) AM_READ_PORT("DSW2")
- AM_RANGE(0x100010, 0x100011) AM_WRITE_LEGACY(blockout_irq6_ack_w)
- AM_RANGE(0x100012, 0x100013) AM_WRITE_LEGACY(blockout_irq5_ack_w)
- AM_RANGE(0x100014, 0x100015) AM_WRITE_LEGACY(blockout_sound_command_w)
+ AM_RANGE(0x100010, 0x100011) AM_WRITE(blockout_irq6_ack_w)
+ AM_RANGE(0x100012, 0x100013) AM_WRITE(blockout_irq5_ack_w)
+ AM_RANGE(0x100014, 0x100015) AM_WRITE(blockout_sound_command_w)
AM_RANGE(0x100016, 0x100017) AM_WRITENOP /* don't know, maybe reset sound CPU */
AM_RANGE(0x180000, 0x1bffff) AM_RAM_WRITE_LEGACY(blockout_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0x1d4000, 0x1dffff) AM_RAM /* work RAM */
diff --git a/src/mame/drivers/blueprnt.c b/src/mame/drivers/blueprnt.c
index 403705699df..45cd7e2164e 100644
--- a/src/mame/drivers/blueprnt.c
+++ b/src/mame/drivers/blueprnt.c
@@ -63,23 +63,21 @@ static WRITE8_DEVICE_HANDLER( dipsw_w )
state->m_dipsw = data;
}
-static READ8_HANDLER( blueprnt_sh_dipsw_r )
+READ8_MEMBER(blueprnt_state::blueprnt_sh_dipsw_r)
{
- blueprnt_state *state = space->machine().driver_data<blueprnt_state>();
- return state->m_dipsw;
+ return m_dipsw;
}
-static WRITE8_HANDLER( blueprnt_sound_command_w )
+WRITE8_MEMBER(blueprnt_state::blueprnt_sound_command_w)
{
- blueprnt_state *state = space->machine().driver_data<blueprnt_state>();
soundlatch_w(space, offset, data);
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
-static WRITE8_HANDLER( blueprnt_coin_counter_w )
+WRITE8_MEMBER(blueprnt_state::blueprnt_coin_counter_w)
{
- coin_counter_w(space->machine(), 0, data & 0x01);
- coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(machine(), 0, data & 0x01);
+ coin_counter_w(machine(), 1, data & 0x02);
}
/*************************************
@@ -94,10 +92,10 @@ static ADDRESS_MAP_START( blueprnt_map, AS_PROGRAM, 8, blueprnt_state )
AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE_LEGACY(blueprnt_videoram_w) AM_MIRROR(0x400) AM_BASE(m_videoram)
AM_RANGE(0xa000, 0xa0ff) AM_RAM AM_BASE(m_scrollram)
AM_RANGE(0xb000, 0xb0ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size)
- AM_RANGE(0xc000, 0xc000) AM_READ_PORT("P1") AM_WRITE_LEGACY(blueprnt_coin_counter_w)
+ AM_RANGE(0xc000, 0xc000) AM_READ_PORT("P1") AM_WRITE(blueprnt_coin_counter_w)
AM_RANGE(0xc001, 0xc001) AM_READ_PORT("P2")
- AM_RANGE(0xc003, 0xc003) AM_READ_LEGACY(blueprnt_sh_dipsw_r)
- AM_RANGE(0xd000, 0xd000) AM_WRITE_LEGACY(blueprnt_sound_command_w)
+ AM_RANGE(0xc003, 0xc003) AM_READ(blueprnt_sh_dipsw_r)
+ AM_RANGE(0xd000, 0xd000) AM_WRITE(blueprnt_sound_command_w)
AM_RANGE(0xe000, 0xe000) AM_READWRITE_LEGACY(watchdog_reset_r, blueprnt_flipscreen_w)
AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE_LEGACY(blueprnt_colorram_w) AM_BASE(m_colorram)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/bogeyman.c b/src/mame/drivers/bogeyman.c
index e634f14fb1d..1b3bf674534 100644
--- a/src/mame/drivers/bogeyman.c
+++ b/src/mame/drivers/bogeyman.c
@@ -21,28 +21,26 @@
// Sound section is copied from Mysterious Stones driver by Nicola, Mike, Brad
-static WRITE8_HANDLER( bogeyman_8910_latch_w )
+WRITE8_MEMBER(bogeyman_state::bogeyman_8910_latch_w)
{
- bogeyman_state *state = space->machine().driver_data<bogeyman_state>();
- state->m_psg_latch = data;
+ m_psg_latch = data;
}
-static WRITE8_HANDLER( bogeyman_8910_control_w )
+WRITE8_MEMBER(bogeyman_state::bogeyman_8910_control_w)
{
- bogeyman_state *state = space->machine().driver_data<bogeyman_state>();
// bit 0 is flipscreen
- flip_screen_set(space->machine(), data & 0x01);
+ flip_screen_set(machine(), data & 0x01);
// bit 5 goes to 8910 #0 BDIR pin
- if ((state->m_last_write & 0x20) == 0x20 && (data & 0x20) == 0x00)
- ay8910_data_address_w(space->machine().device("ay1"), state->m_last_write >> 4, state->m_psg_latch);
+ if ((m_last_write & 0x20) == 0x20 && (data & 0x20) == 0x00)
+ ay8910_data_address_w(machine().device("ay1"), m_last_write >> 4, m_psg_latch);
// bit 7 goes to 8910 #1 BDIR pin
- if ((state->m_last_write & 0x80) == 0x80 && (data & 0x80) == 0x00)
- ay8910_data_address_w(space->machine().device("ay2"), state->m_last_write >> 6, state->m_psg_latch);
+ if ((m_last_write & 0x80) == 0x80 && (data & 0x80) == 0x00)
+ ay8910_data_address_w(machine().device("ay2"), m_last_write >> 6, m_psg_latch);
- state->m_last_write = data;
+ m_last_write = data;
}
/* Memory Map */
@@ -55,8 +53,8 @@ static ADDRESS_MAP_START( bogeyman_map, AS_PROGRAM, 8, bogeyman_state )
AM_RANGE(0x2100, 0x21ff) AM_RAM_WRITE_LEGACY(bogeyman_colorram_w) AM_BASE(m_colorram)
AM_RANGE(0x2800, 0x2bff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size)
AM_RANGE(0x3000, 0x300f) AM_RAM_WRITE_LEGACY(bogeyman_paletteram_w) AM_BASE_GENERIC(paletteram)
- AM_RANGE(0x3800, 0x3800) AM_READ_PORT("P1") AM_WRITE_LEGACY(bogeyman_8910_control_w)
- AM_RANGE(0x3801, 0x3801) AM_READ_PORT("P2") AM_WRITE_LEGACY(bogeyman_8910_latch_w)
+ AM_RANGE(0x3800, 0x3800) AM_READ_PORT("P1") AM_WRITE(bogeyman_8910_control_w)
+ AM_RANGE(0x3801, 0x3801) AM_READ_PORT("P2") AM_WRITE(bogeyman_8910_latch_w)
AM_RANGE(0x3802, 0x3802) AM_READ_PORT("DSW1")
AM_RANGE(0x3803, 0x3803) AM_READ_PORT("DSW2") AM_WRITENOP // ??? sound
AM_RANGE(0x4000, 0xffff) AM_ROM
diff --git a/src/mame/drivers/bombjack.c b/src/mame/drivers/bombjack.c
index beab5f6fb4c..e5886c722ee 100644
--- a/src/mame/drivers/bombjack.c
+++ b/src/mame/drivers/bombjack.c
@@ -107,19 +107,18 @@ static TIMER_CALLBACK( soundlatch_callback )
state->m_latch = param;
}
-static WRITE8_HANDLER( bombjack_soundlatch_w )
+WRITE8_MEMBER(bombjack_state::bombjack_soundlatch_w)
{
/* make all the CPUs synchronize, and only AFTER that write the new command to the latch */
- space->machine().scheduler().synchronize(FUNC(soundlatch_callback), data);
+ machine().scheduler().synchronize(FUNC(soundlatch_callback), data);
}
-static READ8_HANDLER( bombjack_soundlatch_r )
+READ8_MEMBER(bombjack_state::bombjack_soundlatch_r)
{
- bombjack_state *state = space->machine().driver_data<bombjack_state>();
int res;
- res = state->m_latch;
- state->m_latch = 0;
+ res = m_latch;
+ m_latch = 0;
return res;
}
@@ -130,11 +129,10 @@ static READ8_HANDLER( bombjack_soundlatch_r )
*
*************************************/
-static WRITE8_HANDLER( irq_mask_w )
+WRITE8_MEMBER(bombjack_state::irq_mask_w)
{
- bombjack_state *state = space->machine().driver_data<bombjack_state>();
- state->m_nmi_mask = data & 1;
+ m_nmi_mask = data & 1;
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, bombjack_state )
@@ -147,21 +145,21 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, bombjack_state )
AM_RANGE(0x9c00, 0x9cff) AM_WRITE_LEGACY(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0x9e00, 0x9e00) AM_WRITE_LEGACY(bombjack_background_w)
AM_RANGE(0xb000, 0xb000) AM_READ_PORT("P1")
- AM_RANGE(0xb000, 0xb000) AM_WRITE_LEGACY(irq_mask_w)
+ AM_RANGE(0xb000, 0xb000) AM_WRITE(irq_mask_w)
AM_RANGE(0xb001, 0xb001) AM_READ_PORT("P2")
AM_RANGE(0xb002, 0xb002) AM_READ_PORT("SYSTEM")
AM_RANGE(0xb003, 0xb003) AM_READNOP /* watchdog reset? */
AM_RANGE(0xb004, 0xb004) AM_READ_PORT("DSW1")
AM_RANGE(0xb004, 0xb004) AM_WRITE_LEGACY(bombjack_flipscreen_w)
AM_RANGE(0xb005, 0xb005) AM_READ_PORT("DSW2")
- AM_RANGE(0xb800, 0xb800) AM_WRITE_LEGACY(bombjack_soundlatch_w)
+ AM_RANGE(0xb800, 0xb800) AM_WRITE(bombjack_soundlatch_w)
AM_RANGE(0xc000, 0xdfff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, bombjack_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x4000, 0x43ff) AM_RAM
- AM_RANGE(0x6000, 0x6000) AM_READ_LEGACY(bombjack_soundlatch_r)
+ AM_RANGE(0x6000, 0x6000) AM_READ(bombjack_soundlatch_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( audio_io_map, AS_IO, 8, bombjack_state )
diff --git a/src/mame/drivers/bottom9.c b/src/mame/drivers/bottom9.c
index 89ec502714b..4a1275994b4 100644
--- a/src/mame/drivers/bottom9.c
+++ b/src/mame/drivers/bottom9.c
@@ -28,81 +28,75 @@ static INTERRUPT_GEN( bottom9_interrupt )
device_set_input_line(device, 0, HOLD_LINE);
}
-static READ8_HANDLER( k052109_051960_r )
+READ8_MEMBER(bottom9_state::k052109_051960_r)
{
- bottom9_state *state = space->machine().driver_data<bottom9_state>();
- if (k052109_get_rmrd_line(state->m_k052109) == CLEAR_LINE)
+ if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
- return k051937_r(state->m_k051960, offset - 0x3800);
+ return k051937_r(m_k051960, offset - 0x3800);
else if (offset < 0x3c00)
- return k052109_r(state->m_k052109, offset);
+ return k052109_r(m_k052109, offset);
else
- return k051960_r(state->m_k051960, offset - 0x3c00);
+ return k051960_r(m_k051960, offset - 0x3c00);
}
else
- return k052109_r(state->m_k052109, offset);
+ return k052109_r(m_k052109, offset);
}
-static WRITE8_HANDLER( k052109_051960_w )
+WRITE8_MEMBER(bottom9_state::k052109_051960_w)
{
- bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (offset >= 0x3800 && offset < 0x3808)
- k051937_w(state->m_k051960, offset - 0x3800, data);
+ k051937_w(m_k051960, offset - 0x3800, data);
else if (offset < 0x3c00)
- k052109_w(state->m_k052109, offset, data);
+ k052109_w(m_k052109, offset, data);
else
- k051960_w(state->m_k051960, offset - 0x3c00, data);
+ k051960_w(m_k051960, offset - 0x3c00, data);
}
-static READ8_HANDLER( bottom9_bankedram1_r )
+READ8_MEMBER(bottom9_state::bottom9_bankedram1_r)
{
- bottom9_state *state = space->machine().driver_data<bottom9_state>();
- if (state->m_k052109_selected)
+ if (m_k052109_selected)
return k052109_051960_r(space, offset);
else
{
- if (state->m_zoomreadroms)
- return k051316_rom_r(state->m_k051316, offset);
+ if (m_zoomreadroms)
+ return k051316_rom_r(m_k051316, offset);
else
- return k051316_r(state->m_k051316, offset);
+ return k051316_r(m_k051316, offset);
}
}
-static WRITE8_HANDLER( bottom9_bankedram1_w )
+WRITE8_MEMBER(bottom9_state::bottom9_bankedram1_w)
{
- bottom9_state *state = space->machine().driver_data<bottom9_state>();
- if (state->m_k052109_selected)
+ if (m_k052109_selected)
k052109_051960_w(space, offset, data);
else
- k051316_w(state->m_k051316, offset, data);
+ k051316_w(m_k051316, offset, data);
}
-static READ8_HANDLER( bottom9_bankedram2_r )
+READ8_MEMBER(bottom9_state::bottom9_bankedram2_r)
{
- bottom9_state *state = space->machine().driver_data<bottom9_state>();
- if (state->m_k052109_selected)
+ if (m_k052109_selected)
return k052109_051960_r(space, offset + 0x2000);
else
- return space->machine().generic.paletteram.u8[offset];
+ return machine().generic.paletteram.u8[offset];
}
-static WRITE8_HANDLER( bottom9_bankedram2_w )
+WRITE8_MEMBER(bottom9_state::bottom9_bankedram2_w)
{
- bottom9_state *state = space->machine().driver_data<bottom9_state>();
- if (state->m_k052109_selected)
+ if (m_k052109_selected)
k052109_051960_w(space, offset + 0x2000, data);
else
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
}
-static WRITE8_HANDLER( bankswitch_w )
+WRITE8_MEMBER(bottom9_state::bankswitch_w)
{
int bank;
@@ -116,34 +110,32 @@ static WRITE8_HANDLER( bankswitch_w )
else
bank = ((data & 0x0e) >> 1);
- memory_set_bank(space->machine(), "bank1", bank);
+ memory_set_bank(machine(), "bank1", bank);
}
-static WRITE8_HANDLER( bottom9_1f90_w )
+WRITE8_MEMBER(bottom9_state::bottom9_1f90_w)
{
- bottom9_state *state = space->machine().driver_data<bottom9_state>();
/* bits 0/1 = coin counters */
- coin_counter_w(space->machine(), 0, data & 0x01);
- coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(machine(), 0, data & 0x01);
+ coin_counter_w(machine(), 1, data & 0x02);
/* bit 2 = enable char ROM reading through the video RAM */
- k052109_set_rmrd_line(state->m_k052109, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
+ k052109_set_rmrd_line(m_k052109, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
/* bit 3 = disable video */
- state->m_video_enable = ~data & 0x08;
+ m_video_enable = ~data & 0x08;
/* bit 4 = enable 051316 ROM reading */
- state->m_zoomreadroms = data & 0x10;
+ m_zoomreadroms = data & 0x10;
/* bit 5 = RAM bank */
- state->m_k052109_selected = data & 0x20;
+ m_k052109_selected = data & 0x20;
}
-static WRITE8_HANDLER( bottom9_sh_irqtrigger_w )
+WRITE8_MEMBER(bottom9_state::bottom9_sh_irqtrigger_w)
{
- bottom9_state *state = space->machine().driver_data<bottom9_state>();
- device_set_input_line_and_vector(state->m_audiocpu, 0, HOLD_LINE, 0xff);
+ device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff);
}
static INTERRUPT_GEN( bottom9_sound_interrupt )
@@ -153,42 +145,40 @@ static INTERRUPT_GEN( bottom9_sound_interrupt )
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
-static WRITE8_HANDLER( nmi_enable_w )
+WRITE8_MEMBER(bottom9_state::nmi_enable_w)
{
- bottom9_state *state = space->machine().driver_data<bottom9_state>();
- state->m_nmienable = data;
+ m_nmienable = data;
}
-static WRITE8_HANDLER( sound_bank_w )
+WRITE8_MEMBER(bottom9_state::sound_bank_w)
{
- bottom9_state *state = space->machine().driver_data<bottom9_state>();
int bank_A, bank_B;
bank_A = ((data >> 0) & 0x03);
bank_B = ((data >> 2) & 0x03);
- k007232_set_bank(state->m_k007232_1, bank_A, bank_B);
+ k007232_set_bank(m_k007232_1, bank_A, bank_B);
bank_A = ((data >> 4) & 0x03);
bank_B = ((data >> 6) & 0x03);
- k007232_set_bank(state->m_k007232_2, bank_A, bank_B);
+ k007232_set_bank(m_k007232_2, bank_A, bank_B);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, bottom9_state )
- AM_RANGE(0x0000, 0x07ff) AM_READWRITE_LEGACY(bottom9_bankedram1_r, bottom9_bankedram1_w)
- AM_RANGE(0x1f80, 0x1f80) AM_WRITE_LEGACY(bankswitch_w)
- AM_RANGE(0x1f90, 0x1f90) AM_WRITE_LEGACY(bottom9_1f90_w)
+ AM_RANGE(0x0000, 0x07ff) AM_READWRITE(bottom9_bankedram1_r, bottom9_bankedram1_w)
+ AM_RANGE(0x1f80, 0x1f80) AM_WRITE(bankswitch_w)
+ AM_RANGE(0x1f90, 0x1f90) AM_WRITE(bottom9_1f90_w)
AM_RANGE(0x1fa0, 0x1fa0) AM_WRITE_LEGACY(watchdog_reset_w)
AM_RANGE(0x1fb0, 0x1fb0) AM_WRITE_LEGACY(soundlatch_w)
- AM_RANGE(0x1fc0, 0x1fc0) AM_WRITE_LEGACY(bottom9_sh_irqtrigger_w)
+ AM_RANGE(0x1fc0, 0x1fc0) AM_WRITE(bottom9_sh_irqtrigger_w)
AM_RANGE(0x1fd0, 0x1fd0) AM_READ_PORT("SYSTEM")
AM_RANGE(0x1fd1, 0x1fd1) AM_READ_PORT("P1")
AM_RANGE(0x1fd2, 0x1fd2) AM_READ_PORT("P2")
AM_RANGE(0x1fd3, 0x1fd3) AM_READ_PORT("DSW1")
AM_RANGE(0x1fe0, 0x1fe0) AM_READ_PORT("DSW2")
AM_RANGE(0x1ff0, 0x1fff) AM_DEVWRITE_LEGACY("k051316", k051316_ctrl_w)
- AM_RANGE(0x2000, 0x27ff) AM_READWRITE_LEGACY(bottom9_bankedram2_r, bottom9_bankedram2_w) AM_BASE_GENERIC(paletteram)
- AM_RANGE(0x0000, 0x3fff) AM_READWRITE_LEGACY(k052109_051960_r, k052109_051960_w)
+ AM_RANGE(0x2000, 0x27ff) AM_READWRITE(bottom9_bankedram2_r, bottom9_bankedram2_w) AM_BASE_GENERIC(paletteram)
+ AM_RANGE(0x0000, 0x3fff) AM_READWRITE(k052109_051960_r, k052109_051960_w)
AM_RANGE(0x4000, 0x5fff) AM_RAM
AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank1")
AM_RANGE(0x8000, 0xffff) AM_ROM
@@ -197,11 +187,11 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, bottom9_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
- AM_RANGE(0x9000, 0x9000) AM_WRITE_LEGACY(sound_bank_w)
+ AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w)
AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE_LEGACY("k007232_1", k007232_r, k007232_w)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232_2", k007232_r, k007232_w)
AM_RANGE(0xd000, 0xd000) AM_READ_LEGACY(soundlatch_r)
- AM_RANGE(0xf000, 0xf000) AM_WRITE_LEGACY(nmi_enable_w)
+ AM_RANGE(0xf000, 0xf000) AM_WRITE(nmi_enable_w)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/brkthru.c b/src/mame/drivers/brkthru.c
index ea8a7874285..cafff15615e 100644
--- a/src/mame/drivers/brkthru.c
+++ b/src/mame/drivers/brkthru.c
@@ -65,38 +65,35 @@
*
*************************************/
-static WRITE8_HANDLER( brkthru_1803_w )
+WRITE8_MEMBER(brkthru_state::brkthru_1803_w)
{
- brkthru_state *state = space->machine().driver_data<brkthru_state>();
/* bit 0 = NMI enable */
- state->m_nmi_mask = ~data & 1;
+ m_nmi_mask = ~data & 1;
if(data & 2)
- device_set_input_line(state->m_maincpu, 0, CLEAR_LINE);
+ device_set_input_line(m_maincpu, 0, CLEAR_LINE);
/* bit 1 = ? maybe IRQ acknowledge */
}
-static WRITE8_HANDLER( darwin_0803_w )
+WRITE8_MEMBER(brkthru_state::darwin_0803_w)
{
- brkthru_state *state = space->machine().driver_data<brkthru_state>();
/* bit 0 = NMI enable */
- state->m_nmi_mask = data & 1;
+ m_nmi_mask = data & 1;
logerror("0803 %02X\n",data);
if(data & 2)
- device_set_input_line(state->m_maincpu, 0, CLEAR_LINE);
+ device_set_input_line(m_maincpu, 0, CLEAR_LINE);
/* bit 1 = ? maybe IRQ acknowledge */
}
-static WRITE8_HANDLER( brkthru_soundlatch_w )
+WRITE8_MEMBER(brkthru_state::brkthru_soundlatch_w)
{
- brkthru_state *state = space->machine().driver_data<brkthru_state>();
soundlatch_w(space, offset, data);
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static INPUT_CHANGED( coin_inserted )
@@ -126,8 +123,8 @@ static ADDRESS_MAP_START( brkthru_map, AS_PROGRAM, 8, brkthru_state )
AM_RANGE(0x1802, 0x1802) AM_READ_PORT("DSW1")
AM_RANGE(0x1803, 0x1803) AM_READ_PORT("DSW2/COIN")
AM_RANGE(0x1800, 0x1801) AM_WRITE_LEGACY(brkthru_1800_w) /* bg scroll and color, ROM bank selection, flip screen */
- AM_RANGE(0x1802, 0x1802) AM_WRITE_LEGACY(brkthru_soundlatch_w)
- AM_RANGE(0x1803, 0x1803) AM_WRITE_LEGACY(brkthru_1803_w) /* NMI enable, + ? */
+ AM_RANGE(0x1802, 0x1802) AM_WRITE(brkthru_soundlatch_w)
+ AM_RANGE(0x1803, 0x1803) AM_WRITE(brkthru_1803_w) /* NMI enable, + ? */
AM_RANGE(0x2000, 0x3fff) AM_ROMBANK("bank1")
AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -144,8 +141,8 @@ static ADDRESS_MAP_START( darwin_map, AS_PROGRAM, 8, brkthru_state )
AM_RANGE(0x0802, 0x0802) AM_READ_PORT("DSW1")
AM_RANGE(0x0803, 0x0803) AM_READ_PORT("DSW2/COIN")
AM_RANGE(0x0800, 0x0801) AM_WRITE_LEGACY(brkthru_1800_w) /* bg scroll and color, ROM bank selection, flip screen */
- AM_RANGE(0x0802, 0x0802) AM_WRITE_LEGACY(brkthru_soundlatch_w)
- AM_RANGE(0x0803, 0x0803) AM_WRITE_LEGACY(darwin_0803_w) /* NMI enable, + ? */
+ AM_RANGE(0x0802, 0x0802) AM_WRITE(brkthru_soundlatch_w)
+ AM_RANGE(0x0803, 0x0803) AM_WRITE(darwin_0803_w) /* NMI enable, + ? */
AM_RANGE(0x2000, 0x3fff) AM_ROMBANK("bank1")
AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c
index ec921b8b480..ee7dbc9f2f8 100644
--- a/src/mame/drivers/btime.c
+++ b/src/mame/drivers/btime.c
@@ -158,23 +158,22 @@ enum
};
-static WRITE8_HANDLER( audio_command_w );
-static READ8_HANDLER( audio_command_r );
-static READ8_HANDLER( zoar_dsw1_read );
+
+
+
static UINT8 *decrypted;
-static WRITE8_HANDLER( audio_nmi_enable_w )
+WRITE8_MEMBER(btime_state::audio_nmi_enable_w)
{
- btime_state *state = space->machine().driver_data<btime_state>();
/* for most games, this serves as the NMI enable for the audio CPU; however,
lnc and disco use bit 0 of the first AY-8910's port A instead; many other
games also write there in addition to this address */
- if (state->m_audio_nmi_enable_type == AUDIO_ENABLE_DIRECT)
+ if (m_audio_nmi_enable_type == AUDIO_ENABLE_DIRECT)
{
- state->m_audio_nmi_enabled = data & 1;
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, (state->m_audio_nmi_enabled && state->m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
+ m_audio_nmi_enabled = data & 1;
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, (m_audio_nmi_enabled && m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
}
}
@@ -237,126 +236,120 @@ static void btime_decrypt( address_space *space )
}
}
-static WRITE8_HANDLER( lnc_w )
+WRITE8_MEMBER(btime_state::lnc_w)
{
- btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x3bff) ;
- else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; }
- else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(space, offset - 0x7c00, data); return; }
+ else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(&space, offset - 0x3c00, data); return; }
+ else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(&space, offset - 0x7c00, data); return; }
else if (offset == 0x8000) { return; } /* AM_NOP */
- else if (offset == 0x8001) { bnj_video_control_w(space, 0, data); return; }
+ else if (offset == 0x8001) { bnj_video_control_w(&space, 0, data); return; }
else if (offset == 0x8003) ;
else if (offset == 0x9000) { return; } /* AM_NOP */
else if (offset == 0x9002) { audio_command_w(space, 0, data); return; }
else if (offset >= 0xb000 && offset <= 0xb1ff) ;
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->device().tag(), cpu_get_pc(&space->device()), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
- state->m_rambase[offset] = data;
+ m_rambase[offset] = data;
/* Swap bits 5 & 6 for opcodes */
decrypted[offset] = swap_bits_5_6(data);
}
-static WRITE8_HANDLER( mmonkey_w )
+WRITE8_MEMBER(btime_state::mmonkey_w)
{
- btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x3bff) ;
- else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; }
- else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(space, offset - 0x7c00, data); return; }
- else if (offset == 0x8001) { bnj_video_control_w(space, 0, data); return; }
+ else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(&space, offset - 0x3c00, data); return; }
+ else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(&space, offset - 0x7c00, data); return; }
+ else if (offset == 0x8001) { bnj_video_control_w(&space, 0, data); return; }
else if (offset == 0x8003) ;
else if (offset == 0x9000) { return; } /* AM_NOP */
else if (offset == 0x9002) { audio_command_w(space, 0, data); return; }
- else if (offset >= 0xb000 && offset <= 0xbfff) { mmonkey_protection_w(space, offset - 0xb000, data); return; }
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->device().tag(), cpu_get_pc(&space->device()), data, offset);
+ else if (offset >= 0xb000 && offset <= 0xbfff) { mmonkey_protection_w(&space, offset - 0xb000, data); return; }
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
- state->m_rambase[offset] = data;
+ m_rambase[offset] = data;
/* Swap bits 5 & 6 for opcodes */
decrypted[offset] = swap_bits_5_6(data);
}
-static WRITE8_HANDLER( btime_w )
+WRITE8_MEMBER(btime_state::btime_w)
{
- btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x07ff) ;
- else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data);
+ else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(&space, offset - 0x0c00, data);
else if (offset >= 0x1000 && offset <= 0x17ff) ;
- else if (offset >= 0x1800 && offset <= 0x1bff) btime_mirrorvideoram_w(space, offset - 0x1800, data);
- else if (offset >= 0x1c00 && offset <= 0x1fff) btime_mirrorcolorram_w(space, offset - 0x1c00, data);
- else if (offset == 0x4002) btime_video_control_w(space, 0, data);
+ else if (offset >= 0x1800 && offset <= 0x1bff) btime_mirrorvideoram_w(&space, offset - 0x1800, data);
+ else if (offset >= 0x1c00 && offset <= 0x1fff) btime_mirrorcolorram_w(&space, offset - 0x1c00, data);
+ else if (offset == 0x4002) btime_video_control_w(&space, 0, data);
else if (offset == 0x4003) audio_command_w(space, 0, data);
- else if (offset == 0x4004) bnj_scroll1_w(space, 0, data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->device().tag(), cpu_get_pc(&space->device()), data, offset);
+ else if (offset == 0x4004) bnj_scroll1_w(&space, 0, data);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
- state->m_rambase[offset] = data;
+ m_rambase[offset] = data;
- btime_decrypt(space);
+ btime_decrypt(&space);
}
-static WRITE8_HANDLER( tisland_w )
+WRITE8_MEMBER(btime_state::tisland_w)
{
- btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x07ff) ;
- else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data);
+ else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(&space, offset - 0x0c00, data);
else if (offset >= 0x1000 && offset <= 0x17ff) ;
- else if (offset >= 0x1800 && offset <= 0x1bff) btime_mirrorvideoram_w(space, offset - 0x1800, data);
- else if (offset >= 0x1c00 && offset <= 0x1fff) btime_mirrorcolorram_w(space, offset - 0x1c00, data);
- else if (offset == 0x4002) btime_video_control_w(space, 0, data);
+ else if (offset >= 0x1800 && offset <= 0x1bff) btime_mirrorvideoram_w(&space, offset - 0x1800, data);
+ else if (offset >= 0x1c00 && offset <= 0x1fff) btime_mirrorcolorram_w(&space, offset - 0x1c00, data);
+ else if (offset == 0x4002) btime_video_control_w(&space, 0, data);
else if (offset == 0x4003) audio_command_w(space, 0, data);
- else if (offset == 0x4004) bnj_scroll1_w(space, 0, data);
- else if (offset == 0x4005) bnj_scroll2_w(space, 0, data);
-// else if (offset == 0x8000) btime_video_control_w(space,0,data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->device().tag(), cpu_get_pc(&space->device()), data, offset);
+ else if (offset == 0x4004) bnj_scroll1_w(&space, 0, data);
+ else if (offset == 0x4005) bnj_scroll2_w(&space, 0, data);
+// else if (offset == 0x8000) btime_video_control_w(&space,0,data);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
- state->m_rambase[offset] = data;
+ m_rambase[offset] = data;
- btime_decrypt(space);
+ btime_decrypt(&space);
}
-static WRITE8_HANDLER( zoar_w )
+WRITE8_MEMBER(btime_state::zoar_w)
{
- btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x07ff) ;
else if (offset >= 0x8000 && offset <= 0x87ff) ;
- else if (offset >= 0x8800 && offset <= 0x8bff) btime_mirrorvideoram_w(space, offset - 0x8800, data);
- else if (offset >= 0x8c00 && offset <= 0x8fff) btime_mirrorcolorram_w(space, offset - 0x8c00, data);
- else if (offset == 0x9000) zoar_video_control_w(space, 0, data);
+ else if (offset >= 0x8800 && offset <= 0x8bff) btime_mirrorvideoram_w(&space, offset - 0x8800, data);
+ else if (offset >= 0x8c00 && offset <= 0x8fff) btime_mirrorcolorram_w(&space, offset - 0x8c00, data);
+ else if (offset == 0x9000) zoar_video_control_w(&space, 0, data);
else if (offset >= 0x9800 && offset <= 0x9803) ;
- else if (offset == 0x9804) bnj_scroll2_w(space, 0, data);
- else if (offset == 0x9805) bnj_scroll1_w(space, 0, data);
+ else if (offset == 0x9804) bnj_scroll2_w(&space, 0, data);
+ else if (offset == 0x9805) bnj_scroll1_w(&space, 0, data);
else if (offset == 0x9806) audio_command_w(space, 0, data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->device().tag(), cpu_get_pc(&space->device()), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
- state->m_rambase[offset] = data;
+ m_rambase[offset] = data;
- btime_decrypt(space);
+ btime_decrypt(&space);
}
-static WRITE8_HANDLER( disco_w )
+WRITE8_MEMBER(btime_state::disco_w)
{
- btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x04ff) ;
- else if (offset >= 0x2000 && offset <= 0x7fff) deco_charram_w(space, offset - 0x2000, data);
+ else if (offset >= 0x2000 && offset <= 0x7fff) deco_charram_w(&space, offset - 0x2000, data);
else if (offset >= 0x8000 && offset <= 0x881f) ;
else if (offset == 0x9a00) audio_command_w(space, 0, data);
- else if (offset == 0x9c00) disco_video_control_w(space, 0, data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->device().tag(), cpu_get_pc(&space->device()), data, offset);
+ else if (offset == 0x9c00) disco_video_control_w(&space, 0, data);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
- state->m_rambase[offset] = data;
+ m_rambase[offset] = data;
- btime_decrypt(space);
+ btime_decrypt(&space);
}
static ADDRESS_MAP_START( btime_map, AS_PROGRAM, 8, btime_state )
- AM_RANGE(0x0000, 0xffff) AM_WRITE_LEGACY(btime_w) /* override the following entries to */
+ AM_RANGE(0x0000, 0xffff) AM_WRITE(btime_w) /* override the following entries to */
/* support ROM decryption */
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(m_rambase)
AM_RANGE(0x0c00, 0x0c0f) AM_WRITE_LEGACY(btime_paletteram_w) AM_BASE_GENERIC(paletteram)
@@ -367,7 +360,7 @@ static ADDRESS_MAP_START( btime_map, AS_PROGRAM, 8, btime_state )
AM_RANGE(0x4000, 0x4000) AM_READ_PORT("P1") AM_WRITENOP
AM_RANGE(0x4001, 0x4001) AM_READ_PORT("P2")
AM_RANGE(0x4002, 0x4002) AM_READ_PORT("SYSTEM") AM_WRITE_LEGACY(btime_video_control_w)
- AM_RANGE(0x4003, 0x4003) AM_READ_PORT("DSW1") AM_WRITE_LEGACY(audio_command_w)
+ AM_RANGE(0x4003, 0x4003) AM_READ_PORT("DSW1") AM_WRITE(audio_command_w)
AM_RANGE(0x4004, 0x4004) AM_READ_PORT("DSW2") AM_WRITE_LEGACY(bnj_scroll1_w)
AM_RANGE(0xb000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -385,7 +378,7 @@ static ADDRESS_MAP_START( cookrace_map, AS_PROGRAM, 8, btime_state )
AM_RANGE(0xe000, 0xe000) AM_READ_PORT("DSW1") AM_WRITE_LEGACY(bnj_video_control_w)
AM_RANGE(0xe300, 0xe300) AM_READ_PORT("DSW1") /* mirror address used on high score name entry */
/* screen */
- AM_RANGE(0xe001, 0xe001) AM_READ_PORT("DSW2") AM_WRITE_LEGACY(audio_command_w)
+ AM_RANGE(0xe001, 0xe001) AM_READ_PORT("DSW2") AM_WRITE(audio_command_w)
AM_RANGE(0xe002, 0xe002) AM_READ_PORT("P1")
AM_RANGE(0xe003, 0xe003) AM_READ_PORT("P2")
AM_RANGE(0xe004, 0xe004) AM_READ_PORT("SYSTEM")
@@ -393,7 +386,7 @@ static ADDRESS_MAP_START( cookrace_map, AS_PROGRAM, 8, btime_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( tisland_map, AS_PROGRAM, 8, btime_state )
- AM_RANGE(0x0000, 0xffff) AM_WRITE_LEGACY(tisland_w) /* override the following entries to */
+ AM_RANGE(0x0000, 0xffff) AM_WRITE(tisland_w) /* override the following entries to */
/* support ROM decryption */
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(m_rambase)
AM_RANGE(0x0c00, 0x0c0f) AM_WRITE_LEGACY(btime_paletteram_w) AM_BASE_GENERIC(paletteram)
@@ -404,14 +397,14 @@ static ADDRESS_MAP_START( tisland_map, AS_PROGRAM, 8, btime_state )
AM_RANGE(0x4000, 0x4000) AM_READ_PORT("P1") AM_WRITENOP
AM_RANGE(0x4001, 0x4001) AM_READ_PORT("P2")
AM_RANGE(0x4002, 0x4002) AM_READ_PORT("SYSTEM") AM_WRITE_LEGACY(btime_video_control_w)
- AM_RANGE(0x4003, 0x4003) AM_READ_PORT("DSW1") AM_WRITE_LEGACY(audio_command_w)
+ AM_RANGE(0x4003, 0x4003) AM_READ_PORT("DSW1") AM_WRITE(audio_command_w)
AM_RANGE(0x4004, 0x4004) AM_READ_PORT("DSW2") AM_WRITE_LEGACY(bnj_scroll1_w)
AM_RANGE(0x4005, 0x4005) AM_WRITE_LEGACY(bnj_scroll2_w)
AM_RANGE(0x9000, 0xffff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( zoar_map, AS_PROGRAM, 8, btime_state )
- AM_RANGE(0x0000, 0xffff) AM_WRITE_LEGACY(zoar_w) /* override the following entries to */
+ AM_RANGE(0x0000, 0xffff) AM_WRITE(zoar_w) /* override the following entries to */
/* support ROM decryption */
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(m_rambase)
AM_RANGE(0x8000, 0x83ff) AM_WRITEONLY AM_BASE_SIZE(m_videoram, m_videoram_size)
@@ -419,19 +412,19 @@ static ADDRESS_MAP_START( zoar_map, AS_PROGRAM, 8, btime_state )
AM_RANGE(0x8800, 0x8bff) AM_WRITE_LEGACY(btime_mirrorvideoram_w)
AM_RANGE(0x8c00, 0x8fff) AM_WRITE_LEGACY(btime_mirrorcolorram_w)
AM_RANGE(0x9000, 0x9000) AM_WRITE_LEGACY(zoar_video_control_w)
- AM_RANGE(0x9800, 0x9800) AM_READ_LEGACY(zoar_dsw1_read)
+ AM_RANGE(0x9800, 0x9800) AM_READ(zoar_dsw1_read)
AM_RANGE(0x9801, 0x9801) AM_READ_PORT("DSW2")
AM_RANGE(0x9802, 0x9802) AM_READ_PORT("P1")
AM_RANGE(0x9803, 0x9803) AM_READ_PORT("P2")
AM_RANGE(0x9800, 0x9803) AM_WRITEONLY AM_BASE(m_zoar_scrollram)
AM_RANGE(0x9804, 0x9804) AM_READ_PORT("SYSTEM") AM_WRITE_LEGACY(bnj_scroll2_w)
AM_RANGE(0x9805, 0x9805) AM_WRITE_LEGACY(bnj_scroll1_w)
- AM_RANGE(0x9806, 0x9806) AM_WRITE_LEGACY(audio_command_w)
+ AM_RANGE(0x9806, 0x9806) AM_WRITE(audio_command_w)
AM_RANGE(0xd000, 0xffff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( lnc_map, AS_PROGRAM, 8, btime_state )
- AM_RANGE(0x0000, 0xffff) AM_WRITE_LEGACY(lnc_w) /* override the following entries to */
+ AM_RANGE(0x0000, 0xffff) AM_WRITE(lnc_w) /* override the following entries to */
/* support ROM decryption */
AM_RANGE(0x0000, 0x3bff) AM_RAM AM_BASE(m_rambase)
AM_RANGE(0x3c00, 0x3fff) AM_RAM_WRITE_LEGACY(lnc_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size)
@@ -442,13 +435,13 @@ static ADDRESS_MAP_START( lnc_map, AS_PROGRAM, 8, btime_state )
AM_RANGE(0x8003, 0x8003) AM_WRITEONLY AM_BASE(m_lnc_charbank)
AM_RANGE(0x9000, 0x9000) AM_READ_PORT("P1") AM_WRITENOP /* IRQ ack??? */
AM_RANGE(0x9001, 0x9001) AM_READ_PORT("P2")
- AM_RANGE(0x9002, 0x9002) AM_READ_PORT("SYSTEM") AM_WRITE_LEGACY(audio_command_w)
+ AM_RANGE(0x9002, 0x9002) AM_READ_PORT("SYSTEM") AM_WRITE(audio_command_w)
AM_RANGE(0xb000, 0xb1ff) AM_RAM
AM_RANGE(0xc000, 0xffff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( mmonkey_map, AS_PROGRAM, 8, btime_state )
- AM_RANGE(0x0000, 0xffff) AM_WRITE_LEGACY(mmonkey_w) /* override the following entries to */
+ AM_RANGE(0x0000, 0xffff) AM_WRITE(mmonkey_w) /* override the following entries to */
/* support ROM decryption */
AM_RANGE(0x0000, 0x3bff) AM_RAM AM_BASE(m_rambase)
AM_RANGE(0x3c00, 0x3fff) AM_RAM_WRITE_LEGACY(lnc_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size)
@@ -459,7 +452,7 @@ static ADDRESS_MAP_START( mmonkey_map, AS_PROGRAM, 8, btime_state )
AM_RANGE(0x8003, 0x8003) AM_WRITEONLY AM_BASE(m_lnc_charbank)
AM_RANGE(0x9000, 0x9000) AM_READ_PORT("P1") AM_WRITENOP /* IRQ ack??? */
AM_RANGE(0x9001, 0x9001) AM_READ_PORT("P2")
- AM_RANGE(0x9002, 0x9002) AM_READ_PORT("SYSTEM") AM_WRITE_LEGACY(audio_command_w)
+ AM_RANGE(0x9002, 0x9002) AM_READ_PORT("SYSTEM") AM_WRITE(audio_command_w)
AM_RANGE(0xb000, 0xbfff) AM_READWRITE_LEGACY(mmonkey_protection_r, mmonkey_protection_w)
AM_RANGE(0xc000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -468,7 +461,7 @@ static ADDRESS_MAP_START( bnj_map, AS_PROGRAM, 8, btime_state )
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(m_rambase)
AM_RANGE(0x1000, 0x1000) AM_READ_PORT("DSW1")
AM_RANGE(0x1001, 0x1001) AM_READ_PORT("DSW2") AM_WRITE_LEGACY(bnj_video_control_w)
- AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P1") AM_WRITE_LEGACY(audio_command_w)
+ AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P1") AM_WRITE(audio_command_w)
AM_RANGE(0x1003, 0x1003) AM_READ_PORT("P2")
AM_RANGE(0x1004, 0x1004) AM_READ_PORT("SYSTEM")
AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE_SIZE(m_videoram, m_videoram_size)
@@ -483,7 +476,7 @@ static ADDRESS_MAP_START( bnj_map, AS_PROGRAM, 8, btime_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( disco_map, AS_PROGRAM, 8, btime_state )
- AM_RANGE(0x0000, 0xffff) AM_WRITE_LEGACY(disco_w) /* override the following entries to */
+ AM_RANGE(0x0000, 0xffff) AM_WRITE(disco_w) /* override the following entries to */
/* support ROM decryption */
AM_RANGE(0x0000, 0x04ff) AM_RAM AM_BASE(m_rambase)
AM_RANGE(0x2000, 0x7fff) AM_RAM_WRITE_LEGACY(deco_charram_w) AM_BASE(m_deco_charram)
@@ -494,7 +487,7 @@ static ADDRESS_MAP_START( disco_map, AS_PROGRAM, 8, btime_state )
AM_RANGE(0x9200, 0x9200) AM_READ_PORT("P1")
AM_RANGE(0x9400, 0x9400) AM_READ_PORT("P2")
AM_RANGE(0x9800, 0x9800) AM_READ_PORT("DSW1")
- AM_RANGE(0x9a00, 0x9a00) AM_READ_PORT("DSW2") AM_WRITE_LEGACY(audio_command_w)
+ AM_RANGE(0x9a00, 0x9a00) AM_READ_PORT("DSW2") AM_WRITE(audio_command_w)
AM_RANGE(0x9c00, 0x9c00) AM_READ_PORT("VBLANK") AM_WRITE_LEGACY(disco_video_control_w)
AM_RANGE(0xa000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -507,8 +500,8 @@ static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, btime_state )
AM_RANGE(0x4000, 0x5fff) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
AM_RANGE(0x6000, 0x7fff) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
AM_RANGE(0x8000, 0x9fff) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
- AM_RANGE(0xa000, 0xbfff) AM_READ_LEGACY(audio_command_r)
- AM_RANGE(0xc000, 0xdfff) AM_WRITE_LEGACY(audio_nmi_enable_w)
+ AM_RANGE(0xa000, 0xbfff) AM_READ(audio_command_r)
+ AM_RANGE(0xc000, 0xdfff) AM_WRITE(audio_nmi_enable_w)
AM_RANGE(0xe000, 0xefff) AM_MIRROR(0x1000) AM_ROM
ADDRESS_MAP_END
@@ -546,23 +539,21 @@ static INPUT_CHANGED( coin_inserted_nmi_lo )
}
-static WRITE8_HANDLER( audio_command_w )
+WRITE8_MEMBER(btime_state::audio_command_w)
{
- btime_state *state = space->machine().driver_data<btime_state>();
soundlatch_w(space, offset, data);
- device_set_input_line(state->m_audiocpu, 0, ASSERT_LINE);
+ device_set_input_line(m_audiocpu, 0, ASSERT_LINE);
}
-static READ8_HANDLER( audio_command_r )
+READ8_MEMBER(btime_state::audio_command_r)
{
- btime_state *state = space->machine().driver_data<btime_state>();
- device_set_input_line(state->m_audiocpu, 0, CLEAR_LINE);
+ device_set_input_line(m_audiocpu, 0, CLEAR_LINE);
return soundlatch_r(space, offset);
}
-static READ8_HANDLER( zoar_dsw1_read )
+READ8_MEMBER(btime_state::zoar_dsw1_read)
{
- return (!space->machine().primary_screen->vblank() << 7) | (input_port_read(space->machine(), "DSW1") & 0x7f);
+ return (!machine().primary_screen->vblank() << 7) | (input_port_read(machine(), "DSW1") & 0x7f);
}
static INPUT_PORTS_START( btime )
@@ -2085,9 +2076,9 @@ static void decrypt_C10707_cpu(running_machine &machine, const char *cputag)
decrypted = decrypt;
}
-static READ8_HANDLER( wtennis_reset_hack_r )
+READ8_MEMBER(btime_state::wtennis_reset_hack_r)
{
- UINT8 *RAM = space->machine().region("maincpu")->base();
+ UINT8 *RAM = machine().region("maincpu")->base();
/* Otherwise the game goes into test mode and there is no way out that I
can see. I'm not sure how it can work, it probably somehow has to do
@@ -2192,7 +2183,7 @@ static DRIVER_INIT( wtennis )
btime_state *state = machine.driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc15f, 0xc15f, FUNC(wtennis_reset_hack_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc15f, 0xc15f, read8_delegate(FUNC(btime_state::wtennis_reset_hack_r),state));
machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0200, 0x0fff, "bank10");
memory_set_bankptr(machine, "bank10", machine.region("audiocpu")->base() + 0xe200);
diff --git a/src/mame/drivers/buggychl.c b/src/mame/drivers/buggychl.c
index e18a012e6ca..259f78252d4 100644
--- a/src/mame/drivers/buggychl.c
+++ b/src/mame/drivers/buggychl.c
@@ -86,9 +86,9 @@ Dip locations and factory settings verified from dip listing
#include "buggychl.lh"
-static WRITE8_HANDLER( bankswitch_w )
+WRITE8_MEMBER(buggychl_state::bankswitch_w)
{
- memory_set_bank(space->machine(), "bank1", data & 0x07); // shall we check if data&7 < # banks?
+ memory_set_bank(machine(), "bank1", data & 0x07); // shall we check if data&7 < # banks?
}
static TIMER_CALLBACK( nmi_callback )
@@ -101,32 +101,30 @@ static TIMER_CALLBACK( nmi_callback )
state->m_pending_nmi = 1;
}
-static WRITE8_HANDLER( sound_command_w )
+WRITE8_MEMBER(buggychl_state::sound_command_w)
{
soundlatch_w(space, 0, data);
- space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
+ machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
-static WRITE8_HANDLER( nmi_disable_w )
+WRITE8_MEMBER(buggychl_state::nmi_disable_w)
{
- buggychl_state *state = space->machine().driver_data<buggychl_state>();
- state->m_sound_nmi_enable = 0;
+ m_sound_nmi_enable = 0;
}
-static WRITE8_HANDLER( nmi_enable_w )
+WRITE8_MEMBER(buggychl_state::nmi_enable_w)
{
- buggychl_state *state = space->machine().driver_data<buggychl_state>();
- state->m_sound_nmi_enable = 1;
- if (state->m_pending_nmi)
+ m_sound_nmi_enable = 1;
+ if (m_pending_nmi)
{
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
- state->m_pending_nmi = 0;
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ m_pending_nmi = 0;
}
}
-static WRITE8_HANDLER( sound_enable_w )
+WRITE8_MEMBER(buggychl_state::sound_enable_w)
{
- space->machine().sound().system_enable(data & 1);
+ machine().sound().system_enable(data & 1);
}
@@ -140,7 +138,7 @@ static ADDRESS_MAP_START( buggychl_map, AS_PROGRAM, 8, buggychl_state )
AM_RANGE(0xa000, 0xbfff) AM_ROMBANK("bank1") AM_WRITE_LEGACY(buggychl_chargen_w) AM_BASE(m_charram)
AM_RANGE(0xc800, 0xcfff) AM_RAM AM_BASE_SIZE(m_videoram, m_videoram_size)
AM_RANGE(0xd100, 0xd100) AM_WRITE_LEGACY(buggychl_ctrl_w)
- AM_RANGE(0xd200, 0xd200) AM_WRITE_LEGACY(bankswitch_w)
+ AM_RANGE(0xd200, 0xd200) AM_WRITE(bankswitch_w)
AM_RANGE(0xd300, 0xd300) AM_WRITE_LEGACY(watchdog_reset_w)
AM_RANGE(0xd303, 0xd303) AM_WRITE_LEGACY(buggychl_sprite_lookup_bank_w)
AM_RANGE(0xd400, 0xd400) AM_DEVREADWRITE_LEGACY("bmcu", buggychl_mcu_r, buggychl_mcu_w)
@@ -154,7 +152,7 @@ static ADDRESS_MAP_START( buggychl_map, AS_PROGRAM, 8, buggychl_state )
AM_RANGE(0xd609, 0xd609) AM_READ_PORT("IN1") /* coin + accelerator */
// AM_RANGE(0xd60a, 0xd60a) // other inputs, not used?
// AM_RANGE(0xd60b, 0xd60b) // other inputs, not used?
- AM_RANGE(0xd610, 0xd610) AM_WRITE_LEGACY(sound_command_w)
+ AM_RANGE(0xd610, 0xd610) AM_WRITE(sound_command_w)
AM_RANGE(0xd618, 0xd618) AM_WRITENOP /* accelerator clear */
AM_RANGE(0xd700, 0xd7ff) AM_WRITE_LEGACY(paletteram_xxxxRRRRGGGGBBBB_be_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0xd840, 0xd85f) AM_WRITEONLY AM_BASE(m_scrollv)
@@ -173,9 +171,9 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, buggychl_state )
AM_RANGE(0x4830, 0x4830) AM_RAM /* TRBL/BASS for the 7630 on the MSM5232 output */
AM_RANGE(0x5000, 0x5000) AM_READ_LEGACY(soundlatch_r)
// AM_RANGE(0x5001, 0x5001) AM_READNOP /* is command pending? */
- AM_RANGE(0x5001, 0x5001) AM_WRITE_LEGACY(nmi_enable_w)
- AM_RANGE(0x5002, 0x5002) AM_WRITE_LEGACY(nmi_disable_w)
- AM_RANGE(0x5003, 0x5003) AM_WRITE_LEGACY(sound_enable_w)
+ AM_RANGE(0x5001, 0x5001) AM_WRITE(nmi_enable_w)
+ AM_RANGE(0x5002, 0x5002) AM_WRITE(nmi_disable_w)
+ AM_RANGE(0x5003, 0x5003) AM_WRITE(sound_enable_w)
AM_RANGE(0xe000, 0xefff) AM_ROM /* space for diagnostics ROM */
ADDRESS_MAP_END
diff --git a/src/mame/drivers/bwing.c b/src/mame/drivers/bwing.c
index 25d4f4c6f91..202f954776a 100644
--- a/src/mame/drivers/bwing.c
+++ b/src/mame/drivers/bwing.c
@@ -43,62 +43,56 @@ static INTERRUPT_GEN ( bwp3_interrupt )
//****************************************************************************
// Memory and I/O Handlers
-static WRITE8_HANDLER( bwp12_sharedram1_w )
+WRITE8_MEMBER(bwing_state::bwp12_sharedram1_w)
{
- bwing_state *state = space->machine().driver_data<bwing_state>();
- state->m_bwp1_sharedram1[offset] = state->m_bwp2_sharedram1[offset] = data;
+ m_bwp1_sharedram1[offset] = m_bwp2_sharedram1[offset] = data;
}
-static WRITE8_HANDLER( bwp3_u8F_w )
+WRITE8_MEMBER(bwing_state::bwp3_u8F_w)
{
- bwing_state *state = space->machine().driver_data<bwing_state>();
- state->m_bwp3_u8F_d = data; // prepares custom chip for various operations
+ m_bwp3_u8F_d = data; // prepares custom chip for various operations
}
-static WRITE8_HANDLER( bwp3_nmimask_w )
+WRITE8_MEMBER(bwing_state::bwp3_nmimask_w)
{
- bwing_state *state = space->machine().driver_data<bwing_state>();
- state->m_bwp3_nmimask = data & 0x80;
+ m_bwp3_nmimask = data & 0x80;
}
-static WRITE8_HANDLER( bwp3_nmiack_w )
+WRITE8_MEMBER(bwing_state::bwp3_nmiack_w)
{
- bwing_state *state = space->machine().driver_data<bwing_state>();
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
}
-static READ8_HANDLER( bwp1_io_r )
+READ8_MEMBER(bwing_state::bwp1_io_r)
{
- bwing_state *state = space->machine().driver_data<bwing_state>();
- if (offset == 0) return(input_port_read(space->machine(), "DSW0"));
- if (offset == 1) return(input_port_read(space->machine(), "DSW1"));
- if (offset == 2) return(input_port_read(space->machine(), "IN0"));
- if (offset == 3) return(input_port_read(space->machine(), "IN1"));
- if (offset == 4) return(input_port_read(space->machine(), "IN2"));
+ if (offset == 0) return(input_port_read(machine(), "DSW0"));
+ if (offset == 1) return(input_port_read(machine(), "DSW1"));
+ if (offset == 2) return(input_port_read(machine(), "IN0"));
+ if (offset == 3) return(input_port_read(machine(), "IN1"));
+ if (offset == 4) return(input_port_read(machine(), "IN2"));
- return((state->m_bwp123_membase[0])[0x1b00 + offset]);
+ return((m_bwp123_membase[0])[0x1b00 + offset]);
}
-static WRITE8_HANDLER( bwp1_ctrl_w )
+WRITE8_MEMBER(bwing_state::bwp1_ctrl_w)
{
- bwing_state *state = space->machine().driver_data<bwing_state>();
switch (offset)
{
// MSSTB
- case 0: device_set_input_line(state->m_subcpu, M6809_IRQ_LINE, ASSERT_LINE); break;
+ case 0: device_set_input_line(m_subcpu, M6809_IRQ_LINE, ASSERT_LINE); break;
// IRQACK
- case 1: device_set_input_line(state->m_maincpu, M6809_IRQ_LINE, CLEAR_LINE); break;
+ case 1: device_set_input_line(m_maincpu, M6809_IRQ_LINE, CLEAR_LINE); break;
// FIRQACK
- case 2: device_set_input_line(state->m_maincpu, M6809_FIRQ_LINE, CLEAR_LINE); break;
+ case 2: device_set_input_line(m_maincpu, M6809_FIRQ_LINE, CLEAR_LINE); break;
// NMIACK
- case 3: device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, CLEAR_LINE); break;
+ case 3: device_set_input_line(m_maincpu, INPUT_LINE_NMI, CLEAR_LINE); break;
// SWAP(bank-swaps sprite RAM between 1800 & 1900; ignored bc. they're treated as a single chunk.)
case 4: break;
@@ -106,11 +100,11 @@ static WRITE8_HANDLER( bwp1_ctrl_w )
// SNDREQ
case 5:
if (data == 0x80) // protection trick to screw CPU1 & 3
- device_set_input_line(state->m_subcpu, INPUT_LINE_NMI, ASSERT_LINE); // SNMI
+ device_set_input_line(m_subcpu, INPUT_LINE_NMI, ASSERT_LINE); // SNMI
else
{
soundlatch_w(space, 0, data);
- device_set_input_line(state->m_audiocpu, DECO16_IRQ_LINE, HOLD_LINE); // SNDREQ
+ device_set_input_line(m_audiocpu, DECO16_IRQ_LINE, HOLD_LINE); // SNDREQ
}
break;
@@ -122,28 +116,27 @@ static WRITE8_HANDLER( bwp1_ctrl_w )
}
#if BW_DEBUG
- (state->m_bwp123_membase[0])[0x1c00 + offset] = data;
+ (m_bwp123_membase[0])[0x1c00 + offset] = data;
#endif
}
-static WRITE8_HANDLER( bwp2_ctrl_w )
+WRITE8_MEMBER(bwing_state::bwp2_ctrl_w)
{
- bwing_state *state = space->machine().driver_data<bwing_state>();
switch (offset)
{
- case 0: device_set_input_line(state->m_maincpu, M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB
+ case 0: device_set_input_line(m_maincpu, M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB
- case 1: device_set_input_line(state->m_subcpu, M6809_FIRQ_LINE, CLEAR_LINE); break;
+ case 1: device_set_input_line(m_subcpu, M6809_FIRQ_LINE, CLEAR_LINE); break;
- case 2: device_set_input_line(state->m_subcpu, M6809_IRQ_LINE, CLEAR_LINE); break;
+ case 2: device_set_input_line(m_subcpu, M6809_IRQ_LINE, CLEAR_LINE); break;
- case 3: device_set_input_line(state->m_subcpu, INPUT_LINE_NMI, CLEAR_LINE); break;
+ case 3: device_set_input_line(m_subcpu, INPUT_LINE_NMI, CLEAR_LINE); break;
}
#if BW_DEBUG
{
- (state->m_bwp123_membase[1])[0x1800 + offset] = data;
+ (m_bwp123_membase[1])[0x1800 + offset] = data;
}
#endif
}
@@ -153,15 +146,15 @@ static WRITE8_HANDLER( bwp2_ctrl_w )
// Main CPU
static ADDRESS_MAP_START( bwp1_map, AS_PROGRAM, 8, bwing_state )
- AM_RANGE(0x1b00, 0x1b07) AM_READ_LEGACY(bwp1_io_r)
- AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE_LEGACY(bwp12_sharedram1_w) AM_BASE(m_bwp1_sharedram1)
+ AM_RANGE(0x1b00, 0x1b07) AM_READ(bwp1_io_r)
+ AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(bwp12_sharedram1_w) AM_BASE(m_bwp1_sharedram1)
AM_RANGE(0x0800, 0x0fff) AM_RAM
AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE_LEGACY(bwing_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0x1400, 0x17ff) AM_RAM
AM_RANGE(0x1800, 0x19ff) AM_RAM_WRITE_LEGACY(bwing_spriteram_w) AM_BASE(m_spriteram)
AM_RANGE(0x1a00, 0x1aff) AM_RAM_WRITE_LEGACY(bwing_paletteram_w) AM_BASE(m_paletteram)
AM_RANGE(0x1b00, 0x1b07) AM_RAM_WRITE_LEGACY(bwing_scrollreg_w)
- AM_RANGE(0x1c00, 0x1c07) AM_RAM_WRITE_LEGACY(bwp1_ctrl_w)
+ AM_RANGE(0x1c00, 0x1c07) AM_RAM_WRITE(bwp1_ctrl_w)
AM_RANGE(0x2000, 0x3fff) AM_READWRITE_LEGACY(bwing_scrollram_r, bwing_scrollram_w)
AM_RANGE(0x4000, 0xffff) AM_ROM // "B-Wings US" writes to 9631-9632(debug?)
ADDRESS_MAP_END
@@ -169,9 +162,9 @@ ADDRESS_MAP_END
// Sub CPU
static ADDRESS_MAP_START( bwp2_map, AS_PROGRAM, 8, bwing_state )
- AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE_LEGACY(bwp12_sharedram1_w) AM_BASE(m_bwp2_sharedram1)
+ AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(bwp12_sharedram1_w) AM_BASE(m_bwp2_sharedram1)
AM_RANGE(0x0800, 0x0fff) AM_RAM
- AM_RANGE(0x1800, 0x1803) AM_WRITE_LEGACY(bwp2_ctrl_w)
+ AM_RANGE(0x1800, 0x1803) AM_WRITE(bwp2_ctrl_w)
AM_RANGE(0xa000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -180,19 +173,19 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( bwp3_map, AS_PROGRAM, 8, bwing_state )
AM_RANGE(0x0000, 0x01ff) AM_RAM
AM_RANGE(0x0200, 0x0200) AM_DEVWRITE_LEGACY("dac", dac_signed_w)
- AM_RANGE(0x1000, 0x1000) AM_WRITE_LEGACY(bwp3_nmiack_w)
+ AM_RANGE(0x1000, 0x1000) AM_WRITE(bwp3_nmiack_w)
AM_RANGE(0x2000, 0x2000) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
AM_RANGE(0xa000, 0xa000) AM_READ_LEGACY(soundlatch_r)
- AM_RANGE(0xd000, 0xd000) AM_WRITE_LEGACY(bwp3_nmimask_w)
+ AM_RANGE(0xd000, 0xd000) AM_WRITE(bwp3_nmimask_w)
AM_RANGE(0xe000, 0xffff) AM_ROM AM_BASE_SIZE(m_bwp3_rombase, m_bwp3_romsize)
ADDRESS_MAP_END
static ADDRESS_MAP_START( bwp3_io_map, AS_IO, 8, bwing_state )
- AM_RANGE(0x00, 0x00) AM_READ_PORT("VBLANK") AM_WRITE_LEGACY(bwp3_u8F_w)
+ AM_RANGE(0x00, 0x00) AM_READ_PORT("VBLANK") AM_WRITE(bwp3_u8F_w)
ADDRESS_MAP_END
//****************************************************************************
diff --git a/src/mame/drivers/bzone.c b/src/mame/drivers/bzone.c
index 9aabcdae25d..2a1fd0e8906 100644
--- a/src/mame/drivers/bzone.c
+++ b/src/mame/drivers/bzone.c
@@ -262,9 +262,9 @@ static CUSTOM_INPUT( clock_r )
}
-static WRITE8_HANDLER( bzone_coin_counter_w )
+WRITE8_MEMBER(bzone_state::bzone_coin_counter_w)
{
- coin_counter_w(space->machine(), offset,data);
+ coin_counter_w(machine(), offset,data);
}
@@ -302,7 +302,7 @@ static ADDRESS_MAP_START( bzone_map, AS_PROGRAM, 8, bzone_state )
AM_RANGE(0x0800, 0x0800) AM_READ_PORT("IN0")
AM_RANGE(0x0a00, 0x0a00) AM_READ_PORT("DSW0")
AM_RANGE(0x0c00, 0x0c00) AM_READ_PORT("DSW1")
- AM_RANGE(0x1000, 0x1000) AM_WRITE_LEGACY(bzone_coin_counter_w)
+ AM_RANGE(0x1000, 0x1000) AM_WRITE(bzone_coin_counter_w)
AM_RANGE(0x1200, 0x1200) AM_WRITE_LEGACY(avgdvg_go_w)
AM_RANGE(0x1400, 0x1400) AM_WRITE_LEGACY(watchdog_reset_w)
AM_RANGE(0x1600, 0x1600) AM_WRITE_LEGACY(avgdvg_reset_w)
@@ -778,31 +778,30 @@ ROM_END
*
*************************************/
-static READ8_HANDLER( analog_data_r )
+READ8_MEMBER(bzone_state::analog_data_r)
{
- bzone_state *state = space->machine().driver_data<bzone_state>();
- return state->m_analog_data;
+ return m_analog_data;
}
-static WRITE8_HANDLER( analog_select_w )
+WRITE8_MEMBER(bzone_state::analog_select_w)
{
- bzone_state *state = space->machine().driver_data<bzone_state>();
static const char *const analog_port[] = { "AN0", "AN1", "AN2" };
if (offset <= 2)
- state->m_analog_data = input_port_read(space->machine(), analog_port[offset]);
+ m_analog_data = input_port_read(machine(), analog_port[offset]);
}
static DRIVER_INIT( bradley )
{
+ bzone_state *state = machine.driver_data<bzone_state>();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_ram(0x400, 0x7ff);
space->install_read_port(0x1808, 0x1808, "1808");
space->install_read_port(0x1809, 0x1809, "1809");
- space->install_legacy_read_handler(0x180a, 0x180a, FUNC(analog_data_r));
- space->install_legacy_write_handler(0x1848, 0x1850, FUNC(analog_select_w));
+ space->install_read_handler(0x180a, 0x180a, read8_delegate(FUNC(bzone_state::analog_data_r),state));
+ space->install_write_handler(0x1848, 0x1850, write8_delegate(FUNC(bzone_state::analog_select_w),state));
}
diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c
index 92fd5a06ac9..1e609d6a2b6 100644
--- a/src/mame/drivers/cabal.c
+++ b/src/mame/drivers/cabal.c
@@ -61,60 +61,57 @@ static MACHINE_RESET( cabalbl )
/******************************************************************************************/
-static WRITE16_HANDLER( cabalbl_sndcmd_w )
+WRITE16_MEMBER(cabal_state::cabalbl_sndcmd_w)
{
- cabal_state *state = space->machine().driver_data<cabal_state>();
switch (offset)
{
case 0x0:
- state->m_sound_command1 = data;
+ m_sound_command1 = data;
break;
case 0x1: /* ?? */
- state->m_sound_command2 = data & 0xff;
+ m_sound_command2 = data & 0xff;
break;
}
}
-static WRITE16_HANDLER( track_reset_w )
+WRITE16_MEMBER(cabal_state::track_reset_w)
{
- cabal_state *state = space->machine().driver_data<cabal_state>();
int i;
static const char *const track_names[] = { "IN0", "IN1", "IN2", "IN3" };
for (i = 0; i < 4; i++)
- state->m_last[i] = input_port_read(space->machine(), track_names[i]);
+ m_last[i] = input_port_read(machine(), track_names[i]);
}
-static READ16_HANDLER( track_r )
+READ16_MEMBER(cabal_state::track_r)
{
- cabal_state *state = space->machine().driver_data<cabal_state>();
switch (offset)
{
default:
- case 0: return (( input_port_read(space->machine(), "IN0") - state->m_last[0]) & 0x00ff) | (((input_port_read(space->machine(), "IN2") - state->m_last[2]) & 0x00ff) << 8); /* X lo */
- case 1: return (((input_port_read(space->machine(), "IN0") - state->m_last[0]) & 0xff00) >> 8) | (( input_port_read(space->machine(), "IN2") - state->m_last[2]) & 0xff00); /* X hi */
- case 2: return (( input_port_read(space->machine(), "IN1") - state->m_last[1]) & 0x00ff) | (((input_port_read(space->machine(), "IN3") - state->m_last[3]) & 0x00ff) << 8); /* Y lo */
- case 3: return (((input_port_read(space->machine(), "IN1") - state->m_last[1]) & 0xff00) >> 8) | (( input_port_read(space->machine(), "IN3") - state->m_last[3]) & 0xff00); /* Y hi */
+ case 0: return (( input_port_read(machine(), "IN0") - m_last[0]) & 0x00ff) | (((input_port_read(machine(), "IN2") - m_last[2]) & 0x00ff) << 8); /* X lo */
+ case 1: return (((input_port_read(machine(), "IN0") - m_last[0]) & 0xff00) >> 8) | (( input_port_read(machine(), "IN2") - m_last[2]) & 0xff00); /* X hi */
+ case 2: return (( input_port_read(machine(), "IN1") - m_last[1]) & 0x00ff) | (((input_port_read(machine(), "IN3") - m_last[3]) & 0x00ff) << 8); /* Y lo */
+ case 3: return (((input_port_read(machine(), "IN1") - m_last[1]) & 0xff00) >> 8) | (( input_port_read(machine(), "IN3") - m_last[3]) & 0xff00); /* Y hi */
}
}
-static WRITE16_HANDLER( cabal_sound_irq_trigger_word_w )
+WRITE16_MEMBER(cabal_state::cabal_sound_irq_trigger_word_w)
{
- seibu_main_word_w(space,4,data,mem_mask);
+ seibu_main_word_w(&space,4,data,mem_mask);
/* spin for a while to let the Z80 read the command, otherwise coins "stick" */
- device_spin_until_time(&space->device(), attotime::from_usec(50));
+ device_spin_until_time(&space.device(), attotime::from_usec(50));
}
-static WRITE16_HANDLER( cabalbl_sound_irq_trigger_word_w )
+WRITE16_MEMBER(cabal_state::cabalbl_sound_irq_trigger_word_w)
{
- cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
+ cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
}
@@ -128,13 +125,13 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, cabal_state )
AM_RANGE(0x80000, 0x801ff) AM_RAM_WRITE_LEGACY(cabal_background_videoram16_w) AM_BASE(m_videoram)
AM_RANGE(0x80200, 0x803ff) AM_RAM
AM_RANGE(0xa0000, 0xa0001) AM_READ_PORT("DSW")
- AM_RANGE(0xa0008, 0xa000f) AM_READ_LEGACY(track_r)
+ AM_RANGE(0xa0008, 0xa000f) AM_READ(track_r)
AM_RANGE(0xa0010, 0xa0011) AM_READ_PORT("INPUTS")
- AM_RANGE(0xc0000, 0xc0001) AM_WRITE_LEGACY(track_reset_w)
+ AM_RANGE(0xc0000, 0xc0001) AM_WRITE(track_reset_w)
AM_RANGE(0xc0040, 0xc0041) AM_WRITENOP /* ??? */
AM_RANGE(0xc0080, 0xc0081) AM_WRITE_LEGACY(cabal_flipscreen_w)
AM_RANGE(0xe0000, 0xe07ff) AM_RAM_WRITE_LEGACY(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
- AM_RANGE(0xe8008, 0xe8009) AM_WRITE_LEGACY(cabal_sound_irq_trigger_word_w) // fix coin insertion
+ AM_RANGE(0xe8008, 0xe8009) AM_WRITE(cabal_sound_irq_trigger_word_w) // fix coin insertion
AM_RANGE(0xe8000, 0xe800d) AM_READWRITE_LEGACY(seibu_main_word_r, seibu_main_word_w)
ADDRESS_MAP_END
@@ -152,32 +149,30 @@ static ADDRESS_MAP_START( cabalbl_main_map, AS_PROGRAM, 16, cabal_state )
AM_RANGE(0xc0040, 0xc0041) AM_WRITENOP /* ??? */
AM_RANGE(0xc0080, 0xc0081) AM_WRITE_LEGACY(cabal_flipscreen_w)
AM_RANGE(0xe0000, 0xe07ff) AM_RAM_WRITE_LEGACY(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
- AM_RANGE(0xe8000, 0xe8003) AM_WRITE_LEGACY(cabalbl_sndcmd_w)
+ AM_RANGE(0xe8000, 0xe8003) AM_WRITE(cabalbl_sndcmd_w)
AM_RANGE(0xe8004, 0xe8005) AM_READ_LEGACY(soundlatch2_word_r)
- AM_RANGE(0xe8008, 0xe8009) AM_WRITE_LEGACY(cabalbl_sound_irq_trigger_word_w)
+ AM_RANGE(0xe8008, 0xe8009) AM_WRITE(cabalbl_sound_irq_trigger_word_w)
ADDRESS_MAP_END
/*********************************************************************/
-static READ8_HANDLER( cabalbl_snd2_r )
+READ8_MEMBER(cabal_state::cabalbl_snd2_r)
{
- cabal_state *state = space->machine().driver_data<cabal_state>();
- return BITSWAP8(state->m_sound_command2, 7,2,4,5,3,6,1,0);
+ return BITSWAP8(m_sound_command2, 7,2,4,5,3,6,1,0);
}
-static READ8_HANDLER( cabalbl_snd1_r )
+READ8_MEMBER(cabal_state::cabalbl_snd1_r)
{
- cabal_state *state = space->machine().driver_data<cabal_state>();
- return BITSWAP8(state->m_sound_command1, 7,2,4,5,3,6,1,0);
+ return BITSWAP8(m_sound_command1, 7,2,4,5,3,6,1,0);
}
-static WRITE8_HANDLER( cabalbl_coin_w )
+WRITE8_MEMBER(cabal_state::cabalbl_coin_w)
{
- coin_counter_w(space->machine(), 0, data & 1);
- coin_counter_w(space->machine(), 1, data & 2);
+ coin_counter_w(machine(), 0, data & 1);
+ coin_counter_w(machine(), 1, data & 2);
//data & 0x40? video enable?
}
@@ -206,10 +201,10 @@ static ADDRESS_MAP_START( cabalbl_sound_map, AS_PROGRAM, 8, cabal_state )
AM_RANGE(0x2000, 0x2fff) AM_RAM
AM_RANGE(0x4000, 0x4000) AM_WRITE_LEGACY(soundlatch3_w)
AM_RANGE(0x4002, 0x4002) AM_WRITE_LEGACY(soundlatch4_w)
- AM_RANGE(0x4004, 0x4004) AM_WRITE_LEGACY(cabalbl_coin_w)
+ AM_RANGE(0x4004, 0x4004) AM_WRITE(cabalbl_coin_w)
AM_RANGE(0x4006, 0x4006) AM_READ_PORT("COIN")
- AM_RANGE(0x4008, 0x4008) AM_READ_LEGACY(cabalbl_snd2_r)
- AM_RANGE(0x400a, 0x400a) AM_READ_LEGACY(cabalbl_snd1_r)
+ AM_RANGE(0x4008, 0x4008) AM_READ(cabalbl_snd2_r)
+ AM_RANGE(0x400a, 0x400a) AM_READ(cabalbl_snd1_r)
AM_RANGE(0x400c, 0x400c) AM_WRITE_LEGACY(soundlatch2_w)
AM_RANGE(0x400e, 0x400f) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
AM_RANGE(0x6000, 0x6000) AM_WRITENOP /* ??? */
diff --git a/src/mame/drivers/canyon.c b/src/mame/drivers/canyon.c
index a4fdb83b594..a617289d8e9 100644
--- a/src/mame/drivers/canyon.c
+++ b/src/mame/drivers/canyon.c
@@ -63,23 +63,23 @@ static PALETTE_INIT( canyon )
*
*************************************/
-static READ8_HANDLER( canyon_switches_r )
+READ8_MEMBER(canyon_state::canyon_switches_r)
{
UINT8 val = 0;
- if ((input_port_read(space->machine(), "IN2") >> (offset & 7)) & 1)
+ if ((input_port_read(machine(), "IN2") >> (offset & 7)) & 1)
val |= 0x80;
- if ((input_port_read(space->machine(), "IN1") >> (offset & 3)) & 1)
+ if ((input_port_read(machine(), "IN1") >> (offset & 3)) & 1)
val |= 0x01;
return val;
}
-static READ8_HANDLER( canyon_options_r )
+READ8_MEMBER(canyon_state::canyon_options_r)
{
- return (input_port_read(space->machine(), "DSW") >> (2 * (~offset & 3))) & 3;
+ return (input_port_read(machine(), "DSW") >> (2 * (~offset & 3))) & 3;
}
@@ -91,9 +91,9 @@ static READ8_HANDLER( canyon_options_r )
*
*************************************/
-static WRITE8_HANDLER( canyon_led_w )
+WRITE8_MEMBER(canyon_state::canyon_led_w)
{
- set_led_status(space->machine(), offset & 0x01, offset & 0x02);
+ set_led_status(machine(), offset & 0x01, offset & 0x02);
}
@@ -112,11 +112,11 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, canyon_state )
AM_RANGE(0x0500, 0x0500) AM_DEVWRITE_LEGACY("discrete", canyon_explode_w)
AM_RANGE(0x0501, 0x0501) AM_WRITE_LEGACY(watchdog_reset_w) /* watchdog, disabled in service mode */
AM_RANGE(0x0600, 0x0603) AM_DEVWRITE_LEGACY("discrete", canyon_whistle_w)
- AM_RANGE(0x0680, 0x0683) AM_WRITE_LEGACY(canyon_led_w)
+ AM_RANGE(0x0680, 0x0683) AM_WRITE(canyon_led_w)
AM_RANGE(0x0700, 0x0703) AM_DEVWRITE_LEGACY("discrete", canyon_attract_w)
AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE_LEGACY(canyon_videoram_w) AM_BASE(m_videoram)
- AM_RANGE(0x1000, 0x17ff) AM_READ_LEGACY(canyon_switches_r) AM_WRITENOP /* sloppy code writes here */
- AM_RANGE(0x1800, 0x1fff) AM_READ_LEGACY(canyon_options_r)
+ AM_RANGE(0x1000, 0x17ff) AM_READ(canyon_switches_r) AM_WRITENOP /* sloppy code writes here */
+ AM_RANGE(0x1800, 0x1fff) AM_READ(canyon_options_r)
AM_RANGE(0x2000, 0x3fff) AM_ROM
ADDRESS_MAP_END
diff --git a/src/mame/drivers/capbowl.c b/src/mame/drivers/capbowl.c
index 2c2f4dbcbed..21be9bddd85 100644
--- a/src/mame/drivers/capbowl.c
+++ b/src/mame/drivers/capbowl.c
@@ -136,10 +136,10 @@ static TIMER_CALLBACK( capbowl_update )
*
*************************************/
-static WRITE8_HANDLER( capbowl_rom_select_w )
+WRITE8_MEMBER(capbowl_state::capbowl_rom_select_w)
{
// 2009-11 FP: shall we add a check to be sure that bank < 6?
- memory_set_bank(space->machine(), "bank1", ((data & 0x0c) >> 1) + (data & 0x01));
+ memory_set_bank(machine(), "bank1", ((data & 0x0c) >> 1) + (data & 0x01));
}
@@ -150,27 +150,24 @@ static WRITE8_HANDLER( capbowl_rom_select_w )
*
*************************************/
-static READ8_HANDLER( track_0_r )
+READ8_MEMBER(capbowl_state::track_0_r)
{
- capbowl_state *state = space->machine().driver_data<capbowl_state>();
- return (input_port_read(space->machine(), "IN0") & 0xf0) | ((input_port_read(space->machine(), "TRACKY") - state->m_last_trackball_val[0]) & 0x0f);
+ return (input_port_read(machine(), "IN0") & 0xf0) | ((input_port_read(machine(), "TRACKY") - m_last_trackball_val[0]) & 0x0f);
}
-static READ8_HANDLER( track_1_r )
+READ8_MEMBER(capbowl_state::track_1_r)
{
- capbowl_state *state = space->machine().driver_data<capbowl_state>();
- return (input_port_read(space->machine(), "IN1") & 0xf0) | ((input_port_read(space->machine(), "TRACKX") - state->m_last_trackball_val[1]) & 0x0f);
+ return (input_port_read(machine(), "IN1") & 0xf0) | ((input_port_read(machine(), "TRACKX") - m_last_trackball_val[1]) & 0x0f);
}
-static WRITE8_HANDLER( track_reset_w )
+WRITE8_MEMBER(capbowl_state::track_reset_w)
{
- capbowl_state *state = space->machine().driver_data<capbowl_state>();
/* reset the trackball counters */
- state->m_last_trackball_val[0] = input_port_read(space->machine(), "TRACKY");
- state->m_last_trackball_val[1] = input_port_read(space->machine(), "TRACKX");
+ m_last_trackball_val[0] = input_port_read(machine(), "TRACKY");
+ m_last_trackball_val[1] = input_port_read(machine(), "TRACKX");
watchdog_reset_w(space, offset, data);
}
@@ -183,10 +180,9 @@ static WRITE8_HANDLER( track_reset_w )
*
*************************************/
-static WRITE8_HANDLER( capbowl_sndcmd_w )
+WRITE8_MEMBER(capbowl_state::capbowl_sndcmd_w)
{
- capbowl_state *state = space->machine().driver_data<capbowl_state>();
- device_set_input_line(state->m_audiocpu, M6809_IRQ_LINE, HOLD_LINE);
+ device_set_input_line(m_audiocpu, M6809_IRQ_LINE, HOLD_LINE);
soundlatch_w(space, offset, data);
}
@@ -232,13 +228,13 @@ void capbowl_state::init_nvram(nvram_device &nvram, void *base, size_t size)
static ADDRESS_MAP_START( capbowl_map, AS_PROGRAM, 8, capbowl_state )
AM_RANGE(0x0000, 0x3fff) AM_ROMBANK("bank1")
AM_RANGE(0x4000, 0x4000) AM_WRITEONLY AM_BASE(m_rowaddress)
- AM_RANGE(0x4800, 0x4800) AM_WRITE_LEGACY(capbowl_rom_select_w)
+ AM_RANGE(0x4800, 0x4800) AM_WRITE(capbowl_rom_select_w)
AM_RANGE(0x5000, 0x57ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x5800, 0x5fff) AM_READWRITE_LEGACY(capbowl_tms34061_r, capbowl_tms34061_w)
- AM_RANGE(0x6000, 0x6000) AM_WRITE_LEGACY(capbowl_sndcmd_w)
- AM_RANGE(0x6800, 0x6800) AM_WRITE_LEGACY(track_reset_w) /* + watchdog */
- AM_RANGE(0x7000, 0x7000) AM_READ_LEGACY(track_0_r) /* + other inputs */
- AM_RANGE(0x7800, 0x7800) AM_READ_LEGACY(track_1_r) /* + other inputs */
+ AM_RANGE(0x6000, 0x6000) AM_WRITE(capbowl_sndcmd_w)
+ AM_RANGE(0x6800, 0x6800) AM_WRITE(track_reset_w) /* + watchdog */
+ AM_RANGE(0x7000, 0x7000) AM_READ(track_0_r) /* + other inputs */
+ AM_RANGE(0x7800, 0x7800) AM_READ(track_1_r) /* + other inputs */
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -248,10 +244,10 @@ static ADDRESS_MAP_START( bowlrama_map, AS_PROGRAM, 8, capbowl_state )
AM_RANGE(0x4000, 0x4000) AM_WRITEONLY AM_BASE(m_rowaddress)
AM_RANGE(0x5000, 0x57ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x5800, 0x5fff) AM_READWRITE_LEGACY(capbowl_tms34061_r, capbowl_tms34061_w)
- AM_RANGE(0x6000, 0x6000) AM_WRITE_LEGACY(capbowl_sndcmd_w)
- AM_RANGE(0x6800, 0x6800) AM_WRITE_LEGACY(track_reset_w) /* + watchdog */
- AM_RANGE(0x7000, 0x7000) AM_READ_LEGACY(track_0_r) /* + other inputs */
- AM_RANGE(0x7800, 0x7800) AM_READ_LEGACY(track_1_r) /* + other inputs */
+ AM_RANGE(0x6000, 0x6000) AM_WRITE(capbowl_sndcmd_w)
+ AM_RANGE(0x6800, 0x6800) AM_WRITE(track_reset_w) /* + watchdog */
+ AM_RANGE(0x7000, 0x7000) AM_READ(track_0_r) /* + other inputs */
+ AM_RANGE(0x7800, 0x7800) AM_READ(track_1_r) /* + other inputs */
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
diff --git a/src/mame/drivers/carjmbre.c b/src/mame/drivers/carjmbre.c
index e41475a147f..15bffba11bf 100644
--- a/src/mame/drivers/carjmbre.c
+++ b/src/mame/drivers/carjmbre.c
@@ -50,11 +50,10 @@ Notes:
*
*************************************/
-static WRITE8_HANDLER( nmi_mask_w )
+WRITE8_MEMBER(carjmbre_state::nmi_mask_w)
{
- carjmbre_state *state = space->machine().driver_data<carjmbre_state>();
- state->m_nmi_mask = data & 1;
+ m_nmi_mask = data & 1;
}
@@ -62,7 +61,7 @@ static ADDRESS_MAP_START( carjmbre_map, AS_PROGRAM, 8, carjmbre_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
// AM_RANGE(0x8800, 0x8800) AM_READNOP // watchdog?
- AM_RANGE(0x8803, 0x8803) AM_WRITE_LEGACY(nmi_mask_w)
+ AM_RANGE(0x8803, 0x8803) AM_WRITE(nmi_mask_w)
AM_RANGE(0x8805, 0x8805) AM_WRITE_LEGACY(carjmbre_bgcolor_w) // guessed
AM_RANGE(0x8806, 0x8806) AM_WRITE_LEGACY(carjmbre_8806_w) // video related?
AM_RANGE(0x8807, 0x8807) AM_WRITE_LEGACY(carjmbre_flipscreen_w)
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index 495d7c9442d..385f11b7eaf 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -166,22 +166,21 @@ static void sound_irq_gen( device_t *device, int state )
/* Reads the cause of the interrupt and clears the state */
-static READ16_HANDLER( cave_irq_cause_r )
+READ16_MEMBER(cave_state::cave_irq_cause_r)
{
- cave_state *state = space->machine().driver_data<cave_state>();
int result = 0x0003;
- if (state->m_vblank_irq)
+ if (m_vblank_irq)
result ^= 0x01;
- if (state->m_unknown_irq)
+ if (m_unknown_irq)
result ^= 0x02;
if (offset == 4/2)
- state->m_vblank_irq = 0;
+ m_vblank_irq = 0;
if (offset == 6/2)
- state->m_unknown_irq = 0;
+ m_unknown_irq = 0;
- update_irq_state(space->machine());
+ update_irq_state(machine());
/*
sailormn and agallet wait for bit 2 of $b80001 to go 1 -> 0.
@@ -191,7 +190,7 @@ static READ16_HANDLER( cave_irq_cause_r )
if (offset == 0)
{
result &= ~4;
- result |= (state->m_agallet_vblank_irq ? 0 : 4);
+ result |= (m_agallet_vblank_irq ? 0 : 4);
}
return result;
@@ -209,82 +208,75 @@ static READ16_HANDLER( cave_irq_cause_r )
/* We need a FIFO buffer for sailormn, where the inter-CPUs
communication is *really* tight */
-static READ8_HANDLER( soundflags_r )
+READ8_MEMBER(cave_state::soundflags_r)
{
// bit 2 is low: can read command (lo)
// bit 3 is low: can read command (hi)
-// cave_state *state = space->machine().driver_data<cave_state>();
-// return (state->m_sound_flag1 ? 0 : 4) |
-// (state->m_sound_flag2 ? 0 : 8) ;
+// return (m_sound_flag1 ? 0 : 4) |
+// (m_sound_flag2 ? 0 : 8) ;
return 0;
}
-static READ16_HANDLER( soundflags_ack_r )
+READ16_MEMBER(cave_state::soundflags_ack_r)
{
// bit 0 is low: can write command
// bit 1 is low: can read answer
- cave_state *state = space->machine().driver_data<cave_state>();
-// return ((state->m_sound_flag1 | state->m_sound_flag2) ? 1 : 0) |
-// ((state->m_soundbuf_len > 0) ? 0 : 2) ;
+// return ((m_sound_flag1 | m_sound_flag2) ? 1 : 0) |
+// ((m_soundbuf_len > 0) ? 0 : 2) ;
- return ((state->m_soundbuf_len > 0) ? 0 : 2) ;
+ return ((m_soundbuf_len > 0) ? 0 : 2) ;
}
/* Main CPU: write a 16 bit sound latch and generate a NMI on the sound CPU */
-static WRITE16_HANDLER( sound_cmd_w )
+WRITE16_MEMBER(cave_state::sound_cmd_w)
{
- cave_state *state = space->machine().driver_data<cave_state>();
-// state->m_sound_flag1 = 1;
-// state->m_sound_flag2 = 1;
+// m_sound_flag1 = 1;
+// m_sound_flag2 = 1;
soundlatch_word_w(space, offset, data, mem_mask);
- device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
- device_spin_until_time(&space->device(), attotime::from_usec(50)); // Allow the other cpu to reply
+ device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
+ device_spin_until_time(&space.device(), attotime::from_usec(50)); // Allow the other cpu to reply
}
/* Sound CPU: read the low 8 bits of the 16 bit sound latch */
-static READ8_HANDLER( soundlatch_lo_r )
+READ8_MEMBER(cave_state::soundlatch_lo_r)
{
-// cave_state *state = space->machine().driver_data<cave_state>();
-// state->m_sound_flag1 = 0;
+// m_sound_flag1 = 0;
return soundlatch_word_r(space, offset, 0x00ff) & 0xff;
}
/* Sound CPU: read the high 8 bits of the 16 bit sound latch */
-static READ8_HANDLER( soundlatch_hi_r )
+READ8_MEMBER(cave_state::soundlatch_hi_r)
{
-// cave_state *state = space->machine().driver_data<cave_state>();
-// state->m_sound_flag2 = 0;
+// m_sound_flag2 = 0;
return soundlatch_word_r(space, offset, 0xff00) >> 8;
}
/* Main CPU: read the latch written by the sound CPU (acknowledge) */
-static READ16_HANDLER( soundlatch_ack_r )
+READ16_MEMBER(cave_state::soundlatch_ack_r)
{
- cave_state *state = space->machine().driver_data<cave_state>();
- if (state->m_soundbuf_len > 0)
+ if (m_soundbuf_len > 0)
{
- UINT8 data = state->m_soundbuf_data[0];
- memmove(state->m_soundbuf_data, state->m_soundbuf_data + 1, (32 - 1) * sizeof(state->m_soundbuf_data[0]));
- state->m_soundbuf_len--;
+ UINT8 data = m_soundbuf_data[0];
+ memmove(m_soundbuf_data, m_soundbuf_data + 1, (32 - 1) * sizeof(m_soundbuf_data[0]));
+ m_soundbuf_len--;
return data;
}
else
{
- logerror("CPU #1 - PC %04X: Sound Buffer 2 Underflow Error\n", cpu_get_pc(&space->device()));
+ logerror("CPU #1 - PC %04X: Sound Buffer 2 Underflow Error\n", cpu_get_pc(&space.device()));
return 0xff;
}
}
/* Sound CPU: write latch for the main CPU (acknowledge) */
-static WRITE8_HANDLER( soundlatch_ack_w )
+WRITE8_MEMBER(cave_state::soundlatch_ack_w)
{
- cave_state *state = space->machine().driver_data<cave_state>();
- state->m_soundbuf_data[state->m_soundbuf_len] = data;
- if (state->m_soundbuf_len < 32)
- state->m_soundbuf_len++;
+ m_soundbuf_data[m_soundbuf_len] = data;
+ if (m_soundbuf_len < 32)
+ m_soundbuf_len++;
else
- logerror("CPU #1 - PC %04X: Sound Buffer 2 Overflow Error\n", cpu_get_pc(&space->device()));
+ logerror("CPU #1 - PC %04X: Sound Buffer 2 Overflow Error\n", cpu_get_pc(&space.device()));
}
@@ -368,12 +360,12 @@ static WRITE16_DEVICE_HANDLER( cave_eeprom_lsb_w )
}
/* - No eeprom or lockouts */
-static WRITE16_HANDLER( gaia_coin_lsb_w )
+WRITE16_MEMBER(cave_state::gaia_coin_lsb_w)
{
if (ACCESSING_BITS_0_7) // odd address
{
- coin_counter_w(space->machine(), 1, data & 0x0002);
- coin_counter_w(space->machine(), 0, data & 0x0001);
+ coin_counter_w(machine(), 1, data & 0x0002);
+ coin_counter_w(machine(), 0, data & 0x0001);
}
}
@@ -447,7 +439,7 @@ static ADDRESS_MAP_START( dfeveron_map, AS_PROGRAM, 16, cave_state )
/**/AM_RANGE(0x708000, 0x708fff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette
/**/AM_RANGE(0x710000, 0x710bff) AM_READONLY // ?
AM_RANGE(0x710c00, 0x710fff) AM_RAM // ?
- AM_RANGE(0x800000, 0x800007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0x800000, 0x800007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0x800000, 0x80007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
/**/AM_RANGE(0x900000, 0x900005) AM_RAM AM_BASE(m_vctrl[0]) // Layer 0 Control
/**/AM_RANGE(0xa00000, 0xa00005) AM_RAM AM_BASE(m_vctrl[1]) // Layer 1 Control
@@ -470,7 +462,7 @@ static ADDRESS_MAP_START( ddonpach_map, AS_PROGRAM, 16, cave_state )
/**/AM_RANGE(0x500000, 0x507fff) AM_RAM_WRITE_LEGACY(cave_vram_0_w) AM_BASE(m_vram[0]) // Layer 0
/**/AM_RANGE(0x600000, 0x607fff) AM_RAM_WRITE_LEGACY(cave_vram_1_w) AM_BASE(m_vram[1]) // Layer 1
/**/AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE_LEGACY(cave_vram_2_8x8_w) AM_BASE(m_vram[2]) // Layer 2
- AM_RANGE(0x800000, 0x800007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0x800000, 0x800007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0x800000, 0x80007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
/**/AM_RANGE(0x900000, 0x900005) AM_RAM AM_BASE(m_vctrl[0]) // Layer 0 Control
/**/AM_RANGE(0xa00000, 0xa00005) AM_RAM AM_BASE(m_vctrl[1]) // Layer 1 Control
@@ -486,7 +478,7 @@ ADDRESS_MAP_END
Donpachi
***************************************************************************/
-static READ16_HANDLER( donpachi_videoregs_r )
+READ16_MEMBER(cave_state::donpachi_videoregs_r)
{
switch (offset)
{
@@ -523,7 +515,7 @@ static ADDRESS_MAP_START( donpachi_map, AS_PROGRAM, 16, cave_state )
/**/AM_RANGE(0x600000, 0x600005) AM_RAM AM_BASE(m_vctrl[1]) // Layer 1 Control
/**/AM_RANGE(0x700000, 0x700005) AM_RAM AM_BASE(m_vctrl[0]) // Layer 0 Control
/**/AM_RANGE(0x800000, 0x800005) AM_RAM AM_BASE(m_vctrl[2]) // Layer 2 Control
- AM_RANGE(0x900000, 0x90007f) AM_RAM_READ_LEGACY(donpachi_videoregs_r) AM_BASE(m_videoregs) // Video Regs
+ AM_RANGE(0x900000, 0x90007f) AM_RAM_READ(donpachi_videoregs_r) AM_BASE(m_videoregs) // Video Regs
/**/AM_RANGE(0xa08000, 0xa08fff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette
AM_RANGE(0xb00000, 0xb00003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) // M6295
AM_RANGE(0xb00010, 0xb00013) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff) //
@@ -547,7 +539,7 @@ static ADDRESS_MAP_START( esprade_map, AS_PROGRAM, 16, cave_state )
/**/AM_RANGE(0x500000, 0x507fff) AM_RAM_WRITE_LEGACY(cave_vram_0_w) AM_BASE(m_vram[0]) // Layer 0
/**/AM_RANGE(0x600000, 0x607fff) AM_RAM_WRITE_LEGACY(cave_vram_1_w) AM_BASE(m_vram[1]) // Layer 1
/**/AM_RANGE(0x700000, 0x707fff) AM_RAM_WRITE_LEGACY(cave_vram_2_w) AM_BASE(m_vram[2]) // Layer 2
- AM_RANGE(0x800000, 0x800007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0x800000, 0x800007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0x800000, 0x80007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
/**/AM_RANGE(0x900000, 0x900005) AM_RAM AM_BASE(m_vctrl[0]) // Layer 0 Control
/**/AM_RANGE(0xa00000, 0xa00005) AM_RAM AM_BASE(m_vctrl[1]) // Layer 1 Control
@@ -575,14 +567,14 @@ static ADDRESS_MAP_START( gaia_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x608000, 0x60ffff) AM_RAM // More Layer 1, Tested but not used?
AM_RANGE(0x700000, 0x707fff) AM_RAM_WRITE_LEGACY(cave_vram_2_w) AM_BASE(m_vram[2]) // Layer 2
AM_RANGE(0x708000, 0x70ffff) AM_RAM // More Layer 2, Tested but not used?
- AM_RANGE(0x800000, 0x800007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0x800000, 0x800007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0x800000, 0x80007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
/**/AM_RANGE(0x900000, 0x900005) AM_RAM AM_BASE(m_vctrl[0]) // Layer 0 Control
/**/AM_RANGE(0xa00000, 0xa00005) AM_RAM AM_BASE(m_vctrl[1]) // Layer 1 Control
/**/AM_RANGE(0xb00000, 0xb00005) AM_RAM AM_BASE(m_vctrl[2]) // Layer 2 Control
AM_RANGE(0xc00000, 0xc0ffff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette
AM_RANGE(0xd00010, 0xd00011) AM_READ_PORT("IN0") // Inputs
- AM_RANGE(0xd00010, 0xd00011) AM_WRITE_LEGACY(gaia_coin_lsb_w) // Coin counter only
+ AM_RANGE(0xd00010, 0xd00011) AM_WRITE(gaia_coin_lsb_w) // Coin counter only
AM_RANGE(0xd00012, 0xd00013) AM_READ_PORT("IN1") // Inputs
AM_RANGE(0xd00014, 0xd00015) AM_READ_PORT("DSW") // Dips
AM_RANGE(0xd00014, 0xd00015) AM_WRITE_LEGACY(watchdog_reset16_w) // Watchdog?
@@ -596,7 +588,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( guwange_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM
AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM
- AM_RANGE(0x300000, 0x300007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0x300000, 0x300007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0x300000, 0x30007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
/**/AM_RANGE(0x400000, 0x407fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites
/**/AM_RANGE(0x408000, 0x40ffff) AM_RAM AM_BASE(m_spriteram_2) // Sprites?
@@ -627,9 +619,9 @@ static ADDRESS_MAP_START( hotdogst_map, AS_PROGRAM, 16, cave_state )
/**/AM_RANGE(0x880000, 0x887fff) AM_RAM_WRITE_LEGACY(cave_vram_0_w) AM_BASE(m_vram[0]) // Layer 0
/**/AM_RANGE(0x900000, 0x907fff) AM_RAM_WRITE_LEGACY(cave_vram_1_w) AM_BASE(m_vram[1]) // Layer 1
/**/AM_RANGE(0x980000, 0x987fff) AM_RAM_WRITE_LEGACY(cave_vram_2_w) AM_BASE(m_vram[2]) // Layer 2
- AM_RANGE(0xa80000, 0xa80007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
-// AM_RANGE(0xa8006e, 0xa8006f) AM_READ_LEGACY(soundlatch_ack_r) // From Sound CPU
- AM_RANGE(0xa8006e, 0xa8006f) AM_WRITE_LEGACY(sound_cmd_w) // To Sound CPU
+ AM_RANGE(0xa80000, 0xa80007) AM_READ(cave_irq_cause_r) // IRQ Cause
+// AM_RANGE(0xa8006e, 0xa8006f) AM_READ(soundlatch_ack_r) // From Sound CPU
+ AM_RANGE(0xa8006e, 0xa8006f) AM_WRITE(sound_cmd_w) // To Sound CPU
AM_RANGE(0xa80000, 0xa8007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
/**/AM_RANGE(0xb00000, 0xb00005) AM_RAM AM_BASE(m_vctrl[0]) // Layer 0 Control
/**/AM_RANGE(0xb80000, 0xb80005) AM_RAM AM_BASE(m_vctrl[1]) // Layer 1 Control
@@ -655,28 +647,27 @@ static void show_leds(running_machine &machine)
#endif
}
-static WRITE16_HANDLER( korokoro_leds_w )
+WRITE16_MEMBER(cave_state::korokoro_leds_w)
{
- cave_state *state = space->machine().driver_data<cave_state>();
- COMBINE_DATA(&state->m_leds[0]);
+ COMBINE_DATA(&m_leds[0]);
- set_led_status(space->machine(), 0, data & 0x8000);
- set_led_status(space->machine(), 1, data & 0x4000);
- set_led_status(space->machine(), 2, data & 0x1000); // square button
- set_led_status(space->machine(), 3, data & 0x0800); // round button
-// coin_lockout_w(space->machine(), 1, ~data & 0x0200); // coin lockouts?
-// coin_lockout_w(space->machine(), 0, ~data & 0x0100);
+ set_led_status(machine(), 0, data & 0x8000);
+ set_led_status(machine(), 1, data & 0x4000);
+ set_led_status(machine(), 2, data & 0x1000); // square button
+ set_led_status(machine(), 3, data & 0x0800); // round button
+// coin_lockout_w(machine(), 1, ~data & 0x0200); // coin lockouts?
+// coin_lockout_w(machine(), 0, ~data & 0x0100);
-// coin_counter_w(space->machine(), 2, data & 0x0080);
-// coin_counter_w(space->machine(), 1, data & 0x0020);
- coin_counter_w(space->machine(), 0, data & 0x0010);
+// coin_counter_w(machine(), 2, data & 0x0080);
+// coin_counter_w(machine(), 1, data & 0x0020);
+ coin_counter_w(machine(), 0, data & 0x0010);
- set_led_status(space->machine(), 5, data & 0x0008);
- set_led_status(space->machine(), 6, data & 0x0004);
- set_led_status(space->machine(), 7, data & 0x0002);
- set_led_status(space->machine(), 8, data & 0x0001);
+ set_led_status(machine(), 5, data & 0x0008);
+ set_led_status(machine(), 6, data & 0x0004);
+ set_led_status(machine(), 7, data & 0x0002);
+ set_led_status(machine(), 8, data & 0x0001);
- show_leds(space->machine());
+ show_leds(machine());
}
@@ -718,14 +709,14 @@ static ADDRESS_MAP_START( korokoro_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x100000, 0x107fff) AM_WRITE_LEGACY(cave_vram_0_w) AM_BASE(m_vram[0]) // Layer 0
AM_RANGE(0x140000, 0x140005) AM_WRITEONLY AM_BASE(m_vctrl[0]) // Layer 0 Control
AM_RANGE(0x180000, 0x187fff) AM_WRITEONLY AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites
- AM_RANGE(0x1c0000, 0x1c0007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0x1c0000, 0x1c0007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0x1c0000, 0x1c007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
AM_RANGE(0x200000, 0x207fff) AM_WRITEONLY AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette
// AM_RANGE(0x240000, 0x240003) AM_DEVREAD8_LEGACY("ymz", ymz280b_r, 0x00ff) // YMZ280
AM_RANGE(0x240000, 0x240003) AM_DEVWRITE8_LEGACY("ymz", ymz280b_w, 0x00ff) // YMZ280
AM_RANGE(0x280000, 0x280001) AM_READ_PORT("IN0") // Inputs + ???
AM_RANGE(0x280002, 0x280003) AM_READ_PORT("IN1") // Inputs + EEPROM
- AM_RANGE(0x280008, 0x280009) AM_WRITE_LEGACY(korokoro_leds_w) // Leds
+ AM_RANGE(0x280008, 0x280009) AM_WRITE(korokoro_leds_w) // Leds
AM_RANGE(0x28000a, 0x28000b) AM_DEVWRITE_LEGACY("eeprom", korokoro_eeprom_msb_w) // EEPROM
AM_RANGE(0x28000c, 0x28000d) AM_WRITENOP // 0 (watchdog?)
AM_RANGE(0x300000, 0x30ffff) AM_RAM // RAM
@@ -740,10 +731,10 @@ static ADDRESS_MAP_START( crusherm_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x240000, 0x240003) AM_DEVWRITE8_LEGACY("ymz", ymz280b_w, 0x00ff) // YMZ280
AM_RANGE(0x280000, 0x280001) AM_READ_PORT("IN0") // Inputs + ???
AM_RANGE(0x280002, 0x280003) AM_READ_PORT("IN1") // Inputs + EEPROM
- AM_RANGE(0x280008, 0x280009) AM_WRITE_LEGACY(korokoro_leds_w) // Leds
+ AM_RANGE(0x280008, 0x280009) AM_WRITE(korokoro_leds_w) // Leds
AM_RANGE(0x28000a, 0x28000b) AM_DEVWRITE_LEGACY("eeprom", korokoro_eeprom_msb_w) // EEPROM
AM_RANGE(0x28000c, 0x28000d) AM_WRITENOP // 0 (watchdog?)
- AM_RANGE(0x300000, 0x300007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0x300000, 0x300007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0x300000, 0x30007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
AM_RANGE(0x340000, 0x34ffff) AM_RAM // RAM
ADDRESS_MAP_END
@@ -757,9 +748,9 @@ static ADDRESS_MAP_START( mazinger_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x100000, 0x10ffff) AM_RAM // RAM
/**/AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites
/**/AM_RANGE(0x208000, 0x20ffff) AM_RAM AM_BASE(m_spriteram_2) // Sprites?
- AM_RANGE(0x300000, 0x300007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0x300000, 0x300007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0x300068, 0x300069) AM_WRITE_LEGACY(watchdog_reset16_w) // Watchdog
- AM_RANGE(0x30006e, 0x30006f) AM_READWRITE_LEGACY(soundlatch_ack_r, sound_cmd_w) // From Sound CPU
+ AM_RANGE(0x30006e, 0x30006f) AM_READWRITE(soundlatch_ack_r, sound_cmd_w) // From Sound CPU
AM_RANGE(0x300000, 0x30007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
AM_RANGE(0x400000, 0x407fff) AM_RAM_WRITE_LEGACY(cave_vram_1_8x8_w) AM_BASE(m_vram[1]) // Layer 1
/**/AM_RANGE(0x500000, 0x507fff) AM_RAM_WRITE_LEGACY(cave_vram_0_8x8_w) AM_BASE(m_vram[0]) // Layer 0
@@ -789,10 +780,10 @@ static ADDRESS_MAP_START( metmqstr_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x908000, 0x90ffff) AM_RAM //
AM_RANGE(0x980000, 0x987fff) AM_RAM_WRITE_LEGACY(cave_vram_0_w) AM_BASE(m_vram[0]) // Layer 0
AM_RANGE(0x988000, 0x98ffff) AM_RAM //
- AM_RANGE(0xa80000, 0xa80007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0xa80000, 0xa80007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0xa80068, 0xa80069) AM_WRITE_LEGACY(watchdog_reset16_w) // Watchdog?
- AM_RANGE(0xa8006c, 0xa8006d) AM_READ_LEGACY(soundflags_ack_r) AM_WRITENOP // Communication
- AM_RANGE(0xa8006e, 0xa8006f) AM_READWRITE_LEGACY(soundlatch_ack_r, sound_cmd_w) // From Sound CPU
+ AM_RANGE(0xa8006c, 0xa8006d) AM_READ(soundflags_ack_r) AM_WRITENOP // Communication
+ AM_RANGE(0xa8006e, 0xa8006f) AM_READWRITE(soundlatch_ack_r, sound_cmd_w) // From Sound CPU
AM_RANGE(0xa80000, 0xa8007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
/**/AM_RANGE(0xb00000, 0xb00005) AM_RAM AM_BASE(m_vctrl[2]) // Layer 2 Control
/**/AM_RANGE(0xb80000, 0xb80005) AM_RAM AM_BASE(m_vctrl[1]) // Layer 1 Control
@@ -832,10 +823,10 @@ INLINE void vctrl_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem
}
COMBINE_DATA(&VCTRL[offset]);
}
-static WRITE16_HANDLER( pwrinst2_vctrl_0_w ) { vctrl_w(space, offset, data, mem_mask, 0); }
-static WRITE16_HANDLER( pwrinst2_vctrl_1_w ) { vctrl_w(space, offset, data, mem_mask, 1); }
-static WRITE16_HANDLER( pwrinst2_vctrl_2_w ) { vctrl_w(space, offset, data, mem_mask, 2); }
-static WRITE16_HANDLER( pwrinst2_vctrl_3_w ) { vctrl_w(space, offset, data, mem_mask, 3); }
+WRITE16_MEMBER(cave_state::pwrinst2_vctrl_0_w){ vctrl_w(&space, offset, data, mem_mask, 0); }
+WRITE16_MEMBER(cave_state::pwrinst2_vctrl_1_w){ vctrl_w(&space, offset, data, mem_mask, 1); }
+WRITE16_MEMBER(cave_state::pwrinst2_vctrl_2_w){ vctrl_w(&space, offset, data, mem_mask, 2); }
+WRITE16_MEMBER(cave_state::pwrinst2_vctrl_3_w){ vctrl_w(&space, offset, data, mem_mask, 3); }
static ADDRESS_MAP_START( pwrinst2_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x000000, 0x1fffff) AM_ROM // ROM
@@ -851,13 +842,13 @@ static ADDRESS_MAP_START( pwrinst2_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0xa00000, 0xa07fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites
AM_RANGE(0xa08000, 0xa0ffff) AM_RAM AM_BASE(m_spriteram_2) // Sprites?
AM_RANGE(0xa10000, 0xa1ffff) AM_RAM // Sprites?
- AM_RANGE(0xa80000, 0xa8007f) AM_RAM_READ_LEGACY(donpachi_videoregs_r) AM_BASE(m_videoregs) // Video Regs
-/**/AM_RANGE(0xb00000, 0xb00005) AM_RAM_WRITE_LEGACY(pwrinst2_vctrl_2_w) AM_BASE(m_vctrl[2]) // Layer 2 Control
-/**/AM_RANGE(0xb80000, 0xb80005) AM_RAM_WRITE_LEGACY(pwrinst2_vctrl_0_w) AM_BASE(m_vctrl[0]) // Layer 0 Control
-/**/AM_RANGE(0xc00000, 0xc00005) AM_RAM_WRITE_LEGACY(pwrinst2_vctrl_1_w) AM_BASE(m_vctrl[1]) // Layer 1 Control
-/**/AM_RANGE(0xc80000, 0xc80005) AM_RAM_WRITE_LEGACY(pwrinst2_vctrl_3_w) AM_BASE(m_vctrl[3]) // Layer 3 Control
- AM_RANGE(0xd80000, 0xd80001) AM_READ_LEGACY(soundlatch_ack_r) // ? From Sound CPU
- AM_RANGE(0xe00000, 0xe00001) AM_WRITE_LEGACY(sound_cmd_w) // To Sound CPU
+ AM_RANGE(0xa80000, 0xa8007f) AM_RAM_READ(donpachi_videoregs_r) AM_BASE(m_videoregs) // Video Regs
+/**/AM_RANGE(0xb00000, 0xb00005) AM_RAM_WRITE(pwrinst2_vctrl_2_w) AM_BASE(m_vctrl[2]) // Layer 2 Control
+/**/AM_RANGE(0xb80000, 0xb80005) AM_RAM_WRITE(pwrinst2_vctrl_0_w) AM_BASE(m_vctrl[0]) // Layer 0 Control
+/**/AM_RANGE(0xc00000, 0xc00005) AM_RAM_WRITE(pwrinst2_vctrl_1_w) AM_BASE(m_vctrl[1]) // Layer 1 Control
+/**/AM_RANGE(0xc80000, 0xc80005) AM_RAM_WRITE(pwrinst2_vctrl_3_w) AM_BASE(m_vctrl[3]) // Layer 3 Control
+ AM_RANGE(0xd80000, 0xd80001) AM_READ(soundlatch_ack_r) // ? From Sound CPU
+ AM_RANGE(0xe00000, 0xe00001) AM_WRITE(sound_cmd_w) // To Sound CPU
AM_RANGE(0xe80000, 0xe80001) AM_DEVREAD_LEGACY("eeprom", pwrinst2_eeprom_r) // EEPROM
AM_RANGE(0xf00000, 0xf04fff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette
ADDRESS_MAP_END
@@ -867,10 +858,10 @@ ADDRESS_MAP_END
Sailor Moon
***************************************************************************/
-static READ16_HANDLER( sailormn_input0_r )
+READ16_MEMBER(cave_state::sailormn_input0_r)
{
// watchdog_reset16_r(0, 0); // written too rarely for mame.
- return input_port_read(space->machine(), "IN0");
+ return input_port_read(machine(), "IN0");
}
static ADDRESS_MAP_START( sailormn_map, AS_PROGRAM, 16, cave_state )
@@ -885,7 +876,7 @@ static ADDRESS_MAP_START( sailormn_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x500000, 0x507fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites
AM_RANGE(0x508000, 0x50ffff) AM_RAM AM_BASE(m_spriteram_2) // Sprites?
AM_RANGE(0x510000, 0x510001) AM_RAM // (agallet)
- AM_RANGE(0x600000, 0x600001) AM_READ_LEGACY(sailormn_input0_r) // Inputs + Watchdog!
+ AM_RANGE(0x600000, 0x600001) AM_READ(sailormn_input0_r) // Inputs + Watchdog!
AM_RANGE(0x600002, 0x600003) AM_READ_PORT("IN1") // Inputs + EEPROM
AM_RANGE(0x700000, 0x700001) AM_DEVWRITE_LEGACY("eeprom", sailormn_eeprom_msb_w) // EEPROM
AM_RANGE(0x800000, 0x807fff) AM_RAM_WRITE_LEGACY(cave_vram_0_w) AM_BASE(m_vram[0]) // Layer 0
@@ -895,10 +886,10 @@ static ADDRESS_MAP_START( sailormn_map, AS_PROGRAM, 16, cave_state )
/**/AM_RANGE(0xa00000, 0xa00005) AM_RAM AM_BASE(m_vctrl[0]) // Layer 0 Control
/**/AM_RANGE(0xa80000, 0xa80005) AM_RAM AM_BASE(m_vctrl[1]) // Layer 1 Control
/**/AM_RANGE(0xb00000, 0xb00005) AM_RAM AM_BASE(m_vctrl[2]) // Layer 2 Control
- AM_RANGE(0xb80000, 0xb80007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause (bit 2 tested!)
- AM_RANGE(0xb8006c, 0xb8006d) AM_READ_LEGACY(soundflags_ack_r) // Communication
- AM_RANGE(0xb8006e, 0xb8006f) AM_READ_LEGACY(soundlatch_ack_r) // From Sound CPU
- AM_RANGE(0xb8006e, 0xb8006f) AM_WRITE_LEGACY(sound_cmd_w) // To Sound CPU
+ AM_RANGE(0xb80000, 0xb80007) AM_READ(cave_irq_cause_r) // IRQ Cause (bit 2 tested!)
+ AM_RANGE(0xb8006c, 0xb8006d) AM_READ(soundflags_ack_r) // Communication
+ AM_RANGE(0xb8006e, 0xb8006f) AM_READ(soundlatch_ack_r) // From Sound CPU
+ AM_RANGE(0xb8006e, 0xb8006f) AM_WRITE(sound_cmd_w) // To Sound CPU
AM_RANGE(0xb80000, 0xb8007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
ADDRESS_MAP_END
@@ -926,19 +917,18 @@ static WRITE16_DEVICE_HANDLER( tjumpman_eeprom_lsb_w )
}
}
-static WRITE16_HANDLER( tjumpman_leds_w )
+WRITE16_MEMBER(cave_state::tjumpman_leds_w)
{
- cave_state *state = space->machine().driver_data<cave_state>();
if (ACCESSING_BITS_0_7)
{
- set_led_status(space->machine(), 0, data & 0x0001); // suru
- set_led_status(space->machine(), 1, data & 0x0002); // shinai
- set_led_status(space->machine(), 2, data & 0x0004); // payout
- set_led_status(space->machine(), 3, data & 0x0008); // go
- set_led_status(space->machine(), 4, data & 0x0010); // 1 bet
- set_led_status(space->machine(), 5, data & 0x0020); // medal
- state->m_hopper = data & 0x0040; // hopper
- set_led_status(space->machine(), 6, data & 0x0080); // 3 bet
+ set_led_status(machine(), 0, data & 0x0001); // suru
+ set_led_status(machine(), 1, data & 0x0002); // shinai
+ set_led_status(machine(), 2, data & 0x0004); // payout
+ set_led_status(machine(), 3, data & 0x0008); // go
+ set_led_status(machine(), 4, data & 0x0010); // 1 bet
+ set_led_status(machine(), 5, data & 0x0020); // medal
+ m_hopper = data & 0x0040; // hopper
+ set_led_status(machine(), 6, data & 0x0080); // 3 bet
}
// popmessage("led %04X", data);
@@ -961,11 +951,11 @@ static ADDRESS_MAP_START( tjumpman_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x500000, 0x50ffff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette
AM_RANGE(0x600000, 0x600001) AM_READ_PORT("IN0") // Inputs + EEPROM + Hopper
AM_RANGE(0x600002, 0x600003) AM_READ_PORT("IN1") // Inputs
- AM_RANGE(0x700000, 0x700007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0x700000, 0x700007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0x700068, 0x700069) AM_WRITE_LEGACY(watchdog_reset16_w) // Watchdog
AM_RANGE(0x700000, 0x70007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
AM_RANGE(0x800000, 0x800001) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) // M6295
- AM_RANGE(0xc00000, 0xc00001) AM_WRITE_LEGACY(tjumpman_leds_w) // Leds + Hopper
+ AM_RANGE(0xc00000, 0xc00001) AM_WRITE(tjumpman_leds_w) // Leds + Hopper
AM_RANGE(0xe00000, 0xe00001) AM_DEVWRITE_LEGACY("eeprom", tjumpman_eeprom_lsb_w) // EEPROM
ADDRESS_MAP_END
@@ -974,18 +964,17 @@ ADDRESS_MAP_END
Pac-Slot
***************************************************************************/
-static WRITE16_HANDLER( pacslot_leds_w )
+WRITE16_MEMBER(cave_state::pacslot_leds_w)
{
- cave_state *state = space->machine().driver_data<cave_state>();
if (ACCESSING_BITS_0_7)
{
- set_led_status(space->machine(), 0, data & 0x0001); // pac-man
- set_led_status(space->machine(), 1, data & 0x0002); // ms. pac-man
- set_led_status(space->machine(), 2, data & 0x0004); // payout
- set_led_status(space->machine(), 3, data & 0x0008); // start
- set_led_status(space->machine(), 4, data & 0x0010); // bet
- set_led_status(space->machine(), 5, data & 0x0020); // medal
- state->m_hopper = data & 0x0040; // hopper
+ set_led_status(machine(), 0, data & 0x0001); // pac-man
+ set_led_status(machine(), 1, data & 0x0002); // ms. pac-man
+ set_led_status(machine(), 2, data & 0x0004); // payout
+ set_led_status(machine(), 3, data & 0x0008); // start
+ set_led_status(machine(), 4, data & 0x0010); // bet
+ set_led_status(machine(), 5, data & 0x0020); // medal
+ m_hopper = data & 0x0040; // hopper
}
// popmessage("led %04X", data);
@@ -997,7 +986,7 @@ static ADDRESS_MAP_START( pacslot_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites
AM_RANGE(0x208000, 0x20ffff) AM_RAM AM_BASE(m_spriteram_2) // Sprite bank 2
AM_RANGE(0x300000, 0x307fff) AM_RAM_WRITE_LEGACY(cave_vram_0_w) AM_BASE(m_vram[0]) // Layer 0
- AM_RANGE(0x400000, 0x400007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0x400000, 0x400007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0x400068, 0x400069) AM_WRITE_LEGACY(watchdog_reset16_w) // Watchdog
AM_RANGE(0x400000, 0x40007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
AM_RANGE(0x500000, 0x500005) AM_WRITEONLY AM_BASE(m_vctrl[0]) // Layer 0 Control
@@ -1005,7 +994,7 @@ static ADDRESS_MAP_START( pacslot_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x700000, 0x700001) AM_READ_PORT("IN0") // Inputs + EEPROM + Hopper
AM_RANGE(0x700002, 0x700003) AM_READ_PORT("IN1") // Inputs
AM_RANGE(0x800000, 0x800001) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) // M6295
- AM_RANGE(0xc00000, 0xc00001) AM_WRITE_LEGACY(pacslot_leds_w) // Leds + Hopper
+ AM_RANGE(0xc00000, 0xc00001) AM_WRITE(pacslot_leds_w) // Leds + Hopper
AM_RANGE(0xe00000, 0xe00001) AM_DEVWRITE_LEGACY("eeprom", tjumpman_eeprom_lsb_w) // EEPROM
ADDRESS_MAP_END
@@ -1021,7 +1010,7 @@ static ADDRESS_MAP_START( uopoko_map, AS_PROGRAM, 16, cave_state )
/**/AM_RANGE(0x400000, 0x407fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites
/**/AM_RANGE(0x408000, 0x40ffff) AM_RAM AM_BASE(m_spriteram_2) // Sprites?
/**/AM_RANGE(0x500000, 0x507fff) AM_RAM_WRITE_LEGACY(cave_vram_0_w) AM_BASE(m_vram[0]) // Layer 0
- AM_RANGE(0x600000, 0x600007) AM_READ_LEGACY(cave_irq_cause_r) // IRQ Cause
+ AM_RANGE(0x600000, 0x600007) AM_READ(cave_irq_cause_r) // IRQ Cause
AM_RANGE(0x600000, 0x60007f) AM_WRITEONLY AM_BASE(m_videoregs) // Video Regs
/**/AM_RANGE(0x700000, 0x700005) AM_RAM AM_BASE(m_vctrl[0]) // Layer 0 Control
/**/AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette
@@ -1056,20 +1045,20 @@ ADDRESS_MAP_END
Hotdog Storm
***************************************************************************/
-static WRITE8_HANDLER( hotdogst_rombank_w )
+WRITE8_MEMBER(cave_state::hotdogst_rombank_w)
{
if (data & ~0x0f)
- logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(&space->device()), data);
+ logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(&space.device()), data);
- memory_set_bank(space->machine(), "bank2", data & 0x0f);
+ memory_set_bank(machine(), "bank2", data & 0x0f);
}
-static WRITE8_HANDLER( hotdogst_okibank_w )
+WRITE8_MEMBER(cave_state::hotdogst_okibank_w)
{
int bank1 = (data >> 0) & 0x3;
int bank2 = (data >> 4) & 0x3;
- memory_set_bank(space->machine(), "bank3", bank1);
- memory_set_bank(space->machine(), "bank4", bank2);
+ memory_set_bank(machine(), "bank3", bank1);
+ memory_set_bank(machine(), "bank4", bank2);
}
static ADDRESS_MAP_START( hotdogst_sound_map, AS_PROGRAM, 8, cave_state )
@@ -1080,12 +1069,12 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( hotdogst_sound_portmap, AS_IO, 8, cave_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE_LEGACY(hotdogst_rombank_w) // ROM bank
- AM_RANGE(0x30, 0x30) AM_READ_LEGACY(soundlatch_lo_r) // From Main CPU
- AM_RANGE(0x40, 0x40) AM_READ_LEGACY(soundlatch_hi_r) //
+ AM_RANGE(0x00, 0x00) AM_WRITE(hotdogst_rombank_w) // ROM bank
+ AM_RANGE(0x30, 0x30) AM_READ(soundlatch_lo_r) // From Main CPU
+ AM_RANGE(0x40, 0x40) AM_READ(soundlatch_hi_r) //
AM_RANGE(0x50, 0x51) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w) //
AM_RANGE(0x60, 0x60) AM_DEVREADWRITE("oki", okim6295_device, read, write) // M6295
- AM_RANGE(0x70, 0x70) AM_WRITE_LEGACY(hotdogst_okibank_w) // Samples bank
+ AM_RANGE(0x70, 0x70) AM_WRITE(hotdogst_okibank_w) // Samples bank
ADDRESS_MAP_END
@@ -1093,12 +1082,12 @@ ADDRESS_MAP_END
Mazinger Z
***************************************************************************/
-static WRITE8_HANDLER( mazinger_rombank_w )
+WRITE8_MEMBER(cave_state::mazinger_rombank_w)
{
if (data & ~0x07)
- logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(&space->device()), data);
+ logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(&space.device()), data);
- memory_set_bank(space->machine(), "bank2", data & 0x07);
+ memory_set_bank(machine(), "bank2", data & 0x07);
}
static ADDRESS_MAP_START( mazinger_sound_map, AS_PROGRAM, 8, cave_state )
@@ -1110,13 +1099,13 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mazinger_sound_portmap, AS_IO, 8, cave_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE_LEGACY(mazinger_rombank_w) // ROM bank
- AM_RANGE(0x10, 0x10) AM_WRITE_LEGACY(soundlatch_ack_w) // To Main CPU
- AM_RANGE(0x30, 0x30) AM_READ_LEGACY(soundlatch_lo_r) // From Main CPU
+ AM_RANGE(0x00, 0x00) AM_WRITE(mazinger_rombank_w) // ROM bank
+ AM_RANGE(0x10, 0x10) AM_WRITE(soundlatch_ack_w) // To Main CPU
+ AM_RANGE(0x30, 0x30) AM_READ(soundlatch_lo_r) // From Main CPU
AM_RANGE(0x50, 0x51) AM_DEVWRITE_LEGACY("ymsnd", ym2203_w) // YM2203
AM_RANGE(0x52, 0x53) AM_DEVREAD_LEGACY("ymsnd", ym2203_r) // YM2203
AM_RANGE(0x70, 0x70) AM_DEVWRITE("oki", okim6295_device, write) // M6295
- AM_RANGE(0x74, 0x74) AM_WRITE_LEGACY(hotdogst_okibank_w) // Samples bank
+ AM_RANGE(0x74, 0x74) AM_WRITE(hotdogst_okibank_w) // Samples bank
ADDRESS_MAP_END
@@ -1124,28 +1113,28 @@ ADDRESS_MAP_END
Metamoqester
***************************************************************************/
-static WRITE8_HANDLER( metmqstr_rombank_w )
+WRITE8_MEMBER(cave_state::metmqstr_rombank_w)
{
if (data & ~0x0f)
- logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(&space->device()), data);
+ logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(&space.device()), data);<