summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video')
-rw-r--r--src/mame/video/1942.c25
-rw-r--r--src/mame/video/1943.c37
-rw-r--r--src/mame/video/40love.c59
-rw-r--r--src/mame/video/4enraya.c5
-rw-r--r--src/mame/video/8080bw.c13
-rw-r--r--src/mame/video/actfancr.c4
-rw-r--r--src/mame/video/aeroboto.c31
-rw-r--r--src/mame/video/aerofgt.c77
-rw-r--r--src/mame/video/airbustr.c21
-rw-r--r--src/mame/video/ajax.c13
-rw-r--r--src/mame/video/aliens.c13
-rw-r--r--src/mame/video/alpha68k.c27
-rw-r--r--src/mame/video/ambush.c8
-rw-r--r--src/mame/video/amiga.c17
-rw-r--r--src/mame/video/amigaaga.c7
-rw-r--r--src/mame/video/ampoker2.c18
-rw-r--r--src/mame/video/amspdwy.c5
-rw-r--r--src/mame/video/angelkds.c15
-rw-r--r--src/mame/video/appoooh.c33
-rw-r--r--src/mame/video/aquarium.c13
-rw-r--r--src/mame/video/arabian.c29
-rw-r--r--src/mame/video/arcadecl.c7
-rw-r--r--src/mame/video/argus.c92
-rw-r--r--src/mame/video/arkanoid.c5
-rw-r--r--src/mame/video/armedf.c52
-rw-r--r--src/mame/video/artmagic.c15
-rw-r--r--src/mame/video/ashnojoe.c33
-rw-r--r--src/mame/video/astrocde.c58
-rw-r--r--src/mame/video/atarifb.c9
-rw-r--r--src/mame/video/atarig1.c23
-rw-r--r--src/mame/video/atarig42.c23
-rw-r--r--src/mame/video/atarigt.c39
-rw-r--r--src/mame/video/atarigx2.c23
-rw-r--r--src/mame/video/atarisy1.c21
-rw-r--r--src/mame/video/atarisy2.c25
-rw-r--r--src/mame/video/atetris.c5
-rw-r--r--src/mame/video/aztarac.c11
-rw-r--r--src/mame/video/badlands.c9
-rw-r--r--src/mame/video/bagman.c15
-rw-r--r--src/mame/video/balsente.c17
-rw-r--r--src/mame/video/bankp.c31
-rw-r--r--src/mame/video/baraduke.c25
-rw-r--r--src/mame/video/batman.c15
-rw-r--r--src/mame/video/battlane.c7
-rw-r--r--src/mame/video/battlera.c29
-rw-r--r--src/mame/video/battlex.c5
-rw-r--r--src/mame/video/bbusters.c26
-rw-r--r--src/mame/video/bigevglf.c23
-rw-r--r--src/mame/video/bigstrkb.c15
-rw-r--r--src/mame/video/bionicc.c17
-rw-r--r--src/mame/video/bishi.c23
-rw-r--r--src/mame/video/bking.c21
-rw-r--r--src/mame/video/bladestl.c10
-rw-r--r--src/mame/video/blktiger.c39
-rw-r--r--src/mame/video/blmbycar.c17
-rw-r--r--src/mame/video/blockade.c5
-rw-r--r--src/mame/video/blockhl.c13
-rw-r--r--src/mame/video/blockout.c7
-rw-r--r--src/mame/video/bloodbro.c13
-rw-r--r--src/mame/video/blstroid.c7
-rw-r--r--src/mame/video/blueprnt.c17
-rw-r--r--src/mame/video/bogeyman.c15
-rw-r--r--src/mame/video/bombjack.c9
-rw-r--r--src/mame/video/boogwing.c6
-rw-r--r--src/mame/video/bosco.c45
-rw-r--r--src/mame/video/bottom9.c13
-rw-r--r--src/mame/video/brkthru.c27
-rw-r--r--src/mame/video/bsktball.c5
-rw-r--r--src/mame/video/btime.c36
-rw-r--r--src/mame/video/buggychl.c17
-rw-r--r--src/mame/video/bwing.c37
-rw-r--r--src/mame/video/cabal.c11
-rw-r--r--src/mame/video/calomega.c13
-rw-r--r--src/mame/video/canyon.c5
-rw-r--r--src/mame/video/capbowl.c4
-rw-r--r--src/mame/video/carjmbre.c21
-rw-r--r--src/mame/video/carpolo.c31
-rw-r--r--src/mame/video/cave.c80
-rw-r--r--src/mame/video/cbasebal.c17
-rw-r--r--src/mame/video/cbuster.c4
-rw-r--r--src/mame/video/ccastles.c25
-rw-r--r--src/mame/video/cchasm.c11
-rw-r--r--src/mame/video/cclimber.c99
-rw-r--r--src/mame/video/centiped.c42
-rw-r--r--src/mame/video/chaknpop.c35
-rw-r--r--src/mame/video/champbas.c32
-rw-r--r--src/mame/video/changela.c23
-rw-r--r--src/mame/video/cheekyms.c19
-rw-r--r--src/mame/video/chqflag.c11
-rw-r--r--src/mame/video/cinemat.c35
-rw-r--r--src/mame/video/circus.c5
-rw-r--r--src/mame/video/circusc.c19
-rw-r--r--src/mame/video/cischeat.c32
-rw-r--r--src/mame/video/citycon.c11
-rw-r--r--src/mame/video/cloak.c27
-rw-r--r--src/mame/video/cloud9.c27
-rw-r--r--src/mame/video/clshroad.c76
-rw-r--r--src/mame/video/cninja.c15
-rw-r--r--src/mame/video/combatsc.c68
-rw-r--r--src/mame/video/commando.c9
-rw-r--r--src/mame/video/compgolf.c17
-rw-r--r--src/mame/video/contra.c39
-rw-r--r--src/mame/video/cop01.c27
-rw-r--r--src/mame/video/cosmic.c75
-rw-r--r--src/mame/video/cps1.c152
-rw-r--r--src/mame/video/crbaloon.c15
-rw-r--r--src/mame/video/crgolf.c13
-rw-r--r--src/mame/video/crimfght.c13
-rw-r--r--src/mame/video/crospang.c9
-rw-r--r--src/mame/video/crshrace.c11
-rw-r--r--src/mame/video/cvs.c37
-rw-r--r--src/mame/video/cyberbal.c8
-rw-r--r--src/mame/video/darius.c7
-rw-r--r--src/mame/video/darkmist.c21
-rw-r--r--src/mame/video/darkseal.c2
-rw-r--r--src/mame/video/dassault.c6
-rw-r--r--src/mame/video/dbz.c23
-rw-r--r--src/mame/video/dc.c62
-rw-r--r--src/mame/video/dcheese.c23
-rw-r--r--src/mame/video/dcon.c19
-rw-r--r--src/mame/video/dday.c175
-rw-r--r--src/mame/video/ddragon.c30
-rw-r--r--src/mame/video/ddragon3.c11
-rw-r--r--src/mame/video/ddribble.c19
-rw-r--r--src/mame/video/deadang.c19
-rw-r--r--src/mame/video/dec0.c15
-rw-r--r--src/mame/video/dec8.c116
-rw-r--r--src/mame/video/deco32.c57
-rw-r--r--src/mame/video/deco_mlc.c17
-rw-r--r--src/mame/video/decocass.c37
-rw-r--r--src/mame/video/deniam.c13
-rw-r--r--src/mame/video/digdug.c33
-rw-r--r--src/mame/video/djboy.c5
-rw-r--r--src/mame/video/djmain.c4
-rw-r--r--src/mame/video/dkong.c147
-rw-r--r--src/mame/video/docastle.c16
-rw-r--r--src/mame/video/dogfgt.c19
-rw-r--r--src/mame/video/dooyong.c358
-rw-r--r--src/mame/video/dragrace.c5
-rw-r--r--src/mame/video/drgnmst.c17
-rw-r--r--src/mame/video/dribling.c6
-rw-r--r--src/mame/video/drmicro.c23
-rw-r--r--src/mame/video/dynax.c258
-rw-r--r--src/mame/video/dynduke.c13
-rw-r--r--src/mame/video/eolith.c5
-rw-r--r--src/mame/video/eprom.c30
-rw-r--r--src/mame/video/equites.c62
-rw-r--r--src/mame/video/esd16.c23
-rw-r--r--src/mame/video/espial.c36
-rw-r--r--src/mame/video/esripsys.c61
-rw-r--r--src/mame/video/exedexes.c29
-rw-r--r--src/mame/video/exerion.c31
-rw-r--r--src/mame/video/exidy.c29
-rw-r--r--src/mame/video/exidy440.c34
-rw-r--r--src/mame/video/exprraid.c11
-rw-r--r--src/mame/video/exterm.c4
-rw-r--r--src/mame/video/f1gp.c45
-rw-r--r--src/mame/video/fastfred.c40
-rw-r--r--src/mame/video/fastlane.c27
-rw-r--r--src/mame/video/fcombat.c17
-rw-r--r--src/mame/video/fgoal.c11
-rw-r--r--src/mame/video/finalizr.c19
-rw-r--r--src/mame/video/firetrap.c29
-rw-r--r--src/mame/video/firetrk.c61
-rw-r--r--src/mame/video/fitfight.c13
-rw-r--r--src/mame/video/flkatck.c7
-rw-r--r--src/mame/video/flower.c31
-rw-r--r--src/mame/video/flstory.c49
-rw-r--r--src/mame/video/foodf.c17
-rw-r--r--src/mame/video/freekick.c5
-rw-r--r--src/mame/video/fromanc2.c271
-rw-r--r--src/mame/video/fromance.c34
-rw-r--r--src/mame/video/funkybee.c11
-rw-r--r--src/mame/video/funworld.c18
-rw-r--r--src/mame/video/funybubl.c2
-rw-r--r--src/mame/video/fuukifg2.c29
-rw-r--r--src/mame/video/fuukifg3.c31
-rw-r--r--src/mame/video/gaelco.c22
-rw-r--r--src/mame/video/gaelco2.c46
-rw-r--r--src/mame/video/gaelco3d.c17
-rw-r--r--src/mame/video/gaiden.c96
-rw-r--r--src/mame/video/galaga.c31
-rw-r--r--src/mame/video/galastrm.c13
-rw-r--r--src/mame/video/galaxia.c46
-rw-r--r--src/mame/video/galaxian.c61
-rw-r--r--src/mame/video/galaxold.c369
-rw-r--r--src/mame/video/galivan.c32
-rw-r--r--src/mame/video/galpani2.c13
-rw-r--r--src/mame/video/galpanic.c11
-rw-r--r--src/mame/video/galspnbl.c4
-rw-r--r--src/mame/video/gameplan.c38
-rw-r--r--src/mame/video/gaplus.c25
-rw-r--r--src/mame/video/gatron.c7
-rw-r--r--src/mame/video/gauntlet.c17
-rw-r--r--src/mame/video/gberet.c21
-rw-r--r--src/mame/video/gbusters.c11
-rw-r--r--src/mame/video/gcpinbal.c4
-rw-r--r--src/mame/video/gijoe.c27
-rw-r--r--src/mame/video/ginganin.c13
-rw-r--r--src/mame/video/gladiatr.c28
-rw-r--r--src/mame/video/glass.c15
-rw-r--r--src/mame/video/gng.c13
-rw-r--r--src/mame/video/goal92.c19
-rw-r--r--src/mame/video/goindol.c9
-rw-r--r--src/mame/video/goldstar.c107
-rw-r--r--src/mame/video/gomoku.c27
-rw-r--r--src/mame/video/gotcha.c13
-rw-r--r--src/mame/video/gottlieb.c50
-rw-r--r--src/mame/video/gotya.c15
-rw-r--r--src/mame/video/gradius3.c21
-rw-r--r--src/mame/video/grchamp.c20
-rw-r--r--src/mame/video/gridlee.c21
-rw-r--r--src/mame/video/groundfx.c7
-rw-r--r--src/mame/video/gstriker.c75
-rw-r--r--src/mame/video/gsword.c29
-rw-r--r--src/mame/video/gumbo.c9
-rw-r--r--src/mame/video/gunbustr.c5
-rw-r--r--src/mame/video/gundealr.c9
-rw-r--r--src/mame/video/gunsmoke.c23
-rw-r--r--src/mame/video/gyruss.c21
-rw-r--r--src/mame/video/hanaawas.c15
-rw-r--r--src/mame/video/harddriv.c9
-rw-r--r--src/mame/video/hcastle.c17
-rw-r--r--src/mame/video/hexion.c19
-rw-r--r--src/mame/video/higemaru.c17
-rw-r--r--src/mame/video/himesiki.c5
-rw-r--r--src/mame/video/hnayayoi.c36
-rw-r--r--src/mame/video/hng64.c71
-rw-r--r--src/mame/video/holeland.c14
-rw-r--r--src/mame/video/homedata.c121
-rw-r--r--src/mame/video/homerun.c5
-rw-r--r--src/mame/video/hyhoo.c5
-rw-r--r--src/mame/video/hyperspt.c26
-rw-r--r--src/mame/video/hyprduel.c59
-rw-r--r--src/mame/video/ikki.c22
-rw-r--r--src/mame/video/inufuku.c11
-rw-r--r--src/mame/video/iqblock.c11
-rw-r--r--src/mame/video/irobot.c25
-rw-r--r--src/mame/video/ironhors.c24
-rw-r--r--src/mame/video/itech32.c41
-rw-r--r--src/mame/video/itech8.c13
-rw-r--r--src/mame/video/jack.c18
-rw-r--r--src/mame/video/jackal.c17
-rw-r--r--src/mame/video/jailbrek.c19
-rw-r--r--src/mame/video/jedi.c9
-rw-r--r--src/mame/video/jpmimpct.c17
-rw-r--r--src/mame/video/kaneko16.c20
-rw-r--r--src/mame/video/kangaroo.c7
-rw-r--r--src/mame/video/karnov.c38
-rw-r--r--src/mame/video/kchamp.c17
-rw-r--r--src/mame/video/kickgoal.c54
-rw-r--r--src/mame/video/kingobox.c30
-rw-r--r--src/mame/video/klax.c7
-rw-r--r--src/mame/video/kncljoe.c21
-rw-r--r--src/mame/video/konamigx.c180
-rw-r--r--src/mame/video/kopunch.c19
-rw-r--r--src/mame/video/ksayakyu.c15
-rw-r--r--src/mame/video/kyugo.c15
-rw-r--r--src/mame/video/labyrunr.c33
-rw-r--r--src/mame/video/ladybug.c42
-rw-r--r--src/mame/video/ladyfrog.c31
-rw-r--r--src/mame/video/lasso.c41
-rw-r--r--src/mame/video/lastduel.c42
-rw-r--r--src/mame/video/legionna.c125
-rw-r--r--src/mame/video/leland.c20
-rw-r--r--src/mame/video/lemmings.c23
-rw-r--r--src/mame/video/lethal.c31
-rw-r--r--src/mame/video/lethalj.c9
-rw-r--r--src/mame/video/liberate.c48
-rw-r--r--src/mame/video/lkage.c19
-rw-r--r--src/mame/video/lockon.c31
-rw-r--r--src/mame/video/lordgun.c41
-rw-r--r--src/mame/video/lucky74.c29
-rw-r--r--src/mame/video/lvcards.c53
-rw-r--r--src/mame/video/lwings.c33
-rw-r--r--src/mame/video/m10.c26
-rw-r--r--src/mame/video/m107.c11
-rw-r--r--src/mame/video/m52.c63
-rw-r--r--src/mame/video/m57.c23
-rw-r--r--src/mame/video/m58.c35
-rw-r--r--src/mame/video/m62.c183
-rw-r--r--src/mame/video/m72.c165
-rw-r--r--src/mame/video/m90.c59
-rw-r--r--src/mame/video/m92.c44
-rw-r--r--src/mame/video/macrossp.c35
-rw-r--r--src/mame/video/madalien.c57
-rw-r--r--src/mame/video/madmotor.c2
-rw-r--r--src/mame/video/magmax.c27
-rw-r--r--src/mame/video/mainevt.c22
-rw-r--r--src/mame/video/mainsnk.c21
-rw-r--r--src/mame/video/mappy.c65
-rw-r--r--src/mame/video/marineb.c31
-rw-r--r--src/mame/video/mario.c39
-rw-r--r--src/mame/video/markham.c17
-rw-r--r--src/mame/video/matmania.c17
-rw-r--r--src/mame/video/mcatadv.c23
-rw-r--r--src/mame/video/mcd212.c15
-rw-r--r--src/mame/video/mcr.c11
-rw-r--r--src/mame/video/mcr3.c41
-rw-r--r--src/mame/video/mcr68.c26
-rw-r--r--src/mame/video/meadows.c5
-rw-r--r--src/mame/video/megasys1.c60
-rw-r--r--src/mame/video/megazone.c19
-rw-r--r--src/mame/video/mermaid.c57
-rw-r--r--src/mame/video/metlclsh.c15
-rw-r--r--src/mame/video/metro.c117
-rw-r--r--src/mame/video/micro3d.c20
-rw-r--r--src/mame/video/midtunit.c24
-rw-r--r--src/mame/video/midvunit.c17
-rw-r--r--src/mame/video/midyunit.c65
-rw-r--r--src/mame/video/midzeus.c40
-rw-r--r--src/mame/video/midzeus2.c34
-rw-r--r--src/mame/video/mikie.c15
-rw-r--r--src/mame/video/mitchell.c13
-rw-r--r--src/mame/video/mjkjidai.c5
-rw-r--r--src/mame/video/model1.c31
-rw-r--r--src/mame/video/model2.c15
-rw-r--r--src/mame/video/model3.c47
-rw-r--r--src/mame/video/moo.c27
-rw-r--r--src/mame/video/mosaic.c9
-rw-r--r--src/mame/video/mouser.c8
-rw-r--r--src/mame/video/mrdo.c35
-rw-r--r--src/mame/video/mrjong.c15
-rw-r--r--src/mame/video/ms32.c72
-rw-r--r--src/mame/video/msisaac.c13
-rw-r--r--src/mame/video/mugsmash.c9
-rw-r--r--src/mame/video/munchmo.c13
-rw-r--r--src/mame/video/mustache.c13
-rw-r--r--src/mame/video/mystston.c20
-rw-r--r--src/mame/video/mystwarr.c112
-rw-r--r--src/mame/video/n64.c17
-rw-r--r--src/mame/video/n8080.c51
-rw-r--r--src/mame/video/namcofl.c9
-rw-r--r--src/mame/video/namcona1.c29
-rw-r--r--src/mame/video/namconb1.c16
-rw-r--r--src/mame/video/namcos1.c57
-rw-r--r--src/mame/video/namcos21.c11
-rw-r--r--src/mame/video/namcos22.c65
-rw-r--r--src/mame/video/namcos86.c32
-rw-r--r--src/mame/video/naughtyb.c15
-rw-r--r--src/mame/video/nbmj8688.c58
-rw-r--r--src/mame/video/nbmj8891.c50
-rw-r--r--src/mame/video/nbmj8900.c29
-rw-r--r--src/mame/video/nbmj8991.c15
-rw-r--r--src/mame/video/nbmj9195.c85
-rw-r--r--src/mame/video/nemesis.c39
-rw-r--r--src/mame/video/neogeo.c79
-rw-r--r--src/mame/video/news.c9
-rw-r--r--src/mame/video/ninjakd2.c97
-rw-r--r--src/mame/video/ninjaw.c5
-rw-r--r--src/mame/video/nitedrvr.c5
-rw-r--r--src/mame/video/niyanpai.c37
-rw-r--r--src/mame/video/nmk16.c136
-rw-r--r--src/mame/video/nova2001.c46
-rw-r--r--src/mame/video/nycaptor.c23
-rw-r--r--src/mame/video/offtwall.c7
-rw-r--r--src/mame/video/ohmygod.c5
-rw-r--r--src/mame/video/ojankohs.c55
-rw-r--r--src/mame/video/oneshot.c15
-rw-r--r--src/mame/video/orbit.c5
-rw-r--r--src/mame/video/othldrby.c25
-rw-r--r--src/mame/video/othunder.c5
-rw-r--r--src/mame/video/pacland.c64
-rw-r--r--src/mame/video/pacman.c127
-rw-r--r--src/mame/video/pandoras.c19
-rw-r--r--src/mame/video/paradise.c19
-rw-r--r--src/mame/video/pass.c9
-rw-r--r--src/mame/video/pastelg.c27
-rw-r--r--src/mame/video/pbaction.c9
-rw-r--r--src/mame/video/pcktgal.c16
-rw-r--r--src/mame/video/pgm.c27
-rw-r--r--src/mame/video/phoenix.c103
-rw-r--r--src/mame/video/pingpong.c17
-rw-r--r--src/mame/video/pirates.c13
-rw-r--r--src/mame/video/pitnrun.c27
-rw-r--r--src/mame/video/playch10.c28
-rw-r--r--src/mame/video/playmark.c156
-rw-r--r--src/mame/video/plygonet.c25
-rw-r--r--src/mame/video/pokechmp.c5
-rw-r--r--src/mame/video/polepos.c32
-rw-r--r--src/mame/video/policetr.c9
-rw-r--r--src/mame/video/polyplay.c29
-rw-r--r--src/mame/video/poolshrk.c7
-rw-r--r--src/mame/video/pooyan.c17
-rw-r--r--src/mame/video/popeye.c60
-rw-r--r--src/mame/video/popper.c45
-rw-r--r--src/mame/video/portrait.c25
-rw-r--r--src/mame/video/powerins.c17
-rw-r--r--src/mame/video/prehisle.c15
-rw-r--r--src/mame/video/psikyo.c67
-rw-r--r--src/mame/video/psikyo4.c4
-rw-r--r--src/mame/video/psikyosh.c25
-rw-r--r--src/mame/video/psychic5.c88
-rw-r--r--src/mame/video/punchout.c46
-rw-r--r--src/mame/video/pushman.c9
-rw-r--r--src/mame/video/qdrmfgp.c8
-rw-r--r--src/mame/video/qix.c13
-rw-r--r--src/mame/video/quasar.c35
-rw-r--r--src/mame/video/quizdna.c21
-rw-r--r--src/mame/video/quizpani.c9
-rw-r--r--src/mame/video/raiden.c30
-rw-r--r--src/mame/video/rainbow.c13
-rw-r--r--src/mame/video/rallyx.c92
-rw-r--r--src/mame/video/rampart.c4
-rw-r--r--src/mame/video/realbrk.c19
-rw-r--r--src/mame/video/redalert.c24
-rw-r--r--src/mame/video/redclash.c25
-rw-r--r--src/mame/video/relief.c13
-rw-r--r--src/mame/video/renegade.c13
-rw-r--r--src/mame/video/retofinv.c21
-rw-r--r--src/mame/video/rltennis.c11
-rw-r--r--src/mame/video/rockrage.c12
-rw-r--r--src/mame/video/rocnrope.c15
-rw-r--r--src/mame/video/rohga.c18
-rw-r--r--src/mame/video/rollerg.c7
-rw-r--r--src/mame/video/rollrace.c24
-rw-r--r--src/mame/video/rpunch.c15
-rw-r--r--src/mame/video/runaway.c14
-rw-r--r--src/mame/video/rungun.c19
-rw-r--r--src/mame/video/sauro.c16
-rw-r--r--src/mame/video/sbasketb.c19
-rw-r--r--src/mame/video/sbugger.c17
-rw-r--r--src/mame/video/scotrsht.c17
-rw-r--r--src/mame/video/sderby.c13
-rw-r--r--src/mame/video/segag80r.c59
-rw-r--r--src/mame/video/segag80v.c11
-rw-r--r--src/mame/video/segas32.c8
-rw-r--r--src/mame/video/seibuspi.c82
-rw-r--r--src/mame/video/seicross.c15
-rw-r--r--src/mame/video/senjyo.c29
-rw-r--r--src/mame/video/seta.c161
-rw-r--r--src/mame/video/seta2.c33
-rw-r--r--src/mame/video/sf.c13
-rw-r--r--src/mame/video/shadfrce.c15
-rw-r--r--src/mame/video/shangha3.c15
-rw-r--r--src/mame/video/shangkid.c17
-rw-r--r--src/mame/video/shaolins.c17
-rw-r--r--src/mame/video/shisen.c5
-rw-r--r--src/mame/video/shootout.c17
-rw-r--r--src/mame/video/shuuz.c7
-rw-r--r--src/mame/video/sidearms.c23
-rw-r--r--src/mame/video/sidepckt.c27
-rw-r--r--src/mame/video/silkroad.c15
-rw-r--r--src/mame/video/simpl156.c19
-rw-r--r--src/mame/video/skullxbo.c11
-rw-r--r--src/mame/video/skydiver.c26
-rw-r--r--src/mame/video/skyfox.c8
-rw-r--r--src/mame/video/skykid.c27
-rw-r--r--src/mame/video/skyraid.c5
-rw-r--r--src/mame/video/slapfght.c16
-rw-r--r--src/mame/video/slapshot.c37
-rw-r--r--src/mame/video/snk.c211
-rw-r--r--src/mame/video/snk6502.c73
-rw-r--r--src/mame/video/snk68.c16
-rw-r--r--src/mame/video/snookr10.c26
-rw-r--r--src/mame/video/solomon.c9
-rw-r--r--src/mame/video/sonson.c19
-rw-r--r--src/mame/video/spacefb.c15
-rw-r--r--src/mame/video/spbactn.c7
-rw-r--r--src/mame/video/spdodgeb.c21
-rw-r--r--src/mame/video/speedatk.c12
-rw-r--r--src/mame/video/speedbal.c15
-rw-r--r--src/mame/video/speedspn.c7
-rw-r--r--src/mame/video/splash.c13
-rw-r--r--src/mame/video/sprcros2.c23
-rw-r--r--src/mame/video/sprint2.c49
-rw-r--r--src/mame/video/sprint4.c49
-rw-r--r--src/mame/video/sprint8.c31
-rw-r--r--src/mame/video/spy.c11
-rw-r--r--src/mame/video/srmp2.c20
-rw-r--r--src/mame/video/srumbler.c13
-rw-r--r--src/mame/video/sshangha.c6
-rw-r--r--src/mame/video/sslam.c26
-rw-r--r--src/mame/video/ssozumo.c15
-rw-r--r--src/mame/video/sspeedr.c5
-rw-r--r--src/mame/video/ssrj.c19
-rw-r--r--src/mame/video/ssv.c24
-rw-r--r--src/mame/video/st0016.c24
-rw-r--r--src/mame/video/stactics.c29
-rw-r--r--src/mame/video/stadhero.c7
-rw-r--r--src/mame/video/starcrus.c11
-rw-r--r--src/mame/video/starfire.c17
-rw-r--r--src/mame/video/starshp1.c21
-rw-r--r--src/mame/video/stfight.c27
-rw-r--r--src/mame/video/stlforce.c23
-rw-r--r--src/mame/video/strnskil.c17
-rw-r--r--src/mame/video/stvvdp2.c79
-rw-r--r--src/mame/video/suna16.c5
-rw-r--r--src/mame/video/suna8.c6
-rw-r--r--src/mame/video/superchs.c5
-rw-r--r--src/mame/video/superqix.c26
-rw-r--r--src/mame/video/suprloco.c17
-rw-r--r--src/mame/video/suprnova.c48
-rw-r--r--src/mame/video/suprridr.c17
-rw-r--r--src/mame/video/suprslam.c9
-rw-r--r--src/mame/video/system1.c8
-rw-r--r--src/mame/video/system16.c139
-rw-r--r--src/mame/video/tagteam.c15
-rw-r--r--src/mame/video/tail2nos.c13
-rw-r--r--src/mame/video/taito_b.c58
-rw-r--r--src/mame/video/taito_f2.c120
-rw-r--r--src/mame/video/taito_f3.c215
-rw-r--r--src/mame/video/taito_l.c21
-rw-r--r--src/mame/video/taito_z.c11
-rw-r--r--src/mame/video/taitoair.c13
-rw-r--r--src/mame/video/taitojc.c29
-rw-r--r--src/mame/video/taitosj.c23
-rw-r--r--src/mame/video/tank8.c33
-rw-r--r--src/mame/video/tankbatt.c17
-rw-r--r--src/mame/video/tankbust.c9
-rw-r--r--src/mame/video/taotaido.c13
-rw-r--r--src/mame/video/targeth.c9
-rw-r--r--src/mame/video/tatsumi.c54
-rw-r--r--src/mame/video/tbowl.c15
-rw-r--r--src/mame/video/tceptor.c68
-rw-r--r--src/mame/video/tecmo.c25
-rw-r--r--src/mame/video/tecmo16.c83
-rw-r--r--src/mame/video/tecmosys.c31
-rw-r--r--src/mame/video/tehkanwc.c9
-rw-r--r--src/mame/video/terracre.c27
-rw-r--r--src/mame/video/tetrisp2.c91
-rw-r--r--src/mame/video/thedeep.c19
-rw-r--r--src/mame/video/thepit.c33
-rw-r--r--src/mame/video/thief.c11
-rw-r--r--src/mame/video/thoop2.c13
-rw-r--r--src/mame/video/thunderj.c15
-rw-r--r--src/mame/video/thunderx.c13
-rw-r--r--src/mame/video/tiamc1.c42
-rw-r--r--src/mame/video/tigeroad.c13
-rw-r--r--src/mame/video/timelimt.c17
-rw-r--r--src/mame/video/timeplt.c18
-rw-r--r--src/mame/video/tmnt.c99
-rw-r--r--src/mame/video/tnzs.c8
-rw-r--r--src/mame/video/toaplan1.c64
-rw-r--r--src/mame/video/toaplan2.c100
-rw-r--r--src/mame/video/toki.c15
-rw-r--r--src/mame/video/toobin.c15
-rw-r--r--src/mame/video/toypop.c25
-rw-r--r--src/mame/video/tp84.c17
-rw-r--r--src/mame/video/trackfld.c28
-rw-r--r--src/mame/video/travrusa.c41
-rw-r--r--src/mame/video/triplhnt.c7
-rw-r--r--src/mame/video/truco.c6
-rw-r--r--src/mame/video/trucocl.c11
-rw-r--r--src/mame/video/tryout.c23
-rw-r--r--src/mame/video/tsamurai.c16
-rw-r--r--src/mame/video/tubep.c115
-rw-r--r--src/mame/video/tumbleb.c73
-rw-r--r--src/mame/video/tunhunt.c37
-rw-r--r--src/mame/video/turbo.c26
-rw-r--r--src/mame/video/twin16.c33
-rw-r--r--src/mame/video/twincobr.c69
-rw-r--r--src/mame/video/tx1.c53
-rw-r--r--src/mame/video/ultraman.c11
-rw-r--r--src/mame/video/ultratnk.c47
-rw-r--r--src/mame/video/undrfire.c7
-rw-r--r--src/mame/video/unico.c74
-rw-r--r--src/mame/video/usgames.c11
-rw-r--r--src/mame/video/vastar.c19
-rw-r--r--src/mame/video/vball.c13
-rw-r--r--src/mame/video/vectrex.c50
-rw-r--r--src/mame/video/victory.c29
-rw-r--r--src/mame/video/videopin.c5
-rw-r--r--src/mame/video/vigilant.c22
-rw-r--r--src/mame/video/vindictr.c17
-rw-r--r--src/mame/video/volfied.c15
-rw-r--r--src/mame/video/vsnes.c20
-rw-r--r--src/mame/video/vulgus.c35
-rw-r--r--src/mame/video/warpwarp.c53
-rw-r--r--src/mame/video/warriorb.c5
-rw-r--r--src/mame/video/wc90.c26
-rw-r--r--src/mame/video/wc90b.c13
-rw-r--r--src/mame/video/wecleman.c88
-rw-r--r--src/mame/video/welltris.c7
-rw-r--r--src/mame/video/wgp.c8
-rw-r--r--src/mame/video/williams.c31
-rw-r--r--src/mame/video/wiping.c12
-rw-r--r--src/mame/video/wiz.c37
-rw-r--r--src/mame/video/wolfpack.c51
-rw-r--r--src/mame/video/wrally.c11
-rw-r--r--src/mame/video/wwfsstar.c11
-rw-r--r--src/mame/video/wwfwfest.c38
-rw-r--r--src/mame/video/xain.c15
-rw-r--r--src/mame/video/xevious.c57
-rw-r--r--src/mame/video/xexex.c15
-rw-r--r--src/mame/video/xmen.c13
-rw-r--r--src/mame/video/xorworld.c29
-rw-r--r--src/mame/video/xxmissio.c15
-rw-r--r--src/mame/video/xybots.c11
-rw-r--r--src/mame/video/xyonix.c13
-rw-r--r--src/mame/video/yiear.c13
-rw-r--r--src/mame/video/yunsun16.c19
-rw-r--r--src/mame/video/yunsung8.c9
-rw-r--r--src/mame/video/zac2650.c13
-rw-r--r--src/mame/video/zaccaria.c21
-rw-r--r--src/mame/video/zaxxon.c34
-rw-r--r--src/mame/video/zodiack.c20
597 files changed, 8860 insertions, 9774 deletions
diff --git a/src/mame/video/1942.c b/src/mame/video/1942.c
index 6b50f25c260..4d7050d11c9 100644
--- a/src/mame/video/1942.c
+++ b/src/mame/video/1942.c
@@ -24,9 +24,9 @@
***************************************************************************/
-PALETTE_INIT( 1942 )
+void _1942_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t palette[256];
int i, colorbase;
@@ -63,23 +63,23 @@ PALETTE_INIT( 1942 )
/* characters use palette entries 128-143 */
colorbase = 0;
for (i = 0; i < 64 * 4; i++)
- palette_set_color(machine, colorbase + i, palette[0x80 | *color_prom++]);
+ palette_set_color(machine(), colorbase + i, palette[0x80 | *color_prom++]);
colorbase += 64 * 4;
/* background tiles use palette entries 0-63 in four banks */
for (i = 0; i < 32 * 8; i++)
{
- palette_set_color(machine, colorbase + 0 * 32 * 8 + i, palette[0x00 | *color_prom]);
- palette_set_color(machine, colorbase + 1 * 32 * 8 + i, palette[0x10 | *color_prom]);
- palette_set_color(machine, colorbase + 2 * 32 * 8 + i, palette[0x20 | *color_prom]);
- palette_set_color(machine, colorbase + 3 * 32 * 8 + i, palette[0x30 | *color_prom]);
+ palette_set_color(machine(), colorbase + 0 * 32 * 8 + i, palette[0x00 | *color_prom]);
+ palette_set_color(machine(), colorbase + 1 * 32 * 8 + i, palette[0x10 | *color_prom]);
+ palette_set_color(machine(), colorbase + 2 * 32 * 8 + i, palette[0x20 | *color_prom]);
+ palette_set_color(machine(), colorbase + 3 * 32 * 8 + i, palette[0x30 | *color_prom]);
color_prom++;
}
colorbase += 4 * 32 * 8;
/* sprites use palette entries 64-79 */
for (i = 0; i < 16 * 16; i++)
- palette_set_color(machine, colorbase + i, palette[0x40 | *color_prom++]);
+ palette_set_color(machine(), colorbase + i, palette[0x40 | *color_prom++]);
}
@@ -123,13 +123,12 @@ TILE_GET_INFO_MEMBER(_1942_state::get_bg_tile_info)
Start the video hardware emulation.
***************************************************************************/
-VIDEO_START( 1942 )
+void _1942_state::video_start()
{
- _1942_state *state = machine.driver_data<_1942_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(_1942_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(_1942_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 32, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(_1942_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(_1942_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 16);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/1943.c b/src/mame/video/1943.c
index c7bb56318fb..118fc4105b8 100644
--- a/src/mame/video/1943.c
+++ b/src/mame/video/1943.c
@@ -45,13 +45,13 @@ other 2 bits (output & 0x0c) unknown
***************************************************************************/
-PALETTE_INIT( 1943 )
+void _1943_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
for (i = 0; i < 0x100; i++)
{
@@ -79,7 +79,7 @@ PALETTE_INIT( 1943 )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -89,7 +89,7 @@ PALETTE_INIT( 1943 )
for (i = 0x00; i < 0x80; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x40;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* foreground tiles use colors 0x00-0x3f */
@@ -97,7 +97,7 @@ PALETTE_INIT( 1943 )
{
UINT8 ctabentry = ((color_prom[0x200 + (i - 0x080)] & 0x03) << 4) |
((color_prom[0x100 + (i - 0x080)] & 0x0f) << 0);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* background tiles also use colors 0x00-0x3f */
@@ -105,7 +105,7 @@ PALETTE_INIT( 1943 )
{
UINT8 ctabentry = ((color_prom[0x400 + (i - 0x180)] & 0x03) << 4) |
((color_prom[0x300 + (i - 0x180)] & 0x0f) << 0);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites use colors 0x80-0xff
@@ -115,7 +115,7 @@ PALETTE_INIT( 1943 )
{
UINT8 ctabentry = ((color_prom[0x600 + (i - 0x280)] & 0x07) << 4) |
((color_prom[0x500 + (i - 0x280)] & 0x0f) << 0) | 0x80;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -201,20 +201,19 @@ TILE_GET_INFO_MEMBER(_1943_state::c1943_get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( 1943 )
+void _1943_state::video_start()
{
- _1943_state *state = machine.driver_data<_1943_state>();
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(_1943_state::c1943_get_bg2_tile_info),state), TILEMAP_SCAN_COLS, 32, 32, 2048, 8);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(_1943_state::c1943_get_bg_tile_info),state), TILEMAP_SCAN_COLS, 32, 32, 2048, 8);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(_1943_state::c1943_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(_1943_state::c1943_get_bg2_tile_info),this), TILEMAP_SCAN_COLS, 32, 32, 2048, 8);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(_1943_state::c1943_get_bg_tile_info),this), TILEMAP_SCAN_COLS, 32, 32, 2048, 8);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(_1943_state::c1943_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- colortable_configure_tilemap_groups(machine.colortable, state->m_bg_tilemap, machine.gfx[1], 0x0f);
- state->m_fg_tilemap->set_transparent_pen(0);
+ colortable_configure_tilemap_groups(machine().colortable, m_bg_tilemap, machine().gfx[1], 0x0f);
+ m_fg_tilemap->set_transparent_pen(0);
- state->save_item(NAME(state->m_char_on));
- state->save_item(NAME(state->m_obj_on));
- state->save_item(NAME(state->m_bg1_on));
- state->save_item(NAME(state->m_bg2_on));
+ save_item(NAME(m_char_on));
+ save_item(NAME(m_obj_on));
+ save_item(NAME(m_bg1_on));
+ save_item(NAME(m_bg2_on));
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority )
diff --git a/src/mame/video/40love.c b/src/mame/video/40love.c
index 4eec233253e..913392d3747 100644
--- a/src/mame/video/40love.c
+++ b/src/mame/video/40love.c
@@ -10,12 +10,12 @@
* color prom decoding
*/
-PALETTE_INIT( fortyl )
+void fortyl_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, bit3, r, g, b;
@@ -27,20 +27,20 @@ PALETTE_INIT( fortyl )
r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* green component */
- bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine().total_colors()] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[2*machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[2*machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[2*machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[2*machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
color_prom++;
}
@@ -100,30 +100,29 @@ static void redraw_pixels(running_machine &machine)
***************************************************************************/
-VIDEO_START( fortyl )
+void fortyl_state::video_start()
{
- fortyl_state *state = machine.driver_data<fortyl_state>();
- state->m_pixram1 = auto_alloc_array_clear(machine, UINT8, 0x4000);
- state->m_pixram2 = auto_alloc_array_clear(machine, UINT8, 0x4000);
+ m_pixram1 = auto_alloc_array_clear(machine(), UINT8, 0x4000);
+ m_pixram2 = auto_alloc_array_clear(machine(), UINT8, 0x4000);
- state->m_tmp_bitmap1 = auto_bitmap_ind16_alloc(machine, 256, 256);
- state->m_tmp_bitmap2 = auto_bitmap_ind16_alloc(machine, 256, 256);
+ m_tmp_bitmap1 = auto_bitmap_ind16_alloc(machine(), 256, 256);
+ m_tmp_bitmap2 = auto_bitmap_ind16_alloc(machine(), 256, 256);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fortyl_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fortyl_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_xoffset = 128; // this never changes
+ m_xoffset = 128; // this never changes
- state->m_bg_tilemap->set_scroll_rows(32);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap->set_transparent_pen(0);
- state->save_item(NAME(state->m_flipscreen));
- state->save_item(NAME(state->m_pix_color));
- state->save_pointer(NAME(state->m_pixram1), 0x4000);
- state->save_pointer(NAME(state->m_pixram2), 0x4000);
- state->save_item(NAME(*state->m_tmp_bitmap1));
- state->save_item(NAME(*state->m_tmp_bitmap2));
- state->save_item(NAME(state->m_pixram_sel));
- machine.save().register_postload(save_prepost_delegate(FUNC(redraw_pixels), &machine));
+ save_item(NAME(m_flipscreen));
+ save_item(NAME(m_pix_color));
+ save_pointer(NAME(m_pixram1), 0x4000);
+ save_pointer(NAME(m_pixram2), 0x4000);
+ save_item(NAME(*m_tmp_bitmap1));
+ save_item(NAME(*m_tmp_bitmap2));
+ save_item(NAME(m_pixram_sel));
+ machine().save().register_postload(save_prepost_delegate(FUNC(redraw_pixels), &machine()));
}
diff --git a/src/mame/video/4enraya.c b/src/mame/video/4enraya.c
index 595df668aef..c78e358b943 100644
--- a/src/mame/video/4enraya.c
+++ b/src/mame/video/4enraya.c
@@ -28,11 +28,10 @@ TILE_GET_INFO_MEMBER(_4enraya_state::get_tile_info)
0);
}
-VIDEO_START( 4enraya )
+void _4enraya_state::video_start()
{
- _4enraya_state *state = machine.driver_data<_4enraya_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(_4enraya_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(_4enraya_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
SCREEN_UPDATE_IND16( 4enraya )
diff --git a/src/mame/video/8080bw.c b/src/mame/video/8080bw.c
index 3d3bd26022b..f9aa9bffc8b 100644
--- a/src/mame/video/8080bw.c
+++ b/src/mame/video/8080bw.c
@@ -13,18 +13,17 @@
#define NUM_PENS (8)
-MACHINE_START( extra_8080bw_vh )
+MACHINE_START_MEMBER(_8080bw_state,extra_8080bw_vh)
{
- _8080bw_state *state = machine.driver_data<_8080bw_state>();
- state->save_item(NAME(state->m_c8080bw_flip_screen));
- state->save_item(NAME(state->m_color_map));
- state->save_item(NAME(state->m_screen_red));
+ save_item(NAME(m_c8080bw_flip_screen));
+ save_item(NAME(m_color_map));
+ save_item(NAME(m_screen_red));
// These two only belong to schaser, but for simplicity's sake let's waste
// two bytes in other drivers' .sta files.
- state->save_item(NAME(state->m_schaser_background_disable));
- state->save_item(NAME(state->m_schaser_background_select));
+ save_item(NAME(m_schaser_background_disable));
+ save_item(NAME(m_schaser_background_select));
}
diff --git a/src/mame/video/actfancr.c b/src/mame/video/actfancr.c
index d11a0c18cc4..3466714fc89 100644
--- a/src/mame/video/actfancr.c
+++ b/src/mame/video/actfancr.c
@@ -17,9 +17,9 @@ static void register_savestate( running_machine &machine )
state->save_item(NAME(state->m_flipscreen));
}
-VIDEO_START( actfancr )
+void actfancr_state::video_start()
{
- register_savestate(machine);
+ register_savestate(machine());
}
/******************************************************************************/
diff --git a/src/mame/video/aeroboto.c b/src/mame/video/aeroboto.c
index 354b3bb329e..1b02afe2604 100644
--- a/src/mame/video/aeroboto.c
+++ b/src/mame/video/aeroboto.c
@@ -39,33 +39,32 @@ TILE_GET_INFO_MEMBER(aeroboto_state::get_tile_info)
***************************************************************************/
-VIDEO_START( aeroboto )
+void aeroboto_state::video_start()
{
- aeroboto_state *state = machine.driver_data<aeroboto_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aeroboto_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 64);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scroll_rows(64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aeroboto_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 64);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scroll_rows(64);
- state->save_item(NAME(state->m_charbank));
- state->save_item(NAME(state->m_starsoff));
- state->save_item(NAME(state->m_sx));
- state->save_item(NAME(state->m_sy));
- state->save_item(NAME(state->m_ox));
- state->save_item(NAME(state->m_oy));
+ save_item(NAME(m_charbank));
+ save_item(NAME(m_starsoff));
+ save_item(NAME(m_sx));
+ save_item(NAME(m_sy));
+ save_item(NAME(m_ox));
+ save_item(NAME(m_oy));
#if STARS_LAYOUT
{
UINT8 *temp;
int i;
- temp = auto_alloc_array(machine, UINT8, state->m_stars_length);
- memcpy(temp, state->m_stars_rom, state->m_stars_length);
+ temp = auto_alloc_array(machine(), UINT8, m_stars_length);
+ memcpy(temp, m_stars_rom, m_stars_length);
- for (i = 0; i < state->m_stars_length; i++)
- state->m_stars_rom[(i & ~0xff) + (i << 5 & 0xe0) + (i >> 3 & 0x1f)] = temp[i];
+ for (i = 0; i < m_stars_length; i++)
+ m_stars_rom[(i & ~0xff) + (i << 5 & 0xe0) + (i >> 3 & 0x1f)] = temp[i];
- auto_free(machine, temp);
+ auto_free(machine(), temp);
}
#endif
}
diff --git a/src/mame/video/aerofgt.c b/src/mame/video/aerofgt.c
index 3c96c84d30f..a5ea1e27dc1 100644
--- a/src/mame/video/aerofgt.c
+++ b/src/mame/video/aerofgt.c
@@ -91,88 +91,83 @@ static void aerofgt_register_state_globals( running_machine &machine )
state->save_item(NAME(state->m_spritepalettebank));
}
-VIDEO_START( pspikes )
+VIDEO_START_MEMBER(aerofgt_state,pspikes)
{
- aerofgt_state *state = machine.driver_data<aerofgt_state>();
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_pspikes_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_pspikes_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
/* no bg2 in this game */
- state->m_sprite_gfx = 1;
+ m_sprite_gfx = 1;
- aerofgt_register_state_globals(machine);
- state->save_item(NAME(state->m_spikes91_lookup));
+ aerofgt_register_state_globals(machine());
+ save_item(NAME(m_spikes91_lookup));
}
-VIDEO_START( karatblz )
+VIDEO_START_MEMBER(aerofgt_state,karatblz)
{
- aerofgt_state *state = machine.driver_data<aerofgt_state>();
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::karatblz_bg1_tile_info),state),TILEMAP_SCAN_ROWS, 8,8,64,64);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::karatblz_bg2_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::karatblz_bg1_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,64,64);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::karatblz_bg2_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_bg2_tilemap->set_transparent_pen(15);
- state->m_spritepalettebank = 0;
- state->m_sprite_gfx = 2;
+ m_bg2_tilemap->set_transparent_pen(15);
+ m_spritepalettebank = 0;
+ m_sprite_gfx = 2;
- aerofgt_register_state_globals(machine);
+ aerofgt_register_state_globals(machine());
}
-VIDEO_START( spinlbrk )
+VIDEO_START_MEMBER(aerofgt_state,spinlbrk)
{
- aerofgt_state *state = machine.driver_data<aerofgt_state>();
int i;
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::spinlbrk_bg1_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::karatblz_bg2_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::spinlbrk_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::karatblz_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_bg2_tilemap->set_transparent_pen(15);
+ m_bg2_tilemap->set_transparent_pen(15);
- state->m_spritepalettebank = 0;
- state->m_sprite_gfx = 2;
+ m_spritepalettebank = 0;
+ m_sprite_gfx = 2;
/* sprite maps are hardcoded in this game */
/* enemy sprites use ROM instead of RAM */
- state->m_spriteram2.set_target(reinterpret_cast<UINT16 *>(state->memregion("gfx5")->base()), 0x20000);
+ m_spriteram2.set_target(reinterpret_cast<UINT16 *>(memregion("gfx5")->base()), 0x20000);
/* front sprites are direct maps */
- state->m_spriteram1.set_target(state->m_spriteram2 + state->m_spriteram2.bytes() / 2, 0x4000);
+ m_spriteram1.set_target(m_spriteram2 + m_spriteram2.bytes() / 2, 0x4000);
- for (i = 0; i < state->m_spriteram1.bytes() / 2; i++)
+ for (i = 0; i < m_spriteram1.bytes() / 2; i++)
{
- state->m_spriteram1[i] = i;
+ m_spriteram1[i] = i;
}
- aerofgt_register_state_globals(machine);
+ aerofgt_register_state_globals(machine());
}
-VIDEO_START( turbofrc )
+VIDEO_START_MEMBER(aerofgt_state,turbofrc)
{
- aerofgt_state *state = machine.driver_data<aerofgt_state>();
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_bg1_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_bg2_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_bg2_tilemap->set_transparent_pen(15);
+ m_bg2_tilemap->set_transparent_pen(15);
- state->m_spritepalettebank = 0;
- state->m_sprite_gfx = 2;
+ m_spritepalettebank = 0;
+ m_sprite_gfx = 2;
- aerofgt_register_state_globals(machine);
+ aerofgt_register_state_globals(machine());
}
-VIDEO_START( wbbc97 )
+VIDEO_START_MEMBER(aerofgt_state,wbbc97)
{
- aerofgt_state *state = machine.driver_data<aerofgt_state>();
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_pspikes_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_pspikes_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
/* no bg2 in this game */
- state->m_bg1_tilemap->set_transparent_pen(15);
+ m_bg1_tilemap->set_transparent_pen(15);
- state->m_sprite_gfx = 1;
+ m_sprite_gfx = 1;
- aerofgt_register_state_globals(machine);
+ aerofgt_register_state_globals(machine());
- state->save_item(NAME(state->m_wbbc97_bitmap_enable));
+ save_item(NAME(m_wbbc97_bitmap_enable));
}
/***************************************************************************
diff --git a/src/mame/video/airbustr.c b/src/mame/video/airbustr.c
index 67d5ca76a18..116b4fd65be 100644
--- a/src/mame/video/airbustr.c
+++ b/src/mame/video/airbustr.c
@@ -107,22 +107,21 @@ TILE_GET_INFO_MEMBER(airbustr_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( airbustr )
+void airbustr_state::video_start()
{
- airbustr_state *state = machine.driver_data<airbustr_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(airbustr_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(airbustr_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(airbustr_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(airbustr_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- machine.primary_screen->register_screen_bitmap(state->m_sprites_bitmap);
- state->m_fg_tilemap->set_transparent_pen(0);
+ machine().primary_screen->register_screen_bitmap(m_sprites_bitmap);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(0x094, 0x06a);
- state->m_bg_tilemap->set_scrolldy(0x100, 0x1ff);
- state->m_fg_tilemap->set_scrolldx(0x094, 0x06a);
- state->m_fg_tilemap->set_scrolldy(0x100, 0x1ff);
+ m_bg_tilemap->set_scrolldx(0x094, 0x06a);
+ m_bg_tilemap->set_scrolldy(0x100, 0x1ff);
+ m_fg_tilemap->set_scrolldx(0x094, 0x06a);
+ m_fg_tilemap->set_scrolldy(0x100, 0x1ff);
- state->save_item(NAME(state->m_sprites_bitmap));
+ save_item(NAME(m_sprites_bitmap));
}
diff --git a/src/mame/video/ajax.c b/src/mame/video/ajax.c
index a10680ed56e..f2d74fa537d 100644
--- a/src/mame/video/ajax.c
+++ b/src/mame/video/ajax.c
@@ -68,15 +68,14 @@ void ajax_zoom_callback( running_machine &machine, int *code, int *color, int *f
***************************************************************************/
-VIDEO_START( ajax )
+void ajax_state::video_start()
{
- ajax_state *state = machine.driver_data<ajax_state>();
- state->m_layer_colorbase[0] = 64;
- state->m_layer_colorbase[1] = 0;
- state->m_layer_colorbase[2] = 32;
- state->m_sprite_colorbase = 16;
- state->m_zoom_colorbase = 6; /* == 48 since it's 7-bit graphics */
+ m_layer_colorbase[0] = 64;
+ m_layer_colorbase[1] = 0;
+ m_layer_colorbase[2] = 32;
+ m_sprite_colorbase = 16;
+ m_zoom_colorbase = 6; /* == 48 since it's 7-bit graphics */
}
diff --git a/src/mame/video/aliens.c b/src/mame/video/aliens.c
index 10eb9fa49af..def90c14f77 100644
--- a/src/mame/video/aliens.c
+++ b/src/mame/video/aliens.c
@@ -53,16 +53,15 @@ void aliens_sprite_callback( running_machine &machine, int *code, int *color, in
***************************************************************************/
-VIDEO_START( aliens )
+void aliens_state::video_start()
{
- aliens_state *state = machine.driver_data<aliens_state>();
- state->m_generic_paletteram_8.allocate(0x400);
+ m_generic_paletteram_8.allocate(0x400);
- state->m_layer_colorbase[0] = 0;
- state->m_layer_colorbase[1] = 4;
- state->m_layer_colorbase[2] = 8;
- state->m_sprite_colorbase = 16;
+ m_layer_colorbase[0] = 0;
+ m_layer_colorbase[1] = 4;
+ m_layer_colorbase[2] = 8;
+ m_sprite_colorbase = 16;
}
diff --git a/src/mame/video/alpha68k.c b/src/mame/video/alpha68k.c
index 9dfed5bfdb7..28879d48336 100644
--- a/src/mame/video/alpha68k.c
+++ b/src/mame/video/alpha68k.c
@@ -61,12 +61,11 @@ WRITE16_MEMBER(alpha68k_state::alpha68k_videoram_w)
m_fix_tilemap->mark_tile_dirty(offset / 2);
}
-VIDEO_START( alpha68k )
+VIDEO_START_MEMBER(alpha68k_state,alpha68k)
{
- alpha68k_state *state = machine.driver_data<alpha68k_state>();
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(alpha68k_state::get_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(alpha68k_state::get_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_fix_tilemap->set_transparent_pen(0);
}
/******************************************************************************/
@@ -380,13 +379,13 @@ SCREEN_UPDATE_IND16( alpha68k_I )
//ZT
/******************************************************************************/
-PALETTE_INIT( kyros )
+PALETTE_INIT_MEMBER(alpha68k_state,kyros)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -395,7 +394,7 @@ PALETTE_INIT( kyros )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -404,17 +403,17 @@ PALETTE_INIT( kyros )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = ((color_prom[i] & 0x0f) << 4) | (color_prom[i + 0x100] & 0x0f);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
-PALETTE_INIT( paddlem )
+PALETTE_INIT_MEMBER(alpha68k_state,paddlem)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -423,7 +422,7 @@ PALETTE_INIT( paddlem )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -432,7 +431,7 @@ PALETTE_INIT( paddlem )
for (i = 0; i < 0x400; i++)
{
UINT8 ctabentry = ((color_prom[i + 0x400] & 0x0f) << 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
diff --git a/src/mame/video/ambush.c b/src/mame/video/ambush.c
index 1bcc5516c3b..28ff04e58a6 100644
--- a/src/mame/video/ambush.c
+++ b/src/mame/video/ambush.c
@@ -18,12 +18,12 @@
***************************************************************************/
-PALETTE_INIT( ambush )
+void ambush_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -43,7 +43,7 @@ PALETTE_INIT( ambush )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
}
diff --git a/src/mame/video/amiga.c b/src/mame/video/amiga.c
index d0daa916a42..307d666043d 100644
--- a/src/mame/video/amiga.c
+++ b/src/mame/video/amiga.c
@@ -94,12 +94,12 @@ const UINT16 delay[256] =
*
*************************************/
-PALETTE_INIT( amiga )
+PALETTE_INIT_MEMBER(amiga_state,amiga)
{
int i;
for (i = 0; i < 0x1000; i++)
- palette_set_color_rgb(machine, i, pal4bit(i >> 8), pal4bit(i >> 4), pal4bit(i));
+ palette_set_color_rgb(machine(), i, pal4bit(i >> 8), pal4bit(i >> 4), pal4bit(i));
}
@@ -110,9 +110,8 @@ PALETTE_INIT( amiga )
*
*************************************/
-VIDEO_START( amiga )
+VIDEO_START_MEMBER(amiga_state,amiga)
{
- amiga_state *state = machine.driver_data<amiga_state>();
int j;
/* generate tables that produce the correct playfield color for dual playfield mode */
@@ -121,18 +120,18 @@ VIDEO_START( amiga )
int pf1pix = ((j >> 0) & 1) | ((j >> 1) & 2) | ((j >> 2) & 4);
int pf2pix = ((j >> 1) & 1) | ((j >> 2) & 2) | ((j >> 3) & 4);
- state->m_separate_bitplanes[0][j] = (pf1pix || !pf2pix) ? pf1pix : (pf2pix + 8);
- state->m_separate_bitplanes[1][j] = pf2pix ? (pf2pix + 8) : pf1pix;
+ m_separate_bitplanes[0][j] = (pf1pix || !pf2pix) ? pf1pix : (pf2pix + 8);
+ m_separate_bitplanes[1][j] = pf2pix ? (pf2pix + 8) : pf1pix;
}
#if GUESS_COPPER_OFFSET
- state->m_wait_offset = 3;
+ m_wait_offset = 3;
#endif
/* reset the genlock color */
- state->m_genlock_color = 0xffff;
+ m_genlock_color = 0xffff;
- state->m_sprite_ctl_written = 0;
+ m_sprite_ctl_written = 0;
}
diff --git a/src/mame/video/amigaaga.c b/src/mame/video/amigaaga.c
index e37eaf65b5a..d182c062754 100644
--- a/src/mame/video/amigaaga.c
+++ b/src/mame/video/amigaaga.c
@@ -71,13 +71,12 @@ void amiga_aga_palette_write(running_machine &machine, int color_reg, UINT16 dat
*
*************************************/
-VIDEO_START( amiga_aga )
+VIDEO_START_MEMBER(amiga_state,amiga_aga)
{
- amiga_state *state = machine.driver_data<amiga_state>();
- VIDEO_START_CALL( amiga );
+ VIDEO_START_CALL_MEMBER( amiga );
- state->m_aga_diwhigh_written = 0;
+ m_aga_diwhigh_written = 0;
}
diff --git a/src/mame/video/ampoker2.c b/src/mame/video/ampoker2.c
index a2124b0e1de..15cddae7817 100644
--- a/src/mame/video/ampoker2.c
+++ b/src/mame/video/ampoker2.c
@@ -71,9 +71,9 @@
#include "includes/ampoker2.h"
-PALETTE_INIT( ampoker2 )
+void ampoker2_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
/* - bits -
76543210
RRRGGGBB
@@ -89,7 +89,7 @@ PALETTE_INIT( ampoker2 )
2, resistances_b, weights_b, 0, 0);
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -108,7 +108,7 @@ PALETTE_INIT( ampoker2 )
bit2 = (color_prom[i] >> 7) & 0x01;
r = combine_3_weights(weights_r, bit0, bit1, bit2);
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -145,17 +145,15 @@ TILE_GET_INFO_MEMBER(ampoker2_state::s2k_get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START(ampoker2)
+void ampoker2_state::video_start()
{
- ampoker2_state *state = machine.driver_data<ampoker2_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ampoker2_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ampoker2_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 64, 32);
}
-VIDEO_START(sigma2k)
+VIDEO_START_MEMBER(ampoker2_state,sigma2k)
{
- ampoker2_state *state = machine.driver_data<ampoker2_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ampoker2_state::s2k_get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ampoker2_state::s2k_get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 64, 32);
}
diff --git a/src/mame/video/amspdwy.c b/src/mame/video/amspdwy.c
index 87c6da4370a..d7d6f0a8ef3 100644
--- a/src/mame/video/amspdwy.c
+++ b/src/mame/video/amspdwy.c
@@ -73,10 +73,9 @@ TILEMAP_MAPPER_MEMBER(amspdwy_state::tilemap_scan_cols_back)
}
-VIDEO_START( amspdwy )
+void amspdwy_state::video_start()
{
- amspdwy_state *state = machine.driver_data<amspdwy_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(amspdwy_state::get_tile_info),state), tilemap_mapper_delegate(FUNC(amspdwy_state::tilemap_scan_cols_back),state), 8, 8, 0x20, 0x20);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(amspdwy_state::get_tile_info),this), tilemap_mapper_delegate(FUNC(amspdwy_state::tilemap_scan_cols_back),this), 8, 8, 0x20, 0x20);
}
diff --git a/src/mame/video/angelkds.c b/src/mame/video/angelkds.c
index 2615e4ddaa6..991f3f973b3 100644
--- a/src/mame/video/angelkds.c
+++ b/src/mame/video/angelkds.c
@@ -243,18 +243,17 @@ WRITE8_MEMBER(angelkds_state::angelkds_paletteram_w)
*/
-VIDEO_START( angelkds )
+void angelkds_state::video_start()
{
- angelkds_state *state = machine.driver_data<angelkds_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(angelkds_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(angelkds_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_tx_tilemap->set_transparent_pen(0);
- state->m_bgbot_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(angelkds_state::get_bgbot_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bgbot_tilemap->set_transparent_pen(15);
+ m_bgbot_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(angelkds_state::get_bgbot_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bgbot_tilemap->set_transparent_pen(15);
- state->m_bgtop_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(angelkds_state::get_bgtop_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bgtop_tilemap->set_transparent_pen(15);
+ m_bgtop_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(angelkds_state::get_bgtop_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bgtop_tilemap->set_transparent_pen(15);
}
/* enable bits are uncertain */
diff --git a/src/mame/video/appoooh.c b/src/mame/video/appoooh.c
index 39a237ecf49..42375076720 100644
--- a/src/mame/video/appoooh.c
+++ b/src/mame/video/appoooh.c
@@ -20,12 +20,12 @@
***************************************************************************/
-PALETTE_INIT( appoooh )
+PALETTE_INIT_MEMBER(appoooh_state,appoooh)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
UINT8 pen;
int bit0, bit1, bit2, r, g, b;
@@ -55,16 +55,16 @@ PALETTE_INIT( appoooh )
bit2 = (color_prom[pen] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
-PALETTE_INIT( robowres )
+PALETTE_INIT_MEMBER(appoooh_state,robowres)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -88,7 +88,7 @@ PALETTE_INIT( robowres )
bit2 = (color_prom[pen] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -130,19 +130,18 @@ TILE_GET_INFO_MEMBER(appoooh_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( appoooh )
+VIDEO_START_MEMBER(appoooh_state,appoooh)
{
- appoooh_state *state = machine.driver_data<appoooh_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(appoooh_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(appoooh_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(appoooh_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(appoooh_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scrolldy(8, 8);
- state->m_bg_tilemap->set_scrolldy(8, 8);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_scrolldy(8, 8);
+ m_bg_tilemap->set_scrolldy(8, 8);
- state->save_item(NAME(state->m_scroll_x));
- state->save_item(NAME(state->m_priority));
+ save_item(NAME(m_scroll_x));
+ save_item(NAME(m_priority));
}
WRITE8_MEMBER(appoooh_state::appoooh_scroll_w)
diff --git a/src/mame/video/aquarium.c b/src/mame/video/aquarium.c
index 2d280ed14bc..5b4472ccae8 100644
--- a/src/mame/video/aquarium.c
+++ b/src/mame/video/aquarium.c
@@ -141,15 +141,14 @@ WRITE16_MEMBER(aquarium_state::aquarium_bak_videoram_w)
m_bak_tilemap->mark_tile_dirty(offset / 2);
}
-VIDEO_START(aquarium)
+void aquarium_state::video_start()
{
- aquarium_state *state = machine.driver_data<aquarium_state>();
- state->m_txt_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aquarium_state::get_aquarium_txt_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_bak_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aquarium_state::get_aquarium_bak_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_mid_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aquarium_state::get_aquarium_mid_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_txt_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aquarium_state::get_aquarium_txt_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_bak_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aquarium_state::get_aquarium_bak_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_mid_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aquarium_state::get_aquarium_mid_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_txt_tilemap->set_transparent_pen(0);
- state->m_mid_tilemap->set_transparent_pen(0);
+ m_txt_tilemap->set_transparent_pen(0);
+ m_mid_tilemap->set_transparent_pen(0);
}
SCREEN_UPDATE_IND16(aquarium)
diff --git a/src/mame/video/arabian.c b/src/mame/video/arabian.c
index 47a6759cec1..cca5fff558c 100644
--- a/src/mame/video/arabian.c
+++ b/src/mame/video/arabian.c
@@ -20,7 +20,7 @@
*
*************************************/
-PALETTE_INIT( arabian )
+void arabian_state::palette_init()
{
int i;
@@ -139,7 +139,7 @@ PALETTE_INIT( arabian )
b = (bhi * 192) + (bbase * 63);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -151,19 +151,18 @@ PALETTE_INIT( arabian )
*
*************************************/
-VIDEO_START( arabian )
+void arabian_state::video_start()
{
- arabian_state *state = machine.driver_data<arabian_state>();
- UINT8 *gfxbase = state->memregion("gfx1")->base();
+ UINT8 *gfxbase = memregion("gfx1")->base();
int offs;
/* allocate a common bitmap to use for both planes */
/* plane A (top plane with motion objects) is in the upper 4 bits */
/* plane B (bottom plane with playfield) is in the lower 4 bits */
- state->m_main_bitmap = auto_alloc_array(machine, UINT8, BITMAP_WIDTH * BITMAP_HEIGHT);
+ m_main_bitmap = auto_alloc_array(machine(), UINT8, BITMAP_WIDTH * BITMAP_HEIGHT);
/* allocate memory for the converted graphics data */
- state->m_converted_gfx = auto_alloc_array(machine, UINT8, 0x8000 * 2);
+ m_converted_gfx = auto_alloc_array(machine(), UINT8, 0x8000 * 2);
/*--------------------------------------------------
transform graphics data into more usable format
@@ -200,16 +199,16 @@ VIDEO_START( arabian )
v2 >>= 1;
p4 = (v1 & 0x01) | ((v1 & 0x10) >> 3) | ((v2 & 0x01) << 2) | ((v2 & 0x10) >> 1);
- state->m_converted_gfx[offs * 4 + 3] = p1;
- state->m_converted_gfx[offs * 4 + 2] = p2;
- state->m_converted_gfx[offs * 4 + 1] = p3;
- state->m_converted_gfx[offs * 4 + 0] = p4;
+ m_converted_gfx[offs * 4 + 3] = p1;
+ m_converted_gfx[offs * 4 + 2] = p2;
+ m_converted_gfx[offs * 4 + 1] = p3;
+ m_converted_gfx[offs * 4 + 0] = p4;
}
- state->save_pointer(NAME(state->m_main_bitmap), BITMAP_WIDTH * BITMAP_HEIGHT);
- state->save_pointer(NAME(state->m_converted_gfx), 0x8000 * 2);
- state->save_item(NAME(state->m_video_control));
- state->save_item(NAME(state->m_flip_screen));
+ save_pointer(NAME(m_main_bitmap), BITMAP_WIDTH * BITMAP_HEIGHT);
+ save_pointer(NAME(m_converted_gfx), 0x8000 * 2);
+ save_item(NAME(m_video_control));
+ save_item(NAME(m_flip_screen));
}
diff --git a/src/mame/video/arcadecl.c b/src/mame/video/arcadecl.c
index b8cebf6c0ef..7c93a65b3dc 100644
--- a/src/mame/video/arcadecl.c
+++ b/src/mame/video/arcadecl.c
@@ -21,7 +21,7 @@ static void arcadecl_bitmap_render(running_machine &machine, bitmap_ind16 &bitma
*
*************************************/
-VIDEO_START( arcadecl )
+VIDEO_START_MEMBER(arcadecl_state,arcadecl)
{
static const atarimo_desc modesc =
{
@@ -59,15 +59,14 @@ VIDEO_START( arcadecl )
0, /* resulting value to indicate "special" */
0, /* callback routine for special entries */
};
- arcadecl_state *state = machine.driver_data<arcadecl_state>();
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* set the intial scroll offset */
atarimo_set_xscroll(0, -12);
atarimo_set_yscroll(0, 0x110);
- state->m_has_mo = (machine.gfx[0]->elements() > 10);
+ m_has_mo = (machine().gfx[0]->elements() > 10);
}
diff --git a/src/mame/video/argus.c b/src/mame/video/argus.c
index 1b9fe75bcfd..1469efe38ac 100644
--- a/src/mame/video/argus.c
+++ b/src/mame/video/argus.c
@@ -267,85 +267,79 @@ static void reset_common(running_machine &machine)
state->m_palette_intensity = 0;
}
-VIDEO_START( argus )
+VIDEO_START_MEMBER(argus_state,argus)
{
- argus_state *state = machine.driver_data<argus_state>();
/* info offset w h col row */
- state->m_bg0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::argus_get_bg0_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::argus_get_bg1_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::argus_get_tx_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_bg0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::argus_get_bg0_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::argus_get_bg1_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::argus_get_tx_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_bg1_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_bg1_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
/* dummy RAM for back ground */
- state->m_dummy_bg0ram = auto_alloc_array(machine, UINT8, 0x800);
+ m_dummy_bg0ram = auto_alloc_array(machine(), UINT8, 0x800);
- jal_blend_init(machine, 1);
+ jal_blend_init(machine(), 1);
}
-VIDEO_RESET( argus )
+VIDEO_RESET_MEMBER(argus_state,argus)
{
- argus_state *state = machine.driver_data<argus_state>();
- state->m_lowbitscroll = 0;
- state->m_prvscrollx = 0;
- state->m_bg0_scrollx[0] = 0;
- state->m_bg0_scrollx[1] = 0;
- memset(state->m_dummy_bg0ram, 0, 0x800);
- reset_common(machine);
+ m_lowbitscroll = 0;
+ m_prvscrollx = 0;
+ m_bg0_scrollx[0] = 0;
+ m_bg0_scrollx[1] = 0;
+ memset(m_dummy_bg0ram, 0, 0x800);
+ reset_common(machine());
}
-VIDEO_START( valtric )
+VIDEO_START_MEMBER(argus_state,valtric)
{
- argus_state *state = machine.driver_data<argus_state>();
/* info offset w h col row */
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::valtric_get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::valtric_get_tx_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::valtric_get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::valtric_get_tx_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
- machine.primary_screen->register_screen_bitmap(state->m_mosaicbitmap);
+ machine().primary_screen->register_screen_bitmap(m_mosaicbitmap);
- jal_blend_init(machine, 1);
+ jal_blend_init(machine(), 1);
}
-VIDEO_RESET( valtric )
+VIDEO_RESET_MEMBER(argus_state,valtric)
{
- argus_state *state = machine.driver_data<argus_state>();
- state->m_valtric_mosaic = 0x0f;
- reset_common(machine);
+ m_valtric_mosaic = 0x0f;
+ reset_common(machine());
}
-VIDEO_START( butasan )
+VIDEO_START_MEMBER(argus_state,butasan)
{
- argus_state *state = machine.driver_data<argus_state>();
/* info offset w h col row */
- state->m_bg0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::butasan_get_bg0_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::butasan_get_bg1_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::butasan_get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::butasan_get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::butasan_get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(argus_state::butasan_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg1_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_bg1_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
- state->m_butasan_pagedram[0] = auto_alloc_array(machine, UINT8, 0x1000);
- state->m_butasan_pagedram[1] = auto_alloc_array(machine, UINT8, 0x1000);
+ m_butasan_pagedram[0] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_butasan_pagedram[1] = auto_alloc_array(machine(), UINT8, 0x1000);
- state->m_butasan_bg0ram = &state->m_butasan_pagedram[0][0x000];
- state->m_butasan_bg0backram = &state->m_butasan_pagedram[0][0x800];
- state->m_butasan_txram = &state->m_butasan_pagedram[1][0x000];
- state->m_butasan_txbackram = &state->m_butasan_pagedram[1][0x800];
+ m_butasan_bg0ram = &m_butasan_pagedram[0][0x000];
+ m_butasan_bg0backram = &m_butasan_pagedram[0][0x800];
+ m_butasan_txram = &m_butasan_pagedram[1][0x000];
+ m_butasan_txbackram = &m_butasan_pagedram[1][0x800];
- jal_blend_init(machine, 1);
+ jal_blend_init(machine(), 1);
}
-VIDEO_RESET( butasan )
+VIDEO_RESET_MEMBER(argus_state,butasan)
{
- argus_state *state = machine.driver_data<argus_state>();
- state->m_butasan_page_latch = 0;
- state->m_butasan_bg1_status = 0x01;
- memset(state->m_butasan_pagedram[0], 0, 0x1000);
- memset(state->m_butasan_pagedram[1], 0, 0x1000);
- reset_common(machine);
+ m_butasan_page_latch = 0;
+ m_butasan_bg1_status = 0x01;
+ memset(m_butasan_pagedram[0], 0, 0x1000);
+ memset(m_butasan_pagedram[1], 0, 0x1000);
+ reset_common(machine());
}
diff --git a/src/mame/video/arkanoid.c b/src/mame/video/arkanoid.c
index 5e9a3a03c74..6241b7a2321 100644
--- a/src/mame/video/arkanoid.c
+++ b/src/mame/video/arkanoid.c
@@ -158,11 +158,10 @@ TILE_GET_INFO_MEMBER(arkanoid_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( arkanoid )
+VIDEO_START_MEMBER(arkanoid_state,arkanoid)
{
- arkanoid_state *state = machine.driver_data<arkanoid_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(arkanoid_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(arkanoid_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/armedf.c b/src/mame/video/armedf.c
index 1fdaa7c7fa5..90a9896d464 100644
--- a/src/mame/video/armedf.c
+++ b/src/mame/video/armedf.c
@@ -113,49 +113,47 @@ TILE_GET_INFO_MEMBER(armedf_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( terraf )
+VIDEO_START_MEMBER(armedf_state,terraf)
{
- armedf_state *state = machine.driver_data<armedf_state>();
- state->m_sprite_offy = (state->m_scroll_type & 2 ) ? 0 : 128; /* legion, legiono, crazy climber 2 */
+ m_sprite_offy = (m_scroll_type & 2 ) ? 0 : 128; /* legion, legiono, crazy climber 2 */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 64, 32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_nb1414m4_tx_tile_info),state),
- (state->m_scroll_type == 2) ? tilemap_mapper_delegate(FUNC(armedf_state::armedf_scan_type3),state) : tilemap_mapper_delegate(FUNC(armedf_state::armedf_scan_type2),state), 8, 8, 64, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_nb1414m4_tx_tile_info),this),
+ (m_scroll_type == 2) ? tilemap_mapper_delegate(FUNC(armedf_state::armedf_scan_type3),this) : tilemap_mapper_delegate(FUNC(armedf_state::armedf_scan_type2),this), 8, 8, 64, 32);
- state->m_bg_tilemap->set_transparent_pen(0xf);
- state->m_fg_tilemap->set_transparent_pen(0xf);
- state->m_tx_tilemap->set_transparent_pen(0xf);
+ m_bg_tilemap->set_transparent_pen(0xf);
+ m_fg_tilemap->set_transparent_pen(0xf);
+ m_tx_tilemap->set_transparent_pen(0xf);
- if (state->m_scroll_type != 1)
- state->m_tx_tilemap->set_scrollx(0, -128);
+ if (m_scroll_type != 1)
+ m_tx_tilemap->set_scrollx(0, -128);
- state->m_text_videoram = auto_alloc_array(machine, UINT8, 0x1000);
- memset(state->m_text_videoram, 0x00, 0x1000);
+ m_text_videoram = auto_alloc_array(machine(), UINT8, 0x1000);
+ memset(m_text_videoram, 0x00, 0x1000);
}
-VIDEO_START( armedf )
+VIDEO_START_MEMBER(armedf_state,armedf)
{
- armedf_state *state = machine.driver_data<armedf_state>();
- state->m_sprite_offy = (state->m_scroll_type & 2 ) ? 0 : 128; /* legion, legiono, crazy climber 2 */
+ m_sprite_offy = (m_scroll_type & 2 ) ? 0 : 128; /* legion, legiono, crazy climber 2 */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 64, 32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_armedf_tx_tile_info),state), tilemap_mapper_delegate(FUNC(armedf_state::armedf_scan_type1),state), 8, 8, 64, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(armedf_state::get_armedf_tx_tile_info),this), tilemap_mapper_delegate(FUNC(armedf_state::armedf_scan_type1),this), 8, 8, 64, 32);
- state->m_bg_tilemap->set_transparent_pen(0xf);
- state->m_fg_tilemap->set_transparent_pen(0xf);
- state->m_tx_tilemap->set_transparent_pen(0xf);
+ m_bg_tilemap->set_transparent_pen(0xf);
+ m_fg_tilemap->set_transparent_pen(0xf);
+ m_tx_tilemap->set_transparent_pen(0xf);
- if (state->m_scroll_type != 1)
- state->m_tx_tilemap->set_scrollx(0, -128);
+ if (m_scroll_type != 1)
+ m_tx_tilemap->set_scrollx(0, -128);
- state->m_text_videoram = auto_alloc_array(machine, UINT8, 0x1000);
- memset(state->m_text_videoram, 0x00, 0x1000);
+ m_text_videoram = auto_alloc_array(machine(), UINT8, 0x1000);
+ memset(m_text_videoram, 0x00, 0x1000);
}
/***************************************************************************
diff --git a/src/mame/video/artmagic.c b/src/mame/video/artmagic.c
index cbd48af8d5f..7ce0e542056 100644
--- a/src/mame/video/artmagic.c
+++ b/src/mame/video/artmagic.c
@@ -38,16 +38,15 @@ INLINE UINT16 *address_to_vram(artmagic_state *state, offs_t *address)
*
*************************************/
-VIDEO_START( artmagic )
+void artmagic_state::video_start()
{
- artmagic_state *state = machine.driver_data<artmagic_state>();
- state->m_blitter_base = (UINT16 *)state->memregion("gfx1")->base();
- state->m_blitter_mask = state->memregion("gfx1")->bytes()/2 - 1;
+ m_blitter_base = (UINT16 *)memregion("gfx1")->base();
+ m_blitter_mask = memregion("gfx1")->bytes()/2 - 1;
- state_save_register_global_array(machine, state->m_xor);
- state_save_register_global(machine, state->m_is_stoneball);
- state_save_register_global_array(machine, state->m_blitter_data);
- state_save_register_global(machine, state->m_blitter_page);
+ state_save_register_global_array(machine(), m_xor);
+ state_save_register_global(machine(), m_is_stoneball);
+ state_save_register_global_array(machine(), m_blitter_data);
+ state_save_register_global(machine(), m_blitter_page);
}
diff --git a/src/mame/video/ashnojoe.c b/src/mame/video/ashnojoe.c
index 20f2fe1e8d5..2c6d0767a61 100644
--- a/src/mame/video/ashnojoe.c
+++ b/src/mame/video/ashnojoe.c
@@ -189,23 +189,22 @@ WRITE16_MEMBER(ashnojoe_state::joe_tilemaps_yscroll_w)
}
}
-VIDEO_START( ashnojoe )
-{
- ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
-
- state->m_joetilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_joetilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_2),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_joetilemap3 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_3),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_joetilemap4 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_4),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_joetilemap5 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_5),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_joetilemap6 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_6),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_joetilemap7 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_7),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
-
- state->m_joetilemap->set_transparent_pen(15);
- state->m_joetilemap2->set_transparent_pen(15);
- state->m_joetilemap3->set_transparent_pen(15);
- state->m_joetilemap4->set_transparent_pen(15);
- state->m_joetilemap5->set_transparent_pen(15);
+void ashnojoe_state::video_start()
+{
+
+ m_joetilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_joetilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_2),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_joetilemap3 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_3),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_joetilemap4 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_4),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_joetilemap5 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_5),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_joetilemap6 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_6),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_joetilemap7 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ashnojoe_state::get_joe_tile_info_7),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+
+ m_joetilemap->set_transparent_pen(15);
+ m_joetilemap2->set_transparent_pen(15);
+ m_joetilemap3->set_transparent_pen(15);
+ m_joetilemap4->set_transparent_pen(15);
+ m_joetilemap5->set_transparent_pen(15);
}
SCREEN_UPDATE_IND16( ashnojoe )
diff --git a/src/mame/video/astrocde.c b/src/mame/video/astrocde.c
index 99cd3e7b1ad..f92c25ff4fc 100644
--- a/src/mame/video/astrocde.c
+++ b/src/mame/video/astrocde.c
@@ -59,7 +59,7 @@ INLINE int mame_vpos_to_astrocade_vpos(int scanline)
*
*************************************/
-PALETTE_INIT( astrocde )
+void astrocde_state::palette_init()
{
/*
The Astrocade has a 256 color palette: 32 colors with 8 luminance
@@ -102,13 +102,13 @@ PALETTE_INIT( astrocde )
g = MIN(g, 255);
b = MAX(b, 0);
b = MIN(b, 255);
- palette_set_color(machine, color * 16 + luma, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), color * 16 + luma, MAKE_RGB(r, g, b));
}
}
}
-PALETTE_INIT( profpac )
+PALETTE_INIT_MEMBER(astrocde_state,profpac)
{
/* Professor Pac-Man uses a more standard 12-bit RGB palette layout */
static const int resistances[4] = { 6200, 3000, 1500, 750 };
@@ -148,7 +148,7 @@ PALETTE_INIT( profpac )
bit3 = (i >> 11) & 0x01;
r = combine_4_weights(weights, bit0, bit1, bit2, bit3);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -160,51 +160,49 @@ PALETTE_INIT( profpac )
*
*************************************/
-VIDEO_START( astrocde )
+void astrocde_state::video_start()
{
- astrocde_state *state = machine.driver_data<astrocde_state>();
/* allocate timers */
- state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
- state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(1), 1);
- state->m_intoff_timer = machine.scheduler().timer_alloc(FUNC(interrupt_off));
+ m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_callback));
+ m_scanline_timer->adjust(machine().primary_screen->time_until_pos(1), 1);
+ m_intoff_timer = machine().scheduler().timer_alloc(FUNC(interrupt_off));
/* register for save states */
- init_savestate(machine);
+ init_savestate(machine());
/* initialize the sparkle and stars */
- if (state->m_video_config & AC_STARS)
- init_sparklestar(machine);
+ if (m_video_config & AC_STARS)
+ init_sparklestar(machine());
}
-VIDEO_START( profpac )
+VIDEO_START_MEMBER(astrocde_state,profpac)
{
- astrocde_state *state = machine.driver_data<astrocde_state>();
/* allocate timers */
- state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
- state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(1), 1);
- state->m_intoff_timer = machine.scheduler().timer_alloc(FUNC(interrupt_off));
+ m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_callback));
+ m_scanline_timer->adjust(machine().primary_screen->time_until_pos(1), 1);
+ m_intoff_timer = machine().scheduler().timer_alloc(FUNC(interrupt_off));
/* allocate videoram */
- state->m_profpac_videoram = auto_alloc_array(machine, UINT16, 0x4000 * 4);
+ m_profpac_videoram = auto_alloc_array(machine(), UINT16, 0x4000 * 4);
/* register for save states */
- init_savestate(machine);
+ init_savestate(machine());
/* register our specific save state data */
- state_save_register_global_pointer(machine, state->m_profpac_videoram, 0x4000 * 4);
- state_save_register_global_array(machine, state->m_profpac_palette);
- state_save_register_global_array(machine, state->m_profpac_colormap);
- state_save_register_global(machine, state->m_profpac_intercept);
- state_save_register_global(machine, state->m_profpac_vispage);
- state_save_register_global(machine, state->m_profpac_readpage);
- state_save_register_global(machine, state->m_profpac_readshift);
- state_save_register_global(machine, state->m_profpac_writepage);
- state_save_register_global(machine, state->m_profpac_writemode);
- state_save_register_global(machine, state->m_profpac_writemask);
- state_save_register_global(machine, state->m_profpac_vw);
+ state_save_register_global_pointer(machine(), m_profpac_videoram, 0x4000 * 4);
+ state_save_register_global_array(machine(), m_profpac_palette);
+ state_save_register_global_array(machine(), m_profpac_colormap);
+ state_save_register_global(machine(), m_profpac_intercept);
+ state_save_register_global(machine(), m_profpac_vispage);
+ state_save_register_global(machine(), m_profpac_readpage);
+ state_save_register_global(machine(), m_profpac_readshift);
+ state_save_register_global(machine(), m_profpac_writepage);
+ state_save_register_global(machine(), m_profpac_writemode);
+ state_save_register_global(machine(), m_profpac_writemask);
+ state_save_register_global(machine(), m_profpac_vw);
}
diff --git a/src/mame/video/atarifb.c b/src/mame/video/atarifb.c
index 7457ac9246c..9d930eaeeb7 100644
--- a/src/mame/video/atarifb.c
+++ b/src/mame/video/atarifb.c
@@ -87,13 +87,12 @@ WRITE8_MEMBER(atarifb_state::atarifb_field_videoram_w)
*
*************************************/
-VIDEO_START( atarifb )
+void atarifb_state::video_start()
{
- atarifb_state *state = machine.driver_data<atarifb_state>();
- state->m_alpha1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarifb_state::alpha1_get_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 3, 32);
- state->m_alpha2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarifb_state::alpha2_get_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 3, 32);
- state->m_field_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarifb_state::field_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_alpha1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarifb_state::alpha1_get_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 3, 32);
+ m_alpha2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarifb_state::alpha2_get_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 3, 32);
+ m_field_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarifb_state::field_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/atarig1.c b/src/mame/video/atarig1.c
index 6d8865e9c05..28ed4dc0d1d 100644
--- a/src/mame/video/atarig1.c
+++ b/src/mame/video/atarig1.c
@@ -42,31 +42,30 @@ TILE_GET_INFO_MEMBER(atarig1_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( atarig1 )
+VIDEO_START_MEMBER(atarig1_state,atarig1)
{
- atarig1_state *state = machine.driver_data<atarig1_state>();
/* blend the playfields and free the temporary one */
- atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x10);
+ atarigen_blend_gfx(machine(), 0, 2, 0x0f, 0x10);
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarig1_state::get_playfield_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarig1_state::get_playfield_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,64);
/* initialize the motion objects */
- state->m_rle = machine.device("rle");
+ m_rle = machine().device("rle");
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarig1_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarig1_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
/* reset statics */
- state->m_pfscroll_xoffset = state->m_is_pitfight ? 2 : 0;
+ m_pfscroll_xoffset = m_is_pitfight ? 2 : 0;
/* state saving */
- state->save_item(NAME(state->m_current_control));
- state->save_item(NAME(state->m_playfield_tile_bank));
- state->save_item(NAME(state->m_playfield_xscroll));
- state->save_item(NAME(state->m_playfield_yscroll));
+ save_item(NAME(m_current_control));
+ save_item(NAME(m_playfield_tile_bank));
+ save_item(NAME(m_playfield_xscroll));
+ save_item(NAME(m_playfield_yscroll));
}
diff --git a/src/mame/video/atarig42.c b/src/mame/video/atarig42.c
index 1c298021b18..2c7a57b51d9 100644
--- a/src/mame/video/atarig42.c
+++ b/src/mame/video/atarig42.c
@@ -65,29 +65,28 @@ TILEMAP_MAPPER_MEMBER(atarig42_state::atarig42_playfield_scan)
*
*************************************/
-VIDEO_START( atarig42 )
+VIDEO_START_MEMBER(atarig42_state,atarig42)
{
- atarig42_state *state = machine.driver_data<atarig42_state>();
/* blend the playfields and free the temporary one */
- atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30);
+ atarigen_blend_gfx(machine(), 0, 2, 0x0f, 0x30);
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarig42_state::get_playfield_tile_info),state), tilemap_mapper_delegate(FUNC(atarig42_state::atarig42_playfield_scan),state), 8,8, 128,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarig42_state::get_playfield_tile_info),this), tilemap_mapper_delegate(FUNC(atarig42_state::atarig42_playfield_scan),this), 8,8, 128,64);
/* initialize the motion objects */
- state->m_rle = machine.device("rle");
+ m_rle = machine().device("rle");
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarig42_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarig42_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
/* save states */
- state->save_item(NAME(state->m_current_control));
- state->save_item(NAME(state->m_playfield_tile_bank));
- state->save_item(NAME(state->m_playfield_color_bank));
- state->save_item(NAME(state->m_playfield_xscroll));
- state->save_item(NAME(state->m_playfield_yscroll));
+ save_item(NAME(m_current_control));
+ save_item(NAME(m_playfield_tile_bank));
+ save_item(NAME(m_playfield_color_bank));
+ save_item(NAME(m_playfield_xscroll));
+ save_item(NAME(m_playfield_yscroll));
}
diff --git a/src/mame/video/atarigt.c b/src/mame/video/atarigt.c
index 0c176b29c0a..48468a59516 100644
--- a/src/mame/video/atarigt.c
+++ b/src/mame/video/atarigt.c
@@ -74,47 +74,46 @@ TILEMAP_MAPPER_MEMBER(atarigt_state::atarigt_playfield_scan)
*
*************************************/
-VIDEO_START( atarigt )
+VIDEO_START_MEMBER(atarigt_state,atarigt)
{
- atarigt_state *state = machine.driver_data<atarigt_state>();
pen_t *substitute_pens;
int i, width, height;
/* blend the playfields and free the temporary one */
- atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30);
+ atarigen_blend_gfx(machine(), 0, 2, 0x0f, 0x30);
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarigt_state::get_playfield_tile_info),state), tilemap_mapper_delegate(FUNC(atarigt_state::atarigt_playfield_scan),state), 8,8, 128,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarigt_state::get_playfield_tile_info),this), tilemap_mapper_delegate(FUNC(atarigt_state::atarigt_playfield_scan),this), 8,8, 128,64);
/* initialize the motion objects */
- state->m_rle = machine.device("rle");
+ m_rle = machine().device("rle");
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarigt_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarigt_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
/* allocate temp bitmaps */
- width = machine.primary_screen->width();
- height = machine.primary_screen->height();
+ width = machine().primary_screen->width();
+ height = machine().primary_screen->height();
- state->m_pf_bitmap = auto_bitmap_ind16_alloc(machine, width, height);
- state->m_an_bitmap = auto_bitmap_ind16_alloc(machine, width, height);
+ m_pf_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
+ m_an_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
/* map pens 1:1 */
- substitute_pens = auto_alloc_array(machine, pen_t, 65536);
- for (i = 0; i < machine.total_colors(); i++)
+ substitute_pens = auto_alloc_array(machine(), pen_t, 65536);
+ for (i = 0; i < machine().total_colors(); i++)
substitute_pens[i] = i;
- machine.pens = substitute_pens;
+ machine().pens = substitute_pens;
/* reset statics */
- memset(state->m_colorram, 0, 0x80000);
+ memset(m_colorram, 0, 0x80000);
/* save states */
- state->save_item(NAME(state->m_playfield_tile_bank));
- state->save_item(NAME(state->m_playfield_color_bank));
- state->save_item(NAME(state->m_playfield_xscroll));
- state->save_item(NAME(state->m_playfield_yscroll));
- state->save_item(NAME(state->m_tram_checksum));
- state->save_item(NAME(state->m_expanded_mram));
+ save_item(NAME(m_playfield_tile_bank));
+ save_item(NAME(m_playfield_color_bank));
+ save_item(NAME(m_playfield_xscroll));
+ save_item(NAME(m_playfield_yscroll));
+ save_item(NAME(m_tram_checksum));
+ save_item(NAME(m_expanded_mram));
}
diff --git a/src/mame/video/atarigx2.c b/src/mame/video/atarigx2.c
index 88a287a03b7..124b0e71e64 100644
--- a/src/mame/video/atarigx2.c
+++ b/src/mame/video/atarigx2.c
@@ -65,29 +65,28 @@ TILEMAP_MAPPER_MEMBER(atarigx2_state::atarigx2_playfield_scan)
*
*************************************/
-VIDEO_START( atarigx2 )
+VIDEO_START_MEMBER(atarigx2_state,atarigx2)
{
- atarigx2_state *state = machine.driver_data<atarigx2_state>();
/* blend the playfields and free the temporary one */
- atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30);
+ atarigen_blend_gfx(machine(), 0, 2, 0x0f, 0x30);
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarigx2_state::get_playfield_tile_info),state), tilemap_mapper_delegate(FUNC(atarigx2_state::atarigx2_playfield_scan),state), 8,8, 128,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarigx2_state::get_playfield_tile_info),this), tilemap_mapper_delegate(FUNC(atarigx2_state::atarigx2_playfield_scan),this), 8,8, 128,64);
/* initialize the motion objects */
- state->m_rle = machine.device("rle");
+ m_rle = machine().device("rle");
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarigx2_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarigx2_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
/* save states */
- state->save_item(NAME(state->m_current_control));
- state->save_item(NAME(state->m_playfield_tile_bank));
- state->save_item(NAME(state->m_playfield_color_bank));
- state->save_item(NAME(state->m_playfield_xscroll));
- state->save_item(NAME(state->m_playfield_yscroll));
+ save_item(NAME(m_current_control));
+ save_item(NAME(m_playfield_tile_bank));
+ save_item(NAME(m_playfield_color_bank));
+ save_item(NAME(m_playfield_xscroll));
+ save_item(NAME(m_playfield_yscroll));
}
diff --git a/src/mame/video/atarisy1.c b/src/mame/video/atarisy1.c
index f500be31f38..a4c8ea38604 100644
--- a/src/mame/video/atarisy1.c
+++ b/src/mame/video/atarisy1.c
@@ -120,7 +120,7 @@ TILE_GET_INFO_MEMBER(atarisy1_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( atarisy1 )
+VIDEO_START_MEMBER(atarisy1_state,atarisy1)
{
static const atarimo_desc modesc =
{
@@ -159,24 +159,23 @@ VIDEO_START( atarisy1 )
0 /* callback routine for special entries */
};
- atarisy1_state *state = machine.driver_data<atarisy1_state>();
UINT16 motable[256];
UINT16 *codelookup;
UINT8 *colorlookup, *gfxlookup;
int i, size;
/* first decode the graphics */
- decode_gfx(machine, state->m_playfield_lookup, motable);
+ decode_gfx(machine(), m_playfield_lookup, motable);
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarisy1_state::get_playfield_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarisy1_state::get_playfield_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,64);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarisy1_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarisy1_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
/* modify the motion object code lookup */
codelookup = atarimo_get_code_lookup(0, &size);
@@ -194,12 +193,12 @@ VIDEO_START( atarisy1 )
/* reset the statics */
atarimo_set_yscroll(0, 256);
- state->m_next_timer_scanline = -1;
+ m_next_timer_scanline = -1;
/* save state */
- state->save_item(NAME(state->m_playfield_tile_bank));
- state->save_item(NAME(state->m_playfield_priority_pens));
- state->save_item(NAME(state->m_next_timer_scanline));
+ save_item(NAME(m_playfield_tile_bank));
+ save_item(NAME(m_playfield_priority_pens));
+ save_item(NAME(m_next_timer_scanline));
}
diff --git a/src/mame/video/atarisy2.c b/src/mame/video/atarisy2.c
index 89a8eb41e72..2ebdedb2368 100644
--- a/src/mame/video/atarisy2.c
+++ b/src/mame/video/atarisy2.c
@@ -53,7 +53,7 @@ TILE_GET_INFO_MEMBER(atarisy2_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( atarisy2 )
+VIDEO_START_MEMBER(atarisy2_state,atarisy2)
{
static const atarimo_desc modesc =
{
@@ -91,30 +91,29 @@ VIDEO_START( atarisy2 )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- atarisy2_state *state = machine.driver_data<atarisy2_state>();
/* initialize banked memory */
- state->m_alpha.set_target(&state->m_vram[0x0000], 0x2000);
- state->m_playfield.set_target(&state->m_vram[0x2000], 0x2000);
+ m_alpha.set_target(&m_vram[0x0000], 0x2000);
+ m_playfield.set_target(&m_vram[0x2000], 0x2000);
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarisy2_state::get_playfield_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 128,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarisy2_state::get_playfield_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 128,64);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atarisy2_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,48);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarisy2_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,48);
+ m_alpha_tilemap->set_transparent_pen(0);
/* reset the statics */
- state->m_yscroll_reset_timer = machine.scheduler().timer_alloc(FUNC(reset_yscroll_callback));
- state->m_videobank = 0;
+ m_yscroll_reset_timer = machine().scheduler().timer_alloc(FUNC(reset_yscroll_callback));
+ m_videobank = 0;
/* save states */
- state->save_item(NAME(state->m_playfield_tile_bank));
- state->save_item(NAME(state->m_videobank));
- state->save_item(NAME(state->m_vram));
+ save_item(NAME(m_playfield_tile_bank));
+ save_item(NAME(m_videobank));
+ save_item(NAME(m_vram));
}
diff --git a/src/mame/video/atetris.c b/src/mame/video/atetris.c
index 289bd684106..161f78f5fa1 100644
--- a/src/mame/video/atetris.c
+++ b/src/mame/video/atetris.c
@@ -47,11 +47,10 @@ WRITE8_MEMBER(atetris_state::atetris_videoram_w)
*
*************************************/
-VIDEO_START( atetris )
+void atetris_state::video_start()
{
- atetris_state *state = machine.driver_data<atetris_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(atetris_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atetris_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
}
diff --git a/src/mame/video/aztarac.c b/src/mame/video/aztarac.c
index 1168d488c4c..7325c69d8c0 100644
--- a/src/mame/video/aztarac.c
+++ b/src/mame/video/aztarac.c
@@ -80,18 +80,17 @@ WRITE16_MEMBER(aztarac_state::aztarac_ubr_w)
}
-VIDEO_START( aztarac )
+void aztarac_state::video_start()
{
- aztarac_state *state = machine.driver_data<aztarac_state>();
- const rectangle &visarea = machine.primary_screen->visible_area();
+ const rectangle &visarea = machine().primary_screen->visible_area();
int xmin = visarea.min_x;
int ymin = visarea.min_y;
int xmax = visarea.max_x;
int ymax = visarea.max_y;
- state->m_xcenter=((xmax + xmin) / 2) << 16;
- state->m_ycenter=((ymax + ymin) / 2) << 16;
+ m_xcenter=((xmax + xmin) / 2) << 16;
+ m_ycenter=((ymax + ymin) / 2) << 16;
- VIDEO_START_CALL(vector);
+ VIDEO_START_CALL_LEGACY(vector);
}
diff --git a/src/mame/video/badlands.c b/src/mame/video/badlands.c
index 2310c17f246..2f04918ef75 100644
--- a/src/mame/video/badlands.c
+++ b/src/mame/video/badlands.c
@@ -32,7 +32,7 @@ TILE_GET_INFO_MEMBER(badlands_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( badlands )
+VIDEO_START_MEMBER(badlands_state,badlands)
{
static const atarimo_desc modesc =
{
@@ -70,16 +70,15 @@ VIDEO_START( badlands )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- badlands_state *state = machine.driver_data<badlands_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(badlands_state::get_playfield_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(badlands_state::get_playfield_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* save states */
- state->save_item(NAME(state->m_playfield_tile_bank));
+ save_item(NAME(m_playfield_tile_bank));
}
diff --git a/src/mame/video/bagman.c b/src/mame/video/bagman.c
index 4c92a8ce26e..879a26c56b2 100644
--- a/src/mame/video/bagman.c
+++ b/src/mame/video/bagman.c
@@ -42,9 +42,9 @@ WRITE8_MEMBER(bagman_state::bagman_colorram_w)
bit 0 -- 1 kohm resistor -- /
***************************************************************************/
-PALETTE_INIT( bagman )
+PALETTE_INIT_MEMBER(bagman_state,bagman)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
@@ -57,7 +57,7 @@ PALETTE_INIT( bagman )
2, resistances_b, weights_b, 470, 0);
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -76,7 +76,7 @@ PALETTE_INIT( bagman )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(weights_b, bit0, bit1);
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -98,13 +98,12 @@ TILE_GET_INFO_MEMBER(bagman_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(gfxbank, code, color, 0);
}
-VIDEO_START( bagman )
+VIDEO_START_MEMBER(bagman_state,bagman)
{
- bagman_state *state = machine.driver_data<bagman_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bagman_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bagman_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_bg_tilemap->set_scrolldy(-1, -1);
+ m_bg_tilemap->set_scrolldy(-1, -1);
}
diff --git a/src/mame/video/balsente.c b/src/mame/video/balsente.c
index 217c31ca384..be1ed654980 100644
--- a/src/mame/video/balsente.c
+++ b/src/mame/video/balsente.c
@@ -16,22 +16,21 @@
*
*************************************/
-VIDEO_START( balsente )
+void balsente_state::video_start()
{
- balsente_state *state = machine.driver_data<balsente_state>();
/* reset the system */
- state->m_palettebank_vis = 0;
- state->m_sprite_bank[0] = state->memregion("gfx1")->base();
- state->m_sprite_bank[1] = state->memregion("gfx1")->base() + 0x10000;
+ m_palettebank_vis = 0;
+ m_sprite_bank[0] = memregion("gfx1")->base();
+ m_sprite_bank[1] = memregion("gfx1")->base() + 0x10000;
/* determine sprite size */
- state->m_sprite_data = state->memregion("gfx1")->base();
- state->m_sprite_mask = state->memregion("gfx1")->bytes() - 1;
+ m_sprite_data = memregion("gfx1")->base();
+ m_sprite_mask = memregion("gfx1")->bytes() - 1;
/* register for saving */
- state->save_item(NAME(state->m_expanded_videoram));
- state->save_item(NAME(state->m_palettebank_vis));
+ save_item(NAME(m_expanded_videoram));
+ save_item(NAME(m_palettebank_vis));
}
diff --git a/src/mame/video/bankp.c b/src/mame/video/bankp.c
index c74c4246fcc..cf37c90b722 100644
--- a/src/mame/video/bankp.c
+++ b/src/mame/video/bankp.c
@@ -33,13 +33,13 @@
***************************************************************************/
-PALETTE_INIT( bankp )
+void bankp_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 32);
+ machine().colortable = colortable_alloc(machine(), 32);
for (i = 0; i < 32; i++)
{
@@ -61,7 +61,7 @@ PALETTE_INIT( bankp )
bit2 = (*color_prom >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r,g,b));
color_prom++;
}
@@ -69,14 +69,14 @@ PALETTE_INIT( bankp )
/* color_prom now points to the beginning of the lookup table */
/* charset #1 lookup table */
- for (i = 0; i < machine.gfx[0]->colors() * machine.gfx[0]->granularity(); i++)
- colortable_entry_set_value(machine.colortable, machine.gfx[0]->colorbase() + i, *color_prom++ & 0x0f);
+ for (i = 0; i < machine().gfx[0]->colors() * machine().gfx[0]->granularity(); i++)
+ colortable_entry_set_value(machine().colortable, machine().gfx[0]->colorbase() + i, *color_prom++ & 0x0f);
color_prom += 128; /* skip the bottom half of the PROM - seems to be not used */
/* charset #2 lookup table */
- for (i = 0; i < machine.gfx[1]->colors() * machine.gfx[1]->granularity(); i++)
- colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + i, *color_prom++ & 0x0f);
+ for (i = 0; i < machine().gfx[1]->colors() * machine().gfx[1]->granularity(); i++)
+ colortable_entry_set_value(machine().colortable, machine().gfx[1]->colorbase() + i, *color_prom++ & 0x0f);
/* the bottom half of the PROM seems to be not used */
}
@@ -152,18 +152,17 @@ TILE_GET_INFO_MEMBER(bankp_state::get_fg_tile_info)
tileinfo.group = color;
}
-VIDEO_START( bankp )
+void bankp_state::video_start()
{
- bankp_state *state = machine.driver_data<bankp_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bankp_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bankp_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bankp_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bankp_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- colortable_configure_tilemap_groups(machine.colortable, state->m_bg_tilemap, machine.gfx[1], 0);
- colortable_configure_tilemap_groups(machine.colortable, state->m_fg_tilemap, machine.gfx[0], 0);
+ colortable_configure_tilemap_groups(machine().colortable, m_bg_tilemap, machine().gfx[1], 0);
+ colortable_configure_tilemap_groups(machine().colortable, m_fg_tilemap, machine().gfx[0], 0);
- state->save_item(NAME(state->m_scroll_x));
- state->save_item(NAME(state->m_priority));
+ save_item(NAME(m_scroll_x));
+ save_item(NAME(m_priority));
}
SCREEN_UPDATE_IND16( bankp )
diff --git a/src/mame/video/baraduke.c b/src/mame/video/baraduke.c
index e6930cee1cd..a69cee19283 100644
--- a/src/mame/video/baraduke.c
+++ b/src/mame/video/baraduke.c
@@ -15,9 +15,9 @@
***************************************************************************/
-PALETTE_INIT( baraduke )
+void baraduke_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
int bit0,bit1,bit2,bit3,r,g,b;
@@ -44,7 +44,7 @@ PALETTE_INIT( baraduke )
bit3 = (color_prom[0] >> 7) & 0x01;
b = 0x0e*bit0 + 0x1f*bit1 + 0x43*bit2 + 0x8f*bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
}
@@ -113,19 +113,18 @@ TILE_GET_INFO_MEMBER(baraduke_state::get_tile_info1)
***************************************************************************/
-VIDEO_START( baraduke )
+void baraduke_state::video_start()
{
- baraduke_state *state = machine.driver_data<baraduke_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(baraduke_state::tx_get_tile_info),state),tilemap_mapper_delegate(FUNC(baraduke_state::tx_tilemap_scan),state),8,8,36,28);
- state->m_bg_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(baraduke_state::get_tile_info0),state),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_bg_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(baraduke_state::get_tile_info1),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(baraduke_state::tx_get_tile_info),this),tilemap_mapper_delegate(FUNC(baraduke_state::tx_tilemap_scan),this),8,8,36,28);
+ m_bg_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(baraduke_state::get_tile_info0),this),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(baraduke_state::get_tile_info1),this),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_tx_tilemap->set_transparent_pen(3);
- state->m_bg_tilemap[0]->set_transparent_pen(7);
- state->m_bg_tilemap[1]->set_transparent_pen(7);
+ m_tx_tilemap->set_transparent_pen(3);
+ m_bg_tilemap[0]->set_transparent_pen(7);
+ m_bg_tilemap[1]->set_transparent_pen(7);
- state->m_tx_tilemap->set_scrolldx(0,512-288);
- state->m_tx_tilemap->set_scrolldy(16,16);
+ m_tx_tilemap->set_scrolldx(0,512-288);
+ m_tx_tilemap->set_scrolldy(16,16);
}
diff --git a/src/mame/video/batman.c b/src/mame/video/batman.c
index 6953e5270cf..c038c37a5ad 100644
--- a/src/mame/video/batman.c
+++ b/src/mame/video/batman.c
@@ -55,7 +55,7 @@ TILE_GET_INFO_MEMBER(batman_state::get_playfield2_tile_info)
*
*************************************/
-VIDEO_START( batman )
+VIDEO_START_MEMBER(batman_state,batman)
{
static const atarimo_desc modesc =
{
@@ -93,21 +93,20 @@ VIDEO_START( batman )
0, /* resulting value to indicate "special" */
NULL /* callback routine for special entries */
};
- batman_state *state = machine.driver_data<batman_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(batman_state::get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(batman_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
/* initialize the second playfield */
- state->m_playfield2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(batman_state::get_playfield2_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
- state->m_playfield2_tilemap->set_transparent_pen(0);
+ m_playfield2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(batman_state::get_playfield2_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield2_tilemap->set_transparent_pen(0);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(batman_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(batman_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/battlane.c b/src/mame/video/battlane.c
index 8ab9a5af660..98d006769c2 100644
--- a/src/mame/video/battlane.c
+++ b/src/mame/video/battlane.c
@@ -133,11 +133,10 @@ TILEMAP_MAPPER_MEMBER(battlane_state::battlane_tilemap_scan_rows_2x2)
***************************************************************************/
-VIDEO_START( battlane )
+void battlane_state::video_start()
{
- battlane_state *state = machine.driver_data<battlane_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(battlane_state::get_tile_info_bg),state), tilemap_mapper_delegate(FUNC(battlane_state::battlane_tilemap_scan_rows_2x2),state), 16, 16, 32, 32);
- state->m_screen_bitmap.allocate(32 * 8, 32 * 8);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(battlane_state::get_tile_info_bg),this), tilemap_mapper_delegate(FUNC(battlane_state::battlane_tilemap_scan_rows_2x2),this), 16, 16, 32, 32);
+ m_screen_bitmap.allocate(32 * 8, 32 * 8);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/battlera.c b/src/mame/video/battlera.c
index 7cc6bf00607..8f99a300bce 100644
--- a/src/mame/video/battlera.c
+++ b/src/mame/video/battlera.c
@@ -14,26 +14,25 @@
/******************************************************************************/
-VIDEO_START( battlera )
+void battlera_state::video_start()
{
- battlera_state *state = machine.driver_data<battlera_state>();
- state->m_HuC6270_vram=auto_alloc_array(machine, UINT8, 0x20000);
- state->m_vram_dirty=auto_alloc_array(machine, UINT8, 0x1000);
+ m_HuC6270_vram=auto_alloc_array(machine(), UINT8, 0x20000);
+ m_vram_dirty=auto_alloc_array(machine(), UINT8, 0x1000);
- memset(state->m_HuC6270_vram,0,0x20000);
- memset(state->m_vram_dirty,1,0x1000);
+ memset(m_HuC6270_vram,0,0x20000);
+ memset(m_vram_dirty,1,0x1000);
- state->m_tile_bitmap=auto_bitmap_ind16_alloc(machine,512,512);
- state->m_front_bitmap=auto_bitmap_ind16_alloc(machine,512,512);
+ m_tile_bitmap=auto_bitmap_ind16_alloc(machine(),512,512);
+ m_front_bitmap=auto_bitmap_ind16_alloc(machine(),512,512);
- state->m_vram_ptr=0;
- state->m_inc_value=1;
- state->m_current_scanline=0;
- state->m_irq_enable=state->m_rcr_enable=state->m_sb_enable=state->m_bb_enable=0;
+ m_vram_ptr=0;
+ m_inc_value=1;
+ m_current_scanline=0;
+ m_irq_enable=m_rcr_enable=m_sb_enable=m_bb_enable=0;
- machine.gfx[0]->set_source(state->m_HuC6270_vram);
- machine.gfx[1]->set_source(state->m_HuC6270_vram);
- machine.gfx[2]->set_source(state->m_blank_tile);
+ machine().gfx[0]->set_source(m_HuC6270_vram);
+ machine().gfx[1]->set_source(m_HuC6270_vram);
+ machine().gfx[2]->set_source(m_blank_tile);
}
/******************************************************************************/
diff --git a/src/mame/video/battlex.c b/src/mame/video/battlex.c
index 74eafd02cc9..7dab35a229f 100644
--- a/src/mame/video/battlex.c
+++ b/src/mame/video/battlex.c
@@ -53,10 +53,9 @@ TILE_GET_INFO_MEMBER(battlex_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, tile, color, 0);
}
-VIDEO_START( battlex )
+void battlex_state::video_start()
{
- battlex_state *state = machine.driver_data<battlex_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(battlex_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(battlex_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/bbusters.c b/src/mame/video/bbusters.c
index 5185456d3bf..4d952ec4ec0 100644
--- a/src/mame/video/bbusters.c
+++ b/src/mame/video/bbusters.c
@@ -71,28 +71,26 @@ WRITE16_MEMBER(bbusters_state::bbusters_pf2_w)
/******************************************************************************/
-VIDEO_START( bbuster )
+VIDEO_START_MEMBER(bbusters_state,bbuster)
{
- bbusters_state *state = machine.driver_data<bbusters_state>();
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_bbusters_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_pf1_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 128, 32);
- state->m_pf2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_pf2_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 128, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_bbusters_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_pf1_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 32);
+ m_pf2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_pf2_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 32);
- state->m_pf1_tilemap->set_transparent_pen(15);
- state->m_fix_tilemap->set_transparent_pen(15);
+ m_pf1_tilemap->set_transparent_pen(15);
+ m_fix_tilemap->set_transparent_pen(15);
}
-VIDEO_START( mechatt )
+VIDEO_START_MEMBER(bbusters_state,mechatt)
{
- bbusters_state *state = machine.driver_data<bbusters_state>();
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_bbusters_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_pf1_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 256, 32);
- state->m_pf2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_pf2_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 256, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_bbusters_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_pf1_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 256, 32);
+ m_pf2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bbusters_state::get_pf2_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 256, 32);
- state->m_pf1_tilemap->set_transparent_pen(15);
- state->m_fix_tilemap->set_transparent_pen(15);
+ m_pf1_tilemap->set_transparent_pen(15);
+ m_fix_tilemap->set_transparent_pen(15);
}
/******************************************************************************/
diff --git a/src/mame/video/bigevglf.c b/src/mame/video/bigevglf.c
index bda915eb6c4..dd8de34ce02 100644
--- a/src/mame/video/bigevglf.c
+++ b/src/mame/video/bigevglf.c
@@ -49,22 +49,21 @@ READ8_MEMBER(bigevglf_state::bigevglf_vidram_r)
return m_vidram[0x10000 * m_plane_selected + m_vidram_bank + offset];
}
-VIDEO_START( bigevglf )
+void bigevglf_state::video_start()
{
- bigevglf_state *state = machine.driver_data<bigevglf_state>();
- machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap[0]);
- machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap[1]);
- machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap[2]);
- machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap[3]);
- state->save_item(NAME(state->m_tmp_bitmap[0]));
- state->save_item(NAME(state->m_tmp_bitmap[1]));
- state->save_item(NAME(state->m_tmp_bitmap[2]));
- state->save_item(NAME(state->m_tmp_bitmap[3]));
+ machine().primary_screen->register_screen_bitmap(m_tmp_bitmap[0]);
+ machine().primary_screen->register_screen_bitmap(m_tmp_bitmap[1]);
+ machine().primary_screen->register_screen_bitmap(m_tmp_bitmap[2]);
+ machine().primary_screen->register_screen_bitmap(m_tmp_bitmap[3]);
+ save_item(NAME(m_tmp_bitmap[0]));
+ save_item(NAME(m_tmp_bitmap[1]));
+ save_item(NAME(m_tmp_bitmap[2]));
+ save_item(NAME(m_tmp_bitmap[3]));
- state->m_vidram = auto_alloc_array(machine, UINT8, 0x100 * 0x100 * 4);
+ m_vidram = auto_alloc_array(machine(), UINT8, 0x100 * 0x100 * 4);
- state->save_pointer(NAME(state->m_vidram), 0x100 * 0x100 * 4);
+ save_pointer(NAME(m_vidram), 0x100 * 0x100 * 4);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/bigstrkb.c b/src/mame/video/bigstrkb.c
index 985b7b9a882..09bd79ab848 100644
--- a/src/mame/video/bigstrkb.c
+++ b/src/mame/video/bigstrkb.c
@@ -110,16 +110,15 @@ WRITE16_MEMBER(bigstrkb_state::bsb_videoram3_w)
/* Video Start / Update */
-VIDEO_START(bigstrkb)
+void bigstrkb_state::video_start()
{
- bigstrkb_state *state = machine.driver_data<bigstrkb_state>();
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bigstrkb_state::get_bsb_tile_info),state),TILEMAP_SCAN_COLS, 8, 8,64,32);
- state->m_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bigstrkb_state::get_bsb_tile2_info),state),tilemap_mapper_delegate(FUNC(bigstrkb_state::bsb_bg_scan),state), 16, 16,128,64);
- state->m_tilemap3 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bigstrkb_state::get_bsb_tile3_info),state),tilemap_mapper_delegate(FUNC(bigstrkb_state::bsb_bg_scan),state), 16, 16,128,64);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bigstrkb_state::get_bsb_tile_info),this),TILEMAP_SCAN_COLS, 8, 8,64,32);
+ m_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bigstrkb_state::get_bsb_tile2_info),this),tilemap_mapper_delegate(FUNC(bigstrkb_state::bsb_bg_scan),this), 16, 16,128,64);
+ m_tilemap3 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bigstrkb_state::get_bsb_tile3_info),this),tilemap_mapper_delegate(FUNC(bigstrkb_state::bsb_bg_scan),this), 16, 16,128,64);
- state->m_tilemap->set_transparent_pen(15);
- //state->m_tilemap2->set_transparent_pen(15);
- state->m_tilemap3->set_transparent_pen(15);
+ m_tilemap->set_transparent_pen(15);
+ //m_tilemap2->set_transparent_pen(15);
+ m_tilemap3->set_transparent_pen(15);
}
SCREEN_UPDATE_IND16(bigstrkb)
diff --git a/src/mame/video/bionicc.c b/src/mame/video/bionicc.c
index fa7f88ac9e3..4500d18d6f3 100644
--- a/src/mame/video/bionicc.c
+++ b/src/mame/video/bionicc.c
@@ -89,18 +89,17 @@ TILE_GET_INFO_MEMBER(bionicc_state::get_tx_tile_info)
***************************************************************************/
-VIDEO_START( bionicc )
+void bionicc_state::video_start()
{
- bionicc_state *state = machine.driver_data<bionicc_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bionicc_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bionicc_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bionicc_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bionicc_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bionicc_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bionicc_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tx_tilemap->set_transparent_pen(3);
- state->m_fg_tilemap->set_transmask(0, 0xffff, 0x8000); /* split type 0 is completely transparent in front half */
- state->m_fg_tilemap->set_transmask(1, 0xffc1, 0x803e); /* split type 1 has pens 1-5 opaque in front half */
- state->m_bg_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(3);
+ m_fg_tilemap->set_transmask(0, 0xffff, 0x8000); /* split type 0 is completely transparent in front half */
+ m_fg_tilemap->set_transmask(1, 0xffc1, 0x803e); /* split type 1 has pens 1-5 opaque in front half */
+ m_bg_tilemap->set_transparent_pen(15);
}
diff --git a/src/mame/video/bishi.c b/src/mame/video/bishi.c
index d194fb19375..4da225aafee 100644
--- a/src/mame/video/bishi.c
+++ b/src/mame/video/bishi.c
@@ -24,24 +24,23 @@ void bishi_tile_callback( running_machine &machine, int layer, int *code, int *c
*color = state->m_layer_colorbase[layer] + ((*color & 0xf0));
}
-VIDEO_START( bishi )
+void bishi_state::video_start()
{
- bishi_state *state = machine.driver_data<bishi_state>();
- assert(machine.primary_screen->format() == BITMAP_FORMAT_RGB32);
+ assert(machine().primary_screen->format() == BITMAP_FORMAT_RGB32);
- k056832_set_layer_association(state->m_k056832, 0);
+ k056832_set_layer_association(m_k056832, 0);
- k056832_set_layer_offs(state->m_k056832, 0, -2, 0);
- k056832_set_layer_offs(state->m_k056832, 1, 2, 0);
- k056832_set_layer_offs(state->m_k056832, 2, 4, 0);
- k056832_set_layer_offs(state->m_k056832, 3, 6, 0);
+ k056832_set_layer_offs(m_k056832, 0, -2, 0);
+ k056832_set_layer_offs(m_k056832, 1, 2, 0);
+ k056832_set_layer_offs(m_k056832, 2, 4, 0);
+ k056832_set_layer_offs(m_k056832, 3, 6, 0);
// the 55555 is set to "0x10, 0x11, 0x12, 0x13", but these values are almost correct...
- state->m_layer_colorbase[0] = 0x00;
- state->m_layer_colorbase[1] = 0x40; // this one is wrong
- state->m_layer_colorbase[2] = 0x80;
- state->m_layer_colorbase[3] = 0xc0;
+ m_layer_colorbase[0] = 0x00;
+ m_layer_colorbase[1] = 0x40; // this one is wrong
+ m_layer_colorbase[2] = 0x80;
+ m_layer_colorbase[3] = 0xc0;
}
SCREEN_UPDATE_RGB32(bishi)
diff --git a/src/mame/video/bking.c b/src/mame/video/bking.c
index b5779dfbffe..fd9949d96d6 100644
--- a/src/mame/video/bking.c
+++ b/src/mame/video/bking.c
@@ -28,9 +28,9 @@
***************************************************************************/
-PALETTE_INIT( bking )
+void bking_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 220, 390, 820 };
static const int resistances_b [2] = { 220, 390 };
double rweights[3], gweights[3], bweights[2];
@@ -42,7 +42,7 @@ PALETTE_INIT( bking )
3, &resistances_rg[0], gweights, 0, 0,
2, &resistances_b[0], bweights, 0, 0);
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
UINT16 pen;
int bit0, bit1, bit2, r, g, b;
@@ -78,7 +78,7 @@ PALETTE_INIT( bking )
bit1 = (color_prom[pen] >> 7) & 0x01;
b = combine_2_weights(gweights, bit0, bit1);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -222,15 +222,14 @@ TILE_GET_INFO_MEMBER(bking_state::get_tile_info)
}
-VIDEO_START( bking )
+void bking_state::video_start()
{
- bking_state *state = machine.driver_data<bking_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bking_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap1);
- machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap2);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bking_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ machine().primary_screen->register_screen_bitmap(m_tmp_bitmap1);
+ machine().primary_screen->register_screen_bitmap(m_tmp_bitmap2);
- state->save_item(NAME(state->m_tmp_bitmap1));
- state->save_item(NAME(state->m_tmp_bitmap2));
+ save_item(NAME(m_tmp_bitmap1));
+ save_item(NAME(m_tmp_bitmap2));
}
diff --git a/src/mame/video/bladestl.c b/src/mame/video/bladestl.c
index 09ac6735278..f9aaec48c08 100644
--- a/src/mame/video/bladestl.c
+++ b/src/mame/video/bladestl.c
@@ -3,23 +3,23 @@
#include "includes/bladestl.h"
-PALETTE_INIT( bladestl )
+void bladestl_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x30);
+ machine().colortable = colortable_alloc(machine(), 0x30);
/* characters use pens 0x00-0x1f, no look-up table */
for (i = 0; i < 0x20; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprites use pens 0x20-0x2f */
for (i = 0x20; i < 0x120; i++)
{
UINT8 ctabentry = (color_prom[i - 0x20] & 0x0f) | 0x20;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
diff --git a/src/mame/video/blktiger.c b/src/mame/video/blktiger.c
index b8c34559fef..3567d1dbbdf 100644
--- a/src/mame/video/blktiger.c
+++ b/src/mame/video/blktiger.c
@@ -62,33 +62,32 @@ TILE_GET_INFO_MEMBER(blktiger_state::get_tx_tile_info)
***************************************************************************/
-VIDEO_START( blktiger )
+void blktiger_state::video_start()
{
- blktiger_state *state = machine.driver_data<blktiger_state>();
- state->m_chon = 1;
- state->m_bgon = 1;
- state->m_objon = 1;
- state->m_screen_layout = 0;
+ m_chon = 1;
+ m_bgon = 1;
+ m_objon = 1;
+ m_screen_layout = 0;
- state->m_scroll_ram = auto_alloc_array(machine, UINT8, BGRAM_BANK_SIZE * BGRAM_BANKS);
+ m_scroll_ram = auto_alloc_array(machine(), UINT8, BGRAM_BANK_SIZE * BGRAM_BANKS);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(blktiger_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap8x4 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(blktiger_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(blktiger_state::bg8x4_scan),state), 16, 16, 128, 64);
- state->m_bg_tilemap4x8 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(blktiger_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(blktiger_state::bg4x8_scan),state), 16, 16, 64, 128);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(blktiger_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap8x4 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(blktiger_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(blktiger_state::bg8x4_scan),this), 16, 16, 128, 64);
+ m_bg_tilemap4x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(blktiger_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(blktiger_state::bg4x8_scan),this), 16, 16, 64, 128);
- state->m_tx_tilemap->set_transparent_pen(3);
+ m_tx_tilemap->set_transparent_pen(3);
- state->m_bg_tilemap8x4->set_transmask(0, 0xffff, 0x8000); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap8x4->set_transmask(1, 0xfff0, 0x800f); /* split type 1 has pens 4-15 transparent in front half */
- state->m_bg_tilemap8x4->set_transmask(2, 0xff00, 0x80ff); /* split type 1 has pens 8-15 transparent in front half */
- state->m_bg_tilemap8x4->set_transmask(3, 0xf000, 0x8fff); /* split type 1 has pens 12-15 transparent in front half */
- state->m_bg_tilemap4x8->set_transmask(0, 0xffff, 0x8000);
- state->m_bg_tilemap4x8->set_transmask(1, 0xfff0, 0x800f);
- state->m_bg_tilemap4x8->set_transmask(2, 0xff00, 0x80ff);
- state->m_bg_tilemap4x8->set_transmask(3, 0xf000, 0x8fff);
+ m_bg_tilemap8x4->set_transmask(0, 0xffff, 0x8000); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap8x4->set_transmask(1, 0xfff0, 0x800f); /* split type 1 has pens 4-15 transparent in front half */
+ m_bg_tilemap8x4->set_transmask(2, 0xff00, 0x80ff); /* split type 1 has pens 8-15 transparent in front half */
+ m_bg_tilemap8x4->set_transmask(3, 0xf000, 0x8fff); /* split type 1 has pens 12-15 transparent in front half */
+ m_bg_tilemap4x8->set_transmask(0, 0xffff, 0x8000);
+ m_bg_tilemap4x8->set_transmask(1, 0xfff0, 0x800f);
+ m_bg_tilemap4x8->set_transmask(2, 0xff00, 0x80ff);
+ m_bg_tilemap4x8->set_transmask(3, 0xf000, 0x8fff);
- state->save_pointer(NAME(state->m_scroll_ram), BGRAM_BANK_SIZE * BGRAM_BANKS);
+ save_pointer(NAME(m_scroll_ram), BGRAM_BANK_SIZE * BGRAM_BANKS);
}
diff --git a/src/mame/video/blmbycar.c b/src/mame/video/blmbycar.c
index 40beb5f8caf..8fde491520c 100644
--- a/src/mame/video/blmbycar.c
+++ b/src/mame/video/blmbycar.c
@@ -118,19 +118,18 @@ WRITE16_MEMBER(blmbycar_state::blmbycar_vram_1_w)
***************************************************************************/
-VIDEO_START( blmbycar )
+void blmbycar_state::video_start()
{
- blmbycar_state *state = machine.driver_data<blmbycar_state>();
- state->m_tilemap_0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(blmbycar_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 16, 16, DIM_NX, DIM_NY );
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(blmbycar_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS, 16, 16, DIM_NX, DIM_NY );
+ m_tilemap_0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(blmbycar_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 16, 16, DIM_NX, DIM_NY );
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(blmbycar_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 16, 16, DIM_NX, DIM_NY );
- state->m_tilemap_0->set_scroll_rows(1);
- state->m_tilemap_0->set_scroll_cols(1);
+ m_tilemap_0->set_scroll_rows(1);
+ m_tilemap_0->set_scroll_cols(1);
- state->m_tilemap_1->set_scroll_rows(1);
- state->m_tilemap_1->set_scroll_cols(1);
- state->m_tilemap_1->set_transparent_pen(0);
+ m_tilemap_1->set_scroll_rows(1);
+ m_tilemap_1->set_scroll_cols(1);
+ m_tilemap_1->set_transparent_pen(0);
}
diff --git a/src/mame/video/blockade.c b/src/mame/video/blockade.c
index 9645634c2e6..01c00e64e48 100644
--- a/src/mame/video/blockade.c
+++ b/src/mame/video/blockade.c
@@ -20,10 +20,9 @@ TILE_GET_INFO_MEMBER(blockade_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, 0, 0);
}
-VIDEO_START( blockade )
+void blockade_state::video_start()
{
- blockade_state *state = machine.driver_data<blockade_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(blockade_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(blockade_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
SCREEN_UPDATE_IND16( blockade )
diff --git a/src/mame/video/blockhl.c b/src/mame/video/blockhl.c
index 4d415dd76ad..0b827b81b09 100644
--- a/src/mame/video/blockhl.c
+++ b/src/mame/video/blockhl.c
@@ -41,16 +41,15 @@ void blockhl_sprite_callback( running_machine &machine, int *code, int *color, i
***************************************************************************/
-VIDEO_START( blockhl )
+void blockhl_state::video_start()
{
- blockhl_state *state = machine.driver_data<blockhl_state>();
- state->m_generic_paletteram_8.allocate(0x800);
+ m_generic_paletteram_8.allocate(0x800);
- state->m_layer_colorbase[0] = 0;
- state->m_layer_colorbase[1] = 16;
- state->m_layer_colorbase[2] = 32;
- state->m_sprite_colorbase = 48;
+ m_layer_colorbase[0] = 0;
+ m_layer_colorbase[1] = 16;
+ m_layer_colorbase[2] = 32;
+ m_sprite_colorbase = 48;
}
SCREEN_UPDATE_IND16( blockhl )
diff --git a/src/mame/video/blockout.c b/src/mame/video/blockout.c
index f96835c5eb3..15024f4d33c 100644
--- a/src/mame/video/blockout.c
+++ b/src/mame/video/blockout.c
@@ -59,13 +59,12 @@ WRITE16_MEMBER(blockout_state::blockout_frontcolor_w)
Start the video hardware emulation.
***************************************************************************/
-VIDEO_START( blockout )
+void blockout_state::video_start()
{
- blockout_state *state = machine.driver_data<blockout_state>();
/* Allocate temporary bitmaps */
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap);
- state->save_item(NAME(state->m_tmpbitmap));
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap);
+ save_item(NAME(m_tmpbitmap));
}
static void update_pixels( running_machine &machine, int x, int y )
diff --git a/src/mame/video/bloodbro.c b/src/mame/video/bloodbro.c
index c8d18dfd22a..a43d6056aa8 100644
--- a/src/mame/video/bloodbro.c
+++ b/src/mame/video/bloodbro.c
@@ -52,15 +52,14 @@ TILE_GET_INFO_MEMBER(bloodbro_state::get_tx_tile_info)
***************************************************************************/
-VIDEO_START( bloodbro )
+void bloodbro_state::video_start()
{
- bloodbro_state *state = machine.driver_data<bloodbro_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bloodbro_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS, 16,16,32,16);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bloodbro_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,16);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bloodbro_state::get_tx_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bloodbro_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS, 16,16,32,16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bloodbro_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,16);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bloodbro_state::get_tx_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
}
diff --git a/src/mame/video/blstroid.c b/src/mame/video/blstroid.c
index 0c323e7a308..0586dfadae8 100644
--- a/src/mame/video/blstroid.c
+++ b/src/mame/video/blstroid.c
@@ -33,7 +33,7 @@ TILE_GET_INFO_MEMBER(blstroid_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( blstroid )
+VIDEO_START_MEMBER(blstroid_state,blstroid)
{
static const atarimo_desc modesc =
{
@@ -71,13 +71,12 @@ VIDEO_START( blstroid )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- blstroid_state *state = machine.driver_data<blstroid_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(blstroid_state::get_playfield_tile_info),state), TILEMAP_SCAN_ROWS, 16,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(blstroid_state::get_playfield_tile_info),this), TILEMAP_SCAN_ROWS, 16,8, 64,64);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
}
diff --git a/src/mame/video/blueprnt.c b/src/mame/video/blueprnt.c
index dd2bff62054..d7512b85a03 100644
--- a/src/mame/video/blueprnt.c
+++ b/src/mame/video/blueprnt.c
@@ -20,11 +20,11 @@
***************************************************************************/
-PALETTE_INIT( blueprnt )
+void blueprnt_state::palette_init()
{
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
UINT8 pen;
int r, g, b;
@@ -42,7 +42,7 @@ PALETTE_INIT( blueprnt )
g = ((pen >> 2) & 1) * ((pen & 0x08) ? 0xbf : 0xff);
b = ((pen >> 1) & 1) * ((pen & 0x08) ? 0xbf : 0xff);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -83,15 +83,14 @@ TILE_GET_INFO_MEMBER(blueprnt_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( blueprnt )
+void blueprnt_state::video_start()
{
- blueprnt_state *state = machine.driver_data<blueprnt_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(blueprnt_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS_FLIP_X, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(blueprnt_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS_FLIP_X, 8, 8, 32, 32);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scroll_cols(32);
- state->save_item(NAME(state->m_gfx_bank));
+ save_item(NAME(m_gfx_bank));
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/bogeyman.c b/src/mame/video/bogeyman.c
index 0961e89cd5c..759f1b80f14 100644
--- a/src/mame/video/bogeyman.c
+++ b/src/mame/video/bogeyman.c
@@ -2,9 +2,9 @@
#include "includes/bogeyman.h"
-PALETTE_INIT( bogeyman )
+void bogeyman_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* first 16 colors are RAM */
@@ -31,7 +31,7 @@ PALETTE_INIT( bogeyman )
bit2 = (color_prom[256] >> 3) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i + 16, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i + 16, MAKE_RGB(r,g,b));
color_prom++;
}
}
@@ -90,13 +90,12 @@ TILE_GET_INFO_MEMBER(bogeyman_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(gfxbank, code, m_colbank, 0);
}
-VIDEO_START( bogeyman )
+void bogeyman_state::video_start()
{
- bogeyman_state *state = machine.driver_data<bogeyman_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bogeyman_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bogeyman_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bogeyman_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bogeyman_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/bombjack.c b/src/mame/video/bombjack.c
index 7e838a19c6d..6297c5f309e 100644
--- a/src/mame/video/bombjack.c
+++ b/src/mame/video/bombjack.c
@@ -61,13 +61,12 @@ TILE_GET_INFO_MEMBER(bombjack_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( bombjack )
+void bombjack_state::video_start()
{
- bombjack_state *state = machine.driver_data<bombjack_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bombjack_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bombjack_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bombjack_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bombjack_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/boogwing.c b/src/mame/video/boogwing.c
index 78dee27ec80..492376bf3f4 100644
--- a/src/mame/video/boogwing.c
+++ b/src/mame/video/boogwing.c
@@ -4,10 +4,10 @@
#include "video/decocomn.h"
#include "video/decospr.h"
-VIDEO_START( boogwing )
+void boogwing_state::video_start()
{
- machine.device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
- machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
}
diff --git a/src/mame/video/bosco.c b/src/mame/video/bosco.c
index 39359a4075d..e4657df0a41 100644
--- a/src/mame/video/bosco.c
+++ b/src/mame/video/bosco.c
@@ -14,12 +14,12 @@
#define STARS_COLOR_BASE (64*4+64*4+4)
#define VIDEO_RAM_SIZE 0x400
-PALETTE_INIT( bosco )
+PALETTE_INIT_MEMBER(bosco_state,bosco)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- machine.colortable = colortable_alloc(machine, 32+64);
+ machine().colortable = colortable_alloc(machine(), 32+64);
/* core palette */
for (i = 0;i < 32;i++)
@@ -40,7 +40,7 @@ PALETTE_INIT( bosco )
bit2 = ((*color_prom) >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
@@ -57,24 +57,24 @@ PALETTE_INIT( bosco )
bits = (i >> 4) & 0x03;
b = map[bits];
- colortable_palette_set_color(machine.colortable,32 + i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable,32 + i,MAKE_RGB(r,g,b));
}
/* characters / sprites */
for (i = 0;i < 64*4;i++)
{
- colortable_entry_set_value(machine.colortable, i, (color_prom[i] & 0x0f) + 0x10); /* chars */
- colortable_entry_set_value(machine.colortable, i+64*4, color_prom[i] & 0x0f); /* sprites */
+ colortable_entry_set_value(machine().colortable, i, (color_prom[i] & 0x0f) + 0x10); /* chars */
+ colortable_entry_set_value(machine().colortable, i+64*4, color_prom[i] & 0x0f); /* sprites */
}
/* bullets lookup table */
/* they use colors 28-31, I think - PAL 5A controls it */
for (i = 0;i < 4;i++)
- colortable_entry_set_value(machine.colortable, 64*4+64*4+i, 31-i);
+ colortable_entry_set_value(machine().colortable, 64*4+64*4+i, 31-i);
/* now the stars */
for (i = 0;i < 64;i++)
- colortable_entry_set_value(machine.colortable, 64*4+64*4+4+i, 32 + i);
+ colortable_entry_set_value(machine().colortable, 64*4+64*4+4+i, 32 + i);
}
@@ -124,26 +124,25 @@ TILE_GET_INFO_MEMBER(bosco_state::fg_get_tile_info )
***************************************************************************/
-VIDEO_START( bosco )
+VIDEO_START_MEMBER(bosco_state,bosco)
{
- bosco_state *state = machine.driver_data<bosco_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bosco_state::bg_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bosco_state::fg_get_tile_info),state),tilemap_mapper_delegate(FUNC(bosco_state::fg_tilemap_scan),state), 8,8, 8,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bosco_state::bg_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bosco_state::fg_get_tile_info),this),tilemap_mapper_delegate(FUNC(bosco_state::fg_tilemap_scan),this), 8,8, 8,32);
- colortable_configure_tilemap_groups(machine.colortable, state->m_bg_tilemap, machine.gfx[0], 0x1f);
- colortable_configure_tilemap_groups(machine.colortable, state->m_fg_tilemap, machine.gfx[0], 0x1f);
+ colortable_configure_tilemap_groups(machine().colortable, m_bg_tilemap, machine().gfx[0], 0x1f);
+ colortable_configure_tilemap_groups(machine().colortable, m_fg_tilemap, machine().gfx[0], 0x1f);
- state->m_bg_tilemap->set_scrolldx(3,3);
+ m_bg_tilemap->set_scrolldx(3,3);
- state->m_spriteram = state->m_videoram + 0x03d4;
- state->m_spriteram_size = 0x0c;
- state->m_spriteram2 = state->m_spriteram + 0x0800;
- state->m_bosco_radarx = state->m_videoram + 0x03f0;
- state->m_bosco_radary = state->m_bosco_radarx + 0x0800;
+ m_spriteram = m_videoram + 0x03d4;
+ m_spriteram_size = 0x0c;
+ m_spriteram2 = m_spriteram + 0x0800;
+ m_bosco_radarx = m_videoram + 0x03f0;
+ m_bosco_radary = m_bosco_radarx + 0x0800;
- state->save_item(NAME(state->m_stars_scrollx));
- state->save_item(NAME(state->m_stars_scrolly));
+ save_item(NAME(m_stars_scrollx));
+ save_item(NAME(m_stars_scrolly));
}
diff --git a/src/mame/video/bottom9.c b/src/mame/video/bottom9.c
index e14ea5f9bcb..542337dde90 100644
--- a/src/mame/video/bottom9.c
+++ b/src/mame/video/bottom9.c
@@ -54,15 +54,14 @@ void bottom9_zoom_callback( running_machine &machine, int *code, int *color, int
***************************************************************************/
-VIDEO_START( bottom9 )
+void bottom9_state::video_start()
{
- bottom9_state *state = machine.driver_data<bottom9_state>();
- state->m_layer_colorbase[0] = 0; /* not used */
- state->m_layer_colorbase[1] = 0;
- state->m_layer_colorbase[2] = 16;
- state->m_sprite_colorbase = 32;
- state->m_zoom_colorbase = 48;
+ m_layer_colorbase[0] = 0; /* not used */
+ m_layer_colorbase[1] = 0;
+ m_layer_colorbase[2] = 16;
+ m_sprite_colorbase = 32;
+ m_zoom_colorbase = 48;
}
diff --git a/src/mame/video/brkthru.c b/src/mame/video/brkthru.c
index a2018877eba..1297d04a7a8 100644
--- a/src/mame/video/brkthru.c
+++ b/src/mame/video/brkthru.c
@@ -32,12 +32,12 @@
***************************************************************************/
-PALETTE_INIT( brkthru )
+void brkthru_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, bit3, r, g, b;
@@ -51,13 +51,13 @@ PALETTE_INIT( brkthru )
bit2 = (color_prom[0] >> 6) & 0x01;
bit3 = (color_prom[0] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
color_prom++;
}
@@ -107,15 +107,14 @@ WRITE8_MEMBER(brkthru_state::brkthru_fgram_w)
m_fg_tilemap->mark_tile_dirty(offset);
}
-VIDEO_START( brkthru )
+void brkthru_state::video_start()
{
- brkthru_state *state = machine.driver_data<brkthru_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(brkthru_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(brkthru_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 32, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(brkthru_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(brkthru_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 16);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/bsktball.c b/src/mame/video/bsktball.c
index f101d1ce481..ca9285d73e9 100644
--- a/src/mame/video/bsktball.c
+++ b/src/mame/video/bsktball.c
@@ -25,10 +25,9 @@ TILE_GET_INFO_MEMBER(bsktball_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( bsktball )
+void bsktball_state::video_start()
{
- bsktball_state *state = machine.driver_data<bsktball_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bsktball_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bsktball_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/btime.c b/src/mame/video/btime.c
index 7d91b9a5ae6..5906ea7dbbc 100644
--- a/src/mame/video/btime.c
+++ b/src/mame/video/btime.c
@@ -28,9 +28,9 @@
***************************************************************************/
-PALETTE_INIT( btime )
+PALETTE_INIT_MEMBER(btime_state,btime)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
@@ -38,7 +38,7 @@ PALETTE_INIT( btime )
/* This function is also used by Eggs. */
if (color_prom == 0) return;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -58,7 +58,7 @@ PALETTE_INIT( btime )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
}
@@ -79,12 +79,12 @@ PALETTE_INIT( btime )
***************************************************************************/
-PALETTE_INIT( lnc )
+PALETTE_INIT_MEMBER(btime_state,lnc)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -104,7 +104,7 @@ PALETTE_INIT( lnc )
bit2 = (color_prom[i] >> 0) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
}
@@ -114,28 +114,26 @@ Start the video hardware emulation.
***************************************************************************/
-VIDEO_START( btime )
+VIDEO_START_MEMBER(btime_state,btime)
{
- btime_state *state = machine.driver_data<btime_state>();
- if (machine.gfx[0]->srcdata() == NULL)
- machine.gfx[0]->set_source(state->m_deco_charram);
- if (machine.gfx[1]->srcdata() == NULL)
- machine.gfx[1]->set_source(state->m_deco_charram);
+ if (machine().gfx[0]->srcdata() == NULL)
+ machine().gfx[0]->set_source(m_deco_charram);
+ if (machine().gfx[1]->srcdata() == NULL)
+ machine().gfx[1]->set_source(m_deco_charram);
}
-VIDEO_START( bnj )
+VIDEO_START_MEMBER(btime_state,bnj)
{
- btime_state *state = machine.driver_data<btime_state>();
/* the background area is twice as wide as the screen */
int width = 256;
int height = 256;
- state->m_background_bitmap = auto_bitmap_ind16_alloc(machine, 2 * width, height);
+ m_background_bitmap = auto_bitmap_ind16_alloc(machine(), 2 * width, height);
- state->save_item(NAME(*state->m_background_bitmap));
+ save_item(NAME(*m_background_bitmap));
- VIDEO_START_CALL(btime);
+ VIDEO_START_CALL_MEMBER(btime);
}
diff --git a/src/mame/video/buggychl.c b/src/mame/video/buggychl.c
index daf845882fd..da1884d8140 100644
--- a/src/mame/video/buggychl.c
+++ b/src/mame/video/buggychl.c
@@ -2,25 +2,24 @@
#include "includes/buggychl.h"
-PALETTE_INIT( buggychl )
+void buggychl_state::palette_init()
{
int i;
/* arbitrary blue shading for the sky, estimation */
for (i = 0; i < 128; i++)
- palette_set_color(machine, i + 128, MAKE_RGB(0, 240-i, 255));
+ palette_set_color(machine(), i + 128, MAKE_RGB(0, 240-i, 255));
}
-VIDEO_START( buggychl )
+void buggychl_state::video_start()
{
- buggychl_state *state = machine.driver_data<buggychl_state>();
- machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap1);
- machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap2);
+ machine().primary_screen->register_screen_bitmap(m_tmp_bitmap1);
+ machine().primary_screen->register_screen_bitmap(m_tmp_bitmap2);
- state->save_item(NAME(state->m_tmp_bitmap1));
- state->save_item(NAME(state->m_tmp_bitmap2));
+ save_item(NAME(m_tmp_bitmap1));
+ save_item(NAME(m_tmp_bitmap2));
- machine.gfx[0]->set_source(state->m_charram);
+ machine().gfx[0]->set_source(m_charram);
}
diff --git a/src/mame/video/bwing.c b/src/mame/video/bwing.c
index 7091c86f6e4..69fa184658a 100644
--- a/src/mame/video/bwing.c
+++ b/src/mame/video/bwing.c
@@ -193,42 +193,41 @@ TILEMAP_MAPPER_MEMBER(bwing_state::bwing_scan_cols)
}
-VIDEO_START( bwing )
+void bwing_state::video_start()
{
- bwing_state *state = machine.driver_data<bwing_state>();
// UINT32 *dwptr;
int i;
- state->m_charmap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bwing_state::get_charinfo),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_fgmap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bwing_state::get_fgtileinfo),state), tilemap_mapper_delegate(FUNC(bwing_state::bwing_scan_cols),state), 16, 16, 64, 64);
- state->m_bgmap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(bwing_state::get_bgtileinfo),state), tilemap_mapper_delegate(FUNC(bwing_state::bwing_scan_cols),state), 16, 16, 64, 64);
+ m_charmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bwing_state::get_charinfo),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_fgmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bwing_state::get_fgtileinfo),this), tilemap_mapper_delegate(FUNC(bwing_state::bwing_scan_cols),this), 16, 16, 64, 64);
+ m_bgmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(bwing_state::get_bgtileinfo),this), tilemap_mapper_delegate(FUNC(bwing_state::bwing_scan_cols),this), 16, 16, 64, 64);
- state->m_charmap->set_transparent_pen(0);
- state->m_fgmap->set_transparent_pen(0);
+ m_charmap->set_transparent_pen(0);
+ m_fgmap->set_transparent_pen(0);
- state->m_srxlat = auto_alloc_array(machine, int, 0x2000);
- state->save_pointer(NAME(state->m_srxlat), 0x2000);
+ m_srxlat = auto_alloc_array(machine(), int, 0x2000);
+ save_pointer(NAME(m_srxlat), 0x2000);
- fill_srxlat(state->m_srxlat);
+ fill_srxlat(m_srxlat);
- state->m_fgdata = state->memregion("gpu")->base();
- state->m_bgdata = state->m_fgdata + 0x1000;
+ m_fgdata = memregion("gpu")->base();
+ m_bgdata = m_fgdata + 0x1000;
for (i = 0; i < 4; i++)
- state->m_srbase[i] = state->m_fgdata + i * 0x2000;
+ m_srbase[i] = m_fgdata + i * 0x2000;
for (i = 0; i < 8; i++)
- state->m_sreg[i] = 0;
+ m_sreg[i] = 0;
-// state->m_fgfx = machine.gfx[2];
- machine.gfx[2]->set_source(state->m_srbase[1]);
+// m_fgfx = machine().gfx[2];
+ machine().gfx[2]->set_source(m_srbase[1]);
-// state->m_bgfx = machine.gfx[3];
- machine.gfx[3]->set_source(state->m_srbase[1] + 0x1000);
+// m_bgfx = machine().gfx[3];
+ machine().gfx[3]->set_source(m_srbase[1] + 0x1000);
/*
WTF??
- dwptr = machine.gfx[2]->pen_usage();
+ dwptr = machine().gfx[2]->pen_usage();
if (dwptr)
{
dwptr[0] = 0;
diff --git a/src/mame/video/cabal.c b/src/mame/video/cabal.c
index 008dc78bc14..a700645528b 100644
--- a/src/mame/video/cabal.c
+++ b/src/mame/video/cabal.c
@@ -40,15 +40,14 @@ TILE_GET_INFO_MEMBER(cabal_state::get_text_tile_info)
}
-VIDEO_START( cabal )
+void cabal_state::video_start()
{
- cabal_state *state = machine.driver_data<cabal_state>();
- state->m_background_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cabal_state::get_back_tile_info),state),TILEMAP_SCAN_ROWS,16,16,16,16);
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cabal_state::get_text_tile_info),state),TILEMAP_SCAN_ROWS, 8,8,32,32);
+ m_background_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cabal_state::get_back_tile_info),this),TILEMAP_SCAN_ROWS,16,16,16,16);
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cabal_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,32,32);
- state->m_text_layer->set_transparent_pen(3);
- state->m_background_layer->set_transparent_pen(15);
+ m_text_layer->set_transparent_pen(3);
+ m_background_layer->set_transparent_pen(15);
}
diff --git a/src/mame/video/calomega.c b/src/mame/video/calomega.c
index 654d61ff331..f7b088085c6 100644
--- a/src/mame/video/calomega.c
+++ b/src/mame/video/calomega.c
@@ -54,10 +54,9 @@ TILE_GET_INFO_MEMBER(calomega_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(bank, code, color, 0);
}
-VIDEO_START( calomega )
+void calomega_state::video_start()
{
- calomega_state *state = machine.driver_data<calomega_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(calomega_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 31);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(calomega_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 31);
}
SCREEN_UPDATE_IND16( calomega )
@@ -67,9 +66,9 @@ SCREEN_UPDATE_IND16( calomega )
return 0;
}
-PALETTE_INIT( calomega )
+void calomega_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
/* prom bits
7654 3210
---- ---x red component.
@@ -82,7 +81,7 @@ PALETTE_INIT( calomega )
/* 00000BGR */
if (color_prom == 0) return;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -99,6 +98,6 @@ PALETTE_INIT( calomega )
b = bit2 * 0xff;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
diff --git a/src/mame/video/canyon.c b/src/mame/video/canyon.c
index 1f0d43597b3..51aa9eecab6 100644
--- a/src/mame/video/canyon.c
+++ b/src/mame/video/canyon.c
@@ -23,11 +23,10 @@ TILE_GET_INFO_MEMBER(canyon_state::get_bg_tile_info)
}
-VIDEO_START( canyon )
+void canyon_state::video_start()
{
- canyon_state *state = machine.driver_data<canyon_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(canyon_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(canyon_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/capbowl.c b/src/mame/video/capbowl.c
index 728a49912c3..aa3bc93d0b7 100644
--- a/src/mame/video/capbowl.c
+++ b/src/mame/video/capbowl.c
@@ -38,10 +38,10 @@ static const struct tms34061_interface tms34061intf =
*
*************************************/
-VIDEO_START( capbowl )
+void capbowl_state::video_start()
{
/* initialize TMS34061 emulation */
- tms34061_start(machine, &tms34061intf);
+ tms34061_start(machine(), &tms34061intf);
}
diff --git a/src/mame/video/carjmbre.c b/src/mame/video/carjmbre.c
index af377fdb521..633173384bb 100644
--- a/src/mame/video/carjmbre.c
+++ b/src/mame/video/carjmbre.c
@@ -30,15 +30,15 @@ static const res_net_info carjmbre_net_info =
}
};
-PALETTE_INIT( carjmbre )
+void carjmbre_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t *rgb;
- rgb = compute_res_net_all(machine, color_prom, &carjmbre_decode_info, &carjmbre_net_info);
- palette_set_colors(machine, 0, rgb, 64);
- palette_normalize_range(machine.palette, 0, 63, 0, 255);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &carjmbre_decode_info, &carjmbre_net_info);
+ palette_set_colors(machine(), 0, rgb, 64);
+ palette_normalize_range(machine().palette, 0, 63, 0, 255);
+ auto_free(machine(), rgb);
}
@@ -96,13 +96,12 @@ TILE_GET_INFO_MEMBER(carjmbre_state::get_carjmbre_tile_info)
0);
}
-VIDEO_START( carjmbre )
+void carjmbre_state::video_start()
{
- carjmbre_state *state = machine.driver_data<carjmbre_state>();
- state->m_cj_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(carjmbre_state::get_carjmbre_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->save_item(NAME(state->m_flipscreen));
- state->save_item(NAME(state->m_bgcolor));
+ m_cj_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(carjmbre_state::get_carjmbre_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ save_item(NAME(m_flipscreen));
+ save_item(NAME(m_bgcolor));
}
SCREEN_UPDATE_IND16( carjmbre )
diff --git a/src/mame/video/carpolo.c b/src/mame/video/carpolo.c
index 01401b66e43..fb33da2775b 100644
--- a/src/mame/video/carpolo.c
+++ b/src/mame/video/carpolo.c
@@ -64,9 +64,9 @@
*
**************************************************************************/
-PALETTE_INIT( carpolo )
+void carpolo_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* thanks to Jarek Burczynski for analyzing the circuit */
@@ -91,7 +91,7 @@ PALETTE_INIT( carpolo )
};
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
UINT8 pen, r, g, b;
@@ -130,7 +130,7 @@ PALETTE_INIT( carpolo )
/* blue component */
b = ((b_voltage[(color_prom[pen] >> 0) & 0x03] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -141,23 +141,22 @@ PALETTE_INIT( carpolo )
*
*************************************/
-VIDEO_START( carpolo )
+void carpolo_state::video_start()
{
- carpolo_state *state = machine.driver_data<carpolo_state>();
- state->m_sprite_sprite_collision_bitmap1 = auto_bitmap_ind16_alloc(machine, SPRITE_WIDTH*2, SPRITE_HEIGHT*2);
- state->m_sprite_sprite_collision_bitmap2 = auto_bitmap_ind16_alloc(machine, SPRITE_WIDTH*2, SPRITE_HEIGHT*2);
+ m_sprite_sprite_collision_bitmap1 = auto_bitmap_ind16_alloc(machine(), SPRITE_WIDTH*2, SPRITE_HEIGHT*2);
+ m_sprite_sprite_collision_bitmap2 = auto_bitmap_ind16_alloc(machine(), SPRITE_WIDTH*2, SPRITE_HEIGHT*2);
- state->m_sprite_goal_collision_bitmap1 = auto_bitmap_ind16_alloc(machine, SPRITE_WIDTH+GOAL_WIDTH, SPRITE_HEIGHT+GOAL_HEIGHT);
- state->m_sprite_goal_collision_bitmap2 = auto_bitmap_ind16_alloc(machine, SPRITE_WIDTH+GOAL_WIDTH, SPRITE_HEIGHT+GOAL_HEIGHT);
+ m_sprite_goal_collision_bitmap1 = auto_bitmap_ind16_alloc(machine(), SPRITE_WIDTH+GOAL_WIDTH, SPRITE_HEIGHT+GOAL_HEIGHT);
+ m_sprite_goal_collision_bitmap2 = auto_bitmap_ind16_alloc(machine(), SPRITE_WIDTH+GOAL_WIDTH, SPRITE_HEIGHT+GOAL_HEIGHT);
- state->m_sprite_border_collision_bitmap = auto_bitmap_ind16_alloc(machine, SPRITE_WIDTH, SPRITE_HEIGHT);
+ m_sprite_border_collision_bitmap = auto_bitmap_ind16_alloc(machine(), SPRITE_WIDTH, SPRITE_HEIGHT);
- state_save_register_global_bitmap(machine, state->m_sprite_sprite_collision_bitmap1);
- state_save_register_global_bitmap(machine, state->m_sprite_sprite_collision_bitmap2);
- state_save_register_global_bitmap(machine, state->m_sprite_goal_collision_bitmap1);
- state_save_register_global_bitmap(machine, state->m_sprite_goal_collision_bitmap2);
- state_save_register_global_bitmap(machine, state->m_sprite_border_collision_bitmap);
+ state_save_register_global_bitmap(machine(), m_sprite_sprite_collision_bitmap1);
+ state_save_register_global_bitmap(machine(), m_sprite_sprite_collision_bitmap2);
+ state_save_register_global_bitmap(machine(), m_sprite_goal_collision_bitmap1);
+ state_save_register_global_bitmap(machine(), m_sprite_goal_collision_bitmap2);
+ state_save_register_global_bitmap(machine(), m_sprite_border_collision_bitmap);
}
diff --git a/src/mame/video/cave.c b/src/mame/video/cave.c
index 7c46b731331..333a2f93f70 100644
--- a/src/mame/video/cave.c
+++ b/src/mame/video/cave.c
@@ -72,22 +72,20 @@ static void sprite_draw_donpachi_zbuf(running_machine &machine, int priority);
***************************************************************************/
-PALETTE_INIT( cave )
+PALETTE_INIT_MEMBER(cave_state,cave)
{
- cave_state *state = machine.driver_data<cave_state>();
- int maxpen = state->m_paletteram.bytes() / 2;
+ int maxpen = m_paletteram.bytes() / 2;
int pen;
/* create a 1:1 palette map covering everything */
- state->m_palette_map = auto_alloc_array(machine, UINT16, machine.total_colors());
+ m_palette_map = auto_alloc_array(machine(), UINT16, machine().total_colors());
- for (pen = 0; pen < machine.total_colors(); pen++)
- state->m_palette_map[pen] = pen % maxpen;
+ for (pen = 0; pen < machine().total_colors(); pen++)
+ m_palette_map[pen] = pen % maxpen;
}
-PALETTE_INIT( dfeveron )
+PALETTE_INIT_MEMBER(cave_state,dfeveron)
{
- cave_state *state = machine.driver_data<cave_state>();
int color, pen;
/* Fill the 0-3fff range, used by sprites ($40 color codes * $100 pens)
@@ -95,16 +93,15 @@ PALETTE_INIT( dfeveron )
multiplies the color code by $100 (for consistency).
That's why we need this function. */
- PALETTE_INIT_CALL(cave);
+ PALETTE_INIT_CALL_MEMBER(cave);
for (color = 0; color < 0x40; color++)
for (pen = 0; pen < 0x10; pen++)
- state->m_palette_map[(color << 8) | pen] = (color << 4) | pen;
+ m_palette_map[(color << 8) | pen] = (color << 4) | pen;
}
-PALETTE_INIT( ddonpach )
+PALETTE_INIT_MEMBER(cave_state,ddonpach)
{
- cave_state *state = machine.driver_data<cave_state>();
int color, pen;
/* Fill the 8000-83ff range ($40 color codes * $10 pens) for
@@ -112,76 +109,72 @@ PALETTE_INIT( ddonpach )
like layer 2, but use the first 16 color of every 256 for
any given color code. */
- PALETTE_INIT_CALL(cave);
+ PALETTE_INIT_CALL_MEMBER(cave);
for (color = 0; color < 0x40; color++)
for (pen = 0; pen < 0x10; pen++)
- state->m_palette_map[0x8000 | (color << 4) | pen] = 0x4000 | (color << 8) | pen;
+ m_palette_map[0x8000 | (color << 4) | pen] = 0x4000 | (color << 8) | pen;
}
-PALETTE_INIT( mazinger )
+PALETTE_INIT_MEMBER(cave_state,mazinger)
{
- cave_state *state = machine.driver_data<cave_state>();
int color, pen;
- PALETTE_INIT_CALL(cave);
+ PALETTE_INIT_CALL_MEMBER(cave);
/* sprites (encrypted) are 4 bit deep */
for (color = 0; color < 0x40; color++)
for (pen = 0; pen < 0x100; pen++)
- state->m_palette_map[(color << 8) | pen] = (color << 4) + pen; /* yes, PLUS, not OR */
+ m_palette_map[(color << 8) | pen] = (color << 4) + pen; /* yes, PLUS, not OR */
/* layer 0 is 6 bit deep, there are 64 color codes but only $400
colors are actually addressable */
for (color = 0; color < 0x40; color++)
for (pen = 0; pen < 0x40; pen++)
- state->m_palette_map[0x4400 + ((color << 6) | pen)] = 0x400 | ((color & 0x0f) << 6) | pen;
+ m_palette_map[0x4400 + ((color << 6) | pen)] = 0x400 | ((color & 0x0f) << 6) | pen;
}
-PALETTE_INIT( sailormn )
+PALETTE_INIT_MEMBER(cave_state,sailormn)
{
- cave_state *state = machine.driver_data<cave_state>();
int color, pen;
- PALETTE_INIT_CALL(cave);
+ PALETTE_INIT_CALL_MEMBER(cave);
/* sprites (encrypted) are 4 bit deep */
for (color = 0; color < 0x40; color++)
for (pen = 0; pen < 0x100; pen++)
- state->m_palette_map[(color << 8) | pen] = (color << 4) + pen; /* yes, PLUS, not OR */
+ m_palette_map[(color << 8) | pen] = (color << 4) + pen; /* yes, PLUS, not OR */
/* layer 2 is 6 bit deep, there are 64 color codes but only $400
colors are actually addressable */
for (color = 0; color < 0x40; color++)
for (pen = 0; pen < 0x40; pen++)
- state->m_palette_map[0x4c00 | (color << 6) | pen] = 0xc00 | ((color & 0x0f) << 6) | pen;
+ m_palette_map[0x4c00 | (color << 6) | pen] = 0xc00 | ((color & 0x0f) << 6) | pen;
}
-PALETTE_INIT( pwrinst2 )
+PALETTE_INIT_MEMBER(cave_state,pwrinst2)
{
- cave_state *state = machine.driver_data<cave_state>();
int color, pen;
- PALETTE_INIT_CALL(cave);
+ PALETTE_INIT_CALL_MEMBER(cave);
for (color = 0; color < 0x80; color++)
for (pen = 0; pen < 0x10; pen++)
- state->m_palette_map[(color << 8) | pen] = (color << 4) | pen;
+ m_palette_map[(color << 8) | pen] = (color << 4) | pen;
for (pen = 0x8000; pen < 0xa800; pen++)
- state->m_palette_map[pen] = pen - 0x8000;
+ m_palette_map[pen] = pen - 0x8000;
}
-PALETTE_INIT( korokoro )
+PALETTE_INIT_MEMBER(cave_state,korokoro)
{
- cave_state *state = machine.driver_data<cave_state>();
int color, pen;
- PALETTE_INIT_CALL(cave);
+ PALETTE_INIT_CALL_MEMBER(cave);
for (color = 0; color < 0x40; color++)
for (pen = 0; pen < 0x10; pen++)
- state->m_palette_map[(color << 8) | pen] = 0x3c00 | (color << 4) | pen;
+ m_palette_map[(color << 8) | pen] = 0x3c00 | (color << 4) | pen;
}
@@ -459,23 +452,22 @@ static void cave_vh_start( running_machine &machine, int num )
}
}
-VIDEO_START( cave_1_layer ) { cave_vh_start(machine, 1); }
-VIDEO_START( cave_2_layers ) { cave_vh_start(machine, 2); }
-VIDEO_START( cave_3_layers ) { cave_vh_start(machine, 3); }
-VIDEO_START( cave_4_layers ) { cave_vh_start(machine, 4); }
+VIDEO_START_MEMBER(cave_state,cave_1_layer){ cave_vh_start(machine(), 1); }
+VIDEO_START_MEMBER(cave_state,cave_2_layers){ cave_vh_start(machine(), 2); }
+VIDEO_START_MEMBER(cave_state,cave_3_layers){ cave_vh_start(machine(), 3); }
+VIDEO_START_MEMBER(cave_state,cave_4_layers){ cave_vh_start(machine(), 4); }
-VIDEO_START( sailormn_3_layers )
+VIDEO_START_MEMBER(cave_state,sailormn_3_layers)
{
- cave_state *state = machine.driver_data<cave_state>();
- cave_vh_start(machine, 2);
+ cave_vh_start(machine(), 2);
/* Layer 2 (8x8) needs to be handled differently */
- state->m_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cave_state::sailormn_get_tile_info_2),state), TILEMAP_SCAN_ROWS, 8, 8, 512 / 8, 512 / 8 );
+ m_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cave_state::sailormn_get_tile_info_2),this), TILEMAP_SCAN_ROWS, 8, 8, 512 / 8, 512 / 8 );
- state->m_tilemap[2]->set_transparent_pen(0);
- state->m_tilemap[2]->set_scroll_rows(1);
- state->m_tilemap[2]->set_scroll_cols(1);
+ m_tilemap[2]->set_transparent_pen(0);
+ m_tilemap[2]->set_scroll_rows(1);
+ m_tilemap[2]->set_scroll_cols(1);
}
/***************************************************************************
diff --git a/src/mame/video/cbasebal.c b/src/mame/video/cbasebal.c
index a1dc46cec65..d33959594ce 100644
--- a/src/mame/video/cbasebal.c
+++ b/src/mame/video/cbasebal.c
@@ -36,20 +36,19 @@ TILE_GET_INFO_MEMBER(cbasebal_state::get_fg_tile_info)
***************************************************************************/
-VIDEO_START( cbasebal )
+void cbasebal_state::video_start()
{
- cbasebal_state *state = machine.driver_data<cbasebal_state>();
- state->m_textram = auto_alloc_array(machine, UINT8, 0x1000);
- state->m_scrollram = auto_alloc_array(machine, UINT8, 0x1000);
+ m_textram = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_scrollram = auto_alloc_array(machine(), UINT8, 0x1000);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cbasebal_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cbasebal_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cbasebal_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cbasebal_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(3);
+ m_fg_tilemap->set_transparent_pen(3);
- state->save_pointer(NAME(state->m_textram), 0x1000);
- state->save_pointer(NAME(state->m_scrollram), 0x1000);
+ save_pointer(NAME(m_textram), 0x1000);
+ save_pointer(NAME(m_scrollram), 0x1000);
}
diff --git a/src/mame/video/cbuster.c b/src/mame/video/cbuster.c
index 632f1b0b078..c7ea461bfa9 100644
--- a/src/mame/video/cbuster.c
+++ b/src/mame/video/cbuster.c
@@ -43,9 +43,9 @@ WRITE16_MEMBER(cbuster_state::twocrude_palette_24bit_b_w)
/******************************************************************************/
-VIDEO_START( twocrude )
+void cbuster_state::video_start()
{
- machine.device<decospr_device>("spritegen")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen")->alloc_sprite_bitmap();
}
SCREEN_UPDATE_RGB32( twocrude )
diff --git a/src/mame/video/ccastles.c b/src/mame/video/ccastles.c
index 806efb79029..c6b1af6d7e3 100644
--- a/src/mame/video/ccastles.c
+++ b/src/mame/video/ccastles.c
@@ -15,30 +15,29 @@
*
*************************************/
-VIDEO_START( ccastles )
+void ccastles_state::video_start()
{
- ccastles_state *state = machine.driver_data<ccastles_state>();
static const int resistances[3] = { 22000, 10000, 4700 };
/* get pointers to our PROMs */
- state->m_syncprom = machine.root_device().memregion("proms")->base() + 0x000;
- state->m_wpprom = machine.root_device().memregion("proms")->base() + 0x200;
- state->m_priprom = machine.root_device().memregion("proms")->base() + 0x300;
+ m_syncprom = machine().root_device().memregion("proms")->base() + 0x000;
+ m_wpprom = machine().root_device().memregion("proms")->base() + 0x200;
+ m_priprom = machine().root_device().memregion("proms")->base() + 0x300;
/* compute the color output resistor weights at startup */
compute_resistor_weights(0, 255, -1.0,
- 3, resistances, state->m_rweights, 1000, 0,
- 3, resistances, state->m_gweights, 1000, 0,
- 3, resistances, state->m_bweights, 1000, 0);
+ 3, resistances, m_rweights, 1000, 0,
+ 3, resistances, m_gweights, 1000, 0,
+ 3, resistances, m_bweights, 1000, 0);
/* allocate a bitmap for drawing sprites */
- machine.primary_screen->register_screen_bitmap(state->m_spritebitmap);
+ machine().primary_screen->register_screen_bitmap(m_spritebitmap);
/* register for savestates */
- state->save_item(NAME(state->m_video_control));
- state->save_item(NAME(state->m_bitmode_addr));
- state->save_item(NAME(state->m_hscroll));
- state->save_item(NAME(state->m_vscroll));
+ save_item(NAME(m_video_control));
+ save_item(NAME(m_bitmode_addr));
+ save_item(NAME(m_hscroll));
+ save_item(NAME(m_vscroll));
}
diff --git a/src/mame/video/cchasm.c b/src/mame/video/cchasm.c
index 6b8cacbe88f..00341546d88 100644
--- a/src/mame/video/cchasm.c
+++ b/src/mame/video/cchasm.c
@@ -119,13 +119,12 @@ WRITE16_MEMBER(cchasm_state::cchasm_refresh_control_w)
}
}
-VIDEO_START( cchasm )
+void cchasm_state::video_start()
{
- cchasm_state *state = machine.driver_data<cchasm_state>();
- const rectangle &visarea = machine.primary_screen->visible_area();
+ const rectangle &visarea = machine().primary_screen->visible_area();
- state->m_xcenter=visarea.xcenter() << 16;
- state->m_ycenter=visarea.ycenter() << 16;
+ m_xcenter=visarea.xcenter() << 16;
+ m_ycenter=visarea.ycenter() << 16;
- VIDEO_START_CALL(vector);
+ VIDEO_START_CALL_LEGACY(vector);
}
diff --git a/src/mame/video/cclimber.c b/src/mame/video/cclimber.c
index 999009a993d..429f529a2aa 100644
--- a/src/mame/video/cclimber.c
+++ b/src/mame/video/cclimber.c
@@ -36,9 +36,9 @@
bit 0 -- 1 kohm resistor -- RED
***************************************************************************/
-PALETTE_INIT( cclimber )
+PALETTE_INIT_MEMBER(cclimber_state,cclimber)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double weights_rg[3], weights_b[2];
@@ -50,7 +50,7 @@ PALETTE_INIT( cclimber )
2, resistances_b, weights_b, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0;i < machine.total_colors(); i++)
+ for (i = 0;i < machine().total_colors(); i++)
{
int bit0, bit1, bit2;
int r, g, b;
@@ -72,7 +72,7 @@ PALETTE_INIT( cclimber )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(weights_b, bit0, bit1);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -113,9 +113,9 @@ PALETTE_INIT( cclimber )
***************************************************************************/
-PALETTE_INIT( swimmer )
+PALETTE_INIT_MEMBER(cclimber_state,swimmer)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0x100; i++)
@@ -141,7 +141,7 @@ PALETTE_INIT( swimmer )
bit2 = (color_prom[i + 0x100] >> 3) & 0x01;
b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
color_prom += 0x200;
@@ -170,21 +170,21 @@ PALETTE_INIT( swimmer )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
- palette_set_color(machine, i + 0x100, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i + 0x100, MAKE_RGB(r, g, b));
}
/* side panel backgrond pen */
#if 0
// values calculated from the resistors don't seem to match the real board
- palette_set_color(machine, SWIMMER_SIDE_BG_PEN, MAKE_RGB(0x24, 0x5d, 0x4e));
+ palette_set_color(machine(), SWIMMER_SIDE_BG_PEN, MAKE_RGB(0x24, 0x5d, 0x4e));
#endif
- palette_set_color(machine, SWIMMER_SIDE_BG_PEN, MAKE_RGB(0x20, 0x98, 0x79));
+ palette_set_color(machine(), SWIMMER_SIDE_BG_PEN, MAKE_RGB(0x20, 0x98, 0x79));
}
-PALETTE_INIT( yamato )
+PALETTE_INIT_MEMBER(cclimber_state,yamato)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* chars - 12 bits RGB */
@@ -214,7 +214,7 @@ PALETTE_INIT( yamato )
bit3 = (color_prom[i + 0x40] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
/* big sprite - 8 bits RGB */
@@ -241,18 +241,18 @@ PALETTE_INIT( yamato )
bit2 = (color_prom[i + 0x80] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i + 0x40, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i + 0x40, MAKE_RGB(r, g, b));
}
/* fake colors for bg gradient */
for (i = 0; i < 0x100; i++)
- palette_set_color(machine, YAMATO_SKY_PEN_BASE + i, MAKE_RGB(0, 0, i));
+ palette_set_color(machine(), YAMATO_SKY_PEN_BASE + i, MAKE_RGB(0, 0, i));
}
-PALETTE_INIT( toprollr )
+PALETTE_INIT_MEMBER(cclimber_state,toprollr)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0xa0; i++)
@@ -278,7 +278,7 @@ PALETTE_INIT( toprollr )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -436,50 +436,47 @@ TILE_GET_INFO_MEMBER(cclimber_state::toproller_get_bg_tile_info)
}
-VIDEO_START( cclimber )
+VIDEO_START_MEMBER(cclimber_state,cclimber)
{
- cclimber_state *state = machine.driver_data<cclimber_state>();
- state->m_pf_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::cclimber_get_pf_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_pf_tilemap->set_transparent_pen(0);
- state->m_pf_tilemap->set_scroll_cols(32);
-
- state->m_bs_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::cclimber_get_bs_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bs_tilemap->set_scroll_cols(1);
- state->m_bs_tilemap->set_scroll_rows(1);
- state->m_bs_tilemap->set_transmask(0, 0x01, 0); /* pen 0 is transaprent */
- state->m_bs_tilemap->set_transmask(1, 0x0f, 0); /* all 4 pens are transparent */
+ m_pf_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::cclimber_get_pf_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_pf_tilemap->set_transparent_pen(0);
+ m_pf_tilemap->set_scroll_cols(32);
+
+ m_bs_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::cclimber_get_bs_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bs_tilemap->set_scroll_cols(1);
+ m_bs_tilemap->set_scroll_rows(1);
+ m_bs_tilemap->set_transmask(0, 0x01, 0); /* pen 0 is transaprent */
+ m_bs_tilemap->set_transmask(1, 0x0f, 0); /* all 4 pens are transparent */
}
-VIDEO_START( swimmer )
+VIDEO_START_MEMBER(cclimber_state,swimmer)
{
- cclimber_state *state = machine.driver_data<cclimber_state>();
- state->m_pf_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::swimmer_get_pf_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_pf_tilemap->set_transparent_pen(0);
- state->m_pf_tilemap->set_scroll_cols(32);
-
- state->m_bs_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::cclimber_get_bs_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bs_tilemap->set_scroll_cols(1);
- state->m_bs_tilemap->set_scroll_rows(1);
- state->m_bs_tilemap->set_transmask(0, 0x01, 0); /* pen 0 is transaprent */
- state->m_bs_tilemap->set_transmask(1, 0xff, 0); /* all 8 pens are transparent */
+ m_pf_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::swimmer_get_pf_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_pf_tilemap->set_transparent_pen(0);
+ m_pf_tilemap->set_scroll_cols(32);
+
+ m_bs_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::cclimber_get_bs_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bs_tilemap->set_scroll_cols(1);
+ m_bs_tilemap->set_scroll_rows(1);
+ m_bs_tilemap->set_transmask(0, 0x01, 0); /* pen 0 is transaprent */
+ m_bs_tilemap->set_transmask(1, 0xff, 0); /* all 8 pens are transparent */
}
-VIDEO_START( toprollr )
+VIDEO_START_MEMBER(cclimber_state,toprollr)
{
- cclimber_state *state = machine.driver_data<cclimber_state>();
- state->m_pf_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::toprollr_get_pf_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_pf_tilemap->set_transparent_pen(0);
+ m_pf_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::toprollr_get_pf_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_pf_tilemap->set_transparent_pen(0);
- state->m_toproller_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::toproller_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_toproller_bg_tilemap->set_scroll_rows(1);
+ m_toproller_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::toproller_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_toproller_bg_tilemap->set_scroll_rows(1);
- state->m_bs_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::toprollr_get_bs_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bs_tilemap->set_scroll_cols(1);
- state->m_bs_tilemap->set_scroll_rows(1);
- state->m_bs_tilemap->set_transmask(0, 0x01, 0); /* pen 0 is transaprent */
- state->m_bs_tilemap->set_transmask(1, 0x0f, 0); /* all 4 pens are transparent */
+ m_bs_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cclimber_state::toprollr_get_bs_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bs_tilemap->set_scroll_cols(1);
+ m_bs_tilemap->set_scroll_rows(1);
+ m_bs_tilemap->set_transmask(0, 0x01, 0); /* pen 0 is transaprent */
+ m_bs_tilemap->set_transmask(1, 0x0f, 0); /* all 4 pens are transparent */
}
diff --git a/src/mame/video/centiped.c b/src/mame/video/centiped.c
index ba1502268b2..afb339a2fb5 100644
--- a/src/mame/video/centiped.c
+++ b/src/mame/video/centiped.c
@@ -93,42 +93,38 @@ static void init_common(running_machine &machine)
}
-VIDEO_START( centiped )
+VIDEO_START_MEMBER(centiped_state,centiped)
{
- init_common(machine);
- init_penmask(machine);
+ init_common(machine());
+ init_penmask(machine());
- centiped_state *state = machine.driver_data<centiped_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(centiped_state::centiped_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(centiped_state::centiped_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
-VIDEO_START( warlords )
+VIDEO_START_MEMBER(centiped_state,warlords)
{
- init_common(machine);
+ init_common(machine());
- centiped_state *state = machine.driver_data<centiped_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(centiped_state::warlords_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(centiped_state::warlords_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
-VIDEO_START( milliped )
+VIDEO_START_MEMBER(centiped_state,milliped)
{
- init_common(machine);
- init_penmask(machine);
+ init_common(machine());
+ init_penmask(machine());
- centiped_state *state = machine.driver_data<centiped_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(centiped_state::milliped_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(centiped_state::milliped_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
-VIDEO_START( bullsdrt )
+VIDEO_START_MEMBER(centiped_state,bullsdrt)
{
- init_common(machine);
- init_penmask(machine);
+ init_common(machine());
+ init_penmask(machine());
- centiped_state *state = machine.driver_data<centiped_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(centiped_state::bullsdrt_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(centiped_state::bullsdrt_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
@@ -283,12 +279,12 @@ WRITE8_MEMBER(centiped_state::centiped_paletteram_w)
***************************************************************************/
-PALETTE_INIT( warlords )
+PALETTE_INIT_MEMBER(centiped_state,warlords)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
UINT8 pen;
int r, g, b;
@@ -313,7 +309,7 @@ PALETTE_INIT( warlords )
r = g = b = grey;
}
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
diff --git a/src/mame/video/chaknpop.c b/src/mame/video/chaknpop.c
index 2a1857e964e..b210c9fe997 100644
--- a/src/mame/video/chaknpop.c
+++ b/src/mame/video/chaknpop.c
@@ -22,9 +22,9 @@
palette decode
***************************************************************************/
-PALETTE_INIT( chaknpop )
+void chaknpop_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 1024; i++)
@@ -52,7 +52,7 @@ PALETTE_INIT( chaknpop )
bit2 = (col >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -150,28 +150,27 @@ TILE_GET_INFO_MEMBER(chaknpop_state::chaknpop_get_tx_tile_info)
Initialize video hardware emulation
***************************************************************************/
-VIDEO_START( chaknpop )
+void chaknpop_state::video_start()
{
- chaknpop_state *state = machine.driver_data<chaknpop_state>();
- UINT8 *RAM = state->memregion("maincpu")->base();
+ UINT8 *RAM = memregion("maincpu")->base();
/* info offset type w h col row */
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(chaknpop_state::chaknpop_get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(chaknpop_state::chaknpop_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_vram1 = &RAM[0x10000];
- state->m_vram2 = &RAM[0x12000];
- state->m_vram3 = &RAM[0x14000];
- state->m_vram4 = &RAM[0x16000];
+ m_vram1 = &RAM[0x10000];
+ m_vram2 = &RAM[0x12000];
+ m_vram3 = &RAM[0x14000];
+ m_vram4 = &RAM[0x16000];
- state->save_pointer(NAME(state->m_vram1), 0x2000);
- state->save_pointer(NAME(state->m_vram2), 0x2000);
- state->save_pointer(NAME(state->m_vram3), 0x2000);
- state->save_pointer(NAME(state->m_vram4), 0x2000);
+ save_pointer(NAME(m_vram1), 0x2000);
+ save_pointer(NAME(m_vram2), 0x2000);
+ save_pointer(NAME(m_vram3), 0x2000);
+ save_pointer(NAME(m_vram4), 0x2000);
- state->membank("bank1")->set_entry(0);
- tx_tilemap_mark_all_dirty(machine);
+ membank("bank1")->set_entry(0);
+ tx_tilemap_mark_all_dirty(machine());
- machine.save().register_postload(save_prepost_delegate(FUNC(tx_tilemap_mark_all_dirty), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(tx_tilemap_mark_all_dirty), &machine()));
}
diff --git a/src/mame/video/champbas.c b/src/mame/video/champbas.c
index 7706299aa19..fa5249ab508 100644
--- a/src/mame/video/champbas.c
+++ b/src/mame/video/champbas.c
@@ -20,9 +20,9 @@
***************************************************************************/
-PALETTE_INIT( champbas )
+PALETTE_INIT_MEMBER(champbas_state,champbas)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -35,7 +35,7 @@ PALETTE_INIT( champbas )
2, &resistances_b[0], bweights, 0, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -60,7 +60,7 @@ PALETTE_INIT( champbas )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
color_prom += 0x20;
@@ -68,18 +68,18 @@ PALETTE_INIT( champbas )
for (i = 0; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i & 0xff] & 0x0f) | ((i & 0x100) >> 4);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
-PALETTE_INIT( exctsccr )
+PALETTE_INIT_MEMBER(champbas_state,exctsccr)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -105,7 +105,7 @@ PALETTE_INIT( exctsccr )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -116,14 +116,14 @@ PALETTE_INIT( exctsccr )
{
int swapped_i = BITSWAP8(i, 2, 7, 6, 5, 4, 3, 1, 0);
UINT8 ctabentry = (color_prom[swapped_i] & 0x0f) | ((i & 0x80) >> 3);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites (4bpp) */
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[0x100 + i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i + 0x100, ctabentry);
+ colortable_entry_set_value(machine().colortable, i + 0x100, ctabentry);
}
}
@@ -147,16 +147,14 @@ TILE_GET_INFO_MEMBER(champbas_state::exctsccr_get_bg_tile_info)
-VIDEO_START( champbas )
+VIDEO_START_MEMBER(champbas_state,champbas)
{
- champbas_state *state = machine.driver_data<champbas_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(champbas_state::champbas_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(champbas_state::champbas_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
-VIDEO_START( exctsccr )
+VIDEO_START_MEMBER(champbas_state,exctsccr)
{
- champbas_state *state = machine.driver_data<champbas_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(champbas_state::exctsccr_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(champbas_state::exctsccr_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/changela.c b/src/mame/video/changela.c
index a3b591109d7..7ed5d6cbc24 100644
--- a/src/mame/video/changela.c
+++ b/src/mame/video/changela.c
@@ -17,23 +17,22 @@ Todo: Priority between tree0 and tree1.
static TIMER_CALLBACK( changela_scanline_callback );
-VIDEO_START( changela )
+void changela_state::video_start()
{
- changela_state *state = machine.driver_data<changela_state>();
- state->m_memory_devices = auto_alloc_array(machine, UINT8, 4 * 0x800); /* 0 - not connected, 1,2,3 - RAMs*/
- state->m_tree_ram = auto_alloc_array(machine, UINT8, 2 * 0x20);
+ m_memory_devices = auto_alloc_array(machine(), UINT8, 4 * 0x800); /* 0 - not connected, 1,2,3 - RAMs*/
+ m_tree_ram = auto_alloc_array(machine(), UINT8, 2 * 0x20);
- machine.primary_screen->register_screen_bitmap(state->m_obj0_bitmap);
- machine.primary_screen->register_screen_bitmap(state->m_river_bitmap);
- machine.primary_screen->register_screen_bitmap(state->m_tree0_bitmap);
- machine.primary_screen->register_screen_bitmap(state->m_tree1_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_obj0_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_river_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_tree0_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_tree1_bitmap);
- state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(changela_scanline_callback));
- state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(30), 30);
+ m_scanline_timer = machine().scheduler().timer_alloc(FUNC(changela_scanline_callback));
+ m_scanline_timer->adjust(machine().primary_screen->time_until_pos(30), 30);
- state->save_pointer(NAME(state->m_memory_devices), 4 * 0x800);
- state->save_pointer(NAME(state->m_tree_ram), 2 * 0x20);
+ save_pointer(NAME(m_memory_devices), 4 * 0x800);
+ save_pointer(NAME(m_tree_ram), 2 * 0x20);
}
/**************************************************************************
diff --git a/src/mame/video/cheekyms.c b/src/mame/video/cheekyms.c
index 05379e3430c..611dfb28b28 100644
--- a/src/mame/video/cheekyms.c
+++ b/src/mame/video/cheekyms.c
@@ -15,9 +15,9 @@ Functions to emulate the video hardware of the machine.
/* bit 3 and 7 of the char color PROMs are used for something -- not currently emulated -
thus GAME_IMPERFECT_GRAPHICS */
-PALETTE_INIT( cheekyms )
+void cheekyms_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i, j, bit, r, g, b;
for (i = 0; i < 6; i++)
@@ -34,7 +34,7 @@ PALETTE_INIT( cheekyms )
bit = (color_prom[0x20 * (i / 2) + j] >> ((4 * (i & 1)) + 2)) & 0x01;
b = 0xff * bit;
- palette_set_color(machine, (i * 0x20) + j, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), (i * 0x20) + j, MAKE_RGB(r,g,b));
}
}
}
@@ -92,17 +92,16 @@ TILE_GET_INFO_MEMBER(cheekyms_state::cheekyms_get_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( cheekyms )
+void cheekyms_state::video_start()
{
- cheekyms_state *state = machine.driver_data<cheekyms_state>();
int width, height;
- width = machine.primary_screen->width();
- height = machine.primary_screen->height();
- state->m_bitmap_buffer = auto_bitmap_ind16_alloc(machine, width, height);
+ width = machine().primary_screen->width();
+ height = machine().primary_screen->height();
+ m_bitmap_buffer = auto_bitmap_ind16_alloc(machine(), width, height);
- state->m_cm_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cheekyms_state::cheekyms_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_cm_tilemap->set_transparent_pen(0);
+ m_cm_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cheekyms_state::cheekyms_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_cm_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/chqflag.c b/src/mame/video/chqflag.c
index 17b1cf1d822..4a5f6bc3a94 100644
--- a/src/mame/video/chqflag.c
+++ b/src/mame/video/chqflag.c
@@ -52,15 +52,14 @@ void chqflag_zoom_callback_1( running_machine &machine, int *code, int *color, i
***************************************************************************/
-VIDEO_START( chqflag )
+void chqflag_state::video_start()
{
- chqflag_state *state = machine.driver_data<chqflag_state>();
- state->m_generic_paletteram_8.allocate(0x800);
+ m_generic_paletteram_8.allocate(0x800);
- state->m_sprite_colorbase = 0;
- state->m_zoom_colorbase[0] = 0x10;
- state->m_zoom_colorbase[1] = 0x02;
+ m_sprite_colorbase = 0;
+ m_zoom_colorbase[0] = 0x10;
+ m_zoom_colorbase[1] = 0x02;
}
/***************************************************************************
diff --git a/src/mame/video/cinemat.c b/src/mame/video/cinemat.c
index ec9994767ea..463eb19477d 100644
--- a/src/mame/video/cinemat.c
+++ b/src/mame/video/cinemat.c
@@ -165,43 +165,38 @@ WRITE8_MEMBER(cinemat_state::cinemat_vector_control_w)
*
*************************************/
-VIDEO_START( cinemat_bilevel )
+void cinemat_state::video_start()
{
- cinemat_state *state = machine.driver_data<cinemat_state>();
- state->m_color_mode = COLOR_BILEVEL;
- VIDEO_START_CALL(vector);
+ m_color_mode = COLOR_BILEVEL;
+ VIDEO_START_CALL_LEGACY(vector);
}
-VIDEO_START( cinemat_16level )
+VIDEO_START_MEMBER(cinemat_state,cinemat_16level)
{
- cinemat_state *state = machine.driver_data<cinemat_state>();
- state->m_color_mode = COLOR_16LEVEL;
- VIDEO_START_CALL(vector);
+ m_color_mode = COLOR_16LEVEL;
+ VIDEO_START_CALL_LEGACY(vector);
}
-VIDEO_START( cinemat_64level )
+VIDEO_START_MEMBER(cinemat_state,cinemat_64level)
{
- cinemat_state *state = machine.driver_data<cinemat_state>();
- state->m_color_mode = COLOR_64LEVEL;
- VIDEO_START_CALL(vector);
+ m_color_mode = COLOR_64LEVEL;
+ VIDEO_START_CALL_LEGACY(vector);
}
-VIDEO_START( cinemat_color )
+VIDEO_START_MEMBER(cinemat_state,cinemat_color)
{
- cinemat_state *state = machine.driver_data<cinemat_state>();
- state->m_color_mode = COLOR_RGB;
- VIDEO_START_CALL(vector);
+ m_color_mode = COLOR_RGB;
+ VIDEO_START_CALL_LEGACY(vector);
}
-VIDEO_START( cinemat_qb3color )
+VIDEO_START_MEMBER(cinemat_state,cinemat_qb3color)
{
- cinemat_state *state = machine.driver_data<cinemat_state>();
- state->m_color_mode = COLOR_QB3;
- VIDEO_START_CALL(vector);
+ m_color_mode = COLOR_QB3;
+ VIDEO_START_CALL_LEGACY(vector);
}
diff --git a/src/mame/video/circus.c b/src/mame/video/circus.c
index 9e7793e09f2..5e374bbc8de 100644
--- a/src/mame/video/circus.c
+++ b/src/mame/video/circus.c
@@ -34,10 +34,9 @@ TILE_GET_INFO_MEMBER(circus_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, 0, 0);
}
-VIDEO_START( circus )
+void circus_state::video_start()
{
- circus_state *state = machine.driver_data<circus_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(circus_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(circus_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_line( bitmap_ind16 &bitmap, const rectangle &cliprect, int x1, int y1, int x2, int y2, int dotted )
diff --git a/src/mame/video/circusc.c b/src/mame/video/circusc.c
index c4cecd9bae2..5f166a25118 100644
--- a/src/mame/video/circusc.c
+++ b/src/mame/video/circusc.c
@@ -30,9 +30,9 @@
***************************************************************************/
-PALETTE_INIT( circusc )
+void circusc_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -45,7 +45,7 @@ PALETTE_INIT( circusc )
2, &resistances_b[0], bweights, 0, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 32);
+ machine().colortable = colortable_alloc(machine(), 32);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -70,7 +70,7 @@ PALETTE_INIT( circusc )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -80,14 +80,14 @@ PALETTE_INIT( circusc )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry + 0x10);
+ colortable_entry_set_value(machine().colortable, i, ctabentry + 0x10);
}
/* sprites map to the lower 16 palette entries */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -118,12 +118,11 @@ TILE_GET_INFO_MEMBER(circusc_state::get_tile_info)
***************************************************************************/
-VIDEO_START( circusc )
+void circusc_state::video_start()
{
- circusc_state *state = machine.driver_data<circusc_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(circusc_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(circusc_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_scroll_cols(32);
}
diff --git a/src/mame/video/cischeat.c b/src/mame/video/cischeat.c
index 5f74dfe1daa..5033cc0bf17 100644
--- a/src/mame/video/cischeat.c
+++ b/src/mame/video/cischeat.c
@@ -228,28 +228,27 @@ void cischeat_state::cischeat_set_vreg_flag(int which, int data)
}
/* 32 colour codes for the tiles */
-VIDEO_START( cischeat )
+VIDEO_START_MEMBER(cischeat_state,cischeat)
{
- cischeat_state *state = machine.driver_data<cischeat_state>();
int i;
- state->m_spriteram = &state->m_ram[0x8000/2];
+ m_spriteram = &m_ram[0x8000/2];
- create_tilemaps(machine);
- state->m_tmap[0] = state->m_tilemap[0][0][0];
- state->m_tmap[1] = state->m_tilemap[1][0][0];
- state->m_tmap[2] = state->m_tilemap[2][0][0];
+ create_tilemaps(machine());
+ m_tmap[0] = m_tilemap[0][0][0];
+ m_tmap[1] = m_tilemap[1][0][0];
+ m_tmap[2] = m_tilemap[2][0][0];
- state->m_active_layers = 0;
+ m_active_layers = 0;
for (i = 0; i < 3; i ++)
{
- state->m_scroll_flag[i] = state->m_scrollx[i] = state->m_scrolly[i] = 0;
+ m_scroll_flag[i] = m_scrollx[i] = m_scrolly[i] = 0;
}
- state->m_bits_per_color_code = 5;
+ m_bits_per_color_code = 5;
- prepare_shadows(state);
+ prepare_shadows(this);
}
/**************************************************************************
@@ -257,18 +256,17 @@ VIDEO_START( cischeat )
**************************************************************************/
/* 16 colour codes for the tiles */
-VIDEO_START( f1gpstar )
+VIDEO_START_MEMBER(cischeat_state,f1gpstar)
{
- cischeat_state *state = machine.driver_data<cischeat_state>();
- VIDEO_START_CALL(cischeat);
+ VIDEO_START_CALL_MEMBER(cischeat);
- state->m_bits_per_color_code = 4;
+ m_bits_per_color_code = 4;
}
-VIDEO_START( bigrun )
+VIDEO_START_MEMBER(cischeat_state,bigrun)
{
- VIDEO_START_CALL(f1gpstar);
+ VIDEO_START_CALL_MEMBER(f1gpstar);
}
diff --git a/src/mame/video/citycon.c b/src/mame/video/citycon.c
index a4ad20cf81e..3e04eac9988 100644
--- a/src/mame/video/citycon.c
+++ b/src/mame/video/citycon.c
@@ -50,14 +50,13 @@ TILE_GET_INFO_MEMBER(citycon_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( citycon )
+void citycon_state::video_start()
{
- citycon_state *state = machine.driver_data<citycon_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(citycon_state::get_fg_tile_info),state), tilemap_mapper_delegate(FUNC(citycon_state::citycon_scan),state), 8, 8, 128, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(citycon_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(citycon_state::citycon_scan),state), 8, 8, 128, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(citycon_state::get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(citycon_state::citycon_scan),this), 8, 8, 128, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(citycon_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(citycon_state::citycon_scan),this), 8, 8, 128, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scroll_rows(32);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_scroll_rows(32);
}
diff --git a/src/mame/video/cloak.c b/src/mame/video/cloak.c
index 305e5ba755f..ffe28ecf548 100644
--- a/src/mame/video/cloak.c
+++ b/src/mame/video/cloak.c
@@ -161,25 +161,24 @@ TILE_GET_INFO_MEMBER(cloak_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, 0, 0);
}
-VIDEO_START( cloak )
+void cloak_state::video_start()
{
- cloak_state *state = machine.driver_data<cloak_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cloak_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cloak_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bitmap_videoram1 = auto_alloc_array(machine, UINT8, 256*256);
- state->m_bitmap_videoram2 = auto_alloc_array(machine, UINT8, 256*256);
- state->m_palette_ram = auto_alloc_array(machine, UINT16, NUM_PENS);
+ m_bitmap_videoram1 = auto_alloc_array(machine(), UINT8, 256*256);
+ m_bitmap_videoram2 = auto_alloc_array(machine(), UINT8, 256*256);
+ m_palette_ram = auto_alloc_array(machine(), UINT16, NUM_PENS);
- state->set_current_bitmap_videoram_pointer();
+ set_current_bitmap_videoram_pointer();
- state->save_item(NAME(state->m_bitmap_videoram_address_x));
- state->save_item(NAME(state->m_bitmap_videoram_address_y));
- state->save_item(NAME(state->m_bitmap_videoram_selected));
- state->save_pointer(NAME(state->m_bitmap_videoram1), 256*256);
- state->save_pointer(NAME(state->m_bitmap_videoram2), 256*256);
- state->save_pointer(NAME(state->m_palette_ram), NUM_PENS);
- machine.save().register_postload(save_prepost_delegate(FUNC(cloak_state::set_current_bitmap_videoram_pointer), state));
+ save_item(NAME(m_bitmap_videoram_address_x));
+ save_item(NAME(m_bitmap_videoram_address_y));
+ save_item(NAME(m_bitmap_videoram_selected));
+ save_pointer(NAME(m_bitmap_videoram1), 256*256);
+ save_pointer(NAME(m_bitmap_videoram2), 256*256);
+ save_pointer(NAME(m_palette_ram), NUM_PENS);
+ machine().save().register_postload(save_prepost_delegate(FUNC(cloak_state::set_current_bitmap_videoram_pointer), this));
}
static void draw_bitmap(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/cloud9.c b/src/mame/video/cloud9.c
index d7cbc7ee28a..c544c880da7 100644
--- a/src/mame/video/cloud9.c
+++ b/src/mame/video/cloud9.c
@@ -15,33 +15,32 @@
*
*************************************/
-VIDEO_START( cloud9 )
+void cloud9_state::video_start()
{
- cloud9_state *state = machine.driver_data<cloud9_state>();
static const int resistances[3] = { 22000, 10000, 4700 };
/* allocate second bank of videoram */
- state->m_videoram = auto_alloc_array(machine, UINT8, 0x8000);
- state->membank("bank1")->set_base(state->m_videoram);
+ m_videoram = auto_alloc_array(machine(), UINT8, 0x8000);
+ membank("bank1")->set_base(m_videoram);
/* get pointers to our PROMs */
- state->m_syncprom = machine.root_device().memregion("proms")->base() + 0x000;
- state->m_wpprom = machine.root_device().memregion("proms")->base() + 0x200;
- state->m_priprom = machine.root_device().memregion("proms")->base() + 0x300;
+ m_syncprom = machine().root_device().memregion("proms")->base() + 0x000;
+ m_wpprom = machine().root_device().memregion("proms")->base() + 0x200;
+ m_priprom = machine().root_device().memregion("proms")->base() + 0x300;
/* compute the color output resistor weights at startup */
compute_resistor_weights(0, 255, -1.0,
- 3, resistances, state->m_rweights, 1000, 0,
- 3, resistances, state->m_gweights, 1000, 0,
- 3, resistances, state->m_bweights, 1000, 0);
+ 3, resistances, m_rweights, 1000, 0,
+ 3, resistances, m_gweights, 1000, 0,
+ 3, resistances, m_bweights, 1000, 0);
/* allocate a bitmap for drawing sprites */
- machine.primary_screen->register_screen_bitmap(state->m_spritebitmap);
+ machine().primary_screen->register_screen_bitmap(m_spritebitmap);
/* register for savestates */
- state->save_pointer(NAME(state->m_videoram), 0x8000);
- state->save_item(NAME(state->m_video_control));
- state->save_item(NAME(state->m_bitmode_addr));
+ save_pointer(NAME(m_videoram), 0x8000);
+ save_item(NAME(m_video_control));
+ save_item(NAME(m_bitmode_addr));
}
diff --git a/src/mame/video/clshroad.c b/src/mame/video/clshroad.c
index 17c97a6c9bd..fff9bf22162 100644
--- a/src/mame/video/clshroad.c
+++ b/src/mame/video/clshroad.c
@@ -40,23 +40,23 @@ WRITE8_MEMBER(clshroad_state::clshroad_flipscreen_w)
}
-PALETTE_INIT( clshroad )
+PALETTE_INIT_MEMBER(clshroad_state,clshroad)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0;i < 256;i++)
- palette_set_color_rgb(machine,i, pal4bit(color_prom[i + 256 * 0]),
+ palette_set_color_rgb(machine(),i, pal4bit(color_prom[i + 256 * 0]),
pal4bit(color_prom[i + 256 * 1]),
pal4bit(color_prom[i + 256 * 2]));
}
-PALETTE_INIT( firebatl )
+PALETTE_INIT_MEMBER(clshroad_state,firebatl)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -65,20 +65,20 @@ PALETTE_INIT( firebatl )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
color_prom += 0x300;
for (i = 0; i < 0x200; i++)
- colortable_entry_set_value(machine.colortable, i, i & 0xff);
+ colortable_entry_set_value(machine().colortable, i, i & 0xff);
for (i = 0x200; i < 0x300; i++)
{
UINT8 ctabentry = ((color_prom[(i - 0x200) + 0x000] & 0x0f) << 4) |
(color_prom[(i - 0x200) + 0x100] & 0x0f);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -204,52 +204,50 @@ WRITE8_MEMBER(clshroad_state::clshroad_vram_1_w)
}
-VIDEO_START( firebatl )
+VIDEO_START_MEMBER(clshroad_state,firebatl)
{
- clshroad_state *state = machine.driver_data<clshroad_state>();
/* These 2 use the graphics and scroll value */
- state->m_tilemap_0a = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_0a),state),TILEMAP_SCAN_ROWS,16,16,0x20,0x10);
- state->m_tilemap_0b = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_0b),state),TILEMAP_SCAN_ROWS,16,16,0x20,0x10);
+ m_tilemap_0a = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_0a),this),TILEMAP_SCAN_ROWS,16,16,0x20,0x10);
+ m_tilemap_0b = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_0b),this),TILEMAP_SCAN_ROWS,16,16,0x20,0x10);
/* Text (No scrolling) */
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_fb1),state),tilemap_mapper_delegate(FUNC(clshroad_state::tilemap_scan_rows_extra),state),8,8,0x24,0x20);
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_fb1),this),tilemap_mapper_delegate(FUNC(clshroad_state::tilemap_scan_rows_extra),this),8,8,0x24,0x20);
- state->m_tilemap_0a->set_scroll_rows(1);
- state->m_tilemap_0b->set_scroll_rows(1);
- state->m_tilemap_1->set_scroll_rows(1);
+ m_tilemap_0a->set_scroll_rows(1);
+ m_tilemap_0b->set_scroll_rows(1);
+ m_tilemap_1->set_scroll_rows(1);
- state->m_tilemap_0a->set_scroll_cols(1);
- state->m_tilemap_0b->set_scroll_cols(1);
- state->m_tilemap_1->set_scroll_cols(1);
+ m_tilemap_0a->set_scroll_cols(1);
+ m_tilemap_0b->set_scroll_cols(1);
+ m_tilemap_1->set_scroll_cols(1);
- state->m_tilemap_0a->set_scrolldx(-0x30, -0xb5);
- state->m_tilemap_0b->set_scrolldx(-0x30, -0xb5);
+ m_tilemap_0a->set_scrolldx(-0x30, -0xb5);
+ m_tilemap_0b->set_scrolldx(-0x30, -0xb5);
- state->m_tilemap_0b->set_transparent_pen(0 );
- colortable_configure_tilemap_groups(machine.colortable, state->m_tilemap_1, machine.gfx[2], 0x0f);
+ m_tilemap_0b->set_transparent_pen(0 );
+ colortable_configure_tilemap_groups(machine().colortable, m_tilemap_1, machine().gfx[2], 0x0f);
}
-VIDEO_START( clshroad )
+VIDEO_START_MEMBER(clshroad_state,clshroad)
{
- clshroad_state *state = machine.driver_data<clshroad_state>();
/* These 2 use the graphics and scroll value */
- state->m_tilemap_0a = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_0a),state),TILEMAP_SCAN_ROWS,16,16,0x20,0x10);
- state->m_tilemap_0b = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_0b),state),TILEMAP_SCAN_ROWS,16,16,0x20,0x10);
+ m_tilemap_0a = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_0a),this),TILEMAP_SCAN_ROWS,16,16,0x20,0x10);
+ m_tilemap_0b = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_0b),this),TILEMAP_SCAN_ROWS,16,16,0x20,0x10);
/* Text (No scrolling) */
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_1),state),tilemap_mapper_delegate(FUNC(clshroad_state::tilemap_scan_rows_extra),state),8,8,0x24,0x20);
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(clshroad_state::get_tile_info_1),this),tilemap_mapper_delegate(FUNC(clshroad_state::tilemap_scan_rows_extra),this),8,8,0x24,0x20);
- state->m_tilemap_0a->set_scroll_rows(1);
- state->m_tilemap_0b->set_scroll_rows(1);
- state->m_tilemap_1->set_scroll_rows(1);
+ m_tilemap_0a->set_scroll_rows(1);
+ m_tilemap_0b->set_scroll_rows(1);
+ m_tilemap_1->set_scroll_rows(1);
- state->m_tilemap_0a->set_scroll_cols(1);
- state->m_tilemap_0b->set_scroll_cols(1);
- state->m_tilemap_1->set_scroll_cols(1);
+ m_tilemap_0a->set_scroll_cols(1);
+ m_tilemap_0b->set_scroll_cols(1);
+ m_tilemap_1->set_scroll_cols(1);
- state->m_tilemap_0a->set_scrolldx(-0x30, -0xb5);
- state->m_tilemap_0b->set_scrolldx(-0x30, -0xb5);
+ m_tilemap_0a->set_scrolldx(-0x30, -0xb5);
+ m_tilemap_0b->set_scrolldx(-0x30, -0xb5);
- state->m_tilemap_0b->set_transparent_pen(0x0f );
- state->m_tilemap_1->set_transparent_pen(0x0f );
+ m_tilemap_0b->set_transparent_pen(0x0f );
+ m_tilemap_1->set_transparent_pen(0x0f );
}
diff --git a/src/mame/video/cninja.c b/src/mame/video/cninja.c
index 1a879716043..4b2527e1d26 100644
--- a/src/mame/video/cninja.c
+++ b/src/mame/video/cninja.c
@@ -12,14 +12,13 @@
/******************************************************************************/
-VIDEO_START( stoneage )
+VIDEO_START_MEMBER(cninja_state,stoneage)
{
- cninja_state *state = machine.driver_data<cninja_state>();
/* The bootleg has broken scroll registers */
- deco16ic_set_scrolldx(state->m_deco_tilegen1, 3, 0, -10, -10); /* pf4 16x16 tilemap */
- deco16ic_set_scrolldx(state->m_deco_tilegen1, 1, 0, -10, -10); /* pf2 16x16 tilemap */
- deco16ic_set_scrolldx(state->m_deco_tilegen1, 0, 1, 2, 2); /* pf1 8x8 tilemap */
+ deco16ic_set_scrolldx(m_deco_tilegen1, 3, 0, -10, -10); /* pf4 16x16 tilemap */
+ deco16ic_set_scrolldx(m_deco_tilegen1, 1, 0, -10, -10); /* pf2 16x16 tilemap */
+ deco16ic_set_scrolldx(m_deco_tilegen1, 0, 1, 2, 2); /* pf1 8x8 tilemap */
}
/******************************************************************************/
@@ -241,10 +240,10 @@ SCREEN_UPDATE_IND16( robocop2 )
return 0;
}
-VIDEO_START( mutantf )
+VIDEO_START_MEMBER(cninja_state,mutantf)
{
- machine.device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
- machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
}
SCREEN_UPDATE_RGB32( mutantf )
diff --git a/src/mame/video/combatsc.c b/src/mame/video/combatsc.c
index 1526fd3ebc7..3107f9cb287 100644
--- a/src/mame/video/combatsc.c
+++ b/src/mame/video/combatsc.c
@@ -10,13 +10,13 @@
#include "video/konicdev.h"
#include "includes/combatsc.h"
-PALETTE_INIT( combatsc )
+PALETTE_INIT_MEMBER(combatsc_state,combatsc)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int pal;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x80);
+ machine().colortable = colortable_alloc(machine(), 0x80);
for (pal = 0; pal < 8; pal++)
{
@@ -55,19 +55,19 @@ PALETTE_INIT( combatsc )
else
ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
- colortable_entry_set_value(machine.colortable, (pal << 8) | i, ctabentry);
+ colortable_entry_set_value(machine().colortable, (pal << 8) | i, ctabentry);
}
}
}
-PALETTE_INIT( combatscb )
+PALETTE_INIT_MEMBER(combatsc_state,combatscb)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int pal;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x80);
+ machine().colortable = colortable_alloc(machine(), 0x80);
for (pal = 0; pal < 8; pal++)
{
@@ -84,7 +84,7 @@ PALETTE_INIT( combatscb )
/* chars - no lookup? */
ctabentry = (pal << 4) | (i & 0x0f); /* no lookup? */
- colortable_entry_set_value(machine.colortable, (pal << 8) | i, ctabentry);
+ colortable_entry_set_value(machine().colortable, (pal << 8) | i, ctabentry);
}
}
}
@@ -278,47 +278,45 @@ TILE_GET_INFO_MEMBER(combatsc_state::get_text_info_bootleg)
***************************************************************************/
-VIDEO_START( combatsc )
+VIDEO_START_MEMBER(combatsc_state,combatsc)
{
- combatsc_state *state = machine.driver_data<combatsc_state>();
- state->m_bg_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_tile_info0),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_tile_info1),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_textlayer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_text_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_textlayer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_text_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_spriteram[0] = auto_alloc_array_clear(machine, UINT8, 0x800);
- state->m_spriteram[1] = auto_alloc_array_clear(machine, UINT8, 0x800);
+ m_spriteram[0] = auto_alloc_array_clear(machine(), UINT8, 0x800);
+ m_spriteram[1] = auto_alloc_array_clear(machine(), UINT8, 0x800);
- state->m_bg_tilemap[0]->set_transparent_pen(0);
- state->m_bg_tilemap[1]->set_transparent_pen(0);
- state->m_textlayer->set_transparent_pen(0);
+ m_bg_tilemap[0]->set_transparent_pen(0);
+ m_bg_tilemap[1]->set_transparent_pen(0);
+ m_textlayer->set_transparent_pen(0);
- state->m_textlayer->set_scroll_rows(32);
+ m_textlayer->set_scroll_rows(32);
- state->save_pointer(NAME(state->m_spriteram[0]), 0x800);
- state->save_pointer(NAME(state->m_spriteram[1]), 0x800);
+ save_pointer(NAME(m_spriteram[0]), 0x800);
+ save_pointer(NAME(m_spriteram[1]), 0x800);
}
-VIDEO_START( combatscb )
+VIDEO_START_MEMBER(combatsc_state,combatscb)
{
- combatsc_state *state = machine.driver_data<combatsc_state>();
- state->m_bg_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_tile_info0_bootleg),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_tile_info1_bootleg),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_textlayer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_text_info_bootleg),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_tile_info0_bootleg),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_tile_info1_bootleg),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_textlayer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(combatsc_state::get_text_info_bootleg),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_spriteram[0] = auto_alloc_array_clear(machine, UINT8, 0x800);
- state->m_spriteram[1] = auto_alloc_array_clear(machine, UINT8, 0x800);
+ m_spriteram[0] = auto_alloc_array_clear(machine(), UINT8, 0x800);
+ m_spriteram[1] = auto_alloc_array_clear(machine(), UINT8, 0x800);
- state->m_bg_tilemap[0]->set_transparent_pen(0);
- state->m_bg_tilemap[1]->set_transparent_pen(0);
- state->m_textlayer->set_transparent_pen(0);
+ m_bg_tilemap[0]->set_transparent_pen(0);
+ m_bg_tilemap[1]->set_transparent_pen(0);
+ m_textlayer->set_transparent_pen(0);
- state->m_bg_tilemap[0]->set_scroll_rows(32);
- state->m_bg_tilemap[1]->set_scroll_rows(32);
+ m_bg_tilemap[0]->set_scroll_rows(32);
+ m_bg_tilemap[1]->set_scroll_rows(32);
- state->save_pointer(NAME(state->m_spriteram[0]), 0x800);
- state->save_pointer(NAME(state->m_spriteram[1]), 0x800);
+ save_pointer(NAME(m_spriteram[0]), 0x800);
+ save_pointer(NAME(m_spriteram[1]), 0x800);
}
/***************************************************************************
diff --git a/src/mame/video/commando.c b/src/mame/video/commando.c
index 5d8511d2e8a..5b8471925ca 100644
--- a/src/mame/video/commando.c
+++ b/src/mame/video/commando.c
@@ -86,14 +86,13 @@ TILE_GET_INFO_MEMBER(commando_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( commando )
+void commando_state::video_start()
{
- commando_state *state = machine.driver_data<commando_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(commando_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(commando_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(commando_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(commando_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(3);
+ m_fg_tilemap->set_transparent_pen(3);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/compgolf.c b/src/mame/video/compgolf.c
index 38b7660a258..96a9698dce7 100644
--- a/src/mame/video/compgolf.c
+++ b/src/mame/video/compgolf.c
@@ -9,12 +9,12 @@
#include "includes/compgolf.h"
-PALETTE_INIT( compgolf )
+void compgolf_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0,bit1,bit2,r,g,b;
bit0 = (color_prom[i] >> 0) & 0x01;
@@ -30,7 +30,7 @@ PALETTE_INIT( compgolf )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
}
@@ -67,13 +67,12 @@ TILE_GET_INFO_MEMBER(compgolf_state::get_back_info)
SET_TILE_INFO_MEMBER(1, code, color, 0);
}
-VIDEO_START( compgolf )
+void compgolf_state::video_start()
{
- compgolf_state *state = machine.driver_data<compgolf_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(compgolf_state::get_back_info),state), tilemap_mapper_delegate(FUNC(compgolf_state::back_scan),state), 16, 16, 32, 32);
- state->m_text_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(compgolf_state::get_text_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(compgolf_state::get_back_info),this), tilemap_mapper_delegate(FUNC(compgolf_state::back_scan),this), 16, 16, 32, 32);
+ m_text_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(compgolf_state::get_text_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_text_tilemap->set_transparent_pen(0);
+ m_text_tilemap->set_transparent_pen(0);
}
/*
diff --git a/src/mame/video/contra.c b/src/mame/video/contra.c
index 23b91e7f36f..f7ee799983b 100644
--- a/src/mame/video/contra.c
+++ b/src/mame/video/contra.c
@@ -20,13 +20,13 @@
**
***************************************************************************/
-PALETTE_INIT( contra )
+void contra_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int chip;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x80);
+ machine().colortable = colortable_alloc(machine(), 0x80);
for (chip = 0; chip < 2; chip++)
{
@@ -46,7 +46,7 @@ PALETTE_INIT( contra )
else
ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
- colortable_entry_set_value(machine.colortable, (chip << 11) | (pal << 8) | i, ctabentry);
+ colortable_entry_set_value(machine().colortable, (chip << 11) | (pal << 8) | i, ctabentry);
}
}
}
@@ -162,30 +162,29 @@ TILE_GET_INFO_MEMBER(contra_state::get_tx_tile_info)
***************************************************************************/
-VIDEO_START( contra )
+void contra_state::video_start()
{
- contra_state *state = machine.driver_data<contra_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(contra_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(contra_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(contra_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(contra_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(contra_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(contra_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_buffered_spriteram = auto_alloc_array(machine, UINT8, 0x800);
- state->m_buffered_spriteram_2 = auto_alloc_array(machine, UINT8, 0x800);
+ m_buffered_spriteram = auto_alloc_array(machine(), UINT8, 0x800);
+ m_buffered_spriteram_2 = auto_alloc_array(machine(), UINT8, 0x800);
- state->m_bg_clip = machine.primary_screen->visible_area();
- state->m_bg_clip.min_x += 40;
+ m_bg_clip = machine().primary_screen->visible_area();
+ m_bg_clip.min_x += 40;
- state->m_fg_clip = state->m_bg_clip;
+ m_fg_clip = m_bg_clip;
- state->m_tx_clip = machine.primary_screen->visible_area();
- state->m_tx_clip.max_x = 39;
- state->m_tx_clip.min_x = 0;
+ m_tx_clip = machine().primary_screen->visible_area();
+ m_tx_clip.max_x = 39;
+ m_tx_clip.min_x = 0;
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->save_pointer(NAME(state->m_buffered_spriteram), 0x800);
- state->save_pointer(NAME(state->m_buffered_spriteram_2), 0x800);
+ save_pointer(NAME(m_buffered_spriteram), 0x800);
+ save_pointer(NAME(m_buffered_spriteram_2), 0x800);
}
diff --git a/src/mame/video/cop01.c b/src/mame/video/cop01.c
index 33fd523b73e..3ae6f0691d1 100644
--- a/src/mame/video/cop01.c
+++ b/src/mame/video/cop01.c
@@ -10,13 +10,13 @@
#include "includes/cop01.h"
-PALETTE_INIT( cop01 )
+void cop01_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -25,7 +25,7 @@ PALETTE_INIT( cop01 )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -33,7 +33,7 @@ PALETTE_INIT( cop01 )
/* characters use colors 0x00-0x0f (or 0x00-0x7f, but the eight rows are identical) */
for (i = 0; i < 0x10; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* background tiles use colors 0xc0-0xff */
/* I don't know how much of the lookup table PROM is hooked up, */
@@ -42,14 +42,14 @@ PALETTE_INIT( cop01 )
{
UINT8 ctabentry = 0xc0 | ((i - 0x10) & 0x30) |
(color_prom[(((i - 0x10) & 0x40) >> 2) | ((i - 0x10) & 0x0f)] & 0x0f);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites use colors 0x80-0x8f (or 0x80-0xbf, but the four rows are identical) */
for (i = 0x90; i < 0x190; i++)
{
UINT8 ctabentry = 0x80 | (color_prom[i - 0x90 + 0x100] & 0x0f);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -98,17 +98,16 @@ TILE_GET_INFO_MEMBER(cop01_state::get_fg_tile_info)
***************************************************************************/
-VIDEO_START( cop01 )
+void cop01_state::video_start()
{
- cop01_state *state = machine.driver_data<cop01_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cop01_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cop01_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cop01_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cop01_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
/* priority doesn't exactly work this way, see above */
- state->m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x0fff, 0xf000); /* split type 1 has pens 0-11 transparent in front half */
+ m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x0fff, 0xf000); /* split type 1 has pens 0-11 transparent in front half */
}
diff --git a/src/mame/video/cosmic.c b/src/mame/video/cosmic.c
index a3edb10481e..833f93f0671 100644
--- a/src/mame/video/cosmic.c
+++ b/src/mame/video/cosmic.c
@@ -75,14 +75,13 @@ static pen_t magspot_map_color( running_machine &machine, UINT8 x, UINT8 y )
* (1k to ground) so second version of table has blue set to 2/3
*/
-PALETTE_INIT( panic )
+PALETTE_INIT_MEMBER(cosmic_state,panic)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- cosmic_state *state = machine.driver_data<cosmic_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x10);
+ machine().colortable = colortable_alloc(machine(), 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -91,21 +90,21 @@ PALETTE_INIT( panic )
int g = pal1bit(i >> 1);
int b = ((i & 0x0c) == 0x08) ? 0xaa : pal1bit(i >> 2);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* background uses colors 0x00-0x0f */
for (i = 0; i < 0x0f; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprites use colors 0x00-0x07 */
for (i = 0x10; i < 0x30; i++)
{
UINT8 ctabentry = color_prom[i - 0x10] & 0x07;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
- state->m_map_color = panic_map_color;
+ m_map_color = panic_map_color;
}
@@ -118,38 +117,37 @@ PALETTE_INIT( panic )
*
*/
-PALETTE_INIT( cosmica )
+PALETTE_INIT_MEMBER(cosmic_state,cosmica)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- cosmic_state *state = machine.driver_data<cosmic_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x08);
+ machine().colortable = colortable_alloc(machine(), 0x08);
/* create a lookup table for the palette */
for (i = 0; i < 0x08; i++)
{
rgb_t color = MAKE_RGB(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
- colortable_palette_set_color(machine.colortable, i, color);
+ colortable_palette_set_color(machine().colortable, i, color);
}
/* background and sprites use colors 0x00-0x07 */
for (i = 0; i < 0x08; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
for (i = 0x08; i < 0x28; i++)
{
UINT8 ctabentry;
ctabentry = (color_prom[i - 0x08] >> 0) & 0x07;
- colortable_entry_set_value(machine.colortable, i + 0x00, ctabentry);
+ colortable_entry_set_value(machine().colortable, i + 0x00, ctabentry);
ctabentry = (color_prom[i - 0x08] >> 4) & 0x07;
- colortable_entry_set_value(machine.colortable, i + 0x20, ctabentry);
+ colortable_entry_set_value(machine().colortable, i + 0x20, ctabentry);
}
- state->m_map_color = cosmica_map_color;
+ m_map_color = cosmica_map_color;
}
@@ -162,32 +160,30 @@ PALETTE_INIT( cosmica )
* It's possible that the background is dark gray and not black, as the
* resistor chain would never drop to zero, Anybody know ?
*/
-PALETTE_INIT( cosmicg )
+PALETTE_INIT_MEMBER(cosmic_state,cosmicg)
{
- cosmic_state *state = machine.driver_data<cosmic_state>();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int r = (i > 8) ? 0xff : 0xaa * ((i >> 0) & 1);
int g = 0xaa * ((i >> 1) & 1);
int b = 0xaa * ((i >> 2) & 1);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
- state->m_map_color = cosmicg_map_color;
+ m_map_color = cosmicg_map_color;
}
-PALETTE_INIT( magspot )
+PALETTE_INIT_MEMBER(cosmic_state,magspot)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- cosmic_state *state = machine.driver_data<cosmic_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x10);
+ machine().colortable = colortable_alloc(machine(), 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -196,54 +192,53 @@ PALETTE_INIT( magspot )
int g = pal1bit(i >> 1);
int b = pal1bit(i >> 2);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* background uses colors 0x00-0x0f */
for (i = 0; i < 0x0f; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprites use colors 0x00-0x0f */
for (i = 0x10; i < 0x30; i++)
{
UINT8 ctabentry = color_prom[i - 0x10] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
- state->m_map_color = magspot_map_color;
- state->m_magspot_pen_mask = 0x0f;
+ m_map_color = magspot_map_color;
+ m_magspot_pen_mask = 0x0f;
}
-PALETTE_INIT( nomnlnd )
+PALETTE_INIT_MEMBER(cosmic_state,nomnlnd)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- cosmic_state *state = machine.driver_data<cosmic_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x10);
+ machine().colortable = colortable_alloc(machine(), 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
{
rgb_t color = MAKE_RGB(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
- colortable_palette_set_color(machine.colortable, i, color);
+ colortable_palette_set_color(machine().colortable, i, color);
}
/* background uses colors 0x00-0x07 */
for (i = 0; i < 0x07; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprites use colors 0x00-0x07 */
for (i = 0x10; i < 0x30; i++)
{
UINT8 ctabentry = color_prom[i - 0x10] & 0x07;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
- state->m_map_color = magspot_map_color;
- state->m_magspot_pen_mask = 0x07;
+ m_map_color = magspot_map_color;
+ m_magspot_pen_mask = 0x07;
}
diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c
index 827f03ccf0f..88087173c47 100644
--- a/src/mame/video/cps1.c
+++ b/src/mame/video/cps1.c
@@ -1485,10 +1485,9 @@ CPS1 VIDEO RENDERER
static void cps1_build_palette(running_machine &machine, const UINT16* const palette_base);
-static MACHINE_RESET( cps )
+MACHINE_RESET_MEMBER(cps_state,cps)
{
- cps_state *state = machine.driver_data<cps_state>();
- const char *gamename = machine.system().name;
+ const char *gamename = machine().system().name;
const struct CPS1config *pCFG = &cps1_config_table[0];
while (pCFG->name)
@@ -1499,9 +1498,9 @@ static MACHINE_RESET( cps )
pCFG++;
}
- state->m_game_config = pCFG;
+ m_game_config = pCFG;
- if (!state->m_game_config->name)
+ if (!m_game_config->name)
{
gamename = "cps2";
pCFG = &cps1_config_table[0];
@@ -1514,20 +1513,20 @@ static MACHINE_RESET( cps )
pCFG++;
}
- state->m_game_config = pCFG;
+ m_game_config = pCFG;
}
if (strcmp(gamename, "sf2rb") == 0)
{
/* Patch out protection check */
- UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine().root_device().memregion("maincpu")->base();
rom[0xe5464 / 2] = 0x6012;
}
if (strcmp(gamename, "sf2rb2") == 0)
{
/* Patch out protection check */
- UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine().root_device().memregion("maincpu")->base();
rom[0xe5332 / 2] = 0x6014;
}
@@ -1538,13 +1537,13 @@ static MACHINE_RESET( cps )
by the cpu core as a 32-bit branch. This branch would make the
game crash (address error, since it would branch to an odd address)
if location 180ca6 (outside ROM space) isn't 0. Protection check? */
- UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine().root_device().memregion("maincpu")->base();
rom[0x11756 / 2] = 0x4e71;
}
else if (strcmp(gamename, "ghouls") == 0)
{
/* Patch out self-test... it takes forever */
- UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine().root_device().memregion("maincpu")->base();
rom[0x61964 / 2] = 0x4ef9;
rom[0x61966 / 2] = 0x0000;
rom[0x61968 / 2] = 0x0400;
@@ -2079,118 +2078,115 @@ static void cps1_update_transmasks( running_machine &machine )
}
}
-static VIDEO_START( cps )
+VIDEO_START_MEMBER(cps_state,cps)
{
- cps_state *state = machine.driver_data<cps_state>();
int i;
- MACHINE_RESET_CALL(cps);
+ MACHINE_RESET_CALL_MEMBER(cps);
/* Put in some const */
- state->m_scroll_size = 0x4000; /* scroll1, scroll2, scroll3 */
- state->m_obj_size = 0x0800;
- state->m_cps2_obj_size = 0x2000;
- state->m_other_size = 0x0800;
- state->m_palette_align = 0x0400; /* minimum alignment is a single palette page (512 colors). Verified on pcb. */
- state->m_palette_size = cps1_palette_entries * 32; /* Size of palette RAM */
- state->m_stars_rom_size = 0x2000; /* first 0x4000 of gfx ROM are used, but 0x0000-0x1fff is == 0x2000-0x3fff */
+ m_scroll_size = 0x4000; /* scroll1, scroll2, scroll3 */
+ m_obj_size = 0x0800;
+ m_cps2_obj_size = 0x2000;
+ m_other_size = 0x0800;
+ m_palette_align = 0x0400; /* minimum alignment is a single palette page (512 colors). Verified on pcb. */
+ m_palette_size = cps1_palette_entries * 32; /* Size of palette RAM */
+ m_stars_rom_size = 0x2000; /* first 0x4000 of gfx ROM are used, but 0x0000-0x1fff is == 0x2000-0x3fff */
/* create tilemaps */
- state->m_bg_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cps_state::get_tile0_info),state), tilemap_mapper_delegate(FUNC(cps_state::tilemap0_scan),state), 8, 8, 64, 64);
- state->m_bg_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cps_state::get_tile1_info),state), tilemap_mapper_delegate(FUNC(cps_state::tilemap1_scan),state), 16, 16, 64, 64);
- state->m_bg_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cps_state::get_tile2_info),state), tilemap_mapper_delegate(FUNC(cps_state::tilemap2_scan),state), 32, 32, 64, 64);
+ m_bg_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cps_state::get_tile0_info),this), tilemap_mapper_delegate(FUNC(cps_state::tilemap0_scan),this), 8, 8, 64, 64);
+ m_bg_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cps_state::get_tile1_info),this), tilemap_mapper_delegate(FUNC(cps_state::tilemap1_scan),this), 16, 16, 64, 64);
+ m_bg_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cps_state::get_tile2_info),this), tilemap_mapper_delegate(FUNC(cps_state::tilemap2_scan),this), 32, 32, 64, 64);
/* create empty tiles */
- memset(state->m_empty_tile, 0x0f, sizeof(state->m_empty_tile));
+ memset(m_empty_tile, 0x0f, sizeof(m_empty_tile));
/* front masks will change at runtime to handle sprite occluding */
- cps1_update_transmasks(machine);
+ cps1_update_transmasks(machine());
for (i = 0; i < cps1_palette_entries * 16; i++)
- palette_set_color(machine, i, MAKE_RGB(0,0,0));
+ palette_set_color(machine(), i, MAKE_RGB(0,0,0));
- state->m_buffered_obj = auto_alloc_array_clear(machine, UINT16, state->m_obj_size / 2);
+ m_buffered_obj = auto_alloc_array_clear(machine(), UINT16, m_obj_size / 2);
- if (state->m_cps_version == 2)
- state->m_cps2_buffered_obj = auto_alloc_array_clear(machine, UINT16, state->m_cps2_obj_size / 2);
+ if (m_cps_version == 2)
+ m_cps2_buffered_obj = auto_alloc_array_clear(machine(), UINT16, m_cps2_obj_size / 2);
/* clear RAM regions */
- memset(state->m_gfxram, 0, state->m_gfxram.bytes()); /* Clear GFX RAM */
- memset(state->m_cps_a_regs, 0, 0x40); /* Clear CPS-A registers */
- memset(state->m_cps_b_regs, 0, 0x40); /* Clear CPS-B registers */
+ memset(m_gfxram, 0, m_gfxram.bytes()); /* Clear GFX RAM */
+ memset(m_cps_a_regs, 0, 0x40); /* Clear CPS-A registers */
+ memset(m_cps_b_regs, 0, 0x40); /* Clear CPS-B registers */
- if (state->m_cps_version == 2)
+ if (m_cps_version == 2)
{
- memset(state->m_objram1, 0, state->m_cps2_obj_size);
- memset(state->m_objram2, 0, state->m_cps2_obj_size);
+ memset(m_objram1, 0, m_cps2_obj_size);
+ memset(m_objram2, 0, m_cps2_obj_size);
}
/* Put in some defaults */
- state->m_cps_a_regs[CPS1_OBJ_BASE] = 0x9200;
- state->m_cps_a_regs[CPS1_SCROLL1_BASE] = 0x9000;
- state->m_cps_a_regs[CPS1_SCROLL2_BASE] = 0x9040;
- state->m_cps_a_regs[CPS1_SCROLL3_BASE] = 0x9080;
- state->m_cps_a_regs[CPS1_OTHER_BASE] = 0x9100;
+ m_cps_a_regs[CPS1_OBJ_BASE] = 0x9200;
+ m_cps_a_regs[CPS1_SCROLL1_BASE] = 0x9000;
+ m_cps_a_regs[CPS1_SCROLL2_BASE] = 0x9040;
+ m_cps_a_regs[CPS1_SCROLL3_BASE] = 0x9080;
+ m_cps_a_regs[CPS1_OTHER_BASE] = 0x9100;
/* This should never be hit, since game_config is set in MACHINE_RESET */
- assert_always(state->m_game_config, "state_game_config hasn't been set up yet");
+ assert_always(m_game_config, "state_game_config hasn't been set up yet");
/* Set up old base */
- state->m_scroll1 = NULL;
- state->m_scroll2 = NULL;
- state->m_scroll3 = NULL;
- state->m_obj = NULL;
- state->m_other = NULL;
- cps1_get_video_base(machine); /* Calculate base pointers */
- cps1_get_video_base(machine); /* Calculate old base pointers */
+ m_scroll1 = NULL;
+ m_scroll2 = NULL;
+ m_scroll3 = NULL;
+ m_obj = NULL;
+ m_other = NULL;
+ cps1_get_video_base(machine()); /* Calculate base pointers */
+ cps1_get_video_base(machine()); /* Calculate old base pointers */
/* state save register */
- state->save_item(NAME(state->m_scanline1));
- state->save_item(NAME(state->m_scanline2));
- state->save_item(NAME(state->m_scancalls));
+ save_item(NAME(m_scanline1));
+ save_item(NAME(m_scanline2));
+ save_item(NAME(m_scancalls));
#if 0
/* these do not need to be saved, because they are recovered from cps_a_regs in cps1_postload */
- state->save_item(NAME(state->m_scroll1x));
- state->save_item(NAME(state->m_scroll1y));
- state->save_item(NAME(state->m_scroll2x));
- state->save_item(NAME(state->m_scroll2y));
- state->save_item(NAME(state->m_scroll3x));
- state->save_item(NAME(state->m_scroll3y));
- state->save_item(NAME(state->m_stars1x));
- state->save_item(NAME(state->m_stars1y));
- state->save_item(NAME(state->m_stars2x));
- state->save_item(NAME(state->m_stars2y));
- state->save_item(NAME(state->m_stars_enabled));
+ save_item(NAME(m_scroll1x));
+ save_item(NAME(m_scroll1y));
+ save_item(NAME(m_scroll2x));
+ save_item(NAME(m_scroll2y));
+ save_item(NAME(m_scroll3x));
+ save_item(NAME(m_scroll3y));
+ save_item(NAME(m_stars1x));
+ save_item(NAME(m_stars1y));
+ save_item(NAME(m_stars2x));
+ save_item(NAME(m_stars2y));
+ save_item(NAME(m_stars_enabled));
#endif
- state->save_item(NAME(state->m_last_sprite_offset));
- state->save_item(NAME(state->m_pri_ctrl));
- state->save_item(NAME(state->m_objram_bank));
+ save_item(NAME(m_last_sprite_offset));
+ save_item(NAME(m_pri_ctrl));
+ save_item(NAME(m_objram_bank));
- state->save_pointer(NAME(state->m_buffered_obj), state->m_obj_size / 2);
- if (state->m_cps_version == 2)
+ save_pointer(NAME(m_buffered_obj), m_obj_size / 2);
+ if (m_cps_version == 2)
{
- state->save_item(NAME(state->m_cps2_last_sprite_offset));
- state->save_pointer(NAME(state->m_cps2_buffered_obj), state->m_cps2_obj_size / 2);
+ save_item(NAME(m_cps2_last_sprite_offset));
+ save_pointer(NAME(m_cps2_buffered_obj), m_cps2_obj_size / 2);
}
- machine.save().register_postload(save_prepost_delegate(FUNC(cps1_get_video_base), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(cps1_get_video_base), &machine()));
}
-VIDEO_START( cps1 )
+VIDEO_START_MEMBER(cps_state,cps1)
{
- cps_state *state = machine.driver_data<cps_state>();
- state->m_cps_version = 1;
- VIDEO_START_CALL(cps);
+ m_cps_version = 1;
+ VIDEO_START_CALL_MEMBER(cps);
}
-VIDEO_START( cps2 )
+VIDEO_START_MEMBER(cps_state,cps2)
{
- cps_state *state = machine.driver_data<cps_state>();
- state->m_cps_version = 2;
- VIDEO_START_CALL(cps);
+ m_cps_version = 2;
+ VIDEO_START_CALL_MEMBER(cps);
}
/***************************************************************************
diff --git a/src/mame/video/crbaloon.c b/src/mame/video/crbaloon.c
index 31a833cae8f..2f772e3d2c6 100644
--- a/src/mame/video/crbaloon.c
+++ b/src/mame/video/crbaloon.c
@@ -23,11 +23,11 @@
***************************************************************************/
-PALETTE_INIT( crbaloon )
+void crbaloon_state::palette_init()
{
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
UINT8 pen;
int h, r, g, b;
@@ -42,7 +42,7 @@ PALETTE_INIT( crbaloon )
g = h * ((~pen >> 1) & 1);
b = h * ((~pen >> 2) & 1);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -67,13 +67,12 @@ TILE_GET_INFO_MEMBER(crbaloon_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( crbaloon )
+void crbaloon_state::video_start()
{
- crbaloon_state *state = machine.driver_data<crbaloon_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(crbaloon_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS_FLIP_XY, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(crbaloon_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS_FLIP_XY, 8, 8, 32, 32);
- state->save_item(NAME(state->m_collision_address));
- state->save_item(NAME(state->m_collision_address_clear));
+ save_item(NAME(m_collision_address));
+ save_item(NAME(m_collision_address_clear));
}
diff --git a/src/mame/video/crgolf.c b/src/mame/video/crgolf.c
index d66dfad5a2a..add36d7d14b 100644
--- a/src/mame/video/crgolf.c
+++ b/src/mame/video/crgolf.c
@@ -88,17 +88,16 @@ static void get_pens( running_machine &machine, pen_t *pens )
*
*************************************/
-static VIDEO_START( crgolf )
+VIDEO_START_MEMBER(crgolf_state,crgolf)
{
- crgolf_state *state = machine.driver_data<crgolf_state>();
/* allocate memory for the two bitmaps */
- state->m_videoram_a = auto_alloc_array(machine, UINT8, VIDEORAM_SIZE);
- state->m_videoram_b = auto_alloc_array(machine, UINT8, VIDEORAM_SIZE);
+ m_videoram_a = auto_alloc_array(machine(), UINT8, VIDEORAM_SIZE);
+ m_videoram_b = auto_alloc_array(machine(), UINT8, VIDEORAM_SIZE);
/* register for save states */
- state->save_pointer(NAME(state->m_videoram_a), VIDEORAM_SIZE);
- state->save_pointer(NAME(state->m_videoram_b), VIDEORAM_SIZE);
+ save_pointer(NAME(m_videoram_a), VIDEORAM_SIZE);
+ save_pointer(NAME(m_videoram_b), VIDEORAM_SIZE);
}
@@ -192,7 +191,7 @@ static SCREEN_UPDATE_RGB32( crgolf )
MACHINE_CONFIG_FRAGMENT( crgolf_video )
- MCFG_VIDEO_START(crgolf)
+ MCFG_VIDEO_START_OVERRIDE(crgolf_state,crgolf)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_SIZE(256, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 255, 8, 247)
diff --git a/src/mame/video/crimfght.c b/src/mame/video/crimfght.c
index 882e62cf859..99e45b15d8e 100644
--- a/src/mame/video/crimfght.c
+++ b/src/mame/video/crimfght.c
@@ -55,16 +55,15 @@ void crimfght_sprite_callback( running_machine &machine, int *code, int *color,
***************************************************************************/
-VIDEO_START( crimfght )
+void crimfght_state::video_start()
{
- crimfght_state *state = machine.driver_data<crimfght_state>();
- state->m_generic_paletteram_8.allocate(0x400);
+ m_generic_paletteram_8.allocate(0x400);
- state->m_layer_colorbase[0] = 0;
- state->m_layer_colorbase[1] = 4;
- state->m_layer_colorbase[2] = 8;
- state->m_sprite_colorbase = 16;
+ m_layer_colorbase[0] = 0;
+ m_layer_colorbase[1] = 4;
+ m_layer_colorbase[2] = 8;
+ m_sprite_colorbase = 16;
}
diff --git a/src/mame/video/crospang.c b/src/mame/video/crospang.c
index 403e40c6c31..853c08a650c 100644
--- a/src/mame/video/crospang.c
+++ b/src/mame/video/crospang.c
@@ -107,13 +107,12 @@ TILE_GET_INFO_MEMBER(crospang_state::get_fg_tile_info)
}
-VIDEO_START( crospang )
+void crospang_state::video_start()
{
- crospang_state *state = machine.driver_data<crospang_state>();
- state->m_bg_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(crospang_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(crospang_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(crospang_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(crospang_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_layer->set_transparent_pen(0);
+ m_fg_layer->set_transparent_pen(0);
}
SCREEN_UPDATE_IND16( crospang )
diff --git a/src/mame/video/crshrace.c b/src/mame/video/crshrace.c
index de753b0e5a2..490d919579a 100644
--- a/src/mame/video/crshrace.c
+++ b/src/mame/video/crshrace.c
@@ -30,15 +30,14 @@ TILE_GET_INFO_MEMBER(crshrace_state::get_tile_info2)
***************************************************************************/
-VIDEO_START( crshrace )
+void crshrace_state::video_start()
{
- crshrace_state *state = machine.driver_data<crshrace_state>();
- state->m_tilemap1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(crshrace_state::get_tile_info1),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(crshrace_state::get_tile_info2),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(crshrace_state::get_tile_info1),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(crshrace_state::get_tile_info2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap1->set_transparent_pen(0x0f);
- state->m_tilemap2->set_transparent_pen(0xff);
+ m_tilemap1->set_transparent_pen(0x0f);
+ m_tilemap2->set_transparent_pen(0xff);
}
diff --git a/src/mame/video/cvs.c b/src/mame/video/cvs.c
index ac7f701a055..10ec82329d0 100644
--- a/src/mame/video/cvs.c
+++ b/src/mame/video/cvs.c
@@ -25,13 +25,13 @@
* colours are taken from SRAM and are programmable *
******************************************************/
-PALETTE_INIT( cvs )
+PALETTE_INIT_MEMBER(cvs_state,cvs)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i, attr;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x10);
+ machine().colortable = colortable_alloc(machine(), 0x10);
/* color mapping PROM */
for (attr = 0; attr < 0x100; attr++)
@@ -43,25 +43,25 @@ PALETTE_INIT( cvs )
/* bits 0 and 2 are swapped */
ctabentry = BITSWAP8(ctabentry,7,6,5,4,3,0,1,2);
- colortable_entry_set_value(machine.colortable, (attr << 3) | i, ctabentry);
+ colortable_entry_set_value(machine().colortable, (attr << 3) | i, ctabentry);
}
}
/* background collision map */
for (i = 0; i < 8; i++)
{
- colortable_entry_set_value(machine.colortable, 0x800 + i, 0);
- colortable_entry_set_value(machine.colortable, 0x808 + i, i & 0x04);
- colortable_entry_set_value(machine.colortable, 0x810 + i, i & 0x02);
- colortable_entry_set_value(machine.colortable, 0x818 + i, i & 0x06);
+ colortable_entry_set_value(machine().colortable, 0x800 + i, 0);
+ colortable_entry_set_value(machine().colortable, 0x808 + i, i & 0x04);
+ colortable_entry_set_value(machine().colortable, 0x810 + i, i & 0x02);
+ colortable_entry_set_value(machine().colortable, 0x818 + i, i & 0x06);
}
/* sprites */
for (i = 0; i < 8; i++)
- colortable_entry_set_value(machine.colortable, SPRITE_PEN_BASE + i, i | 0x08);
+ colortable_entry_set_value(machine().colortable, SPRITE_PEN_BASE + i, i | 0x08);
/* bullet */
- colortable_entry_set_value(machine.colortable, BULLET_STAR_PEN, 7);
+ colortable_entry_set_value(machine().colortable, BULLET_STAR_PEN, 7);
}
@@ -121,21 +121,20 @@ WRITE8_MEMBER(cvs_state::cvs_scroll_w)
}
-VIDEO_START( cvs )
+VIDEO_START_MEMBER(cvs_state,cvs)
{
- cvs_state *state = machine.driver_data<cvs_state>();
- cvs_init_stars(machine);
+ cvs_init_stars(machine());
/* create helper bitmaps */
- machine.primary_screen->register_screen_bitmap(state->m_background_bitmap);
- machine.primary_screen->register_screen_bitmap(state->m_collision_background);
- machine.primary_screen->register_screen_bitmap(state->m_scrolled_collision_background);
+ machine().primary_screen->register_screen_bitmap(m_background_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_collision_background);
+ machine().primary_screen->register_screen_bitmap(m_scrolled_collision_background);
/* register save */
- state->save_item(NAME(state->m_background_bitmap));
- state->save_item(NAME(state->m_collision_background));
- state->save_item(NAME(state->m_scrolled_collision_background));
+ save_item(NAME(m_background_bitmap));
+ save_item(NAME(m_collision_background));
+ save_item(NAME(m_scrolled_collision_background));
}
diff --git a/src/mame/video/cyberbal.c b/src/mame/video/cyberbal.c
index 8b16dac44e1..e7be8e54fba 100644
--- a/src/mame/video/cyberbal.c
+++ b/src/mame/video/cyberbal.c
@@ -176,9 +176,9 @@ static void video_start_cyberbal_common(running_machine &machine, int screens)
}
-VIDEO_START( cyberbal )
+VIDEO_START_MEMBER(cyberbal_state,cyberbal)
{
- video_start_cyberbal_common(machine, 2);
+ video_start_cyberbal_common(machine(), 2);
/* adjust the sprite positions */
atarimo_set_xscroll(0, 4);
@@ -186,9 +186,9 @@ VIDEO_START( cyberbal )
}
-VIDEO_START( cyberbal2p )
+VIDEO_START_MEMBER(cyberbal_state,cyberbal2p)
{
- video_start_cyberbal_common(machine, 1);
+ video_start_cyberbal_common(machine(), 1);
/* adjust the sprite positions */
atarimo_set_xscroll(0, 5);
diff --git a/src/mame/video/darius.c b/src/mame/video/darius.c
index a4865b004d2..df83af3dfe0 100644
--- a/src/mame/video/darius.c
+++ b/src/mame/video/darius.c
@@ -23,13 +23,12 @@ TILE_GET_INFO_MEMBER(darius_state::get_fg_tile_info)
/***************************************************************************/
-VIDEO_START( darius )
+void darius_state::video_start()
{
- darius_state *state = machine.driver_data<darius_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(darius_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,128,64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(darius_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,64);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
/***************************************************************************/
diff --git a/src/mame/video/darkmist.c b/src/mame/video/darkmist.c
index 04d5f2d344a..daae7254cbf 100644
--- a/src/mame/video/darkmist.c
+++ b/src/mame/video/darkmist.c
@@ -68,13 +68,13 @@ TILE_GET_INFO_MEMBER(darkmist_state::get_txttile_info)
0);
}
-PALETTE_INIT(darkmist)
+void darkmist_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x101);
+ machine().colortable = colortable_alloc(machine(), 0x101);
for (i = 0; i < 0x400; i++)
{
@@ -95,7 +95,7 @@ PALETTE_INIT(darkmist)
}
}
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -118,14 +118,13 @@ static void set_pens(running_machine &machine)
}
-VIDEO_START(darkmist)
+void darkmist_state::video_start()
{
- darkmist_state *state = machine.driver_data<darkmist_state>();
- state->m_bgtilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(darkmist_state::get_bgtile_info),state),TILEMAP_SCAN_ROWS,16,16,512,64 );
- state->m_fgtilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(darkmist_state::get_fgtile_info),state),TILEMAP_SCAN_ROWS,16,16,64,256 );
- state->m_txtilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(darkmist_state::get_txttile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32 );
- state->m_fgtilemap->set_transparent_pen(0);
- state->m_txtilemap->set_transparent_pen(0);
+ m_bgtilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(darkmist_state::get_bgtile_info),this),TILEMAP_SCAN_ROWS,16,16,512,64 );
+ m_fgtilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(darkmist_state::get_fgtile_info),this),TILEMAP_SCAN_ROWS,16,16,64,256 );
+ m_txtilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(darkmist_state::get_txttile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32 );
+ m_fgtilemap->set_transparent_pen(0);
+ m_txtilemap->set_transparent_pen(0);
}
SCREEN_UPDATE_IND16( darkmist)
diff --git a/src/mame/video/darkseal.c b/src/mame/video/darkseal.c
index 4ca19217b7d..08f295c119d 100644
--- a/src/mame/video/darkseal.c
+++ b/src/mame/video/darkseal.c
@@ -53,7 +53,7 @@ WRITE16_MEMBER(darkseal_state::darkseal_palette_24bit_b_w)
/******************************************************************************/
-VIDEO_START( darkseal )
+void darkseal_state::video_start()
{
}
diff --git a/src/mame/video/dassault.c b/src/mame/video/dassault.c
index a66957c8245..272bed66fc0 100644
--- a/src/mame/video/dassault.c
+++ b/src/mame/video/dassault.c
@@ -21,10 +21,10 @@
/******************************************************************************/
-VIDEO_START(dassault)
+void dassault_state::video_start()
{
- machine.device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
- machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
}
static void mixdassaultlayer(running_machine &machine, bitmap_rgb32 &bitmap, bitmap_ind16* sprite_bitmap, const rectangle &cliprect, UINT16 pri, UINT16 primask, UINT16 penbase, UINT8 alpha)
diff --git a/src/mame/video/dbz.c b/src/mame/video/dbz.c
index 7081df4437f..2afe0b4ea90 100644
--- a/src/mame/video/dbz.c
+++ b/src/mame/video/dbz.c
@@ -72,25 +72,24 @@ TILE_GET_INFO_MEMBER(dbz_state::get_dbz_bg1_tile_info)
SET_TILE_INFO_MEMBER(1, tileno, colour + (m_layer_colorbase[4] << 1), flag);
}
-VIDEO_START( dbz )
+void dbz_state::video_start()
{
- dbz_state *state = machine.driver_data<dbz_state>();
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dbz_state::get_dbz_bg1_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dbz_state::get_dbz_bg2_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dbz_state::get_dbz_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dbz_state::get_dbz_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_bg1_tilemap->set_transparent_pen(0);
- state->m_bg2_tilemap->set_transparent_pen(0);
+ m_bg1_tilemap->set_transparent_pen(0);
+ m_bg2_tilemap->set_transparent_pen(0);
- if (!strcmp(machine.system().name, "dbz"))
- k056832_set_layer_offs(state->m_k056832, 0, -34, -16);
+ if (!strcmp(machine().system().name, "dbz"))
+ k056832_set_layer_offs(m_k056832, 0, -34, -16);
else
- k056832_set_layer_offs(state->m_k056832, 0, -35, -16);
+ k056832_set_layer_offs(m_k056832, 0, -35, -16);
- k056832_set_layer_offs(state->m_k056832, 1, -31, -16);
- k056832_set_layer_offs(state->m_k056832, 3, -31, -16); //?
+ k056832_set_layer_offs(m_k056832, 1, -31, -16);
+ k056832_set_layer_offs(m_k056832, 3, -31, -16); //?
- k053247_set_sprite_offs(state->m_k053246, -87, 32);
+ k053247_set_sprite_offs(m_k053246, -87, 32);
}
SCREEN_UPDATE_IND16( dbz )
diff --git a/src/mame/video/dc.c b/src/mame/video/dc.c
index 51acd9399de..bf7f1e8141e 100644
--- a/src/mame/video/dc.c
+++ b/src/mame/video/dc.c
@@ -26,6 +26,7 @@ SPG_HBLANK_INT
---- ---- ---- ---- ---- --xx xxxx xxxx line_comp_val
*/
#define spg_hblank_in_irq ((state->pvrta_regs[SPG_HBLANK_INT] & 0x03ff0000) >> 16)
+#define spg_hblank_in_irq_new ((pvrta_regs[SPG_HBLANK_INT] & 0x03ff0000) >> 16)
#define spg_hblank_int_mode ((state->pvrta_regs[SPG_HBLANK_INT] & 0x00003000) >> 12)
#define spg_line_comp_val ((state->pvrta_regs[SPG_HBLANK_INT] & 0x000003ff) >> 0)
@@ -36,6 +37,8 @@ SPG_VBLANK_INT
*/
#define spg_vblank_out_irq_line_num ((state->pvrta_regs[SPG_VBLANK_INT] & 0x03ff0000) >> 16)
#define spg_vblank_in_irq_line_num ((state->pvrta_regs[SPG_VBLANK_INT] & 0x000003ff) >> 0)
+#define spg_vblank_out_irq_line_num_new ((pvrta_regs[SPG_VBLANK_INT] & 0x03ff0000) >> 16)
+#define spg_vblank_in_irq_line_num_new ((pvrta_regs[SPG_VBLANK_INT] & 0x000003ff) >> 0)
/*
@@ -2578,28 +2581,27 @@ static TIMER_CALLBACK(endofrender_isp)
}
-VIDEO_START(dc)
+void dc_state::video_start()
{
- dc_state *state = machine.driver_data<dc_state>();
- memset(state->pvrctrl_regs, 0, sizeof(state->pvrctrl_regs));
- memset(state->pvrta_regs, 0, sizeof(state->pvrta_regs));
+ memset(pvrctrl_regs, 0, sizeof(pvrctrl_regs));
+ memset(pvrta_regs, 0, sizeof(pvrta_regs));
memset(state_ta.grab, 0, sizeof(state_ta.grab));
pvr_build_parameterconfig();
// if the next 2 registers do not have the correct values, the naomi bios will hang
- state->pvrta_regs[PVRID]=0x17fd11db;
- state->pvrta_regs[REVISION]=0x11;
+ pvrta_regs[PVRID]=0x17fd11db;
+ pvrta_regs[REVISION]=0x11;
/* FIXME: move the following regs inside MACHINE_RESET */
- state->pvrta_regs[VO_CONTROL]= 0x00000108;
- state->pvrta_regs[SOFTRESET]= 0x00000007;
- state->pvrta_regs[VO_STARTX]= 0x0000009d;
- state->pvrta_regs[VO_STARTY]= 0x00150015;
- state->pvrta_regs[SPG_HBLANK]= 0x007e0345;
- state->pvrta_regs[SPG_LOAD]= 0x01060359;
- state->pvrta_regs[SPG_VBLANK]= 0x01500104;
- state->pvrta_regs[SPG_HBLANK_INT]= 0x031d0000;
- state->pvrta_regs[SPG_VBLANK_INT]= 0x01500104;
+ pvrta_regs[VO_CONTROL]= 0x00000108;
+ pvrta_regs[SOFTRESET]= 0x00000007;
+ pvrta_regs[VO_STARTX]= 0x0000009d;
+ pvrta_regs[VO_STARTY]= 0x00150015;
+ pvrta_regs[SPG_HBLANK]= 0x007e0345;
+ pvrta_regs[SPG_LOAD]= 0x01060359;
+ pvrta_regs[SPG_VBLANK]= 0x01500104;
+ pvrta_regs[SPG_HBLANK_INT]= 0x031d0000;
+ pvrta_regs[SPG_VBLANK_INT]= 0x01500104;
state_ta.tafifo_pos=0;
state_ta.tafifo_mask=7;
@@ -2611,27 +2613,27 @@ VIDEO_START(dc)
computedilated();
- state->vbout_timer = machine.scheduler().timer_alloc(FUNC(vbout));
- state->vbout_timer->adjust(machine.primary_screen->time_until_pos(spg_vblank_out_irq_line_num));
+ vbout_timer = machine().scheduler().timer_alloc(FUNC(vbout));
+ vbout_timer->adjust(machine().primary_screen->time_until_pos(spg_vblank_out_irq_line_num_new));
- state->vbin_timer = machine.scheduler().timer_alloc(FUNC(vbin));
- state->vbin_timer->adjust(machine.primary_screen->time_until_pos(spg_vblank_in_irq_line_num));
+ vbin_timer = machine().scheduler().timer_alloc(FUNC(vbin));
+ vbin_timer->adjust(machine().primary_screen->time_until_pos(spg_vblank_in_irq_line_num_new));
- state->hbin_timer = machine.scheduler().timer_alloc(FUNC(hbin));
- state->hbin_timer->adjust(machine.primary_screen->time_until_pos(0, spg_hblank_in_irq-1));
+ hbin_timer = machine().scheduler().timer_alloc(FUNC(hbin));
+ hbin_timer->adjust(machine().primary_screen->time_until_pos(0, spg_hblank_in_irq_new-1));
- state->scanline = 0;
- state->next_y = 0;
+ scanline = 0;
+ next_y = 0;
- state->endofrender_timer_isp = machine.scheduler().timer_alloc(FUNC(endofrender_isp));
- state->endofrender_timer_tsp = machine.scheduler().timer_alloc(FUNC(endofrender_tsp));
- state->endofrender_timer_video = machine.scheduler().timer_alloc(FUNC(endofrender_video));
+ endofrender_timer_isp = machine().scheduler().timer_alloc(FUNC(endofrender_isp));
+ endofrender_timer_tsp = machine().scheduler().timer_alloc(FUNC(endofrender_tsp));
+ endofrender_timer_video = machine().scheduler().timer_alloc(FUNC(endofrender_video));
- state->endofrender_timer_isp->adjust(attotime::never);
- state->endofrender_timer_tsp->adjust(attotime::never);
- state->endofrender_timer_video->adjust(attotime::never);
+ endofrender_timer_isp->adjust(attotime::never);
+ endofrender_timer_tsp->adjust(attotime::never);
+ endofrender_timer_video->adjust(attotime::never);
- fake_accumulationbuffer_bitmap = auto_bitmap_rgb32_alloc(machine,1024,1024);
+ fake_accumulationbuffer_bitmap = auto_bitmap_rgb32_alloc(machine(),1024,1024);
}
diff --git a/src/mame/video/dcheese.c b/src/mame/video/dcheese.c
index 9b118c67077..63a4f8f7594 100644
--- a/src/mame/video/dcheese.c
+++ b/src/mame/video/dcheese.c
@@ -25,9 +25,9 @@
*
*************************************/
-PALETTE_INIT( dcheese )
+void dcheese_state::palette_init()
{
- const UINT16 *src = (UINT16 *)machine.root_device().memregion("user1")->base();
+ const UINT16 *src = (UINT16 *)machine().root_device().memregion("user1")->base();
int i;
/* really 65536 colors, but they don't use the later ones so we can stay */
@@ -35,7 +35,7 @@ PALETTE_INIT( dcheese )
for (i = 0; i < 65534; i++)
{
int data = *src++;
- palette_set_color_rgb(machine, i, pal6bit(data >> 0), pal5bit(data >> 6), pal5bit(data >> 11));
+ palette_set_color_rgb(machine(), i, pal6bit(data >> 0), pal5bit(data >> 6), pal5bit(data >> 11));
}
}
@@ -90,22 +90,21 @@ static TIMER_CALLBACK( dcheese_signal_irq_callback )
*
*************************************/
-VIDEO_START( dcheese )
+void dcheese_state::video_start()
{
- dcheese_state *state = machine.driver_data<dcheese_state>();
/* the destination bitmap is not directly accessible to the CPU */
- state->m_dstbitmap = auto_bitmap_ind16_alloc(machine, DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT);
+ m_dstbitmap = auto_bitmap_ind16_alloc(machine(), DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT);
/* create a timer */
- state->m_blitter_timer = machine.scheduler().timer_alloc(FUNC(blitter_scanline_callback));
+ m_blitter_timer = machine().scheduler().timer_alloc(FUNC(blitter_scanline_callback));
/* register for saving */
- state->save_item(NAME(state->m_blitter_color));
- state->save_item(NAME(state->m_blitter_xparam));
- state->save_item(NAME(state->m_blitter_yparam));
- state->save_item(NAME(state->m_blitter_vidparam));
- state->save_item(NAME(*state->m_dstbitmap));
+ save_item(NAME(m_blitter_color));
+ save_item(NAME(m_blitter_xparam));
+ save_item(NAME(m_blitter_yparam));
+ save_item(NAME(m_blitter_vidparam));
+ save_item(NAME(*m_dstbitmap));
}
diff --git a/src/mame/video/dcon.c b/src/mame/video/dcon.c
index 565b6985d51..b17adfdf0d1 100644
--- a/src/mame/video/dcon.c
+++ b/src/mame/video/dcon.c
@@ -125,19 +125,18 @@ TILE_GET_INFO_MEMBER(dcon_state::get_text_tile_info)
0);
}
-VIDEO_START( dcon )
+void dcon_state::video_start()
{
- dcon_state *state = machine.driver_data<dcon_state>();
- state->m_background_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dcon_state::get_back_tile_info),state),TILEMAP_SCAN_ROWS, 16,16,32,32);
- state->m_foreground_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dcon_state::get_fore_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_midground_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dcon_state::get_mid_tile_info),state), TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dcon_state::get_text_tile_info),state),TILEMAP_SCAN_ROWS, 8,8,64,32);
+ m_background_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dcon_state::get_back_tile_info),this),TILEMAP_SCAN_ROWS, 16,16,32,32);
+ m_foreground_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dcon_state::get_fore_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_midground_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dcon_state::get_mid_tile_info),this), TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dcon_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,64,32);
- state->m_midground_layer->set_transparent_pen(15);
- state->m_foreground_layer->set_transparent_pen(15);
- state->m_text_layer->set_transparent_pen(15);
+ m_midground_layer->set_transparent_pen(15);
+ m_foreground_layer->set_transparent_pen(15);
+ m_text_layer->set_transparent_pen(15);
- state->m_gfx_bank_select = 0;
+ m_gfx_bank_select = 0;
}
static void draw_sprites(running_machine& machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
diff --git a/src/mame/video/dday.c b/src/mame/video/dday.c
index ec7681294b7..55063eaad92 100644
--- a/src/mame/video/dday.c
+++ b/src/mame/video/dday.c
@@ -48,15 +48,15 @@ static void start_countdown_timer(running_machine &machine)
***************************************************************************/
-PALETTE_INIT( dday )
+void dday_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- palette_set_shadow_factor(machine, 1.0 / 8);
+ palette_set_shadow_factor(machine(), 1.0 / 8);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -65,85 +65,85 @@ PALETTE_INIT( dday )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* HACK!!! This table is handgenerated, but it matches the screenshot.
I have no clue how it really works */
- colortable_entry_set_value(machine.colortable, 0*8+0+0, 0x00);
- colortable_entry_set_value(machine.colortable, 0*8+0+1, 0x01);
- colortable_entry_set_value(machine.colortable, 0*8+0+2, 0x15);
- colortable_entry_set_value(machine.colortable, 0*8+0+3, 0x02);
- colortable_entry_set_value(machine.colortable, 0*8+4+0, 0x00);
- colortable_entry_set_value(machine.colortable, 0*8+4+1, 0x01);
- colortable_entry_set_value(machine.colortable, 0*8+4+2, 0x15);
- colortable_entry_set_value(machine.colortable, 0*8+4+3, 0x02);
-
- colortable_entry_set_value(machine.colortable, 1*8+0+0, 0x04);
- colortable_entry_set_value(machine.colortable, 1*8+0+1, 0x05);
- colortable_entry_set_value(machine.colortable, 1*8+0+2, 0x03);
- colortable_entry_set_value(machine.colortable, 1*8+0+3, 0x07);
- colortable_entry_set_value(machine.colortable, 1*8+4+0, 0x04);
- colortable_entry_set_value(machine.colortable, 1*8+4+1, 0x05);
- colortable_entry_set_value(machine.colortable, 1*8+4+2, 0x03);
- colortable_entry_set_value(machine.colortable, 1*8+4+3, 0x07);
-
- colortable_entry_set_value(machine.colortable, 2*8+0+0, 0x08);
- colortable_entry_set_value(machine.colortable, 2*8+0+1, 0x15);
- colortable_entry_set_value(machine.colortable, 2*8+0+2, 0x0a);
- colortable_entry_set_value(machine.colortable, 2*8+0+3, 0x03);
- colortable_entry_set_value(machine.colortable, 2*8+4+0, 0x08);
- colortable_entry_set_value(machine.colortable, 2*8+4+1, 0x15);
- colortable_entry_set_value(machine.colortable, 2*8+4+2, 0x0a);
- colortable_entry_set_value(machine.colortable, 2*8+4+3, 0x03);
-
- colortable_entry_set_value(machine.colortable, 3*8+0+0, 0x08);
- colortable_entry_set_value(machine.colortable, 3*8+0+1, 0x15);
- colortable_entry_set_value(machine.colortable, 3*8+0+2, 0x0a);
- colortable_entry_set_value(machine.colortable, 3*8+0+3, 0x03);
- colortable_entry_set_value(machine.colortable, 3*8+4+0, 0x08);
- colortable_entry_set_value(machine.colortable, 3*8+4+1, 0x15);
- colortable_entry_set_value(machine.colortable, 3*8+4+2, 0x0a);
- colortable_entry_set_value(machine.colortable, 3*8+4+3, 0x03);
-
- colortable_entry_set_value(machine.colortable, 4*8+0+0, 0x10);
- colortable_entry_set_value(machine.colortable, 4*8+0+1, 0x11);
- colortable_entry_set_value(machine.colortable, 4*8+0+2, 0x12);
- colortable_entry_set_value(machine.colortable, 4*8+0+3, 0x07);
- colortable_entry_set_value(machine.colortable, 4*8+4+0, 0x10);
- colortable_entry_set_value(machine.colortable, 4*8+4+1, 0x11);
- colortable_entry_set_value(machine.colortable, 4*8+4+2, 0x12);
- colortable_entry_set_value(machine.colortable, 4*8+4+3, 0x07);
-
- colortable_entry_set_value(machine.colortable, 5*8+0+0, 0x1d);
- colortable_entry_set_value(machine.colortable, 5*8+0+1, 0x15);
- colortable_entry_set_value(machine.colortable, 5*8+0+2, 0x16);
- colortable_entry_set_value(machine.colortable, 5*8+0+3, 0x1b);
- colortable_entry_set_value(machine.colortable, 5*8+4+0, 0x1d);
- colortable_entry_set_value(machine.colortable, 5*8+4+1, 0x15);
- colortable_entry_set_value(machine.colortable, 5*8+4+2, 0x16);
- colortable_entry_set_value(machine.colortable, 5*8+4+3, 0x1b);
-
- colortable_entry_set_value(machine.colortable, 6*8+0+0, 0x1d);
- colortable_entry_set_value(machine.colortable, 6*8+0+1, 0x15);
- colortable_entry_set_value(machine.colortable, 6*8+0+2, 0x1a);
- colortable_entry_set_value(machine.colortable, 6*8+0+3, 0x1b);
- colortable_entry_set_value(machine.colortable, 6*8+4+0, 0x1d);
- colortable_entry_set_value(machine.colortable, 6*8+4+1, 0x15);
- colortable_entry_set_value(machine.colortable, 6*8+4+2, 0x1a);
- colortable_entry_set_value(machine.colortable, 6*8+4+3, 0x1b);
-
- colortable_entry_set_value(machine.colortable, 7*8+0+0, 0x1d);
- colortable_entry_set_value(machine.colortable, 7*8+0+1, 0x02);
- colortable_entry_set_value(machine.colortable, 7*8+0+2, 0x04);
- colortable_entry_set_value(machine.colortable, 7*8+0+3, 0x1b);
- colortable_entry_set_value(machine.colortable, 7*8+4+0, 0x1d);
- colortable_entry_set_value(machine.colortable, 7*8+4+1, 0x02);
- colortable_entry_set_value(machine.colortable, 7*8+4+2, 0x04);
- colortable_entry_set_value(machine.colortable, 7*8+4+3, 0x1b);
+ colortable_entry_set_value(machine().colortable, 0*8+0+0, 0x00);
+ colortable_entry_set_value(machine().colortable, 0*8+0+1, 0x01);
+ colortable_entry_set_value(machine().colortable, 0*8+0+2, 0x15);
+ colortable_entry_set_value(machine().colortable, 0*8+0+3, 0x02);
+ colortable_entry_set_value(machine().colortable, 0*8+4+0, 0x00);
+ colortable_entry_set_value(machine().colortable, 0*8+4+1, 0x01);
+ colortable_entry_set_value(machine().colortable, 0*8+4+2, 0x15);
+ colortable_entry_set_value(machine().colortable, 0*8+4+3, 0x02);
+
+ colortable_entry_set_value(machine().colortable, 1*8+0+0, 0x04);
+ colortable_entry_set_value(machine().colortable, 1*8+0+1, 0x05);
+ colortable_entry_set_value(machine().colortable, 1*8+0+2, 0x03);
+ colortable_entry_set_value(machine().colortable, 1*8+0+3, 0x07);
+ colortable_entry_set_value(machine().colortable, 1*8+4+0, 0x04);
+ colortable_entry_set_value(machine().colortable, 1*8+4+1, 0x05);
+ colortable_entry_set_value(machine().colortable, 1*8+4+2, 0x03);
+ colortable_entry_set_value(machine().colortable, 1*8+4+3, 0x07);
+
+ colortable_entry_set_value(machine().colortable, 2*8+0+0, 0x08);
+ colortable_entry_set_value(machine().colortable, 2*8+0+1, 0x15);
+ colortable_entry_set_value(machine().colortable, 2*8+0+2, 0x0a);
+ colortable_entry_set_value(machine().colortable, 2*8+0+3, 0x03);
+ colortable_entry_set_value(machine().colortable, 2*8+4+0, 0x08);
+ colortable_entry_set_value(machine().colortable, 2*8+4+1, 0x15);
+ colortable_entry_set_value(machine().colortable, 2*8+4+2, 0x0a);
+ colortable_entry_set_value(machine().colortable, 2*8+4+3, 0x03);
+
+ colortable_entry_set_value(machine().colortable, 3*8+0+0, 0x08);
+ colortable_entry_set_value(machine().colortable, 3*8+0+1, 0x15);
+ colortable_entry_set_value(machine().colortable, 3*8+0+2, 0x0a);
+ colortable_entry_set_value(machine().colortable, 3*8+0+3, 0x03);
+ colortable_entry_set_value(machine().colortable, 3*8+4+0, 0x08);
+ colortable_entry_set_value(machine().colortable, 3*8+4+1, 0x15);
+ colortable_entry_set_value(machine().colortable, 3*8+4+2, 0x0a);
+ colortable_entry_set_value(machine().colortable, 3*8+4+3, 0x03);
+
+ colortable_entry_set_value(machine().colortable, 4*8+0+0, 0x10);
+ colortable_entry_set_value(machine().colortable, 4*8+0+1, 0x11);
+ colortable_entry_set_value(machine().colortable, 4*8+0+2, 0x12);
+ colortable_entry_set_value(machine().colortable, 4*8+0+3, 0x07);
+ colortable_entry_set_value(machine().colortable, 4*8+4+0, 0x10);
+ colortable_entry_set_value(machine().colortable, 4*8+4+1, 0x11);
+ colortable_entry_set_value(machine().colortable, 4*8+4+2, 0x12);
+ colortable_entry_set_value(machine().colortable, 4*8+4+3, 0x07);
+
+ colortable_entry_set_value(machine().colortable, 5*8+0+0, 0x1d);
+ colortable_entry_set_value(machine().colortable, 5*8+0+1, 0x15);
+ colortable_entry_set_value(machine().colortable, 5*8+0+2, 0x16);
+ colortable_entry_set_value(machine().colortable, 5*8+0+3, 0x1b);
+ colortable_entry_set_value(machine().colortable, 5*8+4+0, 0x1d);
+ colortable_entry_set_value(machine().colortable, 5*8+4+1, 0x15);
+ colortable_entry_set_value(machine().colortable, 5*8+4+2, 0x16);
+ colortable_entry_set_value(machine().colortable, 5*8+4+3, 0x1b);
+
+ colortable_entry_set_value(machine().colortable, 6*8+0+0, 0x1d);
+ colortable_entry_set_value(machine().colortable, 6*8+0+1, 0x15);
+ colortable_entry_set_value(machine().colortable, 6*8+0+2, 0x1a);
+ colortable_entry_set_value(machine().colortable, 6*8+0+3, 0x1b);
+ colortable_entry_set_value(machine().colortable, 6*8+4+0, 0x1d);
+ colortable_entry_set_value(machine().colortable, 6*8+4+1, 0x15);
+ colortable_entry_set_value(machine().colortable, 6*8+4+2, 0x1a);
+ colortable_entry_set_value(machine().colortable, 6*8+4+3, 0x1b);
+
+ colortable_entry_set_value(machine().colortable, 7*8+0+0, 0x1d);
+ colortable_entry_set_value(machine().colortable, 7*8+0+1, 0x02);
+ colortable_entry_set_value(machine().colortable, 7*8+0+2, 0x04);
+ colortable_entry_set_value(machine().colortable, 7*8+0+3, 0x1b);
+ colortable_entry_set_value(machine().colortable, 7*8+4+0, 0x1d);
+ colortable_entry_set_value(machine().colortable, 7*8+4+1, 0x02);
+ colortable_entry_set_value(machine().colortable, 7*8+4+2, 0x04);
+ colortable_entry_set_value(machine().colortable, 7*8+4+3, 0x1b);
}
@@ -207,21 +207,20 @@ TILE_GET_INFO_MEMBER(dday_state::get_sl_tile_info)
***************************************************************************/
-VIDEO_START( dday )
+void dday_state::video_start()
{
- dday_state *state = machine.driver_data<dday_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dday_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dday_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_text_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dday_state::get_text_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_sl_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dday_state::get_sl_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dday_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dday_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_text_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dday_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_sl_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dday_state::get_sl_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- machine.primary_screen->register_screen_bitmap(state->m_main_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_main_bitmap);
- state->m_bg_tilemap->set_transmask(0, 0x00f0, 0xff0f); /* pens 0-3 have priority over the foreground layer */
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_text_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transmask(0, 0x00f0, 0xff0f); /* pens 0-3 have priority over the foreground layer */
+ m_fg_tilemap->set_transparent_pen(0);
+ m_text_tilemap->set_transparent_pen(0);
- start_countdown_timer(machine);
+ start_countdown_timer(machine());
}
WRITE8_MEMBER(dday_state::dday_bgvideoram_w)
diff --git a/src/mame/video/ddragon.c b/src/mame/video/ddragon.c
index 96b97ef1fd9..6e1f7837b54 100644
--- a/src/mame/video/ddragon.c
+++ b/src/mame/video/ddragon.c
@@ -93,30 +93,28 @@ TILE_GET_INFO_MEMBER(ddragon_state::get_fg_16color_tile_info)
***************************************************************************/
-VIDEO_START( ddragon )
+VIDEO_START_MEMBER(ddragon_state,ddragon)
{
- ddragon_state *state = machine.driver_data<ddragon_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ddragon_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(ddragon_state::background_scan),state), 16, 16, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ddragon_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ddragon_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(ddragon_state::background_scan),this), 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ddragon_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scrolldx(0, 384 - 256);
- state->m_bg_tilemap->set_scrolldx(0, 384 - 256);
- state->m_fg_tilemap->set_scrolldy(-8, -8);
- state->m_bg_tilemap->set_scrolldy(-8, -8);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_scrolldx(0, 384 - 256);
+ m_bg_tilemap->set_scrolldx(0, 384 - 256);
+ m_fg_tilemap->set_scrolldy(-8, -8);
+ m_bg_tilemap->set_scrolldy(-8, -8);
}
-VIDEO_START( chinagat )
+VIDEO_START_MEMBER(ddragon_state,chinagat)
{
- ddragon_state *state = machine.driver_data<ddragon_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ddragon_state::get_bg_tile_info),state),tilemap_mapper_delegate(FUNC(ddragon_state::background_scan),state), 16, 16, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ddragon_state::get_fg_16color_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ddragon_state::get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(ddragon_state::background_scan),this), 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ddragon_state::get_fg_16color_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scrolldy(-8, -8);
- state->m_bg_tilemap->set_scrolldy(-8, -8);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_scrolldy(-8, -8);
+ m_bg_tilemap->set_scrolldy(-8, -8);
}
diff --git a/src/mame/video/ddragon3.c b/src/mame/video/ddragon3.c
index 8e6695d3d89..43582b9be21 100644
--- a/src/mame/video/ddragon3.c
+++ b/src/mame/video/ddragon3.c
@@ -74,15 +74,14 @@ TILE_GET_INFO_MEMBER(ddragon3_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( ddragon3 )
+void ddragon3_state::video_start()
{
- ddragon3_state *state = machine.driver_data<ddragon3_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ddragon3_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ddragon3_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ddragon3_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ddragon3_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
/*
diff --git a/src/mame/video/ddribble.c b/src/mame/video/ddribble.c
index 71462f3c386..25303031923 100644
--- a/src/mame/video/ddribble.c
+++ b/src/mame/video/ddribble.c
@@ -10,22 +10,22 @@
#include "includes/ddribble.h"
-PALETTE_INIT( ddribble )
+void ddribble_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x40);
+ machine().colortable = colortable_alloc(machine(), 0x40);
for (i = 0x10; i < 0x40; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprite #2 uses pens 0x00-0x0f */
for (i = 0x40; i < 0x140; i++)
{
UINT8 ctabentry = color_prom[i - 0x40] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -121,14 +121,13 @@ TILE_GET_INFO_MEMBER(ddribble_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( ddribble )
+void ddribble_state::video_start()
{
- ddribble_state *state = machine.driver_data<ddribble_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ddribble_state::get_fg_tile_info),state), tilemap_mapper_delegate(FUNC(ddribble_state::tilemap_scan),state), 8, 8, 64, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ddribble_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(ddribble_state::tilemap_scan),state), 8, 8, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ddribble_state::get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(ddribble_state::tilemap_scan),this), 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ddribble_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(ddribble_state::tilemap_scan),this), 8, 8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
/***************************************************************************
diff --git a/src/mame/video/deadang.c b/src/mame/video/deadang.c
index e6483415773..ed16010f65e 100644
--- a/src/mame/video/deadang.c
+++ b/src/mame/video/deadang.c
@@ -69,17 +69,16 @@ TILE_GET_INFO_MEMBER(deadang_state::get_text_tile_info)
SET_TILE_INFO_MEMBER(0,tile,color,0);
}
-VIDEO_START( deadang )
+void deadang_state::video_start()
{
- deadang_state *state = machine.driver_data<deadang_state>();
- state->m_pf3_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(deadang_state::get_pf3_tile_info),state),tilemap_mapper_delegate(FUNC(deadang_state::bg_scan),state),16,16,128,256);
- state->m_pf2_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(deadang_state::get_pf2_tile_info),state),tilemap_mapper_delegate(FUNC(deadang_state::bg_scan),state),16,16,128,256);
- state->m_pf1_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(deadang_state::get_pf1_tile_info),state),TILEMAP_SCAN_COLS,16,16, 32, 32);
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(deadang_state::get_text_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
-
- state->m_pf2_layer->set_transparent_pen(15);
- state->m_pf1_layer->set_transparent_pen(15);
- state->m_text_layer->set_transparent_pen(15);
+ m_pf3_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deadang_state::get_pf3_tile_info),this),tilemap_mapper_delegate(FUNC(deadang_state::bg_scan),this),16,16,128,256);
+ m_pf2_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deadang_state::get_pf2_tile_info),this),tilemap_mapper_delegate(FUNC(deadang_state::bg_scan),this),16,16,128,256);
+ m_pf1_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deadang_state::get_pf1_tile_info),this),TILEMAP_SCAN_COLS,16,16, 32, 32);
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deadang_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+
+ m_pf2_layer->set_transparent_pen(15);
+ m_pf1_layer->set_transparent_pen(15);
+ m_text_layer->set_transparent_pen(15);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/dec0.c b/src/mame/video/dec0.c
index 88bdaf83886..1a490ec5220 100644
--- a/src/mame/video/dec0.c
+++ b/src/mame/video/dec0.c
@@ -371,22 +371,19 @@ WRITE16_MEMBER(dec0_state::dec0_priority_w)
COMBINE_DATA(&m_pri);
}
-VIDEO_START( dec0_nodma )
+VIDEO_START_MEMBER(dec0_state,dec0_nodma)
{
- dec0_state *state = machine.driver_data<dec0_state>();
- state->m_buffered_spriteram = state->m_spriteram;
+ m_buffered_spriteram = m_spriteram;
}
-VIDEO_START( dec0 )
+VIDEO_START_MEMBER(dec0_state,dec0)
{
- dec0_state *state = machine.driver_data<dec0_state>();
- VIDEO_START_CALL(dec0_nodma);
- state->m_buffered_spriteram = auto_alloc_array(machine, UINT16, 0x800/2);
+ VIDEO_START_CALL_MEMBER(dec0_nodma);
+ m_buffered_spriteram = auto_alloc_array(machine(), UINT16, 0x800/2);
}
-VIDEO_START( automat )
+VIDEO_START_MEMBER(dec0_automat_state,automat)
{
-// dec0_state *state = machine.driver_data<dec0_state>();
}
/******************************************************************************/
diff --git a/src/mame/video/dec8.c b/src/mame/video/dec8.c
index b52f8707359..91d17067c49 100644
--- a/src/mame/video/dec8.c
+++ b/src/mame/video/dec8.c
@@ -75,12 +75,12 @@ sprites.
***************************************************************************/
-PALETTE_INIT( ghostb )
+PALETTE_INIT_MEMBER(dec8_state,ghostb)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, bit3, r, g, b;
@@ -94,13 +94,13 @@ PALETTE_INIT( ghostb )
bit2 = (color_prom[i] >> 6) & 0x01;
bit3 = (color_prom[i] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -293,16 +293,15 @@ TILE_GET_INFO_MEMBER(dec8_state::get_cobracom_fix_tile_info)
0);
}
-VIDEO_START( cobracom )
+VIDEO_START_MEMBER(dec8_state,cobracom)
{
- dec8_state *state = machine.driver_data<dec8_state>();
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_cobracom_fix_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_cobracom_fix_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
+ m_fix_tilemap->set_transparent_pen(0);
- state->m_game_uses_priority = 0;
- machine.device<deco_bac06_device>("tilegen1")->set_colmask(0x3);
- machine.device<deco_bac06_device>("tilegen2")->set_colmask(0x3);
+ m_game_uses_priority = 0;
+ machine().device<deco_bac06_device>("tilegen1")->set_colmask(0x3);
+ machine().device<deco_bac06_device>("tilegen2")->set_colmask(0x3);
}
@@ -330,14 +329,13 @@ TILE_GET_INFO_MEMBER(dec8_state::get_ghostb_fix_tile_info)
0);
}
-VIDEO_START( ghostb )
+VIDEO_START_MEMBER(dec8_state,ghostb)
{
- dec8_state *state = machine.driver_data<dec8_state>();
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_ghostb_fix_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_ghostb_fix_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fix_tilemap->set_transparent_pen(0);
- state->m_game_uses_priority = 0;
- machine.device<deco_bac06_device>("tilegen1")->set_colmask(0xf);
+ m_game_uses_priority = 0;
+ machine().device<deco_bac06_device>("tilegen1")->set_colmask(0xf);
}
/******************************************************************************/
@@ -368,15 +366,14 @@ TILE_GET_INFO_MEMBER(dec8_state::get_oscar_fix_tile_info)
0);
}
-VIDEO_START( oscar )
+VIDEO_START_MEMBER(dec8_state,oscar)
{
- dec8_state *state = machine.driver_data<dec8_state>();
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_oscar_fix_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_oscar_fix_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
+ m_fix_tilemap->set_transparent_pen(0);
- state->m_game_uses_priority = 1;
- machine.device<deco_bac06_device>("tilegen1")->set_colmask(0x7);
+ m_game_uses_priority = 1;
+ machine().device<deco_bac06_device>("tilegen1")->set_colmask(0x7);
}
@@ -446,25 +443,23 @@ TILE_GET_INFO_MEMBER(dec8_state::get_lastmisn_fix_tile_info)
0);
}
-VIDEO_START( lastmisn )
+VIDEO_START_MEMBER(dec8_state,lastmisn)
{
- dec8_state *state = machine.driver_data<dec8_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_lastmisn_tile_info),state), tilemap_mapper_delegate(FUNC(dec8_state::lastmisn_scan_rows),state), 16, 16, 32, 32);
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_lastmisn_fix_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_lastmisn_tile_info),this), tilemap_mapper_delegate(FUNC(dec8_state::lastmisn_scan_rows),this), 16, 16, 32, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_lastmisn_fix_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
- state->m_game_uses_priority = 0;
+ m_fix_tilemap->set_transparent_pen(0);
+ m_game_uses_priority = 0;
}
-VIDEO_START( shackled )
+VIDEO_START_MEMBER(dec8_state,shackled)
{
- dec8_state *state = machine.driver_data<dec8_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_lastmisn_tile_info),state), tilemap_mapper_delegate(FUNC(dec8_state::lastmisn_scan_rows),state), 16, 16, 32, 32);
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_lastmisn_fix_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_lastmisn_tile_info),this), tilemap_mapper_delegate(FUNC(dec8_state::lastmisn_scan_rows),this), 16, 16, 32, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_lastmisn_fix_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_transmask(0, 0x000f, 0xfff0); /* Bottom 12 pens */
- state->m_game_uses_priority = 1;
+ m_fix_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transmask(0, 0x000f, 0xfff0); /* Bottom 12 pens */
+ m_game_uses_priority = 1;
}
/******************************************************************************/
@@ -517,17 +512,16 @@ TILE_GET_INFO_MEMBER(dec8_state::get_srdarwin_tile_info)
tileinfo.group = color;
}
-VIDEO_START( srdarwin )
+VIDEO_START_MEMBER(dec8_state,srdarwin)
{
- dec8_state *state = machine.driver_data<dec8_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_srdarwin_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 16);
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_srdarwin_fix_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_srdarwin_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 16);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_srdarwin_fix_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); //* draw as background only
- state->m_bg_tilemap->set_transmask(1, 0x00ff, 0xff00); /* Bottom 8 pens */
- state->m_bg_tilemap->set_transmask(2, 0x00ff, 0xff00); /* Bottom 8 pens */
- state->m_bg_tilemap->set_transmask(3, 0x0000, 0xffff); //* draw as foreground only
+ m_fix_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); //* draw as background only
+ m_bg_tilemap->set_transmask(1, 0x00ff, 0xff00); /* Bottom 8 pens */
+ m_bg_tilemap->set_transmask(2, 0x00ff, 0xff00); /* Bottom 8 pens */
+ m_bg_tilemap->set_transmask(3, 0x0000, 0xffff); //* draw as foreground only
}
/******************************************************************************/
@@ -590,25 +584,23 @@ TILE_GET_INFO_MEMBER(dec8_state::get_gondo_tile_info)
0);
}
-VIDEO_START( gondo )
+VIDEO_START_MEMBER(dec8_state,gondo)
{
- dec8_state *state = machine.driver_data<dec8_state>();
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_gondo_fix_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_gondo_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_gondo_fix_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_gondo_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_transmask(0, 0x00ff, 0xff00); /* Bottom 8 pens */
- state->m_game_uses_priority = 0;
+ m_fix_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transmask(0, 0x00ff, 0xff00); /* Bottom 8 pens */
+ m_game_uses_priority = 0;
}
-VIDEO_START( garyoret )
+VIDEO_START_MEMBER(dec8_state,garyoret)
{
- dec8_state *state = machine.driver_data<dec8_state>();
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_gondo_fix_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_gondo_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_gondo_fix_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dec8_state::get_gondo_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
- state->m_game_uses_priority = 1;
+ m_fix_tilemap->set_transparent_pen(0);
+ m_game_uses_priority = 1;
}
/******************************************************************************/
diff --git a/src/mame/video/deco32.c b/src/mame/video/deco32.c
index 62d72b6465f..6b5c3230b6f 100644
--- a/src/mame/video/deco32.c
+++ b/src/mame/video/deco32.c
@@ -510,55 +510,50 @@ static void dragngun_draw_sprites(running_machine& machine, bitmap_rgb32 &bitmap
/******************************************************************************/
-VIDEO_START( captaven )
+VIDEO_START_MEMBER(deco32_state,captaven)
{
- deco32_state *state = machine.driver_data<deco32_state>();
- state->m_has_ace_ram=0;
+ m_has_ace_ram=0;
}
-VIDEO_START( fghthist )
+VIDEO_START_MEMBER(deco32_state,fghthist)
{
- deco32_state *state = machine.driver_data<deco32_state>();
- state->m_dirty_palette = auto_alloc_array(machine, UINT8, 4096);
- machine.device<decospr_device>("spritegen")->alloc_sprite_bitmap();
- state->m_has_ace_ram=0;
+ m_dirty_palette = auto_alloc_array(machine(), UINT8, 4096);
+ machine().device<decospr_device>("spritegen")->alloc_sprite_bitmap();
+ m_has_ace_ram=0;
}
-VIDEO_START( dragngun )
+VIDEO_START_MEMBER(dragngun_state,dragngun)
{
- dragngun_state *state = machine.driver_data<dragngun_state>();
- state->m_dirty_palette = auto_alloc_array(machine, UINT8, 4096);
+ m_dirty_palette = auto_alloc_array(machine(), UINT8, 4096);
- memset(state->m_dirty_palette,0,4096);
+ memset(m_dirty_palette,0,4096);
- state_save_register_global(machine, state->m_dragngun_sprite_ctrl);
- state->m_has_ace_ram=0;
+ state_save_register_global(machine(), m_dragngun_sprite_ctrl);
+ m_has_ace_ram=0;
}
-VIDEO_START( lockload )
+VIDEO_START_MEMBER(dragngun_state,lockload)
{
- dragngun_state *state = machine.driver_data<dragngun_state>();
- state->m_dirty_palette = auto_alloc_array(machine, UINT8, 4096);
+ m_dirty_palette = auto_alloc_array(machine(), UINT8, 4096);
- memset(state->m_dirty_palette,0,4096);
+ memset(m_dirty_palette,0,4096);
- state_save_register_global(machine, state->m_dragngun_sprite_ctrl);
- state->m_has_ace_ram=0;
+ state_save_register_global(machine(), m_dragngun_sprite_ctrl);
+ m_has_ace_ram=0;
}
-VIDEO_START( nslasher )
+VIDEO_START_MEMBER(deco32_state,nslasher)
{
- deco32_state *state = machine.driver_data<deco32_state>();
int width, height;
- state->m_dirty_palette = auto_alloc_array(machine, UINT8, 4096);
- width = machine.primary_screen->width();
- height = machine.primary_screen->height();
- state->m_tilemap_alpha_bitmap=auto_bitmap_ind16_alloc(machine, width, height );
- machine.device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
- machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
- memset(state->m_dirty_palette,0,4096);
- state_save_register_global(machine, state->m_pri);
- state->m_has_ace_ram=1;
+ m_dirty_palette = auto_alloc_array(machine(), UINT8, 4096);
+ width = machine().primary_screen->width();
+ height = machine().primary_screen->height();
+ m_tilemap_alpha_bitmap=auto_bitmap_ind16_alloc(machine(), width, height );
+ machine().device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
+ memset(m_dirty_palette,0,4096);
+ state_save_register_global(machine(), m_pri);
+ m_has_ace_ram=1;
}
/******************************************************************************/
diff --git a/src/mame/video/deco_mlc.c b/src/mame/video/deco_mlc.c
index fae506860e6..39a9f68cae8 100644
--- a/src/mame/video/deco_mlc.c
+++ b/src/mame/video/deco_mlc.c
@@ -17,18 +17,17 @@
/******************************************************************************/
-VIDEO_START( mlc )
+VIDEO_START_MEMBER(deco_mlc_state,mlc)
{
- deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
- if (machine.gfx[0]->granularity()==16)
- state->m_colour_mask=0x7f;
- else if (machine.gfx[0]->granularity()==32)
- state->m_colour_mask=0x3f;
+ if (machine().gfx[0]->granularity()==16)
+ m_colour_mask=0x7f;
+ else if (machine().gfx[0]->granularity()==32)
+ m_colour_mask=0x3f;
else
- state->m_colour_mask=0x1f;
+ m_colour_mask=0x1f;
-// temp_bitmap = auto_bitmap_rgb32_alloc( machine, 512, 512 );
- state->m_mlc_buffered_spriteram = auto_alloc_array(machine, UINT32, 0x3000/4);
+// temp_bitmap = auto_bitmap_rgb32_alloc( machine(), 512, 512 );
+ m_mlc_buffered_spriteram = auto_alloc_array(machine(), UINT32, 0x3000/4);
}
#ifdef UNUSED_FUNCTION
diff --git a/src/mame/video/decocass.c b/src/mame/video/decocass.c
index c6de544f26a..13aa5d654c7 100644
--- a/src/mame/video/decocass.c
+++ b/src/mame/video/decocass.c
@@ -486,35 +486,34 @@ static void draw_missiles(running_machine &machine,bitmap_ind16 &bitmap, const r
}
-VIDEO_START( decocass )
+void decocass_state::video_start()
{
- decocass_state *state = machine.driver_data<decocass_state>();
- state->m_bg_tilemap_l = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(decocass_state::get_bg_l_tile_info),state), tilemap_mapper_delegate(FUNC(decocass_state::bgvideoram_scan_cols),state), 16, 16, 32, 32);
- state->m_bg_tilemap_r = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(decocass_state::get_bg_r_tile_info),state), tilemap_mapper_delegate(FUNC(decocass_state::bgvideoram_scan_cols),state), 16, 16, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(decocass_state::get_fg_tile_info),state), tilemap_mapper_delegate(FUNC(decocass_state::fgvideoram_scan_cols),state), 8, 8, 32, 32);
+ m_bg_tilemap_l = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(decocass_state::get_bg_l_tile_info),this), tilemap_mapper_delegate(FUNC(decocass_state::bgvideoram_scan_cols),this), 16, 16, 32, 32);
+ m_bg_tilemap_r = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(decocass_state::get_bg_r_tile_info),this), tilemap_mapper_delegate(FUNC(decocass_state::bgvideoram_scan_cols),this), 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(decocass_state::get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(decocass_state::fgvideoram_scan_cols),this), 8, 8, 32, 32);
- state->m_bg_tilemap_l->set_transparent_pen(0);
- state->m_bg_tilemap_r->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap_l->set_transparent_pen(0);
+ m_bg_tilemap_r->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap_l_clip = machine.primary_screen->visible_area();
- state->m_bg_tilemap_l_clip.max_y = 256 / 2 - 1;
+ m_bg_tilemap_l_clip = machine().primary_screen->visible_area();
+ m_bg_tilemap_l_clip.max_y = 256 / 2 - 1;
- state->m_bg_tilemap_r_clip = machine.primary_screen->visible_area();
- state->m_bg_tilemap_r_clip.min_y = 256 / 2;
+ m_bg_tilemap_r_clip = machine().primary_screen->visible_area();
+ m_bg_tilemap_r_clip.min_y = 256 / 2;
/* background videroam bits D0-D3 are shared with the tileram */
- state->m_bgvideoram = state->m_tileram;
- state->m_bgvideoram_size = 0x0400; /* d000-d3ff */
+ m_bgvideoram = m_tileram;
+ m_bgvideoram_size = 0x0400; /* d000-d3ff */
- machine.gfx[0]->set_source(state->m_charram);
- machine.gfx[1]->set_source(state->m_charram);
- machine.gfx[2]->set_source(state->m_tileram);
- machine.gfx[3]->set_source(state->m_objectram);
+ machine().gfx[0]->set_source(m_charram);
+ machine().gfx[1]->set_source(m_charram);
+ machine().gfx[2]->set_source(m_tileram);
+ machine().gfx[3]->set_source(m_objectram);
/* This should ensure that the fake 17th tile is left blank
* now that dirty-tile tracking is handled by the core */
- machine.gfx[2]->decode(16);
+ machine().gfx[2]->decode(16);
}
SCREEN_UPDATE_IND16( decocass )
diff --git a/src/mame/video/deniam.c b/src/mame/video/deniam.c
index 409d2c91cbc..d47cc9e9f56 100644
--- a/src/mame/video/deniam.c
+++ b/src/mame/video/deniam.c
@@ -100,15 +100,14 @@ TILE_GET_INFO_MEMBER(deniam_state::get_tx_tile_info)
***************************************************************************/
-VIDEO_START( deniam )
+void deniam_state::video_start()
{
- deniam_state *state = machine.driver_data<deniam_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(deniam_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(deniam_state::scan_pages),state), 8, 8, 128, 64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(deniam_state::get_fg_tile_info),state), tilemap_mapper_delegate(FUNC(deniam_state::scan_pages),state), 8, 8, 128, 64);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(deniam_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deniam_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(deniam_state::scan_pages),this), 8, 8, 128, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deniam_state::get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(deniam_state::scan_pages),this), 8, 8, 128, 64);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deniam_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/digdug.c b/src/mame/video/digdug.c
index fded1de7c84..45b33ab5d4c 100644
--- a/src/mame/video/digdug.c
+++ b/src/mame/video/digdug.c
@@ -21,12 +21,12 @@
***************************************************************************/
-PALETTE_INIT( digdug )
+PALETTE_INIT_MEMBER(digdug_state,digdug)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- machine.colortable = colortable_alloc(machine, 32);
+ machine().colortable = colortable_alloc(machine(), 32);
for (i = 0;i < 32;i++)
{
@@ -44,24 +44,24 @@ PALETTE_INIT( digdug )
bit1 = (*color_prom >> 6) & 0x01;
bit2 = (*color_prom >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
/* characters - direct mapping */
for (i = 0; i < 16; i++)
{
- colortable_entry_set_value(machine.colortable, i*2+0, 0);
- colortable_entry_set_value(machine.colortable, i*2+1, i);
+ colortable_entry_set_value(machine().colortable, i*2+0, 0);
+ colortable_entry_set_value(machine().colortable, i*2+1, i);
}
/* sprites */
for (i = 0;i < 0x100;i++)
- colortable_entry_set_value(machine.colortable, 16*2+i, (*color_prom++ & 0x0f) + 0x10);
+ colortable_entry_set_value(machine().colortable, 16*2+i, (*color_prom++ & 0x0f) + 0x10);
/* bg_select */
for (i = 0;i < 0x100;i++)
- colortable_entry_set_value(machine.colortable, 16*2+256+i, *color_prom++ & 0x0f);
+ colortable_entry_set_value(machine().colortable, 16*2+256+i, *color_prom++ & 0x0f);
}
@@ -141,19 +141,18 @@ TILE_GET_INFO_MEMBER(digdug_state::tx_get_tile_info)
***************************************************************************/
-VIDEO_START( digdug )
+VIDEO_START_MEMBER(digdug_state,digdug)
{
- digdug_state *state = machine.driver_data<digdug_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(digdug_state::bg_get_tile_info),state),tilemap_mapper_delegate(FUNC(digdug_state::tilemap_scan),state),8,8,36,28);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(digdug_state::tx_get_tile_info),state),tilemap_mapper_delegate(FUNC(digdug_state::tilemap_scan),state),8,8,36,28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(digdug_state::bg_get_tile_info),this),tilemap_mapper_delegate(FUNC(digdug_state::tilemap_scan),this),8,8,36,28);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(digdug_state::tx_get_tile_info),this),tilemap_mapper_delegate(FUNC(digdug_state::tilemap_scan),this),8,8,36,28);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->save_item(NAME(state->m_bg_select));
- state->save_item(NAME(state->m_tx_color_mode));
- state->save_item(NAME(state->m_bg_disable));
- state->save_item(NAME(state->m_bg_color_bank));
+ save_item(NAME(m_bg_select));
+ save_item(NAME(m_tx_color_mode));
+ save_item(NAME(m_bg_disable));
+ save_item(NAME(m_bg_color_bank));
}
diff --git a/src/mame/video/djboy.c b/src/mame/video/djboy.c
index 43b8f412391..f060026f8c2 100644
--- a/src/mame/video/djboy.c
+++ b/src/mame/video/djboy.c
@@ -36,10 +36,9 @@ WRITE8_MEMBER(djboy_state::djboy_videoram_w)
m_background->mark_tile_dirty(offset & 0x7ff);
}
-VIDEO_START( djboy )
+void djboy_state::video_start()
{
- djboy_state *state = machine.driver_data<djboy_state>();
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(djboy_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(djboy_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
}
WRITE8_MEMBER(djboy_state::djboy_paletteram_w)
diff --git a/src/mame/video/djmain.c b/src/mame/video/djmain.c
index e691dde1bd4..3e9222359ec 100644
--- a/src/mame/video/djmain.c
+++ b/src/mame/video/djmain.c
@@ -134,9 +134,9 @@ void djmain_tile_callback(running_machine& machine, int layer, int *code, int *c
{
}
-VIDEO_START( djmain )
+void djmain_state::video_start()
{
- device_t *k056832 = machine.device("k056832");
+ device_t *k056832 = machine().device("k056832");
k056832_set_layer_offs(k056832, 0, -92, -27);
// k056832_set_layer_offs(k056832, 1, -87, -27);
diff --git a/src/mame/video/dkong.c b/src/mame/video/dkong.c
index dd64f055dc9..9476a07a728 100644
--- a/src/mame/video/dkong.c
+++ b/src/mame/video/dkong.c
@@ -199,15 +199,14 @@ static const res_net_info radarscp_grid_net_info =
***************************************************************************/
-PALETTE_INIT( dkong2b)
+PALETTE_INIT_MEMBER(dkong_state,dkong2b)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- dkong_state *state = machine.driver_data<dkong_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t *rgb;
int i;
- rgb = compute_res_net_all(machine, color_prom, &dkong_decode_info, &dkong_net_info);
- palette_set_colors(machine, 0, rgb, 256);
+ rgb = compute_res_net_all(machine(), color_prom, &dkong_decode_info, &dkong_net_info);
+ palette_set_colors(machine(), 0, rgb, 256);
/* Now treat tri-state black background generation */
@@ -218,22 +217,21 @@ PALETTE_INIT( dkong2b)
r = compute_res_net( 1, 0, &dkong_net_bck_info );
g = compute_res_net( 1, 1, &dkong_net_bck_info );
b = compute_res_net( 1, 2, &dkong_net_bck_info );
- palette_set_color_rgb(machine,i,r,g,b);
+ palette_set_color_rgb(machine(),i,r,g,b);
}
- palette_normalize_range(machine.palette, 0, 255, 0, 255);
+ palette_normalize_range(machine().palette, 0, 255, 0, 255);
color_prom += 512;
/* color_prom now points to the beginning of the character color codes */
- state->m_color_codes = color_prom; /* we'll need it later */
- auto_free(machine, rgb);
+ m_color_codes = color_prom; /* we'll need it later */
+ auto_free(machine(), rgb);
}
#ifdef UNUSED_FUNCTION
-PALETTE_INIT( dkong4b )
+PALETTE_INIT_MEMBER(dkong_state,dkong4b)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- dkong_state *state = machine.driver_data<dkong_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
int r,g,b;
@@ -247,7 +245,7 @@ PALETTE_INIT( dkong4b )
/* blue component */
b = compute_res_net( (color_prom[0]>>0) & 0x03, 2, &radarscp_net_info );
- palette_set_color_rgb(machine,i,r,g,b);
+ palette_set_color_rgb(machine(),i,r,g,b);
color_prom++;
}
@@ -259,21 +257,20 @@ PALETTE_INIT( dkong4b )
r = compute_res_net( 1, 0, &radarscp_net_bck_info );
g = compute_res_net( 1, 1, &radarscp_net_bck_info );
b = compute_res_net( 1, 2, &radarscp_net_bck_info );
- palette_set_color_rgb(machine,i,r,g,b);
+ palette_set_color_rgb(machine(),i,r,g,b);
}
- palette_normalize_range(machine.palette, 0, 255, 0, 255);
+ palette_normalize_range(machine().palette, 0, 255, 0, 255);
color_prom += 256;
/* color_prom now points to the beginning of the character color codes */
- state->m_color_codes = color_prom; /* we'll need it later */
+ m_color_codes = color_prom; /* we'll need it later */
}
#endif
-PALETTE_INIT( radarscp )
+PALETTE_INIT_MEMBER(dkong_state,radarscp)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- dkong_state *state = machine.driver_data<dkong_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
int r,g,b;
@@ -287,7 +284,7 @@ PALETTE_INIT( radarscp )
/* blue component */
b = compute_res_net( (color_prom[0]>>0) & 0x03, 2, &radarscp_net_info );
- palette_set_color_rgb(machine,i,r,g,b);
+ palette_set_color_rgb(machine(),i,r,g,b);
color_prom++;
}
@@ -299,14 +296,14 @@ PALETTE_INIT( radarscp )
r = compute_res_net( 1, 0, &radarscp_net_bck_info );
g = compute_res_net( 1, 1, &radarscp_net_bck_info );
b = compute_res_net( 1, 2, &radarscp_net_bck_info );
- palette_set_color_rgb(machine,i,r,g,b);
+ palette_set_color_rgb(machine(),i,r,g,b);
}
/* Star color */
r = compute_res_net( 1, 0, &radarscp_stars_net_info );
g = compute_res_net( 0, 1, &radarscp_stars_net_info );
b = compute_res_net( 0, 2, &radarscp_stars_net_info );
- palette_set_color_rgb(machine,RADARSCP_STAR_COL,r,g,b);
+ palette_set_color_rgb(machine(),RADARSCP_STAR_COL,r,g,b);
/* Oscillating background */
for (i = 0;i < 256;i++)
@@ -315,7 +312,7 @@ PALETTE_INIT( radarscp )
g = compute_res_net( 0, 1, &radarscp_blue_net_info );
b = compute_res_net( i, 2, &radarscp_blue_net_info );
- palette_set_color_rgb(machine,RADARSCP_BCK_COL_OFFSET + i,r,g,b);
+ palette_set_color_rgb(machine(),RADARSCP_BCK_COL_OFFSET + i,r,g,b);
}
/* Grid */
@@ -325,20 +322,19 @@ PALETTE_INIT( radarscp )
g = compute_res_net( (i>>1) & 1, 1, &radarscp_grid_net_info );
b = compute_res_net( (i>>2) & 1, 2, &radarscp_grid_net_info );
- palette_set_color_rgb(machine,RADARSCP_GRID_COL_OFFSET + i,r,g,b);
+ palette_set_color_rgb(machine(),RADARSCP_GRID_COL_OFFSET + i,r,g,b);
}
- palette_normalize_range(machine.palette, 0, RADARSCP_GRID_COL_OFFSET+7, 0, 255);
+ palette_normalize_range(machine().palette, 0, RADARSCP_GRID_COL_OFFSET+7, 0, 255);
color_prom += 256;
/* color_prom now points to the beginning of the character color codes */
- state->m_color_codes = color_prom; /* we'll need it later */
+ m_color_codes = color_prom; /* we'll need it later */
}
-PALETTE_INIT( radarscp1 )
+PALETTE_INIT_MEMBER(dkong_state,radarscp1)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- dkong_state *state = machine.driver_data<dkong_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
int r,g,b;
@@ -352,7 +348,7 @@ PALETTE_INIT( radarscp1 )
/* blue component */
b = compute_res_net( color_prom[0], 2, &radarscp1_net_info );
- palette_set_color_rgb(machine,i,r,g,b);
+ palette_set_color_rgb(machine(),i,r,g,b);
color_prom++;
}
@@ -364,14 +360,14 @@ PALETTE_INIT( radarscp1 )
r = compute_res_net( 0, 0, &radarscp1_net_info );
g = compute_res_net( 0, 1, &radarscp1_net_info );
b = compute_res_net( 0, 2, &radarscp1_net_info );
- palette_set_color_rgb(machine,i,r,g,b);
+ palette_set_color_rgb(machine(),i,r,g,b);
}
/* Star color */
r = compute_res_net( 1, 0, &radarscp_stars_net_info );
g = compute_res_net( 0, 1, &radarscp_stars_net_info );
b = compute_res_net( 0, 2, &radarscp_stars_net_info );
- palette_set_color_rgb(machine,RADARSCP_STAR_COL,r,g,b);
+ palette_set_color_rgb(machine(),RADARSCP_STAR_COL,r,g,b);
/* Oscillating background */
for (i = 0;i < 256;i++)
@@ -380,7 +376,7 @@ PALETTE_INIT( radarscp1 )
g = compute_res_net( 0, 1, &radarscp_blue_net_info );
b = compute_res_net( i, 2, &radarscp_blue_net_info );
- palette_set_color_rgb(machine,RADARSCP_BCK_COL_OFFSET + i,r,g,b);
+ palette_set_color_rgb(machine(),RADARSCP_BCK_COL_OFFSET + i,r,g,b);
}
/* Grid */
@@ -390,13 +386,13 @@ PALETTE_INIT( radarscp1 )
g = compute_res_net( (i>>1) & 1, 1, &radarscp_grid_net_info );
b = compute_res_net( (i>>2) & 1, 2, &radarscp_grid_net_info );
- palette_set_color_rgb(machine,RADARSCP_GRID_COL_OFFSET + i,r,g,b);
+ palette_set_color_rgb(machine(),RADARSCP_GRID_COL_OFFSET + i,r,g,b);
}
- palette_normalize_range(machine.palette, 0, RADARSCP_GRID_COL_OFFSET+7, 0, 255);
+ palette_normalize_range(machine().palette, 0, RADARSCP_GRID_COL_OFFSET+7, 0, 255);
color_prom += 512;
/* color_prom now points to the beginning of the character color codes */
- state->m_color_codes = color_prom; /* we'll need it later */
+ m_color_codes = color_prom; /* we'll need it later */
}
@@ -436,20 +432,19 @@ PALETTE_INIT( radarscp1 )
***************************************************************************/
-PALETTE_INIT( dkong3 )
+PALETTE_INIT_MEMBER(dkong_state,dkong3)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- dkong_state *state = machine.driver_data<dkong_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t *rgb;
- rgb = compute_res_net_all(machine, color_prom, &dkong3_decode_info, &dkong3_net_info);
- palette_set_colors(machine, 0, rgb, 256);
- palette_normalize_range(machine.palette, 0, 255, 0, 255);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &dkong3_decode_info, &dkong3_net_info);
+ palette_set_colors(machine(), 0, rgb, 256);
+ palette_normalize_range(machine().palette, 0, 255, 0, 255);
+ auto_free(machine(), rgb);
color_prom += 1024;
/* color_prom now points to the beginning of the character color codes */
- state->m_color_codes = color_prom; /* we'll need it later */
+ m_color_codes = color_prom; /* we'll need it later */
}
TILE_GET_INFO_MEMBER(dkong_state::dkong_bg_tile_info)
@@ -891,66 +886,64 @@ static void check_palette(running_machine &machine)
switch (newset)
{
case 0x00:
- PALETTE_INIT_CALL(radarscp);
+ state->PALETTE_INIT_CALL_MEMBER(radarscp);
break;
case 0x01:
- PALETTE_INIT_CALL(dkong2b);
+ state->PALETTE_INIT_CALL_MEMBER(dkong2b);
break;
}
}
}
}
-static VIDEO_START( dkong_base )
+VIDEO_START_MEMBER(dkong_state,dkong_base)
{
- dkong_state *state = machine.driver_data<dkong_state>();
- state->m_cd4049_b = (log(0.0 - log(cd4049_al)) - log(0.0 - log((1.0-cd4049_al))) ) / log(cd4049_vh/cd4049_vl);
- state->m_cd4049_a = log(0.0 - log(cd4049_al)) - state->m_cd4049_b * log(cd4049_vh);
+ m_cd4049_b = (log(0.0 - log(cd4049_al)) - log(0.0 - log((1.0-cd4049_al))) ) / log(cd4049_vh/cd4049_vl);
+ m_cd4049_a = log(0.0 - log(cd4049_al)) - m_cd4049_b * log(cd4049_vh);
- state->m_gfx_bank = 0;
- state->m_palette_bank = 0;
- state->m_sprite_bank = 0;
- state->m_vidhw = -1;
+ m_gfx_bank = 0;
+ m_palette_bank = 0;
+ m_sprite_bank = 0;
+ m_vidhw = -1;
- state->save_item(NAME(state->m_gfx_bank));
- state->save_item(NAME(state->m_palette_bank));
- state->save_item(NAME(state->m_sprite_bank));
- state->save_item(NAME(state->m_grid_on));
+ save_item(NAME(m_gfx_bank));
+ save_item(NAME(m_palette_bank));
+ save_item(NAME(m_sprite_bank));
+ save_item(NAME(m_grid_on));
- state->save_item(NAME(state->m_grid_col));
- state->save_item(NAME(state->m_flip));
+ save_item(NAME(m_grid_col));
+ save_item(NAME(m_flip));
}
-VIDEO_START( dkong )
+VIDEO_START_MEMBER(dkong_state,dkong)
{
- dkong_state *state = machine.driver_data<dkong_state>();
- VIDEO_START_CALL(dkong_base);
+ VIDEO_START_CALL_MEMBER(dkong_base);
- state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
- state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
+ m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_callback));
+ m_scanline_timer->adjust(machine().primary_screen->time_until_pos(0));
- switch (state->m_hardware_type)
+ switch (m_hardware_type)
{
case HARDWARE_TRS02:
- machine.primary_screen->register_screen_bitmap(state->m_bg_bits);
- state->m_gfx3 = state->memregion("gfx3")->base();
- state->m_gfx3_len = state->memregion("gfx3")->bytes();
+ machine().primary_screen->register_screen_bitmap(m_bg_bits);
+ m_gfx3 = memregion("gfx3")->base();
+ m_gfx3_len = memregion("gfx3")->bytes();
/* fall through */
case HARDWARE_TKG04:
case HARDWARE_TKG02:
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dkong_state::dkong_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scrolldx(0, 128);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dkong_state::dkong_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scrolldx(0, 128);
break;
case HARDWARE_TRS01:
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dkong_state::radarscp1_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scrolldx(0, 128);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dkong_state::radarscp1_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scrolldx(0, 128);
- machine.primary_screen->register_screen_bitmap(state->m_bg_bits);
- state->m_gfx4 = state->memregion("gfx4")->base();
- state->m_gfx3 = state->memregion("gfx3")->base();
- state->m_gfx3_len = state->memregion("gfx3")->bytes();
+ machine().primary_screen->register_screen_bitmap(m_bg_bits);
+ m_gfx4 = memregion("gfx4")->base();
+ m_gfx3 = memregion("gfx3")->base();
+ m_gfx3_len = memregion("gfx3")->bytes();
break;
default:
diff --git a/src/mame/video/docastle.c b/src/mame/video/docastle.c
index fdbb9854fcf..fc19cfa2eaa 100644
--- a/src/mame/video/docastle.c
+++ b/src/mame/video/docastle.c
@@ -29,9 +29,9 @@
***************************************************************************/
-PALETTE_INIT( docastle )
+void docastle_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 256; i++)
@@ -57,8 +57,8 @@ PALETTE_INIT( docastle )
/* because the graphics are decoded as 4bpp with the top bit used for transparency
or priority, we create matching 3bpp sets of palette entries, which effectively
ignores the value of the top bit */
- palette_set_color(machine, ((i & 0xf8) << 1) | 0x00 | (i & 0x07), MAKE_RGB(r,g,b));
- palette_set_color(machine, ((i & 0xf8) << 1) | 0x08 | (i & 0x07), MAKE_RGB(r,g,b));
+ palette_set_color(machine(), ((i & 0xf8) << 1) | 0x00 | (i & 0x07), MAKE_RGB(r,g,b));
+ palette_set_color(machine(), ((i & 0xf8) << 1) | 0x08 | (i & 0x07), MAKE_RGB(r,g,b));
color_prom++;
}
}
@@ -116,14 +116,14 @@ static void video_start_common( running_machine &machine, UINT32 tile_transmask
state->m_do_tilemap->set_transmask(0, tile_transmask, 0x0000);
}
-VIDEO_START( docastle )
+void docastle_state::video_start()
{
- video_start_common(machine, 0x00ff);
+ video_start_common(machine(), 0x00ff);
}
-VIDEO_START( dorunrun )
+VIDEO_START_MEMBER(docastle_state,dorunrun)
{
- video_start_common(machine, 0xff00);
+ video_start_common(machine(), 0xff00);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/dogfgt.c b/src/mame/video/dogfgt.c
index ec85ca26a08..c208164e135 100644
--- a/src/mame/video/dogfgt.c
+++ b/src/mame/video/dogfgt.c
@@ -11,9 +11,9 @@
***************************************************************************/
-PALETTE_INIT( dogfgt )
+void dogfgt_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* first 16 colors are RAM */
@@ -37,7 +37,7 @@ PALETTE_INIT( dogfgt )
bit2 = (*color_prom >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i + 16, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i + 16, MAKE_RGB(r,g,b));
color_prom++;
}
}
@@ -65,16 +65,15 @@ TILE_GET_INFO_MEMBER(dogfgt_state::get_tile_info)
***************************************************************************/
-VIDEO_START( dogfgt )
+void dogfgt_state::video_start()
{
- dogfgt_state *state = machine.driver_data<dogfgt_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dogfgt_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dogfgt_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_bitmapram = auto_alloc_array(machine, UINT8, BITMAPRAM_SIZE);
- state->save_pointer(NAME(state->m_bitmapram), BITMAPRAM_SIZE);
+ m_bitmapram = auto_alloc_array(machine(), UINT8, BITMAPRAM_SIZE);
+ save_pointer(NAME(m_bitmapram), BITMAPRAM_SIZE);
- machine.primary_screen->register_screen_bitmap(state->m_pixbitmap);
- state->save_item(NAME(state->m_pixbitmap));
+ machine().primary_screen->register_screen_bitmap(m_pixbitmap);
+ save_item(NAME(m_pixbitmap));
}
diff --git a/src/mame/video/dooyong.c b/src/mame/video/dooyong.c
index 3257ee6d3b5..379ac6f975e 100644
--- a/src/mame/video/dooyong.c
+++ b/src/mame/video/dooyong.c
@@ -619,299 +619,291 @@ SCREEN_UPDATE_IND16( popbingo )
}
-VIDEO_START( lastday )
+VIDEO_START_MEMBER(dooyong_state,lastday)
{
- dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = state->memregion("gfx5")->base();
- state->m_fg_tilerom = state->memregion("gfx6")->base();
- state->m_bg_tilerom2 = NULL;
- state->m_fg_tilerom2 = NULL;
- state->m_bg_gfx = 2;
- state->m_fg_gfx = 3;
- state->m_tx_tilemap_mode = 0;
+ m_bg_tilerom = memregion("gfx5")->base();
+ m_fg_tilerom = memregion("gfx6")->base();
+ m_bg_tilerom2 = NULL;
+ m_fg_tilerom2 = NULL;
+ m_bg_gfx = 2;
+ m_fg_gfx = 3;
+ m_tx_tilemap_mode = 0;
/* Create tilemaps */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),state), TILEMAP_SCAN_COLS,
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
/* Text layer is offset on this machine */
- state->m_tx_tilemap->set_scrolly(0, 8);
+ m_tx_tilemap->set_scrolly(0, 8);
- memset(state->m_bgscroll8, 0, 0x10);
- memset(state->m_bg2scroll8, 0, 0x10);
- memset(state->m_fgscroll8, 0, 0x10);
- memset(state->m_fg2scroll8, 0, 0x10);
+ memset(m_bgscroll8, 0, 0x10);
+ memset(m_bg2scroll8, 0, 0x10);
+ memset(m_fgscroll8, 0, 0x10);
+ memset(m_fg2scroll8, 0, 0x10);
/* Register for save/restore */
- state_save_register_global_array(machine, state->m_bgscroll8);
- state_save_register_global_array(machine, state->m_fgscroll8);
- state_save_register_global(machine, state->m_sprites_disabled);
- state_save_register_global(machine, state->m_interrupt_line_1);
- state_save_register_global(machine, state->m_interrupt_line_2);
+ state_save_register_global_array(machine(), m_bgscroll8);
+ state_save_register_global_array(machine(), m_fgscroll8);
+ state_save_register_global(machine(), m_sprites_disabled);
+ state_save_register_global(machine(), m_interrupt_line_1);
+ state_save_register_global(machine(), m_interrupt_line_2);
}
-VIDEO_START( gulfstrm )
+VIDEO_START_MEMBER(dooyong_state,gulfstrm)
{
- dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = state->memregion("gfx5")->base();
- state->m_fg_tilerom = state->memregion("gfx6")->base();
- state->m_bg_tilerom2 = NULL;
- state->m_fg_tilerom2 = NULL;
- state->m_bg_gfx = 2;
- state->m_fg_gfx = 3;
- state->m_tx_tilemap_mode = 0;
+ m_bg_tilerom = memregion("gfx5")->base();
+ m_fg_tilerom = memregion("gfx6")->base();
+ m_bg_tilerom2 = NULL;
+ m_fg_tilerom2 = NULL;
+ m_bg_gfx = 2;
+ m_fg_gfx = 3;
+ m_tx_tilemap_mode = 0;
/* Create tilemaps */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),state), TILEMAP_SCAN_COLS,
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
/* Text layer is offset on this machine */
- state->m_tx_tilemap->set_scrolly(0, 8);
+ m_tx_tilemap->set_scrolly(0, 8);
- memset(state->m_bgscroll8, 0, 0x10);
- memset(state->m_bg2scroll8, 0, 0x10);
- memset(state->m_fgscroll8, 0, 0x10);
- memset(state->m_fg2scroll8, 0, 0x10);
+ memset(m_bgscroll8, 0, 0x10);
+ memset(m_bg2scroll8, 0, 0x10);
+ memset(m_fgscroll8, 0, 0x10);
+ memset(m_fg2scroll8, 0, 0x10);
/* Register for save/restore */
- state_save_register_global_array(machine, state->m_bgscroll8);
- state_save_register_global_array(machine, state->m_fgscroll8);
- state_save_register_global(machine, state->m_interrupt_line_1);
- state_save_register_global(machine, state->m_interrupt_line_2);
+ state_save_register_global_array(machine(), m_bgscroll8);
+ state_save_register_global_array(machine(), m_fgscroll8);
+ state_save_register_global(machine(), m_interrupt_line_1);
+ state_save_register_global(machine(), m_interrupt_line_2);
}
-VIDEO_START( pollux )
+VIDEO_START_MEMBER(dooyong_state,pollux)
{
- dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = state->memregion("gfx5")->base();
- state->m_fg_tilerom = state->memregion("gfx6")->base();
- state->m_bg_tilerom2 = NULL;
- state->m_fg_tilerom2 = NULL;
- state->m_bg_gfx = 2;
- state->m_fg_gfx = 3;
- state->m_tx_tilemap_mode = 0;
+ m_bg_tilerom = memregion("gfx5")->base();
+ m_fg_tilerom = memregion("gfx6")->base();
+ m_bg_tilerom2 = NULL;
+ m_fg_tilerom2 = NULL;
+ m_bg_gfx = 2;
+ m_fg_gfx = 3;
+ m_tx_tilemap_mode = 0;
/* Create tilemaps */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),state), TILEMAP_SCAN_COLS,
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
- memset(state->m_bgscroll8, 0, 0x10);
- memset(state->m_bg2scroll8, 0, 0x10);
- memset(state->m_fgscroll8, 0, 0x10);
- memset(state->m_fg2scroll8, 0, 0x10);
+ memset(m_bgscroll8, 0, 0x10);
+ memset(m_bg2scroll8, 0, 0x10);
+ memset(m_fgscroll8, 0, 0x10);
+ memset(m_fg2scroll8, 0, 0x10);
/* Register for save/restore */
- state_save_register_global_array(machine, state->m_bgscroll8);
- state_save_register_global_array(machine, state->m_fgscroll8);
- state_save_register_global(machine, state->m_interrupt_line_1);
- state_save_register_global(machine, state->m_interrupt_line_2);
+ state_save_register_global_array(machine(), m_bgscroll8);
+ state_save_register_global_array(machine(), m_fgscroll8);
+ state_save_register_global(machine(), m_interrupt_line_1);
+ state_save_register_global(machine(), m_interrupt_line_2);
}
-VIDEO_START( bluehawk )
+VIDEO_START_MEMBER(dooyong_state,bluehawk)
{
- dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = state->memregion("gfx3")->base() + 0x78000;
- state->m_fg_tilerom = state->memregion("gfx4")->base() + 0x78000;
- state->m_fg2_tilerom = state->memregion("gfx5")->base() + 0x38000;
- state->m_bg_tilerom2 = NULL;
- state->m_fg_tilerom2 = NULL;
- state->m_fg2_tilerom2 = NULL;
- state->m_bg_gfx = 2;
- state->m_fg_gfx = 3;
- state->m_fg2_gfx = 4;
- state->m_tx_tilemap_mode = 1;
+ m_bg_tilerom = memregion("gfx3")->base() + 0x78000;
+ m_fg_tilerom = memregion("gfx4")->base() + 0x78000;
+ m_fg2_tilerom = memregion("gfx5")->base() + 0x38000;
+ m_bg_tilerom2 = NULL;
+ m_fg_tilerom2 = NULL;
+ m_fg2_tilerom2 = NULL;
+ m_bg_gfx = 2;
+ m_fg_gfx = 3;
+ m_fg2_gfx = 4;
+ m_tx_tilemap_mode = 1;
/* Create tilemaps */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_fg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg2_tile_info),state), TILEMAP_SCAN_COLS,
+ m_fg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg2_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),state), TILEMAP_SCAN_COLS,
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_fg2_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_fg2_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
- memset(state->m_bgscroll8, 0, 0x10);
- memset(state->m_bg2scroll8, 0, 0x10);
- memset(state->m_fgscroll8, 0, 0x10);
- memset(state->m_fg2scroll8, 0, 0x10);
+ memset(m_bgscroll8, 0, 0x10);
+ memset(m_bg2scroll8, 0, 0x10);
+ memset(m_fgscroll8, 0, 0x10);
+ memset(m_fg2scroll8, 0, 0x10);
/* Register for save/restore */
- state_save_register_global_array(machine, state->m_bgscroll8);
- state_save_register_global_array(machine, state->m_fgscroll8);
- state_save_register_global_array(machine, state->m_fg2scroll8);
+ state_save_register_global_array(machine(), m_bgscroll8);
+ state_save_register_global_array(machine(), m_fgscroll8);
+ state_save_register_global_array(machine(), m_fg2scroll8);
}
-VIDEO_START( flytiger )
+VIDEO_START_MEMBER(dooyong_state,flytiger)
{
- dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = state->memregion("gfx3")->base() + 0x78000;
- state->m_fg_tilerom = state->memregion("gfx4")->base() + 0x78000;
- state->m_bg_tilerom2 = NULL;
- state->m_fg_tilerom2 = NULL;
- state->m_bg_gfx = 2;
- state->m_fg_gfx = 3;
- state->m_tx_tilemap_mode = 0;
+ m_bg_tilerom = memregion("gfx3")->base() + 0x78000;
+ m_fg_tilerom = memregion("gfx4")->base() + 0x78000;
+ m_bg_tilerom2 = NULL;
+ m_fg_tilerom2 = NULL;
+ m_bg_gfx = 2;
+ m_fg_gfx = 3;
+ m_tx_tilemap_mode = 0;
/* Create tilemaps */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::flytiger_get_fg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::flytiger_get_fg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),state), TILEMAP_SCAN_COLS,
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
- state->m_bg_tilemap->set_transparent_pen(15);
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_bg_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
- memset(state->m_bgscroll8, 0, 0x10);
- memset(state->m_bg2scroll8, 0, 0x10);
- memset(state->m_fgscroll8, 0, 0x10);
- memset(state->m_fg2scroll8, 0, 0x10);
+ memset(m_bgscroll8, 0, 0x10);
+ memset(m_bg2scroll8, 0, 0x10);
+ memset(m_fgscroll8, 0, 0x10);
+ memset(m_fg2scroll8, 0, 0x10);
/* Register for save/restore */
- state_save_register_global_array(machine, state->m_bgscroll8);
- state_save_register_global_array(machine, state->m_fgscroll8);
- state_save_register_global(machine, state->m_flytiger_pri);
+ state_save_register_global_array(machine(), m_bgscroll8);
+ state_save_register_global_array(machine(), m_fgscroll8);
+ state_save_register_global(machine(), m_flytiger_pri);
}
-VIDEO_START( primella )
+VIDEO_START_MEMBER(dooyong_state,primella)
{
- dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = state->memregion("gfx2")->base() + state->memregion("gfx2")->bytes() - 0x8000;
- state->m_fg_tilerom = state->memregion("gfx3")->base() + state->memregion("gfx3")->bytes() - 0x8000;
- state->m_bg_tilerom2 = NULL;
- state->m_fg_tilerom2 = NULL;
- state->m_bg_gfx = 1;
- state->m_fg_gfx = 2;
- state->m_tx_tilemap_mode = 1;
+ m_bg_tilerom = memregion("gfx2")->base() + memregion("gfx2")->bytes() - 0x8000;
+ m_fg_tilerom = memregion("gfx3")->base() + memregion("gfx3")->bytes() - 0x8000;
+ m_bg_tilerom2 = NULL;
+ m_fg_tilerom2 = NULL;
+ m_bg_gfx = 1;
+ m_fg_gfx = 2;
+ m_tx_tilemap_mode = 1;
/* Create tilemaps */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),state), TILEMAP_SCAN_COLS,
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
- memset(state->m_bgscroll8, 0, 0x10);
- memset(state->m_bg2scroll8, 0, 0x10);
- memset(state->m_fgscroll8, 0, 0x10);
- memset(state->m_fg2scroll8, 0, 0x10);
+ memset(m_bgscroll8, 0, 0x10);
+ memset(m_bg2scroll8, 0, 0x10);
+ memset(m_fgscroll8, 0, 0x10);
+ memset(m_fg2scroll8, 0, 0x10);
/* Register for save/restore */
- state_save_register_global_array(machine, state->m_bgscroll8);
- state_save_register_global_array(machine, state->m_fgscroll8);
- state_save_register_global(machine, state->m_tx_pri);
+ state_save_register_global_array(machine(), m_bgscroll8);
+ state_save_register_global_array(machine(), m_fgscroll8);
+ state_save_register_global(machine(), m_tx_pri);
}
-VIDEO_START( rshark )
+VIDEO_START_MEMBER(dooyong_state,rshark)
{
- dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = state->memregion("gfx5")->base();
- state->m_bg2_tilerom = state->memregion("gfx4")->base();
- state->m_fg_tilerom = state->memregion("gfx3")->base();
- state->m_fg2_tilerom = state->memregion("gfx2")->base();
- state->m_bg_tilerom2 = state->memregion("gfx6")->base() + 0x60000;
- state->m_bg2_tilerom2 = state->memregion("gfx6")->base() + 0x40000;
- state->m_fg_tilerom2 = state->memregion("gfx6")->base() + 0x20000;
- state->m_fg2_tilerom2 = state->memregion("gfx6")->base() + 0x00000;
- state->m_bg_gfx = 4;
- state->m_bg2_gfx = 3;
- state->m_fg_gfx = 2;
- state->m_fg2_gfx = 1;
+ m_bg_tilerom = memregion("gfx5")->base();
+ m_bg2_tilerom = memregion("gfx4")->base();
+ m_fg_tilerom = memregion("gfx3")->base();
+ m_fg2_tilerom = memregion("gfx2")->base();
+ m_bg_tilerom2 = memregion("gfx6")->base() + 0x60000;
+ m_bg2_tilerom2 = memregion("gfx6")->base() + 0x40000;
+ m_fg_tilerom2 = memregion("gfx6")->base() + 0x20000;
+ m_fg2_tilerom2 = memregion("gfx6")->base() + 0x00000;
+ m_bg_gfx = 4;
+ m_bg2_gfx = 3;
+ m_fg_gfx = 2;
+ m_fg2_gfx = 1;
/* Create tilemaps */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
16, 16, 64, 32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg2_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg2_tile_info),this), TILEMAP_SCAN_COLS,
16, 16, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
16, 16, 64, 32);
- state->m_fg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg2_tile_info),state), TILEMAP_SCAN_COLS,
+ m_fg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_fg2_tile_info),this), TILEMAP_SCAN_COLS,
16, 16, 64, 32);
/* Configure tilemap transparency */
- state->m_bg2_tilemap->set_transparent_pen(15);
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_fg2_tilemap->set_transparent_pen(15);
+ m_bg2_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_fg2_tilemap->set_transparent_pen(15);
- memset(state->m_bgscroll8, 0, 0x10);
- memset(state->m_bg2scroll8, 0, 0x10);
- memset(state->m_fgscroll8, 0, 0x10);
- memset(state->m_fg2scroll8, 0, 0x10);
+ memset(m_bgscroll8, 0, 0x10);
+ memset(m_bg2scroll8, 0, 0x10);
+ memset(m_fgscroll8, 0, 0x10);
+ memset(m_fg2scroll8, 0, 0x10);
/* Register for save/restore */
- state_save_register_global_array(machine, state->m_bgscroll8);
- state_save_register_global_array(machine, state->m_bg2scroll8);
- state_save_register_global_array(machine, state->m_fgscroll8);
- state_save_register_global_array(machine, state->m_fg2scroll8);
- state_save_register_global(machine, state->m_rshark_pri);
+ state_save_register_global_array(machine(), m_bgscroll8);
+ state_save_register_global_array(machine(), m_bg2scroll8);
+ state_save_register_global_array(machine(), m_fgscroll8);
+ state_save_register_global_array(machine(), m_fg2scroll8);
+ state_save_register_global(machine(), m_rshark_pri);
}
-VIDEO_START( popbingo )
+VIDEO_START_MEMBER(dooyong_state,popbingo)
{
- dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = state->memregion("gfx2")->base();
- state->m_bg_gfx = 1;
+ m_bg_tilerom = memregion("gfx2")->base();
+ m_bg_gfx = 1;
/* Create tilemaps */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
32, 32, 32, 8);
- state->m_bg2_tilemap = state->m_fg_tilemap = state->m_fg2_tilemap = NULL; /* Stop scroll handler from crashing on these */
+ m_bg2_tilemap = m_fg_tilemap = m_fg2_tilemap = NULL; /* Stop scroll handler from crashing on these */
- memset(state->m_bgscroll8, 0, 0x10);
- memset(state->m_bg2scroll8, 0, 0x10);
- memset(state->m_fgscroll8, 0, 0x10);
- memset(state->m_fg2scroll8, 0, 0x10);
+ memset(m_bgscroll8, 0, 0x10);
+ memset(m_bg2scroll8, 0, 0x10);
+ memset(m_fgscroll8, 0, 0x10);
+ memset(m_fg2scroll8, 0, 0x10);
/* Register for save/restore */
- state_save_register_global_array(machine, state->m_bgscroll8);
- state_save_register_global_array(machine, state->m_bg2scroll8); // Not used atm
- state_save_register_global_array(machine, state->m_fgscroll8); // Not used atm
- state_save_register_global_array(machine, state->m_fg2scroll8); // Not used atm
- state_save_register_global(machine, state->m_rshark_pri);
+ state_save_register_global_array(machine(), m_bgscroll8);
+ state_save_register_global_array(machine(), m_bg2scroll8); // Not used atm
+ state_save_register_global_array(machine(), m_fgscroll8); // Not used atm
+ state_save_register_global_array(machine(), m_fg2scroll8); // Not used atm
+ state_save_register_global(machine(), m_rshark_pri);
}
diff --git a/src/mame/video/dragrace.c b/src/mame/video/dragrace.c
index db99f595974..4fff2a82c4e 100644
--- a/src/mame/video/dragrace.c
+++ b/src/mame/video/dragrace.c
@@ -39,10 +39,9 @@ TILE_GET_INFO_MEMBER(dragrace_state::get_tile_info)
}
-VIDEO_START( dragrace )
+void dragrace_state::video_start()
{
- dragrace_state *state = machine.driver_data<dragrace_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dragrace_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dragrace_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
}
diff --git a/src/mame/video/drgnmst.c b/src/mame/video/drgnmst.c
index 4e57e62cbe8..75dd7b04033 100644
--- a/src/mame/video/drgnmst.c
+++ b/src/mame/video/drgnmst.c
@@ -117,20 +117,19 @@ TILEMAP_MAPPER_MEMBER(drgnmst_state::drgnmst_bg_tilemap_scan_cols)
return (col * 8) + (row & 0x07) + ((row & 0xf8) >> 3) * 512;
}
-VIDEO_START(drgnmst)
+void drgnmst_state::video_start()
{
- drgnmst_state *state = machine.driver_data<drgnmst_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(drgnmst_state::get_drgnmst_fg_tile_info),state), tilemap_mapper_delegate(FUNC(drgnmst_state::drgnmst_fg_tilemap_scan_cols),state), 8, 8, 64,64);
- state->m_fg_tilemap->set_transparent_pen(15);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(drgnmst_state::get_drgnmst_fg_tile_info),this), tilemap_mapper_delegate(FUNC(drgnmst_state::drgnmst_fg_tilemap_scan_cols),this), 8, 8, 64,64);
+ m_fg_tilemap->set_transparent_pen(15);
- state->m_md_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(drgnmst_state::get_drgnmst_md_tile_info),state), tilemap_mapper_delegate(FUNC(drgnmst_state::drgnmst_md_tilemap_scan_cols),state), 16, 16, 64,64);
- state->m_md_tilemap->set_transparent_pen(15);
+ m_md_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(drgnmst_state::get_drgnmst_md_tile_info),this), tilemap_mapper_delegate(FUNC(drgnmst_state::drgnmst_md_tilemap_scan_cols),this), 16, 16, 64,64);
+ m_md_tilemap->set_transparent_pen(15);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(drgnmst_state::get_drgnmst_bg_tile_info),state), tilemap_mapper_delegate(FUNC(drgnmst_state::drgnmst_bg_tilemap_scan_cols),state), 32, 32, 64,64);
- state->m_bg_tilemap->set_transparent_pen(15);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(drgnmst_state::get_drgnmst_bg_tile_info),this), tilemap_mapper_delegate(FUNC(drgnmst_state::drgnmst_bg_tilemap_scan_cols),this), 32, 32, 64,64);
+ m_bg_tilemap->set_transparent_pen(15);
// do the other tilemaps have rowscroll too? probably not ..
- state->m_md_tilemap->set_scroll_rows(1024);
+ m_md_tilemap->set_scroll_rows(1024);
}
SCREEN_UPDATE_IND16(drgnmst)
diff --git a/src/mame/video/dribling.c b/src/mame/video/dribling.c
index 20342ec70e2..636bd8687db 100644
--- a/src/mame/video/dribling.c
+++ b/src/mame/video/dribling.c
@@ -15,9 +15,9 @@
*
*************************************/
-PALETTE_INIT( dribling )
+void dribling_state::palette_init()
{
- const UINT8 *prom = machine.root_device().memregion("proms")->base() + 0x400;
+ const UINT8 *prom = machine().root_device().memregion("proms")->base() + 0x400;
int i;
for (i = 0; i < 256; i++)
@@ -30,7 +30,7 @@ PALETTE_INIT( dribling )
g *= 0x55;
b *= 0xff;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
}
diff --git a/src/mame/video/drmicro.c b/src/mame/video/drmicro.c
index 9b9f832d965..822defe4b9b 100644
--- a/src/mame/video/drmicro.c
+++ b/src/mame/video/drmicro.c
@@ -56,13 +56,13 @@ TILE_GET_INFO_MEMBER(drmicro_state::get_bg2_tile_info)
/****************************************************************************/
-PALETTE_INIT( drmicro )
+void drmicro_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -88,7 +88,7 @@ PALETTE_INIT( drmicro )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -97,21 +97,20 @@ PALETTE_INIT( drmicro )
for (i = 0; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
-VIDEO_START( drmicro)
+void drmicro_state::video_start()
{
- drmicro_state *state = machine.driver_data<drmicro_state>();
- state->m_videoram = auto_alloc_array(machine, UINT8, 0x1000);
- state->save_pointer(NAME(state->m_videoram), 0x1000);
+ m_videoram = auto_alloc_array(machine(), UINT8, 0x1000);
+ save_pointer(NAME(m_videoram), 0x1000);
- state->m_bg1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(drmicro_state::get_bg1_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(drmicro_state::get_bg2_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(drmicro_state::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(drmicro_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg2->set_transparent_pen(0);
+ m_bg2->set_transparent_pen(0);
}
SCREEN_UPDATE_IND16( drmicro )
diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c
index ada6d6b9388..2e280116708 100644
--- a/src/mame/video/dynax.c
+++ b/src/mame/video/dynax.c
@@ -26,19 +26,19 @@
/* 0 B01234 G01234 R01234 */
-PALETTE_INIT( sprtmtch )
+PALETTE_INIT_MEMBER(dynax_state,sprtmtch)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int x = (color_prom[i] << 8) + color_prom[0x200 + i];
/* The bits are in reverse order! */
int r = BITSWAP8((x >> 0) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
int g = BITSWAP8((x >> 5) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
int b = BITSWAP8((x >> 10) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
- palette_set_color_rgb(machine, i, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(machine(), i, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
@@ -800,166 +800,158 @@ static void dynax_common_reset( running_machine &machine )
state->save_item(NAME(state->m_hanamai_priority));
}
-VIDEO_START( hanamai )
+VIDEO_START_MEMBER(dynax_state,hanamai)
{
- dynax_state *state = machine.driver_data<dynax_state>();
- state->m_pixmap[0][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[0][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[1][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[1][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[2][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[2][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[3][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[3][1] = auto_alloc_array(machine, UINT8, 256 * 256);
-
- dynax_common_reset(machine);
- state->m_layer_layout = LAYOUT_HANAMAI;
-
- state->save_pointer(NAME(state->m_pixmap[0][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[0][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[1][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[1][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[2][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[2][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[3][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[3][1]), 256 * 256);
+ m_pixmap[0][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[0][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[1][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[1][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[2][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[2][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[3][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[3][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+
+ dynax_common_reset(machine());
+ m_layer_layout = LAYOUT_HANAMAI;
+
+ save_pointer(NAME(m_pixmap[0][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][1]), 256 * 256);
}
-VIDEO_START( hnoridur )
+VIDEO_START_MEMBER(dynax_state,hnoridur)
{
- dynax_state *state = machine.driver_data<dynax_state>();
- state->m_pixmap[0][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[0][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[1][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[1][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[2][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[2][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[3][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[3][1] = auto_alloc_array(machine, UINT8, 256 * 256);
-
- dynax_common_reset(machine);
- state->m_layer_layout = LAYOUT_HNORIDUR;
-
- state->m_priority_table = priority_hnoridur;
-
- state->save_pointer(NAME(state->m_pixmap[0][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[0][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[1][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[1][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[2][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[2][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[3][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[3][1]), 256 * 256);
+ m_pixmap[0][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[0][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[1][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[1][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[2][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[2][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[3][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[3][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+
+ dynax_common_reset(machine());
+ m_layer_layout = LAYOUT_HNORIDUR;
+
+ m_priority_table = priority_hnoridur;
+
+ save_pointer(NAME(m_pixmap[0][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][1]), 256 * 256);
}
-VIDEO_START( mcnpshnt )
+VIDEO_START_MEMBER(dynax_state,mcnpshnt)
{
- dynax_state *state = machine.driver_data<dynax_state>();
- VIDEO_START_CALL(hnoridur);
- state->m_priority_table = priority_mcnpshnt;
+ VIDEO_START_CALL_MEMBER(hnoridur);
+ m_priority_table = priority_mcnpshnt;
}
-VIDEO_START( sprtmtch )
+VIDEO_START_MEMBER(dynax_state,sprtmtch)
{
- dynax_state *state = machine.driver_data<dynax_state>();
- state->m_pixmap[0][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[0][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[1][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[1][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[2][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[2][1] = auto_alloc_array(machine, UINT8, 256 * 256);
-
- dynax_common_reset(machine);
- state->m_layer_layout = LAYOUT_DRGPUNCH;
-
- state->save_pointer(NAME(state->m_pixmap[0][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[0][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[1][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[1][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[2][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[2][1]), 256 * 256);
+ m_pixmap[0][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[0][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[1][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[1][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[2][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[2][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+
+ dynax_common_reset(machine());
+ m_layer_layout = LAYOUT_DRGPUNCH;
+
+ save_pointer(NAME(m_pixmap[0][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][1]), 256 * 256);
}
-VIDEO_START( jantouki )
+VIDEO_START_MEMBER(dynax_state,jantouki)
{
- dynax_state *state = machine.driver_data<dynax_state>();
- state->m_pixmap[0][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[0][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[1][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[1][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[2][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[2][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[3][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[3][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[4][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[4][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[5][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[5][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[6][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[6][1] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[7][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[7][1] = auto_alloc_array(machine, UINT8, 256 * 256);
-
- dynax_common_reset(machine);
- state->m_layer_layout = LAYOUT_JANTOUKI;
- state->m_update_irq_func = jantouki_update_irq;
-
- state->save_pointer(NAME(state->m_pixmap[0][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[0][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[1][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[1][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[2][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[2][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[3][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[3][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[4][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[4][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[5][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[5][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[6][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[6][1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[7][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[7][1]), 256 * 256);
+ m_pixmap[0][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[0][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[1][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[1][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[2][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[2][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[3][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[3][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[4][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[4][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[5][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[5][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[6][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[6][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[7][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[7][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+
+ dynax_common_reset(machine());
+ m_layer_layout = LAYOUT_JANTOUKI;
+ m_update_irq_func = jantouki_update_irq;
+
+ save_pointer(NAME(m_pixmap[0][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[4][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[4][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[5][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[5][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[6][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[6][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[7][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[7][1]), 256 * 256);
}
-VIDEO_START( mjdialq2 )
+VIDEO_START_MEMBER(dynax_state,mjdialq2)
{
- dynax_state *state = machine.driver_data<dynax_state>();
- state->m_pixmap[0][0] = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_pixmap[1][0] = auto_alloc_array(machine, UINT8, 256 * 256);
+ m_pixmap[0][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[1][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- dynax_common_reset(machine);
- state->m_layer_layout = LAYOUT_MJDIALQ2;
- state->m_update_irq_func = 0;
+ dynax_common_reset(machine());
+ m_layer_layout = LAYOUT_MJDIALQ2;
+ m_update_irq_func = 0;
- state->save_pointer(NAME(state->m_pixmap[0][0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[1][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][0]), 256 * 256);
}
-VIDEO_START( mjelctrn )
+VIDEO_START_MEMBER(dynax_state,mjelctrn)
{
- dynax_state *state = machine.driver_data<dynax_state>();
- VIDEO_START_CALL(hnoridur);
+ VIDEO_START_CALL_MEMBER(hnoridur);
- state->m_priority_table = priority_mjelctrn;
- state->m_update_irq_func = mjelctrn_update_irq;
+ m_priority_table = priority_mjelctrn;
+ m_update_irq_func = mjelctrn_update_irq;
}
-VIDEO_START( neruton )
+VIDEO_START_MEMBER(dynax_state,neruton)
{
- dynax_state *state = machine.driver_data<dynax_state>();
- VIDEO_START_CALL(hnoridur);
+ VIDEO_START_CALL_MEMBER(hnoridur);
-// state->m_priority_table = priority_mjelctrn;
- state->m_update_irq_func = neruton_update_irq;
+// m_priority_table = priority_mjelctrn;
+ m_update_irq_func = neruton_update_irq;
}
/***************************************************************************
@@ -1396,10 +1388,10 @@ SCREEN_UPDATE_IND16( mjdialq2 )
// htengoku uses the mixer chip from ddenlovr
-VIDEO_START(htengoku)
+VIDEO_START_MEMBER(dynax_state,htengoku)
{
- VIDEO_START_CALL(ddenlovr);
- VIDEO_START_CALL(hnoridur);
+ VIDEO_START_CALL_MEMBER(ddenlovr);
+ VIDEO_START_CALL_MEMBER(hnoridur);
}
SCREEN_UPDATE_IND16(htengoku)
diff --git a/src/mame/video/dynduke.c b/src/mame/video/dynduke.c
index d64497cbe61..cfc0c43adf2 100644
--- a/src/mame/video/dynduke.c
+++ b/src/mame/video/dynduke.c
@@ -76,15 +76,14 @@ TILE_GET_INFO_MEMBER(dynduke_state::get_tx_tile_info)
0);
}
-VIDEO_START( dynduke )
+void dynduke_state::video_start()
{
- dynduke_state *state = machine.driver_data<dynduke_state>();
- state->m_bg_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dynduke_state::get_bg_tile_info),state),TILEMAP_SCAN_COLS, 16,16,32,32);
- state->m_fg_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dynduke_state::get_fg_tile_info),state),TILEMAP_SCAN_COLS,16,16,32,32);
- state->m_tx_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(dynduke_state::get_tx_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,32,32);
+ m_bg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dynduke_state::get_bg_tile_info),this),TILEMAP_SCAN_COLS, 16,16,32,32);
+ m_fg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dynduke_state::get_fg_tile_info),this),TILEMAP_SCAN_COLS,16,16,32,32);
+ m_tx_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(dynduke_state::get_tx_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
- state->m_fg_layer->set_transparent_pen(15);
- state->m_tx_layer->set_transparent_pen(15);
+ m_fg_layer->set_transparent_pen(15);
+ m_tx_layer->set_transparent_pen(15);
}
WRITE16_MEMBER(dynduke_state::dynduke_gfxbank_w)
diff --git a/src/mame/video/eolith.c b/src/mame/video/eolith.c
index 66bfc0cae5e..d8fd24fdf66 100644
--- a/src/mame/video/eolith.c
+++ b/src/mame/video/eolith.c
@@ -30,10 +30,9 @@ READ32_MEMBER(eolith_state::eolith_vram_r)
return m_vram[offset+(0x40000/4)*m_buffer];
}
-VIDEO_START( eolith )
+VIDEO_START_MEMBER(eolith_state,eolith)
{
- eolith_state *state = machine.driver_data<eolith_state>();
- state->m_vram = auto_alloc_array(machine, UINT32, 0x40000*2/4);
+ m_vram = auto_alloc_array(machine(), UINT32, 0x40000*2/4);
}
SCREEN_UPDATE_IND16( eolith )
diff --git a/src/mame/video/eprom.c b/src/mame/video/eprom.c
index ce4eb69aa70..b9899fe2b88 100644
--- a/src/mame/video/eprom.c
+++ b/src/mame/video/eprom.c
@@ -88,7 +88,7 @@ TILE_GET_INFO_MEMBER(eprom_state::guts_get_playfield_tile_info)
*
*************************************/
-VIDEO_START( eprom )
+VIDEO_START_MEMBER(eprom_state,eprom)
{
static const atarimo_desc modesc =
{
@@ -126,25 +126,24 @@ VIDEO_START( eprom )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- eprom_state *state = machine.driver_data<eprom_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(eprom_state::get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(eprom_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(eprom_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(eprom_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
/* save states */
- state->save_item(NAME(state->m_screen_intensity));
- state->save_item(NAME(state->m_video_disable));
+ save_item(NAME(m_screen_intensity));
+ save_item(NAME(m_video_disable));
}
-VIDEO_START( guts )
+VIDEO_START_MEMBER(eprom_state,guts)
{
static const atarimo_desc modesc =
{
@@ -182,21 +181,20 @@ VIDEO_START( guts )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- eprom_state *state = machine.driver_data<eprom_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(eprom_state::guts_get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(eprom_state::guts_get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(eprom_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(eprom_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
/* save states */
- state->save_item(NAME(state->m_screen_intensity));
- state->save_item(NAME(state->m_video_disable));
+ save_item(NAME(m_screen_intensity));
+ save_item(NAME(m_video_disable));
}
diff --git a/src/mame/video/equites.c b/src/mame/video/equites.c
index 91cecf61562..f1285446dc2 100644
--- a/src/mame/video/equites.c
+++ b/src/mame/video/equites.c
@@ -8,50 +8,50 @@
*
*************************************/
-PALETTE_INIT( equites )
+PALETTE_INIT_MEMBER(equites_state,equites)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- machine.colortable = colortable_alloc(machine, 256);
+ machine().colortable = colortable_alloc(machine(), 256);
for (i = 0; i < 256; i++)
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i + 0x100]), pal4bit(color_prom[i + 0x200])));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i + 0x100]), pal4bit(color_prom[i + 0x200])));
// point to the CLUT
color_prom += 0x380;
for (i = 0; i < 256; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine.colortable, i + 0x100, color_prom[i]);
+ colortable_entry_set_value(machine().colortable, i + 0x100, color_prom[i]);
}
-PALETTE_INIT( splndrbt )
+PALETTE_INIT_MEMBER(equites_state,splndrbt)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- machine.colortable = colortable_alloc(machine, 256);
+ machine().colortable = colortable_alloc(machine(), 256);
for (i = 0; i < 0x100; i++)
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i + 0x100]), pal4bit(color_prom[i + 0x200])));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i + 0x100]), pal4bit(color_prom[i + 0x200])));
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
// point to the bg CLUT
color_prom += 0x300;
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine.colortable, i + 0x100, color_prom[i] + 0x10);
+ colortable_entry_set_value(machine().colortable, i + 0x100, color_prom[i] + 0x10);
// point to the sprite CLUT
color_prom += 0x100;
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine.colortable, i + 0x180, color_prom[i]);
+ colortable_entry_set_value(machine().colortable, i + 0x180, color_prom[i]);
}
@@ -111,34 +111,32 @@ TILE_GET_INFO_MEMBER(equites_state::splndrbt_bg_info)
*
*************************************/
-VIDEO_START( equites )
+VIDEO_START_MEMBER(equites_state,equites)
{
- equites_state *state = machine.driver_data<equites_state>();
- state->m_fg_videoram = auto_alloc_array(machine, UINT8, 0x800);
- state->save_pointer(NAME(state->m_fg_videoram), 0x800);
+ m_fg_videoram = auto_alloc_array(machine(), UINT8, 0x800);
+ save_pointer(NAME(m_fg_videoram), 0x800);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(equites_state::equites_fg_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(equites_state::equites_fg_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(equites_state::equites_bg_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(0, -10);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(equites_state::equites_bg_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scrolldx(0, -10);
}
-VIDEO_START( splndrbt )
+VIDEO_START_MEMBER(equites_state,splndrbt)
{
- equites_state *state = machine.driver_data<equites_state>();
- assert(machine.primary_screen->format() == BITMAP_FORMAT_IND16);
+ assert(machine().primary_screen->format() == BITMAP_FORMAT_IND16);
- state->m_fg_videoram = auto_alloc_array(machine, UINT8, 0x800);
- state->save_pointer(NAME(state->m_fg_videoram), 0x800);
+ m_fg_videoram = auto_alloc_array(machine(), UINT8, 0x800);
+ save_pointer(NAME(m_fg_videoram), 0x800);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(equites_state::splndrbt_fg_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scrolldx(8, -8);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(equites_state::splndrbt_fg_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_scrolldx(8, -8);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(equites_state::splndrbt_bg_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- colortable_configure_tilemap_groups(machine.colortable, state->m_bg_tilemap, machine.gfx[1], 0x10);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(equites_state::splndrbt_bg_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ colortable_configure_tilemap_groups(machine().colortable, m_bg_tilemap, machine().gfx[1], 0x10);
}
diff --git a/src/mame/video/esd16.c b/src/mame/video/esd16.c
index 4e543a0f208..7e343381bfb 100644
--- a/src/mame/video/esd16.c
+++ b/src/mame/video/esd16.c
@@ -133,26 +133,25 @@ WRITE16_MEMBER(esd16_state::esd16_tilemap0_color_jumppop_w)
***************************************************************************/
-VIDEO_START( esd16 )
+void esd16_state::video_start()
{
- esd16_state *state = machine.driver_data<esd16_state>();
- state->m_tilemap_0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(esd16_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40);
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(esd16_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40);
+ m_tilemap_0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(esd16_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40);
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(esd16_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40);
/* swatpolc changes tilemap 0 to 16x16 at various times */
- state->m_tilemap_0_16x16 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(esd16_state::get_tile_info_0_16x16),state), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40);
+ m_tilemap_0_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(esd16_state::get_tile_info_0_16x16),this), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40);
/* hedpanic changes tilemap 1 to 16x16 at various times */
- state->m_tilemap_1_16x16 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(esd16_state::get_tile_info_1_16x16),state), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40);
+ m_tilemap_1_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(esd16_state::get_tile_info_1_16x16),this), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40);
- state->m_tilemap_0->set_scrolldx(-0x60 + 2, -0x60);
- state->m_tilemap_1->set_scrolldx(-0x60, -0x60 + 2);
- state->m_tilemap_0_16x16->set_scrolldx(-0x60 + 2, -0x60);
- state->m_tilemap_1_16x16->set_scrolldx(-0x60, -0x60 + 2);
+ m_tilemap_0->set_scrolldx(-0x60 + 2, -0x60);
+ m_tilemap_1->set_scrolldx(-0x60, -0x60 + 2);
+ m_tilemap_0_16x16->set_scrolldx(-0x60 + 2, -0x60);
+ m_tilemap_1_16x16->set_scrolldx(-0x60, -0x60 + 2);
- state->m_tilemap_1->set_transparent_pen(0x00);
- state->m_tilemap_1_16x16->set_transparent_pen(0x00);
+ m_tilemap_1->set_transparent_pen(0x00);
+ m_tilemap_1_16x16->set_transparent_pen(0x00);
}
diff --git a/src/mame/video/espial.c b/src/mame/video/espial.c
index 757dd0d70c3..4906e6ab9cf 100644
--- a/src/mame/video/espial.c
+++ b/src/mame/video/espial.c
@@ -29,12 +29,12 @@
***************************************************************************/
-PALETTE_INIT( espial )
+void espial_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -45,16 +45,16 @@ PALETTE_INIT( espial )
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
/* green component */
bit0 = (color_prom[i] >> 3) & 0x01;
- bit1 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
- bit2 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
+ bit1 = (color_prom[i + machine().total_colors()] >> 0) & 0x01;
+ bit2 = (color_prom[i + machine().total_colors()] >> 1) & 0x01;
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
/* blue component */
bit0 = 0;
- bit1 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
- bit2 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
+ bit1 = (color_prom[i + machine().total_colors()] >> 2) & 0x01;
+ bit2 = (color_prom[i + machine().total_colors()] >> 3) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
}
@@ -85,27 +85,25 @@ TILE_GET_INFO_MEMBER(espial_state::get_tile_info)
*
*************************************/
-VIDEO_START( espial )
+void espial_state::video_start()
{
- espial_state *state = machine.driver_data<espial_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(espial_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(espial_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scroll_cols(32);
- state->save_item(NAME(state->m_flipscreen));
+ save_item(NAME(m_flipscreen));
}
-VIDEO_START( netwars )
+VIDEO_START_MEMBER(espial_state,netwars)
{
- espial_state *state = machine.driver_data<espial_state>();
/* Net Wars has a tile map that's twice as big as Espial's */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(espial_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(espial_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 64);
- state->m_bg_tilemap->set_scroll_cols(32);
- state->m_bg_tilemap->set_scrolldy(0, 0x100);
+ m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_scrolldy(0, 0x100);
- state->save_item(NAME(state->m_flipscreen));
+ save_item(NAME(m_flipscreen));
}
diff --git a/src/mame/video/esripsys.c b/src/mame/video/esripsys.c
index 924f7550ed5..682f964d300 100644
--- a/src/mame/video/esripsys.c
+++ b/src/mame/video/esripsys.c
@@ -57,28 +57,27 @@ static TIMER_CALLBACK( hblank_end_callback )
state->m_hblank = 1;
}
-VIDEO_START( esripsys )
+void esripsys_state::video_start()
{
- esripsys_state *state = machine.driver_data<esripsys_state>();
- struct line_buffer_t *line_buffer = state->m_line_buffer;
+ struct line_buffer_t *line_buffer = m_line_buffer;
int i;
/* Allocate memory for the two 512-pixel line buffers */
- line_buffer[0].colour_buf = auto_alloc_array(machine, UINT8, 512);
- line_buffer[0].intensity_buf = auto_alloc_array(machine, UINT8, 512);
- line_buffer[0].priority_buf = auto_alloc_array(machine, UINT8, 512);
+ line_buffer[0].colour_buf = auto_alloc_array(machine(), UINT8, 512);
+ line_buffer[0].intensity_buf = auto_alloc_array(machine(), UINT8, 512);
+ line_buffer[0].priority_buf = auto_alloc_array(machine(), UINT8, 512);
- line_buffer[1].colour_buf = auto_alloc_array(machine, UINT8, 512);
- line_buffer[1].intensity_buf = auto_alloc_array(machine, UINT8, 512);
- line_buffer[1].priority_buf = auto_alloc_array(machine, UINT8, 512);
+ line_buffer[1].colour_buf = auto_alloc_array(machine(), UINT8, 512);
+ line_buffer[1].intensity_buf = auto_alloc_array(machine(), UINT8, 512);
+ line_buffer[1].priority_buf = auto_alloc_array(machine(), UINT8, 512);
/* Create and initialise the HBLANK timers */
- state->m_hblank_start_timer = machine.scheduler().timer_alloc(FUNC(hblank_start_callback));
- state->m_hblank_end_timer = machine.scheduler().timer_alloc(FUNC(hblank_end_callback));
- state->m_hblank_start_timer->adjust(machine.primary_screen->time_until_pos(0, ESRIPSYS_HBLANK_START));
+ m_hblank_start_timer = machine().scheduler().timer_alloc(FUNC(hblank_start_callback));
+ m_hblank_end_timer = machine().scheduler().timer_alloc(FUNC(hblank_end_callback));
+ m_hblank_start_timer->adjust(machine().primary_screen->time_until_pos(0, ESRIPSYS_HBLANK_START));
/* Create the sprite scaling table */
- state->m_scale_table = auto_alloc_array(machine, UINT8, 64 * 64);
+ m_scale_table = auto_alloc_array(machine(), UINT8, 64 * 64);
for (i = 0; i < 64; ++i)
{
@@ -106,12 +105,12 @@ VIDEO_START( esripsys )
if (i & 0x20)
p5 = BIT(j, 0);
- state->m_scale_table[i * 64 + j - 1] = p0 | p1 | p2 | p3 | p4 | p5;
+ m_scale_table[i * 64 + j - 1] = p0 | p1 | p2 | p3 | p4 | p5;
}
}
/* Now create a lookup table for scaling the sprite 'fig' value */
- state->m_fig_scale_table = auto_alloc_array(machine, UINT8, 1024 * 64);
+ m_fig_scale_table = auto_alloc_array(machine(), UINT8, 1024 * 64);
for (i = 0; i < 1024; ++i)
{
@@ -124,31 +123,31 @@ VIDEO_START( esripsys )
while (input_pixels)
{
- if (state->m_scale_table[scale * 64 + (scaled_pixels & 0x3f)] == 0)
+ if (m_scale_table[scale * 64 + (scaled_pixels & 0x3f)] == 0)
input_pixels--;
scaled_pixels++;
}
- state->m_fig_scale_table[i * 64 + scale] = scaled_pixels - 1;
+ m_fig_scale_table[i * 64 + scale] = scaled_pixels - 1;
}
}
/* Register stuff for state saving */
- state_save_register_global_pointer(machine, line_buffer[0].colour_buf, 512);
- state_save_register_global_pointer(machine, line_buffer[0].intensity_buf, 512);
- state_save_register_global_pointer(machine, line_buffer[0].priority_buf, 512);
-
- state_save_register_global_pointer(machine, line_buffer[1].colour_buf, 512);
- state_save_register_global_pointer(machine, line_buffer[1].intensity_buf, 512);
- state_save_register_global_pointer(machine, line_buffer[1].priority_buf, 512);
-
- state_save_register_global(machine, state->m_video_firq);
- state_save_register_global(machine, state->m_bg_intensity);
- state_save_register_global(machine, state->m_hblank);
- state_save_register_global(machine, state->m_video_firq_en);
- state_save_register_global(machine, state->m_frame_vbl);
- state_save_register_global(machine, state->m_12sel);
+ state_save_register_global_pointer(machine(), line_buffer[0].colour_buf, 512);
+ state_save_register_global_pointer(machine(), line_buffer[0].intensity_buf, 512);
+ state_save_register_global_pointer(machine(), line_buffer[0].priority_buf, 512);
+
+ state_save_register_global_pointer(machine(), line_buffer[1].colour_buf, 512);
+ state_save_register_global_pointer(machine(), line_buffer[1].intensity_buf, 512);
+ state_save_register_global_pointer(machine(), line_buffer[1].priority_buf, 512);
+
+ state_save_register_global(machine(), m_video_firq);
+ state_save_register_global(machine(), m_bg_intensity);
+ state_save_register_global(machine(), m_hblank);
+ state_save_register_global(machine(), m_video_firq_en);
+ state_save_register_global(machine(), m_frame_vbl);
+ state_save_register_global(machine(), m_12sel);
}
SCREEN_UPDATE_RGB32( esripsys )
diff --git a/src/mame/video/exedexes.c b/src/mame/video/exedexes.c
index 6a71551f914..7f03b3414cc 100644
--- a/src/mame/video/exedexes.c
+++ b/src/mame/video/exedexes.c
@@ -31,13 +31,13 @@
***************************************************************************/
-PALETTE_INIT( exedexes )
+void exedexes_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -46,7 +46,7 @@ PALETTE_INIT( exedexes )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -56,28 +56,28 @@ PALETTE_INIT( exedexes )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] | 0xc0;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* 32x32 tiles use colors 0-0x0f */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i];
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* 16x16 tiles use colors 0x40-0x4f */
for (i = 0x200; i < 0x300; i++)
{
UINT8 ctabentry = color_prom[i] | 0x40;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites use colors 0x80-0xbf in four banks */
for (i = 0x300; i < 0x400; i++)
{
UINT8 ctabentry = color_prom[i] | (color_prom[i + 0x100] << 4) | 0x80;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -168,16 +168,15 @@ TILEMAP_MAPPER_MEMBER(exedexes_state::exedexes_fg_tilemap_scan)
return ((col * 16 & 0xf0) >> 4) + (row * 16 & 0xf0) + (col * 16 & 0x700) + ((row * 16 & 0x700) << 3);
}
-VIDEO_START( exedexes )
+void exedexes_state::video_start()
{
- exedexes_state *state = machine.driver_data<exedexes_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(exedexes_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(exedexes_state::exedexes_bg_tilemap_scan),state), 32, 32, 64, 64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(exedexes_state::get_fg_tile_info),state), tilemap_mapper_delegate(FUNC(exedexes_state::exedexes_fg_tilemap_scan),state), 16, 16, 128, 128);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(exedexes_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(exedexes_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(exedexes_state::exedexes_bg_tilemap_scan),this), 32, 32, 64, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(exedexes_state::get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(exedexes_state::exedexes_fg_tilemap_scan),this), 16, 16, 128, 128);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(exedexes_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- colortable_configure_tilemap_groups(machine.colortable, state->m_tx_tilemap, machine.gfx[0], 0xcf);
+ m_fg_tilemap->set_transparent_pen(0);
+ colortable_configure_tilemap_groups(machine().colortable, m_tx_tilemap, machine().gfx[0], 0xcf);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority )
diff --git a/src/mame/video/exerion.c b/src/mame/video/exerion.c
index f8bb8d4b852..ae3cab1b0e0 100644
--- a/src/mame/video/exerion.c
+++ b/src/mame/video/exerion.c
@@ -34,9 +34,9 @@
***************************************************************************/
-PALETTE_INIT( exerion )
+void exerion_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -49,7 +49,7 @@ PALETTE_INIT( exerion )
2, &resistances_b[0], bweights, 0, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -74,7 +74,7 @@ PALETTE_INIT( exerion )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -84,7 +84,7 @@ PALETTE_INIT( exerion )
for (i = 0; i < 0x200; i++)
{
UINT8 ctabentry = 0x10 | (color_prom[(i & 0x1c0) | ((i & 3) << 4) | ((i >> 2) & 0x0f)] & 0x0f);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* bg chars (this is not the full story... there are four layers mixed */
@@ -92,7 +92,7 @@ PALETTE_INIT( exerion )
for (i = 0x200; i < 0x300; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -104,22 +104,21 @@ PALETTE_INIT( exerion )
*
*************************************/
-VIDEO_START( exerion )
+void exerion_state::video_start()
{
- exerion_state *state = machine.driver_data<exerion_state>();
int i;
UINT8 *gfx;
/* get pointers to the mixing and lookup PROMs */
- state->m_background_mixer = state->memregion("proms")->base() + 0x320;
+ m_background_mixer = memregion("proms")->base() + 0x320;
/* allocate memory for the decoded background graphics */
- state->m_background_gfx[0] = auto_alloc_array(machine, UINT16, 256 * 256 * 4);
- state->m_background_gfx[1] = state->m_background_gfx[0] + 256 * 256;
- state->m_background_gfx[2] = state->m_background_gfx[1] + 256 * 256;
- state->m_background_gfx[3] = state->m_background_gfx[2] + 256 * 256;
+ m_background_gfx[0] = auto_alloc_array(machine(), UINT16, 256 * 256 * 4);
+ m_background_gfx[1] = m_background_gfx[0] + 256 * 256;
+ m_background_gfx[2] = m_background_gfx[1] + 256 * 256;
+ m_background_gfx[3] = m_background_gfx[2] + 256 * 256;
- state->save_pointer(NAME(state->m_background_gfx[0]), 256 * 256 * 4);
+ save_pointer(NAME(m_background_gfx[0]), 256 * 256 * 4);
/*---------------------------------
* Decode the background graphics
@@ -136,13 +135,13 @@ VIDEO_START( exerion )
* Where AA,BB,CC,DD are the 2bpp data for the pixel,and a,b,c,d are the OR
* of these two bits together.
*/
- gfx = state->memregion("gfx3")->base();
+ gfx = memregion("gfx3")->base();
for (i = 0; i < 4; i++)
{
int y;
UINT8 *src = gfx + i * 0x2000;
- UINT16 *dst = state->m_background_gfx[i];
+ UINT16 *dst = m_background_gfx[i];
for (y = 0; y < 0x100; y++)
{
diff --git a/src/mame/video/exidy.c b/src/mame/video/exidy.c
index 200cf28cbf8..26fc0b56f62 100644
--- a/src/mame/video/exidy.c
+++ b/src/mame/video/exidy.c
@@ -31,23 +31,22 @@ void exidy_video_config(running_machine &machine, UINT8 _collision_mask, UINT8 _
*
*************************************/
-VIDEO_START( exidy )
+void exidy_state::video_start()
{
- exidy_state *state = machine.driver_data<exidy_state>();
- machine.primary_screen->register_screen_bitmap(state->m_background_bitmap);
- state->m_motion_object_1_vid.allocate(16, 16);
- state->m_motion_object_2_vid.allocate(16, 16);
- state->m_motion_object_2_clip.allocate(16, 16);
-
- state_save_register_global(machine, state->m_collision_mask);
- state_save_register_global(machine, state->m_collision_invert);
- state_save_register_global(machine, state->m_is_2bpp);
- state_save_register_global(machine, state->m_int_condition);
- state_save_register_global_bitmap(machine, &state->m_background_bitmap);
- state_save_register_global_bitmap(machine, &state->m_motion_object_1_vid);
- state_save_register_global_bitmap(machine, &state->m_motion_object_2_vid);
- state_save_register_global_bitmap(machine, &state->m_motion_object_2_clip);
+ machine().primary_screen->register_screen_bitmap(m_background_bitmap);
+ m_motion_object_1_vid.allocate(16, 16);
+ m_motion_object_2_vid.allocate(16, 16);
+ m_motion_object_2_clip.allocate(16, 16);
+
+ state_save_register_global(machine(), m_collision_mask);
+ state_save_register_global(machine(), m_collision_invert);
+ state_save_register_global(machine(), m_is_2bpp);
+ state_save_register_global(machine(), m_int_condition);
+ state_save_register_global_bitmap(machine(), &m_background_bitmap);
+ state_save_register_global_bitmap(machine(), &m_motion_object_1_vid);
+ state_save_register_global_bitmap(machine(), &m_motion_object_2_vid);
+ state_save_register_global_bitmap(machine(), &m_motion_object_2_clip);
}
diff --git a/src/mame/video/exidy440.c b/src/mame/video/exidy440.c
index 78b86952fb4..2ae4908e966 100644
--- a/src/mame/video/exidy440.c
+++ b/src/mame/video/exidy440.c
@@ -37,33 +37,31 @@ static void exidy440_update_firq(running_machine &machine);
*
*************************************/
-static VIDEO_START( exidy440 )
+VIDEO_START_MEMBER(exidy440_state,exidy440)
{
- exidy440_state *state = machine.driver_data<exidy440_state>();
/* reset the system */
- state->m_firq_enable = 0;
- state->m_firq_select = 0;
- state->m_palettebank_io = 0;
- state->m_palettebank_vis = 0;
- state->m_firq_vblank = 0;
- state->m_firq_beam = 0;
+ m_firq_enable = 0;
+ m_firq_select = 0;
+ m_palettebank_io = 0;
+ m_palettebank_vis = 0;
+ m_firq_vblank = 0;
+ m_firq_beam = 0;
/* allocate a buffer for VRAM */
- state->m_local_videoram = auto_alloc_array(machine, UINT8, 256 * 256 * 2);
- memset(state->m_local_videoram, 0, 256 * 256 * 2);
+ m_local_videoram = auto_alloc_array(machine(), UINT8, 256 * 256 * 2);
+ memset(m_local_videoram, 0, 256 * 256 * 2);
/* allocate a buffer for palette RAM */
- state->m_local_paletteram = auto_alloc_array(machine, UINT8, 512 * 2);
- memset(state->m_local_paletteram, 0, 512 * 2);
+ m_local_paletteram = auto_alloc_array(machine(), UINT8, 512 * 2);
+ memset(m_local_paletteram, 0, 512 * 2);
}
-static VIDEO_START( topsecex )
+VIDEO_START_MEMBER(exidy440_state,topsecex)
{
- exidy440_state *state = machine.driver_data<exidy440_state>();
- VIDEO_START_CALL(exidy440);
+ VIDEO_START_CALL_MEMBER(exidy440);
- *state->m_topsecex_yscroll = 0;
+ *m_topsecex_yscroll = 0;
}
@@ -476,7 +474,7 @@ static SCREEN_UPDATE_IND16( topsecex )
MACHINE_CONFIG_FRAGMENT( exidy440_video )
MCFG_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
- MCFG_VIDEO_START(exidy440)
+ MCFG_VIDEO_START_OVERRIDE(exidy440_state,exidy440)
MCFG_PALETTE_LENGTH(256)
MCFG_SCREEN_ADD("screen", RASTER)
@@ -487,7 +485,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( topsecex_video )
MCFG_VIDEO_ATTRIBUTES(0)
- MCFG_VIDEO_START(topsecex)
+ MCFG_VIDEO_START_OVERRIDE(exidy440_state,topsecex)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, TOPSECEX_VBSTART)
diff --git a/src/mame/video/exprraid.c b/src/mame/video/exprraid.c
index efcc8e58103..cb68c46fa38 100644
--- a/src/mame/video/exprraid.c
+++ b/src/mame/video/exprraid.c
@@ -78,15 +78,14 @@ TILE_GET_INFO_MEMBER(exprraid_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( exprraid )
+void exprraid_state::video_start()
{
- exprraid_state *state = machine.driver_data<exprraid_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(exprraid_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(exprraid_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(exprraid_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(exprraid_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_rows(2);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scroll_rows(2);
+ m_fg_tilemap->set_transparent_pen(0);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/exterm.c b/src/mame/video/exterm.c
index 7093ad82ede..9bb3e31c3e2 100644
--- a/src/mame/video/exterm.c
+++ b/src/mame/video/exterm.c
@@ -15,13 +15,13 @@
*
*************************************/
-PALETTE_INIT( exterm )
+void exterm_state::palette_init()
{
int i;
/* initialize 555 RGB lookup */
for (i = 0; i < 32768; i++)
- palette_set_color_rgb(machine, i + 0x800, pal5bit(i >> 10), pal5bit(i >> 5), pal5bit(i >> 0));
+ palette_set_color_rgb(machine(), i + 0x800, pal5bit(i >> 10), pal5bit(i >> 5), pal5bit(i >> 0));
}
diff --git a/src/mame/video/f1gp.c b/src/mame/video/f1gp.c
index 95e5cbdf8fc..29179cd342b 100644
--- a/src/mame/video/f1gp.c
+++ b/src/mame/video/f1gp.c
@@ -40,49 +40,46 @@ TILE_GET_INFO_MEMBER(f1gp_state::get_fg_tile_info)
***************************************************************************/
-VIDEO_START( f1gp )
+VIDEO_START_MEMBER(f1gp_state,f1gp)
{
- f1gp_state *state = machine.driver_data<f1gp_state>();
- state->m_roz_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::f1gp_get_roz_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_roz_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::f1gp_get_roz_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0xff);
+ m_fg_tilemap->set_transparent_pen(0xff);
- state->m_zoomdata = (UINT16 *)state->memregion("gfx4")->base();
- machine.gfx[3]->set_source((UINT8 *)state->m_zoomdata);
+ m_zoomdata = (UINT16 *)memregion("gfx4")->base();
+ machine().gfx[3]->set_source((UINT8 *)m_zoomdata);
-// state->save_pointer(NAME(state->m_zoomdata), state->memregion("gfx4")->bytes());
+// save_pointer(NAME(m_zoomdata), memregion("gfx4")->bytes());
}
-VIDEO_START( f1gpb )
+VIDEO_START_MEMBER(f1gp_state,f1gpb)
{
- f1gp_state *state = machine.driver_data<f1gp_state>();
- state->m_roz_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::f1gp_get_roz_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_roz_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::f1gp_get_roz_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0xff);
+ m_fg_tilemap->set_transparent_pen(0xff);
- state->m_zoomdata = (UINT16 *)state->memregion("gfx4")->base();
- machine.gfx[3]->set_source((UINT8 *)state->m_zoomdata);
+ m_zoomdata = (UINT16 *)memregion("gfx4")->base();
+ machine().gfx[3]->set_source((UINT8 *)m_zoomdata);
-// state->save_pointer(NAME(state->m_zoomdata), state->memregion("gfx4")->bytes());
+// save_pointer(NAME(m_zoomdata), memregion("gfx4")->bytes());
}
-VIDEO_START( f1gp2 )
+VIDEO_START_MEMBER(f1gp_state,f1gp2)
{
- f1gp_state *state = machine.driver_data<f1gp_state>();
- state->m_roz_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::f1gp2_get_roz_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_roz_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::f1gp2_get_roz_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(f1gp_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0xff);
- state->m_roz_tilemap->set_transparent_pen(0x0f);
+ m_fg_tilemap->set_transparent_pen(0xff);
+ m_roz_tilemap->set_transparent_pen(0x0f);
- state->m_fg_tilemap->set_scrolldx(-80, 0);
- state->m_fg_tilemap->set_scrolldy(-26, 0);
+ m_fg_tilemap->set_scrolldx(-80, 0);
+ m_fg_tilemap->set_scrolldy(-26, 0);
}
diff --git a/src/mame/video/fastfred.c b/src/mame/video/fastfred.c
index b48da054aae..5ea45171e92 100644
--- a/src/mame/video/fastfred.c
+++ b/src/mame/video/fastfred.c
@@ -23,9 +23,9 @@
***************************************************************************/
-PALETTE_INIT( fastfred )
+PALETTE_INIT_MEMBER(fastfred_state,fastfred)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[4] = { 1000, 470, 220, 100 };
double rweights[4], gweights[4], bweights[4];
int i;
@@ -37,7 +37,7 @@ PALETTE_INIT( fastfred )
4, resistances, bweights, 470, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -66,12 +66,12 @@ PALETTE_INIT( fastfred )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* characters and sprites use the same palette */
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
}
/***************************************************************************
@@ -98,13 +98,12 @@ TILE_GET_INFO_MEMBER(fastfred_state::get_tile_info)
*
*************************************/
-VIDEO_START( fastfred )
+VIDEO_START_MEMBER(fastfred_state,fastfred)
{
- fastfred_state *state = machine.driver_data<fastfred_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fastfred_state::get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fastfred_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scroll_cols(32);
}
@@ -345,23 +344,22 @@ WRITE8_HANDLER( imago_charbank_w )
}
}
-VIDEO_START( imago )
+VIDEO_START_MEMBER(fastfred_state,imago)
{
- fastfred_state *state = machine.driver_data<fastfred_state>();
- state->m_web_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fastfred_state::imago_get_tile_info_web),state),TILEMAP_SCAN_ROWS, 8,8,32,32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fastfred_state::imago_get_tile_info_bg),state), TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fastfred_state::imago_get_tile_info_fg),state), TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_web_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fastfred_state::imago_get_tile_info_web),this),TILEMAP_SCAN_ROWS, 8,8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fastfred_state::imago_get_tile_info_bg),this), TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fastfred_state::imago_get_tile_info_fg),this), TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
/* the game has a galaxian starfield */
- galaxold_init_stars(machine, 256);
- state->m_stars_on = 1;
+ galaxold_init_stars(machine(), 256);
+ m_stars_on = 1;
/* web colors */
- palette_set_color(machine,256+64+0,MAKE_RGB(0x50,0x00,0x00));
- palette_set_color(machine,256+64+1,MAKE_RGB(0x00,0x00,0x00));
+ palette_set_color(machine(),256+64+0,MAKE_RGB(0x50,0x00,0x00));
+ palette_set_color(machine(),256+64+1,MAKE_RGB(0x00,0x00,0x00));
}
SCREEN_UPDATE_IND16( imago )
diff --git a/src/mame/video/fastlane.c b/src/mame/video/fastlane.c
index b7027f6eee4..e2a8a343ffc 100644
--- a/src/mame/video/fastlane.c
+++ b/src/mame/video/fastlane.c
@@ -3,13 +3,13 @@
#include "includes/fastlane.h"
-PALETTE_INIT( fastlane )
+void fastlane_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int pal;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x400);
+ machine().colortable = colortable_alloc(machine(), 0x400);
for (pal = 0; pal < 0x10; pal++)
{
@@ -18,7 +18,7 @@ PALETTE_INIT( fastlane )
for (i = 0; i < 0x400; i++)
{
UINT8 ctabentry = (i & 0x3f0) | color_prom[(pal << 4) | (i & 0x0f)];
- colortable_entry_set_value(machine.colortable, (pal << 10) | i, ctabentry);
+ colortable_entry_set_value(machine().colortable, (pal << 10) | i, ctabentry);
}
}
}
@@ -109,21 +109,20 @@ TILE_GET_INFO_MEMBER(fastlane_state::get_tile_info1)
***************************************************************************/
-VIDEO_START( fastlane )
+void fastlane_state::video_start()
{
- fastlane_state *state = machine.driver_data<fastlane_state>();
- state->m_layer0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fastlane_state::get_tile_info0),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_layer1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fastlane_state::get_tile_info1),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_layer0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fastlane_state::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_layer1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fastlane_state::get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_layer0->set_scroll_rows(32);
+ m_layer0->set_scroll_rows(32);
- state->m_clip0 = machine.primary_screen->visible_area();
- state->m_clip0.min_x += 40;
+ m_clip0 = machine().primary_screen->visible_area();
+ m_clip0.min_x += 40;
- state->m_clip1 = machine.primary_screen->visible_area();
- state->m_clip1.max_x = 39;
- state->m_clip1.min_x = 0;
+ m_clip1 = machine().primary_screen->visible_area();
+ m_clip1.max_x = 39;
+ m_clip1.min_x = 0;
}
/***************************************************************************
diff --git a/src/mame/video/fcombat.c b/src/mame/video/fcombat.c
index dc2f22dc1fd..02838cbb3a9 100644
--- a/src/mame/video/fcombat.c
+++ b/src/mame/video/fcombat.c
@@ -37,13 +37,13 @@ TILE_GET_INFO_MEMBER(fcombat_state::get_bg_tile_info)
***************************************************************************/
-PALETTE_INIT( fcombat )
+void fcombat_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( fcombat )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -79,7 +79,7 @@ PALETTE_INIT( fcombat )
for (i = 0; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[(i & 0x1c0) | ((i & 3) << 4) | ((i >> 2) & 0x0f)] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* bg chars (this is not the full story... there are four layers mixed */
@@ -87,7 +87,7 @@ PALETTE_INIT( fcombat )
for (i = 0x200; i < 0x300; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -99,10 +99,9 @@ PALETTE_INIT( fcombat )
*
*************************************/
-VIDEO_START( fcombat )
+void fcombat_state::video_start()
{
- fcombat_state *state = machine.driver_data<fcombat_state>();
- state->m_bgmap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fcombat_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32 * 8 * 2, 32);
+ m_bgmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fcombat_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32 * 8 * 2, 32);
}
diff --git a/src/mame/video/fgoal.c b/src/mame/video/fgoal.c
index 298ef34a282..2c4501e7e08 100644
--- a/src/mame/video/fgoal.c
+++ b/src/mame/video/fgoal.c
@@ -26,14 +26,13 @@ WRITE8_MEMBER(fgoal_state::fgoal_xpos_w)
}
-VIDEO_START( fgoal )
+void fgoal_state::video_start()
{
- fgoal_state *state = machine.driver_data<fgoal_state>();
- machine.primary_screen->register_screen_bitmap(state->m_fgbitmap);
- machine.primary_screen->register_screen_bitmap(state->m_bgbitmap);
+ machine().primary_screen->register_screen_bitmap(m_fgbitmap);
+ machine().primary_screen->register_screen_bitmap(m_bgbitmap);
- state->save_item(NAME(state->m_fgbitmap));
- state->save_item(NAME(state->m_bgbitmap));
+ save_item(NAME(m_fgbitmap));
+ save_item(NAME(m_bgbitmap));
}
diff --git a/src/mame/video/finalizr.c b/src/mame/video/finalizr.c
index 705347f0cfc..9fb81139940 100644
--- a/src/mame/video/finalizr.c
+++ b/src/mame/video/finalizr.c
@@ -10,13 +10,13 @@
#include "includes/finalizr.h"
-PALETTE_INIT( finalizr )
+void finalizr_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -25,7 +25,7 @@ PALETTE_INIT( finalizr )
int g = pal4bit(color_prom[i + 0x00] >> 4);
int b = pal4bit(color_prom[i + 0x20] >> 0);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -34,13 +34,13 @@ PALETTE_INIT( finalizr )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -64,12 +64,11 @@ TILE_GET_INFO_MEMBER(finalizr_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( finalizr )
+void finalizr_state::video_start()
{
- finalizr_state *state = machine.driver_data<finalizr_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(finalizr_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(finalizr_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(finalizr_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(finalizr_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/firetrap.c b/src/mame/video/firetrap.c
index e4d81dc2bab..0ab7ba8dcb3 100644
--- a/src/mame/video/firetrap.c
+++ b/src/mame/video/firetrap.c
@@ -34,13 +34,13 @@
***************************************************************************/
-PALETTE_INIT( firetrap )
+void firetrap_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, bit3, r, g, b;
@@ -55,13 +55,13 @@ PALETTE_INIT( firetrap )
bit2 = (color_prom[i] >> 6) & 0x01;
bit3 = (color_prom[i] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
}
@@ -123,15 +123,14 @@ TILE_GET_INFO_MEMBER(firetrap_state::get_bg2_tile_info)
***************************************************************************/
-VIDEO_START( firetrap )
+void firetrap_state::video_start()
{
- firetrap_state *state = machine.driver_data<firetrap_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(firetrap_state::get_fg_tile_info),state), tilemap_mapper_delegate(FUNC(firetrap_state::get_fg_memory_offset),state), 8, 8, 32, 32);
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(firetrap_state::get_bg1_tile_info),state), tilemap_mapper_delegate(FUNC(firetrap_state::get_bg_memory_offset),state), 16, 16, 32, 32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(firetrap_state::get_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(firetrap_state::get_bg_memory_offset),state), 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(firetrap_state::get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(firetrap_state::get_fg_memory_offset),this), 8, 8, 32, 32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(firetrap_state::get_bg1_tile_info),this), tilemap_mapper_delegate(FUNC(firetrap_state::get_bg_memory_offset),this), 16, 16, 32, 32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(firetrap_state::get_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(firetrap_state::get_bg_memory_offset),this), 16, 16, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_bg1_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_bg1_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/firetrk.c b/src/mame/video/firetrk.c
index 734b3fe37da..c321d4b0937 100644
--- a/src/mame/video/firetrk.c
+++ b/src/mame/video/firetrk.c
@@ -18,9 +18,8 @@ static const rectangle playfield_window(0x02a, 0x115, 0x000, 0x0ff);
-PALETTE_INIT( firetrk )
+void firetrk_state::palette_init()
{
- firetrk_state *state = machine.driver_data<firetrk_state>();
int i;
static const UINT8 colortable_source[] =
@@ -41,18 +40,18 @@ PALETTE_INIT( firetrk )
RGB_WHITE
};
- state->m_color1_mask = state->m_color2_mask = 0;
+ m_color1_mask = m_color2_mask = 0;
for (i = 0; i < ARRAY_LENGTH(colortable_source); i++)
{
UINT8 color = colortable_source[i];
if (color == 1)
- state->m_color1_mask |= 1 << i;
+ m_color1_mask |= 1 << i;
else if (color == 2)
- state->m_color2_mask |= 1 << i;
+ m_color2_mask |= 1 << i;
- palette_set_color(machine, i, palette_source[color]);
+ palette_set_color(machine(), i, palette_source[color]);
}
}
@@ -63,10 +62,9 @@ static void prom_to_palette(running_machine &machine, int number, UINT8 val)
}
-PALETTE_INIT( montecar )
+PALETTE_INIT_MEMBER(firetrk_state,montecar)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- firetrk_state *state = machine.driver_data<firetrk_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
static const UINT8 colortable_source[] =
@@ -102,22 +100,22 @@ PALETTE_INIT( montecar )
*
*/
- state->m_color1_mask = state->m_color2_mask = 0;
+ m_color1_mask = m_color2_mask = 0;
for (i = 0; i < ARRAY_LENGTH(colortable_source); i++)
{
UINT8 color = colortable_source[i];
if (color == 1)
- state->m_color1_mask |= 1 << i;
+ m_color1_mask |= 1 << i;
else if (color == 2)
- state->m_color2_mask |= 1 << i;
+ m_color2_mask |= 1 << i;
- prom_to_palette(machine, i, color_prom[0x100 + colortable_source[i]]);
+ prom_to_palette(machine(), i, color_prom[0x100 + colortable_source[i]]);
}
- palette_set_color(machine, ARRAY_LENGTH(colortable_source) + 0, RGB_BLACK);
- palette_set_color(machine, ARRAY_LENGTH(colortable_source) + 1, RGB_WHITE);
+ palette_set_color(machine(), ARRAY_LENGTH(colortable_source) + 0, RGB_BLACK);
+ palette_set_color(machine(), ARRAY_LENGTH(colortable_source) + 1, RGB_WHITE);
}
@@ -217,36 +215,33 @@ TILE_GET_INFO_MEMBER(firetrk_state::montecar_get_tile_info2)
}
-VIDEO_START( firetrk )
+void firetrk_state::video_start()
{
- firetrk_state *state = machine.driver_data<firetrk_state>();
- machine.primary_screen->register_screen_bitmap(state->m_helper1);
- machine.primary_screen->register_screen_bitmap(state->m_helper2);
+ machine().primary_screen->register_screen_bitmap(m_helper1);
+ machine().primary_screen->register_screen_bitmap(m_helper2);
- state->m_tilemap1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::firetrk_get_tile_info1),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
- state->m_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::firetrk_get_tile_info2),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_tilemap1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::firetrk_get_tile_info1),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::firetrk_get_tile_info2),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
}
-VIDEO_START( superbug )
+VIDEO_START_MEMBER(firetrk_state,superbug)
{
- firetrk_state *state = machine.driver_data<firetrk_state>();
- machine.primary_screen->register_screen_bitmap(state->m_helper1);
- machine.primary_screen->register_screen_bitmap(state->m_helper2);
+ machine().primary_screen->register_screen_bitmap(m_helper1);
+ machine().primary_screen->register_screen_bitmap(m_helper2);
- state->m_tilemap1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::superbug_get_tile_info1),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
- state->m_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::superbug_get_tile_info2),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_tilemap1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::superbug_get_tile_info1),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::superbug_get_tile_info2),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
}
-VIDEO_START( montecar )
+VIDEO_START_MEMBER(firetrk_state,montecar)
{
- firetrk_state *state = machine.driver_data<firetrk_state>();
- machine.primary_screen->register_screen_bitmap(state->m_helper1);
- machine.primary_screen->register_screen_bitmap(state->m_helper2);
+ machine().primary_screen->register_screen_bitmap(m_helper1);
+ machine().primary_screen->register_screen_bitmap(m_helper2);
- state->m_tilemap1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::montecar_get_tile_info1),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
- state->m_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::montecar_get_tile_info2),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_tilemap1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::montecar_get_tile_info1),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(firetrk_state::montecar_get_tile_info2),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
}
diff --git a/src/mame/video/fitfight.c b/src/mame/video/fitfight.c
index ca0dd6eca34..57103a1dd01 100644
--- a/src/mame/video/fitfight.c
+++ b/src/mame/video/fitfight.c
@@ -95,17 +95,16 @@ WRITE16_MEMBER(fitfight_state::fof_txt_tileram_w)
/* video start / update */
-VIDEO_START(fitfight)
+void fitfight_state::video_start()
{
- fitfight_state *state = machine.driver_data<fitfight_state>();
- state->m_fof_bak_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fitfight_state::get_fof_bak_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 128, 32);
+ m_fof_bak_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fitfight_state::get_fof_bak_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 128, 32);
/* opaque */
- state->m_fof_mid_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fitfight_state::get_fof_mid_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 128, 32);
- state->m_fof_mid_tilemap->set_transparent_pen(0);
+ m_fof_mid_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fitfight_state::get_fof_mid_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 128, 32);
+ m_fof_mid_tilemap->set_transparent_pen(0);
- state->m_fof_txt_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fitfight_state::get_fof_txt_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 128, 32);
- state->m_fof_txt_tilemap->set_transparent_pen(0);
+ m_fof_txt_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fitfight_state::get_fof_txt_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 128, 32);
+ m_fof_txt_tilemap->set_transparent_pen(0);
}
SCREEN_UPDATE_IND16(fitfight)
diff --git a/src/mame/video/flkatck.c b/src/mame/video/flkatck.c
index 217d43db55b..18135749ad8 100644
--- a/src/mame/video/flkatck.c
+++ b/src/mame/video/flkatck.c
@@ -67,11 +67,10 @@ TILE_GET_INFO_MEMBER(flkatck_state::get_tile_info_B)
***************************************************************************/
-VIDEO_START( flkatck )
+void flkatck_state::video_start()
{
- flkatck_state *state = machine.driver_data<flkatck_state>();
- state->m_k007121_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(flkatck_state::get_tile_info_A),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_k007121_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(flkatck_state::get_tile_info_B),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_k007121_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(flkatck_state::get_tile_info_A),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_k007121_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(flkatck_state::get_tile_info_B),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/flower.c b/src/mame/video/flower.c
index 22158cb082d..baa965620ae 100644
--- a/src/mame/video/flower.c
+++ b/src/mame/video/flower.c
@@ -4,13 +4,13 @@
#include "includes/flower.h"
-PALETTE_INIT( flower )
+void flower_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -19,11 +19,11 @@ PALETTE_INIT( flower )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
@@ -145,20 +145,19 @@ TILE_GET_INFO_MEMBER(flower_state::get_text_tile_info)
SET_TILE_INFO_MEMBER(0, code, color>>2, 0);
}
-VIDEO_START(flower)
+void flower_state::video_start()
{
- flower_state *state = machine.driver_data<flower_state>();
- state->m_bg0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(flower_state::get_bg0_tile_info),state), TILEMAP_SCAN_ROWS,16,16,16,16);
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(flower_state::get_bg1_tile_info),state), TILEMAP_SCAN_ROWS,16,16,16,16);
- state->m_text_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(flower_state::get_text_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,32,32);
- state->m_text_right_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(flower_state::get_text_tile_info),state),TILEMAP_SCAN_COLS, 8, 8, 2,32);
+ m_bg0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(flower_state::get_bg0_tile_info),this), TILEMAP_SCAN_ROWS,16,16,16,16);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(flower_state::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS,16,16,16,16);
+ m_text_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(flower_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
+ m_text_right_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(flower_state::get_text_tile_info),this),TILEMAP_SCAN_COLS, 8, 8, 2,32);
- state->m_bg1_tilemap->set_transparent_pen(15);
- state->m_text_tilemap->set_transparent_pen(3);
- state->m_text_right_tilemap->set_transparent_pen(3);
+ m_bg1_tilemap->set_transparent_pen(15);
+ m_text_tilemap->set_transparent_pen(3);
+ m_text_right_tilemap->set_transparent_pen(3);
- state->m_text_tilemap->set_scrolly(0, 16);
- state->m_text_right_tilemap->set_scrolly(0, 16);
+ m_text_tilemap->set_scrolly(0, 16);
+ m_text_right_tilemap->set_scrolly(0, 16);
}
SCREEN_UPDATE_IND16( flower )
diff --git a/src/mame/video/flstory.c b/src/mame/video/flstory.c
index 9d8eb8be2a4..3d4761d54ef 100644
--- a/src/mame/video/flstory.c
+++ b/src/mame/video/flstory.c
@@ -54,40 +54,37 @@ TILE_GET_INFO_MEMBER(flstory_state::get_rumba_tile_info)
0);
}
-VIDEO_START( flstory )
+VIDEO_START_MEMBER(flstory_state,flstory)
{
- flstory_state *state = machine.driver_data<flstory_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(flstory_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
-// state->m_bg_tilemap->set_transparent_pen(15);
- state->m_bg_tilemap->set_transmask(0, 0x3fff, 0xc000); /* split type 0 has pens 0-13 transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x8000, 0x7fff); /* split type 1 has pen 15 transparent in front half */
- state->m_bg_tilemap->set_scroll_cols(32);
-
- state->m_generic_paletteram_8.allocate(0x200);
- state->m_generic_paletteram2_8.allocate(0x200);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(flstory_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+// m_bg_tilemap->set_transparent_pen(15);
+ m_bg_tilemap->set_transmask(0, 0x3fff, 0xc000); /* split type 0 has pens 0-13 transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x8000, 0x7fff); /* split type 1 has pen 15 transparent in front half */
+ m_bg_tilemap->set_scroll_cols(32);
+
+ m_generic_paletteram_8.allocate(0x200);
+ m_generic_paletteram2_8.allocate(0x200);
}
-VIDEO_START( rumba )
+VIDEO_START_MEMBER(flstory_state,rumba)
{
- flstory_state *state = machine.driver_data<flstory_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(flstory_state::get_rumba_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
-// state->m_bg_tilemap->set_transparent_pen(15);
- state->m_bg_tilemap->set_transmask(0, 0x3fff, 0xc000); /* split type 0 has pens 0-13 transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x8000, 0x7fff); /* split type 1 has pen 15 transparent in front half */
- state->m_bg_tilemap->set_scroll_cols(32);
-
- state->m_generic_paletteram_8.allocate(0x200);
- state->m_generic_paletteram2_8.allocate(0x200);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(flstory_state::get_rumba_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+// m_bg_tilemap->set_transparent_pen(15);
+ m_bg_tilemap->set_transmask(0, 0x3fff, 0xc000); /* split type 0 has pens 0-13 transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x8000, 0x7fff); /* split type 1 has pen 15 transparent in front half */
+ m_bg_tilemap->set_scroll_cols(32);
+
+ m_generic_paletteram_8.allocate(0x200);
+ m_generic_paletteram2_8.allocate(0x200);
}
-VIDEO_START( victnine )
+VIDEO_START_MEMBER(flstory_state,victnine)
{
- flstory_state *state = machine.driver_data<flstory_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(flstory_state::victnine_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(flstory_state::victnine_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scroll_cols(32);
- state->m_generic_paletteram_8.allocate(0x200);
- state->m_generic_paletteram2_8.allocate(0x200);
+ m_generic_paletteram_8.allocate(0x200);
+ m_generic_paletteram2_8.allocate(0x200);
}
WRITE8_MEMBER(flstory_state::flstory_videoram_w)
diff --git a/src/mame/video/foodf.c b/src/mame/video/foodf.c
index c57034169e4..8e867c47237 100644
--- a/src/mame/video/foodf.c
+++ b/src/mame/video/foodf.c
@@ -31,24 +31,23 @@ TILE_GET_INFO_MEMBER(foodf_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( foodf )
+VIDEO_START_MEMBER(foodf_state,foodf)
{
static const int resistances[3] = { 1000, 470, 220 };
- foodf_state *state = machine.driver_data<foodf_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(foodf_state::get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 32,32);
- state->m_playfield_tilemap->set_transparent_pen(0);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(foodf_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 32,32);
+ m_playfield_tilemap->set_transparent_pen(0);
/* adjust the playfield for the 8 pixel offset */
- state->m_playfield_tilemap->set_scrollx(0, -8);
- state->save_item(NAME(state->m_playfield_flip));
+ m_playfield_tilemap->set_scrollx(0, -8);
+ save_item(NAME(m_playfield_flip));
/* compute the color output resistor weights */
compute_resistor_weights(0, 255, -1.0,
- 3, &resistances[0], state->m_rweights, 0, 0,
- 3, &resistances[0], state->m_gweights, 0, 0,
- 2, &resistances[1], state->m_bweights, 0, 0);
+ 3, &resistances[0], m_rweights, 0, 0,
+ 3, &resistances[0], m_gweights, 0, 0,
+ 2, &resistances[1], m_bweights, 0, 0);
}
diff --git a/src/mame/video/freekick.c b/src/mame/video/freekick.c
index 144e29436ae..03f15d0d9ef 100644
--- a/src/mame/video/freekick.c
+++ b/src/mame/video/freekick.c
@@ -14,10 +14,9 @@ TILE_GET_INFO_MEMBER(freekick_state::get_freek_tile_info)
}
-VIDEO_START( freekick )
+void freekick_state::video_start()
{
- freekick_state *state = machine.driver_data<freekick_state>();
- state->m_freek_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(freekick_state::get_freek_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_freek_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(freekick_state::get_freek_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/fromanc2.c b/src/mame/video/fromanc2.c
index bf78451ee02..22dc0cf00cd 100644
--- a/src/mame/video/fromanc2.c
+++ b/src/mame/video/fromanc2.c
@@ -379,143 +379,140 @@ WRITE16_MEMBER(fromanc2_state::fromanc4_gfxreg_2_w)
******************************************************************************/
-VIDEO_START( fromanc2 )
-{
- fromanc2_state *state = machine.driver_data<fromanc2_state>();
-
- state->m_tilemap[0][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v0_l0_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[0][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v0_l1_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[0][2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v0_l2_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[0][3] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v0_l3_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[1][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v1_l0_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[1][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v1_l1_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[1][2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v1_l2_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[1][3] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v1_l3_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
-
- state->m_tilemap[0][1]->set_transparent_pen(0x000);
- state->m_tilemap[0][2]->set_transparent_pen(0x000);
- state->m_tilemap[0][3]->set_transparent_pen(0x000);
- state->m_tilemap[1][1]->set_transparent_pen(0x000);
- state->m_tilemap[1][2]->set_transparent_pen(0x000);
- state->m_tilemap[1][3]->set_transparent_pen(0x000);
-
- state->m_videoram[0][0] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[0][1] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[0][2] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[0][3] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[1][0] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[1][1] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[1][2] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[1][3] = auto_alloc_array(machine, UINT16, (64 * 64));
-
- state->m_paletteram[0] = auto_alloc_array(machine, UINT16, 0x800);
- state->m_paletteram[1] = auto_alloc_array(machine, UINT16, 0x800);
-
- state->save_pointer(NAME(state->m_videoram[0][0]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[0][1]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[0][2]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[0][3]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[1][0]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[1][1]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[1][2]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[1][3]), (64 * 64));
- state->save_pointer(NAME(state->m_paletteram[0]), 0x800);
- state->save_pointer(NAME(state->m_paletteram[1]), 0x800);
- state->save_item(NAME(state->m_scrollx[0]));
- state->save_item(NAME(state->m_scrollx[1]));
- state->save_item(NAME(state->m_scrolly[0]));
- state->save_item(NAME(state->m_scrolly[1]));
- state->save_item(NAME(state->m_gfxbank[0]));
- state->save_item(NAME(state->m_gfxbank[1]));
-}
-
-VIDEO_START( fromancr )
-{
- fromanc2_state *state = machine.driver_data<fromanc2_state>();
-
- state->m_tilemap[0][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l0_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[0][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l1_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[0][2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l2_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[0][3] = 0;
- state->m_tilemap[1][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l0_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[1][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l1_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[1][2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l2_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tilemap[1][3] = 0;
-
- state->m_tilemap[0][1]->set_transparent_pen(0x0ff);
- state->m_tilemap[0][2]->set_transparent_pen(0x0ff);
- state->m_tilemap[1][1]->set_transparent_pen(0x0ff);
- state->m_tilemap[1][2]->set_transparent_pen(0x0ff);
-
- state->m_videoram[0][0] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[0][1] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[0][2] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[1][0] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[1][1] = auto_alloc_array(machine, UINT16, (64 * 64));
- state->m_videoram[1][2] = auto_alloc_array(machine, UINT16, (64 * 64));
-
- state->m_paletteram[0] = auto_alloc_array(machine, UINT16, 0x800);
- state->m_paletteram[1] = auto_alloc_array(machine, UINT16, 0x800);
-
- state->save_pointer(NAME(state->m_videoram[0][0]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[0][1]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[0][2]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[1][0]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[1][1]), (64 * 64));
- state->save_pointer(NAME(state->m_videoram[1][2]), (64 * 64));
- state->save_pointer(NAME(state->m_paletteram[0]), 0x800);
- state->save_pointer(NAME(state->m_paletteram[1]), 0x800);
- state->save_item(NAME(state->m_scrollx[0]));
- state->save_item(NAME(state->m_scrollx[1]));
- state->save_item(NAME(state->m_scrolly[0]));
- state->save_item(NAME(state->m_scrolly[1]));
- state->save_item(NAME(state->m_gfxbank[0]));
- state->save_item(NAME(state->m_gfxbank[1]));
-}
-
-
-VIDEO_START( fromanc4 )
-{
- fromanc2_state *state = machine.driver_data<fromanc2_state>();
-
- state->m_tilemap[0][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l0_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
- state->m_tilemap[0][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l1_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
- state->m_tilemap[0][2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l2_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
- state->m_tilemap[0][3] = 0;
- state->m_tilemap[1][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l0_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
- state->m_tilemap[1][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l1_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
- state->m_tilemap[1][2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l2_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
- state->m_tilemap[1][3] = 0;
-
- state->m_tilemap[0][1]->set_transparent_pen(0x000);
- state->m_tilemap[0][2]->set_transparent_pen(0x000);
- state->m_tilemap[1][1]->set_transparent_pen(0x000);
- state->m_tilemap[1][2]->set_transparent_pen(0x000);
-
- state->m_videoram[0][0] = auto_alloc_array(machine, UINT16, (256 * 64));
- state->m_videoram[0][1] = auto_alloc_array(machine, UINT16, (256 * 64));
- state->m_videoram[0][2] = auto_alloc_array(machine, UINT16, (256 * 64));
- state->m_videoram[1][0] = auto_alloc_array(machine, UINT16, (256 * 64));
- state->m_videoram[1][1] = auto_alloc_array(machine, UINT16, (256 * 64));
- state->m_videoram[1][2] = auto_alloc_array(machine, UINT16, (256 * 64));
-
- state->m_paletteram[0] = auto_alloc_array(machine, UINT16, 0x800);
- state->m_paletteram[1] = auto_alloc_array(machine, UINT16, 0x800);
-
- state->save_pointer(NAME(state->m_videoram[0][0]), (256 * 64));
- state->save_pointer(NAME(state->m_videoram[0][1]), (256 * 64));
- state->save_pointer(NAME(state->m_videoram[0][2]), (256 * 64));
- state->save_pointer(NAME(state->m_videoram[1][0]), (256 * 64));
- state->save_pointer(NAME(state->m_videoram[1][1]), (256 * 64));
- state->save_pointer(NAME(state->m_videoram[1][2]), (256 * 64));
- state->save_pointer(NAME(state->m_paletteram[0]), 0x800);
- state->save_pointer(NAME(state->m_paletteram[1]), 0x800);
- state->save_item(NAME(state->m_scrollx[0]));
- state->save_item(NAME(state->m_scrollx[1]));
- state->save_item(NAME(state->m_scrolly[0]));
- state->save_item(NAME(state->m_scrolly[1]));
- state->save_item(NAME(state->m_gfxbank[0]));
- state->save_item(NAME(state->m_gfxbank[1]));
+VIDEO_START_MEMBER(fromanc2_state,fromanc2)
+{
+
+ m_tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v0_l0_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v0_l1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[0][2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v0_l2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[0][3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v0_l3_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v1_l0_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v1_l1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[1][2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v1_l2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[1][3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromanc2_get_v1_l3_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+
+ m_tilemap[0][1]->set_transparent_pen(0x000);
+ m_tilemap[0][2]->set_transparent_pen(0x000);
+ m_tilemap[0][3]->set_transparent_pen(0x000);
+ m_tilemap[1][1]->set_transparent_pen(0x000);
+ m_tilemap[1][2]->set_transparent_pen(0x000);
+ m_tilemap[1][3]->set_transparent_pen(0x000);
+
+ m_videoram[0][0] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[0][1] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[0][2] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[0][3] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[1][0] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[1][1] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[1][2] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[1][3] = auto_alloc_array(machine(), UINT16, (64 * 64));
+
+ m_paletteram[0] = auto_alloc_array(machine(), UINT16, 0x800);
+ m_paletteram[1] = auto_alloc_array(machine(), UINT16, 0x800);
+
+ save_pointer(NAME(m_videoram[0][0]), (64 * 64));
+ save_pointer(NAME(m_videoram[0][1]), (64 * 64));
+ save_pointer(NAME(m_videoram[0][2]), (64 * 64));
+ save_pointer(NAME(m_videoram[0][3]), (64 * 64));
+ save_pointer(NAME(m_videoram[1][0]), (64 * 64));
+ save_pointer(NAME(m_videoram[1][1]), (64 * 64));
+ save_pointer(NAME(m_videoram[1][2]), (64 * 64));
+ save_pointer(NAME(m_videoram[1][3]), (64 * 64));
+ save_pointer(NAME(m_paletteram[0]), 0x800);
+ save_pointer(NAME(m_paletteram[1]), 0x800);
+ save_item(NAME(m_scrollx[0]));
+ save_item(NAME(m_scrollx[1]));
+ save_item(NAME(m_scrolly[0]));
+ save_item(NAME(m_scrolly[1]));
+ save_item(NAME(m_gfxbank[0]));
+ save_item(NAME(m_gfxbank[1]));
+}
+
+VIDEO_START_MEMBER(fromanc2_state,fromancr)
+{
+
+ m_tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l0_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[0][2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[0][3] = 0;
+ m_tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l0_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[1][2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap[1][3] = 0;
+
+ m_tilemap[0][1]->set_transparent_pen(0x0ff);
+ m_tilemap[0][2]->set_transparent_pen(0x0ff);
+ m_tilemap[1][1]->set_transparent_pen(0x0ff);
+ m_tilemap[1][2]->set_transparent_pen(0x0ff);
+
+ m_videoram[0][0] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[0][1] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[0][2] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[1][0] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[1][1] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[1][2] = auto_alloc_array(machine(), UINT16, (64 * 64));
+
+ m_paletteram[0] = auto_alloc_array(machine(), UINT16, 0x800);
+ m_paletteram[1] = auto_alloc_array(machine(), UINT16, 0x800);
+
+ save_pointer(NAME(m_videoram[0][0]), (64 * 64));
+ save_pointer(NAME(m_videoram[0][1]), (64 * 64));
+ save_pointer(NAME(m_videoram[0][2]), (64 * 64));
+ save_pointer(NAME(m_videoram[1][0]), (64 * 64));
+ save_pointer(NAME(m_videoram[1][1]), (64 * 64));
+ save_pointer(NAME(m_videoram[1][2]), (64 * 64));
+ save_pointer(NAME(m_paletteram[0]), 0x800);
+ save_pointer(NAME(m_paletteram[1]), 0x800);
+ save_item(NAME(m_scrollx[0]));
+ save_item(NAME(m_scrollx[1]));
+ save_item(NAME(m_scrolly[0]));
+ save_item(NAME(m_scrolly[1]));
+ save_item(NAME(m_gfxbank[0]));
+ save_item(NAME(m_gfxbank[1]));
+}
+
+
+VIDEO_START_MEMBER(fromanc2_state,fromanc4)
+{
+
+ m_tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l0_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
+ m_tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
+ m_tilemap[0][2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v0_l2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
+ m_tilemap[0][3] = 0;
+ m_tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l0_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
+ m_tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
+ m_tilemap[1][2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromanc2_state::fromancr_get_v1_l2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
+ m_tilemap[1][3] = 0;
+
+ m_tilemap[0][1]->set_transparent_pen(0x000);
+ m_tilemap[0][2]->set_transparent_pen(0x000);
+ m_tilemap[1][1]->set_transparent_pen(0x000);
+ m_tilemap[1][2]->set_transparent_pen(0x000);
+
+ m_videoram[0][0] = auto_alloc_array(machine(), UINT16, (256 * 64));
+ m_videoram[0][1] = auto_alloc_array(machine(), UINT16, (256 * 64));
+ m_videoram[0][2] = auto_alloc_array(machine(), UINT16, (256 * 64));
+ m_videoram[1][0] = auto_alloc_array(machine(), UINT16, (256 * 64));
+ m_videoram[1][1] = auto_alloc_array(machine(), UINT16, (256 * 64));
+ m_videoram[1][2] = auto_alloc_array(machine(), UINT16, (256 * 64));
+
+ m_paletteram[0] = auto_alloc_array(machine(), UINT16, 0x800);
+ m_paletteram[1] = auto_alloc_array(machine(), UINT16, 0x800);
+
+ save_pointer(NAME(m_videoram[0][0]), (256 * 64));
+ save_pointer(NAME(m_videoram[0][1]), (256 * 64));
+ save_pointer(NAME(m_videoram[0][2]), (256 * 64));
+ save_pointer(NAME(m_videoram[1][0]), (256 * 64));
+ save_pointer(NAME(m_videoram[1][1]), (256 * 64));
+ save_pointer(NAME(m_videoram[1][2]), (256 * 64));
+ save_pointer(NAME(m_paletteram[0]), 0x800);
+ save_pointer(NAME(m_paletteram[1]), 0x800);
+ save_item(NAME(m_scrollx[0]));
+ save_item(NAME(m_scrollx[1]));
+ save_item(NAME(m_scrolly[0]));
+ save_item(NAME(m_scrolly[1]));
+ save_item(NAME(m_gfxbank[0]));
+ save_item(NAME(m_gfxbank[1]));
}
/******************************************************************************
diff --git a/src/mame/video/fromance.c b/src/mame/video/fromance.c
index e29dd12c3c9..d69505c924b 100644
--- a/src/mame/video/fromance.c
+++ b/src/mame/video/fromance.c
@@ -89,43 +89,39 @@ static void init_common( running_machine &machine )
state->save_pointer(NAME(state->m_local_paletteram), 0x800 * 2);
}
-VIDEO_START( fromance )
+VIDEO_START_MEMBER(fromance_state,fromance)
{
- fromance_state *state = machine.driver_data<fromance_state>();
/* allocate tilemaps */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_fromance_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_fromance_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_fromance_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_fromance_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
- init_common(machine);
+ init_common(machine());
}
-VIDEO_START( nekkyoku )
+VIDEO_START_MEMBER(fromance_state,nekkyoku)
{
- fromance_state *state = machine.driver_data<fromance_state>();
/* allocate tilemaps */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_nekkyoku_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_nekkyoku_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_nekkyoku_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_nekkyoku_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
- init_common(machine);
+ init_common(machine());
}
-VIDEO_START( pipedrm )
+VIDEO_START_MEMBER(fromance_state,pipedrm)
{
- fromance_state *state = machine.driver_data<fromance_state>();
- VIDEO_START_CALL(fromance);
- state->m_scrolly_ofs = 0x00;
+ VIDEO_START_CALL_MEMBER(fromance);
+ m_scrolly_ofs = 0x00;
}
-VIDEO_START( hatris )
+VIDEO_START_MEMBER(fromance_state,hatris)
{
- fromance_state *state = machine.driver_data<fromance_state>();
- VIDEO_START_CALL(fromance);
- state->m_scrollx_ofs = 0xB9;
- state->m_scrolly_ofs = 0x00;
+ VIDEO_START_CALL_MEMBER(fromance);
+ m_scrollx_ofs = 0xB9;
+ m_scrolly_ofs = 0x00;
}
/*************************************
diff --git a/src/mame/video/funkybee.c b/src/mame/video/funkybee.c
index 41d967f807e..d21cb7c2635 100644
--- a/src/mame/video/funkybee.c
+++ b/src/mame/video/funkybee.c
@@ -9,9 +9,9 @@
#include "emu.h"
#include "includes/funkybee.h"
-PALETTE_INIT( funkybee )
+void funkybee_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* first, the character/sprite palette */
@@ -35,7 +35,7 @@ PALETTE_INIT( funkybee )
bit2 = (*color_prom >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
color_prom++;
}
}
@@ -85,10 +85,9 @@ TILEMAP_MAPPER_MEMBER(funkybee_state::funkybee_tilemap_scan)
return 256 * row + col;
}
-VIDEO_START( funkybee )
+void funkybee_state::video_start()
{
- funkybee_state *state = machine.driver_data<funkybee_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(funkybee_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(funkybee_state::funkybee_tilemap_scan),state), 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(funkybee_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(funkybee_state::funkybee_tilemap_scan),this), 8, 8, 32, 32);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/funworld.c b/src/mame/video/funworld.c
index 3187bf16978..56f46a712cb 100644
--- a/src/mame/video/funworld.c
+++ b/src/mame/video/funworld.c
@@ -105,9 +105,9 @@
#include "includes/funworld.h"
-PALETTE_INIT(funworld)
+PALETTE_INIT_MEMBER(funworld_state,funworld)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
static const int resistances_rb[3] = { 1000, 470, 220 };
static const int resistances_g [2] = { 470, 220 };
@@ -119,7 +119,7 @@ PALETTE_INIT(funworld)
2, resistances_g, weights_g, 100, 0);
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -138,7 +138,7 @@ PALETTE_INIT(funworld)
bit1 = (color_prom[i] >> 7) & 0x01;
g = combine_2_weights(weights_g, bit0, bit1);
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -180,16 +180,14 @@ TILE_GET_INFO_MEMBER(funworld_state::get_bg_tile_info)
}
-VIDEO_START(funworld)
+VIDEO_START_MEMBER(funworld_state,funworld)
{
- funworld_state *state = machine.driver_data<funworld_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(funworld_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 4, 8, 96, 29);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(funworld_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 96, 29);
}
-VIDEO_START(magicrd2)
+VIDEO_START_MEMBER(funworld_state,magicrd2)
{
- funworld_state *state = machine.driver_data<funworld_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(funworld_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 4, 8, 112, 34);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(funworld_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 112, 34);
}
diff --git a/src/mame/video/funybubl.c b/src/mame/video/funybubl.c
index 4c548561f7b..6137971fb1f 100644
--- a/src/mame/video/funybubl.c
+++ b/src/mame/video/funybubl.c
@@ -23,7 +23,7 @@ WRITE8_MEMBER(funybubl_state::funybubl_paldatawrite)
}
-VIDEO_START(funybubl)
+void funybubl_state::video_start()
{
}
diff --git a/src/mame/video/fuukifg2.c b/src/mame/video/fuukifg2.c
index 95e8a69d80f..88a036e9e97 100644
--- a/src/mame/video/fuukifg2.c
+++ b/src/mame/video/fuukifg2.c
@@ -80,32 +80,31 @@ WRITE16_MEMBER(fuuki16_state::fuuki16_vram_3_w){ fuuki16_vram_w(&space, offset,
/* Not used atm, seems to be fine without clearing pens? */
#if 0
-PALETTE_INIT( fuuki16 )
+PALETTE_INIT_MEMBER(fuuki16_state,fuuki16)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int pen;
/* The game does not initialise the palette at startup. It should
be totally black */
- for (pen = 0; pen < machine.total_colors(); pen++)
- palette_set_color(machine,pen,MAKE_RGB(0,0,0));
+ for (pen = 0; pen < machine().total_colors(); pen++)
+ palette_set_color(machine(),pen,MAKE_RGB(0,0,0));
}
#endif
-VIDEO_START( fuuki16 )
+void fuuki16_state::video_start()
{
- fuuki16_state *state = machine.driver_data<fuuki16_state>();
- state->m_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fuuki16_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fuuki16_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fuuki16_state::get_tile_info_2),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_tilemap[3] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fuuki16_state::get_tile_info_3),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fuuki16_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fuuki16_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fuuki16_state::get_tile_info_2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_tilemap[3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fuuki16_state::get_tile_info_3),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_tilemap[0]->set_transparent_pen(0x0f); // 4 bits
- state->m_tilemap[1]->set_transparent_pen(0xff); // 8 bits
- state->m_tilemap[2]->set_transparent_pen(0x0f); // 4 bits
- state->m_tilemap[3]->set_transparent_pen(0x0f); // 4 bits
+ m_tilemap[0]->set_transparent_pen(0x0f); // 4 bits
+ m_tilemap[1]->set_transparent_pen(0xff); // 8 bits
+ m_tilemap[2]->set_transparent_pen(0x0f); // 4 bits
+ m_tilemap[3]->set_transparent_pen(0x0f); // 4 bits
- machine.gfx[2]->set_granularity(16); /* 256 colour tiles with palette selectable on 16 colour boundaries */
+ machine().gfx[2]->set_granularity(16); /* 256 colour tiles with palette selectable on 16 colour boundaries */
}
diff --git a/src/mame/video/fuukifg3.c b/src/mame/video/fuukifg3.c
index 7cc290bf039..49502c2282a 100644
--- a/src/mame/video/fuukifg3.c
+++ b/src/mame/video/fuukifg3.c
@@ -91,27 +91,26 @@ WRITE32_MEMBER(fuuki32_state::fuuki32_vram_3_w){ fuuki32_vram_w(&space, offset,
***************************************************************************/
-VIDEO_START( fuuki32 )
+void fuuki32_state::video_start()
{
- fuuki32_state *state = machine.driver_data<fuuki32_state>();
- state->m_buf_spriteram = auto_alloc_array(machine, UINT32, state->m_spriteram.bytes() / 4);
- state->m_buf_spriteram2 = auto_alloc_array(machine, UINT32, state->m_spriteram.bytes() / 4);
+ m_buf_spriteram = auto_alloc_array(machine(), UINT32, m_spriteram.bytes() / 4);
+ m_buf_spriteram2 = auto_alloc_array(machine(), UINT32, m_spriteram.bytes() / 4);
- state->save_pointer(NAME(state->m_buf_spriteram), state->m_spriteram.bytes() / 4);
- state->save_pointer(NAME(state->m_buf_spriteram2), state->m_spriteram.bytes() / 4);
+ save_pointer(NAME(m_buf_spriteram), m_spriteram.bytes() / 4);
+ save_pointer(NAME(m_buf_spriteram2), m_spriteram.bytes() / 4);
- state->m_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fuuki32_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fuuki32_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fuuki32_state::get_tile_info_2),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_tilemap[3] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(fuuki32_state::get_tile_info_3),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fuuki32_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fuuki32_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fuuki32_state::get_tile_info_2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_tilemap[3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fuuki32_state::get_tile_info_3),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_tilemap[0]->set_transparent_pen(0xff); // 8 bits
- state->m_tilemap[1]->set_transparent_pen(0xff); // 8 bits
- state->m_tilemap[2]->set_transparent_pen(0x0f); // 4 bits
- state->m_tilemap[3]->set_transparent_pen(0x0f); // 4 bits
+ m_tilemap[0]->set_transparent_pen(0xff); // 8 bits
+ m_tilemap[1]->set_transparent_pen(0xff); // 8 bits
+ m_tilemap[2]->set_transparent_pen(0x0f); // 4 bits
+ m_tilemap[3]->set_transparent_pen(0x0f); // 4 bits
- //machine.gfx[1]->set_granularity(16); /* 256 colour tiles with palette selectable on 16 colour boundaries */
- //machine.gfx[2]->set_granularity(16);
+ //machine().gfx[1]->set_granularity(16); /* 256 colour tiles with palette selectable on 16 colour boundaries */
+ //machine().gfx[2]->set_granularity(16);
}
diff --git a/src/mame/video/gaelco.c b/src/mame/video/gaelco.c
index 24c136bf71d..8c23c871ae8 100644
--- a/src/mame/video/gaelco.c
+++ b/src/mame/video/gaelco.c
@@ -72,24 +72,22 @@ WRITE16_MEMBER(gaelco_state::gaelco_vram_w)
***************************************************************************/
-VIDEO_START( bigkarnk )
+VIDEO_START_MEMBER(gaelco_state,bigkarnk)
{
- gaelco_state *state = machine.driver_data<gaelco_state>();
- state->m_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaelco_state::get_tile_info_gaelco_screen0),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaelco_state::get_tile_info_gaelco_screen1),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaelco_state::get_tile_info_gaelco_screen0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaelco_state::get_tile_info_gaelco_screen1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tilemap[0]->set_transmask(0, 0xff01, 0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
- state->m_tilemap[1]->set_transmask(0, 0xff01, 0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
+ m_tilemap[0]->set_transmask(0, 0xff01, 0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
+ m_tilemap[1]->set_transmask(0, 0xff01, 0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
}
-VIDEO_START( maniacsq )
+VIDEO_START_MEMBER(gaelco_state,maniacsq)
{
- gaelco_state *state = machine.driver_data<gaelco_state>();
- state->m_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaelco_state::get_tile_info_gaelco_screen0),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaelco_state::get_tile_info_gaelco_screen1),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaelco_state::get_tile_info_gaelco_screen0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaelco_state::get_tile_info_gaelco_screen1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tilemap[0]->set_transparent_pen(0);
- state->m_tilemap[1]->set_transparent_pen(0);
+ m_tilemap[0]->set_transparent_pen(0);
+ m_tilemap[1]->set_transparent_pen(0);
}
diff --git a/src/mame/video/gaelco2.c b/src/mame/video/gaelco2.c
index c5f0f3940bf..f1633fa70ce 100644
--- a/src/mame/video/gaelco2.c
+++ b/src/mame/video/gaelco2.c
@@ -256,46 +256,44 @@ WRITE16_MEMBER(gaelco2_state::gaelco2_palette_w)
***************************************************************************/
-VIDEO_START( gaelco2 )
+VIDEO_START_MEMBER(gaelco2_state,gaelco2)
{
- gaelco2_state *state = machine.driver_data<gaelco2_state>();
- state->m_videoram = state->m_spriteram->live();
+ m_videoram = m_spriteram->live();
/* create tilemaps */
- state->m_pant[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaelco2_state::get_tile_info_gaelco2_screen0),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_pant[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaelco2_state::get_tile_info_gaelco2_screen1),state),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_pant[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaelco2_state::get_tile_info_gaelco2_screen0),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_pant[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaelco2_state::get_tile_info_gaelco2_screen1),this),TILEMAP_SCAN_ROWS,16,16,64,32);
/* set tilemap properties */
- state->m_pant[0]->set_transparent_pen(0);
- state->m_pant[1]->set_transparent_pen(0);
+ m_pant[0]->set_transparent_pen(0);
+ m_pant[1]->set_transparent_pen(0);
- state->m_pant[0]->set_scroll_rows(512);
- state->m_pant[0]->set_scroll_cols(1);
- state->m_pant[1]->set_scroll_rows(512);
- state->m_pant[1]->set_scroll_cols(1);
+ m_pant[0]->set_scroll_rows(512);
+ m_pant[0]->set_scroll_cols(1);
+ m_pant[1]->set_scroll_rows(512);
+ m_pant[1]->set_scroll_cols(1);
- state->m_dual_monitor = 0;
+ m_dual_monitor = 0;
}
-VIDEO_START( gaelco2_dual )
+VIDEO_START_MEMBER(gaelco2_state,gaelco2_dual)
{
- gaelco2_state *state = machine.driver_data<gaelco2_state>();
- state->m_videoram = state->m_spriteram->live();
+ m_videoram = m_spriteram->live();
/* create tilemaps */
- state->m_pant[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaelco2_state::get_tile_info_gaelco2_screen0_dual),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_pant[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaelco2_state::get_tile_info_gaelco2_screen1_dual),state),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_pant[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaelco2_state::get_tile_info_gaelco2_screen0_dual),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_pant[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaelco2_state::get_tile_info_gaelco2_screen1_dual),this),TILEMAP_SCAN_ROWS,16,16,64,32);
/* set tilemap properties */
- state->m_pant[0]->set_transparent_pen(0);
- state->m_pant[1]->set_transparent_pen(0);
+ m_pant[0]->set_transparent_pen(0);
+ m_pant[1]->set_transparent_pen(0);
- state->m_pant[0]->set_scroll_rows(512);
- state->m_pant[0]->set_scroll_cols(1);
- state->m_pant[1]->set_scroll_rows(512);
- state->m_pant[1]->set_scroll_cols(1);
+ m_pant[0]->set_scroll_rows(512);
+ m_pant[0]->set_scroll_cols(1);
+ m_pant[1]->set_scroll_rows(512);
+ m_pant[1]->set_scroll_cols(1);
- state->m_dual_monitor = 1;
+ m_dual_monitor = 1;
}
/***************************************************************************
diff --git a/src/mame/video/gaelco3d.c b/src/mame/video/gaelco3d.c
index 8de62e9c6a7..e812a682171 100644
--- a/src/mame/video/gaelco3d.c
+++ b/src/mame/video/gaelco3d.c
@@ -65,22 +65,21 @@ gaelco3d_renderer::gaelco3d_renderer(gaelco3d_state &state)
*
*************************************/
-VIDEO_START( gaelco3d )
+void gaelco3d_state::video_start()
{
- gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
- state->m_poly = auto_alloc(machine, gaelco3d_renderer(*state));
+ m_poly = auto_alloc(machine(), gaelco3d_renderer(*this));
- state->m_palette = auto_alloc_array(machine, rgb_t, 32768);
- state->m_polydata_buffer = auto_alloc_array(machine, UINT32, MAX_POLYDATA);
+ m_palette = auto_alloc_array(machine(), rgb_t, 32768);
+ m_polydata_buffer = auto_alloc_array(machine(), UINT32, MAX_POLYDATA);
/* save states */
- state_save_register_global_pointer(machine, state->m_palette, 32768);
- state_save_register_global_pointer(machine, state->m_polydata_buffer, MAX_POLYDATA);
- state_save_register_global(machine, state->m_polydata_count);
+ state_save_register_global_pointer(machine(), m_palette, 32768);
+ state_save_register_global_pointer(machine(), m_polydata_buffer, MAX_POLYDATA);
+ state_save_register_global(machine(), m_polydata_count);
- state_save_register_global(machine, state->m_lastscan);
+ state_save_register_global(machine(), m_lastscan);
}
diff --git a/src/mame/video/gaiden.c b/src/mame/video/gaiden.c
index 89e3b0996a1..56694c83130 100644
--- a/src/mame/video/gaiden.c
+++ b/src/mame/video/gaiden.c
@@ -68,91 +68,87 @@ TILE_GET_INFO_MEMBER(gaiden_state::get_tx_tile_info)
***************************************************************************/
-VIDEO_START( gaiden )
+VIDEO_START_MEMBER(gaiden_state,gaiden)
{
- gaiden_state *state = machine.driver_data<gaiden_state>();
/* set up tile layers */
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_bg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_fg);
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_foreground = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info_raiga),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_foreground = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info_raiga),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_background->set_transparent_pen(0);
- state->m_foreground->set_transparent_pen(0);
- state->m_text_layer->set_transparent_pen(0);
+ m_background->set_transparent_pen(0);
+ m_foreground->set_transparent_pen(0);
+ m_text_layer->set_transparent_pen(0);
- state->m_background->set_scrolldy(0, 33);
- state->m_foreground->set_scrolldy(0, 33);
- state->m_text_layer->set_scrolldy(0, 31);
+ m_background->set_scrolldy(0, 33);
+ m_foreground->set_scrolldy(0, 33);
+ m_text_layer->set_scrolldy(0, 31);
- state->m_background->set_scrolldx(0, -1);
- state->m_foreground->set_scrolldx(0, -1);
- state->m_text_layer->set_scrolldx(0, -1);
+ m_background->set_scrolldx(0, -1);
+ m_foreground->set_scrolldx(0, -1);
+ m_text_layer->set_scrolldx(0, -1);
/* set up sprites */
- machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_sprite_bitmap);
}
-VIDEO_START( mastninj )
+VIDEO_START_MEMBER(gaiden_state,mastninj)
{
- gaiden_state *state = machine.driver_data<gaiden_state>();
/* set up tile layers */
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_bg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_fg);
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_foreground = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info_raiga),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_foreground = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info_raiga),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
-// state->m_background->set_transparent_pen(15);
- state->m_foreground->set_transparent_pen(15);
- state->m_text_layer->set_transparent_pen(15);
+// m_background->set_transparent_pen(15);
+ m_foreground->set_transparent_pen(15);
+ m_text_layer->set_transparent_pen(15);
/* set up sprites */
- machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_sprite_bitmap);
- state->m_background->set_scrolldx(-248, 248);
- state->m_foreground->set_scrolldx(-252, 252);
+ m_background->set_scrolldx(-248, 248);
+ m_foreground->set_scrolldx(-252, 252);
}
-VIDEO_START( raiga )
+VIDEO_START_MEMBER(gaiden_state,raiga)
{
- gaiden_state *state = machine.driver_data<gaiden_state>();
/* set up tile layers */
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_bg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_fg);
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_foreground = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info_raiga),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_foreground = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info_raiga),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_background->set_transparent_pen(0);
- state->m_foreground->set_transparent_pen(0);
- state->m_text_layer->set_transparent_pen(0);
+ m_background->set_transparent_pen(0);
+ m_foreground->set_transparent_pen(0);
+ m_text_layer->set_transparent_pen(0);
/* set up sprites */
- machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_sprite_bitmap);
}
-VIDEO_START( drgnbowl )
+VIDEO_START_MEMBER(gaiden_state,drgnbowl)
{
- gaiden_state *state = machine.driver_data<gaiden_state>();
/* set up tile layers */
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_foreground = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_foreground = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaiden_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_foreground->set_transparent_pen(15);
- state->m_text_layer->set_transparent_pen(15);
+ m_foreground->set_transparent_pen(15);
+ m_text_layer->set_transparent_pen(15);
- state->m_background->set_scrolldx(-248, 248);
- state->m_foreground->set_scrolldx(-252, 252);
+ m_background->set_scrolldx(-248, 248);
+ m_foreground->set_scrolldx(-252, 252);
}
diff --git a/src/mame/video/galaga.c b/src/mame/video/galaga.c
index 354ce8157f7..93887eee84e 100644
--- a/src/mame/video/galaga.c
+++ b/src/mame/video/galaga.c
@@ -324,12 +324,12 @@ const struct star star_seed_tab[252]=
***************************************************************************/
-PALETTE_INIT( galaga )
+PALETTE_INIT_MEMBER(galaga_state,galaga)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- machine.colortable = colortable_alloc(machine, 32+64);
+ machine().colortable = colortable_alloc(machine(), 32+64);
/* core palette */
for (i = 0;i < 32;i++)
@@ -349,7 +349,7 @@ PALETTE_INIT( galaga )
bit2 = ((*color_prom) >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
@@ -366,20 +366,20 @@ PALETTE_INIT( galaga )
bits = (i >> 4) & 0x03;
b = map[bits];
- colortable_palette_set_color(machine.colortable,32 + i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable,32 + i,MAKE_RGB(r,g,b));
}
/* characters */
for (i = 0;i < 64*4;i++)
- colortable_entry_set_value(machine.colortable, i, (*(color_prom++) & 0x0f) + 0x10); /* chars */
+ colortable_entry_set_value(machine().colortable, i, (*(color_prom++) & 0x0f) + 0x10); /* chars */
/* sprites */
for (i = 0;i < 64*4;i++)
- colortable_entry_set_value(machine.colortable, 64*4+i, (*(color_prom++) & 0x0f));
+ colortable_entry_set_value(machine().colortable, 64*4+i, (*(color_prom++) & 0x0f));
/* now the stars */
for (i = 0;i < 64;i++)
- colortable_entry_set_value(machine.colortable, 64*4+64*4+i, 32 + i);
+ colortable_entry_set_value(machine().colortable, 64*4+64*4+i, 32 + i);
}
@@ -430,17 +430,16 @@ TILE_GET_INFO_MEMBER(galaga_state::get_tile_info)
***************************************************************************/
-VIDEO_START( galaga )
+VIDEO_START_MEMBER(galaga_state,galaga)
{
- galaga_state *state = machine.driver_data<galaga_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galaga_state::get_tile_info),state),tilemap_mapper_delegate(FUNC(galaga_state::tilemap_scan),state),8,8,36,28);
- colortable_configure_tilemap_groups(machine.colortable, state->m_fg_tilemap, machine.gfx[0], 0x1f);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galaga_state::get_tile_info),this),tilemap_mapper_delegate(FUNC(galaga_state::tilemap_scan),this),8,8,36,28);
+ colortable_configure_tilemap_groups(machine().colortable, m_fg_tilemap, machine().gfx[0], 0x1f);
- state->m_galaga_gfxbank = 0;
+ m_galaga_gfxbank = 0;
- state->save_item(NAME(state->m_stars_scrollx));
- state->save_item(NAME(state->m_stars_scrolly));
- state->save_item(NAME(state->m_galaga_gfxbank));
+ save_item(NAME(m_stars_scrollx));
+ save_item(NAME(m_stars_scrolly));
+ save_item(NAME(m_galaga_gfxbank));
}
diff --git a/src/mame/video/galastrm.c b/src/mame/video/galastrm.c
index 01c3c14bd21..c8256b1bdef 100644
--- a/src/mame/video/galastrm.c
+++ b/src/mame/video/galastrm.c
@@ -28,16 +28,15 @@ static void galastrm_exit(running_machine &machine)
poly_free(state->m_poly);
}
-VIDEO_START( galastrm )
+void galastrm_state::video_start()
{
- galastrm_state *state = machine.driver_data<galastrm_state>();
- state->m_spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000);
+ m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x4000);
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmaps);
- machine.primary_screen->register_screen_bitmap(state->m_polybitmap);
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmaps);
+ machine().primary_screen->register_screen_bitmap(m_polybitmap);
- state->m_poly = poly_alloc(machine, 16, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
- machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(galastrm_exit), &machine));
+ m_poly = poly_alloc(machine(), 16, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
+ machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(galastrm_exit), &machine()));
}
/************************************************************
diff --git a/src/mame/video/galaxia.c b/src/mame/video/galaxia.c
index 993f999801b..c5aaa967670 100644
--- a/src/mame/video/galaxia.c
+++ b/src/mame/video/galaxia.c
@@ -18,7 +18,7 @@
// Colors are 1bpp, but how they are generated is a mystery
// there's no color prom on the pcb, nor palette ram
-PALETTE_INIT( galaxia )
+PALETTE_INIT_MEMBER(galaxia_state,galaxia)
{
// estimated with video/photo references
const int lut_clr[0x18] = {
@@ -33,14 +33,14 @@ PALETTE_INIT( galaxia )
};
for (int i = 0; i < 0x18; i++)
- palette_set_color_rgb(machine, i, pal1bit(lut_clr[i] >> 0), pal1bit(lut_clr[i] >> 1), pal1bit(lut_clr[i] >> 2));
+ palette_set_color_rgb(machine(), i, pal1bit(lut_clr[i] >> 0), pal1bit(lut_clr[i] >> 1), pal1bit(lut_clr[i] >> 2));
// stars/bullets
- palette_set_color_rgb(machine, STAR_PEN, pal1bit(1), pal1bit(1), pal1bit(1));
- palette_set_color_rgb(machine, BULLET_PEN, pal1bit(1), pal1bit(1), pal1bit(0));
+ palette_set_color_rgb(machine(), STAR_PEN, pal1bit(1), pal1bit(1), pal1bit(1));
+ palette_set_color_rgb(machine(), BULLET_PEN, pal1bit(1), pal1bit(1), pal1bit(0));
}
-PALETTE_INIT( astrowar )
+PALETTE_INIT_MEMBER(galaxia_state,astrowar)
{
// no reference material available(?), except for Data East astrof
const int lut_clr[8] = { 7, 3, 5, 1, 4, 2, 6, 7 };
@@ -48,16 +48,16 @@ PALETTE_INIT( astrowar )
for (int i = 0; i < 8; i++)
{
// background
- palette_set_color_rgb(machine, i*2, 0, 0, 0);
- palette_set_color_rgb(machine, i*2 + 1, pal1bit(lut_clr[i] >> 0), pal1bit(lut_clr[i] >> 1), pal1bit(lut_clr[i] >> 2));
+ palette_set_color_rgb(machine(), i*2, 0, 0, 0);
+ palette_set_color_rgb(machine(), i*2 + 1, pal1bit(lut_clr[i] >> 0), pal1bit(lut_clr[i] >> 1), pal1bit(lut_clr[i] >> 2));
// sprites
- palette_set_color_rgb(machine, i | SPRITE_PEN_BASE, pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
+ palette_set_color_rgb(machine(), i | SPRITE_PEN_BASE, pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
}
// stars/bullets
- palette_set_color_rgb(machine, STAR_PEN, pal1bit(1), pal1bit(1), pal1bit(1));
- palette_set_color_rgb(machine, BULLET_PEN, pal1bit(1), pal1bit(1), pal1bit(0));
+ palette_set_color_rgb(machine(), STAR_PEN, pal1bit(1), pal1bit(1), pal1bit(1));
+ palette_set_color_rgb(machine(), BULLET_PEN, pal1bit(1), pal1bit(1), pal1bit(0));
}
TILE_GET_INFO_MEMBER(galaxia_state::get_galaxia_bg_tile_info)
@@ -82,28 +82,26 @@ static void init_common( running_machine &machine )
cvs_init_stars(machine);
}
-VIDEO_START( galaxia )
+VIDEO_START_MEMBER(galaxia_state,galaxia)
{
- galaxia_state *state = machine.driver_data<galaxia_state>();
- init_common(machine);
+ init_common(machine());
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galaxia_state::get_galaxia_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scroll_cols(8);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galaxia_state::get_galaxia_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scroll_cols(8);
}
-VIDEO_START( astrowar )
+VIDEO_START_MEMBER(galaxia_state,astrowar)
{
- galaxia_state *state = machine.driver_data<galaxia_state>();
- init_common(machine);
+ init_common(machine());
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galaxia_state::get_astrowar_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scroll_cols(8);
- state->m_bg_tilemap->set_scrolldx(8, 8);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galaxia_state::get_astrowar_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scroll_cols(8);
+ m_bg_tilemap->set_scrolldx(8, 8);
- machine.primary_screen->register_screen_bitmap(state->m_temp_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_temp_bitmap);
}
diff --git a/src/mame/video/galaxian.c b/src/mame/video/galaxian.c
index 2b31084249c..c429eac1e3d 100644
--- a/src/mame/video/galaxian.c
+++ b/src/mame/video/galaxian.c
@@ -253,10 +253,9 @@ static void bullets_draw(running_machine &machine, bitmap_rgb32 &bitmap, const r
*
*************************************/
-PALETTE_INIT( galaxian )
+void galaxian_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- galaxian_state *state = machine.driver_data<galaxian_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int rgb_resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
int i, minval, midval, maxval, len;
@@ -294,7 +293,7 @@ PALETTE_INIT( galaxian )
2, &rgb_resistances[1], bweights, 470, 0);
/* decode the palette first */
- len = machine.root_device().memregion("proms")->bytes();
+ len = machine().root_device().memregion("proms")->bytes();
for (i = 0; i < len; i++)
{
UINT8 bit0, bit1, bit2, r, g, b;
@@ -316,7 +315,7 @@ PALETTE_INIT( galaxian )
bit1 = BIT(color_prom[i],7);
b = combine_2_weights(bweights, bit0, bit1);
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
/*
@@ -365,22 +364,21 @@ PALETTE_INIT( galaxian )
b = starmap[(bit1 << 1) | bit0];
/* set the RGB color */
- state->m_star_color[i] = MAKE_RGB(r, g, b);
+ m_star_color[i] = MAKE_RGB(r, g, b);
}
/* default bullet colors are white for the first 7, and yellow for the last one */
for (i = 0; i < 7; i++)
- state->m_bullet_color[i] = MAKE_RGB(0xff,0xff,0xff);
- state->m_bullet_color[7] = MAKE_RGB(0xff,0xff,0x00);
+ m_bullet_color[i] = MAKE_RGB(0xff,0xff,0xff);
+ m_bullet_color[7] = MAKE_RGB(0xff,0xff,0x00);
}
-PALETTE_INIT( moonwar )
+PALETTE_INIT_MEMBER(galaxian_state,moonwar)
{
- galaxian_state *state = machine.driver_data<galaxian_state>();
- PALETTE_INIT_CALL(galaxian);
+ galaxian_state::palette_init();
/* wire mod to connect the bullet blue output to the 220 ohm resistor */
- state->m_bullet_color[7] = MAKE_RGB(0xef,0xef,0x97);
+ m_bullet_color[7] = MAKE_RGB(0xef,0xef,0x97);
}
/*************************************
@@ -389,41 +387,40 @@ PALETTE_INIT( moonwar )
*
*************************************/
-VIDEO_START( galaxian )
+void galaxian_state::video_start()
{
- galaxian_state *state = machine.driver_data<galaxian_state>();
/* create a tilemap for the background */
- if (!state->m_sfx_tilemap)
+ if (!m_sfx_tilemap)
{
/* normal galaxian hardware is row-based and individually scrolling columns */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galaxian_state::bg_get_tile_info),state), TILEMAP_SCAN_ROWS, GALAXIAN_XSCALE*8,8, 32,32);
- state->m_bg_tilemap->set_scroll_cols(32);
- state->m_bg_tilemap->set_scrolldx(0, -GALAXIAN_XSCALE * 128);
- state->m_bg_tilemap->set_scrolldy(0, 8);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galaxian_state::bg_get_tile_info),this), TILEMAP_SCAN_ROWS, GALAXIAN_XSCALE*8,8, 32,32);
+ m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_scrolldx(0, -GALAXIAN_XSCALE * 128);
+ m_bg_tilemap->set_scrolldy(0, 8);
}
else
{
/* sfx hardware is column-based and individually scrolling rows */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galaxian_state::bg_get_tile_info),state), TILEMAP_SCAN_COLS, GALAXIAN_XSCALE*8,8, 32,32);
- state->m_bg_tilemap->set_scroll_rows(32);
- state->m_bg_tilemap->set_scrolldx(0, -GALAXIAN_XSCALE * 128);
- state->m_bg_tilemap->set_scrolldy(0, 8);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galaxian_state::bg_get_tile_info),this), TILEMAP_SCAN_COLS, GALAXIAN_XSCALE*8,8, 32,32);
+ m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap->set_scrolldx(0, -GALAXIAN_XSCALE * 128);
+ m_bg_tilemap->set_scrolldy(0, 8);
}
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
/* initialize globals */
- state->m_flipscreen_x = 0;
- state->m_flipscreen_y = 0;
- state->m_background_enable = 0;
- state->m_background_blue = 0;
- state->m_background_red = 0;
- state->m_background_green = 0;
+ m_flipscreen_x = 0;
+ m_flipscreen_y = 0;
+ m_background_enable = 0;
+ m_background_blue = 0;
+ m_background_red = 0;
+ m_background_green = 0;
/* initialize stars */
- stars_init(machine);
+ stars_init(machine());
/* register for save states */
- state_save_register(machine);
+ state_save_register(machine());
}
diff --git a/src/mame/video/galaxold.c b/src/mame/video/galaxold.c
index 451a1b547a3..9ad691ae8e5 100644
--- a/src/mame/video/galaxold.c
+++ b/src/mame/video/galaxold.c
@@ -7,9 +7,12 @@
#include "emu.h"
#include "includes/galaxold.h"
-#define STARS_COLOR_BASE (machine.root_device().memregion("proms")->bytes())
+#define STARS_COLOR_BASE_LEGACY (machine.root_device().memregion("proms")->bytes())
+#define STARS_COLOR_BASE (machine().root_device().memregion("proms")->bytes())
#define BULLETS_COLOR_BASE (STARS_COLOR_BASE + 64)
+#define BULLETS_COLOR_BASE_LEGACY (STARS_COLOR_BASE_LEGACY + 64)
#define BACKGROUND_COLOR_BASE (BULLETS_COLOR_BASE + 2)
+#define BACKGROUND_COLOR_BASE_LEGACY (BULLETS_COLOR_BASE_LEGACY + 2)
@@ -92,14 +95,14 @@ static void dambustr_draw_background(running_machine &machine, bitmap_ind16 &bit
The RGB outputs have a 470 ohm pull-down each.
***************************************************************************/
-PALETTE_INIT( galaxold )
+PALETTE_INIT_MEMBER(galaxold_state,galaxold)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i, len;
/* first, the character/sprite palette */
- len = machine.root_device().memregion("proms")->bytes();
+ len = machine().root_device().memregion("proms")->bytes();
for (i = 0;i < len;i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -119,36 +122,36 @@ PALETTE_INIT( galaxold )
bit1 = BIT(*color_prom,7);
b = 0x4f * bit0 + 0xa8 * bit1;
- palette_set_color_rgb(machine,i,r,g,b);
+ palette_set_color_rgb(machine(),i,r,g,b);
color_prom++;
}
- galaxold_init_stars(machine, STARS_COLOR_BASE);
+ galaxold_init_stars(machine(), STARS_COLOR_BASE);
/* bullets - yellow and white */
- palette_set_color(machine,BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0xef,0x00));
- palette_set_color(machine,BULLETS_COLOR_BASE+1,MAKE_RGB(0xef,0xef,0xef));
+ palette_set_color(machine(),BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0xef,0x00));
+ palette_set_color(machine(),BULLETS_COLOR_BASE+1,MAKE_RGB(0xef,0xef,0xef));
}
-PALETTE_INIT( scrambold )
+PALETTE_INIT_MEMBER(galaxold_state,scrambold)
{
- PALETTE_INIT_CALL(galaxold);
+ PALETTE_INIT_CALL_MEMBER(galaxold);
/* blue background - 390 ohm resistor */
- palette_set_color(machine,BACKGROUND_COLOR_BASE,MAKE_RGB(0,0,0x56));
+ palette_set_color(machine(),BACKGROUND_COLOR_BASE,MAKE_RGB(0,0,0x56));
}
-PALETTE_INIT( stratgyx )
+PALETTE_INIT_MEMBER(galaxold_state,stratgyx)
{
int base = BACKGROUND_COLOR_BASE;
int i;
- PALETTE_INIT_CALL(galaxold);
+ PALETTE_INIT_CALL_MEMBER(galaxold);
/* The background color generator is connected this way:
@@ -163,18 +166,18 @@ PALETTE_INIT( stratgyx )
int g = BIT(i,1) * 0x3c;
int b = BIT(i,2) * 0x47;
- palette_set_color_rgb(machine,base+i,r,g,b);
+ palette_set_color_rgb(machine(),base+i,r,g,b);
}
}
-PALETTE_INIT( rockclim )
+PALETTE_INIT_MEMBER(galaxold_state,rockclim)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i, len;
/* first, the character/sprite palette */
- len = machine.root_device().memregion("proms")->bytes();
+ len = machine().root_device().memregion("proms")->bytes();
for (i = 0;i < len;i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -194,7 +197,7 @@ PALETTE_INIT( rockclim )
bit1 = BIT(*color_prom,7);
b = 0x4f * bit0 + 0xa8 * bit1;
- palette_set_color_rgb(machine,i,r,g,b);
+ palette_set_color_rgb(machine(),i,r,g,b);
color_prom++;
}
}
@@ -216,9 +219,9 @@ PALETTE_INIT( rockclim )
The RGB outputs have a 470 ohm pull-down each.
***************************************************************************/
-PALETTE_INIT( darkplnt )
+PALETTE_INIT_MEMBER(galaxold_state,darkplnt)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
@@ -241,23 +244,23 @@ PALETTE_INIT( darkplnt )
bit2 = BIT(*color_prom,5);
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color_rgb(machine,i,r,g,b);
+ palette_set_color_rgb(machine(),i,r,g,b);
color_prom++;
}
/* bullets - red and blue */
- palette_set_color(machine,BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0x00,0x00));
- palette_set_color(machine,BULLETS_COLOR_BASE+1,MAKE_RGB(0x00,0x00,0xef));
+ palette_set_color(machine(),BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0x00,0x00));
+ palette_set_color(machine(),BULLETS_COLOR_BASE+1,MAKE_RGB(0x00,0x00,0xef));
}
-PALETTE_INIT( minefld )
+PALETTE_INIT_MEMBER(galaxold_state,minefld)
{
int base = BACKGROUND_COLOR_BASE;
int i;
- PALETTE_INIT_CALL(galaxold);
+ PALETTE_INIT_CALL_MEMBER(galaxold);
/* set up background colors */
@@ -269,7 +272,7 @@ PALETTE_INIT( minefld )
int r = 0;
int g = i;
int b = i * 2;
- palette_set_color_rgb(machine,base+i,r,g,b);
+ palette_set_color_rgb(machine(),base+i,r,g,b);
}
/* graduated brown */
@@ -279,17 +282,17 @@ PALETTE_INIT( minefld )
int r = i * 1.5;
int g = i * 0.75;
int b = i / 2;
- palette_set_color_rgb(machine,base+128+i,r,g,b);
+ palette_set_color_rgb(machine(),base+128+i,r,g,b);
}
}
-PALETTE_INIT( rescue )
+PALETTE_INIT_MEMBER(galaxold_state,rescue)
{
int base = BACKGROUND_COLOR_BASE;
int i;
- PALETTE_INIT_CALL(galaxold);
+ PALETTE_INIT_CALL_MEMBER(galaxold);
/* set up background colors */
@@ -301,17 +304,17 @@ PALETTE_INIT( rescue )
int r = 0;
int g = i;
int b = i * 2;
- palette_set_color_rgb(machine,base+i,r,g,b);
+ palette_set_color_rgb(machine(),base+i,r,g,b);
}
}
-PALETTE_INIT( mariner )
+PALETTE_INIT_MEMBER(galaxold_state,mariner)
{
int base = BACKGROUND_COLOR_BASE;
int i;
- PALETTE_INIT_CALL(galaxold);
+ PALETTE_INIT_CALL_MEMBER(galaxold);
/* set up background colors */
@@ -331,19 +334,19 @@ PALETTE_INIT( mariner )
g = 0;
b = 0x0e * BIT(i,0) + 0x1f * BIT(i,1) + 0x43 * BIT(i,2) + 0x8f * BIT(i,3);
- palette_set_color_rgb(machine,base+i,r,g,b);
+ palette_set_color_rgb(machine(),base+i,r,g,b);
}
}
/* swapped r/g/b hook-up */
-PALETTE_INIT( dambustr )
+PALETTE_INIT_MEMBER(galaxold_state,dambustr)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int base = BACKGROUND_COLOR_BASE;
int i, len;
/* first, the character/sprite palette */
- len = machine.root_device().memregion("proms")->bytes();
+ len = machine().root_device().memregion("proms")->bytes();
for (i = 0;i < len;i++)
{
@@ -364,17 +367,17 @@ PALETTE_INIT( dambustr )
bit1 = BIT(*color_prom,7);
g = 0x4f * bit0 + 0xa8 * bit1;
- palette_set_color_rgb(machine,i,r,g,b);
+ palette_set_color_rgb(machine(),i,r,g,b);
color_prom++;
}
- galaxold_init_stars(machine, STARS_COLOR_BASE);
+ galaxold_init_stars(machine(), STARS_COLOR_BASE);
/* bullets - yellow and white */
- palette_set_color(machine,BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0xef,0x00));
- palette_set_color(machine,BULLETS_COLOR_BASE+1,MAKE_RGB(0xef,0xef,0xef));
+ palette_set_color(machine(),BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0xef,0x00));
+ palette_set_color(machine(),BULLETS_COLOR_BASE+1,MAKE_RGB(0xef,0xef,0xef));
/*
Assumption (not clear from the schematics):
@@ -390,18 +393,18 @@ PALETTE_INIT( dambustr )
int r = BIT(i,0) * 0x47;
int g = BIT(i,1) * 0x47;
int b = BIT(i,2) * 0x4f;
- palette_set_color_rgb(machine,base+i,r,g,b);
+ palette_set_color_rgb(machine(),base+i,r,g,b);
}
}
-PALETTE_INIT( turtles )
+PALETTE_INIT_MEMBER(galaxold_state,turtles)
{
int base = BACKGROUND_COLOR_BASE;
int i;
- PALETTE_INIT_CALL(galaxold);
+ PALETTE_INIT_CALL_MEMBER(galaxold);
/* The background color generator is connected this way:
@@ -416,7 +419,7 @@ PALETTE_INIT( turtles )
int g = BIT(i,1) * 0x47;
int b = BIT(i,2) * 0x55;
- palette_set_color_rgb(machine,base+i,r,g,b);
+ palette_set_color_rgb(machine(),base+i,r,g,b);
}
}
@@ -474,130 +477,118 @@ static void video_start_common(running_machine &machine)
state_save_register(machine);
}
-VIDEO_START( galaxold_plain )
+VIDEO_START_MEMBER(galaxold_state,galaxold_plain)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- video_start_common(machine);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg_tilemap->set_transparent_pen(0);
+ video_start_common(machine());
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_scroll_cols(32);
- state->m_color_mask = (machine.gfx[0]->granularity() == 4) ? 7 : 3;
+ m_color_mask = (machine().gfx[0]->granularity() == 4) ? 7 : 3;
}
-VIDEO_START( galaxold )
+VIDEO_START_MEMBER(galaxold_state,galaxold)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold_plain);
+ VIDEO_START_CALL_MEMBER(galaxold_plain);
- state->m_draw_stars = galaxold_draw_stars;
+ m_draw_stars = galaxold_draw_stars;
- state->m_draw_bullets = galaxold_draw_bullets;
+ m_draw_bullets = galaxold_draw_bullets;
}
-VIDEO_START( scrambold )
+VIDEO_START_MEMBER(galaxold_state,scrambold)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold_plain);
+ VIDEO_START_CALL_MEMBER(galaxold_plain);
/* FIXME: This most probably needs to be adjusted
* again when RAW video params are added to scramble
*/
- state->m_bg_tilemap->set_scrolldx(0, 0);
+ m_bg_tilemap->set_scrolldx(0, 0);
- state->m_draw_stars = scrambold_draw_stars;
+ m_draw_stars = scrambold_draw_stars;
- state->m_draw_bullets = scrambold_draw_bullets;
+ m_draw_bullets = scrambold_draw_bullets;
- state->m_draw_background = scrambold_draw_background;
+ m_draw_background = scrambold_draw_background;
}
-VIDEO_START( darkplnt )
+VIDEO_START_MEMBER(galaxold_state,darkplnt)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold_plain);
+ VIDEO_START_CALL_MEMBER(galaxold_plain);
- state->m_bg_tilemap->set_scrolldx(0, 0);
- state->m_draw_bullets = darkplnt_draw_bullets;
+ m_bg_tilemap->set_scrolldx(0, 0);
+ m_draw_bullets = darkplnt_draw_bullets;
}
-VIDEO_START( rescue )
+VIDEO_START_MEMBER(galaxold_state,rescue)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(scrambold);
+ VIDEO_START_CALL_MEMBER(scrambold);
- state->m_draw_stars = rescue_draw_stars;
+ m_draw_stars = rescue_draw_stars;
- state->m_draw_background = rescue_draw_background;
+ m_draw_background = rescue_draw_background;
}
-VIDEO_START( minefld )
+VIDEO_START_MEMBER(galaxold_state,minefld)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(scrambold);
+ VIDEO_START_CALL_MEMBER(scrambold);
- state->m_draw_stars = rescue_draw_stars;
+ m_draw_stars = rescue_draw_stars;
- state->m_draw_background = minefld_draw_background;
+ m_draw_background = minefld_draw_background;
}
-VIDEO_START( stratgyx )
+VIDEO_START_MEMBER(galaxold_state,stratgyx)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold_plain);
+ VIDEO_START_CALL_MEMBER(galaxold_plain);
- state->m_draw_background = stratgyx_draw_background;
+ m_draw_background = stratgyx_draw_background;
}
-VIDEO_START( ckongs )
+VIDEO_START_MEMBER(galaxold_state,ckongs)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(scrambold);
+ VIDEO_START_CALL_MEMBER(scrambold);
- state->m_modify_spritecode = mshuttle_modify_spritecode;
+ m_modify_spritecode = mshuttle_modify_spritecode;
}
-VIDEO_START( mariner )
+VIDEO_START_MEMBER(galaxold_state,mariner)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold_plain);
+ VIDEO_START_CALL_MEMBER(galaxold_plain);
- state->m_draw_stars = mariner_draw_stars;
+ m_draw_stars = mariner_draw_stars;
- state->m_draw_bullets = scrambold_draw_bullets;
+ m_draw_bullets = scrambold_draw_bullets;
- state->m_draw_background = mariner_draw_background;
+ m_draw_background = mariner_draw_background;
- state->m_modify_charcode = mariner_modify_charcode;
+ m_modify_charcode = mariner_modify_charcode;
}
-VIDEO_START( mimonkey )
+VIDEO_START_MEMBER(galaxold_state,mimonkey)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(scrambold);
+ VIDEO_START_CALL_MEMBER(scrambold);
- state->m_modify_charcode = mimonkey_modify_charcode;
- state->m_modify_spritecode = mimonkey_modify_spritecode;
+ m_modify_charcode = mimonkey_modify_charcode;
+ m_modify_spritecode = mimonkey_modify_spritecode;
}
-VIDEO_START( dkongjrm )
+VIDEO_START_MEMBER(galaxold_state,dkongjrm)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold_plain);
+ VIDEO_START_CALL_MEMBER(galaxold_plain);
- state->m_modify_charcode = pisces_modify_charcode;
- state->m_modify_spritecode = dkongjrm_modify_spritecode;
+ m_modify_charcode = pisces_modify_charcode;
+ m_modify_spritecode = dkongjrm_modify_spritecode;
- state->m_spriteram2_present= 1;
+ m_spriteram2_present= 1;
}
-VIDEO_START( scorpion )
+VIDEO_START_MEMBER(galaxold_state,scorpion)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(scrambold);
+ VIDEO_START_CALL_MEMBER(scrambold);
- state->m_modify_spritecode = batman2_modify_spritecode;
+ m_modify_spritecode = batman2_modify_spritecode;
}
static void pisces_modify_spritecode(running_machine &machine, UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs)
@@ -606,13 +597,12 @@ static void pisces_modify_spritecode(running_machine &machine, UINT8 *spriteram,
*code |= (state->m_gfxbank[0] << 6);
}
-VIDEO_START( pisces )
+VIDEO_START_MEMBER(galaxold_state,pisces)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold);
+ VIDEO_START_CALL_MEMBER(galaxold);
- state->m_modify_charcode = pisces_modify_charcode;
- state->m_modify_spritecode = pisces_modify_spritecode;
+ m_modify_charcode = pisces_modify_charcode;
+ m_modify_spritecode = pisces_modify_spritecode;
}
#ifdef UNUSED_FUNCTION
@@ -631,12 +621,11 @@ static void theend_draw_bullets(running_machine &machine, bitmap_ind16 &bitmap,
}
}
-VIDEO_START( theend )
+VIDEO_START_MEMBER(galaxold_state,theend)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold);
+ VIDEO_START_CALL_MEMBER(galaxold);
- state->m_draw_bullets = theend_draw_bullets;
+ m_draw_bullets = theend_draw_bullets;
}
#endif
@@ -649,13 +638,12 @@ static void mooncrst_modify_spritecode(running_machine &machine, UINT8 *spritera
}
}
-VIDEO_START( mooncrst )
+VIDEO_START_MEMBER(galaxold_state,mooncrst)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold);
+ VIDEO_START_CALL_MEMBER(galaxold);
- state->m_modify_charcode = mooncrst_modify_charcode;
- state->m_modify_spritecode = mooncrst_modify_spritecode;
+ m_modify_charcode = mooncrst_modify_charcode;
+ m_modify_spritecode = mooncrst_modify_spritecode;
}
static void batman2_modify_charcode(running_machine &machine, UINT16 *code, UINT8 x)
@@ -667,13 +655,12 @@ static void batman2_modify_charcode(running_machine &machine, UINT16 *code, UINT
}
}
-VIDEO_START( batman2 )
+VIDEO_START_MEMBER(galaxold_state,batman2)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold);
+ VIDEO_START_CALL_MEMBER(galaxold);
- state->m_modify_charcode = batman2_modify_charcode;
- state->m_modify_spritecode = batman2_modify_spritecode;
+ m_modify_charcode = batman2_modify_charcode;
+ m_modify_spritecode = batman2_modify_spritecode;
}
@@ -690,19 +677,18 @@ static void rockclim_modify_spritecode(running_machine &machine, UINT8 *spritera
if (state->m_gfxbank[2]) *code|=0x40;
}
-VIDEO_START( rockclim )
+VIDEO_START_MEMBER(galaxold_state,rockclim)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold);
- state->m_rockclim_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::rockclim_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ VIDEO_START_CALL_MEMBER(galaxold);
+ m_rockclim_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::rockclim_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_draw_background = rockclim_draw_background;
- state->m_modify_charcode = mooncrst_modify_charcode;
- state->m_modify_spritecode = rockclim_modify_spritecode;
+ m_draw_background = rockclim_draw_background;
+ m_modify_charcode = mooncrst_modify_charcode;
+ m_modify_spritecode = rockclim_modify_spritecode;
- state->m_rockclim_v = state->m_rockclim_h = 0;
- state_save_register_global(machine, state->m_rockclim_v);
- state_save_register_global(machine, state->m_rockclim_h);
+ m_rockclim_v = m_rockclim_h = 0;
+ state_save_register_global(machine(), m_rockclim_v);
+ state_save_register_global(machine(), m_rockclim_h);
}
TILE_GET_INFO_MEMBER(galaxold_state::drivfrcg_get_tile_info)
@@ -718,37 +704,35 @@ TILE_GET_INFO_MEMBER(galaxold_state::drivfrcg_get_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( drivfrcg )
+VIDEO_START_MEMBER(galaxold_state,drivfrcg)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- video_start_common(machine);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::drivfrcg_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ video_start_common(machine());
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::drivfrcg_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scroll_cols(32);
- state->m_modify_spritecode = mshuttle_modify_spritecode;
- state->m_modify_color = drivfrcg_modify_color;
+ m_modify_spritecode = mshuttle_modify_spritecode;
+ m_modify_color = drivfrcg_modify_color;
- state->m_color_mask = 0xff;
+ m_color_mask = 0xff;
}
-VIDEO_START( ad2083 )
+VIDEO_START_MEMBER(galaxold_state,ad2083)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- video_start_common(machine);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::drivfrcg_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ video_start_common(machine());
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::drivfrcg_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scroll_cols(32);
- state->m_modify_spritecode = ad2083_modify_spritecode;
+ m_modify_spritecode = ad2083_modify_spritecode;
- state->m_draw_bullets = scrambold_draw_bullets;
+ m_draw_bullets = scrambold_draw_bullets;
- state->m_draw_background = ad2083_draw_background;
+ m_draw_background = ad2083_draw_background;
- state->m_color_mask = 7;
+ m_color_mask = 7;
}
@@ -770,24 +754,22 @@ TILE_GET_INFO_MEMBER(galaxold_state::racknrol_get_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( racknrol )
+VIDEO_START_MEMBER(galaxold_state,racknrol)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- video_start_common(machine);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::racknrol_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ video_start_common(machine());
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::racknrol_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scroll_cols(32);
- state->m_color_mask = 0xff;
+ m_color_mask = 0xff;
}
-VIDEO_START( bongo )
+VIDEO_START_MEMBER(galaxold_state,bongo)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold_plain);
+ VIDEO_START_CALL_MEMBER(galaxold_plain);
- state->m_modify_spritecode = batman2_modify_spritecode;
+ m_modify_spritecode = batman2_modify_spritecode;
}
TILE_GET_INFO_MEMBER(galaxold_state::dambustr_get_tile_info2)
@@ -810,32 +792,31 @@ TILE_GET_INFO_MEMBER(galaxold_state::dambustr_get_tile_info2)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( dambustr )
+VIDEO_START_MEMBER(galaxold_state,dambustr)
{
- galaxold_state *state = machine.driver_data<galaxold_state>();
- VIDEO_START_CALL(galaxold);
+ VIDEO_START_CALL_MEMBER(galaxold);
- state->m_dambustr_bg_split_line = 0;
- state->m_dambustr_bg_color_1 = 0;
- state->m_dambustr_bg_color_2 = 0;
- state->m_dambustr_bg_priority = 0;
- state->m_dambustr_char_bank = 0;
+ m_dambustr_bg_split_line = 0;
+ m_dambustr_bg_color_1 = 0;
+ m_dambustr_bg_color_2 = 0;
+ m_dambustr_bg_priority = 0;
+ m_dambustr_char_bank = 0;
- state->m_draw_background = dambustr_draw_background;
+ m_draw_background = dambustr_draw_background;
- state->m_modify_charcode = dambustr_modify_charcode;
- state->m_modify_spritecode = dambustr_modify_spritecode;
+ m_modify_charcode = dambustr_modify_charcode;
+ m_modify_spritecode = dambustr_modify_spritecode;
- state->m_draw_bullets = dambustr_draw_bullets;
+ m_draw_bullets = dambustr_draw_bullets;
/* allocate the temporary bitmap for the background priority */
- state->m_dambustr_tmpbitmap = auto_bitmap_ind16_alloc(machine, machine.primary_screen->width(), machine.primary_screen->height());
+ m_dambustr_tmpbitmap = auto_bitmap_ind16_alloc(machine(), machine().primary_screen->width(), machine().primary_screen->height());
/* make a copy of the tilemap to emulate background priority */
- state->m_dambustr_videoram2 = auto_alloc_array(machine, UINT8, 0x0400);
- state->m_dambustr_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::dambustr_get_tile_info2),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_dambustr_videoram2 = auto_alloc_array(machine(), UINT8, 0x0400);
+ m_dambustr_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galaxold_state::dambustr_get_tile_info2),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_dambustr_tilemap2->set_transparent_pen(0);
+ m_dambustr_tilemap2->set_transparent_pen(0);
}
@@ -1128,7 +1109,7 @@ static void galaxold_draw_bullets(running_machine &machine, bitmap_ind16 &bitmap
/* yellow missile, white shells (this is the terminology on the schematics) */
- color = ((offs == 7*4) ? BULLETS_COLOR_BASE : BULLETS_COLOR_BASE + 1);
+ color = ((offs == 7*4) ? BULLETS_COLOR_BASE_LEGACY : BULLETS_COLOR_BASE_LEGACY + 1);
bitmap.pix16(y, x) = color;
}
@@ -1144,7 +1125,7 @@ static void scrambold_draw_bullets(running_machine &machine, bitmap_ind16 &bitma
if (cliprect.contains(x, y))
/* yellow bullets */
- bitmap.pix16(y, x) = BULLETS_COLOR_BASE;
+ bitmap.pix16(y, x) = BULLETS_COLOR_BASE_LEGACY;
}
static void darkplnt_draw_bullets(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int offs, int x, int y)
@@ -1172,11 +1153,11 @@ static void dambustr_draw_bullets(running_machine &machine, bitmap_ind16 &bitmap
{
if (offs < 4*4)
{
- color = BULLETS_COLOR_BASE;
+ color = BULLETS_COLOR_BASE_LEGACY;
y--;
}
else {
- color = BULLETS_COLOR_BASE + 1;
+ color = BULLETS_COLOR_BASE_LEGACY + 1;
x--;
}
@@ -1199,7 +1180,7 @@ static void scrambold_draw_background(running_machine &machine, bitmap_ind16 &bi
{
galaxold_state *state = machine.driver_data<galaxold_state>();
if (state->m_background_enable)
- bitmap.fill(BACKGROUND_COLOR_BASE, cliprect);
+ bitmap.fill(BACKGROUND_COLOR_BASE_LEGACY, cliprect);
else
bitmap.fill(0, cliprect);
}
@@ -1209,7 +1190,7 @@ static void ad2083_draw_background(running_machine &machine, bitmap_ind16 &bitma
galaxold_state *state = machine.driver_data<galaxold_state>();
int color = (state->m_background_blue << 2) | (state->m_background_green << 1) | state->m_background_red;
- bitmap.fill(BACKGROUND_COLOR_BASE + color, cliprect);
+ bitmap.fill(BACKGROUND_COLOR_BASE_LEGACY + color, cliprect);
}
static void stratgyx_draw_background(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -1217,7 +1198,7 @@ static void stratgyx_draw_background(running_machine &machine, bitmap_ind16 &bit
galaxold_state *state = machine.driver_data<galaxold_state>();
UINT8 x;
UINT8 *prom;
- int base = BACKGROUND_COLOR_BASE;
+ int base = BACKGROUND_COLOR_BASE_LEGACY;
/* the background PROM is connected the following way:
@@ -1254,7 +1235,7 @@ static void minefld_draw_background(running_machine &machine, bitmap_ind16 &bitm
galaxold_state *state = machine.driver_data<galaxold_state>();
if (state->m_background_enable)
{
- int base = BACKGROUND_COLOR_BASE;
+ int base = BACKGROUND_COLOR_BASE_LEGACY;
int x;
@@ -1275,7 +1256,7 @@ static void rescue_draw_background(running_machine &machine, bitmap_ind16 &bitma
galaxold_state *state = machine.driver_data<galaxold_state>();
if (state->m_background_enable)
{
- int base = BACKGROUND_COLOR_BASE;
+ int base = BACKGROUND_COLOR_BASE_LEGACY;
int x;
for (x = 0; x < 128; x++)
@@ -1293,7 +1274,7 @@ static void rescue_draw_background(running_machine &machine, bitmap_ind16 &bitma
static void mariner_draw_background(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
galaxold_state *state = machine.driver_data<galaxold_state>();
- int base = BACKGROUND_COLOR_BASE;
+ int base = BACKGROUND_COLOR_BASE_LEGACY;
UINT8 x;
UINT8 *prom;
@@ -1337,7 +1318,7 @@ static void mariner_draw_background(running_machine &machine, bitmap_ind16 &bitm
static void dambustr_draw_background(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
galaxold_state *state = machine.driver_data<galaxold_state>();
- int base = BACKGROUND_COLOR_BASE;
+ int base = BACKGROUND_COLOR_BASE_LEGACY;
int col1 = base + state->m_dambustr_bg_color_1;
int col2 = base + state->m_dambustr_bg_color_2;
diff --git a/src/mame/video/galivan.c b/src/mame/video/galivan.c
index d4f53bff6d8..6cf14f069bf 100644
--- a/src/mame/video/galivan.c
+++ b/src/mame/video/galivan.c
@@ -52,13 +52,13 @@ background: 0x4000 bytes of ROM: 76543210 tile code low bits
***************************************************************************/
-PALETTE_INIT( galivan )
+void galivan_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -67,7 +67,7 @@ PALETTE_INIT( galivan )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -75,7 +75,7 @@ PALETTE_INIT( galivan )
/* characters use colors 0-0x7f */
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* I think that */
/* background tiles use colors 0xc0-0xff in four banks */
@@ -90,7 +90,7 @@ PALETTE_INIT( galivan )
else
ctabentry = 0xc0 | (i & 0x0f) | ((i & 0x30) >> 0);
- colortable_entry_set_value(machine.colortable, 0x80 + i, ctabentry);
+ colortable_entry_set_value(machine().colortable, 0x80 + i, ctabentry);
}
/* sprites use colors 0x80-0xbf in four banks */
@@ -108,7 +108,7 @@ PALETTE_INIT( galivan )
else
ctabentry = 0x80 | ((i & 0x03) << 4) | (color_prom[i >> 4] & 0x0f);
- colortable_entry_set_value(machine.colortable, 0x180 + i_swapped, ctabentry);
+ colortable_entry_set_value(machine().colortable, 0x180 + i_swapped, ctabentry);
}
}
@@ -179,24 +179,22 @@ TILE_GET_INFO_MEMBER(galivan_state::ninjemak_get_tx_tile_info)
***************************************************************************/
-VIDEO_START( galivan )
+VIDEO_START_MEMBER(galivan_state,galivan)
{
- galivan_state *state = machine.driver_data<galivan_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galivan_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 128, 128);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galivan_state::get_tx_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galivan_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 128, 128);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galivan_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
}
-VIDEO_START( ninjemak )
+VIDEO_START_MEMBER(galivan_state,ninjemak)
{
- galivan_state *state = machine.driver_data<galivan_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galivan_state::ninjemak_get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 512, 32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(galivan_state::ninjemak_get_tx_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galivan_state::ninjemak_get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 512, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(galivan_state::ninjemak_get_tx_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
}
diff --git a/src/mame/video/galpani2.c b/src/mame/video/galpani2.c
index d85e329631c..9a1b4119f0a 100644
--- a/src/mame/video/galpani2.c
+++ b/src/mame/video/galpani2.c
@@ -111,22 +111,21 @@ WRITE16_HANDLER( galpani2_bg15_w )
***************************************************************************/
-PALETTE_INIT( galpani2 )
+void galpani2_state::palette_init()
{
int i;
/* first $4200 colors are dynamic */
/* initialize 555 RGB lookup */
for (i = 0; i < 0x8000; i++)
- palette_set_color_rgb(machine,0x4200+i,pal5bit(i >> 5),pal5bit(i >> 10),pal5bit(i >> 0));
+ palette_set_color_rgb(machine(),0x4200+i,pal5bit(i >> 5),pal5bit(i >> 10),pal5bit(i >> 0));
}
-VIDEO_START( galpani2 )
+void galpani2_state::video_start()
{
- galpani2_state *state = machine.driver_data<galpani2_state>();
- state->m_bg15_bitmap = auto_bitmap_ind16_alloc(machine, 256*8, 256);
- state->m_bg8_bitmap[0] = auto_bitmap_ind16_alloc(machine, 512, 256);
- state->m_bg8_bitmap[1] = auto_bitmap_ind16_alloc(machine, 512, 256);
+ m_bg15_bitmap = auto_bitmap_ind16_alloc(machine(), 256*8, 256);
+ m_bg8_bitmap[0] = auto_bitmap_ind16_alloc(machine(), 512, 256);
+ m_bg8_bitmap[1] = auto_bitmap_ind16_alloc(machine(), 512, 256);
}
diff --git a/src/mame/video/galpanic.c b/src/mame/video/galpanic.c
index f9dd8b944f8..1dfbdb23448 100644
--- a/src/mame/video/galpanic.c
+++ b/src/mame/video/galpanic.c
@@ -3,14 +3,13 @@
#include "includes/galpanic.h"
-VIDEO_START( galpanic )
+VIDEO_START_MEMBER(galpanic_state,galpanic)
{
- galpanic_state *state = machine.driver_data<galpanic_state>();
- machine.primary_screen->register_screen_bitmap(state->m_bitmap);
- machine.primary_screen->register_screen_bitmap(state->m_sprites_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_sprites_bitmap);
}
-PALETTE_INIT( galpanic )
+PALETTE_INIT_MEMBER(galpanic_state,galpanic)
{
int i;
@@ -18,7 +17,7 @@ PALETTE_INIT( galpanic )
/* initialize 555 RGB lookup */
for (i = 0;i < 32768;i++)
- palette_set_color_rgb(machine,i+1024,pal5bit(i >> 5),pal5bit(i >> 10),pal5bit(i >> 0));
+ palette_set_color_rgb(machine(),i+1024,pal5bit(i >> 5),pal5bit(i >> 10),pal5bit(i >> 0));
}
diff --git a/src/mame/video/galspnbl.c b/src/mame/video/galspnbl.c
index d526c1a94a2..992b8e765b5 100644
--- a/src/mame/video/galspnbl.c
+++ b/src/mame/video/galspnbl.c
@@ -2,13 +2,13 @@
#include "includes/galspnbl.h"
-PALETTE_INIT( galspnbl )
+void galspnbl_state::palette_init()
{
int i;
/* initialize 555 RGB lookup */
for (i = 0; i < 32768; i++)
- palette_set_color_rgb(machine, i + 1024, pal5bit(i >> 5), pal5bit(i >> 10), pal5bit(i >> 0));
+ palette_set_color_rgb(machine(), i + 1024, pal5bit(i >> 5), pal5bit(i >> 10), pal5bit(i >> 0));
}
diff --git a/src/mame/video/gameplan.c b/src/mame/video/gameplan.c
index a4a0a4e36d1..30d1ba57cae 100644
--- a/src/mame/video/gameplan.c
+++ b/src/mame/video/gameplan.c
@@ -284,35 +284,34 @@ static TIMER_CALLBACK( via_0_ca1_timer_callback )
*
*************************************/
-static VIDEO_START( common )
+VIDEO_START_MEMBER(gameplan_state,common)
{
- gameplan_state *state = machine.driver_data<gameplan_state>();
- state->m_videoram_size = (HBSTART - HBEND) * (VBSTART - VBEND);
- state->m_videoram = auto_alloc_array(machine, UINT8, state->m_videoram_size);
+ m_videoram_size = (HBSTART - HBEND) * (VBSTART - VBEND);
+ m_videoram = auto_alloc_array(machine(), UINT8, m_videoram_size);
- state->m_via_0_ca1_timer = machine.scheduler().timer_alloc(FUNC(via_0_ca1_timer_callback));
+ m_via_0_ca1_timer = machine().scheduler().timer_alloc(FUNC(via_0_ca1_timer_callback));
/* register for save states */
- state->save_pointer(NAME(state->m_videoram), state->m_videoram_size);
+ save_pointer(NAME(m_videoram), m_videoram_size);
}
-static VIDEO_START( gameplan )
+VIDEO_START_MEMBER(gameplan_state,gameplan)
{
- VIDEO_START_CALL(common);
+ VIDEO_START_CALL_MEMBER(common);
}
-static VIDEO_START( leprechn )
+VIDEO_START_MEMBER(gameplan_state,leprechn)
{
- VIDEO_START_CALL(common);
+ VIDEO_START_CALL_MEMBER(common);
}
-static VIDEO_START( trvquest )
+VIDEO_START_MEMBER(gameplan_state,trvquest)
{
- VIDEO_START_CALL(common);
+ VIDEO_START_CALL_MEMBER(common);
}
@@ -323,10 +322,9 @@ static VIDEO_START( trvquest )
*
*************************************/
-static VIDEO_RESET( gameplan )
+VIDEO_RESET_MEMBER(gameplan_state,gameplan)
{
- gameplan_state *state = machine.driver_data<gameplan_state>();
- state->m_via_0_ca1_timer->adjust(machine.primary_screen->time_until_pos(VBSTART));
+ m_via_0_ca1_timer->adjust(machine().primary_screen->time_until_pos(VBSTART));
}
@@ -338,10 +336,10 @@ static VIDEO_RESET( gameplan )
*************************************/
MACHINE_CONFIG_FRAGMENT( gameplan_video )
- MCFG_VIDEO_START(gameplan)
- MCFG_VIDEO_RESET(gameplan)
+ MCFG_VIDEO_START_OVERRIDE(gameplan_state,gameplan)
+ MCFG_VIDEO_RESET_OVERRIDE(gameplan_state,gameplan)
- MCFG_VIDEO_START(gameplan)
+ MCFG_VIDEO_START_OVERRIDE(gameplan_state,gameplan)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(GAMEPLAN_PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
@@ -350,14 +348,14 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( leprechn_video )
- MCFG_VIDEO_START(leprechn)
+ MCFG_VIDEO_START_OVERRIDE(gameplan_state,leprechn)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_STATIC(leprechn)
MACHINE_CONFIG_END
MACHINE_CONFIG_DERIVED( trvquest_video, gameplan_video )
- MCFG_VIDEO_START(trvquest)
+ MCFG_VIDEO_START_OVERRIDE(gameplan_state,trvquest)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_STATIC(gameplan)
MACHINE_CONFIG_END
diff --git a/src/mame/video/gaplus.c b/src/mame/video/gaplus.c
index 44da4997318..0d4c3ca70cd 100644
--- a/src/mame/video/gaplus.c
+++ b/src/mame/video/gaplus.c
@@ -23,13 +23,13 @@
***************************************************************************/
-PALETTE_INIT( gaplus )
+void gaplus_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 256);
+ machine().colortable = colortable_alloc(machine(), 256);
for (i = 0;i < 256;i++)
{
@@ -54,20 +54,20 @@ PALETTE_INIT( gaplus )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable,i,MAKE_RGB(r,g,b));
}
color_prom += 0x300;
/* color_prom now points to the beginning of the lookup table */
/* characters use colors 0xf0-0xff */
- for (i = 0;i < machine.gfx[0]->colors() * machine.gfx[0]->granularity();i++)
- colortable_entry_set_value(machine.colortable, machine.gfx[0]->colorbase() + i, 0xf0 + (*color_prom++ & 0x0f));
+ for (i = 0;i < machine().gfx[0]->colors() * machine().gfx[0]->granularity();i++)
+ colortable_entry_set_value(machine().colortable, machine().gfx[0]->colorbase() + i, 0xf0 + (*color_prom++ & 0x0f));
/* sprites */
- for (i = 0;i < machine.gfx[1]->colors() * machine.gfx[1]->granularity();i++)
+ for (i = 0;i < machine().gfx[1]->colors() * machine().gfx[1]->granularity();i++)
{
- colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + i, (color_prom[0] & 0x0f) + ((color_prom[0x200] & 0x0f) << 4));
+ colortable_entry_set_value(machine().colortable, machine().gfx[1]->colorbase() + i, (color_prom[0] & 0x0f) + ((color_prom[0x200] & 0x0f) << 4));
color_prom++;
}
}
@@ -179,14 +179,13 @@ static void starfield_init(running_machine &machine)
***************************************************************************/
-VIDEO_START( gaplus )
+void gaplus_state::video_start()
{
- gaplus_state *state = machine.driver_data<gaplus_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gaplus_state::get_tile_info),state),tilemap_mapper_delegate(FUNC(gaplus_state::tilemap_scan),state),8,8,36,28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gaplus_state::get_tile_info),this),tilemap_mapper_delegate(FUNC(gaplus_state::tilemap_scan),this),8,8,36,28);
- colortable_configure_tilemap_groups(machine.colortable, state->m_bg_tilemap, machine.gfx[0], 0xff);
+ colortable_configure_tilemap_groups(machine().colortable, m_bg_tilemap, machine().gfx[0], 0xff);
- starfield_init(machine);
+ starfield_init(machine());
}
diff --git a/src/mame/video/gatron.c b/src/mame/video/gatron.c
index 81d81025b0c..84aad44b32d 100644
--- a/src/mame/video/gatron.c
+++ b/src/mame/video/gatron.c
@@ -43,10 +43,9 @@ TILE_GET_INFO_MEMBER(gatron_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, 0, 0);
}
-VIDEO_START( gat )
+void gatron_state::video_start()
{
- gatron_state *state = machine.driver_data<gatron_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gatron_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 8, 16, 48, 16);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gatron_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 8, 16, 48, 16);
}
SCREEN_UPDATE_IND16( gat )
@@ -56,7 +55,7 @@ SCREEN_UPDATE_IND16( gat )
return 0;
}
-PALETTE_INIT( gat )
+void gatron_state::palette_init()
{
}
diff --git a/src/mame/video/gauntlet.c b/src/mame/video/gauntlet.c
index e679682845d..77c82a2fe8c 100644
--- a/src/mame/video/gauntlet.c
+++ b/src/mame/video/gauntlet.c
@@ -43,7 +43,7 @@ TILE_GET_INFO_MEMBER(gauntlet_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( gauntlet )
+VIDEO_START_MEMBER(gauntlet_state,gauntlet)
{
static const atarimo_desc modesc =
{
@@ -82,19 +82,18 @@ VIDEO_START( gauntlet )
0 /* callback routine for special entries */
};
- gauntlet_state *state = machine.driver_data<gauntlet_state>();
UINT16 *codelookup;
int i, size;
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gauntlet_state::get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gauntlet_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gauntlet_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gauntlet_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
/* modify the motion object code lookup table to account for the code XOR */
codelookup = atarimo_get_code_lookup(0, &size);
@@ -102,11 +101,11 @@ VIDEO_START( gauntlet )
codelookup[i] ^= 0x800;
/* set up the base color for the playfield */
- state->m_playfield_color_bank = state->m_vindctr2_screen_refresh ? 0 : 1;
+ m_playfield_color_bank = m_vindctr2_screen_refresh ? 0 : 1;
/* save states */
- state->save_item(NAME(state->m_playfield_tile_bank));
- state->save_item(NAME(state->m_playfield_color_bank));
+ save_item(NAME(m_playfield_tile_bank));
+ save_item(NAME(m_playfield_color_bank));
}
diff --git a/src/mame/video/gberet.c b/src/mame/video/gberet.c
index 8efbdec0ea9..c0777eaa2bd 100644
--- a/src/mame/video/gberet.c
+++ b/src/mame/video/gberet.c
@@ -21,13 +21,13 @@
***************************************************************************/
-PALETTE_INIT( gberet )
+PALETTE_INIT_MEMBER(gberet_state,gberet)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -53,7 +53,7 @@ PALETTE_INIT( gberet )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -62,7 +62,7 @@ PALETTE_INIT( gberet )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
for (i = 0x100; i < 0x200; i++)
@@ -74,7 +74,7 @@ PALETTE_INIT( gberet )
else
ctabentry = 0;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -118,13 +118,12 @@ TILE_GET_INFO_MEMBER(gberet_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( gberet )
+VIDEO_START_MEMBER(gberet_state,gberet)
{
- gberet_state *state = machine.driver_data<gberet_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gberet_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- colortable_configure_tilemap_groups(machine.colortable, state->m_bg_tilemap, machine.gfx[0], 0x10);
- state->m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gberet_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ colortable_configure_tilemap_groups(machine().colortable, m_bg_tilemap, machine().gfx[0], 0x10);
+ m_bg_tilemap->set_scroll_rows(32);
}
static void gberet_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/gbusters.c b/src/mame/video/gbusters.c
index 641d6a06bcb..a9fe019b0c4 100644
--- a/src/mame/video/gbusters.c
+++ b/src/mame/video/gbusters.c
@@ -37,13 +37,12 @@ void gbusters_sprite_callback( running_machine &machine, int *code, int *color,
***************************************************************************/
-VIDEO_START( gbusters )
+void gbusters_state::video_start()
{
- gbusters_state *state = machine.driver_data<gbusters_state>();
- state->m_layer_colorbase[0] = 48;
- state->m_layer_colorbase[1] = 0;
- state->m_layer_colorbase[2] = 16;
- state->m_sprite_colorbase = 32;
+ m_layer_colorbase[0] = 48;
+ m_layer_colorbase[1] = 0;
+ m_layer_colorbase[2] = 16;
+ m_sprite_colorbase = 32;
}
diff --git a/src/mame/video/gcpinbal.c b/src/mame/video/gcpinbal.c
index 9221b84d07b..09d5807aad1 100644
--- a/src/mame/video/gcpinbal.c
+++ b/src/mame/video/gcpinbal.c
@@ -63,9 +63,9 @@ static void gcpinbal_core_vh_start( running_machine &machine )
state->m_tilemap[2]->set_scrolldy(-yoffs, 0);
}
-VIDEO_START( gcpinbal )
+void gcpinbal_state::video_start()
{
- gcpinbal_core_vh_start(machine);
+ gcpinbal_core_vh_start(machine());
}
diff --git a/src/mame/video/gijoe.c b/src/mame/video/gijoe.c
index e3605c97eb4..5df64bc1781 100644
--- a/src/mame/video/gijoe.c
+++ b/src/mame/video/gijoe.c
@@ -50,29 +50,28 @@ void gijoe_tile_callback( running_machine &machine, int layer, int *code, int *c
*color = (*color >> 2 & 0x0f) | state->m_layer_colorbase[layer];
}
-VIDEO_START( gijoe )
+void gijoe_state::video_start()
{
- gijoe_state *state = machine.driver_data<gijoe_state>();
int i;
- k056832_linemap_enable(state->m_k056832, 1);
+ k056832_linemap_enable(m_k056832, 1);
for (i = 0; i < 4; i++)
{
- state->m_avac_occupancy[i] = 0;
- state->m_avac_bits[i] = 0;
- state->m_layer_colorbase[i] = 0;
- state->m_layer_pri[i] = 0;
+ m_avac_occupancy[i] = 0;
+ m_avac_bits[i] = 0;
+ m_layer_colorbase[i] = 0;
+ m_layer_pri[i] = 0;
}
- state->m_avac_vrc = 0xffff;
+ m_avac_vrc = 0xffff;
- state->save_item(NAME(state->m_avac_vrc));
- state->save_item(NAME(state->m_sprite_colorbase));
- state->save_item(NAME(state->m_avac_occupancy));
- state->save_item(NAME(state->m_avac_bits)); // these could possibly be re-created at postload k056832 elements
- state->save_item(NAME(state->m_layer_colorbase));
- state->save_item(NAME(state->m_layer_pri));
+ save_item(NAME(m_avac_vrc));
+ save_item(NAME(m_sprite_colorbase));
+ save_item(NAME(m_avac_occupancy));
+ save_item(NAME(m_avac_bits)); // these could possibly be re-created at postload k056832 elements
+ save_item(NAME(m_layer_colorbase));
+ save_item(NAME(m_layer_pri));
}
SCREEN_UPDATE_IND16( gijoe )
diff --git a/src/mame/video/ginganin.c b/src/mame/video/ginganin.c
index 131dd14af72..113e5b39099 100644
--- a/src/mame/video/ginganin.c
+++ b/src/mame/video/ginganin.c
@@ -132,15 +132,14 @@ WRITE16_MEMBER(ginganin_state::ginganin_txtram16_w)
}
-VIDEO_START( ginganin )
+void ginganin_state::video_start()
{
- ginganin_state *state = machine.driver_data<ginganin_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ginganin_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, BG_NX, BG_NY);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ginganin_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, FG_NX, FG_NY);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ginganin_state::get_txt_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, TXT_NX, TXT_NY);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ginganin_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, BG_NX, BG_NY);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ginganin_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, FG_NX, FG_NY);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ginganin_state::get_txt_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, TXT_NX, TXT_NY);
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
}
diff --git a/src/mame/video/gladiatr.c b/src/mame/video/gladiatr.c
index ad9adbfaa93..4c0327d1eaa 100644
--- a/src/mame/video/gladiatr.c
+++ b/src/mame/video/gladiatr.c
@@ -42,31 +42,29 @@ TILE_GET_INFO_MEMBER(gladiatr_state::fg_get_tile_info)
***************************************************************************/
-VIDEO_START( ppking )
+VIDEO_START_MEMBER(gladiatr_state,ppking)
{
- gladiatr_state *state = machine.driver_data<gladiatr_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gladiatr_state::bg_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gladiatr_state::fg_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gladiatr_state::bg_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gladiatr_state::fg_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,64);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scroll_cols(0x10);
+ m_bg_tilemap->set_scroll_cols(0x10);
- state->m_sprite_bank = 1;
+ m_sprite_bank = 1;
}
-VIDEO_START( gladiatr )
+VIDEO_START_MEMBER(gladiatr_state,gladiatr)
{
- gladiatr_state *state = machine.driver_data<gladiatr_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gladiatr_state::bg_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gladiatr_state::fg_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gladiatr_state::bg_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gladiatr_state::fg_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(-0x30, 0x12f);
- state->m_fg_tilemap->set_scrolldx(-0x30, 0x12f);
+ m_bg_tilemap->set_scrolldx(-0x30, 0x12f);
+ m_fg_tilemap->set_scrolldx(-0x30, 0x12f);
- state->m_sprite_bank = 2;
+ m_sprite_bank = 2;
}
diff --git a/src/mame/video/glass.c b/src/mame/video/glass.c
index e96aebacf8f..efaa33b4960 100644
--- a/src/mame/video/glass.c
+++ b/src/mame/video/glass.c
@@ -123,17 +123,16 @@ WRITE16_MEMBER(glass_state::glass_vram_w)
***************************************************************************/
-VIDEO_START( glass )
+void glass_state::video_start()
{
- glass_state *state = machine.driver_data<glass_state>();
- state->m_pant[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_glass_screen0),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_pant[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_glass_screen1),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_screen_bitmap = auto_bitmap_ind16_alloc (machine, 320, 200);
+ m_pant[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_glass_screen0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_pant[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_glass_screen1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_screen_bitmap = auto_bitmap_ind16_alloc (machine(), 320, 200);
- state->save_item(NAME(*state->m_screen_bitmap));
+ save_item(NAME(*m_screen_bitmap));
- state->m_pant[0]->set_transparent_pen(0);
- state->m_pant[1]->set_transparent_pen(0);
+ m_pant[0]->set_transparent_pen(0);
+ m_pant[1]->set_transparent_pen(0);
}
diff --git a/src/mame/video/gng.c b/src/mame/video/gng.c
index 646e17fc9a1..92c3b79e976 100644
--- a/src/mame/video/gng.c
+++ b/src/mame/video/gng.c
@@ -45,15 +45,14 @@ TILE_GET_INFO_MEMBER(gng_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( gng )
+void gng_state::video_start()
{
- gng_state *state = machine.driver_data<gng_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gng_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gng_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gng_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gng_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(3);
- state->m_bg_tilemap->set_transmask(0, 0xff, 0x00); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x41, 0xbe); /* split type 1 has pens 0 and 6 transparent in front half */
+ m_fg_tilemap->set_transparent_pen(3);
+ m_bg_tilemap->set_transmask(0, 0xff, 0x00); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x41, 0xbe); /* split type 1 has pens 0 and 6 transparent in front half */
}
diff --git a/src/mame/video/goal92.c b/src/mame/video/goal92.c
index 98f046ed13d..97f0bb497c8 100644
--- a/src/mame/video/goal92.c
+++ b/src/mame/video/goal92.c
@@ -129,19 +129,18 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
}
-VIDEO_START( goal92 )
+void goal92_state::video_start()
{
- goal92_state *state = machine.driver_data<goal92_state>();
- state->m_bg_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goal92_state::get_back_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goal92_state::get_fore_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tx_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goal92_state::get_text_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goal92_state::get_back_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goal92_state::get_fore_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tx_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goal92_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_buffered_spriteram = auto_alloc_array(machine, UINT16, 0x400 * 2);
- state_save_register_global_pointer(machine, state->m_buffered_spriteram, 0x400 * 2);
+ m_buffered_spriteram = auto_alloc_array(machine(), UINT16, 0x400 * 2);
+ state_save_register_global_pointer(machine(), m_buffered_spriteram, 0x400 * 2);
- state->m_bg_layer->set_transparent_pen(15);
- state->m_fg_layer->set_transparent_pen(15);
- state->m_tx_layer->set_transparent_pen(15);
+ m_bg_layer->set_transparent_pen(15);
+ m_fg_layer->set_transparent_pen(15);
+ m_tx_layer->set_transparent_pen(15);
}
SCREEN_UPDATE_IND16( goal92 )
diff --git a/src/mame/video/goindol.c b/src/mame/video/goindol.c
index c27432d6f78..16df70b7f4d 100644
--- a/src/mame/video/goindol.c
+++ b/src/mame/video/goindol.c
@@ -45,13 +45,12 @@ TILE_GET_INFO_MEMBER(goindol_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( goindol )
+void goindol_state::video_start()
{
- goindol_state *state = machine.driver_data<goindol_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goindol_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goindol_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goindol_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goindol_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/goldstar.c b/src/mame/video/goldstar.c
index 211567779e0..9994ab85d76 100644
--- a/src/mame/video/goldstar.c
+++ b/src/mame/video/goldstar.c
@@ -218,100 +218,95 @@ TILE_GET_INFO_MEMBER(goldstar_state::get_unkch_reel3_tile_info)
-VIDEO_START( goldstar )
+VIDEO_START_MEMBER(goldstar_state,goldstar)
{
- goldstar_state *state = machine.driver_data<goldstar_state>();
- state->m_reel1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel1_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel2_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel3_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel3_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel1_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel2_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel3_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel3_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel1_tilemap->set_scroll_cols(64);
- state->m_reel2_tilemap->set_scroll_cols(64);
- state->m_reel3_tilemap->set_scroll_cols(64);
+ m_reel1_tilemap->set_scroll_cols(64);
+ m_reel2_tilemap->set_scroll_cols(64);
+ m_reel3_tilemap->set_scroll_cols(64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8, 64, 32);
+ m_fg_tilemap->set_transparent_pen(0);
// is there an enable reg for this game?
- state->m_cm_enable_reg = 0x0b;
+ m_cm_enable_reg = 0x0b;
}
-VIDEO_START( bingowng )
+VIDEO_START_MEMBER(goldstar_state,bingowng)
{
- goldstar_state *state = machine.driver_data<goldstar_state>();
- state->m_reel1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel1_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel1_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel1_tilemap->set_scroll_cols(64);
+ m_reel1_tilemap->set_scroll_cols(64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8, 64, 32);
+ m_fg_tilemap->set_transparent_pen(0);
// is there an enable reg for this game?
- state->m_cm_enable_reg = 0x0b;
+ m_cm_enable_reg = 0x0b;
}
-VIDEO_START( magical )
+VIDEO_START_MEMBER(goldstar_state,magical)
{
- goldstar_state *state = machine.driver_data<goldstar_state>();
- state->m_reel1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel1_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel2_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel3_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel3_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel1_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel2_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel3_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel3_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel1_tilemap->set_scroll_cols(32);
- state->m_reel2_tilemap->set_scroll_cols(32);
- state->m_reel3_tilemap->set_scroll_cols(32);
+ m_reel1_tilemap->set_scroll_cols(32);
+ m_reel2_tilemap->set_scroll_cols(32);
+ m_reel3_tilemap->set_scroll_cols(32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_magical_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_magical_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8, 64, 32);
+ m_fg_tilemap->set_transparent_pen(0);
// is there an enable reg for this game?
- state->m_cm_enable_reg = 0x0b;
+ m_cm_enable_reg = 0x0b;
}
-VIDEO_START( unkch )
+VIDEO_START_MEMBER(goldstar_state,unkch)
{
- goldstar_state *state = machine.driver_data<goldstar_state>();
- state->m_reel1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_unkch_reel1_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_unkch_reel2_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel3_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_unkch_reel3_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_unkch_reel1_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_unkch_reel2_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel3_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_unkch_reel3_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel1_tilemap->set_scroll_cols(32);
- state->m_reel2_tilemap->set_scroll_cols(32);
- state->m_reel3_tilemap->set_scroll_cols(32);
+ m_reel1_tilemap->set_scroll_cols(32);
+ m_reel2_tilemap->set_scroll_cols(32);
+ m_reel3_tilemap->set_scroll_cols(32);
- state->m_cmaster_girl_num = 0;
- state->m_cmaster_girl_pal = 0;
- state->m_unkch_vidreg = 0x00;
+ m_cmaster_girl_num = 0;
+ m_cmaster_girl_pal = 0;
+ m_unkch_vidreg = 0x00;
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_cherrym_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_cherrym_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8, 64, 32);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_cm_enable_reg = 0x0b;
+ m_cm_enable_reg = 0x0b;
}
-VIDEO_START( cherrym )
+VIDEO_START_MEMBER(goldstar_state,cherrym)
{
- goldstar_state *state = machine.driver_data<goldstar_state>();
- state->m_reel1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel1_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel2_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel3_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel3_tile_info),state),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel1_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel2_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
+ m_reel3_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_goldstar_reel3_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 8);
- state->m_reel1_tilemap->set_scroll_cols(64);
- state->m_reel2_tilemap->set_scroll_cols(64);
- state->m_reel3_tilemap->set_scroll_cols(64);
+ m_reel1_tilemap->set_scroll_cols(64);
+ m_reel2_tilemap->set_scroll_cols(64);
+ m_reel3_tilemap->set_scroll_cols(64);
- state->m_cmaster_girl_num = 0;
- state->m_cmaster_girl_pal = 0;
+ m_cmaster_girl_num = 0;
+ m_cmaster_girl_pal = 0;
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_cherrym_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(goldstar_state::get_cherrym_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8, 64, 32);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_cm_enable_reg = 0x0b;
+ m_cm_enable_reg = 0x0b;
}
diff --git a/src/mame/video/gomoku.c b/src/mame/video/gomoku.c
index abcbb4a8608..623534c7865 100644
--- a/src/mame/video/gomoku.c
+++ b/src/mame/video/gomoku.c
@@ -18,13 +18,13 @@
******************************************************************************/
-PALETTE_INIT( gomoku )
+void gomoku_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
int bit0, bit1, bit2, r, g, b;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
/* red component */
bit0 = (*color_prom >> 0) & 0x01;
@@ -42,7 +42,7 @@ PALETTE_INIT( gomoku )
bit2 = (*color_prom >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine,i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(),i, MAKE_RGB(r, g, b));
color_prom++;
}
}
@@ -102,24 +102,23 @@ WRITE8_MEMBER(gomoku_state::gomoku_bg_dispsw_w)
******************************************************************************/
-VIDEO_START( gomoku )
+void gomoku_state::video_start()
{
- gomoku_state *state = machine.driver_data<gomoku_state>();
- UINT8 *GOMOKU_BG_X = state->memregion( "user1" )->base();
- UINT8 *GOMOKU_BG_Y = state->memregion( "user2" )->base();
- UINT8 *GOMOKU_BG_D = state->memregion( "user3" )->base();
+ UINT8 *GOMOKU_BG_X = memregion( "user1" )->base();
+ UINT8 *GOMOKU_BG_Y = memregion( "user2" )->base();
+ UINT8 *GOMOKU_BG_D = memregion( "user3" )->base();
int x, y;
int bgdata;
int color;
- machine.primary_screen->register_screen_bitmap(state->m_bg_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_bg_bitmap);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gomoku_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gomoku_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
/* make background bitmap */
- state->m_bg_bitmap.fill(0x20);
+ m_bg_bitmap.fill(0x20);
// board
for (y = 0; y < 256; y++)
@@ -133,7 +132,7 @@ VIDEO_START( gomoku )
if (bgdata & 0x01) color = 0x21; // board (brown)
if (bgdata & 0x02) color = 0x20; // frame line (while)
- state->m_bg_bitmap.pix16((255 - y - 1) & 0xff, (255 - x + 7) & 0xff) = color;
+ m_bg_bitmap.pix16((255 - y - 1) & 0xff, (255 - x + 7) & 0xff) = color;
}
}
}
diff --git a/src/mame/video/gotcha.c b/src/mame/video/gotcha.c
index 41d9dea58fa..e6a5c44a22b 100644
--- a/src/mame/video/gotcha.c
+++ b/src/mame/video/gotcha.c
@@ -40,16 +40,15 @@ TILE_GET_INFO_MEMBER(gotcha_state::bg_get_tile_info)
***************************************************************************/
-VIDEO_START( gotcha )
+void gotcha_state::video_start()
{
- gotcha_state *state = machine.driver_data<gotcha_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gotcha_state::fg_get_tile_info),state), tilemap_mapper_delegate(FUNC(gotcha_state::gotcha_tilemap_scan),state), 16, 16, 64, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gotcha_state::bg_get_tile_info),state), tilemap_mapper_delegate(FUNC(gotcha_state::gotcha_tilemap_scan),state), 16, 16, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gotcha_state::fg_get_tile_info),this), tilemap_mapper_delegate(FUNC(gotcha_state::gotcha_tilemap_scan),this), 16, 16, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gotcha_state::bg_get_tile_info),this), tilemap_mapper_delegate(FUNC(gotcha_state::gotcha_tilemap_scan),this), 16, 16, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scrolldx(-1, 0);
- state->m_bg_tilemap->set_scrolldx(-5, 0);
+ m_fg_tilemap->set_scrolldx(-1, 0);
+ m_bg_tilemap->set_scrolldx(-5, 0);
}
diff --git a/src/mame/video/gottlieb.c b/src/mame/video/gottlieb.c
index e2fb6f60649..39ab5989ed1 100644
--- a/src/mame/video/gottlieb.c
+++ b/src/mame/video/gottlieb.c
@@ -142,58 +142,56 @@ TILE_GET_INFO_MEMBER(gottlieb_state::get_screwloo_bg_tile_info)
}
-VIDEO_START( gottlieb )
+void gottlieb_state::video_start()
{
- gottlieb_state *state = machine.driver_data<gottlieb_state>();
static const int resistances[4] = { 2000, 1000, 470, 240 };
/* compute palette information */
/* note that there really are pullup/pulldown resistors, but this situation is complicated */
/* by the use of transistors, so we ignore that and just use the realtive resistor weights */
compute_resistor_weights(0, 255, -1.0,
- 4, resistances, state->m_weights, 180, 0,
- 4, resistances, state->m_weights, 180, 0,
- 4, resistances, state->m_weights, 180, 0);
- state->m_transparent0 = FALSE;
+ 4, resistances, m_weights, 180, 0,
+ 4, resistances, m_weights, 180, 0,
+ 4, resistances, m_weights, 180, 0);
+ m_transparent0 = FALSE;
/* configure the background tilemap */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gottlieb_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(0, 318 - 256);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gottlieb_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scrolldx(0, 318 - 256);
- machine.gfx[0]->set_source(state->m_charram);
+ machine().gfx[0]->set_source(m_charram);
/* save some state */
- state_save_register_global(machine, state->m_background_priority);
- state_save_register_global(machine, state->m_spritebank);
- state_save_register_global(machine, state->m_transparent0);
+ state_save_register_global(machine(), m_background_priority);
+ state_save_register_global(machine(), m_spritebank);
+ state_save_register_global(machine(), m_transparent0);
}
-VIDEO_START( screwloo )
+VIDEO_START_MEMBER(gottlieb_state,screwloo)
{
- gottlieb_state *state = machine.driver_data<gottlieb_state>();
static const int resistances[4] = { 2000, 1000, 470, 240 };
/* compute palette information */
/* note that there really are pullup/pulldown resistors, but this situation is complicated */
/* by the use of transistors, so we ignore that and just use the realtive resistor weights */
compute_resistor_weights(0, 255, -1.0,
- 4, resistances, state->m_weights, 180, 0,
- 4, resistances, state->m_weights, 180, 0,
- 4, resistances, state->m_weights, 180, 0);
- state->m_transparent0 = FALSE;
+ 4, resistances, m_weights, 180, 0,
+ 4, resistances, m_weights, 180, 0,
+ 4, resistances, m_weights, 180, 0);
+ m_transparent0 = FALSE;
/* configure the background tilemap */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gottlieb_state::get_screwloo_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(0, 318 - 256);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gottlieb_state::get_screwloo_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scrolldx(0, 318 - 256);
- machine.gfx[0]->set_source(state->m_charram);
+ machine().gfx[0]->set_source(m_charram);
/* save some state */
- state_save_register_global(machine, state->m_background_priority);
- state_save_register_global(machine, state->m_spritebank);
- state_save_register_global(machine, state->m_transparent0);
+ state_save_register_global(machine(), m_background_priority);
+ state_save_register_global(machine(), m_spritebank);
+ state_save_register_global(machine(), m_transparent0);
}
diff --git a/src/mame/video/gotya.c b/src/mame/video/gotya.c
index 2cb82948268..f330dc2e17f 100644
--- a/src/mame/video/gotya.c
+++ b/src/mame/video/gotya.c
@@ -9,9 +9,9 @@
***************************************************************************/
-PALETTE_INIT( gotya )
+void gotya_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -24,7 +24,7 @@ PALETTE_INIT( gotya )
2, &resistances_b[0], bweights, 0, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 32);
+ machine().colortable = colortable_alloc(machine(), 32);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -49,7 +49,7 @@ PALETTE_INIT( gotya )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -58,7 +58,7 @@ PALETTE_INIT( gotya )
for (i = 0; i < 0x40; i++)
{
UINT8 ctabentry = color_prom[i] & 0x07;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -106,10 +106,9 @@ TILEMAP_MAPPER_MEMBER(gotya_state::tilemap_scan_rows_thehand)
return ((row) * (num_cols >> 1)) + (col & 31) + ((col >> 5) * 0x400);
}
-VIDEO_START( gotya )
+void gotya_state::video_start()
{
- gotya_state *state = machine.driver_data<gotya_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gotya_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(gotya_state::tilemap_scan_rows_thehand),state), 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gotya_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(gotya_state::tilemap_scan_rows_thehand),this), 8, 8, 64, 32);
}
static void draw_status_row( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int sx, int col )
diff --git a/src/mame/video/gradius3.c b/src/mame/video/gradius3.c
index c55c029cf12..6745b7617d1 100644
--- a/src/mame/video/gradius3.c
+++ b/src/mame/video/gradius3.c
@@ -68,27 +68,26 @@ static void gradius3_postload(running_machine &machine)
}
}
-VIDEO_START( gradius3 )
+void gradius3_state::video_start()
{
- gradius3_state *state = machine.driver_data<gradius3_state>();
int i;
- state->m_layer_colorbase[0] = 0;
- state->m_layer_colorbase[1] = 32;
- state->m_layer_colorbase[2] = 48;
- state->m_sprite_colorbase = 16;
+ m_layer_colorbase[0] = 0;
+ m_layer_colorbase[1] = 32;
+ m_layer_colorbase[2] = 48;
+ m_sprite_colorbase = 16;
- k052109_set_layer_offsets(state->m_k052109, 2, -2, 0);
- k051960_set_sprite_offsets(state->m_k051960, 2, 0);
+ k052109_set_layer_offsets(m_k052109, 2, -2, 0);
+ k051960_set_sprite_offsets(m_k051960, 2, 0);
/* re-decode the sprites because the ROMs are connected to the custom IC differently
from how they are connected to the CPU. */
for (i = 0; i < TOTAL_SPRITES; i++)
- machine.gfx[1]->mark_dirty(i);
+ machine().gfx[1]->mark_dirty(i);
- machine.gfx[0]->set_source((UINT8 *)state->m_gfxram.target());
+ machine().gfx[0]->set_source((UINT8 *)m_gfxram.target());
- machine.save().register_postload(save_prepost_delegate(FUNC(gradius3_postload), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(gradius3_postload), &machine()));
}
diff --git a/src/mame/video/grchamp.c b/src/mame/video/grchamp.c
index 44fdee2bcd9..98bda17ee7e 100644
--- a/src/mame/video/grchamp.c
+++ b/src/mame/video/grchamp.c
@@ -12,12 +12,11 @@
#define RGB_MAX 191
-PALETTE_INIT( grchamp )
+void grchamp_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[3] = { 100, 270, 470 };
double rweights[3], gweights[3], bweights[2];
- grchamp_state *state = machine.driver_data<grchamp_state>();
int i;
/* compute the color output resistor weights */
@@ -48,7 +47,7 @@ PALETTE_INIT( grchamp )
bit1 = (color_prom[i] >> 7) & 1;
b = combine_2_weights(bweights, bit0, bit1);
- state->m_bgcolor[i] = MAKE_RGB(r, g, b);
+ m_bgcolor[i] = MAKE_RGB(r, g, b);
}
}
@@ -97,17 +96,16 @@ TILEMAP_MAPPER_MEMBER(grchamp_state::get_memory_offset)
}
-VIDEO_START( grchamp )
+void grchamp_state::video_start()
{
- grchamp_state *state = machine.driver_data<grchamp_state>();
- state->m_work_bitmap.allocate(32,32);
+ m_work_bitmap.allocate(32,32);
/* allocate tilemaps for each of the three sections */
- state->m_text_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(grchamp_state::get_text_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32);
- state->m_left_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(grchamp_state::get_left_tile_info),state), tilemap_mapper_delegate(FUNC(grchamp_state::get_memory_offset),state), 8,8, 64,32);
- state->m_right_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(grchamp_state::get_right_tile_info),state), tilemap_mapper_delegate(FUNC(grchamp_state::get_memory_offset),state), 8,8, 64,32);
- state->m_center_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(grchamp_state::get_center_tile_info),state), tilemap_mapper_delegate(FUNC(grchamp_state::get_memory_offset),state), 8,8, 64,32);
+ m_text_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(grchamp_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
+ m_left_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(grchamp_state::get_left_tile_info),this), tilemap_mapper_delegate(FUNC(grchamp_state::get_memory_offset),this), 8,8, 64,32);
+ m_right_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(grchamp_state::get_right_tile_info),this), tilemap_mapper_delegate(FUNC(grchamp_state::get_memory_offset),this), 8,8, 64,32);
+ m_center_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(grchamp_state::get_center_tile_info),this), tilemap_mapper_delegate(FUNC(grchamp_state::get_memory_offset),this), 8,8, 64,32);
}
#if 0
diff --git a/src/mame/video/gridlee.c b/src/mame/video/gridlee.c
index 572979ff831..06ea150c48a 100644
--- a/src/mame/video/gridlee.c
+++ b/src/mame/video/gridlee.c
@@ -18,14 +18,14 @@
*
*************************************/
-PALETTE_INIT( gridlee )
+void gridlee_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
- palette_set_color_rgb(machine,i,pal4bit(color_prom[0x0000]),pal4bit(color_prom[0x0800]),pal4bit(color_prom[0x1000]));
+ palette_set_color_rgb(machine(),i,pal4bit(color_prom[0x0000]),pal4bit(color_prom[0x0800]),pal4bit(color_prom[0x1000]));
color_prom++;
}
}
@@ -59,18 +59,17 @@ static void expand_pixels(running_machine &machine)
*
*************************************/
-VIDEO_START( gridlee )
+void gridlee_state::video_start()
{
- gridlee_state *state = machine.driver_data<gridlee_state>();
/* allocate a local copy of video RAM */
- state->m_local_videoram = auto_alloc_array_clear(machine, UINT8, 256 * 256);
+ m_local_videoram = auto_alloc_array_clear(machine(), UINT8, 256 * 256);
/* reset the palette */
- state->m_palettebank_vis = 0;
+ m_palettebank_vis = 0;
- state_save_register_global(machine, state->m_cocktail_flip);
- state_save_register_global(machine, state->m_palettebank_vis);
- machine.save().register_postload(save_prepost_delegate(FUNC(expand_pixels), &machine));
+ state_save_register_global(machine(), m_cocktail_flip);
+ state_save_register_global(machine(), m_palettebank_vis);
+ machine().save().register_postload(save_prepost_delegate(FUNC(expand_pixels), &machine()));
}
diff --git a/src/mame/video/groundfx.c b/src/mame/video/groundfx.c
index 3f52b420fc5..b96347dfe72 100644
--- a/src/mame/video/groundfx.c
+++ b/src/mame/video/groundfx.c
@@ -4,13 +4,12 @@
/******************************************************************/
-VIDEO_START( groundfx )
+void groundfx_state::video_start()
{
- groundfx_state *state = machine.driver_data<groundfx_state>();
- state->m_spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000);
+ m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x4000);
/* Hack */
- state->m_hack_cliprect.set(69, 250, 24 + 5, 24 + 44);
+ m_hack_cliprect.set(69, 250, 24 + 5, 24 + 44);
}
/***************************************************************
diff --git a/src/mame/video/gstriker.c b/src/mame/video/gstriker.c
index 00c775ba3eb..711a15204c2 100644
--- a/src/mame/video/gstriker.c
+++ b/src/mame/video/gstriker.c
@@ -556,77 +556,74 @@ SCREEN_UPDATE_IND16(gstriker)
return 0;
}
-VIDEO_START(gstriker)
+VIDEO_START_MEMBER(gstriker_state,gstriker)
{
- gstriker_state *state = machine.driver_data<gstriker_state>();
// Palette bases are hardcoded, but should be probably extracted from the mixer registers
// Initalize the chip for the score plane
- VS920A_init(machine, 1);
- VS920A_set_gfx_region(state, 0, 0);
- VS920A_set_pal_base(state, 0, 0x30);
- VS920A_get_tilemap(state, 0)->set_transparent_pen(0xf);
+ VS920A_init(machine(), 1);
+ VS920A_set_gfx_region(this, 0, 0);
+ VS920A_set_pal_base(this, 0, 0x30);
+ VS920A_get_tilemap(this, 0)->set_transparent_pen(0xf);
// Initalize the chip for the screen plane
- MB60553_init(machine, 1);
- MB60553_set_gfx_region(state, 0, 1);
- MB60553_set_pal_base(state, 0, 0);
- MB60553_get_tilemap(state, 0)->set_transparent_pen(0xf);
+ MB60553_init(machine(), 1);
+ MB60553_set_gfx_region(this, 0, 1);
+ MB60553_set_pal_base(this, 0, 0);
+ MB60553_get_tilemap(this, 0)->set_transparent_pen(0xf);
// Initialize the sprite generator
CG10103_init(1);
- CG10103_set_gfx_region(state, 0, 2);
- CG10103_set_pal_base(state, 0, 0x10);
- CG10103_set_transpen(state, 0, 0x0);
+ CG10103_set_gfx_region(this, 0, 2);
+ CG10103_set_pal_base(this, 0, 0x10);
+ CG10103_set_transpen(this, 0, 0x0);
}
-VIDEO_START(twrldc94)
+VIDEO_START_MEMBER(gstriker_state,twrldc94)
{
- gstriker_state *state = machine.driver_data<gstriker_state>();
// Palette bases are hardcoded, but should be probably extracted from the mixer registers
// Initalize the chip for the score plane
- VS920A_init(machine, 1);
- VS920A_set_gfx_region(state, 0, 0);
- VS920A_set_pal_base(state, 0, 0x40);
- VS920A_get_tilemap(state, 0)->set_transparent_pen(0xf);
+ VS920A_init(machine(), 1);
+ VS920A_set_gfx_region(this, 0, 0);
+ VS920A_set_pal_base(this, 0, 0x40);
+ VS920A_get_tilemap(this, 0)->set_transparent_pen(0xf);
// Initalize the chip for the screen plane
- MB60553_init(machine, 1);
- MB60553_set_gfx_region(state, 0, 1);
- MB60553_set_pal_base(state, 0, 0x50);
- MB60553_get_tilemap(state, 0)->set_transparent_pen(0xf);
+ MB60553_init(machine(), 1);
+ MB60553_set_gfx_region(this, 0, 1);
+ MB60553_set_pal_base(this, 0, 0x50);
+ MB60553_get_tilemap(this, 0)->set_transparent_pen(0xf);
// Initialize the sprite generator
CG10103_init(1);
- CG10103_set_gfx_region(state, 0, 2);
- CG10103_set_pal_base(state, 0, 0x60);
- CG10103_set_transpen(state, 0, 0x0);
+ CG10103_set_gfx_region(this, 0, 2);
+ CG10103_set_pal_base(this, 0, 0x60);
+ CG10103_set_transpen(this, 0, 0x0);
}
-VIDEO_START(vgoalsoc)
+VIDEO_START_MEMBER(gstriker_state,vgoalsoc)
{
- gstriker_state *state = machine.driver_data<gstriker_state>();
// Palette bases are hardcoded, but should be probably extracted from the mixer registers
// Initalize the chip for the score plane
- VS920A_init(machine, 1);
- VS920A_set_gfx_region(state, 0, 0);
- VS920A_set_pal_base(state, 0, 0x30);
- VS920A_get_tilemap(state, 0)->set_transparent_pen(0xf);
+ VS920A_init(machine(), 1);
+ VS920A_set_gfx_region(this, 0, 0);
+ VS920A_set_pal_base(this, 0, 0x30);
+ VS920A_get_tilemap(this, 0)->set_transparent_pen(0xf);
// Initalize the chip for the screen plane
- MB60553_init(machine, 1);
- MB60553_set_gfx_region(state, 0, 1);
- MB60553_set_pal_base(state, 0, 0x20);
- MB60553_get_tilemap(state, 0)->set_transparent_pen(0xf);
+ MB60553_init(machine(), 1);
+ MB60553_set_gfx_region(this, 0, 1);
+ MB60553_set_pal_base(this, 0, 0x20);
+ MB60553_get_tilemap(this, 0)->set_transparent_pen(0xf);
// Initialize the sprite generator
CG10103_init(1);
- CG10103_set_gfx_region(state, 0, 2);
- CG10103_set_pal_base(state, 0, 0x00);
- CG10103_set_transpen(state, 0, 0xf);
+ CG10103_set_gfx_region(this, 0, 2);
+ CG10103_set_pal_base(this, 0, 0x00);
+ CG10103_set_transpen(this, 0, 0xf);
}
diff --git a/src/mame/video/gsword.c b/src/mame/video/gsword.c
index 9bd81d96e0b..5ca803b24e4 100644
--- a/src/mame/video/gsword.c
+++ b/src/mame/video/gsword.c
@@ -9,13 +9,13 @@
#include "includes/gsword.h"
-PALETTE_INIT( josvolly )
+PALETTE_INIT_MEMBER(gsword_state,josvolly)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -24,7 +24,7 @@ PALETTE_INIT( josvolly )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -32,24 +32,24 @@ PALETTE_INIT( josvolly )
/* characters */
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprites */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (BITSWAP8(color_prom[i - 0x100],7,6,5,4,0,1,2,3) & 0x0f) | 0x80;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
-PALETTE_INIT( gsword )
+PALETTE_INIT_MEMBER(gsword_state,gsword)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -75,7 +75,7 @@ PALETTE_INIT( gsword )
bit2 = (color_prom[i + 0x000] >> 3) & 1;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -83,13 +83,13 @@ PALETTE_INIT( gsword )
/* characters */
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprites */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (BITSWAP8(color_prom[i - 0x100],7,6,5,4,0,1,2,3) & 0x0f) | 0x80;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -152,10 +152,9 @@ TILE_GET_INFO_MEMBER(gsword_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( gsword )
+void gsword_state::video_start()
{
- gsword_state *state = machine.driver_data<gsword_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gsword_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gsword_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 64);
}
diff --git a/src/mame/video/gumbo.c b/src/mame/video/gumbo.c
index a7d59fa81e8..6547e1193ff 100644
--- a/src/mame/video/gumbo.c
+++ b/src/mame/video/gumbo.c
@@ -30,12 +30,11 @@ TILE_GET_INFO_MEMBER(gumbo_state::get_gumbo_fg_tile_info)
}
-VIDEO_START( gumbo )
+void gumbo_state::video_start()
{
- gumbo_state *state = machine.driver_data<gumbo_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gumbo_state::get_gumbo_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gumbo_state::get_gumbo_fg_tile_info),state), TILEMAP_SCAN_ROWS, 4, 4, 128, 64);
- state->m_fg_tilemap->set_transparent_pen(0xff);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gumbo_state::get_gumbo_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gumbo_state::get_gumbo_fg_tile_info),this), TILEMAP_SCAN_ROWS, 4, 4, 128, 64);
+ m_fg_tilemap->set_transparent_pen(0xff);
}
SCREEN_UPDATE_IND16( gumbo )
diff --git a/src/mame/video/gunbustr.c b/src/mame/video/gunbustr.c
index 6fb0b8bfacc..1f9f6f9afc2 100644
--- a/src/mame/video/gunbustr.c
+++ b/src/mame/video/gunbustr.c
@@ -4,10 +4,9 @@
/************************************************************/
-VIDEO_START( gunbustr )
+void gunbustr_state::video_start()
{
- gunbustr_state *state = machine.driver_data<gunbustr_state>();
- state->m_spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000);
+ m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x4000);
}
/************************************************************
diff --git a/src/mame/video/gundealr.c b/src/mame/video/gundealr.c
index b880b765ee6..327086d35e1 100644
--- a/src/mame/video/gundealr.c
+++ b/src/mame/video/gundealr.c
@@ -50,13 +50,12 @@ TILE_GET_INFO_MEMBER(gundealr_state::get_fg_tile_info)
***************************************************************************/
-VIDEO_START( gundealr )
+void gundealr_state::video_start()
{
- gundealr_state *state = machine.driver_data<gundealr_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gundealr_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gundealr_state::get_fg_tile_info),state), tilemap_mapper_delegate(FUNC(gundealr_state::gundealr_scan),state), 16, 16, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gundealr_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gundealr_state::get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(gundealr_state::gundealr_scan),this), 16, 16, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
}
diff --git a/src/mame/video/gunsmoke.c b/src/mame/video/gunsmoke.c
index 2f332d383cf..c986db23f5c 100644
--- a/src/mame/video/gunsmoke.c
+++ b/src/mame/video/gunsmoke.c
@@ -16,13 +16,13 @@
***************************************************************************/
-PALETTE_INIT( gunsmoke )
+void gunsmoke_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -31,7 +31,7 @@ PALETTE_INIT( gunsmoke )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -41,21 +41,21 @@ PALETTE_INIT( gunsmoke )
for (i = 0; i < 0x80; i++)
{
UINT8 ctabentry = color_prom[i] | 0x40;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* background tiles use colors 0-0x3f */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x03) << 4);
- colortable_entry_set_value(machine.colortable, i - 0x80, ctabentry);
+ colortable_entry_set_value(machine().colortable, i - 0x80, ctabentry);
}
/* sprites use colors 0x80-0xff */
for (i = 0x300; i < 0x400; i++)
{
UINT8 ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x07) << 4) | 0x80;
- colortable_entry_set_value(machine.colortable, i - 0x180, ctabentry);
+ colortable_entry_set_value(machine().colortable, i - 0x180, ctabentry);
}
}
@@ -127,13 +127,12 @@ TILE_GET_INFO_MEMBER(gunsmoke_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( gunsmoke )
+void gunsmoke_state::video_start()
{
- gunsmoke_state *state = machine.driver_data<gunsmoke_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gunsmoke_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 32, 32, 2048, 8);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gunsmoke_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gunsmoke_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 32, 32, 2048, 8);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gunsmoke_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- colortable_configure_tilemap_groups(machine.colortable, state->m_fg_tilemap, machine.gfx[0], 0x4f);
+ colortable_configure_tilemap_groups(machine().colortable, m_fg_tilemap, machine().gfx[0], 0x4f);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/gyruss.c b/src/mame/video/gyruss.c
index d6546eb427c..485ee42cbac 100644
--- a/src/mame/video/gyruss.c
+++ b/src/mame/video/gyruss.c
@@ -29,9 +29,9 @@
***************************************************************************/
-PALETTE_INIT( gyruss )
+void gyruss_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double weights_rg[3], weights_b[2];
@@ -44,7 +44,7 @@ PALETTE_INIT( gyruss )
0, 0, 0, 0, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 32);
+ machine().colortable = colortable_alloc(machine(), 32);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( gyruss )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(weights_b, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -79,14 +79,14 @@ PALETTE_INIT( gyruss )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* characters map to the upper 16 palette entries */
for (i = 0x100; i < 0x140; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry + 0x10);
+ colortable_entry_set_value(machine().colortable, i, ctabentry + 0x10);
}
}
@@ -111,12 +111,11 @@ TILE_GET_INFO_MEMBER(gyruss_state::gyruss_get_tile_info)
}
-VIDEO_START( gyruss )
+void gyruss_state::video_start()
{
- gyruss_state *state = machine.driver_data<gyruss_state>();
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(gyruss_state::gyruss_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_tilemap->set_transmask(0, 0x00, 0); /* opaque */
- state->m_tilemap->set_transmask(1, 0x0f, 0); /* transparent */
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gyruss_state::gyruss_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_tilemap->set_transmask(0, 0x00, 0); /* opaque */
+ m_tilemap->set_transmask(1, 0x0f, 0); /* transparent */
}
diff --git a/src/mame/video/hanaawas.c b/src/mame/video/hanaawas.c
index ccb149717fe..93c9ccf4f92 100644
--- a/src/mame/video/hanaawas.c
+++ b/src/mame/video/hanaawas.c
@@ -15,13 +15,13 @@
***************************************************************************/
-PALETTE_INIT( hanaawas )
+void hanaawas_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x10);
+ machine().colortable = colortable_alloc(machine(), 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -47,7 +47,7 @@ PALETTE_INIT( hanaawas )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -59,7 +59,7 @@ PALETTE_INIT( hanaawas )
{
int swapped_i = BITSWAP8(i,2,7,6,5,4,3,1,0);
UINT8 ctabentry = color_prom[swapped_i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -101,10 +101,9 @@ TILE_GET_INFO_MEMBER(hanaawas_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(gfxbank, code, color, 0);
}
-VIDEO_START( hanaawas )
+void hanaawas_state::video_start()
{
- hanaawas_state *state = machine.driver_data<hanaawas_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hanaawas_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hanaawas_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
SCREEN_UPDATE_IND16( hanaawas )
diff --git a/src/mame/video/harddriv.c b/src/mame/video/harddriv.c
index d9e656811e4..124509f6a67 100644
--- a/src/mame/video/harddriv.c
+++ b/src/mame/video/harddriv.c
@@ -28,16 +28,15 @@
*
*************************************/
-VIDEO_START( harddriv )
+VIDEO_START_MEMBER(harddriv_state,harddriv)
{
- harddriv_state *state = machine.driver_data<harddriv_state>();
UINT32 *destmask, mask;
int i;
/* fill in the mask table */
- destmask = state->m_mask_table;
+ destmask = m_mask_table;
for (i = 0; i < 65536; i++)
- if (state->m_gsp_multisync)
+ if (m_gsp_multisync)
{
mask = 0;
if (i & 0x0001) mask |= MASK(0);
@@ -85,7 +84,7 @@ VIDEO_START( harddriv )
}
/* init VRAM pointers */
- state->m_vram_mask = state->m_gsp_vram.bytes() - 1;
+ m_vram_mask = m_gsp_vram.bytes() - 1;
}
diff --git a/src/mame/video/hcastle.c b/src/mame/video/hcastle.c
index f9e62cd8f65..4c0afd21359 100644
--- a/src/mame/video/hcastle.c
+++ b/src/mame/video/hcastle.c
@@ -9,13 +9,13 @@
#include "includes/hcastle.h"
-PALETTE_INIT( hcastle )
+void hcastle_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int chip;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x80);
+ machine().colortable = colortable_alloc(machine(), 0x80);
for (chip = 0; chip < 2; chip++)
{
@@ -35,7 +35,7 @@ PALETTE_INIT( hcastle )
else
ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
- colortable_entry_set_value(machine.colortable, (chip << 11) | (pal << 8) | i, ctabentry);
+ colortable_entry_set_value(machine().colortable, (chip << 11) | (pal << 8) | i, ctabentry);
}
}
}
@@ -127,14 +127,13 @@ TILE_GET_INFO_MEMBER(hcastle_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( hcastle )
+void hcastle_state::video_start()
{
- hcastle_state *state = machine.driver_data<hcastle_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hcastle_state::get_fg_tile_info),state), tilemap_mapper_delegate(FUNC(hcastle_state::tilemap_scan),state), 8, 8, 64, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hcastle_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(hcastle_state::tilemap_scan),state), 8, 8, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hcastle_state::get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(hcastle_state::tilemap_scan),this), 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hcastle_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(hcastle_state::tilemap_scan),this), 8, 8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/hexion.c b/src/mame/video/hexion.c
index 5b54ada764f..600aea90eac 100644
--- a/src/mame/video/hexion.c
+++ b/src/mame/video/hexion.c
@@ -38,19 +38,18 @@ TILE_GET_INFO_MEMBER(hexion_state::get_tile_info1)
***************************************************************************/
-VIDEO_START( hexion )
+void hexion_state::video_start()
{
- hexion_state *state = machine.driver_data<hexion_state>();
- state->m_bg_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hexion_state::get_tile_info0),state),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_bg_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hexion_state::get_tile_info1),state),TILEMAP_SCAN_ROWS, 8,8,64,32);
+ m_bg_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hexion_state::get_tile_info0),this),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hexion_state::get_tile_info1),this),TILEMAP_SCAN_ROWS, 8,8,64,32);
- state->m_bg_tilemap[0]->set_transparent_pen(0);
- state->m_bg_tilemap[1]->set_scrollx(0,-4);
- state->m_bg_tilemap[1]->set_scrolly(0,4);
+ m_bg_tilemap[0]->set_transparent_pen(0);
+ m_bg_tilemap[1]->set_scrollx(0,-4);
+ m_bg_tilemap[1]->set_scrolly(0,4);
- state->m_vram[0] = state->memregion("maincpu")->base() + 0x30000;
- state->m_vram[1] = state->m_vram[0] + 0x2000;
- state->m_unkram = state->m_vram[1] + 0x2000;
+ m_vram[0] = memregion("maincpu")->base() + 0x30000;
+ m_vram[1] = m_vram[0] + 0x2000;
+ m_unkram = m_vram[1] + 0x2000;
}
diff --git a/src/mame/video/higemaru.c b/src/mame/video/higemaru.c
index 5e24fe017c9..c53256a6380 100644
--- a/src/mame/video/higemaru.c
+++ b/src/mame/video/higemaru.c
@@ -19,13 +19,13 @@ WRITE8_MEMBER(higemaru_state::higemaru_colorram_w)
***************************************************************************/
-PALETTE_INIT( higemaru )
+void higemaru_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -51,7 +51,7 @@ PALETTE_INIT( higemaru )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -61,14 +61,14 @@ PALETTE_INIT( higemaru )
for (i = 0; i < 0x80; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites use colors 16-31 */
for (i = 0x80; i < 0x180; i++)
{
UINT8 ctabentry = (color_prom[i + 0x80] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -97,10 +97,9 @@ TILE_GET_INFO_MEMBER(higemaru_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( higemaru )
+void higemaru_state::video_start()
{
- higemaru_state *state = machine.driver_data<higemaru_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(higemaru_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(higemaru_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/himesiki.c b/src/mame/video/himesiki.c
index 060591965f6..76bed981fc7 100644
--- a/src/mame/video/himesiki.c
+++ b/src/mame/video/himesiki.c
@@ -20,10 +20,9 @@ TILE_GET_INFO_MEMBER(himesiki_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, col, 0);
}
-VIDEO_START( himesiki )
+void himesiki_state::video_start()
{
- himesiki_state *state = machine.driver_data<himesiki_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(himesiki_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(himesiki_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
}
WRITE8_MEMBER(himesiki_state::himesiki_bg_ram_w)
diff --git a/src/mame/video/hnayayoi.c b/src/mame/video/hnayayoi.c
index 336f4fa9d8f..bcb0193c465 100644
--- a/src/mame/video/hnayayoi.c
+++ b/src/mame/video/hnayayoi.c
@@ -30,30 +30,28 @@ static void common_vh_start( running_machine &machine, int num_pixmaps )
}
}
-VIDEO_START( hnayayoi )
+void hnayayoi_state::video_start()
{
- hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
- common_vh_start(machine, 4); /* 4 bitmaps -> 2 layers */
+ common_vh_start(machine(), 4); /* 4 bitmaps -> 2 layers */
- state->save_pointer(NAME(state->m_pixmap[0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[2]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[3]), 256 * 256);
+ save_pointer(NAME(m_pixmap[0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[2]), 256 * 256);
+ save_pointer(NAME(m_pixmap[3]), 256 * 256);
}
-VIDEO_START( untoucha )
+VIDEO_START_MEMBER(hnayayoi_state,untoucha)
{
- hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
- common_vh_start(machine, 8); /* 8 bitmaps -> 4 layers */
-
- state->save_pointer(NAME(state->m_pixmap[0]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[1]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[2]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[3]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[4]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[5]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[6]), 256 * 256);
- state->save_pointer(NAME(state->m_pixmap[7]), 256 * 256);
+ common_vh_start(machine(), 8); /* 8 bitmaps -> 4 layers */
+
+ save_pointer(NAME(m_pixmap[0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[2]), 256 * 256);
+ save_pointer(NAME(m_pixmap[3]), 256 * 256);
+ save_pointer(NAME(m_pixmap[4]), 256 * 256);
+ save_pointer(NAME(m_pixmap[5]), 256 * 256);
+ save_pointer(NAME(m_pixmap[6]), 256 * 256);
+ save_pointer(NAME(m_pixmap[7]), 256 * 256);
}
diff --git a/src/mame/video/hng64.c b/src/mame/video/hng64.c
index 226fe8c3038..ad5566d26da 100644
--- a/src/mame/video/hng64.c
+++ b/src/mame/video/hng64.c
@@ -1645,56 +1645,55 @@ SCREEN_VBLANK( hng64 )
clear3d(screen.machine());
}
-VIDEO_START( hng64 )
+void hng64_state::video_start()
{
- hng64_state *state = machine.driver_data<hng64_state>();
- const rectangle &visarea = machine.primary_screen->visible_area();
+ const rectangle &visarea = machine().primary_screen->visible_area();
- state->m_old_animmask = -1;
- state->m_old_animbits = -1;
- state->m_old_tileflags0 = -1;
- state->m_old_tileflags1 = -1;
- state->m_old_tileflags2 = -1;
- state->m_old_tileflags3 = -1;
+ m_old_animmask = -1;
+ m_old_animbits = -1;
+ m_old_tileflags0 = -1;
+ m_old_tileflags1 = -1;
+ m_old_tileflags2 = -1;
+ m_old_tileflags3 = -1;
- state->m_tilemap0_8x8 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile0_8x8_info),state), TILEMAP_SCAN_ROWS, 8, 8, 128, 128); /* 128x128x4 = 0x10000 */
- state->m_tilemap0_16x16 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile0_16x16_info),state), TILEMAP_SCAN_ROWS, 16, 16, 128, 128); /* 128x128x4 = 0x10000 */
- state->m_tilemap0_16x16_alt = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile0_16x16_info),state), TILEMAP_SCAN_ROWS, 16, 16, 256, 64); /* 128x128x4 = 0x10000 */
+ m_tilemap0_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile0_8x8_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 128); /* 128x128x4 = 0x10000 */
+ m_tilemap0_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile0_16x16_info),this), TILEMAP_SCAN_ROWS, 16, 16, 128, 128); /* 128x128x4 = 0x10000 */
+ m_tilemap0_16x16_alt = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile0_16x16_info),this), TILEMAP_SCAN_ROWS, 16, 16, 256, 64); /* 128x128x4 = 0x10000 */
- state->m_tilemap1_8x8 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile1_8x8_info),state), TILEMAP_SCAN_ROWS, 8, 8, 128, 128); /* 128x128x4 = 0x10000 */
- state->m_tilemap1_16x16 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile1_16x16_info),state), TILEMAP_SCAN_ROWS, 16, 16, 128, 128); /* 128x128x4 = 0x10000 */
- state->m_tilemap1_16x16_alt = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile1_16x16_info),state), TILEMAP_SCAN_ROWS, 16, 16, 256, 64); /* 128x128x4 = 0x10000 */
+ m_tilemap1_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile1_8x8_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 128); /* 128x128x4 = 0x10000 */
+ m_tilemap1_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile1_16x16_info),this), TILEMAP_SCAN_ROWS, 16, 16, 128, 128); /* 128x128x4 = 0x10000 */
+ m_tilemap1_16x16_alt = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile1_16x16_info),this), TILEMAP_SCAN_ROWS, 16, 16, 256, 64); /* 128x128x4 = 0x10000 */
- state->m_tilemap2_8x8 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile2_8x8_info),state), TILEMAP_SCAN_ROWS, 8, 8, 128, 128); /* 128x128x4 = 0x10000 */
- state->m_tilemap2_16x16 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile2_16x16_info),state), TILEMAP_SCAN_ROWS, 16, 16, 128, 128); /* 128x128x4 = 0x10000 */
- state->m_tilemap2_16x16_alt = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile2_16x16_info),state), TILEMAP_SCAN_ROWS, 16, 16, 256, 64); /* 128x128x4 = 0x10000 */
+ m_tilemap2_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile2_8x8_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 128); /* 128x128x4 = 0x10000 */
+ m_tilemap2_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile2_16x16_info),this), TILEMAP_SCAN_ROWS, 16, 16, 128, 128); /* 128x128x4 = 0x10000 */
+ m_tilemap2_16x16_alt = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile2_16x16_info),this), TILEMAP_SCAN_ROWS, 16, 16, 256, 64); /* 128x128x4 = 0x10000 */
- state->m_tilemap3_8x8 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile3_8x8_info),state), TILEMAP_SCAN_ROWS, 8, 8, 128, 128); /* 128x128x4 = 0x10000 */
- state->m_tilemap3_16x16 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile3_16x16_info),state), TILEMAP_SCAN_ROWS, 16, 16, 128, 128); /* 128x128x4 = 0x10000 */
- state->m_tilemap3_16x16_alt = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile3_16x16_info),state), TILEMAP_SCAN_ROWS, 16, 16, 256, 64); /* 128x128x4 = 0x10000 */
+ m_tilemap3_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile3_8x8_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 128); /* 128x128x4 = 0x10000 */
+ m_tilemap3_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile3_16x16_info),this), TILEMAP_SCAN_ROWS, 16, 16, 128, 128); /* 128x128x4 = 0x10000 */
+ m_tilemap3_16x16_alt = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hng64_state::get_hng64_tile3_16x16_info),this), TILEMAP_SCAN_ROWS, 16, 16, 256, 64); /* 128x128x4 = 0x10000 */
- state->m_tilemap0_8x8->set_transparent_pen(0);
- state->m_tilemap0_16x16->set_transparent_pen(0);
- state->m_tilemap0_16x16_alt->set_transparent_pen(0);
+ m_tilemap0_8x8->set_transparent_pen(0);
+ m_tilemap0_16x16->set_transparent_pen(0);
+ m_tilemap0_16x16_alt->set_transparent_pen(0);
- state->m_tilemap1_8x8->set_transparent_pen(0);
- state->m_tilemap1_16x16->set_transparent_pen(0);
- state->m_tilemap1_16x16_alt->set_transparent_pen(0);
+ m_tilemap1_8x8->set_transparent_pen(0);
+ m_tilemap1_16x16->set_transparent_pen(0);
+ m_tilemap1_16x16_alt->set_transparent_pen(0);
- state->m_tilemap2_8x8->set_transparent_pen(0);
- state->m_tilemap2_16x16->set_transparent_pen(0);
- state->m_tilemap2_16x16_alt->set_transparent_pen(0);
+ m_tilemap2_8x8->set_transparent_pen(0);
+ m_tilemap2_16x16->set_transparent_pen(0);
+ m_tilemap2_16x16_alt->set_transparent_pen(0);
- state->m_tilemap3_8x8->set_transparent_pen(0);
- state->m_tilemap3_16x16->set_transparent_pen(0);
- state->m_tilemap3_16x16_alt->set_transparent_pen(0);
+ m_tilemap3_8x8->set_transparent_pen(0);
+ m_tilemap3_16x16->set_transparent_pen(0);
+ m_tilemap3_16x16_alt->set_transparent_pen(0);
// Debug switch, turn on / off additive blending on a per-tilemap basis
- state->m_additive_tilemap_debug = 0;
+ m_additive_tilemap_debug = 0;
// 3d Buffer Allocation
- state->m_depthBuffer3d = auto_alloc_array(machine, float, (visarea.max_x + 1)*(visarea.max_y + 1));
- state->m_colorBuffer3d = auto_alloc_array(machine, UINT32, (visarea.max_x + 1)*(visarea.max_y + 1));
+ m_depthBuffer3d = auto_alloc_array(machine(), float, (visarea.max_x + 1)*(visarea.max_y + 1));
+ m_colorBuffer3d = auto_alloc_array(machine(), UINT32, (visarea.max_x + 1)*(visarea.max_y + 1));
}
diff --git a/src/mame/video/holeland.c b/src/mame/video/holeland.c
index 4e5325a88e3..a9f6df7ae82 100644
--- a/src/mame/video/holeland.c
+++ b/src/mame/video/holeland.c
@@ -52,19 +52,17 @@ TILE_GET_INFO_MEMBER(holeland_state::crzrally_get_tile_info)
***************************************************************************/
-VIDEO_START( holeland )
+VIDEO_START_MEMBER(holeland_state,holeland)
{
- holeland_state *state = machine.driver_data<holeland_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(holeland_state::holeland_get_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(holeland_state::holeland_get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_bg_tilemap->set_transmask(0, 0xff, 0x00); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x01, 0xfe); /* split type 1 has pen 0? transparent in front half */
+ m_bg_tilemap->set_transmask(0, 0xff, 0x00); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x01, 0xfe); /* split type 1 has pen 0? transparent in front half */
}
-VIDEO_START( crzrally )
+VIDEO_START_MEMBER(holeland_state,crzrally)
{
- holeland_state *state = machine.driver_data<holeland_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(holeland_state::crzrally_get_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(holeland_state::crzrally_get_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
}
WRITE8_MEMBER(holeland_state::holeland_videoram_w)
diff --git a/src/mame/video/homedata.c b/src/mame/video/homedata.c
index 4073a875133..4487b70633d 100644
--- a/src/mame/video/homedata.c
+++ b/src/mame/video/homedata.c
@@ -313,9 +313,9 @@ finish:
***************************************************************************/
-PALETTE_INIT( mrokumei )
+PALETTE_INIT_MEMBER(homedata_state,mrokumei)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* initialize 555 RGB palette */
@@ -332,13 +332,13 @@ PALETTE_INIT( mrokumei )
g = ((color >> 7) & 0x1e) | ((color >> 2) & 1);
b = ((color >> 3) & 0x1e) | ((color >> 1) & 1);
- palette_set_color_rgb(machine, i, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(machine(), i, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
-PALETTE_INIT( reikaids )
+PALETTE_INIT_MEMBER(homedata_state,reikaids)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* initialize 555 RGB palette */
@@ -355,13 +355,13 @@ PALETTE_INIT( reikaids )
r = ((color >> 7) & 0x1e) | ((color >> 2) & 1);
b = ((color >> 3) & 0x1e) | ((color >> 1) & 1);
- palette_set_color_rgb(machine, i, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(machine(), i, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
-PALETTE_INIT( pteacher )
+PALETTE_INIT_MEMBER(homedata_state,pteacher)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* initialize 555 RGB palette */
@@ -378,13 +378,13 @@ PALETTE_INIT( pteacher )
r = ((color >> 6) & 0x1f);
b = ((color >> 1) & 0x1f);
- palette_set_color_rgb(machine, i, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(machine(), i, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
-PALETTE_INIT( mirderby )
+PALETTE_INIT_MEMBER(homedata_state,mirderby)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0x100; i++)
@@ -394,7 +394,7 @@ PALETTE_INIT( mirderby )
g = color_prom[0x100+i];
b = color_prom[0x200+i];
- palette_set_color_rgb(machine,i,pal4bit(r),pal4bit(g),pal4bit(b));
+ palette_set_color_rgb(machine(),i,pal4bit(r),pal4bit(g),pal4bit(b));
}
}
@@ -623,74 +623,69 @@ TILE_GET_INFO_MEMBER(homedata_state::mirderby_get_info1_1)
***************************************************************************/
-VIDEO_START( mrokumei )
+VIDEO_START_MEMBER(homedata_state,mrokumei)
{
- homedata_state *state = machine.driver_data<homedata_state>();
- state->m_bg_tilemap[0][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mrokumei_get_info0_0),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
- state->m_bg_tilemap[0][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mrokumei_get_info0_1),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
- state->m_bg_tilemap[1][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mrokumei_get_info1_0),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
- state->m_bg_tilemap[1][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mrokumei_get_info1_1),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
+ m_bg_tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mrokumei_get_info0_0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
+ m_bg_tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mrokumei_get_info0_1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
+ m_bg_tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mrokumei_get_info1_0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
+ m_bg_tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mrokumei_get_info1_1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
- state->m_bg_tilemap[0][1]->set_transparent_pen(0);
- state->m_bg_tilemap[1][1]->set_transparent_pen(0);
+ m_bg_tilemap[0][1]->set_transparent_pen(0);
+ m_bg_tilemap[1][1]->set_transparent_pen(0);
}
-VIDEO_START( reikaids )
+VIDEO_START_MEMBER(homedata_state,reikaids)
{
- homedata_state *state = machine.driver_data<homedata_state>();
- state->m_bg_tilemap[0][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info0_0),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap[0][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info0_1),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap[0][2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info0_2),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap[0][3] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info0_3),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap[1][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info1_0),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap[1][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info1_1),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap[1][2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info1_2),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap[1][3] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info1_3),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
-
- state->m_bg_tilemap[0][0]->set_transparent_pen(0xff);
- state->m_bg_tilemap[0][1]->set_transparent_pen(0xff);
- state->m_bg_tilemap[0][2]->set_transparent_pen(0xff);
- state->m_bg_tilemap[0][3]->set_transparent_pen(0xff);
- state->m_bg_tilemap[1][0]->set_transparent_pen(0xff);
- state->m_bg_tilemap[1][1]->set_transparent_pen(0xff);
- state->m_bg_tilemap[1][2]->set_transparent_pen(0xff);
- state->m_bg_tilemap[1][3]->set_transparent_pen(0xff);
+ m_bg_tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info0_0),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info0_1),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap[0][2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info0_2),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap[0][3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info0_3),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info1_0),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info1_1),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap[1][2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info1_2),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap[1][3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::reikaids_get_info1_3),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+
+ m_bg_tilemap[0][0]->set_transparent_pen(0xff);
+ m_bg_tilemap[0][1]->set_transparent_pen(0xff);
+ m_bg_tilemap[0][2]->set_transparent_pen(0xff);
+ m_bg_tilemap[0][3]->set_transparent_pen(0xff);
+ m_bg_tilemap[1][0]->set_transparent_pen(0xff);
+ m_bg_tilemap[1][1]->set_transparent_pen(0xff);
+ m_bg_tilemap[1][2]->set_transparent_pen(0xff);
+ m_bg_tilemap[1][3]->set_transparent_pen(0xff);
}
-VIDEO_START( pteacher )
+VIDEO_START_MEMBER(homedata_state,pteacher)
{
- homedata_state *state = machine.driver_data<homedata_state>();
- state->m_bg_tilemap[0][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::pteacher_get_info0_0),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap[0][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::pteacher_get_info0_1),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap[1][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::pteacher_get_info1_0),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap[1][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::pteacher_get_info1_1),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::pteacher_get_info0_0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::pteacher_get_info0_1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::pteacher_get_info1_0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::pteacher_get_info1_1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap[0][1]->set_transparent_pen(0xff);
- state->m_bg_tilemap[1][1]->set_transparent_pen(0xff);
+ m_bg_tilemap[0][1]->set_transparent_pen(0xff);
+ m_bg_tilemap[1][1]->set_transparent_pen(0xff);
}
-VIDEO_START( lemnangl )
+VIDEO_START_MEMBER(homedata_state,lemnangl)
{
- homedata_state *state = machine.driver_data<homedata_state>();
- state->m_bg_tilemap[0][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::lemnangl_get_info0_0),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap[0][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::lemnangl_get_info0_1),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap[1][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::lemnangl_get_info1_0),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap[1][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::lemnangl_get_info1_1),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::lemnangl_get_info0_0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::lemnangl_get_info0_1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::lemnangl_get_info1_0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::lemnangl_get_info1_1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap[0][1]->set_transparent_pen(0x0f);
- state->m_bg_tilemap[1][1]->set_transparent_pen(0x0f);
+ m_bg_tilemap[0][1]->set_transparent_pen(0x0f);
+ m_bg_tilemap[1][1]->set_transparent_pen(0x0f);
}
-VIDEO_START( mirderby )
+VIDEO_START_MEMBER(homedata_state,mirderby)
{
- homedata_state *state = machine.driver_data<homedata_state>();
- state->m_bg_tilemap[0][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mirderby_get_info0_0),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
- state->m_bg_tilemap[0][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mirderby_get_info0_1),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
- state->m_bg_tilemap[1][0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mirderby_get_info1_0),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
- state->m_bg_tilemap[1][1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mirderby_get_info1_1),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
+ m_bg_tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mirderby_get_info0_0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
+ m_bg_tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mirderby_get_info0_1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
+ m_bg_tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mirderby_get_info1_0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
+ m_bg_tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homedata_state::mirderby_get_info1_1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32 );
- state->m_bg_tilemap[0][1]->set_transparent_pen(0);
- state->m_bg_tilemap[1][1]->set_transparent_pen(0);
+ m_bg_tilemap[0][1]->set_transparent_pen(0);
+ m_bg_tilemap[1][1]->set_transparent_pen(0);
}
/***************************************************************************
diff --git a/src/mame/video/homerun.c b/src/mame/video/homerun.c
index da6c0351085..9c7e1226c39 100644
--- a/src/mame/video/homerun.c
+++ b/src/mame/video/homerun.c
@@ -96,10 +96,9 @@ TILE_GET_INFO_MEMBER(homerun_state::get_homerun_tile_info)
}
-VIDEO_START( homerun )
+void homerun_state::video_start()
{
- homerun_state *state = machine.driver_data<homerun_state>();
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(homerun_state::get_homerun_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(homerun_state::get_homerun_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
}
diff --git a/src/mame/video/hyhoo.c b/src/mame/video/hyhoo.c
index 840da6d5969..e2cad5ce3ef 100644
--- a/src/mame/video/hyhoo.c
+++ b/src/mame/video/hyhoo.c
@@ -222,10 +222,9 @@ static void hyhoo_gfxdraw(running_machine &machine)
}
-VIDEO_START( hyhoo )
+void hyhoo_state::video_start()
{
- hyhoo_state *state = machine.driver_data<hyhoo_state>();
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap);
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap);
}
diff --git a/src/mame/video/hyperspt.c b/src/mame/video/hyperspt.c
index 54c6c34b640..c34a715d3bb 100644
--- a/src/mame/video/hyperspt.c
+++ b/src/mame/video/hyperspt.c
@@ -29,9 +29,9 @@
***************************************************************************/
-PALETTE_INIT( hyperspt )
+void hyperspt_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b[2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -44,7 +44,7 @@ PALETTE_INIT( hyperspt )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( hyperspt )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -79,14 +79,14 @@ PALETTE_INIT( hyperspt )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* characters */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -120,12 +120,11 @@ TILE_GET_INFO_MEMBER(hyperspt_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(1, code, color, flags);
}
-VIDEO_START( hyperspt )
+void hyperspt_state::video_start()
{
- hyperspt_state *state = machine.driver_data<hyperspt_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hyperspt_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hyperspt_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap->set_scroll_rows(32);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
@@ -199,10 +198,9 @@ TILE_GET_INFO_MEMBER(hyperspt_state::roadf_get_bg_tile_info)
SET_TILE_INFO_MEMBER(1, code, color, flags);
}
-VIDEO_START( roadf )
+VIDEO_START_MEMBER(hyperspt_state,roadf)
{
- hyperspt_state *state = machine.driver_data<hyperspt_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hyperspt_state::roadf_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hyperspt_state::roadf_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap->set_scroll_rows(32);
}
diff --git a/src/mame/video/hyprduel.c b/src/mame/video/hyprduel.c
index 27109f42bfb..1bd8d097cf5 100644
--- a/src/mame/video/hyprduel.c
+++ b/src/mame/video/hyprduel.c
@@ -356,56 +356,53 @@ static void expand_gfx1(hyprduel_state &state)
}
}
-static VIDEO_START( common_14220 )
+VIDEO_START_MEMBER(hyprduel_state,common_14220)
{
- hyprduel_state *state = machine.driver_data<hyprduel_state>();
- expand_gfx1(*state);
- alloc_empty_tiles(machine);
- state->m_tiletable_old = auto_alloc_array(machine, UINT16, state->m_tiletable.bytes() / 2);
- state->m_dirtyindex = auto_alloc_array(machine, UINT8, state->m_tiletable.bytes() / 4);
+ expand_gfx1(*this);
+ alloc_empty_tiles(machine());
+ m_tiletable_old = auto_alloc_array(machine(), UINT16, m_tiletable.bytes() / 2);
+ m_dirtyindex = auto_alloc_array(machine(), UINT8, m_tiletable.bytes() / 4);
- state->save_pointer(NAME(state->m_tiletable_old), state->m_tiletable.bytes() / 2);
- state->save_pointer(NAME(state->m_dirtyindex), state->m_tiletable.bytes() / 4);
+ save_pointer(NAME(m_tiletable_old), m_tiletable.bytes() / 2);
+ save_pointer(NAME(m_dirtyindex), m_tiletable.bytes() / 4);
- state->m_bg_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hyprduel_state::get_tile_info_0_8bit),state), TILEMAP_SCAN_ROWS, 8, 8, WIN_NX, WIN_NY);
- state->m_bg_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hyprduel_state::get_tile_info_1_8bit),state), TILEMAP_SCAN_ROWS, 8, 8, WIN_NX, WIN_NY);
- state->m_bg_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(hyprduel_state::get_tile_info_2_8bit),state), TILEMAP_SCAN_ROWS, 8, 8, WIN_NX, WIN_NY);
+ m_bg_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hyprduel_state::get_tile_info_0_8bit),this), TILEMAP_SCAN_ROWS, 8, 8, WIN_NX, WIN_NY);
+ m_bg_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hyprduel_state::get_tile_info_1_8bit),this), TILEMAP_SCAN_ROWS, 8, 8, WIN_NX, WIN_NY);
+ m_bg_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(hyprduel_state::get_tile_info_2_8bit),this), TILEMAP_SCAN_ROWS, 8, 8, WIN_NX, WIN_NY);
- state->m_bg_tilemap[0]->map_pen_to_layer(0, 15, TILEMAP_PIXEL_TRANSPARENT);
- state->m_bg_tilemap[0]->map_pen_to_layer(1, 255, TILEMAP_PIXEL_TRANSPARENT);
+ m_bg_tilemap[0]->map_pen_to_layer(0, 15, TILEMAP_PIXEL_TRANSPARENT);
+ m_bg_tilemap[0]->map_pen_to_layer(1, 255, TILEMAP_PIXEL_TRANSPARENT);
- state->m_bg_tilemap[1]->map_pen_to_layer(0, 15, TILEMAP_PIXEL_TRANSPARENT);
- state->m_bg_tilemap[1]->map_pen_to_layer(1, 255, TILEMAP_PIXEL_TRANSPARENT);
+ m_bg_tilemap[1]->map_pen_to_layer(0, 15, TILEMAP_PIXEL_TRANSPARENT);
+ m_bg_tilemap[1]->map_pen_to_layer(1, 255, TILEMAP_PIXEL_TRANSPARENT);
- state->m_bg_tilemap[2]->map_pen_to_layer(0, 15, TILEMAP_PIXEL_TRANSPARENT);
- state->m_bg_tilemap[2]->map_pen_to_layer(1, 255, TILEMAP_PIXEL_TRANSPARENT);
+ m_bg_tilemap[2]->map_pen_to_layer(0, 15, TILEMAP_PIXEL_TRANSPARENT);
+ m_bg_tilemap[2]->map_pen_to_layer(1, 255, TILEMAP_PIXEL_TRANSPARENT);
- state->m_bg_tilemap[0]->set_scrolldx(0, 0);
- state->m_bg_tilemap[1]->set_scrolldx(0, 0);
- state->m_bg_tilemap[2]->set_scrolldx(0, 0);
+ m_bg_tilemap[0]->set_scrolldx(0, 0);
+ m_bg_tilemap[1]->set_scrolldx(0, 0);
+ m_bg_tilemap[2]->set_scrolldx(0, 0);
/* Set up save state */
- state->save_item(NAME(state->m_sprite_xoffs));
- state->save_item(NAME(state->m_sprite_yoffs));
- machine.save().register_postload(save_prepost_delegate(FUNC(hyprduel_postload), &machine));
+ save_item(NAME(m_sprite_xoffs));
+ save_item(NAME(m_sprite_yoffs));
+ machine().save().register_postload(save_prepost_delegate(FUNC(hyprduel_postload), &machine()));
}
-VIDEO_START( hyprduel_14220 )
+VIDEO_START_MEMBER(hyprduel_state,hyprduel_14220)
{
- hyprduel_state *state = machine.driver_data<hyprduel_state>();
- state->m_sprite_yoffs_sub = 2;
+ m_sprite_yoffs_sub = 2;
- VIDEO_START_CALL(common_14220);
+ VIDEO_START_CALL_MEMBER(common_14220);
}
-VIDEO_START( magerror_14220 )
+VIDEO_START_MEMBER(hyprduel_state,magerror_14220)
{
- hyprduel_state *state = machine.driver_data<hyprduel_state>();
- state->m_sprite_yoffs_sub = 0;
+ m_sprite_yoffs_sub = 0;
- VIDEO_START_CALL(common_14220);
+ VIDEO_START_CALL_MEMBER(common_14220);
}
/***************************************************************************
diff --git a/src/mame/video/ikki.c b/src/mame/video/ikki.c
index ff5bcccb932..ef951496898 100644
--- a/src/mame/video/ikki.c
+++ b/src/mame/video/ikki.c
@@ -11,14 +11,13 @@ Video hardware driver by Uki
#include "emu.h"
#include "includes/ikki.h"
-PALETTE_INIT( ikki )
+void ikki_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- ikki_state *state = machine.driver_data<ikki_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable - extra pen for the punch through pen */
- machine.colortable = colortable_alloc(machine, 0x101);
+ machine().colortable = colortable_alloc(machine(), 0x101);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -27,7 +26,7 @@ PALETTE_INIT( ikki )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -41,18 +40,18 @@ PALETTE_INIT( ikki )
if (((i & 0x07) == 0x07) && (ctabentry == 0))
{
/* punch through */
- state->m_punch_through_pen = i;
+ m_punch_through_pen = i;
ctabentry = 0x100;
}
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* bg lookup table */
for (i = 0x200; i < 0x400; i++)
{
UINT8 ctabentry = color_prom[i];
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -116,11 +115,10 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
}
-VIDEO_START( ikki )
+void ikki_state::video_start()
{
- ikki_state *state = machine.driver_data<ikki_state>();
- machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
- state->save_item(NAME(state->m_sprite_bitmap));
+ machine().primary_screen->register_screen_bitmap(m_sprite_bitmap);
+ save_item(NAME(m_sprite_bitmap));
}
diff --git a/src/mame/video/inufuku.c b/src/mame/video/inufuku.c
index 12c5014b7f4..6f71b340e72 100644
--- a/src/mame/video/inufuku.c
+++ b/src/mame/video/inufuku.c
@@ -208,15 +208,14 @@ WRITE16_MEMBER(inufuku_state::inufuku_tx_videoram_w)
******************************************************************************/
-VIDEO_START( inufuku )
+void inufuku_state::video_start()
{
- inufuku_state *state = machine.driver_data<inufuku_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(inufuku_state::get_inufuku_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(inufuku_state::get_inufuku_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(inufuku_state::get_inufuku_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(inufuku_state::get_inufuku_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_bg_tilemap->set_transparent_pen(255);
- state->m_tx_tilemap->set_transparent_pen(255);
+ m_bg_tilemap->set_transparent_pen(255);
+ m_tx_tilemap->set_transparent_pen(255);
}
diff --git a/src/mame/video/iqblock.c b/src/mame/video/iqblock.c
index 3a5853c181c..a510a83349c 100644
--- a/src/mame/video/iqblock.c
+++ b/src/mame/video/iqblock.c
@@ -36,14 +36,13 @@ TILE_GET_INFO_MEMBER(iqblock_state::get_fg_tile_info)
***************************************************************************/
-VIDEO_START( iqblock )
+void iqblock_state::video_start()
{
- iqblock_state *state = machine.driver_data<iqblock_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(iqblock_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(iqblock_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,32,64, 8);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(iqblock_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(iqblock_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,32,64, 8);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scroll_cols(64);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_scroll_cols(64);
}
diff --git a/src/mame/video/irobot.c b/src/mame/video/irobot.c
index c53d9c3ae5e..c5f1255d49e 100644
--- a/src/mame/video/irobot.c
+++ b/src/mame/video/irobot.c
@@ -37,9 +37,9 @@
***************************************************************************/
-PALETTE_INIT( irobot )
+void irobot_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* convert the color prom for the text palette */
@@ -53,7 +53,7 @@ PALETTE_INIT( irobot )
int swapped_i = BITSWAP8(i,7,6,5,4,3,0,1,2);
- palette_set_color(machine, swapped_i + 64, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), swapped_i + 64, MAKE_RGB(r, g, b));
}
}
@@ -94,22 +94,21 @@ void irobot_poly_clear(running_machine &machine)
Start the video hardware emulation.
***************************************************************************/
-VIDEO_START( irobot )
+void irobot_state::video_start()
{
- irobot_state *state = machine.driver_data<irobot_state>();
/* Setup 2 bitmaps for the polygon generator */
- int height = machine.primary_screen->height();
- state->m_polybitmap1 = auto_alloc_array(machine, UINT8, BITMAP_WIDTH * height);
- state->m_polybitmap2 = auto_alloc_array(machine, UINT8, BITMAP_WIDTH * height);
+ int height = machine().primary_screen->height();
+ m_polybitmap1 = auto_alloc_array(machine(), UINT8, BITMAP_WIDTH * height);
+ m_polybitmap2 = auto_alloc_array(machine(), UINT8, BITMAP_WIDTH * height);
/* clear the bitmaps so we start with valid palette look-up values for drawing */
- _irobot_poly_clear(machine, state->m_polybitmap1);
- _irobot_poly_clear(machine, state->m_polybitmap2);
+ _irobot_poly_clear(machine(), m_polybitmap1);
+ _irobot_poly_clear(machine(), m_polybitmap2);
/* Set clipping */
- state->m_ir_xmin = state->m_ir_ymin = 0;
- state->m_ir_xmax = machine.primary_screen->width();
- state->m_ir_ymax = machine.primary_screen->height();
+ m_ir_xmin = m_ir_ymin = 0;
+ m_ir_xmax = machine().primary_screen->width();
+ m_ir_ymax = machine().primary_screen->height();
}
diff --git a/src/mame/video/ironhors.c b/src/mame/video/ironhors.c
index 034511dfa77..0356d444696 100644
--- a/src/mame/video/ironhors.c
+++ b/src/mame/video/ironhors.c
@@ -16,9 +16,9 @@
***************************************************************************/
-PALETTE_INIT( ironhors )
+void ironhors_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[4] = { 2000, 1000, 470, 220 };
double rweights[4], gweights[4], bweights[4];
int i;
@@ -30,7 +30,7 @@ PALETTE_INIT( ironhors )
4, resistances, bweights, 1000, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -59,7 +59,7 @@ PALETTE_INIT( ironhors )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table,*/
@@ -74,7 +74,7 @@ PALETTE_INIT( ironhors )
for (j = 0; j < 8; j++)
{
UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine.colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
+ colortable_entry_set_value(machine().colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
}
}
}
@@ -143,12 +143,11 @@ TILE_GET_INFO_MEMBER(ironhors_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( ironhors )
+void ironhors_state::video_start()
{
- ironhors_state *state = machine.driver_data<ironhors_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ironhors_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ironhors_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap->set_scroll_rows(32);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
@@ -258,12 +257,11 @@ TILE_GET_INFO_MEMBER(ironhors_state::farwest_get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( farwest )
+VIDEO_START_MEMBER(ironhors_state,farwest)
{
- ironhors_state *state = machine.driver_data<ironhors_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ironhors_state::farwest_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ironhors_state::farwest_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap->set_scroll_rows(32);
}
static void farwest_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/itech32.c b/src/mame/video/itech32.c
index b7727f0e689..610ca2d409a 100644
--- a/src/mame/video/itech32.c
+++ b/src/mame/video/itech32.c
@@ -161,42 +161,41 @@ INLINE void enable_clipping(itech32_state *state)
*
*************************************/
-VIDEO_START( itech32 )
+void itech32_state::video_start()
{
- itech32_state *state = machine.driver_data<itech32_state>();
int i;
/* allocate memory */
- state->m_videoram = auto_alloc_array(machine, UINT16, VRAM_WIDTH * (state->m_vram_height + 16) * 2);
- memset(state->m_videoram, 0xff, VRAM_WIDTH * (state->m_vram_height + 16) * 2 * 2);
+ m_videoram = auto_alloc_array(machine(), UINT16, VRAM_WIDTH * (m_vram_height + 16) * 2);
+ memset(m_videoram, 0xff, VRAM_WIDTH * (m_vram_height + 16) * 2 * 2);
/* videoplane[0] is the foreground; videoplane[1] is the background */
- state->m_videoplane[0] = &state->m_videoram[0 * VRAM_WIDTH * (state->m_vram_height + 16) + 8 * VRAM_WIDTH];
- state->m_videoplane[1] = &state->m_videoram[1 * VRAM_WIDTH * (state->m_vram_height + 16) + 8 * VRAM_WIDTH];
+ m_videoplane[0] = &m_videoram[0 * VRAM_WIDTH * (m_vram_height + 16) + 8 * VRAM_WIDTH];
+ m_videoplane[1] = &m_videoram[1 * VRAM_WIDTH * (m_vram_height + 16) + 8 * VRAM_WIDTH];
/* set the masks */
- state->m_vram_mask = VRAM_WIDTH * state->m_vram_height - 1;
- state->m_vram_xmask = VRAM_WIDTH - 1;
- state->m_vram_ymask = state->m_vram_height - 1;
+ m_vram_mask = VRAM_WIDTH * m_vram_height - 1;
+ m_vram_xmask = VRAM_WIDTH - 1;
+ m_vram_ymask = m_vram_height - 1;
/* clear the planes initially */
- for (i = 0; i < VRAM_WIDTH * state->m_vram_height; i++)
- state->m_videoplane[0][i] = state->m_videoplane[1][i] = 0xff;
+ for (i = 0; i < VRAM_WIDTH * m_vram_height; i++)
+ m_videoplane[0][i] = m_videoplane[1][i] = 0xff;
/* fetch the GROM base */
- state->m_grom_base = state->memregion("gfx1")->base();
- state->m_grom_size = state->memregion("gfx1")->bytes();
- state->m_grom_bank = 0;
- state->m_grom_bank_mask = state->m_grom_size >> 24;
- if (state->m_grom_bank_mask == 2)
- state->m_grom_bank_mask = 3;
+ m_grom_base = memregion("gfx1")->base();
+ m_grom_size = memregion("gfx1")->bytes();
+ m_grom_bank = 0;
+ m_grom_bank_mask = m_grom_size >> 24;
+ if (m_grom_bank_mask == 2)
+ m_grom_bank_mask = 3;
/* reset statics */
- memset(state->m_video, 0, 0x80);
+ memset(m_video, 0, 0x80);
- state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_interrupt));
- state->m_enable_latch[0] = 1;
- state->m_enable_latch[1] = (state->m_planes > 1) ? 1 : 0;
+ m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_interrupt));
+ m_enable_latch[0] = 1;
+ m_enable_latch[1] = (m_planes > 1) ? 1 : 0;
}
diff --git a/src/mame/video/itech8.c b/src/mame/video/itech8.c
index 98d12bcd673..b5e15dbe626 100644
--- a/src/mame/video/itech8.c
+++ b/src/mame/video/itech8.c
@@ -162,21 +162,20 @@ static const struct tms34061_interface tms34061intf =
*
*************************************/
-VIDEO_START( itech8 )
+void itech8_state::video_start()
{
- itech8_state *state = machine.driver_data<itech8_state>();
/* initialize TMS34061 emulation */
- tms34061_start(machine, &tms34061intf);
+ tms34061_start(machine(), &tms34061intf);
/* get the TMS34061 display state */
- tms34061_get_display_state(&state->m_tms_state);
+ tms34061_get_display_state(&m_tms_state);
/* reset statics */
- state->m_page_select = 0xc0;
+ m_page_select = 0xc0;
/* fetch the GROM base */
- state->m_grom_base = state->memregion("grom")->base();
- state->m_grom_size = state->memregion("grom")->bytes();
+ m_grom_base = memregion("grom")->base();
+ m_grom_size = memregion("grom")->bytes();
}
diff --git a/src/mame/video/jack.c b/src/mame/video/jack.c
index f247a114dbb..d621273fef3 100644
--- a/src/mame/video/jack.c
+++ b/src/mame/video/jack.c
@@ -55,10 +55,9 @@ TILEMAP_MAPPER_MEMBER(jack_state::tilemap_scan_cols_flipy)
return (col * num_rows) + (num_rows - 1 - row);
}
-VIDEO_START( jack )
+void jack_state::video_start()
{
- jack_state *state = machine.driver_data<jack_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(jack_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(jack_state::tilemap_scan_cols_flipy),state), 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(jack_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(jack_state::tilemap_scan_cols_flipy),this), 8, 8, 32, 32);
}
static void jack_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
@@ -107,12 +106,12 @@ SCREEN_UPDATE_IND16( jack )
3bpp gfx and different banking / colors bits
*/
-PALETTE_INIT( joinem )
+PALETTE_INIT_MEMBER(jack_state,joinem)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
bit0 = (color_prom[i] >> 0) & 0x01;
@@ -128,7 +127,7 @@ PALETTE_INIT( joinem )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
}
@@ -140,10 +139,9 @@ TILE_GET_INFO_MEMBER(jack_state::joinem_get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( joinem )
+VIDEO_START_MEMBER(jack_state,joinem)
{
- jack_state *state = machine.driver_data<jack_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(jack_state::joinem_get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(jack_state::tilemap_scan_cols_flipy),state), 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(jack_state::joinem_get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(jack_state::tilemap_scan_cols_flipy),this), 8, 8, 32, 32);
}
static void joinem_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/jackal.c b/src/mame/video/jackal.c
index 405c1e6af42..3d5b343e703 100644
--- a/src/mame/video/jackal.c
+++ b/src/mame/video/jackal.c
@@ -12,30 +12,30 @@
#include "includes/jackal.h"
-PALETTE_INIT( jackal )
+void jackal_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x200);
+ machine().colortable = colortable_alloc(machine(), 0x200);
for (i = 0; i < 0x100; i++)
{
UINT16 ctabentry = i | 0x100;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
for (i = 0x100; i < 0x200; i++)
{
UINT16 ctabentry = color_prom[i - 0x100] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
for (i = 0x200; i < 0x300; i++)
{
UINT16 ctabentry = (color_prom[i - 0x100] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -74,10 +74,9 @@ TILE_GET_INFO_MEMBER(jackal_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( jackal )
+void jackal_state::video_start()
{
- jackal_state *state = machine.driver_data<jackal_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(jackal_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(jackal_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_background( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/jailbrek.c b/src/mame/video/jailbrek.c
index 8de8189c7f7..b139abc15f7 100644
--- a/src/mame/video/jailbrek.c
+++ b/src/mame/video/jailbrek.c
@@ -1,13 +1,13 @@
#include "emu.h"
#include "includes/jailbrek.h"
-PALETTE_INIT( jailbrek )
+void jailbrek_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -16,7 +16,7 @@ PALETTE_INIT( jailbrek )
int g = pal4bit(color_prom[i + 0x00] >> 4);
int b = pal4bit(color_prom[i + 0x20] >> 0);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -25,13 +25,13 @@ PALETTE_INIT( jailbrek )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -56,11 +56,10 @@ TILE_GET_INFO_MEMBER(jailbrek_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( jailbrek )
+void jailbrek_state::video_start()
{
- jailbrek_state *state = machine.driver_data<jailbrek_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(jailbrek_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap->set_scrolldx(0, 396 - 256);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(jailbrek_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap->set_scrolldx(0, 396 - 256);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/jedi.c b/src/mame/video/jedi.c
index c3cd1d074e1..73402c6a0bb 100644
--- a/src/mame/video/jedi.c
+++ b/src/mame/video/jedi.c
@@ -28,13 +28,12 @@
*
*************************************/
-static VIDEO_START( jedi )
+VIDEO_START_MEMBER(jedi_state,jedi)
{
- jedi_state *state = machine.driver_data<jedi_state>();
/* register for saving */
- state->save_item(NAME(state->m_vscroll));
- state->save_item(NAME(state->m_hscroll));
+ save_item(NAME(m_vscroll));
+ save_item(NAME(m_hscroll));
}
@@ -359,5 +358,5 @@ MACHINE_CONFIG_FRAGMENT( jedi_video )
MCFG_SCREEN_VISIBLE_AREA(0*8, 37*8-1, 0*8, 30*8-1)
MCFG_SCREEN_UPDATE_STATIC(jedi)
- MCFG_VIDEO_START(jedi)
+ MCFG_VIDEO_START_OVERRIDE(jedi_state,jedi)
MACHINE_CONFIG_END
diff --git a/src/mame/video/jpmimpct.c b/src/mame/video/jpmimpct.c
index 7e49eca4e80..1901c13288c 100644
--- a/src/mame/video/jpmimpct.c
+++ b/src/mame/video/jpmimpct.c
@@ -128,14 +128,13 @@ void jpmimpct_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int s
*
*************************************/
-VIDEO_START( jpmimpct )
+VIDEO_START_MEMBER(jpmimpct_state,jpmimpct)
{
- jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
- memset(&state->m_bt477, 0, sizeof(state->m_bt477));
-
- state_save_register_global(machine, state->m_bt477.address);
- state_save_register_global(machine, state->m_bt477.addr_cnt);
- state_save_register_global(machine, state->m_bt477.pixmask);
- state_save_register_global(machine, state->m_bt477.command);
- state_save_register_global(machine, state->m_bt477.color);
+ memset(&m_bt477, 0, sizeof(m_bt477));
+
+ state_save_register_global(machine(), m_bt477.address);
+ state_save_register_global(machine(), m_bt477.addr_cnt);
+ state_save_register_global(machine(), m_bt477.pixmask);
+ state_save_register_global(machine(), m_bt477.command);
+ state_save_register_global(machine(), m_bt477.color);
}
diff --git a/src/mame/video/kaneko16.c b/src/mame/video/kaneko16.c
index 292e01b794f..7433290d896 100644
--- a/src/mame/video/kaneko16.c
+++ b/src/mame/video/kaneko16.c
@@ -17,10 +17,9 @@ WRITE16_MEMBER(kaneko16_state::kaneko16_display_enable)
COMBINE_DATA(&m_disp_enable);
}
-VIDEO_START( kaneko16 )
+VIDEO_START_MEMBER(kaneko16_state,kaneko16)
{
- kaneko16_state *state = machine.driver_data<kaneko16_state>();
- state->m_disp_enable = 1; // default enabled for games not using it
+ m_disp_enable = 1; // default enabled for games not using it
}
@@ -88,7 +87,7 @@ SCREEN_UPDATE_IND16( kaneko16 )
/* Berlwall and Gals Panic have an additional hi-color layers */
-PALETTE_INIT( berlwall )
+PALETTE_INIT_MEMBER(kaneko16_berlwall_state,berlwall)
{
int i;
@@ -96,18 +95,17 @@ PALETTE_INIT( berlwall )
/* initialize 555 RGB lookup */
for (i = 0; i < 32768; i++)
- palette_set_color_rgb(machine,2048 + i,pal5bit(i >> 5),pal5bit(i >> 10),pal5bit(i >> 0));
+ palette_set_color_rgb(machine(),2048 + i,pal5bit(i >> 5),pal5bit(i >> 10),pal5bit(i >> 0));
}
-VIDEO_START( berlwall )
+VIDEO_START_MEMBER(kaneko16_berlwall_state,berlwall)
{
- kaneko16_berlwall_state *state = machine.driver_data<kaneko16_berlwall_state>();
int sx, x,y;
- UINT8 *RAM = state->memregion("gfx3")->base();
+ UINT8 *RAM = memregion("gfx3")->base();
/* Render the hi-color static backgrounds held in the ROMs */
- state->m_bg15_bitmap.allocate(256 * 32, 256 * 1);
+ m_bg15_bitmap.allocate(256 * 32, 256 * 1);
/*
8aba is used as background color
@@ -140,10 +138,10 @@ VIDEO_START( berlwall )
if ((r & 0x10) && (b & 0x10))
g = (g - 1) & 0x1f; /* decrease with wraparound */
- state->m_bg15_bitmap.pix16(y, sx * 256 + x) = 2048 + ((g << 10) | (r << 5) | b);
+ m_bg15_bitmap.pix16(y, sx * 256 + x) = 2048 + ((g << 10) | (r << 5) | b);
}
- VIDEO_START_CALL(kaneko16);
+ VIDEO_START_CALL_MEMBER(kaneko16);
}
diff --git a/src/mame/video/kangaroo.c b/src/mame/video/kangaroo.c
index 6c32e590744..3b07f36b8e7 100644
--- a/src/mame/video/kangaroo.c
+++ b/src/mame/video/kangaroo.c
@@ -16,13 +16,12 @@ static void blitter_execute(running_machine &machine);
*
*************************************/
-VIDEO_START( kangaroo )
+void kangaroo_state::video_start()
{
- kangaroo_state *state = machine.driver_data<kangaroo_state>();
/* video RAM is accessed 32 bits at a time (two planes, 4bpp each, 4 pixels) */
- state->m_videoram = auto_alloc_array(machine, UINT32, 256 * 64);
- state->save_pointer(NAME(state->m_videoram), 256 * 64);
+ m_videoram = auto_alloc_array(machine(), UINT32, 256 * 64);
+ save_pointer(NAME(m_videoram), 256 * 64);
}
diff --git a/src/mame/video/karnov.c b/src/mame/video/karnov.c
index b00d77af223..ba8ee477c10 100644
--- a/src/mame/video/karnov.c
+++ b/src/mame/video/karnov.c
@@ -36,12 +36,12 @@
***************************************************************************/
-PALETTE_INIT( karnov )
+void karnov_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, bit3, r, g, b;
@@ -55,13 +55,13 @@ PALETTE_INIT( karnov )
bit2 = (color_prom[0] >> 6) & 0x01;
bit3 = (color_prom[0] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
color_prom++;
}
}
@@ -159,30 +159,28 @@ WRITE16_MEMBER(karnov_state::karnov_playfield_swap_w)
/******************************************************************************/
-VIDEO_START( karnov )
+VIDEO_START_MEMBER(karnov_state,karnov)
{
- karnov_state *state = machine.driver_data<karnov_state>();
/* Allocate bitmap & tilemap */
- state->m_bitmap_f = auto_bitmap_ind16_alloc(machine, 512, 512);
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(karnov_state::get_fix_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bitmap_f = auto_bitmap_ind16_alloc(machine(), 512, 512);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(karnov_state::get_fix_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->save_item(NAME(*state->m_bitmap_f));
+ save_item(NAME(*m_bitmap_f));
- state->m_fix_tilemap->set_transparent_pen(0);
+ m_fix_tilemap->set_transparent_pen(0);
}
-VIDEO_START( wndrplnt )
+VIDEO_START_MEMBER(karnov_state,wndrplnt)
{
- karnov_state *state = machine.driver_data<karnov_state>();
/* Allocate bitmap & tilemap */
- state->m_bitmap_f = auto_bitmap_ind16_alloc(machine, 512, 512);
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(karnov_state::get_fix_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_bitmap_f = auto_bitmap_ind16_alloc(machine(), 512, 512);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(karnov_state::get_fix_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->save_item(NAME(*state->m_bitmap_f));
+ save_item(NAME(*m_bitmap_f));
- state->m_fix_tilemap->set_transparent_pen(0);
+ m_fix_tilemap->set_transparent_pen(0);
}
/******************************************************************************/
diff --git a/src/mame/video/kchamp.c b/src/mame/video/kchamp.c
index bb54b1239e1..2f3a73b8793 100644
--- a/src/mame/video/kchamp.c
+++ b/src/mame/video/kchamp.c
@@ -10,18 +10,18 @@
#include "includes/kchamp.h"
-PALETTE_INIT( kchamp )
+void kchamp_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i, red, green, blue;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
red = color_prom[i];
- green = color_prom[machine.total_colors() + i];
- blue = color_prom[2 * machine.total_colors() + i];
+ green = color_prom[machine().total_colors() + i];
+ blue = color_prom[2 * machine().total_colors() + i];
- palette_set_color_rgb(machine, i, pal4bit(red), pal4bit(green), pal4bit(blue));
+ palette_set_color_rgb(machine(), i, pal4bit(red), pal4bit(green), pal4bit(blue));
}
}
@@ -50,10 +50,9 @@ TILE_GET_INFO_MEMBER(kchamp_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( kchamp )
+void kchamp_state::video_start()
{
- kchamp_state *state = machine.driver_data<kchamp_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kchamp_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kchamp_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
/*
diff --git a/src/mame/video/kickgoal.c b/src/mame/video/kickgoal.c
index c81790b90f2..a5f69ddfe8a 100644
--- a/src/mame/video/kickgoal.c
+++ b/src/mame/video/kickgoal.c
@@ -116,48 +116,46 @@ static void kickgoal_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap
}
-VIDEO_START( kickgoal )
+VIDEO_START_MEMBER(kickgoal_state,kickgoal)
{
- kickgoal_state *state = machine.driver_data<kickgoal_state>();
- state->m_sprbase = 0x0000;
+ m_sprbase = 0x0000;
- state->m_fg_base = 0x7000;
- state->m_bg_base = 0x1000;
- state->m_bg_mask = 0x0fff;
+ m_fg_base = 0x7000;
+ m_bg_base = 0x1000;
+ m_bg_mask = 0x0fff;
- state->m_bg2_region = 2; // 32x32 tile source
- state->m_bg2_base = 0x2000 / 4;
- state->m_bg2_mask = (0x2000/4) - 1;
+ m_bg2_region = 2; // 32x32 tile source
+ m_bg2_base = 0x2000 / 4;
+ m_bg2_mask = (0x2000/4) - 1;
- state->m_fgtm = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_fg_tile_info),state), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_kicksfg),state), 8, 8, 64, 64);
- state->m_bgtm = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_bg_tile_info),state), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_kicksbg),state), 16, 16, 64, 64);
- state->m_bg2tm = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_kicksbg2),state), 32, 32, 64, 64);
+ m_fgtm = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_fg_tile_info),this), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_kicksfg),this), 8, 8, 64, 64);
+ m_bgtm = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_bg_tile_info),this), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_kicksbg),this), 16, 16, 64, 64);
+ m_bg2tm = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_kicksbg2),this), 32, 32, 64, 64);
- state->m_fgtm->set_transparent_pen(15);
- state->m_bgtm->set_transparent_pen(15);
+ m_fgtm->set_transparent_pen(15);
+ m_bgtm->set_transparent_pen(15);
}
-VIDEO_START( actionhw )
+VIDEO_START_MEMBER(kickgoal_state,actionhw)
{
- kickgoal_state *state = machine.driver_data<kickgoal_state>();
- state->m_sprbase = 0x4000;
- state->m_fg_base = 0x7000 * 2;
+ m_sprbase = 0x4000;
+ m_fg_base = 0x7000 * 2;
- state->m_bg_base = 0x0000;
- state->m_bg_mask = 0x1fff;
+ m_bg_base = 0x0000;
+ m_bg_mask = 0x1fff;
- state->m_bg2_region = 1; // 16x16 tile source
- state->m_bg2_base = 0x2000;
- state->m_bg2_mask = 0x2000 - 1;
+ m_bg2_region = 1; // 16x16 tile source
+ m_bg2_base = 0x2000;
+ m_bg2_mask = 0x2000 - 1;
- state->m_fgtm = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_fg_tile_info),state), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_kicksfg),state), 8, 8, 64, 64);
- state->m_bgtm = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_bg_tile_info),state), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_kicksbg),state), 16, 16, 64, 64);
- state->m_bg2tm = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_actionhwbg2),state), 16, 16, 64, 64);
+ m_fgtm = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_fg_tile_info),this), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_kicksfg),this), 8, 8, 64, 64);
+ m_bgtm = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_bg_tile_info),this), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_kicksbg),this), 16, 16, 64, 64);
+ m_bg2tm = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kickgoal_state::get_kickgoal_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(kickgoal_state::tilemap_scan_actionhwbg2),this), 16, 16, 64, 64);
- state->m_fgtm->set_transparent_pen(15);
- state->m_bgtm->set_transparent_pen(15);
+ m_fgtm->set_transparent_pen(15);
+ m_bgtm->set_transparent_pen(15);
}
diff --git a/src/mame/video/kingobox.c b/src/mame/video/kingobox.c
index 04229a5fb57..3cadd555456 100644
--- a/src/mame/video/kingobox.c
+++ b/src/mame/video/kingobox.c
@@ -121,16 +121,16 @@ static void ringking_get_rgb_data( const UINT8 *color_prom, int i, int *r_data,
}
-PALETTE_INIT( kingofb )
+PALETTE_INIT_MEMBER(kingofb_state,kingofb)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- palette_init_common(machine, color_prom, kingofb_get_rgb_data);
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
+ palette_init_common(machine(), color_prom, kingofb_get_rgb_data);
}
-PALETTE_INIT( ringking )
+PALETTE_INIT_MEMBER(kingofb_state,ringking)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- palette_init_common(machine, color_prom, ringking_get_rgb_data);
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
+ palette_init_common(machine(), color_prom, ringking_get_rgb_data);
}
WRITE8_MEMBER(kingofb_state::kingofb_videoram_w)
@@ -194,13 +194,12 @@ TILE_GET_INFO_MEMBER(kingofb_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(bank, code, color, 0);
}
-VIDEO_START( kingofb )
+VIDEO_START_MEMBER(kingofb_state,kingofb)
{
- kingofb_state *state = machine.driver_data<kingofb_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kingofb_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS_FLIP_Y, 16, 16, 16, 16);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kingofb_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS_FLIP_Y, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kingofb_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS_FLIP_Y, 16, 16, 16, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kingofb_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS_FLIP_Y, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
static void kingofb_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -262,13 +261,12 @@ TILE_GET_INFO_MEMBER(kingofb_state::ringking_get_bg_tile_info)
SET_TILE_INFO_MEMBER(4, code, color, 0);
}
-VIDEO_START( ringking )
+VIDEO_START_MEMBER(kingofb_state,ringking)
{
- kingofb_state *state = machine.driver_data<kingofb_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kingofb_state::ringking_get_bg_tile_info),state), TILEMAP_SCAN_COLS_FLIP_Y, 16, 16, 16, 16);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kingofb_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS_FLIP_Y, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kingofb_state::ringking_get_bg_tile_info),this), TILEMAP_SCAN_COLS_FLIP_Y, 16, 16, 16, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kingofb_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS_FLIP_Y, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
static void ringking_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/klax.c b/src/mame/video/klax.c
index 81d771c6f84..72627b1455b 100644
--- a/src/mame/video/klax.c
+++ b/src/mame/video/klax.c
@@ -33,7 +33,7 @@ TILE_GET_INFO_MEMBER(klax_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( klax )
+VIDEO_START_MEMBER(klax_state,klax)
{
static const atarimo_desc modesc =
{
@@ -71,13 +71,12 @@ VIDEO_START( klax )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- klax_state *state = machine.driver_data<klax_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(klax_state::get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,32);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(klax_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,32);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
}
diff --git a/src/mame/video/kncljoe.c b/src/mame/video/kncljoe.c
index e4c073f81b0..d5922ba6515 100644
--- a/src/mame/video/kncljoe.c
+++ b/src/mame/video/kncljoe.c
@@ -14,13 +14,13 @@ Knuckle Joe - (c) 1985 Taito Corporation
***************************************************************************/
-PALETTE_INIT( kncljoe )
+void kncljoe_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x90);
+ machine().colortable = colortable_alloc(machine(), 0x90);
/* create a lookup table for the palette */
for (i = 0; i < 0x80; i++)
@@ -29,7 +29,7 @@ PALETTE_INIT( kncljoe )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0x80; i < 0x90; i++)
@@ -55,7 +55,7 @@ PALETTE_INIT( kncljoe )
bit2 = (color_prom[(i - 0x80) + 0x300] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -63,13 +63,13 @@ PALETTE_INIT( kncljoe )
/* chars */
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprite lookup table */
for (i = 0x80; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i - 0x80] & 0x0f) | 0x80;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -101,12 +101,11 @@ TILE_GET_INFO_MEMBER(kncljoe_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( kncljoe )
+void kncljoe_state::video_start()
{
- kncljoe_state *state = machine.driver_data<kncljoe_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kncljoe_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kncljoe_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap->set_scroll_rows(4);
+ m_bg_tilemap->set_scroll_rows(4);
}
diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c
index 55179cc67d0..023ec16c492 100644
--- a/src/mame/video/konamigx.c
+++ b/src/mame/video/konamigx.c
@@ -2054,62 +2054,62 @@ static void _gxcommoninit(running_machine &machine)
}
-VIDEO_START(konamigx_5bpp)
+VIDEO_START_MEMBER(konamigx_state,konamigx_5bpp)
{
- if (!strcmp(machine.system().name,"sexyparo") || !strcmp(machine.system().name,"sexyparoa"))
+ if (!strcmp(machine().system().name,"sexyparo") || !strcmp(machine().system().name,"sexyparoa"))
game_tile_callback = konamigx_alpha_tile_callback;
else
game_tile_callback = konamigx_type2_tile_callback;
- K056832_vh_start(machine, "gfx1", K056832_BPP_5, 0, NULL, game_tile_callback, 0);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game_tile_callback, 0);
- _gxcommoninit(machine);
+ _gxcommoninit(machine());
/* here are some hand tuned per game scroll offsets to go with the per game visible areas,
i see no better way of doing this for now... */
- if (!strcmp(machine.system().name,"tbyahhoo"))
+ if (!strcmp(machine().system().name,"tbyahhoo"))
{
K056832_set_UpdateMode(1);
gx_tilemode = 1;
} else
- if (!strcmp(machine.system().name,"puzldama"))
+ if (!strcmp(machine().system().name,"puzldama"))
{
K053247GP_set_SpriteOffset(-46, -23);
konamigx_mixer_primode(5);
} else
- if (!strcmp(machine.system().name,"daiskiss"))
+ if (!strcmp(machine().system().name,"daiskiss"))
{
konamigx_mixer_primode(4);
} else
- if (!strcmp(machine.system().name,"gokuparo") || !strcmp(machine.system().name,"fantjour") || !strcmp(machine.system().name,"fantjoura"))
+ if (!strcmp(machine().system().name,"gokuparo") || !strcmp(machine().system().name,"fantjour") || !strcmp(machine().system().name,"fantjoura"))
{
K053247GP_set_SpriteOffset(-46, -23);
} else
- if (!strcmp(machine.system().name,"sexyparo") || !strcmp(machine.system().name,"sexyparoa"))
+ if (!strcmp(machine().system().name,"sexyparo") || !strcmp(machine().system().name,"sexyparoa"))
{
K053247GP_set_SpriteOffset(-42, -23);
}
}
-VIDEO_START(winspike)
+VIDEO_START_MEMBER(konamigx_state,winspike)
{
- K056832_vh_start(machine, "gfx1", K056832_BPP_8, 0, NULL, konamigx_alpha_tile_callback, 2);
- K055673_vh_start(machine, "gfx2", K055673_LAYOUT_LE2, -53, -23, konamigx_type2_sprite_callback);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_alpha_tile_callback, 2);
+ K055673_vh_start(machine(), "gfx2", K055673_LAYOUT_LE2, -53, -23, konamigx_type2_sprite_callback);
- _gxcommoninitnosprites(machine);
+ _gxcommoninitnosprites(machine());
}
-VIDEO_START(dragoonj)
+VIDEO_START_MEMBER(konamigx_state,dragoonj)
{
- K056832_vh_start(machine, "gfx1", K056832_BPP_5, 1, NULL, konamigx_type2_tile_callback, 0);
- K055673_vh_start(machine, "gfx2", K055673_LAYOUT_RNG, -53, -23, konamigx_dragoonj_sprite_callback);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_5, 1, NULL, konamigx_type2_tile_callback, 0);
+ K055673_vh_start(machine(), "gfx2", K055673_LAYOUT_RNG, -53, -23, konamigx_dragoonj_sprite_callback);
- _gxcommoninitnosprites(machine);
+ _gxcommoninitnosprites(machine());
K056832_set_LayerOffset(0, -2+1, 0);
K056832_set_LayerOffset(1, 0+1, 0);
@@ -2117,12 +2117,12 @@ VIDEO_START(dragoonj)
K056832_set_LayerOffset(3, 3+1, 0);
}
-VIDEO_START(le2)
+VIDEO_START_MEMBER(konamigx_state,le2)
{
- K056832_vh_start(machine, "gfx1", K056832_BPP_8, 1, NULL, konamigx_type2_tile_callback, 0);
- K055673_vh_start(machine, "gfx2", K055673_LAYOUT_LE2, -46, -23, konamigx_le2_sprite_callback);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_8, 1, NULL, konamigx_type2_tile_callback, 0);
+ K055673_vh_start(machine(), "gfx2", K055673_LAYOUT_LE2, -46, -23, konamigx_le2_sprite_callback);
- _gxcommoninitnosprites(machine);
+ _gxcommoninitnosprites(machine());
konamigx_mixer_primode(-1); // swapped layer B and C priorities?
@@ -2130,42 +2130,41 @@ VIDEO_START(le2)
K055555_write_reg(K55_INPUT_ENABLES, 1); // it doesn't turn on the video output at first for the test screens, maybe it should default to ON?
}
-VIDEO_START(konamigx_6bpp)
+VIDEO_START_MEMBER(konamigx_state,konamigx_6bpp)
{
- K056832_vh_start(machine, "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 0);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 0);
- _gxcommoninit(machine);
+ _gxcommoninit(machine());
- if (!strcmp(machine.system().name,"tokkae") || !strcmp(machine.system().name,"tkmmpzdm"))
+ if (!strcmp(machine().system().name,"tokkae") || !strcmp(machine().system().name,"tkmmpzdm"))
{
K053247GP_set_SpriteOffset(-46, -23);
konamigx_mixer_primode(5);
}
}
-VIDEO_START(konamigx_type3)
+VIDEO_START_MEMBER(konamigx_state,konamigx_type3)
{
- konamigx_state *state = machine.driver_data<konamigx_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
- K056832_vh_start(machine, "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 1);
- K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 1);
+ K055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback);
- dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine, width, height);
- dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine, width, height);
+ dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
+ dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
- _gxcommoninitnosprites(machine);
+ _gxcommoninitnosprites(machine());
- gx_psac_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac3_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 256, 256);
- gx_psac_tilemap_alt = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac3_alt_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 256, 256);
+ gx_psac_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac3_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 256, 256);
+ gx_psac_tilemap_alt = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac3_alt_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 256, 256);
gx_rozenable = 0;
gx_specialrozenable = 2;
/* set up tile layers */
- type3_roz_temp_bitmap = auto_bitmap_ind16_alloc(machine, width, height);
+ type3_roz_temp_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
//gx_psac_tilemap->set_flip(TILEMAP_FLIPX| TILEMAP_FLIPY);
@@ -2183,21 +2182,20 @@ VIDEO_START(konamigx_type3)
konamigx_palformat = 1;
}
-VIDEO_START(konamigx_type4)
+VIDEO_START_MEMBER(konamigx_state,konamigx_type4)
{
- konamigx_state *state = machine.driver_data<konamigx_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
- K056832_vh_start(machine, "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 0);
- K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX6, -79, -24, konamigx_type2_sprite_callback); // -23 looks better in intro
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 0);
+ K055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -79, -24, konamigx_type2_sprite_callback); // -23 looks better in intro
- dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine, width, height);
- dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine, width, height);
+ dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
+ dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
- _gxcommoninitnosprites(machine);
+ _gxcommoninitnosprites(machine());
- gx_psac_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
+ gx_psac_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
gx_rozenable = 0;
gx_specialrozenable = 3;
@@ -2215,21 +2213,20 @@ VIDEO_START(konamigx_type4)
}
-VIDEO_START(konamigx_type4_vsn)
+VIDEO_START_MEMBER(konamigx_state,konamigx_type4_vsn)
{
- konamigx_state *state = machine.driver_data<konamigx_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
- K056832_vh_start(machine, "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 2); // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0
- K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 2); // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0
+ K055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback);
- dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine, width, height);
- dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine, width, height);
+ dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
+ dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
- _gxcommoninitnosprites(machine);
+ _gxcommoninitnosprites(machine());
- gx_psac_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
+ gx_psac_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
gx_rozenable = 0;
gx_specialrozenable = 3;
@@ -2246,21 +2243,20 @@ VIDEO_START(konamigx_type4_vsn)
konamigx_palformat = 0;
}
-VIDEO_START(konamigx_type4_sd2)
+VIDEO_START_MEMBER(konamigx_state,konamigx_type4_sd2)
{
- konamigx_state *state = machine.driver_data<konamigx_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
- K056832_vh_start(machine, "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 0);
- K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX6, -81, -23, konamigx_type2_sprite_callback);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 0);
+ K055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -81, -23, konamigx_type2_sprite_callback);
- dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine, width, height);
- dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine, width, height);
+ dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
+ dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
- _gxcommoninitnosprites(machine);
+ _gxcommoninitnosprites(machine());
- gx_psac_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
+ gx_psac_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
gx_rozenable = 0;
gx_specialrozenable = 3;
@@ -2281,37 +2277,36 @@ VIDEO_START(konamigx_type4_sd2)
}
-VIDEO_START(konamigx_6bpp_2)
+VIDEO_START_MEMBER(konamigx_state,konamigx_6bpp_2)
{
- K056832_vh_start(machine, "gfx1", K056832_BPP_6, 1, NULL, konamigx_type2_tile_callback, 0);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_6, 1, NULL, konamigx_type2_tile_callback, 0);
- if (!strcmp(machine.system().name,"salmndr2") || !strcmp(machine.system().name,"salmndr2a"))
+ if (!strcmp(machine().system().name,"salmndr2") || !strcmp(machine().system().name,"salmndr2a"))
{
- K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX6, -48, -23, konamigx_salmndr2_sprite_callback);
+ K055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -48, -23, konamigx_salmndr2_sprite_callback);
- _gxcommoninitnosprites(machine);
+ _gxcommoninitnosprites(machine());
}
else
{
- _gxcommoninit(machine);
+ _gxcommoninit(machine());
}
}
-VIDEO_START(opengolf)
+VIDEO_START_MEMBER(konamigx_state,opengolf)
{
- konamigx_state *state = machine.driver_data<konamigx_state>();
- K056832_vh_start(machine, "gfx1", K056832_BPP_5, 0, NULL, konamigx_type2_tile_callback, 0);
- K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX6, -53, -23, konamigx_type2_sprite_callback);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, konamigx_type2_tile_callback, 0);
+ K055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -53, -23, konamigx_type2_sprite_callback);
- _gxcommoninitnosprites(machine);
+ _gxcommoninitnosprites(machine());
K056832_set_LayerOffset(0, -2+1, 0);
K056832_set_LayerOffset(1, 0+1, 0);
K056832_set_LayerOffset(2, 2+1, 0);
K056832_set_LayerOffset(3, 3+1, 0);
- gx_psac_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac1a_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
- gx_psac_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac1b_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
+ gx_psac_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac1a_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
+ gx_psac_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac1b_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
// transparency will be handled manually in post-processing
//gx_psac_tilemap->set_transparent_pen(0);
@@ -2320,8 +2315,8 @@ VIDEO_START(opengolf)
gx_rozenable = 0;
gx_specialrozenable = 1;
- gxtype1_roz_dstbitmap = auto_bitmap_ind16_alloc(machine,512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
- gxtype1_roz_dstbitmap2 = auto_bitmap_ind16_alloc(machine,512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
+ gxtype1_roz_dstbitmap = auto_bitmap_ind16_alloc(machine(),512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
+ gxtype1_roz_dstbitmap2 = auto_bitmap_ind16_alloc(machine(),512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
gxtype1_roz_dstbitmapclip.set(0, 512-1, 0, 512-1);
@@ -2332,25 +2327,24 @@ VIDEO_START(opengolf)
// urgh.. the priority bitmap is global, and because our temp bitmaps are bigger than the screen, this causes issues.. so just allocate something huge
// until there is a better solution, or priority bitmap can be specified manually.
- machine.priority_bitmap.allocate(2048,2048);
+ machine().priority_bitmap.allocate(2048,2048);
}
-VIDEO_START(racinfrc)
+VIDEO_START_MEMBER(konamigx_state,racinfrc)
{
- konamigx_state *state = machine.driver_data<konamigx_state>();
- K056832_vh_start(machine, "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 0);
- K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX, -53, -23, konamigx_type2_sprite_callback);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 0);
+ K055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX, -53, -23, konamigx_type2_sprite_callback);
- _gxcommoninitnosprites(machine);
+ _gxcommoninitnosprites(machine());
K056832_set_LayerOffset(0, -2+1, 0);
K056832_set_LayerOffset(1, 0+1, 0);
K056832_set_LayerOffset(2, 2+1, 0);
K056832_set_LayerOffset(3, 3+1, 0);
- gx_psac_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac1a_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
- gx_psac_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac1b_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
+ gx_psac_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac1a_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
+ gx_psac_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac1b_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
// transparency will be handled manually in post-processing
//gx_psac_tilemap->set_transparent_pen(0);
@@ -2359,8 +2353,8 @@ VIDEO_START(racinfrc)
gx_rozenable = 0;
gx_specialrozenable = 1;
- gxtype1_roz_dstbitmap = auto_bitmap_ind16_alloc(machine,512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
- gxtype1_roz_dstbitmap2 = auto_bitmap_ind16_alloc(machine,512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
+ gxtype1_roz_dstbitmap = auto_bitmap_ind16_alloc(machine(),512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
+ gxtype1_roz_dstbitmap2 = auto_bitmap_ind16_alloc(machine(),512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
gxtype1_roz_dstbitmapclip.set(0, 512-1, 0, 512-1);
@@ -2371,7 +2365,7 @@ VIDEO_START(racinfrc)
// urgh.. the priority bitmap is global, and because our temp bitmaps are bigger than the screen, this causes issues.. so just allocate something huge
// until there is a better solution, or priority bitmap can be specified manually.
- machine.priority_bitmap.allocate(2048,2048);
+ machine().priority_bitmap.allocate(2048,2048);
}
diff --git a/src/mame/video/kopunch.c b/src/mame/video/kopunch.c
index 764e7fe8424..235e5ef3170 100644
--- a/src/mame/video/kopunch.c
+++ b/src/mame/video/kopunch.c
@@ -2,13 +2,13 @@
#include "includes/kopunch.h"
-PALETTE_INIT( kopunch )
+void kopunch_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
color_prom += 24; /* first 24 colors are black */
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -28,7 +28,7 @@ PALETTE_INIT( kopunch )
bit2 = (*color_prom >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
color_prom++;
}
}
@@ -80,15 +80,14 @@ TILE_GET_INFO_MEMBER(kopunch_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(1, code, 0, 0);
}
-VIDEO_START( kopunch )
+void kopunch_state::video_start()
{
- kopunch_state *state = machine.driver_data<kopunch_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kopunch_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kopunch_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kopunch_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kopunch_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(16, 16);
+ m_bg_tilemap->set_scrolldx(16, 16);
}
SCREEN_UPDATE_IND16( kopunch )
diff --git a/src/mame/video/ksayakyu.c b/src/mame/video/ksayakyu.c
index 90f7809144a..3cd5c8658ec 100644
--- a/src/mame/video/ksayakyu.c
+++ b/src/mame/video/ksayakyu.c
@@ -30,9 +30,9 @@ WRITE8_MEMBER(ksayakyu_state::ksayakyu_videoctrl_w)
m_tilemap->set_flip((data & 2) ? TILEMAP_FLIPX : 0);
}
-PALETTE_INIT( ksayakyu )
+void ksayakyu_state::palette_init()
{
- const UINT8 *prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *prom = machine().root_device().memregion("proms")->base();
int r, g, b, i;
for (i = 0; i < 0x100; i++)
@@ -41,7 +41,7 @@ PALETTE_INIT( ksayakyu )
g = (prom[i] & 0x38) >> 3;
b = (prom[i] & 0xc0) >> 6;
- palette_set_color_rgb(machine, i, pal3bit(r), pal3bit(g), pal2bit(b));
+ palette_set_color_rgb(machine(), i, pal3bit(r), pal3bit(g), pal2bit(b));
}
}
@@ -113,12 +113,11 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
}
}
-VIDEO_START(ksayakyu)
+void ksayakyu_state::video_start()
{
- ksayakyu_state *state = machine.driver_data<ksayakyu_state>();
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ksayakyu_state::get_ksayakyu_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32 * 8);
- state->m_textmap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ksayakyu_state::get_text_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_textmap->set_transparent_pen(0);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ksayakyu_state::get_ksayakyu_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32 * 8);
+ m_textmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ksayakyu_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_textmap->set_transparent_pen(0);
}
SCREEN_UPDATE_IND16(ksayakyu)
diff --git a/src/mame/video/kyugo.c b/src/mame/video/kyugo.c
index aace00ed91f..cbdb7e552d9 100644
--- a/src/mame/video/kyugo.c
+++ b/src/mame/video/kyugo.c
@@ -41,19 +41,18 @@ TILE_GET_INFO_MEMBER(kyugo_state::get_bg_tile_info)
*
*************************************/
-VIDEO_START( kyugo )
+void kyugo_state::video_start()
{
- kyugo_state *state = machine.driver_data<kyugo_state>();
- state->m_color_codes = state->memregion("proms")->base() + 0x300;
+ m_color_codes = memregion("proms")->base() + 0x300;
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kyugo_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(kyugo_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kyugo_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kyugo_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scrolldx(0, 224);
- state->m_bg_tilemap->set_scrolldx(-32, 32);
+ m_fg_tilemap->set_scrolldx(0, 224);
+ m_bg_tilemap->set_scrolldx(-32, 32);
}
diff --git a/src/mame/video/labyrunr.c b/src/mame/video/labyrunr.c
index 5de33126696..ccbba100293 100644
--- a/src/mame/video/labyrunr.c
+++ b/src/mame/video/labyrunr.c
@@ -2,13 +2,13 @@
#include "video/konicdev.h"
#include "includes/labyrunr.h"
-PALETTE_INIT( labyrunr )
+void labyrunr_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int pal;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x80);
+ machine().colortable = colortable_alloc(machine(), 0x80);
for (pal = 0; pal < 8; pal++)
{
@@ -18,7 +18,7 @@ PALETTE_INIT( labyrunr )
int i;
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine.colortable, (pal << 8) | i, (pal << 4) | (i & 0x0f));
+ colortable_entry_set_value(machine().colortable, (pal << 8) | i, (pal << 4) | (i & 0x0f));
}
/* sprites */
else
@@ -34,7 +34,7 @@ PALETTE_INIT( labyrunr )
else
ctabentry = (pal << 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine.colortable, (pal << 8) | i, ctabentry);
+ colortable_entry_set_value(machine().colortable, (pal << 8) | i, ctabentry);
}
}
}
@@ -129,24 +129,23 @@ TILE_GET_INFO_MEMBER(labyrunr_state::get_tile_info1)
***************************************************************************/
-VIDEO_START( labyrunr )
+void labyrunr_state::video_start()
{
- labyrunr_state *state = machine.driver_data<labyrunr_state>();
- state->m_layer0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(labyrunr_state::get_tile_info0),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_layer1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(labyrunr_state::get_tile_info1),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_layer0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(labyrunr_state::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_layer1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(labyrunr_state::get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_layer0->set_transparent_pen(0);
- state->m_layer1->set_transparent_pen(0);
+ m_layer0->set_transparent_pen(0);
+ m_layer1->set_transparent_pen(0);
- state->m_clip0 = machine.primary_screen->visible_area();
- state->m_clip0.min_x += 40;
+ m_clip0 = machine().primary_screen->visible_area();
+ m_clip0.min_x += 40;
- state->m_clip1 = machine.primary_screen->visible_area();
- state->m_clip1.max_x = 39;
- state->m_clip1.min_x = 0;
+ m_clip1 = machine().primary_screen->visible_area();
+ m_clip1.max_x = 39;
+ m_clip1.min_x = 0;
- state->m_layer0->set_scroll_cols(32);
+ m_layer0->set_scroll_cols(32);
}
diff --git a/src/mame/video/ladybug.c b/src/mame/video/ladybug.c
index 8ac02c01170..33878895fbf 100644
--- a/src/mame/video/ladybug.c
+++ b/src/mame/video/ladybug.c
@@ -93,19 +93,19 @@ static void palette_init_common( running_machine &machine, const UINT8 *color_pr
}
-PALETTE_INIT( ladybug )
+PALETTE_INIT_MEMBER(ladybug_state,ladybug)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- palette_init_common(machine, color_prom, 0x20, 0, 5, 2, 6, 4, 7);
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
+ palette_init_common(machine(), color_prom, 0x20, 0, 5, 2, 6, 4, 7);
}
-PALETTE_INIT( sraider )
+PALETTE_INIT_MEMBER(ladybug_state,sraider)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* the resistor net may be probably different than Lady Bug */
- palette_init_common(machine, color_prom, 0x41, 3, 0, 5, 4, 7, 6);
+ palette_init_common(machine(), color_prom, 0x41, 3, 0, 5, 4, 7, 6);
/* star colors */
for (i = 0x20; i < 0x40; i++)
@@ -127,14 +127,14 @@ PALETTE_INIT( sraider )
bit0 = ((i - 0x20) >> 0) & 0x01;
r = 0x47 * bit0;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0x60; i < 0x80; i++)
- colortable_entry_set_value(machine.colortable, i, (i - 0x60) + 0x20);
+ colortable_entry_set_value(machine().colortable, i, (i - 0x60) + 0x20);
/* stationary part of grid */
- colortable_entry_set_value(machine.colortable, 0x81, 0x40);
+ colortable_entry_set_value(machine().colortable, 0x81, 0x40);
}
WRITE8_MEMBER(ladybug_state::ladybug_videoram_w)
@@ -207,26 +207,24 @@ TILE_GET_INFO_MEMBER(ladybug_state::get_grid_tile_info)
}
}
-VIDEO_START( ladybug )
+VIDEO_START_MEMBER(ladybug_state,ladybug)
{
- ladybug_state *state = machine.driver_data<ladybug_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ladybug_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_rows(32);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ladybug_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap->set_transparent_pen(0);
}
-VIDEO_START( sraider )
+VIDEO_START_MEMBER(ladybug_state,sraider)
{
- ladybug_state *state = machine.driver_data<ladybug_state>();
- state->m_grid_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ladybug_state::get_grid_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_grid_tilemap->set_scroll_rows(32);
- state->m_grid_tilemap->set_transparent_pen(0);
+ m_grid_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ladybug_state::get_grid_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_grid_tilemap->set_scroll_rows(32);
+ m_grid_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ladybug_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_rows(32);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ladybug_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap->set_transparent_pen(0);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/ladyfrog.c b/src/mame/video/ladyfrog.c
index 34e60df4c9e..ff8e279d7c5 100644
--- a/src/mame/video/ladyfrog.c
+++ b/src/mame/video/ladyfrog.c
@@ -127,36 +127,33 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
}
}
-static VIDEO_START( ladyfrog_common )
+VIDEO_START_MEMBER(ladyfrog_state,ladyfrog_common)
{
- ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
- state->m_spriteram = auto_alloc_array(machine, UINT8, 160);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ladyfrog_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_spriteram = auto_alloc_array(machine(), UINT8, 160);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ladyfrog_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_generic_paletteram_8.allocate(0x200);
- state->m_generic_paletteram2_8.allocate(0x200);
- state->m_bg_tilemap->set_scroll_cols(32);
- state->m_bg_tilemap->set_scrolldy(15, 15);
+ m_generic_paletteram_8.allocate(0x200);
+ m_generic_paletteram2_8.allocate(0x200);
+ m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_scrolldy(15, 15);
- state->save_pointer(NAME(state->m_spriteram), 160);
+ save_pointer(NAME(m_spriteram), 160);
}
-VIDEO_START( ladyfrog )
+void ladyfrog_state::video_start()
{
- ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
// weird, there are sprite tiles at 0x000 and 0x400, but they don't contain all the sprites!
- state->m_spritetilebase = 0x800;
- VIDEO_START_CALL(ladyfrog_common);
+ m_spritetilebase = 0x800;
+ VIDEO_START_CALL_MEMBER(ladyfrog_common);
}
-VIDEO_START( toucheme )
+VIDEO_START_MEMBER(ladyfrog_state,toucheme)
{
- ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
- state->m_spritetilebase = 0x000;
- VIDEO_START_CALL(ladyfrog_common);
+ m_spritetilebase = 0x000;
+ VIDEO_START_CALL_MEMBER(ladyfrog_common);
}
diff --git a/src/mame/video/lasso.c b/src/mame/video/lasso.c
index 1bdcd652e4e..879fa0d0cc5 100644
--- a/src/mame/video/lasso.c
+++ b/src/mame/video/lasso.c
@@ -64,30 +64,30 @@ static rgb_t get_color( int data )
}
-PALETTE_INIT( lasso )
+void lasso_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0x40; i++)
- palette_set_color(machine, i, get_color(color_prom[i]));
+ palette_set_color(machine(), i, get_color(color_prom[i]));
}
-PALETTE_INIT( wwjgtin )
+PALETTE_INIT_MEMBER(lasso_state,wwjgtin)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x40);
+ machine().colortable = colortable_alloc(machine(), 0x40);
for (i = 0; i < 0x40; i++)
- colortable_palette_set_color(machine.colortable, i, get_color(color_prom[i]));
+ colortable_palette_set_color(machine().colortable, i, get_color(color_prom[i]));
/* characters/sprites */
for (i = 0; i < 0x40; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* track */
for (i = 0x40; i < 0x140; i++)
@@ -99,7 +99,7 @@ PALETTE_INIT( wwjgtin )
else
ctabentry = 0;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -163,35 +163,32 @@ TILE_GET_INFO_MEMBER(lasso_state::pinbo_get_bg_tile_info)
*
*************************************/
-VIDEO_START( lasso )
+void lasso_state::video_start()
{
- lasso_state *state = machine.driver_data<lasso_state>();
/* create tilemap */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lasso_state::lasso_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lasso_state::lasso_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
}
-VIDEO_START( wwjgtin )
+VIDEO_START_MEMBER(lasso_state,wwjgtin)
{
- lasso_state *state = machine.driver_data<lasso_state>();
/* create tilemaps */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lasso_state::lasso_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_track_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lasso_state::wwjgtin_get_track_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 128, 64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lasso_state::lasso_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_track_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lasso_state::wwjgtin_get_track_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 128, 64);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
}
-VIDEO_START( pinbo )
+VIDEO_START_MEMBER(lasso_state,pinbo)
{
- lasso_state *state = machine.driver_data<lasso_state>();
/* create tilemap */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lasso_state::pinbo_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lasso_state::pinbo_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/lastduel.c b/src/mame/video/lastduel.c
index 5379a39fa7b..63675170351 100644
--- a/src/mame/video/lastduel.c
+++ b/src/mame/video/lastduel.c
@@ -79,36 +79,34 @@ TILE_GET_INFO_MEMBER(lastduel_state::get_fix_info)
***************************************************************************/
-VIDEO_START( lastduel )
+VIDEO_START_MEMBER(lastduel_state,lastduel)
{
- lastduel_state *state = machine.driver_data<lastduel_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::ld_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::ld_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::get_fix_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::ld_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::ld_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::get_fix_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap->set_transmask(0, 0xffff, 0x0001);
- state->m_fg_tilemap->set_transmask(1, 0xf07f, 0x0f81);
- state->m_tx_tilemap->set_transparent_pen(3);
+ m_fg_tilemap->set_transmask(0, 0xffff, 0x0001);
+ m_fg_tilemap->set_transmask(1, 0xf07f, 0x0f81);
+ m_tx_tilemap->set_transparent_pen(3);
- state->m_sprite_flipy_mask = 0x40;
- state->m_sprite_pri_mask = 0x00;
- state->m_tilemap_priority = 0;
+ m_sprite_flipy_mask = 0x40;
+ m_sprite_pri_mask = 0x00;
+ m_tilemap_priority = 0;
}
-VIDEO_START( madgear )
+VIDEO_START_MEMBER(lastduel_state,madgear)
{
- lastduel_state *state = machine.driver_data<lastduel_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::get_bg_tile_info),state),TILEMAP_SCAN_COLS,16,16,64,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::get_fg_tile_info),state),TILEMAP_SCAN_COLS,16,16,64,32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::get_fix_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::get_bg_tile_info),this),TILEMAP_SCAN_COLS,16,16,64,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::get_fg_tile_info),this),TILEMAP_SCAN_COLS,16,16,64,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lastduel_state::get_fix_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_fg_tilemap->set_transmask(0, 0xffff, 0x8000);
- state->m_fg_tilemap->set_transmask(1, 0x80ff, 0xff00);
- state->m_tx_tilemap->set_transparent_pen(3);
- state->m_bg_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transmask(0, 0xffff, 0x8000);
+ m_fg_tilemap->set_transmask(1, 0x80ff, 0xff00);
+ m_tx_tilemap->set_transparent_pen(3);
+ m_bg_tilemap->set_transparent_pen(15);
- state->m_sprite_flipy_mask = 0x80;
- state->m_sprite_pri_mask = 0x10;
+ m_sprite_flipy_mask = 0x80;
+ m_sprite_pri_mask = 0x10;
}
diff --git a/src/mame/video/legionna.c b/src/mame/video/legionna.c
index b22fa950248..880791f54b7 100644
--- a/src/mame/video/legionna.c
+++ b/src/mame/video/legionna.c
@@ -131,86 +131,81 @@ TILE_GET_INFO_MEMBER(legionna_state::get_text_tile_info)
SET_TILE_INFO_MEMBER(0,tile,color,0);
}
-VIDEO_START( legionna )
+VIDEO_START_MEMBER(legionna_state,legionna)
{
- legionna_state *state = machine.driver_data<legionna_state>();
- state->m_background_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_back_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_foreground_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_fore_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_midground_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_mid_tile_info),state), TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_text_tile_info),state),TILEMAP_SCAN_ROWS, 8,8,64,32);
-
- state->m_scrollram16 = auto_alloc_array(machine, UINT16, 0x60/2);
- state->m_sprite_xoffs = 0;
- state->m_sprite_yoffs = 0;
-
- state->m_has_extended_banking = 0;
- state->m_has_extended_priority = 0;
-
- state->m_background_layer->set_transparent_pen(15);
- state->m_midground_layer->set_transparent_pen(15);
- state->m_foreground_layer->set_transparent_pen(15);
- state->m_text_layer->set_transparent_pen(15);
+ m_background_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_back_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_foreground_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_fore_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_midground_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_mid_tile_info),this), TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,64,32);
+
+ m_scrollram16 = auto_alloc_array(machine(), UINT16, 0x60/2);
+ m_sprite_xoffs = 0;
+ m_sprite_yoffs = 0;
+
+ m_has_extended_banking = 0;
+ m_has_extended_priority = 0;
+
+ m_background_layer->set_transparent_pen(15);
+ m_midground_layer->set_transparent_pen(15);
+ m_foreground_layer->set_transparent_pen(15);
+ m_text_layer->set_transparent_pen(15);
}
-VIDEO_START( denjinmk )
+VIDEO_START_MEMBER(legionna_state,denjinmk)
{
- legionna_state *state = machine.driver_data<legionna_state>();
- state->m_background_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_back_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_foreground_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_fore_tile_info_denji),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_midground_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_mid_tile_info_denji),state), TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_text_tile_info),state),TILEMAP_SCAN_ROWS, 8,8,64,32);
-
- state->m_scrollram16 = auto_alloc_array(machine, UINT16, 0x60/2);
- state->m_sprite_xoffs = 0;
- state->m_sprite_yoffs = 0;
-
- state->m_has_extended_banking = 1;
- state->m_has_extended_priority = 0;
-
- state->m_background_layer->set_transparent_pen(15);
- state->m_midground_layer->set_transparent_pen(15);
- state->m_foreground_layer->set_transparent_pen(15);
- state->m_text_layer->set_transparent_pen(7);//?
+ m_background_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_back_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_foreground_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_fore_tile_info_denji),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_midground_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_mid_tile_info_denji),this), TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,64,32);
+
+ m_scrollram16 = auto_alloc_array(machine(), UINT16, 0x60/2);
+ m_sprite_xoffs = 0;
+ m_sprite_yoffs = 0;
+
+ m_has_extended_banking = 1;
+ m_has_extended_priority = 0;
+
+ m_background_layer->set_transparent_pen(15);
+ m_midground_layer->set_transparent_pen(15);
+ m_foreground_layer->set_transparent_pen(15);
+ m_text_layer->set_transparent_pen(7);//?
}
-VIDEO_START( cupsoc )
+VIDEO_START_MEMBER(legionna_state,cupsoc)
{
- legionna_state *state = machine.driver_data<legionna_state>();
- state->m_background_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_back_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_foreground_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_fore_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_midground_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_mid_tile_info_cupsoc),state), TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_text_tile_info),state),TILEMAP_SCAN_ROWS, 8,8,64,32);
-
- state->m_scrollram16 = auto_alloc_array(machine, UINT16, 0x60/2);
- state->m_sprite_xoffs = 0;
- state->m_sprite_yoffs = 0;
-
- state->m_has_extended_banking = 0;
- state->m_has_extended_priority = 1;
-
- state->m_background_layer->set_transparent_pen(15);
- state->m_midground_layer->set_transparent_pen(15);
- state->m_foreground_layer->set_transparent_pen(15);
- state->m_text_layer->set_transparent_pen(15);
+ m_background_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_back_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_foreground_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_fore_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_midground_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_mid_tile_info_cupsoc),this), TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(legionna_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,64,32);
+
+ m_scrollram16 = auto_alloc_array(machine(), UINT16, 0x60/2);
+ m_sprite_xoffs = 0;
+ m_sprite_yoffs = 0;
+
+ m_has_extended_banking = 0;
+ m_has_extended_priority = 1;
+
+ m_background_layer->set_transparent_pen(15);
+ m_midground_layer->set_transparent_pen(15);
+ m_foreground_layer->set_transparent_pen(15);
+ m_text_layer->set_transparent_pen(15);
}
-VIDEO_START(grainbow)
+VIDEO_START_MEMBER(legionna_state,grainbow)
{
- legionna_state *state = machine.driver_data<legionna_state>();
- VIDEO_START_CALL(legionna);
- state->m_sprite_xoffs = state->m_sprite_yoffs = 16;
+ VIDEO_START_CALL_MEMBER(legionna);
+ m_sprite_xoffs = m_sprite_yoffs = 16;
- state->m_has_extended_banking = 0;
- state->m_has_extended_priority = 1;
+ m_has_extended_banking = 0;
+ m_has_extended_priority = 1;
}
-VIDEO_START(godzilla)
+VIDEO_START_MEMBER(legionna_state,godzilla)
{
- legionna_state *state = machine.driver_data<legionna_state>();
- VIDEO_START_CALL(legionna);
+ VIDEO_START_CALL_MEMBER(legionna);
- state->m_has_extended_banking = 1;
- state->m_has_extended_priority = 0;
+ m_has_extended_banking = 1;
+ m_has_extended_priority = 0;
}
diff --git a/src/mame/video/leland.c b/src/mame/video/leland.c
index 0e93a8fad05..a5f3db38699 100644
--- a/src/mame/video/leland.c
+++ b/src/mame/video/leland.c
@@ -55,27 +55,25 @@ static TIMER_CALLBACK( scanline_callback )
*
*************************************/
-static VIDEO_START( leland )
+VIDEO_START_MEMBER(leland_state,leland)
{
- leland_state *state = machine.driver_data<leland_state>();
/* allocate memory */
- state->m_video_ram = auto_alloc_array_clear(machine, UINT8, VRAM_SIZE);
+ m_video_ram = auto_alloc_array_clear(machine(), UINT8, VRAM_SIZE);
/* scanline timer */
- state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
- state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
+ m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_callback));
+ m_scanline_timer->adjust(machine().primary_screen->time_until_pos(0));
}
-static VIDEO_START( ataxx )
+VIDEO_START_MEMBER(leland_state,ataxx)
{
- leland_state *state = machine.driver_data<leland_state>();
/* first do the standard stuff */
- VIDEO_START_CALL(leland);
+ VIDEO_START_CALL_MEMBER(leland);
/* allocate memory */
- state->m_ataxx_qram = auto_alloc_array_clear(machine, UINT8, QRAM_SIZE);
+ m_ataxx_qram = auto_alloc_array_clear(machine(), UINT8, QRAM_SIZE);
}
@@ -525,7 +523,7 @@ static SCREEN_UPDATE_IND16( ataxx )
MACHINE_CONFIG_FRAGMENT( leland_video )
MCFG_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
- MCFG_VIDEO_START(leland)
+ MCFG_VIDEO_START_OVERRIDE(leland_state,leland)
MCFG_PALETTE_LENGTH(1024)
@@ -538,7 +536,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_DERIVED( ataxx_video, leland_video )
- MCFG_VIDEO_START(ataxx)
+ MCFG_VIDEO_START_OVERRIDE(leland_state,ataxx)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_STATIC(ataxx)
MACHINE_CONFIG_END
diff --git a/src/mame/video/lemmings.c b/src/mame/video/lemmings.c
index 71bf4e1f8d1..9fd6e5349cd 100644
--- a/src/mame/video/lemmings.c
+++ b/src/mame/video/lemmings.c
@@ -29,23 +29,22 @@ TILE_GET_INFO_MEMBER(lemmings_state::get_tile_info)
0);
}
-VIDEO_START( lemmings )
+void lemmings_state::video_start()
{
- lemmings_state *state = machine.driver_data<lemmings_state>();
- state->m_vram_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lemmings_state::get_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
+ m_vram_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lemmings_state::get_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
- state->m_vram_tilemap->set_transparent_pen(0);
- state->m_bitmap0.fill(0x100);
+ m_vram_tilemap->set_transparent_pen(0);
+ m_bitmap0.fill(0x100);
- machine.gfx[2]->set_source(state->m_vram_buffer);
+ machine().gfx[2]->set_source(m_vram_buffer);
- machine.device<decospr_device>("spritegen")->alloc_sprite_bitmap();
- machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
- state->save_item(NAME(state->m_bitmap0));
- state->save_item(NAME(state->m_vram_buffer));
- state->save_item(NAME(state->m_sprite_triple_buffer_0));
- state->save_item(NAME(state->m_sprite_triple_buffer_1));
+ save_item(NAME(m_bitmap0));
+ save_item(NAME(m_vram_buffer));
+ save_item(NAME(m_sprite_triple_buffer_0));
+ save_item(NAME(m_sprite_triple_buffer_1));
}
SCREEN_VBLANK( lemmings )
diff --git a/src/mame/video/lethal.c b/src/mame/video/lethal.c
index 928774c8d2c..94728e70afc 100644
--- a/src/mame/video/lethal.c
+++ b/src/mame/video/lethal.c
@@ -47,33 +47,32 @@ void lethalen_tile_callback( running_machine &machine, int layer, int *code, int
*color = state->m_layer_colorbase[layer] + ((*color & 0x3c) << 2);
}
-VIDEO_START(lethalen)
+void lethal_state::video_start()
{
- lethal_state *state = machine.driver_data<lethal_state>();
// this game uses external linescroll RAM
- k056832_SetExtLinescroll(state->m_k056832);
+ k056832_SetExtLinescroll(m_k056832);
// the US and Japanese cabinets apparently use different mirror setups
- if (!strcmp(machine.system().name, "lethalenj"))
+ if (!strcmp(machine().system().name, "lethalenj"))
{
- k056832_set_layer_offs(state->m_k056832, 0, -195, 0);
- k056832_set_layer_offs(state->m_k056832, 1, -193, 0);
- k056832_set_layer_offs(state->m_k056832, 2, -191, 0);
- k056832_set_layer_offs(state->m_k056832, 3, -189, 0);
+ k056832_set_layer_offs(m_k056832, 0, -195, 0);
+ k056832_set_layer_offs(m_k056832, 1, -193, 0);
+ k056832_set_layer_offs(m_k056832, 2, -191, 0);
+ k056832_set_layer_offs(m_k056832, 3, -189, 0);
}
else
{
- k056832_set_layer_offs(state->m_k056832, 0, 188, 0);
- k056832_set_layer_offs(state->m_k056832, 1, 190, 0);
- k056832_set_layer_offs(state->m_k056832, 2, 192, 0);
- k056832_set_layer_offs(state->m_k056832, 3, 194, 0);
+ k056832_set_layer_offs(m_k056832, 0, 188, 0);
+ k056832_set_layer_offs(m_k056832, 1, 190, 0);
+ k056832_set_layer_offs(m_k056832, 2, 192, 0);
+ k056832_set_layer_offs(m_k056832, 3, 194, 0);
}
- state->m_layer_colorbase[0] = 0x00;
- state->m_layer_colorbase[1] = 0x40;
- state->m_layer_colorbase[2] = 0x80;
- state->m_layer_colorbase[3] = 0xc0;
+ m_layer_colorbase[0] = 0x00;
+ m_layer_colorbase[1] = 0x40;
+ m_layer_colorbase[2] = 0x80;
+ m_layer_colorbase[3] = 0xc0;
}
WRITE8_MEMBER(lethal_state::lethalen_palette_control)
diff --git a/src/mame/video/lethalj.c b/src/mame/video/lethalj.c
index b4b75948bd6..36b798f8e81 100644
--- a/src/mame/video/lethalj.c
+++ b/src/mame/video/lethalj.c
@@ -75,15 +75,14 @@ READ16_MEMBER(lethalj_state::lethalj_gun_r)
*
*************************************/
-VIDEO_START( lethalj )
+void lethalj_state::video_start()
{
- lethalj_state *state = machine.driver_data<lethalj_state>();
/* allocate video RAM for screen */
- state->m_screenram = auto_alloc_array(machine, UINT16, BLITTER_DEST_WIDTH * BLITTER_DEST_HEIGHT);
+ m_screenram = auto_alloc_array(machine(), UINT16, BLITTER_DEST_WIDTH * BLITTER_DEST_HEIGHT);
/* predetermine blitter info */
- state->m_blitter_base = (UINT16 *)state->memregion("gfx1")->base();
- state->m_blitter_rows = state->memregion("gfx1")->bytes() / (2*BLITTER_SOURCE_WIDTH);
+ m_blitter_base = (UINT16 *)memregion("gfx1")->base();
+ m_blitter_rows = memregion("gfx1")->bytes() / (2*BLITTER_SOURCE_WIDTH);
}
diff --git a/src/mame/video/liberate.c b/src/mame/video/liberate.c
index 4cabf464dcd..6f2b86ac68e 100644
--- a/src/mame/video/liberate.c
+++ b/src/mame/video/liberate.c
@@ -199,43 +199,39 @@ WRITE8_MEMBER(liberate_state::prosport_bg_vram_w)
/***************************************************************************/
-VIDEO_START( prosoccr )
+VIDEO_START_MEMBER(liberate_state,prosoccr)
{
- liberate_state *state = machine.driver_data<liberate_state>();
- state->m_back_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_back_tile_info),state), tilemap_mapper_delegate(FUNC(liberate_state::back_scan),state), 16, 16, 32, 32);
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_fix_tile_info),state), tilemap_mapper_delegate(FUNC(liberate_state::fix_scan),state), 8, 8, 32, 32);
+ m_back_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_back_tile_info),this), tilemap_mapper_delegate(FUNC(liberate_state::back_scan),this), 16, 16, 32, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_fix_tile_info),this), tilemap_mapper_delegate(FUNC(liberate_state::fix_scan),this), 8, 8, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
+ m_fix_tilemap->set_transparent_pen(0);
- state->m_charram = auto_alloc_array(machine, UINT8, 0x1800 * 2);
+ m_charram = auto_alloc_array(machine(), UINT8, 0x1800 * 2);
}
-VIDEO_START( boomrang )
+VIDEO_START_MEMBER(liberate_state,boomrang)
{
- liberate_state *state = machine.driver_data<liberate_state>();
- state->m_back_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_back_tile_info),state), tilemap_mapper_delegate(FUNC(liberate_state::back_scan),state), 16, 16, 32, 32);
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_fix_tile_info),state), tilemap_mapper_delegate(FUNC(liberate_state::fix_scan),state), 8, 8, 32, 32);
+ m_back_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_back_tile_info),this), tilemap_mapper_delegate(FUNC(liberate_state::back_scan),this), 16, 16, 32, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_fix_tile_info),this), tilemap_mapper_delegate(FUNC(liberate_state::fix_scan),this), 8, 8, 32, 32);
- state->m_back_tilemap->set_transmask(0, 0x0001, 0x007e); /* Bottom 1 pen/Top 7 pens */
- state->m_fix_tilemap->set_transparent_pen(0);
+ m_back_tilemap->set_transmask(0, 0x0001, 0x007e); /* Bottom 1 pen/Top 7 pens */
+ m_fix_tilemap->set_transparent_pen(0);
}
-VIDEO_START( liberate )
+VIDEO_START_MEMBER(liberate_state,liberate)
{
- liberate_state *state = machine.driver_data<liberate_state>();
- state->m_back_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_back_tile_info),state), tilemap_mapper_delegate(FUNC(liberate_state::back_scan),state), 16, 16, 32, 32);
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_fix_tile_info),state), tilemap_mapper_delegate(FUNC(liberate_state::fix_scan),state), 8, 8, 32, 32);
+ m_back_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_back_tile_info),this), tilemap_mapper_delegate(FUNC(liberate_state::back_scan),this), 16, 16, 32, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_fix_tile_info),this), tilemap_mapper_delegate(FUNC(liberate_state::fix_scan),this), 8, 8, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
+ m_fix_tilemap->set_transparent_pen(0);
}
-VIDEO_START( prosport )
+VIDEO_START_MEMBER(liberate_state,prosport)
{
- liberate_state *state = machine.driver_data<liberate_state>();
- state->m_back_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::prosport_get_back_tile_info),state), tilemap_mapper_delegate(FUNC(liberate_state::back_scan),state), 16, 16, 32, 32);
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_fix_tile_info),state), tilemap_mapper_delegate(FUNC(liberate_state::fix_scan),state), 8, 8, 32, 32);
+ m_back_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::prosport_get_back_tile_info),this), tilemap_mapper_delegate(FUNC(liberate_state::back_scan),this), 16, 16, 32, 32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(liberate_state::get_fix_tile_info),this), tilemap_mapper_delegate(FUNC(liberate_state::fix_scan),this), 8, 8, 32, 32);
- state->m_fix_tilemap->set_transparent_pen(0);
+ m_fix_tilemap->set_transparent_pen(0);
}
/***************************************************************************/
@@ -248,9 +244,9 @@ WRITE8_MEMBER(liberate_state::prosport_paletteram_w)
palette_set_color_rgb(machine(), offset, pal3bit(~data >> 0), pal3bit(~data >> 3), pal2bit(~data >> 6));
}
-PALETTE_INIT( liberate )
+PALETTE_INIT_MEMBER(liberate_state,liberate)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i, bit0, bit1, bit2, g, r, b;
for (i = 0;i < 32;i++)
@@ -274,9 +270,9 @@ PALETTE_INIT( liberate )
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
color_prom++;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
- palette_set_color(machine,32,MAKE_RGB(0,0,0)); /* Allocate black for when no background is displayed */
+ palette_set_color(machine(),32,MAKE_RGB(0,0,0)); /* Allocate black for when no background is displayed */
}
/***************************************************************************/
diff --git a/src/mame/video/lkage.c b/src/mame/video/lkage.c
index 92a2ba55183..ae31d2251b7 100644
--- a/src/mame/video/lkage.c
+++ b/src/mame/video/lkage.c
@@ -83,20 +83,19 @@ TILE_GET_INFO_MEMBER(lkage_state::get_tx_tile_info)
SET_TILE_INFO_MEMBER( 0/*gfx*/, code, 0/*color*/, 0/*flags*/);
}
-VIDEO_START( lkage )
+void lkage_state::video_start()
{
- lkage_state *state = machine.driver_data<lkage_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lkage_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lkage_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lkage_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lkage_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lkage_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lkage_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(-5, -5 + 24);
- state->m_fg_tilemap->set_scrolldx(-3, -3 + 24);
- state->m_tx_tilemap->set_scrolldx(-1, -1 + 24);
+ m_bg_tilemap->set_scrolldx(-5, -5 + 24);
+ m_fg_tilemap->set_scrolldx(-3, -3 + 24);
+ m_tx_tilemap->set_scrolldx(-1, -1 + 24);
}
diff --git a/src/mame/video/lockon.c b/src/mame/video/lockon.c
index 4ada68b152e..e59dce1febf 100644
--- a/src/mame/video/lockon.c
+++ b/src/mame/video/lockon.c
@@ -98,9 +98,9 @@ static const res_net_info lockon_pd_net_info =
}
};
-PALETTE_INIT( lockon )
+void lockon_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 1024; ++i)
@@ -122,7 +122,7 @@ PALETTE_INIT( lockon )
b = compute_res_net((p1 & 0x1f), 2, &lockon_pd_net_info);
}
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -895,30 +895,29 @@ static void hud_draw( running_machine &machine, bitmap_ind16 &bitmap, const rect
*
*************************************/
-VIDEO_START( lockon )
+void lockon_state::video_start()
{
- lockon_state *state = machine.driver_data<lockon_state>();
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lockon_state::get_lockon_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_tilemap->set_transparent_pen(0);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lockon_state::get_lockon_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_tilemap->set_transparent_pen(0);
/* Allocate the two frame buffers for rotation */
- state->m_back_buffer = auto_bitmap_ind16_alloc(machine, 512, 512);
- state->m_front_buffer = auto_bitmap_ind16_alloc(machine, 512, 512);
+ m_back_buffer = auto_bitmap_ind16_alloc(machine(), 512, 512);
+ m_front_buffer = auto_bitmap_ind16_alloc(machine(), 512, 512);
/* 2kB of object ASIC palette RAM */
- state->m_obj_pal_ram = auto_alloc_array(machine, UINT8, 2048);
+ m_obj_pal_ram = auto_alloc_array(machine(), UINT8, 2048);
/* Timer for ground display list callback */
- state->m_bufend_timer = machine.scheduler().timer_alloc(FUNC(bufend_callback));
+ m_bufend_timer = machine().scheduler().timer_alloc(FUNC(bufend_callback));
/* Timer for the CRTC cursor pulse */
- state->m_cursor_timer = machine.scheduler().timer_alloc(FUNC(cursor_callback));
- state->m_cursor_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
+ m_cursor_timer = machine().scheduler().timer_alloc(FUNC(cursor_callback));
+ m_cursor_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
- state->save_item(NAME(*state->m_back_buffer));
- state->save_item(NAME(*state->m_front_buffer));
- state->save_pointer(NAME(state->m_obj_pal_ram), 2048);
+ save_item(NAME(*m_back_buffer));
+ save_item(NAME(*m_front_buffer));
+ save_pointer(NAME(m_obj_pal_ram), 2048);
}
SCREEN_UPDATE_IND16( lockon )
diff --git a/src/mame/video/lordgun.c b/src/mame/video/lordgun.c
index c3b844b642e..9c2e6697d55 100644
--- a/src/mame/video/lordgun.c
+++ b/src/mame/video/lordgun.c
@@ -94,45 +94,44 @@ WRITE16_MEMBER(lordgun_state::lordgun_vram_3_w){ lordgun_vram_w(&space, offset,
***************************************************************************/
-VIDEO_START( lordgun )
+void lordgun_state::video_start()
{
- lordgun_state *state = machine.driver_data<lordgun_state>();
int i;
- int w = machine.primary_screen->width();
- int h = machine.primary_screen->height();
+ int w = machine().primary_screen->width();
+ int h = machine().primary_screen->height();
// 0x800 x 200
- state->m_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lordgun_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS,8,8, 0x100, 0x40 );
+ m_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lordgun_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS,8,8, 0x100, 0x40 );
// 0x800 x 200
- state->m_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lordgun_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS,16,16, 0x80,0x20 );
+ m_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lordgun_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS,16,16, 0x80,0x20 );
// 0x800 x 200
- state->m_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lordgun_state::get_tile_info_2),state), TILEMAP_SCAN_ROWS,32,32, 0x40,0x10 );
+ m_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lordgun_state::get_tile_info_2),this), TILEMAP_SCAN_ROWS,32,32, 0x40,0x10 );
// 0x200 x 100
- state->m_tilemap[3] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lordgun_state::get_tile_info_3),state), TILEMAP_SCAN_ROWS,8,8, 0x40,0x20 );
+ m_tilemap[3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lordgun_state::get_tile_info_3),this), TILEMAP_SCAN_ROWS,8,8, 0x40,0x20 );
- state->m_tilemap[0]->set_scroll_rows(1);
- state->m_tilemap[0]->set_scroll_cols(1);
- state->m_tilemap[0]->set_transparent_pen(0x3f);
+ m_tilemap[0]->set_scroll_rows(1);
+ m_tilemap[0]->set_scroll_cols(1);
+ m_tilemap[0]->set_transparent_pen(0x3f);
// Has line scroll
- state->m_tilemap[1]->set_scroll_rows(0x200);
- state->m_tilemap[1]->set_scroll_cols(1);
- state->m_tilemap[1]->set_transparent_pen(0x3f);
+ m_tilemap[1]->set_scroll_rows(0x200);
+ m_tilemap[1]->set_scroll_cols(1);
+ m_tilemap[1]->set_transparent_pen(0x3f);
- state->m_tilemap[2]->set_scroll_rows(1);
- state->m_tilemap[2]->set_scroll_cols(1);
- state->m_tilemap[2]->set_transparent_pen(0x3f);
+ m_tilemap[2]->set_scroll_rows(1);
+ m_tilemap[2]->set_scroll_cols(1);
+ m_tilemap[2]->set_transparent_pen(0x3f);
- state->m_tilemap[3]->set_scroll_rows(1);
- state->m_tilemap[3]->set_scroll_cols(1);
- state->m_tilemap[3]->set_transparent_pen(0x3f);
+ m_tilemap[3]->set_scroll_rows(1);
+ m_tilemap[3]->set_scroll_cols(1);
+ m_tilemap[3]->set_transparent_pen(0x3f);
// Buffer bitmaps for 4 tilemaps (0-3) + sprites (4)
for (i = 0; i < 5; i++)
- state->m_bitmaps[i] = auto_bitmap_ind16_alloc(machine, w, h);
+ m_bitmaps[i] = auto_bitmap_ind16_alloc(machine(), w, h);
}
/***************************************************************************
diff --git a/src/mame/video/lucky74.c b/src/mame/video/lucky74.c
index fc012d5dcde..a104cafcd2e 100644
--- a/src/mame/video/lucky74.c
+++ b/src/mame/video/lucky74.c
@@ -123,13 +123,13 @@ WRITE8_MEMBER(lucky74_state::lucky74_bg_colorram_w)
}
-PALETTE_INIT( lucky74 )
+void lucky74_state::palette_init()
/*
There are 2 states (see the technical notes).
We're constructing a double-sized palette with one half for each state.
*/
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
static const int resistances_rgb[4] = { 2000, 1000, 470, 220 };
double weights_r[4], weights_g[4], weights_b[4];
@@ -144,42 +144,42 @@ PALETTE_INIT( lucky74 )
{
int bit0, bit1, bit2, bit3, r1, g1, b1, r2, g2, b2;
- /* red component (state 1, PROM E6) */
+ /* red component (this 1, PROM E6) */
bit0 = (color_prom[0x000 + i] >> 0) & 0x01;
bit1 = (color_prom[0x000 + i] >> 1) & 0x01;
bit2 = (color_prom[0x000 + i] >> 2) & 0x01;
bit3 = (color_prom[0x000 + i] >> 3) & 0x01;
r1 = combine_4_weights(weights_r, bit0, bit1, bit2, bit3);
- /* red component (state 2, PROM E7) */
+ /* red component (this 2, PROM E7) */
bit0 = (color_prom[0x100 + i] >> 0) & 0x01;
bit1 = (color_prom[0x100 + i] >> 1) & 0x01;
bit2 = (color_prom[0x100 + i] >> 2) & 0x01;
bit3 = (color_prom[0x100 + i] >> 3) & 0x01;
r2 = combine_4_weights(weights_r, bit0, bit1, bit2, bit3);
- /* green component (state 1, PROM D6) */
+ /* green component (this 1, PROM D6) */
bit0 = (color_prom[0x200 + i] >> 0) & 0x01;
bit1 = (color_prom[0x200 + i] >> 1) & 0x01;
bit2 = (color_prom[0x200 + i] >> 2) & 0x01;
bit3 = (color_prom[0x200 + i] >> 3) & 0x01;
g1 = combine_4_weights(weights_g, bit0, bit1, bit2, bit3);
- /* green component (state 2, PROM D7) */
+ /* green component (this 2, PROM D7) */
bit0 = (color_prom[0x300 + i] >> 0) & 0x01;
bit1 = (color_prom[0x300 + i] >> 1) & 0x01;
bit2 = (color_prom[0x300 + i] >> 2) & 0x01;
bit3 = (color_prom[0x300 + i] >> 3) & 0x01;
g2 = combine_4_weights(weights_g, bit0, bit1, bit2, bit3);
- /* blue component (state 1, PROM C6) */
+ /* blue component (this 1, PROM C6) */
bit0 = (color_prom[0x400 + i] >> 0) & 0x01;
bit1 = (color_prom[0x400 + i] >> 1) & 0x01;
bit2 = (color_prom[0x400 + i] >> 2) & 0x01;
bit3 = (color_prom[0x400 + i] >> 3) & 0x01;
b1 = combine_4_weights(weights_b, bit0, bit1, bit2, bit3);
- /* blue component (state 2, PROM C7) */
+ /* blue component (this 2, PROM C7) */
bit0 = (color_prom[0x500 + i] >> 0) & 0x01;
bit1 = (color_prom[0x500 + i] >> 1) & 0x01;
bit2 = (color_prom[0x500 + i] >> 2) & 0x01;
@@ -188,10 +188,10 @@ PALETTE_INIT( lucky74 )
/* PROMs circuitry, 1st state */
- palette_set_color(machine, i, MAKE_RGB(r1, g1, b1));
+ palette_set_color(machine(), i, MAKE_RGB(r1, g1, b1));
/* PROMs circuitry, 2nd state */
- palette_set_color(machine, i + 256, MAKE_RGB(r2, g2, b2));
+ palette_set_color(machine(), i + 256, MAKE_RGB(r2, g2, b2));
}
}
@@ -227,13 +227,12 @@ TILE_GET_INFO_MEMBER(lucky74_state::get_bg_tile_info)
}
-VIDEO_START( lucky74 )
+void lucky74_state::video_start()
{
- lucky74_state *state = machine.driver_data<lucky74_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lucky74_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lucky74_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lucky74_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lucky74_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
SCREEN_UPDATE_IND16( lucky74 )
diff --git a/src/mame/video/lvcards.c b/src/mame/video/lvcards.c
index 7206659c48f..be4eb04c730 100644
--- a/src/mame/video/lvcards.c
+++ b/src/mame/video/lvcards.c
@@ -10,12 +10,12 @@
#include "includes/lvcards.h"
-PALETTE_INIT( ponttehk )
+PALETTE_INIT_MEMBER(lvcards_state,ponttehk)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for ( i = 0; i < machine.total_colors(); i++ )
+ for ( i = 0; i < machine().total_colors(); i++ )
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -27,31 +27,31 @@ PALETTE_INIT( ponttehk )
r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* green component */
- bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine().total_colors()] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[2*machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[2*machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[2*machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[2*machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
}
-PALETTE_INIT( lvcards ) //Ever so slightly different, but different enough.
+void lvcards_state::palette_init()//Ever so slightly different, but different enough.
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for ( i = 0; i < machine.total_colors(); i++ )
+ for ( i = 0; i < machine().total_colors(); i++ )
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -63,20 +63,20 @@ PALETTE_INIT( lvcards ) //Ever so slightly different, but different enough.
r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* green component */
- bit0 = (color_prom[machine.total_colors()] >> 0) & 0x11;
- bit1 = (color_prom[machine.total_colors()] >> 1) & 0x11;
- bit2 = (color_prom[machine.total_colors()] >> 2) & 0x11;
- bit3 = (color_prom[machine.total_colors()] >> 3) & 0x11;
+ bit0 = (color_prom[machine().total_colors()] >> 0) & 0x11;
+ bit1 = (color_prom[machine().total_colors()] >> 1) & 0x11;
+ bit2 = (color_prom[machine().total_colors()] >> 2) & 0x11;
+ bit3 = (color_prom[machine().total_colors()] >> 3) & 0x11;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x11;
- bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x11;
- bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x11;
- bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x11;
+ bit0 = (color_prom[2*machine().total_colors()] >> 0) & 0x11;
+ bit1 = (color_prom[2*machine().total_colors()] >> 1) & 0x11;
+ bit2 = (color_prom[2*machine().total_colors()] >> 2) & 0x11;
+ bit3 = (color_prom[2*machine().total_colors()] >> 3) & 0x11;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
@@ -104,10 +104,9 @@ TILE_GET_INFO_MEMBER(lvcards_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( lvcards )
+void lvcards_state::video_start()
{
- lvcards_state *state = machine.driver_data<lvcards_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lvcards_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lvcards_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
}
diff --git a/src/mame/video/lwings.c b/src/mame/video/lwings.c
index a51110e0a12..41cb67839fb 100644
--- a/src/mame/video/lwings.c
+++ b/src/mame/video/lwings.c
@@ -78,37 +78,34 @@ TILE_GET_INFO_MEMBER(lwings_state::get_bg2_tile_info)
***************************************************************************/
-VIDEO_START( lwings )
+void lwings_state::video_start()
{
- lwings_state *state = machine.driver_data<lwings_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lwings_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lwings_state::lwings_get_bg1_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lwings_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lwings_state::lwings_get_bg1_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(3);
+ m_fg_tilemap->set_transparent_pen(3);
}
-VIDEO_START( trojan )
+VIDEO_START_MEMBER(lwings_state,trojan)
{
- lwings_state *state = machine.driver_data<lwings_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lwings_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lwings_state::trojan_get_bg1_tile_info),state),TILEMAP_SCAN_COLS, 16, 16, 32, 32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(lwings_state::get_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(lwings_state::get_bg2_memory_offset),state), 16, 16, 32, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lwings_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lwings_state::trojan_get_bg1_tile_info),this),TILEMAP_SCAN_COLS, 16, 16, 32, 32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lwings_state::get_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(lwings_state::get_bg2_memory_offset),this), 16, 16, 32, 16);
- state->m_fg_tilemap->set_transparent_pen(3);
- state->m_bg1_tilemap->set_transmask(0, 0xffff, 0x0001); /* split type 0 is totally transparent in front half */
- state->m_bg1_tilemap->set_transmask(1, 0xf07f, 0x0f81); /* split type 1 has pens 7-11 opaque in front half */
+ m_fg_tilemap->set_transparent_pen(3);
+ m_bg1_tilemap->set_transmask(0, 0xffff, 0x0001); /* split type 0 is totally transparent in front half */
+ m_bg1_tilemap->set_transmask(1, 0xf07f, 0x0f81); /* split type 1 has pens 7-11 opaque in front half */
- state->m_bg2_avenger_hw = 0;
+ m_bg2_avenger_hw = 0;
}
-VIDEO_START( avengers )
+VIDEO_START_MEMBER(lwings_state,avengers)
{
- lwings_state *state = machine.driver_data<lwings_state>();
- VIDEO_START_CALL(trojan);
- state->m_bg2_avenger_hw = 1;
+ VIDEO_START_CALL_MEMBER(trojan);
+ m_bg2_avenger_hw = 1;
}
/***************************************************************************
diff --git a/src/mame/video/m10.c b/src/mame/video/m10.c
index aff8a1c418f..f96cd1d6891 100644
--- a/src/mame/video/m10.c
+++ b/src/mame/video/m10.c
@@ -98,30 +98,28 @@ INLINE void plot_pixel_m10( running_machine &machine, bitmap_ind16 &bm, int x, i
(IREMM10_HBSTART - 1) - (x - IREMM10_HBEND)) = col; // only when flip_screen(?)
}
-VIDEO_START( m10 )
+VIDEO_START_MEMBER(m10_state,m10)
{
- m10_state *state = machine.driver_data<m10_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m10_state::get_tile_info),state), tilemap_mapper_delegate(FUNC(m10_state::tilemap_scan),state), 8, 8, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_scrolldx(0, 62);
- state->m_tx_tilemap->set_scrolldy(0, 0);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m10_state::get_tile_info),this), tilemap_mapper_delegate(FUNC(m10_state::tilemap_scan),this), 8, 8, 32, 32);
+ m_tx_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_scrolldx(0, 62);
+ m_tx_tilemap->set_scrolldy(0, 0);
- state->m_back_gfx = auto_alloc(machine, gfx_element(machine, backlayout, state->m_chargen, 8, 0));
+ m_back_gfx = auto_alloc(machine(), gfx_element(machine(), backlayout, m_chargen, 8, 0));
- machine.gfx[1] = state->m_back_gfx;
+ machine().gfx[1] = m_back_gfx;
return ;
}
-VIDEO_START( m15 )
+VIDEO_START_MEMBER(m10_state,m15)
{
- m10_state *state = machine.driver_data<m10_state>();
- machine.gfx[0] = auto_alloc(machine, gfx_element(machine, charlayout, state->m_chargen, 8, 0));
+ machine().gfx[0] = auto_alloc(machine(), gfx_element(machine(), charlayout, m_chargen, 8, 0));
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m10_state::get_tile_info),state),tilemap_mapper_delegate(FUNC(m10_state::tilemap_scan),state), 8, 8, 32, 32);
- state->m_tx_tilemap->set_scrolldx(0, 116);
- state->m_tx_tilemap->set_scrolldy(0, 0);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m10_state::get_tile_info),this),tilemap_mapper_delegate(FUNC(m10_state::tilemap_scan),this), 8, 8, 32, 32);
+ m_tx_tilemap->set_scrolldx(0, 116);
+ m_tx_tilemap->set_scrolldy(0, 0);
return ;
}
diff --git a/src/mame/video/m107.c b/src/mame/video/m107.c
index 74b32bcf840..196454dcdec 100644
--- a/src/mame/video/m107.c
+++ b/src/mame/video/m107.c
@@ -118,20 +118,19 @@ WRITE16_MEMBER(m107_state::m107_control_w)
/*****************************************************************************/
-VIDEO_START( m107 )
+void m107_state::video_start()
{
- m107_state *state = machine.driver_data<m107_state>();
int laynum;
for (laynum = 0; laynum < 4; laynum++)
{
- pf_layer_info *layer = &state->m_pf_layer[laynum];
+ pf_layer_info *layer = &m_pf_layer[laynum];
/* allocate a tilemaps per layer */
- layer->tmap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m107_state::get_pf_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,64);
+ layer->tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m107_state::get_pf_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,64);
/* set the user data to point to the layer */
- layer->tmap->set_user_data(&state->m_pf_layer[laynum]);
+ layer->tmap->set_user_data(&m_pf_layer[laynum]);
/* set scroll offsets */
layer->tmap->set_scrolldx(-3 + 2 * laynum, -3 + 2 * laynum);
@@ -142,7 +141,7 @@ VIDEO_START( m107 )
layer->tmap->set_transparent_pen(0);
}
- state->m_buffered_spriteram = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
+ m_buffered_spriteram = auto_alloc_array_clear(machine(), UINT16, 0x1000/2);
}
/*****************************************************************************/
diff --git a/src/mame/video/m52.c b/src/mame/video/m52.c
index 6555255cf29..b34f5a7934b 100644
--- a/src/mame/video/m52.c
+++ b/src/mame/video/m52.c
@@ -17,9 +17,9 @@
*
*************************************/
-PALETTE_INIT( m52 )
+void m52_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
const UINT8 *char_pal = color_prom + 0x000;
const UINT8 *back_pal = color_prom + 0x200;
const UINT8 *sprite_pal = color_prom + 0x220;
@@ -29,7 +29,7 @@ PALETTE_INIT( m52 )
double weights_r[3], weights_g[3], weights_b[3], scale;
int i;
- machine.colortable = colortable_alloc(machine, 512 + 32 + 32);
+ machine().colortable = colortable_alloc(machine(), 512 + 32 + 32);
/* compute palette information for characters/backgrounds */
scale = compute_resistor_weights(0, 255, -1.0,
@@ -45,7 +45,7 @@ PALETTE_INIT( m52 )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_2_weights(weights_b, BIT(promval,6), BIT(promval,7));
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r,g,b));
}
/* background palette */
@@ -56,7 +56,7 @@ PALETTE_INIT( m52 )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_2_weights(weights_b, BIT(promval,6), BIT(promval,7));
- colortable_palette_set_color(machine.colortable, 512+i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable, 512+i, MAKE_RGB(r,g,b));
}
/* compute palette information for sprites */
@@ -73,18 +73,18 @@ PALETTE_INIT( m52 )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
- colortable_palette_set_color(machine.colortable, 512 + 32 + i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable, 512 + 32 + i, MAKE_RGB(r,g,b));
}
/* character lookup table */
for (i = 0; i < 512; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprite lookup table */
for (i = 0; i < 16 * 4; i++)
{
UINT8 promval = sprite_table[(i & 3) | ((i & ~3) << 1)];
- colortable_entry_set_value(machine.colortable, 512 + i, 512 + 32 + promval);
+ colortable_entry_set_value(machine().colortable, 512 + i, 512 + 32 + promval);
}
/* background */
@@ -93,18 +93,18 @@ PALETTE_INIT( m52 )
/* xbb00: mountains */
/* 0xxbb: hills */
/* 1xxbb: city */
- colortable_entry_set_value(machine.colortable, 512+16*4+0*4+0, 512);
- colortable_entry_set_value(machine.colortable, 512+16*4+0*4+1, 512+4);
- colortable_entry_set_value(machine.colortable, 512+16*4+0*4+2, 512+8);
- colortable_entry_set_value(machine.colortable, 512+16*4+0*4+3, 512+12);
- colortable_entry_set_value(machine.colortable, 512+16*4+1*4+0, 512);
- colortable_entry_set_value(machine.colortable, 512+16*4+1*4+1, 512+1);
- colortable_entry_set_value(machine.colortable, 512+16*4+1*4+2, 512+2);
- colortable_entry_set_value(machine.colortable, 512+16*4+1*4+3, 512+3);
- colortable_entry_set_value(machine.colortable, 512+16*4+2*4+0, 512);
- colortable_entry_set_value(machine.colortable, 512+16*4+2*4+1, 512+16+1);
- colortable_entry_set_value(machine.colortable, 512+16*4+2*4+2, 512+16+2);
- colortable_entry_set_value(machine.colortable, 512+16*4+2*4+3, 512+16+3);
+ colortable_entry_set_value(machine().colortable, 512+16*4+0*4+0, 512);
+ colortable_entry_set_value(machine().colortable, 512+16*4+0*4+1, 512+4);
+ colortable_entry_set_value(machine().colortable, 512+16*4+0*4+2, 512+8);
+ colortable_entry_set_value(machine().colortable, 512+16*4+0*4+3, 512+12);
+ colortable_entry_set_value(machine().colortable, 512+16*4+1*4+0, 512);
+ colortable_entry_set_value(machine().colortable, 512+16*4+1*4+1, 512+1);
+ colortable_entry_set_value(machine().colortable, 512+16*4+1*4+2, 512+2);
+ colortable_entry_set_value(machine().colortable, 512+16*4+1*4+3, 512+3);
+ colortable_entry_set_value(machine().colortable, 512+16*4+2*4+0, 512);
+ colortable_entry_set_value(machine().colortable, 512+16*4+2*4+1, 512+16+1);
+ colortable_entry_set_value(machine().colortable, 512+16*4+2*4+2, 512+16+2);
+ colortable_entry_set_value(machine().colortable, 512+16*4+2*4+3, 512+16+3);
}
@@ -146,22 +146,21 @@ TILE_GET_INFO_MEMBER(m52_state::get_tile_info)
*
*************************************/
-VIDEO_START( m52 )
+void m52_state::video_start()
{
- m52_state *state = machine.driver_data<m52_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m52_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m52_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(128 - 1, -1);
- state->m_bg_tilemap->set_scrolldy(16, 16);
- state->m_bg_tilemap->set_scroll_rows(4); /* only lines 192-256 scroll */
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scrolldx(128 - 1, -1);
+ m_bg_tilemap->set_scrolldy(16, 16);
+ m_bg_tilemap->set_scroll_rows(4); /* only lines 192-256 scroll */
- state->save_item(NAME(state->m_bg1xpos));
- state->save_item(NAME(state->m_bg1ypos));
- state->save_item(NAME(state->m_bg2xpos));
- state->save_item(NAME(state->m_bg2ypos));
- state->save_item(NAME(state->m_bgcontrol));
+ save_item(NAME(m_bg1xpos));
+ save_item(NAME(m_bg1ypos));
+ save_item(NAME(m_bg2xpos));
+ save_item(NAME(m_bg2ypos));
+ save_item(NAME(m_bgcontrol));
}
diff --git a/src/mame/video/m57.c b/src/mame/video/m57.c
index dbd2cda9bc2..52592c4005d 100644
--- a/src/mame/video/m57.c
+++ b/src/mame/video/m57.c
@@ -30,12 +30,12 @@
***************************************************************************/
-PALETTE_INIT( m57 )
+void m57_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- machine.colortable = colortable_alloc(machine, 32 * 8 + 16);
+ machine().colortable = colortable_alloc(machine(), 32 * 8 + 16);
/* character palette */
for (i = 0; i < 256; i++)
@@ -58,8 +58,8 @@ PALETTE_INIT( m57 )
bit2 = (color_prom[0] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r,g,b));
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r,g,b));
+ colortable_entry_set_value(machine().colortable, i, i);
color_prom++;
}
@@ -87,7 +87,7 @@ PALETTE_INIT( m57 )
bit2 = (*color_prom >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i + 256, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable, i + 256, MAKE_RGB(r,g,b));
color_prom++;
}
@@ -98,7 +98,7 @@ PALETTE_INIT( m57 )
/* sprite lookup table */
for (i = 0; i < 32 * 8; i++)
{
- colortable_entry_set_value(machine.colortable, i + 32 * 8, 256 + (~*color_prom & 0x0f));
+ colortable_entry_set_value(machine().colortable, i + 32 * 8, 256 + (~*color_prom & 0x0f));
color_prom++;
}
}
@@ -140,14 +140,13 @@ WRITE8_MEMBER(m57_state::m57_videoram_w)
*
*************************************/
-VIDEO_START( m57 )
+void m57_state::video_start()
{
- m57_state *state = machine.driver_data<m57_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m57_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_rows(256);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m57_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scroll_rows(256);
- state->save_item(NAME(state->m_flipscreen));
+ save_item(NAME(m_flipscreen));
}
diff --git a/src/mame/video/m58.c b/src/mame/video/m58.c
index 07b9a07105c..68c407193e4 100644
--- a/src/mame/video/m58.c
+++ b/src/mame/video/m58.c
@@ -19,9 +19,9 @@
*
*************************************/
-PALETTE_INIT( yard )
+void m58_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
const UINT8 *char_lopal = color_prom + 0x000;
const UINT8 *char_hipal = color_prom + 0x100;
const UINT8 *sprite_pal = color_prom + 0x200;
@@ -33,7 +33,7 @@ PALETTE_INIT( yard )
double weights_r[3], weights_g[3], weights_b[3], scale;
int i;
- machine.colortable = colortable_alloc(machine, 256+256+16);
+ machine().colortable = colortable_alloc(machine(), 256+256+16);
/* compute palette information for characters/radar */
scale = compute_resistor_weights(0, 255, -1.0,
@@ -49,7 +49,7 @@ PALETTE_INIT( yard )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r,g,b));
}
/* radar palette */
@@ -60,7 +60,7 @@ PALETTE_INIT( yard )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
- colortable_palette_set_color(machine.colortable, 256+i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable, 256+i, MAKE_RGB(r,g,b));
}
/* compute palette information for sprites */
@@ -77,22 +77,22 @@ PALETTE_INIT( yard )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
- colortable_palette_set_color(machine.colortable, 256+256+i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable, 256+256+i, MAKE_RGB(r,g,b));
}
/* character lookup table */
for (i = 0; i < 256; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* radar lookup table */
for (i = 0; i < 256; i++)
- colortable_entry_set_value(machine.colortable, 256+i, 256+i);
+ colortable_entry_set_value(machine().colortable, 256+i, 256+i);
/* sprite lookup table */
for (i = 0; i < 256; i++)
{
UINT8 promval = sprite_table[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, 256+256+i, 256+256+promval);
+ colortable_entry_set_value(machine().colortable, 256+256+i, 256+256+promval);
}
}
@@ -174,19 +174,18 @@ TILEMAP_MAPPER_MEMBER(m58_state::yard_tilemap_scan_rows)
*
*************************************/
-VIDEO_START( yard )
+void m58_state::video_start()
{
- m58_state *state = machine.driver_data<m58_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
- const rectangle &visarea = machine.primary_screen->visible_area();
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
+ const rectangle &visarea = machine().primary_screen->visible_area();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m58_state::yard_get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(m58_state::yard_tilemap_scan_rows),state), 8, 8, 64, 32);
- state->m_bg_tilemap->set_scrolldx(visarea.min_x, width - (visarea.max_x + 1));
- state->m_bg_tilemap->set_scrolldy(visarea.min_y - 8, height + 16 - (visarea.max_y + 1));
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m58_state::yard_get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(m58_state::yard_tilemap_scan_rows),this), 8, 8, 64, 32);
+ m_bg_tilemap->set_scrolldx(visarea.min_x, width - (visarea.max_x + 1));
+ m_bg_tilemap->set_scrolldy(visarea.min_y - 8, height + 16 - (visarea.max_y + 1));
- state->m_scroll_panel_bitmap = auto_bitmap_ind16_alloc(machine, SCROLL_PANEL_WIDTH, height);
+ m_scroll_panel_bitmap = auto_bitmap_ind16_alloc(machine(), SCROLL_PANEL_WIDTH, height);
}
diff --git a/src/mame/video/m62.c b/src/mame/video/m62.c
index bdf91377f12..4bfbf2ee347 100644
--- a/src/mame/video/m62.c
+++ b/src/mame/video/m62.c
@@ -197,93 +197,89 @@ static void m62_amplify_contrast(palette_t *palette, UINT32 numcolors)
palette_set_contrast(palette, 255000.0/ymax);
}
-PALETTE_INIT( m62 )
+void m62_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- m62_state *state = machine.driver_data<m62_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t *rgb;
- rgb = compute_res_net_all(machine, color_prom, &m62_tile_decode_info, &m62_tile_net_info);
- palette_set_colors(machine, 0x000, rgb, 0x100);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &m62_tile_decode_info, &m62_tile_net_info);
+ palette_set_colors(machine(), 0x000, rgb, 0x100);
+ auto_free(machine(), rgb);
- rgb = compute_res_net_all(machine, color_prom, &m62_sprite_decode_info, &m62_sprite_net_info);
- palette_set_colors(machine, 0x100, rgb, 0x100);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &m62_sprite_decode_info, &m62_sprite_net_info);
+ palette_set_colors(machine(), 0x100, rgb, 0x100);
+ auto_free(machine(), rgb);
- m62_amplify_contrast(machine.palette,0);
+ m62_amplify_contrast(machine().palette,0);
/* we'll need this at run time */
- state->m_sprite_height_prom = color_prom + 0x600;
+ m_sprite_height_prom = color_prom + 0x600;
}
-PALETTE_INIT( lotlot )
+PALETTE_INIT_MEMBER(m62_state,lotlot)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- m62_state *state = machine.driver_data<m62_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t *rgb;
- rgb = compute_res_net_all(machine, color_prom, &lotlot_tile_decode_info, &m62_tile_net_info);
- palette_set_colors(machine, 0x000, rgb, 0x180);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &lotlot_tile_decode_info, &m62_tile_net_info);
+ palette_set_colors(machine(), 0x000, rgb, 0x180);
+ auto_free(machine(), rgb);
- rgb = compute_res_net_all(machine, color_prom, &lotlot_sprite_decode_info, &m62_sprite_net_info);
- palette_set_colors(machine, 0x180, rgb, 0x180);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &lotlot_sprite_decode_info, &m62_sprite_net_info);
+ palette_set_colors(machine(), 0x180, rgb, 0x180);
+ auto_free(machine(), rgb);
- m62_amplify_contrast(machine.palette,0);
+ m62_amplify_contrast(machine().palette,0);
/* we'll need this at run time */
- state->m_sprite_height_prom = color_prom + 0x900;
+ m_sprite_height_prom = color_prom + 0x900;
}
-PALETTE_INIT( battroad )
+PALETTE_INIT_MEMBER(m62_state,battroad)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- m62_state *state = machine.driver_data<m62_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t *rgb;
// m62 palette
- rgb = compute_res_net_all(machine, color_prom, &m62_tile_decode_info, &m62_tile_net_info);
- palette_set_colors(machine, 0x000, rgb, 0x100);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &m62_tile_decode_info, &m62_tile_net_info);
+ palette_set_colors(machine(), 0x000, rgb, 0x100);
+ auto_free(machine(), rgb);
- rgb = compute_res_net_all(machine, color_prom, &m62_sprite_decode_info, &m62_sprite_net_info);
- palette_set_colors(machine, 0x100, rgb, 0x100);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &m62_sprite_decode_info, &m62_sprite_net_info);
+ palette_set_colors(machine(), 0x100, rgb, 0x100);
+ auto_free(machine(), rgb);
- m62_amplify_contrast(machine.palette,0x200);
+ m62_amplify_contrast(machine().palette,0x200);
// custom palette for foreground
- rgb = compute_res_net_all(machine, color_prom, &battroad_char_decode_info, &battroad_char_net_info);
- palette_set_colors(machine, 0x200, rgb, 0x020);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &battroad_char_decode_info, &battroad_char_net_info);
+ palette_set_colors(machine(), 0x200, rgb, 0x020);
+ auto_free(machine(), rgb);
/* we'll need this at run time */
- state->m_sprite_height_prom = color_prom + 0x620;
+ m_sprite_height_prom = color_prom + 0x620;
}
-PALETTE_INIT( spelunk2 )
+PALETTE_INIT_MEMBER(m62_state,spelunk2)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- m62_state *state = machine.driver_data<m62_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t *rgb;
- rgb = compute_res_net_all(machine, color_prom, &spelunk2_tile_decode_info, &m62_tile_net_info);
- palette_set_colors(machine, 0x000, rgb, 0x200);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &spelunk2_tile_decode_info, &m62_tile_net_info);
+ palette_set_colors(machine(), 0x000, rgb, 0x200);
+ auto_free(machine(), rgb);
- rgb = compute_res_net_all(machine, color_prom, &spelunk2_sprite_decode_info, &m62_sprite_net_info);
- palette_set_colors(machine, 0x200, rgb, 0x100);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &spelunk2_sprite_decode_info, &m62_sprite_net_info);
+ palette_set_colors(machine(), 0x200, rgb, 0x100);
+ auto_free(machine(), rgb);
- m62_amplify_contrast(machine.palette,0);
+ m62_amplify_contrast(machine().palette,0);
/* we'll need this at run time */
- state->m_sprite_height_prom = color_prom + 0x700;
+ m_sprite_height_prom = color_prom + 0x700;
}
@@ -462,10 +458,9 @@ TILE_GET_INFO_MEMBER(m62_state::get_kungfum_bg_tile_info)
tileinfo.category = 0;
}
-VIDEO_START( kungfum )
+VIDEO_START_MEMBER(m62_state,kungfum)
{
- m62_state *state = machine.driver_data<m62_state>();
- m62_start(machine, tilemap_get_info_delegate(FUNC(m62_state::get_kungfum_bg_tile_info),state), 32, 0, 8, 8, 64, 32);
+ m62_start(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_kungfum_bg_tile_info),this), 32, 0, 8, 8, 64, 32);
}
SCREEN_UPDATE_IND16( kungfum )
@@ -507,13 +502,12 @@ TILE_GET_INFO_MEMBER(m62_state::get_ldrun_bg_tile_info)
tileinfo.group = 0;
}
-VIDEO_START( ldrun )
+void m62_state::video_start()
{
- m62_state *state = machine.driver_data<m62_state>();
- m62_start(machine, tilemap_get_info_delegate(FUNC(m62_state::get_ldrun_bg_tile_info),state), 1, 1, 8, 8, 64, 32);
- state->m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
+ m62_start(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_ldrun_bg_tile_info),this), 1, 1, 8, 8, 64, 32);
+ m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
}
SCREEN_UPDATE_IND16( ldrun )
@@ -548,12 +542,11 @@ TILE_GET_INFO_MEMBER(m62_state::get_ldrun2_bg_tile_info)
tileinfo.group = 0;
}
-VIDEO_START( ldrun2 )
+VIDEO_START_MEMBER(m62_state,ldrun2)
{
- m62_state *state = machine.driver_data<m62_state>();
- m62_start(machine, tilemap_get_info_delegate(FUNC(m62_state::get_ldrun2_bg_tile_info),state), 1, 1, 8, 8, 64, 32);
- state->m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
+ m62_start(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_ldrun2_bg_tile_info),this), 1, 1, 8, 8, 64, 32);
+ m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
}
@@ -612,13 +605,12 @@ TILE_GET_INFO_MEMBER(m62_state::get_battroad_fg_tile_info)
SET_TILE_INFO_MEMBER(2, code | ((color & 0x40) << 3) | ((color & 0x10) << 4), color & 0x0f, 0);
}
-VIDEO_START( battroad )
+VIDEO_START_MEMBER(m62_state,battroad)
{
- m62_state *state = machine.driver_data<m62_state>();
- m62_start(machine, tilemap_get_info_delegate(FUNC(m62_state::get_battroad_bg_tile_info),state), 1, 1, 8, 8, 64, 32);
- m62_textlayer(machine, tilemap_get_info_delegate(FUNC(m62_state::get_battroad_fg_tile_info),state), 1, 1, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
+ m62_start(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_battroad_bg_tile_info),this), 1, 1, 8, 8, 64, 32);
+ m62_textlayer(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_battroad_fg_tile_info),this), 1, 1, 8, 8, 32, 32);
+ m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
}
SCREEN_UPDATE_IND16( battroad )
@@ -650,10 +642,9 @@ TILE_GET_INFO_MEMBER(m62_state::get_ldrun4_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code | ((color & 0xc0) << 2) | ((color & 0x20) << 5), color & 0x1f, 0);
}
-VIDEO_START( ldrun4 )
+VIDEO_START_MEMBER(m62_state,ldrun4)
{
- m62_state *state = machine.driver_data<m62_state>();
- m62_start(machine, tilemap_get_info_delegate(FUNC(m62_state::get_ldrun4_bg_tile_info),state), 1, 0, 8, 8, 64, 32);
+ m62_start(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_ldrun4_bg_tile_info),this), 1, 0, 8, 8, 64, 32);
}
SCREEN_UPDATE_IND16( ldrun4 )
@@ -691,11 +682,10 @@ TILE_GET_INFO_MEMBER(m62_state::get_lotlot_fg_tile_info)
SET_TILE_INFO_MEMBER(2, code | ((color & 0xc0) << 2), color & 0x1f, 0);
}
-VIDEO_START( lotlot )
+VIDEO_START_MEMBER(m62_state,lotlot)
{
- m62_state *state = machine.driver_data<m62_state>();
- m62_start(machine, tilemap_get_info_delegate(FUNC(m62_state::get_lotlot_bg_tile_info),state), 1, 1, 12, 10, 32, 64);
- m62_textlayer(machine, tilemap_get_info_delegate(FUNC(m62_state::get_lotlot_fg_tile_info),state), 1, 1, 12, 10, 32, 64);
+ m62_start(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_lotlot_bg_tile_info),this), 1, 1, 12, 10, 32, 64);
+ m62_textlayer(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_lotlot_fg_tile_info),this), 1, 1, 12, 10, 32, 64);
}
SCREEN_UPDATE_IND16( lotlot )
@@ -752,17 +742,16 @@ TILE_GET_INFO_MEMBER(m62_state::get_kidniki_fg_tile_info)
SET_TILE_INFO_MEMBER(2, code | ( ( color & 0xc0 ) << 2 ), color & 0x1f, 0);
}
-VIDEO_START( kidniki )
+VIDEO_START_MEMBER(m62_state,kidniki)
{
- m62_state *state = machine.driver_data<m62_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m62_state::get_kidniki_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m62_state::get_kidniki_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
- register_savestate(machine);
+ register_savestate(machine());
- m62_textlayer(machine, tilemap_get_info_delegate(FUNC(m62_state::get_kidniki_fg_tile_info),state), 1, 1, 12, 8, 32, 64);
+ m62_textlayer(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_kidniki_fg_tile_info),this), 1, 1, 12, 8, 32, 64);
}
SCREEN_UPDATE_IND16( kidniki )
@@ -810,11 +799,10 @@ TILE_GET_INFO_MEMBER(m62_state::get_spelunkr_fg_tile_info)
SET_TILE_INFO_MEMBER(2, code | ((color & 0x10) << 4), (color & 0x0f) | (m_spelunkr_palbank << 4), 0);
}
-VIDEO_START( spelunkr )
+VIDEO_START_MEMBER(m62_state,spelunkr)
{
- m62_state *state = machine.driver_data<m62_state>();
- m62_start(machine, tilemap_get_info_delegate(FUNC(m62_state::get_spelunkr_bg_tile_info),state), 1, 1, 8, 8, 64, 64);
- m62_textlayer(machine, tilemap_get_info_delegate(FUNC(m62_state::get_spelunkr_fg_tile_info),state), 1, 1, 12, 8, 32, 32);
+ m62_start(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_spelunkr_bg_tile_info),this), 1, 1, 8, 8, 64, 64);
+ m62_textlayer(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_spelunkr_fg_tile_info),this), 1, 1, 12, 8, 32, 32);
}
SCREEN_UPDATE_IND16( spelunkr )
@@ -854,11 +842,10 @@ TILE_GET_INFO_MEMBER(m62_state::get_spelunk2_bg_tile_info)
SET_TILE_INFO_MEMBER( 0, code | ((color & 0xf0) << 4), (color & 0x0f) | (m_spelunkr_palbank << 4), 0 );
}
-VIDEO_START( spelunk2 )
+VIDEO_START_MEMBER(m62_state,spelunk2)
{
- m62_state *state = machine.driver_data<m62_state>();
- m62_start(machine, tilemap_get_info_delegate(FUNC(m62_state::get_spelunk2_bg_tile_info),state), 1, 1, 8, 8, 64, 64);
- m62_textlayer(machine, tilemap_get_info_delegate(FUNC(m62_state::get_spelunkr_fg_tile_info),state), 1, 1, 12, 8, 32, 32);
+ m62_start(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_spelunk2_bg_tile_info),this), 1, 1, 8, 8, 64, 64);
+ m62_textlayer(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_spelunkr_fg_tile_info),this), 1, 1, 12, 8, 32, 32);
}
SCREEN_UPDATE_IND16( spelunk2 )
@@ -899,13 +886,12 @@ TILE_GET_INFO_MEMBER(m62_state::get_youjyudn_fg_tile_info)
SET_TILE_INFO_MEMBER(2, code | ((color & 0xc0) << 2), (color & 0x0f), 0);
}
-VIDEO_START( youjyudn )
+VIDEO_START_MEMBER(m62_state,youjyudn)
{
- m62_state *state = machine.driver_data<m62_state>();
- m62_start(machine, tilemap_get_info_delegate(FUNC(m62_state::get_youjyudn_bg_tile_info),state), 1, 0, 8, 16, 64, 16);
- m62_textlayer(machine, tilemap_get_info_delegate(FUNC(m62_state::get_youjyudn_fg_tile_info),state), 1, 1, 12, 8, 32, 32);
- state->m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
+ m62_start(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_youjyudn_bg_tile_info),this), 1, 0, 8, 16, 64, 16);
+ m62_textlayer(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_youjyudn_fg_tile_info),this), 1, 1, 12, 8, 32, 32);
+ m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
}
SCREEN_UPDATE_IND16( youjyudn )
@@ -943,12 +929,11 @@ TILE_GET_INFO_MEMBER(m62_state::get_horizon_bg_tile_info)
tileinfo.group = 0;
}
-VIDEO_START( horizon )
+VIDEO_START_MEMBER(m62_state,horizon)
{
- m62_state *state = machine.driver_data<m62_state>();
- m62_start(machine, tilemap_get_info_delegate(FUNC(m62_state::get_horizon_bg_tile_info),state), 32, 0, 8, 8, 64, 32);
- state->m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
+ m62_start(machine(), tilemap_get_info_delegate(FUNC(m62_state::get_horizon_bg_tile_info),this), 32, 0, 8, 8, 64, 32);
+ m_bg_tilemap->set_transmask(0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
}
SCREEN_UPDATE_IND16( horizon )
diff --git a/src/mame/video/m72.c b/src/mame/video/m72.c
index 8e15ff4778d..9f6be566fae 100644
--- a/src/mame/video/m72.c
+++ b/src/mame/video/m72.c
@@ -109,147 +109,140 @@ static void register_savestate(running_machine &machine)
}
-VIDEO_START( m72 )
+VIDEO_START_MEMBER(m72_state,m72)
{
- m72_state *state = machine.driver_data<m72_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::m72_get_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::m72_get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::m72_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::m72_get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_buffered_spriteram = auto_alloc_array(machine, UINT16, state->m_spriteram.bytes()/2);
+ m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2);
- state->m_fg_tilemap->set_transmask(0,0xffff,0x0001);
- state->m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
- state->m_fg_tilemap->set_transmask(2,0x0001,0xffff);
+ m_fg_tilemap->set_transmask(0,0xffff,0x0001);
+ m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
+ m_fg_tilemap->set_transmask(2,0x0001,0xffff);
- state->m_bg_tilemap->set_transmask(0,0xffff,0x0000);
- state->m_bg_tilemap->set_transmask(1,0x00ff,0xff00);
+ m_bg_tilemap->set_transmask(0,0xffff,0x0000);
+ m_bg_tilemap->set_transmask(1,0x00ff,0xff00);
- //state->m_bg_tilemap->set_transmask(2,0x0001,0xfffe);
- state->m_bg_tilemap->set_transmask(2,0x0007,0xfff8); // needed for lohtj japan warning to look correct
- //state->m_bg_tilemap->set_transmask(2,0x001f,0xffe0); // needed for nspiritj japan warning to look correct
+ //m_bg_tilemap->set_transmask(2,0x0001,0xfffe);
+ m_bg_tilemap->set_transmask(2,0x0007,0xfff8); // needed for lohtj japan warning to look correct
+ //m_bg_tilemap->set_transmask(2,0x001f,0xffe0); // needed for nspiritj japan warning to look correct
// not sure what is needed to be able to see the imgfghto warning message
- memset(state->m_buffered_spriteram,0,state->m_spriteram.bytes());
+ memset(m_buffered_spriteram,0,m_spriteram.bytes());
- state->m_fg_tilemap->set_scrolldx(0,0);
- state->m_fg_tilemap->set_scrolldy(-128,16);
+ m_fg_tilemap->set_scrolldx(0,0);
+ m_fg_tilemap->set_scrolldy(-128,16);
- state->m_bg_tilemap->set_scrolldx(0,0);
- state->m_bg_tilemap->set_scrolldy(-128,16);
+ m_bg_tilemap->set_scrolldx(0,0);
+ m_bg_tilemap->set_scrolldy(-128,16);
- register_savestate(machine);
+ register_savestate(machine());
}
-VIDEO_START( xmultipl )
+VIDEO_START_MEMBER(m72_state,xmultipl)
{
- m72_state *state = machine.driver_data<m72_state>();
- VIDEO_START_CALL(m72);
+ VIDEO_START_CALL_MEMBER(m72);
- state->m_fg_tilemap->set_scrolldx(4,0);
- state->m_bg_tilemap->set_scrolldx(6,0);
+ m_fg_tilemap->set_scrolldx(4,0);
+ m_bg_tilemap->set_scrolldx(6,0);
}
-VIDEO_START( rtype2 )
+VIDEO_START_MEMBER(m72_state,rtype2)
{
- m72_state *state = machine.driver_data<m72_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_buffered_spriteram = auto_alloc_array(machine, UINT16, state->m_spriteram.bytes()/2);
+ m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2);
- state->m_fg_tilemap->set_transmask(0,0xffff,0x0001);
- state->m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
- state->m_fg_tilemap->set_transmask(2,0x0001,0xffff);
+ m_fg_tilemap->set_transmask(0,0xffff,0x0001);
+ m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
+ m_fg_tilemap->set_transmask(2,0x0001,0xffff);
- state->m_bg_tilemap->set_transmask(0,0xffff,0x0000);
- state->m_bg_tilemap->set_transmask(1,0x00ff,0xff00);
- state->m_bg_tilemap->set_transmask(2,0x0001,0xfffe);
+ m_bg_tilemap->set_transmask(0,0xffff,0x0000);
+ m_bg_tilemap->set_transmask(1,0x00ff,0xff00);
+ m_bg_tilemap->set_transmask(2,0x0001,0xfffe);
- memset(state->m_buffered_spriteram,0,state->m_spriteram.bytes());
+ memset(m_buffered_spriteram,0,m_spriteram.bytes());
- state->m_fg_tilemap->set_scrolldx(4,0);
- state->m_fg_tilemap->set_scrolldy(-128,16);
+ m_fg_tilemap->set_scrolldx(4,0);
+ m_fg_tilemap->set_scrolldy(-128,16);
- state->m_bg_tilemap->set_scrolldx(4,0);
- state->m_bg_tilemap->set_scrolldy(-128,16);
+ m_bg_tilemap->set_scrolldx(4,0);
+ m_bg_tilemap->set_scrolldy(-128,16);
- register_savestate(machine);
+ register_savestate(machine());
}
-VIDEO_START( poundfor )
+VIDEO_START_MEMBER(m72_state,poundfor)
{
- m72_state *state = machine.driver_data<m72_state>();
- VIDEO_START_CALL(rtype2);
+ VIDEO_START_CALL_MEMBER(rtype2);
- state->m_fg_tilemap->set_scrolldx(6,0);
- state->m_bg_tilemap->set_scrolldx(6,0);
+ m_fg_tilemap->set_scrolldx(6,0);
+ m_bg_tilemap->set_scrolldx(6,0);
}
-VIDEO_START( hharryu )
+VIDEO_START_MEMBER(m72_state,hharryu)
{
- m72_state *state = machine.driver_data<m72_state>();
- VIDEO_START_CALL(rtype2);
+ VIDEO_START_CALL_MEMBER(rtype2);
- state->m_fg_tilemap->set_scrolldx(4,0);
- state->m_bg_tilemap->set_scrolldx(6,0);
+ m_fg_tilemap->set_scrolldx(4,0);
+ m_bg_tilemap->set_scrolldx(6,0);
}
/* Major Title has a larger background RAM, and rowscroll */
-VIDEO_START( majtitle )
+VIDEO_START_MEMBER(m72_state,majtitle)
{
- m72_state *state = machine.driver_data<m72_state>();
// The tilemap can be 256x64, but seems to be used at 128x64 (scroll wraparound).
// The layout ramains 256x64, the right half is just not displayed.
-// state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,256,64);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_bg_tile_info),state),tilemap_mapper_delegate(FUNC(m72_state::majtitle_scan_rows),state),8,8,128,64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,64);
+// m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,256,64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(m72_state::majtitle_scan_rows),this),8,8,128,64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_buffered_spriteram = auto_alloc_array(machine, UINT16, state->m_spriteram.bytes()/2);
+ m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2);
- state->m_fg_tilemap->set_transmask(0,0xffff,0x0001);
- state->m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
- state->m_fg_tilemap->set_transmask(2,0x0001,0xffff);
+ m_fg_tilemap->set_transmask(0,0xffff,0x0001);
+ m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
+ m_fg_tilemap->set_transmask(2,0x0001,0xffff);
- state->m_bg_tilemap->set_transmask(0,0xffff,0x0000);
- state->m_bg_tilemap->set_transmask(1,0x00ff,0xff00);
- state->m_bg_tilemap->set_transmask(2,0x0001,0xfffe);
+ m_bg_tilemap->set_transmask(0,0xffff,0x0000);
+ m_bg_tilemap->set_transmask(1,0x00ff,0xff00);
+ m_bg_tilemap->set_transmask(2,0x0001,0xfffe);
- memset(state->m_buffered_spriteram,0,state->m_spriteram.bytes());
+ memset(m_buffered_spriteram,0,m_spriteram.bytes());
- state->m_fg_tilemap->set_scrolldx(4,0);
- state->m_fg_tilemap->set_scrolldy(-128,16);
+ m_fg_tilemap->set_scrolldx(4,0);
+ m_fg_tilemap->set_scrolldy(-128,16);
- state->m_bg_tilemap->set_scrolldx(4,0);
- state->m_bg_tilemap->set_scrolldy(-128,16);
+ m_bg_tilemap->set_scrolldx(4,0);
+ m_bg_tilemap->set_scrolldy(-128,16);
- register_savestate(machine);
+ register_savestate(machine());
}
-VIDEO_START( hharry )
+VIDEO_START_MEMBER(m72_state,hharry)
{
- m72_state *state = machine.driver_data<m72_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::hharry_get_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::m72_get_fg_tile_info),state), TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::hharry_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m72_state::m72_get_fg_tile_info),this), TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_buffered_spriteram = auto_alloc_array(machine, UINT16, state->m_spriteram.bytes()/2);
+ m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2);
- state->m_fg_tilemap->set_transmask(0,0xffff,0x0001);
- state->m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
- state->m_fg_tilemap->set_transmask(2,0x0001,0xffff);
+ m_fg_tilemap->set_transmask(0,0xffff,0x0001);
+ m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
+ m_fg_tilemap->set_transmask(2,0x0001,0xffff);
- state->m_bg_tilemap->set_transmask(0,0xffff,0x0000);
- state->m_bg_tilemap->set_transmask(1,0x00ff,0xff00);
- state->m_bg_tilemap->set_transmask(2,0x0001,0xfffe);
+ m_bg_tilemap->set_transmask(0,0xffff,0x0000);
+ m_bg_tilemap->set_transmask(1,0x00ff,0xff00);
+ m_bg_tilemap->set_transmask(2,0x0001,0xfffe);
- memset(state->m_buffered_spriteram,0,state->m_spriteram.bytes());
+ memset(m_buffered_spriteram,0,m_spriteram.bytes());
- state->m_fg_tilemap->set_scrolldx(4,0);
- state->m_fg_tilemap->set_scrolldy(-128,16);
+ m_fg_tilemap->set_scrolldx(4,0);
+ m_fg_tilemap->set_scrolldy(-128,16);
- state->m_bg_tilemap->set_scrolldx(6,0);
- state->m_bg_tilemap->set_scrolldy(-128,16);
+ m_bg_tilemap->set_scrolldx(6,0);
+ m_bg_tilemap->set_scrolldy(-128,16);
- register_savestate(machine);
+ register_savestate(machine());
}
diff --git a/src/mame/video/m90.c b/src/mame/video/m90.c
index c5f946d9443..8f7f29af75f 100644
--- a/src/mame/video/m90.c
+++ b/src/mame/video/m90.c
@@ -93,50 +93,47 @@ TILE_GET_INFO_MEMBER(m90_state::dynablsb_get_pf1w_tile_info){ dynablsb_get_tile_
TILE_GET_INFO_MEMBER(m90_state::dynablsb_get_pf2_tile_info){ dynablsb_get_tile_info(machine(),tileinfo,tile_index,2); }
TILE_GET_INFO_MEMBER(m90_state::dynablsb_get_pf2w_tile_info){ dynablsb_get_tile_info(machine(),tileinfo,tile_index,2); }
-VIDEO_START( m90 )
+void m90_state::video_start()
{
- m90_state *state = machine.driver_data<m90_state>();
- state->m_pf1_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::get_pf1_tile_info),state), TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_pf1_wide_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::get_pf1w_tile_info),state),TILEMAP_SCAN_ROWS,8,8,128,64);
- state->m_pf2_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::get_pf2_tile_info),state), TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_pf2_wide_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::get_pf2w_tile_info),state),TILEMAP_SCAN_ROWS,8,8,128,64);
+ m_pf1_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::get_pf1_tile_info),this), TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_pf1_wide_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::get_pf1w_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,64);
+ m_pf2_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::get_pf2_tile_info),this), TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_pf2_wide_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::get_pf2w_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,64);
- state->m_pf1_layer->set_transparent_pen(0);
- state->m_pf1_wide_layer->set_transparent_pen(0);
+ m_pf1_layer->set_transparent_pen(0);
+ m_pf1_wide_layer->set_transparent_pen(0);
- state_save_register_global_array(machine, state->m_video_control_data);
- state_save_register_global(machine, state->m_last_pf1);
- state_save_register_global(machine, state->m_last_pf2);
+ state_save_register_global_array(machine(), m_video_control_data);
+ state_save_register_global(machine(), m_last_pf1);
+ state_save_register_global(machine(), m_last_pf2);
}
-VIDEO_START( bomblord )
+VIDEO_START_MEMBER(m90_state,bomblord)
{
- m90_state *state = machine.driver_data<m90_state>();
- state->m_pf1_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::bomblord_get_pf1_tile_info),state), TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_pf1_wide_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::bomblord_get_pf1w_tile_info),state),TILEMAP_SCAN_ROWS,8,8,128,64);
- state->m_pf2_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::bomblord_get_pf2_tile_info),state), TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_pf2_wide_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::bomblord_get_pf2w_tile_info),state),TILEMAP_SCAN_ROWS,8,8,128,64);
+ m_pf1_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::bomblord_get_pf1_tile_info),this), TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_pf1_wide_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::bomblord_get_pf1w_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,64);
+ m_pf2_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::bomblord_get_pf2_tile_info),this), TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_pf2_wide_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::bomblord_get_pf2w_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,64);
- state->m_pf2_layer->set_transparent_pen(0);
- state->m_pf2_wide_layer->set_transparent_pen(0);
- state->m_pf1_layer->set_transparent_pen(0);
- state->m_pf1_wide_layer->set_transparent_pen(0);
+ m_pf2_layer->set_transparent_pen(0);
+ m_pf2_wide_layer->set_transparent_pen(0);
+ m_pf1_layer->set_transparent_pen(0);
+ m_pf1_wide_layer->set_transparent_pen(0);
- state_save_register_global_array(machine, state->m_video_control_data);
+ state_save_register_global_array(machine(), m_video_control_data);
}
-VIDEO_START( dynablsb )
+VIDEO_START_MEMBER(m90_state,dynablsb)
{
- m90_state *state = machine.driver_data<m90_state>();
- state->m_pf1_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::dynablsb_get_pf1_tile_info),state), TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_pf1_wide_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::dynablsb_get_pf1w_tile_info),state),TILEMAP_SCAN_ROWS,8,8,128,64);
- state->m_pf2_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::dynablsb_get_pf2_tile_info),state), TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_pf2_wide_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::dynablsb_get_pf2w_tile_info),state),TILEMAP_SCAN_ROWS,8,8,128,64);
+ m_pf1_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::dynablsb_get_pf1_tile_info),this), TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_pf1_wide_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::dynablsb_get_pf1w_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,64);
+ m_pf2_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::dynablsb_get_pf2_tile_info),this), TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_pf2_wide_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m90_state::dynablsb_get_pf2w_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,64);
- state->m_pf2_layer->set_transparent_pen(0);
- state->m_pf2_wide_layer->set_transparent_pen(0);
+ m_pf2_layer->set_transparent_pen(0);
+ m_pf2_wide_layer->set_transparent_pen(0);
- state_save_register_global_array(machine, state->m_video_control_data);
+ state_save_register_global_array(machine(), m_video_control_data);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
diff --git a/src/mame/video/m92.c b/src/mame/video/m92.c
index 04393c0734f..47da5f7972e 100644
--- a/src/mame/video/m92.c
+++ b/src/mame/video/m92.c
@@ -237,23 +237,22 @@ WRITE16_MEMBER(m92_state::m92_master_control_w)
/*****************************************************************************/
-VIDEO_START( m92 )
+VIDEO_START_MEMBER(m92_state,m92)
{
- m92_state *state = machine.driver_data<m92_state>();
int laynum;
- memset(&state->m_pf_layer, 0, sizeof(state->m_pf_layer));
+ memset(&m_pf_layer, 0, sizeof(m_pf_layer));
for (laynum = 0; laynum < 3; laynum++)
{
- pf_layer_info *layer = &state->m_pf_layer[laynum];
+ pf_layer_info *layer = &m_pf_layer[laynum];
/* allocate two tilemaps per layer, one normal, one wide */
- layer->tmap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m92_state::get_pf_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,64);
- layer->wide_tmap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(m92_state::get_pf_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 128,64);
+ layer->tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m92_state::get_pf_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,64);
+ layer->wide_tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(m92_state::get_pf_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 128,64);
/* set the user data for each one to point to the layer */
- layer->tmap->set_user_data(&state->m_pf_layer[laynum]);
- layer->wide_tmap->set_user_data(&state->m_pf_layer[laynum]);
+ layer->tmap->set_user_data(&m_pf_layer[laynum]);
+ layer->wide_tmap->set_user_data(&m_pf_layer[laynum]);
/* set scroll offsets */
layer->tmap->set_scrolldx(2 * laynum, -2 * laynum + 8);
@@ -273,33 +272,32 @@ VIDEO_START( m92 )
layer->tmap->set_transmask(2, 0x0001, (laynum == 2) ? 0xfffe : 0xffff);
layer->wide_tmap->set_transmask(2, 0x0001, (laynum == 2) ? 0xfffe : 0xffff);
- state_save_register_item(machine, "layer", NULL, laynum, layer->vram_base);
- state_save_register_item_array(machine, "layer", NULL, laynum, layer->control);
+ state_save_register_item(machine(), "layer", NULL, laynum, layer->vram_base);
+ state_save_register_item_array(machine(), "layer", NULL, laynum, layer->control);
}
- state->m_generic_paletteram_16.allocate(0x1000/2);
+ m_generic_paletteram_16.allocate(0x1000/2);
- memset(state->m_spriteram->live(),0,0x800);
- memset(state->m_spriteram->buffer(),0,0x800);
+ memset(m_spriteram->live(),0,0x800);
+ memset(m_spriteram->buffer(),0,0x800);
- state->save_item(NAME(state->m_pf_master_control));
- state->save_item(NAME(state->m_videocontrol));
- state->save_item(NAME(state->m_sprite_list));
- state->save_item(NAME(state->m_raster_irq_position));
- state->save_item(NAME(state->m_sprite_buffer_busy));
- state->save_item(NAME(state->m_palette_bank));
+ save_item(NAME(m_pf_master_control));
+ save_item(NAME(m_videocontrol));
+ save_item(NAME(m_sprite_list));
+ save_item(NAME(m_raster_irq_position));
+ save_item(NAME(m_sprite_buffer_busy));
+ save_item(NAME(m_palette_bank));
}
-VIDEO_START( ppan )
+VIDEO_START_MEMBER(m92_state,ppan)
{
- m92_state *state = machine.driver_data<m92_state>();
int laynum;
- VIDEO_START_CALL(m92);
+ VIDEO_START_CALL_MEMBER(m92);
for (laynum = 0; laynum < 3; laynum++)
{
- pf_layer_info *layer = &state->m_pf_layer[laynum];
+ pf_layer_info *layer = &m_pf_layer[laynum];
/* set scroll offsets */
layer->tmap->set_scrolldx(2 * laynum + 11, -2 * laynum + 11);
diff --git a/src/mame/video/macrossp.c b/src/mame/video/macrossp.c
index 5f284c3b80f..e8f1bfa9e27 100644
--- a/src/mame/video/macrossp.c
+++ b/src/mame/video/macrossp.c
@@ -137,30 +137,29 @@ TILE_GET_INFO_MEMBER(macrossp_state::get_macrossp_text_tile_info)
/*** VIDEO START / UPDATE ***/
-VIDEO_START( macrossp )
+void macrossp_state::video_start()
{
- macrossp_state *state = machine.driver_data<macrossp_state>();
- state->m_spriteram_old = auto_alloc_array_clear(machine, UINT32, state->m_spriteram.bytes() / 4);
- state->m_spriteram_old2 = auto_alloc_array_clear(machine, UINT32, state->m_spriteram.bytes() / 4);
+ m_spriteram_old = auto_alloc_array_clear(machine(), UINT32, m_spriteram.bytes() / 4);
+ m_spriteram_old2 = auto_alloc_array_clear(machine(), UINT32, m_spriteram.bytes() / 4);
- state->m_text_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(macrossp_state::get_macrossp_text_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_scra_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(macrossp_state::get_macrossp_scra_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_scrb_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(macrossp_state::get_macrossp_scrb_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_scrc_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(macrossp_state::get_macrossp_scrc_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_text_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(macrossp_state::get_macrossp_text_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_scra_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(macrossp_state::get_macrossp_scra_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_scrb_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(macrossp_state::get_macrossp_scrb_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_scrc_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(macrossp_state::get_macrossp_scrc_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_text_tilemap->set_transparent_pen(0);
- state->m_scra_tilemap->set_transparent_pen(0);
- state->m_scrb_tilemap->set_transparent_pen(0);
- state->m_scrc_tilemap->set_transparent_pen(0);
+ m_text_tilemap->set_transparent_pen(0);
+ m_scra_tilemap->set_transparent_pen(0);
+ m_scrb_tilemap->set_transparent_pen(0);
+ m_scrc_tilemap->set_transparent_pen(0);
- machine.gfx[0]->set_granularity(64);
- machine.gfx[1]->set_granularity(64);
- machine.gfx[2]->set_granularity(64);
- machine.gfx[3]->set_granularity(64);
+ machine().gfx[0]->set_granularity(64);
+ machine().gfx[1]->set_granularity(64);
+ machine().gfx[2]->set_granularity(64);
+ machine().gfx[3]->set_granularity(64);
- state->save_pointer(NAME(state->m_spriteram_old), state->m_spriteram.bytes() / 4);
- state->save_pointer(NAME(state->m_spriteram_old2), state->m_spriteram.bytes() / 4);
+ save_pointer(NAME(m_spriteram_old), m_spriteram.bytes() / 4);
+ save_pointer(NAME(m_spriteram_old2), m_spriteram.bytes() / 4);
}
diff --git a/src/mame/video/madalien.c b/src/mame/video/madalien.c
index ca71a648f15..8f5d740380c 100644
--- a/src/mame/video/madalien.c
+++ b/src/mame/video/madalien.c
@@ -14,13 +14,13 @@
#define PIXEL_CLOCK (MADALIEN_MAIN_CLOCK / 2)
-static PALETTE_INIT( madalien )
+PALETTE_INIT_MEMBER(madalien_state,madalien)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
for (i = 0; i < 0x20; i++)
{
@@ -41,11 +41,11 @@ static PALETTE_INIT( madalien )
if (BIT(color_prom[i], 5))
b += 0xc0;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0; i < 0x10; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
for (i = 0x10; i < 0x20; i++)
{
@@ -57,11 +57,11 @@ static PALETTE_INIT( madalien )
if (BIT((i - 0x10), 2))
ctabentry = ctabentry ^ 0x06;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
for (i = 0x20; i < 0x30; i++)
- colortable_entry_set_value(machine.colortable, i, (i - 0x20) | 0x10);
+ colortable_entry_set_value(machine().colortable, i, (i - 0x20) | 0x10);
}
@@ -117,17 +117,16 @@ WRITE8_MEMBER(madalien_state::madalien_videoram_w)
}
-static VIDEO_START( madalien )
+VIDEO_START_MEMBER(madalien_state,madalien)
{
- madalien_state *state = machine.driver_data<madalien_state>();
int i;
static const tilemap_mapper_delegate scan_functions[4] =
{
- tilemap_mapper_delegate(FUNC(madalien_state::scan_mode0),state),
- tilemap_mapper_delegate(FUNC(madalien_state::scan_mode1),state),
- tilemap_mapper_delegate(FUNC(madalien_state::scan_mode2),state),
- tilemap_mapper_delegate(FUNC(madalien_state::scan_mode3),state)
+ tilemap_mapper_delegate(FUNC(madalien_state::scan_mode0),this),
+ tilemap_mapper_delegate(FUNC(madalien_state::scan_mode1),this),
+ tilemap_mapper_delegate(FUNC(madalien_state::scan_mode2),this),
+ tilemap_mapper_delegate(FUNC(madalien_state::scan_mode3),this)
};
static const int tilemap_cols[4] =
@@ -135,28 +134,28 @@ static VIDEO_START( madalien )
16, 16, 32, 32
};
- state->m_tilemap_fg = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(madalien_state::get_tile_info_FG),state), TILEMAP_SCAN_COLS_FLIP_X, 8, 8, 32, 32);
- state->m_tilemap_fg->set_transparent_pen(0);
- state->m_tilemap_fg->set_scrolldx(0, 0x50);
- state->m_tilemap_fg->set_scrolldy(0, 0x20);
+ m_tilemap_fg = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(madalien_state::get_tile_info_FG),this), TILEMAP_SCAN_COLS_FLIP_X, 8, 8, 32, 32);
+ m_tilemap_fg->set_transparent_pen(0);
+ m_tilemap_fg->set_scrolldx(0, 0x50);
+ m_tilemap_fg->set_scrolldy(0, 0x20);
for (i = 0; i < 4; i++)
{
- state->m_tilemap_edge1[i] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(madalien_state::get_tile_info_BG_1),state), scan_functions[i], 16, 16, tilemap_cols[i], 8);
- state->m_tilemap_edge1[i]->set_scrolldx(0, 0x50);
- state->m_tilemap_edge1[i]->set_scrolldy(0, 0x20);
+ m_tilemap_edge1[i] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(madalien_state::get_tile_info_BG_1),this), scan_functions[i], 16, 16, tilemap_cols[i], 8);
+ m_tilemap_edge1[i]->set_scrolldx(0, 0x50);
+ m_tilemap_edge1[i]->set_scrolldy(0, 0x20);
- state->m_tilemap_edge2[i] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(madalien_state::get_tile_info_BG_2),state), scan_functions[i], 16, 16, tilemap_cols[i], 8);
- state->m_tilemap_edge2[i]->set_scrolldx(0, 0x50);
- state->m_tilemap_edge2[i]->set_scrolldy(0, machine.primary_screen->height() - 256);
+ m_tilemap_edge2[i] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(madalien_state::get_tile_info_BG_2),this), scan_functions[i], 16, 16, tilemap_cols[i], 8);
+ m_tilemap_edge2[i]->set_scrolldx(0, 0x50);
+ m_tilemap_edge2[i]->set_scrolldy(0, machine().primary_screen->height() - 256);
}
- state->m_headlight_bitmap = auto_bitmap_ind16_alloc(machine, 128, 128);
+ m_headlight_bitmap = auto_bitmap_ind16_alloc(machine(), 128, 128);
- machine.gfx[0]->set_source(state->m_charram);
+ machine().gfx[0]->set_source(m_charram);
- drawgfx_opaque(*state->m_headlight_bitmap, state->m_headlight_bitmap->cliprect(), machine.gfx[2], 0, 0, 0, 0, 0x00, 0x00);
- drawgfx_opaque(*state->m_headlight_bitmap, state->m_headlight_bitmap->cliprect(), machine.gfx[2], 0, 0, 0, 1, 0x00, 0x40);
+ drawgfx_opaque(*m_headlight_bitmap, m_headlight_bitmap->cliprect(), machine().gfx[2], 0, 0, 0, 0, 0x00, 0x00);
+ drawgfx_opaque(*m_headlight_bitmap, m_headlight_bitmap->cliprect(), machine().gfx[2], 0, 0, 0, 1, 0x00, 0x40);
}
@@ -401,8 +400,8 @@ MACHINE_CONFIG_FRAGMENT( madalien_video )
MCFG_GFXDECODE(madalien)
MCFG_PALETTE_LENGTH(0x30)
- MCFG_PALETTE_INIT(madalien)
- MCFG_VIDEO_START(madalien)
+ MCFG_PALETTE_INIT_OVERRIDE(madalien_state,madalien)
+ MCFG_VIDEO_START_OVERRIDE(madalien_state,madalien)
MCFG_MC6845_ADD("crtc", MC6845, PIXEL_CLOCK / 8, mc6845_intf)
MACHINE_CONFIG_END
diff --git a/src/mame/video/madmotor.c b/src/mame/video/madmotor.c
index c3bd372c782..1af35e9cff3 100644
--- a/src/mame/video/madmotor.c
+++ b/src/mame/video/madmotor.c
@@ -13,7 +13,7 @@
/******************************************************************************/
-VIDEO_START( madmotor )
+void madmotor_state::video_start()
{
}
diff --git a/src/mame/video/magmax.c b/src/mame/video/magmax.c
index a5353613a50..536221f8797 100644
--- a/src/mame/video/magmax.c
+++ b/src/mame/video/magmax.c
@@ -24,13 +24,13 @@ Additional tweaking by Jarek Burczynski
bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE
***************************************************************************/
-PALETTE_INIT( magmax )
+void magmax_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -39,7 +39,7 @@ PALETTE_INIT( magmax )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -47,39 +47,38 @@ PALETTE_INIT( magmax )
/* characters use colors 0-0x0f */
for (i = 0; i < 0x10; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/*sprites use colors 0x10-0x1f, color 0x1f being transparent*/
for (i = 0x10; i < 0x110; i++)
{
UINT8 ctabentry = (color_prom[i - 0x10] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* background uses all colors (no lookup table) */
for (i = 0x110; i < 0x210; i++)
- colortable_entry_set_value(machine.colortable, i, i - 0x110);
+ colortable_entry_set_value(machine().colortable, i, i - 0x110);
}
-VIDEO_START( magmax )
+void magmax_state::video_start()
{
- magmax_state *state = machine.driver_data<magmax_state>();
int i,v;
- UINT8 * prom14D = state->memregion("user2")->base();
+ UINT8 * prom14D = memregion("user2")->base();
/* Set up save state */
- state_save_register_global(machine, state->m_flipscreen);
+ state_save_register_global(machine(), m_flipscreen);
- state->m_prom_tab = auto_alloc_array(machine, UINT32, 256);
+ m_prom_tab = auto_alloc_array(machine(), UINT32, 256);
- machine.primary_screen->register_screen_bitmap(state->m_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_bitmap);
/* Allocate temporary bitmap */
for (i=0; i<256; i++)
{
v = (prom14D[i] << 4) + prom14D[i + 0x100];
- state->m_prom_tab[i] = ((v&0x1f)<<8) | ((v&0x10)<<10) | ((v&0xe0)>>1); /*convert data into more useful format*/
+ m_prom_tab[i] = ((v&0x1f)<<8) | ((v&0x10)<<10) | ((v&0xe0)>>1); /*convert data into more useful format*/
}
}
diff --git a/src/mame/video/mainevt.c b/src/mame/video/mainevt.c
index b44b842ca11..28c033f0e30 100644
--- a/src/mame/video/mainevt.c
+++ b/src/mame/video/mainevt.c
@@ -73,22 +73,20 @@ void dv_sprite_callback(running_machine &machine, int *code,int *color,int *prio
/*****************************************************************************/
-VIDEO_START( mainevt )
+VIDEO_START_MEMBER(mainevt_state,mainevt)
{
- mainevt_state *state = machine.driver_data<mainevt_state>();
- state->m_layer_colorbase[0] = 0;
- state->m_layer_colorbase[1] = 8;
- state->m_layer_colorbase[2] = 4;
- state->m_sprite_colorbase = 12;
+ m_layer_colorbase[0] = 0;
+ m_layer_colorbase[1] = 8;
+ m_layer_colorbase[2] = 4;
+ m_sprite_colorbase = 12;
}
-VIDEO_START( dv )
+VIDEO_START_MEMBER(mainevt_state,dv)
{
- mainevt_state *state = machine.driver_data<mainevt_state>();
- state->m_layer_colorbase[0] = 0;
- state->m_layer_colorbase[1] = 0;
- state->m_layer_colorbase[2] = 4;
- state->m_sprite_colorbase = 8;
+ m_layer_colorbase[0] = 0;
+ m_layer_colorbase[1] = 0;
+ m_layer_colorbase[2] = 4;
+ m_sprite_colorbase = 8;
}
/*****************************************************************************/
diff --git a/src/mame/video/mainsnk.c b/src/mame/video/mainsnk.c
index db2d10a46f4..b3b3c9bdf47 100644
--- a/src/mame/video/mainsnk.c
+++ b/src/mame/video/mainsnk.c
@@ -2,9 +2,9 @@
#include "includes/mainsnk.h"
-PALETTE_INIT( mainsnk )
+void mainsnk_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
int num_colors = 0x400;
@@ -30,7 +30,7 @@ PALETTE_INIT( mainsnk )
bit3 = (color_prom[i + num_colors] >> 1) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -67,18 +67,17 @@ TILE_GET_INFO_MEMBER(mainsnk_state::get_bg_tile_info)
}
-VIDEO_START(mainsnk)
+void mainsnk_state::video_start()
{
- mainsnk_state *state = machine.driver_data<mainsnk_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mainsnk_state::get_tx_tile_info),state), tilemap_mapper_delegate(FUNC(mainsnk_state::marvins_tx_scan_cols),state), 8, 8, 36, 28);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mainsnk_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mainsnk_state::get_tx_tile_info),this), tilemap_mapper_delegate(FUNC(mainsnk_state::marvins_tx_scan_cols),this), 8, 8, 36, 28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mainsnk_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_scrolldy(8, 8);
+ m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_scrolldy(8, 8);
- state->m_bg_tilemap->set_scrolldx(16, 16);
- state->m_bg_tilemap->set_scrolldy(8, 8);
+ m_bg_tilemap->set_scrolldx(16, 16);
+ m_bg_tilemap->set_scrolldy(8, 8);
}
diff --git a/src/mame/video/mappy.c b/src/mame/video/mappy.c
index 1045e89e2b9..574ac40a33c 100644
--- a/src/mame/video/mappy.c
+++ b/src/mame/video/mappy.c
@@ -30,9 +30,9 @@
***************************************************************************/
-PALETTE_INIT( superpac )
+PALETTE_INIT_MEMBER(mappy_state,superpac)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
int i;
@@ -44,7 +44,7 @@ PALETTE_INIT( superpac )
2, &resistances[1], bweights, 0, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 32);
+ machine().colortable = colortable_alloc(machine(), 32);
/* create a lookup table for the palette */
for (i = 0; i < 32; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( superpac )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -79,20 +79,20 @@ PALETTE_INIT( superpac )
for (i = 0; i < 64*4; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, (ctabentry ^ 15) + 0x10);
+ colortable_entry_set_value(machine().colortable, i, (ctabentry ^ 15) + 0x10);
}
/* sprites map to the lower 16 palette entries */
for (i = 64*4; i < 128*4; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
-PALETTE_INIT( mappy )
+PALETTE_INIT_MEMBER(mappy_state,mappy)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
int i;
@@ -104,7 +104,7 @@ PALETTE_INIT( mappy )
2, &resistances[1], bweights, 0, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 32);
+ machine().colortable = colortable_alloc(machine(), 32);
/* create a lookup table for the palette */
for (i = 0; i < 32; i++)
@@ -129,7 +129,7 @@ PALETTE_INIT( mappy )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -139,14 +139,14 @@ PALETTE_INIT( mappy )
for (i = 0*4; i < 64*4; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry + 0x10);
+ colortable_entry_set_value(machine().colortable, i, ctabentry + 0x10);
}
/* sprites map to the lower 16 palette entries */
- for (i = 64*4; i < machine.total_colors(); i++)
+ for (i = 64*4; i < machine().total_colors(); i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -162,9 +162,9 @@ PALETTE_INIT( mappy )
***************************************************************************/
-PALETTE_INIT( phozon )
+PALETTE_INIT_MEMBER(mappy_state,phozon)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[4] = { 2200, 1000, 470, 220 };
double rweights[4], gweights[4], bweights[4];
int i;
@@ -176,7 +176,7 @@ PALETTE_INIT( phozon )
4, &resistances[0], bweights, 0, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 32);
+ machine().colortable = colortable_alloc(machine(), 32);
/* create a lookup table for the palette */
for (i = 0; i < 32; i++)
@@ -205,7 +205,7 @@ PALETTE_INIT( phozon )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -215,14 +215,14 @@ PALETTE_INIT( phozon )
for (i = 0; i < 64*4; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites map to the upper 16 palette entries */
for (i = 64*4; i < 128*4; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry + 0x10);
+ colortable_entry_set_value(machine().colortable, i, ctabentry + 0x10);
}
}
@@ -318,35 +318,32 @@ TILE_GET_INFO_MEMBER(mappy_state::mappy_get_tile_info)
***************************************************************************/
-VIDEO_START( superpac )
+VIDEO_START_MEMBER(mappy_state,superpac)
{
- mappy_state *state = machine.driver_data<mappy_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mappy_state::superpac_get_tile_info),state),tilemap_mapper_delegate(FUNC(mappy_state::superpac_tilemap_scan),state),8,8,36,28);
- machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mappy_state::superpac_get_tile_info),this),tilemap_mapper_delegate(FUNC(mappy_state::superpac_tilemap_scan),this),8,8,36,28);
+ machine().primary_screen->register_screen_bitmap(m_sprite_bitmap);
- colortable_configure_tilemap_groups(machine.colortable, state->m_bg_tilemap, machine.gfx[0], 31);
+ colortable_configure_tilemap_groups(machine().colortable, m_bg_tilemap, machine().gfx[0], 31);
}
-VIDEO_START( phozon )
+VIDEO_START_MEMBER(mappy_state,phozon)
{
- mappy_state *state = machine.driver_data<mappy_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mappy_state::phozon_get_tile_info),state),tilemap_mapper_delegate(FUNC(mappy_state::superpac_tilemap_scan),state),8,8,36,28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mappy_state::phozon_get_tile_info),this),tilemap_mapper_delegate(FUNC(mappy_state::superpac_tilemap_scan),this),8,8,36,28);
- colortable_configure_tilemap_groups(machine.colortable, state->m_bg_tilemap, machine.gfx[0], 15);
+ colortable_configure_tilemap_groups(machine().colortable, m_bg_tilemap, machine().gfx[0], 15);
- state->save_item(NAME(state->m_scroll));
+ save_item(NAME(m_scroll));
}
-VIDEO_START( mappy )
+VIDEO_START_MEMBER(mappy_state,mappy)
{
- mappy_state *state = machine.driver_data<mappy_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mappy_state::mappy_get_tile_info),state),tilemap_mapper_delegate(FUNC(mappy_state::mappy_tilemap_scan),state),8,8,36,60);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mappy_state::mappy_get_tile_info),this),tilemap_mapper_delegate(FUNC(mappy_state::mappy_tilemap_scan),this),8,8,36,60);
- colortable_configure_tilemap_groups(machine.colortable, state->m_bg_tilemap, machine.gfx[0], 31);
- state->m_bg_tilemap->set_scroll_cols(36);
+ colortable_configure_tilemap_groups(machine().colortable, m_bg_tilemap, machine().gfx[0], 31);
+ m_bg_tilemap->set_scroll_cols(36);
}
diff --git a/src/mame/video/marineb.c b/src/mame/video/marineb.c
index 07b8c781b57..208bf333469 100644
--- a/src/mame/video/marineb.c
+++ b/src/mame/video/marineb.c
@@ -10,12 +10,12 @@
#include "includes/marineb.h"
-PALETTE_INIT( marineb )
+void marineb_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -26,16 +26,16 @@ PALETTE_INIT( marineb )
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
/* green component */
bit0 = (color_prom[i] >> 3) & 0x01;
- bit1 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
- bit2 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
+ bit1 = (color_prom[i + machine().total_colors()] >> 0) & 0x01;
+ bit2 = (color_prom[i + machine().total_colors()] >> 1) & 0x01;
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
/* blue component */
bit0 = 0;
- bit1 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
- bit2 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
+ bit1 = (color_prom[i + machine().total_colors()] >> 2) & 0x01;
+ bit2 = (color_prom[i + machine().total_colors()] >> 3) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
}
@@ -65,17 +65,16 @@ TILE_GET_INFO_MEMBER(marineb_state::get_tile_info)
*
*************************************/
-VIDEO_START( marineb )
+void marineb_state::video_start()
{
- marineb_state *state = machine.driver_data<marineb_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(marineb_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(marineb_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scroll_cols(32);
- state->save_item(NAME(state->m_palette_bank));
- state->save_item(NAME(state->m_column_scroll));
- state->save_item(NAME(state->m_flipscreen_x));
- state->save_item(NAME(state->m_flipscreen_y));
+ save_item(NAME(m_palette_bank));
+ save_item(NAME(m_column_scroll));
+ save_item(NAME(m_flipscreen_x));
+ save_item(NAME(m_flipscreen_y));
}
diff --git a/src/mame/video/mario.c b/src/mame/video/mario.c
index d450d3fe5c9..a592af7c0cb 100644
--- a/src/mame/video/mario.c
+++ b/src/mame/video/mario.c
@@ -62,20 +62,20 @@ static const res_net_info mario_net_info_std =
bit 0 -- 470 ohm resistor -- inverter -- BLUE
***************************************************************************/
-PALETTE_INIT( mario )
+void mario_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t *rgb;
- rgb = compute_res_net_all(machine, color_prom, &mario_decode_info, &mario_net_info);
- palette_set_colors(machine, 0, rgb, 256);
- auto_free(machine, rgb);
- rgb = compute_res_net_all(machine, color_prom+256, &mario_decode_info, &mario_net_info_std);
- palette_set_colors(machine, 256, rgb, 256);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &mario_decode_info, &mario_net_info);
+ palette_set_colors(machine(), 0, rgb, 256);
+ auto_free(machine(), rgb);
+ rgb = compute_res_net_all(machine(), color_prom+256, &mario_decode_info, &mario_net_info_std);
+ palette_set_colors(machine(), 256, rgb, 256);
+ auto_free(machine(), rgb);
- palette_normalize_range(machine.palette, 0, 255, 0, 255);
- palette_normalize_range(machine.palette, 256, 511, 0, 255);
+ palette_normalize_range(machine().palette, 0, 255, 0, 255);
+ palette_normalize_range(machine().palette, 256, 511, 0, 255);
}
WRITE8_MEMBER(mario_state::mario_videoram_w)
@@ -135,20 +135,19 @@ TILE_GET_INFO_MEMBER(mario_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( mario )
+void mario_state::video_start()
{
- mario_state *state = machine.driver_data<mario_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mario_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mario_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_gfx_bank = 0;
- state->m_palette_bank = 0;
- state->m_gfx_scroll = 0;
- state->save_item(NAME(state->m_gfx_bank));
- state->save_item(NAME(state->m_palette_bank));
- state->save_item(NAME(state->m_gfx_scroll));
- state->save_item(NAME(state->m_flip));
+ m_gfx_bank = 0;
+ m_palette_bank = 0;
+ m_gfx_scroll = 0;
+ save_item(NAME(m_gfx_bank));
+ save_item(NAME(m_palette_bank));
+ save_item(NAME(m_gfx_scroll));
+ save_item(NAME(m_flip));
}
/*
diff --git a/src/mame/video/markham.c b/src/mame/video/markham.c
index 78c73dbb0fe..b2c6ebe6523 100644
--- a/src/mame/video/markham.c
+++ b/src/mame/video/markham.c
@@ -11,13 +11,13 @@
#include "emu.h"
#include "includes/markham.h"
-PALETTE_INIT( markham )
+void markham_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -26,7 +26,7 @@ PALETTE_INIT( markham )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -36,7 +36,7 @@ PALETTE_INIT( markham )
for (i = 0; i < 0x400; i++)
{
UINT8 ctabentry = color_prom[i];
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -64,12 +64,11 @@ TILE_GET_INFO_MEMBER(markham_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( markham )
+void markham_state::video_start()
{
- markham_state *state = machine.driver_data<markham_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(markham_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(markham_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap->set_scroll_rows(32);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/matmania.c b/src/mame/video/matmania.c
index 3e2694bc7ec..0d9818e0cbe 100644
--- a/src/mame/video/matmania.c
+++ b/src/mame/video/matmania.c
@@ -41,9 +41,9 @@
bit 0 -- 2.2kohm resistor -- BLUE
***************************************************************************/
-PALETTE_INIT( matmania )
+void matmania_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 64; i++)
@@ -66,7 +66,7 @@ PALETTE_INIT( matmania )
bit3 = BIT(color_prom[64], 3);
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
}
@@ -113,15 +113,14 @@ WRITE8_MEMBER(matmania_state::matmania_paletteram_w)
***************************************************************************/
-VIDEO_START( matmania )
+void matmania_state::video_start()
{
- matmania_state *state = machine.driver_data<matmania_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
/* Mat Mania has a virtual screen twice as large as the visible screen */
- state->m_tmpbitmap = auto_bitmap_ind16_alloc(machine, width, 2 * height);
- state->m_tmpbitmap2 = auto_bitmap_ind16_alloc(machine, width, 2 * height);
+ m_tmpbitmap = auto_bitmap_ind16_alloc(machine(), width, 2 * height);
+ m_tmpbitmap2 = auto_bitmap_ind16_alloc(machine(), width, 2 * height);
}
diff --git a/src/mame/video/mcatadv.c b/src/mame/video/mcatadv.c
index 9d64e773eb3..f183c26ac8c 100644
--- a/src/mame/video/mcatadv.c
+++ b/src/mame/video/mcatadv.c
@@ -248,23 +248,22 @@ SCREEN_UPDATE_IND16( mcatadv )
return 0;
}
-VIDEO_START( mcatadv )
+void mcatadv_state::video_start()
{
- mcatadv_state *state = machine.driver_data<mcatadv_state>();
- state->m_tilemap1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcatadv_state::get_mcatadv_tile_info1),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tilemap1->set_transparent_pen(0);
+ m_tilemap1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcatadv_state::get_mcatadv_tile_info1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tilemap1->set_transparent_pen(0);
- state->m_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcatadv_state::get_mcatadv_tile_info2),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tilemap2->set_transparent_pen(0);
+ m_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcatadv_state::get_mcatadv_tile_info2),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tilemap2->set_transparent_pen(0);
- state->m_spriteram_old = auto_alloc_array_clear(machine, UINT16, state->m_spriteram.bytes() / 2);
- state->m_vidregs_old = auto_alloc_array(machine, UINT16, (0x0f + 1) / 2);
+ m_spriteram_old = auto_alloc_array_clear(machine(), UINT16, m_spriteram.bytes() / 2);
+ m_vidregs_old = auto_alloc_array(machine(), UINT16, (0x0f + 1) / 2);
- state->m_palette_bank1 = 0;
- state->m_palette_bank2 = 0;
+ m_palette_bank1 = 0;
+ m_palette_bank2 = 0;
- state->save_pointer(NAME(state->m_spriteram_old), state->m_spriteram.bytes() / 2);
- state->save_pointer(NAME(state->m_vidregs_old), (0x0f + 1) / 2);
+ save_pointer(NAME(m_spriteram_old), m_spriteram.bytes() / 2);
+ save_pointer(NAME(m_vidregs_old), (0x0f + 1) / 2);
}
SCREEN_VBLANK( mcatadv )
diff --git a/src/mame/video/mcd212.c b/src/mame/video/mcd212.c
index 0dd8b1ba517..892f0d46f39 100644
--- a/src/mame/video/mcd212.c
+++ b/src/mame/video/mcd212.c
@@ -1648,17 +1648,16 @@ void mcd212_ab_init(mcd212_ab_t *mcd212_ab)
}
}
-VIDEO_START( cdimono1 )
+void cdi_state::video_start()
{
- cdi_state *state = machine.driver_data<cdi_state>();
- mcd212_ab_init(&state->m_mcd212_ab);
- mcd212_init(machine, &state->m_mcd212_regs);
- state->m_mcd212_regs.scan_timer = machine.scheduler().timer_alloc(FUNC(mcd212_perform_scan));
- state->m_mcd212_regs.scan_timer->adjust(machine.primary_screen->time_until_pos(0, 0));
+ mcd212_ab_init(&m_mcd212_ab);
+ mcd212_init(machine(), &m_mcd212_regs);
+ m_mcd212_regs.scan_timer = machine().scheduler().timer_alloc(FUNC(mcd212_perform_scan));
+ m_mcd212_regs.scan_timer->adjust(machine().primary_screen->time_until_pos(0, 0));
- screen_device *screen = downcast<screen_device *>(machine.device("lcd"));
- screen->register_screen_bitmap(state->m_lcdbitmap);
+ screen_device *screen = downcast<screen_device *>(machine().device("lcd"));
+ screen->register_screen_bitmap(m_lcdbitmap);
}
SCREEN_UPDATE_RGB32( cdimono1 )
diff --git a/src/mame/video/mcr.c b/src/mame/video/mcr.c
index 22eacc0d306..74a13ca8ab1 100644
--- a/src/mame/video/mcr.c
+++ b/src/mame/video/mcr.c
@@ -95,26 +95,25 @@ TILE_GET_INFO_MEMBER(mcr_state::mcr_91490_get_tile_info)
*
*************************************/
-VIDEO_START( mcr )
+VIDEO_START_MEMBER(mcr_state,mcr)
{
- mcr_state *state = machine.driver_data<mcr_state>();
/* the tilemap callback is based on the CPU board */
switch (mcr_cpu_board)
{
case 90009:
- bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcr_state::mcr_90009_get_tile_info),state), TILEMAP_SCAN_ROWS, 16,16, 32,30);
+ bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr_state::mcr_90009_get_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,30);
break;
case 90010:
- bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcr_state::mcr_90010_get_tile_info),state), TILEMAP_SCAN_ROWS, 16,16, 32,30);
+ bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr_state::mcr_90010_get_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,30);
break;
case 91475:
- bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcr_state::mcr_90010_get_tile_info),state), TILEMAP_SCAN_ROWS, 16,16, 32,30);
+ bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr_state::mcr_90010_get_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,30);
break;
case 91490:
- bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcr_state::mcr_91490_get_tile_info),state), TILEMAP_SCAN_ROWS, 16,16, 32,30);
+ bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr_state::mcr_91490_get_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,30);
break;
default:
diff --git a/src/mame/video/mcr3.c b/src/mame/video/mcr3.c
index f739e1f286c..f527fda1122 100644
--- a/src/mame/video/mcr3.c
+++ b/src/mame/video/mcr3.c
@@ -67,13 +67,13 @@ TILE_GET_INFO_MEMBER(mcr3_state::spyhunt_get_alpha_tile_info)
*
*************************************/
-PALETTE_INIT( spyhunt )
+PALETTE_INIT_MEMBER(mcr3_state,spyhunt)
{
/* alpha colors are hard-coded */
- palette_set_color(machine,4*16+0,MAKE_RGB(0x00,0x00,0x00));
- palette_set_color(machine,4*16+1,MAKE_RGB(0x00,0xff,0x00));
- palette_set_color(machine,4*16+2,MAKE_RGB(0x00,0x00,0xff));
- palette_set_color(machine,4*16+3,MAKE_RGB(0xff,0xff,0xff));
+ palette_set_color(machine(),4*16+0,MAKE_RGB(0x00,0x00,0x00));
+ palette_set_color(machine(),4*16+1,MAKE_RGB(0x00,0xff,0x00));
+ palette_set_color(machine(),4*16+2,MAKE_RGB(0x00,0x00,0xff));
+ palette_set_color(machine(),4*16+3,MAKE_RGB(0xff,0xff,0xff));
}
@@ -85,38 +85,35 @@ PALETTE_INIT( spyhunt )
*************************************/
#ifdef UNUSED_FUNCTION
-VIDEO_START( mcr3 )
+VIDEO_START_MEMBER(mcr3_state,mcr3)
{
- mcr3_state *state = machine.driver_data<mcr3_state>();
/* initialize the background tilemap */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcr3_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16,16, 32,30);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr3_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,30);
}
#endif
-VIDEO_START( mcrmono )
+VIDEO_START_MEMBER(mcr3_state,mcrmono)
{
- mcr3_state *state = machine.driver_data<mcr3_state>();
/* initialize the background tilemap */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcr3_state::mcrmono_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16,16, 32,30);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr3_state::mcrmono_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,30);
}
-VIDEO_START( spyhunt )
+VIDEO_START_MEMBER(mcr3_state,spyhunt)
{
- mcr3_state *state = machine.driver_data<mcr3_state>();
/* initialize the background tilemap */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcr3_state::spyhunt_get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(mcr3_state::spyhunt_bg_scan),state), 64,32, 64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr3_state::spyhunt_get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(mcr3_state::spyhunt_bg_scan),this), 64,32, 64,32);
/* initialize the text tilemap */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcr3_state::spyhunt_get_alpha_tile_info),state), TILEMAP_SCAN_COLS, 16,16, 32,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
- state->m_alpha_tilemap->set_scrollx(0, 16);
-
- state_save_register_global(machine, state->m_spyhunt_sprite_color_mask);
- state_save_register_global(machine, state->m_spyhunt_scrollx);
- state_save_register_global(machine, state->m_spyhunt_scrolly);
- state_save_register_global(machine, state->m_spyhunt_scroll_offset);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr3_state::spyhunt_get_alpha_tile_info),this), TILEMAP_SCAN_COLS, 16,16, 32,32);
+ m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap->set_scrollx(0, 16);
+
+ state_save_register_global(machine(), m_spyhunt_sprite_color_mask);
+ state_save_register_global(machine(), m_spyhunt_scrollx);
+ state_save_register_global(machine(), m_spyhunt_scrolly);
+ state_save_register_global(machine(), m_spyhunt_scroll_offset);
}
diff --git a/src/mame/video/mcr68.c b/src/mame/video/mcr68.c
index 871f54c6175..16a5d6bd075 100644
--- a/src/mame/video/mcr68.c
+++ b/src/mame/video/mcr68.c
@@ -56,35 +56,33 @@ TILE_GET_INFO_MEMBER(mcr68_state::zwackery_get_fg_tile_info)
*
*************************************/
-VIDEO_START( mcr68 )
+VIDEO_START_MEMBER(mcr68_state,mcr68)
{
- mcr68_state *state = machine.driver_data<mcr68_state>();
/* initialize the background tilemap */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcr68_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16,16, 32,32);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr68_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,32);
+ m_bg_tilemap->set_transparent_pen(0);
}
-VIDEO_START( zwackery )
+VIDEO_START_MEMBER(mcr68_state,zwackery)
{
- mcr68_state *state = machine.driver_data<mcr68_state>();
- const UINT8 *colordatabase = (const UINT8 *)state->memregion("gfx3")->base();
- gfx_element *gfx0 = machine.gfx[0];
- gfx_element *gfx2 = machine.gfx[2];
+ const UINT8 *colordatabase = (const UINT8 *)memregion("gfx3")->base();
+ gfx_element *gfx0 = machine().gfx[0];
+ gfx_element *gfx2 = machine().gfx[2];
UINT8 *srcdata0, *dest0;
UINT8 *srcdata2, *dest2;
int code, y, x;
/* initialize the background tilemap */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcr68_state::zwackery_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16,16, 32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr68_state::zwackery_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,32);
/* initialize the foreground tilemap */
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mcr68_state::zwackery_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16,16, 32,32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mcr68_state::zwackery_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,32);
+ m_fg_tilemap->set_transparent_pen(0);
/* allocate memory for the assembled gfx data */
- srcdata0 = auto_alloc_array(machine, UINT8, gfx0->elements() * gfx0->width() * gfx0->height());
- srcdata2 = auto_alloc_array(machine, UINT8, gfx2->elements() * gfx2->width() * gfx2->height());
+ srcdata0 = auto_alloc_array(machine(), UINT8, gfx0->elements() * gfx0->width() * gfx0->height());
+ srcdata2 = auto_alloc_array(machine(), UINT8, gfx2->elements() * gfx2->width() * gfx2->height());
/* "colorize" each code */
dest0 = srcdata0;
diff --git a/src/mame/video/meadows.c b/src/mame/video/meadows.c
index a877184199f..4c261dfcce3 100644
--- a/src/mame/video/meadows.c
+++ b/src/mame/video/meadows.c
@@ -32,10 +32,9 @@ TILE_GET_INFO_MEMBER(meadows_state::get_tile_info)
*
*************************************/
-VIDEO_START( meadows )
+void meadows_state::video_start()
{
- meadows_state *state = machine.driver_data<meadows_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(meadows_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,30);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(meadows_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,30);
}
diff --git a/src/mame/video/megasys1.c b/src/mame/video/megasys1.c
index ed518ecf089..a8c8d47c7dc 100644
--- a/src/mame/video/megasys1.c
+++ b/src/mame/video/megasys1.c
@@ -220,31 +220,30 @@ static void create_tilemaps(running_machine &machine);
-VIDEO_START( megasys1 )
+VIDEO_START_MEMBER(megasys1_state,megasys1)
{
- megasys1_state *state = machine.driver_data<megasys1_state>();
int i;
- state->m_spriteram = &state->m_ram[0x8000/2];
+ m_spriteram = &m_ram[0x8000/2];
- state->m_buffer_objectram = auto_alloc_array(machine, UINT16, 0x2000);
- state->m_buffer_spriteram16 = auto_alloc_array(machine, UINT16, 0x2000);
- state->m_buffer2_objectram = auto_alloc_array(machine, UINT16, 0x2000);
- state->m_buffer2_spriteram16 = auto_alloc_array(machine, UINT16, 0x2000);
+ m_buffer_objectram = auto_alloc_array(machine(), UINT16, 0x2000);
+ m_buffer_spriteram16 = auto_alloc_array(machine(), UINT16, 0x2000);
+ m_buffer2_objectram = auto_alloc_array(machine(), UINT16, 0x2000);
+ m_buffer2_spriteram16 = auto_alloc_array(machine(), UINT16, 0x2000);
- create_tilemaps(machine);
- state->m_tmap[0] = state->m_tilemap[0][0][0];
- state->m_tmap[1] = state->m_tilemap[1][0][0];
- state->m_tmap[2] = state->m_tilemap[2][0][0];
+ create_tilemaps(machine());
+ m_tmap[0] = m_tilemap[0][0][0];
+ m_tmap[1] = m_tilemap[1][0][0];
+ m_tmap[2] = m_tilemap[2][0][0];
- state->m_active_layers = state->m_sprite_bank = state->m_screen_flag = state->m_sprite_flag = 0;
+ m_active_layers = m_sprite_bank = m_screen_flag = m_sprite_flag = 0;
for (i = 0; i < 3; i ++)
{
- state->m_scroll_flag[i] = state->m_scrollx[i] = state->m_scrolly[i] = 0;
+ m_scroll_flag[i] = m_scrollx[i] = m_scrolly[i] = 0;
}
- state->m_bits_per_color_code = 4;
+ m_bits_per_color_code = 4;
/*
The tile code of a specific layer is multiplied for a constant
@@ -263,19 +262,19 @@ VIDEO_START( megasys1 )
for each layer and hardwired to 1x or 4x for both tile sizes
*/
- state->m_8x8_scroll_factor[0] = 1; state->m_16x16_scroll_factor[0] = 4;
- state->m_8x8_scroll_factor[1] = 1; state->m_16x16_scroll_factor[1] = 4;
- state->m_8x8_scroll_factor[2] = 1; state->m_16x16_scroll_factor[2] = 4;
+ m_8x8_scroll_factor[0] = 1; m_16x16_scroll_factor[0] = 4;
+ m_8x8_scroll_factor[1] = 1; m_16x16_scroll_factor[1] = 4;
+ m_8x8_scroll_factor[2] = 1; m_16x16_scroll_factor[2] = 4;
- if (strcmp(machine.system().name, "soldamj") == 0)
+ if (strcmp(machine().system().name, "soldamj") == 0)
{
- state->m_8x8_scroll_factor[1] = 4; state->m_16x16_scroll_factor[1] = 4;
+ m_8x8_scroll_factor[1] = 4; m_16x16_scroll_factor[1] = 4;
}
- state->m_hardware_type_z = 0;
- if (strcmp(machine.system().name, "lomakai") == 0 ||
- strcmp(machine.system().name, "makaiden") == 0)
- state->m_hardware_type_z = 1;
+ m_hardware_type_z = 0;
+ if (strcmp(machine().system().name, "lomakai") == 0 ||
+ strcmp(machine().system().name, "makaiden") == 0)
+ m_hardware_type_z = 1;
}
/***************************************************************************
@@ -749,10 +748,9 @@ static const struct priority priorities[] =
pens.
*/
-PALETTE_INIT( megasys1 )
+PALETTE_INIT_MEMBER(megasys1_state,megasys1)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- megasys1_state *state = machine.driver_data<megasys1_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int pri_code, offset, i, order;
/* First check if we have an hand-crafted priority scheme
@@ -761,13 +759,13 @@ PALETTE_INIT( megasys1 )
i = 0;
while ( priorities[i].driver &&
- strcmp(priorities[i].driver, machine.system().name) != 0 &&
- strcmp(priorities[i].driver, machine.system().parent) != 0)
+ strcmp(priorities[i].driver, machine().system().name) != 0 &&
+ strcmp(priorities[i].driver, machine().system().parent) != 0)
i++;
if (priorities[i].driver)
{
- memcpy (state->m_layers_order, priorities[i].priorities, 16 * sizeof(int));
+ memcpy (m_layers_order, priorities[i].priorities, 16 * sizeof(int));
logerror("WARNING: using an hand-crafted priorities scheme\n");
@@ -895,7 +893,7 @@ PALETTE_INIT( megasys1 )
} // merging
- state->m_layers_order[pri_code] = order & 0xfffff; // at last!
+ m_layers_order[pri_code] = order & 0xfffff; // at last!
} // pri_code
@@ -904,7 +902,7 @@ PALETTE_INIT( megasys1 )
#if 0
/* log the priority schemes */
for (i = 0; i < 16; i++)
- logerror("PROM %X] %05x\n", i, state->m_layers_order[i]);
+ logerror("PROM %X] %05x\n", i, m_layers_order[i]);
#endif
diff --git a/src/mame/video/megazone.c b/src/mame/video/megazone.c
index 2a57af564db..94012039155 100644
--- a/src/mame/video/megazone.c
+++ b/src/mame/video/megazone.c
@@ -36,9 +36,9 @@ Changes by Martin M. (pfloyd@gmx.net) 14.10.2001:
***************************************************************************/
-PALETTE_INIT( megazone )
+void megazone_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -51,7 +51,7 @@ PALETTE_INIT( megazone )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -76,7 +76,7 @@ PALETTE_INIT( megazone )
bit1 = BIT(color_prom[i], 7);
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -86,14 +86,14 @@ PALETTE_INIT( megazone )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* characters */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -102,12 +102,11 @@ WRITE8_MEMBER(megazone_state::megazone_flipscreen_w)
m_flipscreen = data & 1;
}
-VIDEO_START( megazone )
+void megazone_state::video_start()
{
- megazone_state *state = machine.driver_data<megazone_state>();
- state->m_tmpbitmap = auto_bitmap_ind16_alloc(machine, 256, 256);
+ m_tmpbitmap = auto_bitmap_ind16_alloc(machine(), 256, 256);
- state->save_item(NAME(*state->m_tmpbitmap));
+ save_item(NAME(*m_tmpbitmap));
}
diff --git a/src/mame/video/mermaid.c b/src/mame/video/mermaid.c
index d800216ccbc..d6e755aa8a3 100644
--- a/src/mame/video/mermaid.c
+++ b/src/mame/video/mermaid.c
@@ -2,13 +2,13 @@
#include "includes/mermaid.h"
-PALETTE_INIT( mermaid )
+void mermaid_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x41);
+ machine().colortable = colortable_alloc(machine(), 0x41);
for (i = 0; i < 0x40; i++)
{
@@ -16,30 +16,30 @@ PALETTE_INIT( mermaid )
int g = 0x21 * BIT(color_prom[i], 3) + 0x47 * BIT(color_prom[i], 4) + 0x97 * BIT(color_prom[i], 5);
int b = 0x47 * BIT(color_prom[i], 6) + 0x97 * BIT(color_prom[i], 7);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* blue background */
- colortable_palette_set_color(machine.colortable, 0x40, MAKE_RGB(0, 0, 0xff));
+ colortable_palette_set_color(machine().colortable, 0x40, MAKE_RGB(0, 0, 0xff));
/* char/sprite palette */
for (i = 0; i < 0x40; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* background palette */
- colortable_entry_set_value(machine.colortable, 0x40, 0x20);
- colortable_entry_set_value(machine.colortable, 0x41, 0x21);
- colortable_entry_set_value(machine.colortable, 0x42, 0x40);
- colortable_entry_set_value(machine.colortable, 0x43, 0x21);
+ colortable_entry_set_value(machine().colortable, 0x40, 0x20);
+ colortable_entry_set_value(machine().colortable, 0x41, 0x21);
+ colortable_entry_set_value(machine().colortable, 0x42, 0x40);
+ colortable_entry_set_value(machine().colortable, 0x43, 0x21);
}
-PALETTE_INIT( rougien )
+PALETTE_INIT_MEMBER(mermaid_state,rougien)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x41);
+ machine().colortable = colortable_alloc(machine(), 0x41);
for (i = 0; i < 0x40; i++)
{
@@ -47,21 +47,21 @@ PALETTE_INIT( rougien )
int g = 0x21 * BIT(color_prom[i], 3) + 0x47 * BIT(color_prom[i], 4) + 0x97 * BIT(color_prom[i], 5);
int b = 0x47 * BIT(color_prom[i], 6) + 0x97 * BIT(color_prom[i], 7);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* blue background */
- colortable_palette_set_color(machine.colortable, 0x40, MAKE_RGB(0, 0, 0));
+ colortable_palette_set_color(machine().colortable, 0x40, MAKE_RGB(0, 0, 0));
/* char/sprite palette */
for (i = 0; i < 0x40; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* background palette */
- colortable_entry_set_value(machine.colortable, 0x40, 0x40);
- colortable_entry_set_value(machine.colortable, 0x41, 0x00);
- colortable_entry_set_value(machine.colortable, 0x42, 0x00);
- colortable_entry_set_value(machine.colortable, 0x43, 0x02);
+ colortable_entry_set_value(machine().colortable, 0x40, 0x40);
+ colortable_entry_set_value(machine().colortable, 0x41, 0x00);
+ colortable_entry_set_value(machine().colortable, 0x42, 0x00);
+ colortable_entry_set_value(machine().colortable, 0x43, 0x02);
}
@@ -165,19 +165,18 @@ TILE_GET_INFO_MEMBER(mermaid_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( mermaid )
+void mermaid_state::video_start()
{
- mermaid_state *state = machine.driver_data<mermaid_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mermaid_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mermaid_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scroll_cols(32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mermaid_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_scroll_cols(32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mermaid_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap->set_scroll_cols(32);
+ m_fg_tilemap->set_transparent_pen(0);
- machine.primary_screen->register_screen_bitmap(state->m_helper);
- machine.primary_screen->register_screen_bitmap(state->m_helper2);
+ machine().primary_screen->register_screen_bitmap(m_helper);
+ machine().primary_screen->register_screen_bitmap(m_helper2);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/metlclsh.c b/src/mame/video/metlclsh.c
index 1d39ea2004a..d51b0f19d86 100644
--- a/src/mame/video/metlclsh.c
+++ b/src/mame/video/metlclsh.c
@@ -132,19 +132,18 @@ WRITE8_MEMBER(metlclsh_state::metlclsh_fgram_w)
***************************************************************************/
-VIDEO_START( metlclsh )
+void metlclsh_state::video_start()
{
- metlclsh_state *state = machine.driver_data<metlclsh_state>();
- state->m_otherram = auto_alloc_array(machine, UINT8, 0x800); // banked ram
+ m_otherram = auto_alloc_array(machine(), UINT8, 0x800); // banked ram
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(metlclsh_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(metlclsh_state::metlclsh_bgtilemap_scan),state), 16, 16, 32, 16);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(metlclsh_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(metlclsh_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(metlclsh_state::metlclsh_bgtilemap_scan),this), 16, 16, 32, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(metlclsh_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->save_pointer(NAME(state->m_otherram), 0x800);
+ save_pointer(NAME(m_otherram), 0x800);
}
diff --git a/src/mame/video/metro.c b/src/mame/video/metro.c
index 61b8d79e061..a0a1a2e548f 100644
--- a/src/mame/video/metro.c
+++ b/src/mame/video/metro.c
@@ -282,100 +282,95 @@ static void expand_gfx1(metro_state &state)
}
}
-VIDEO_START( metro_i4100 )
+VIDEO_START_MEMBER(metro_state,metro_i4100)
{
- metro_state *state = machine.driver_data<metro_state>();
- expand_gfx1(*state);
+ expand_gfx1(*this);
- state->m_support_8bpp = 0;
- state->m_support_16x16 = 0;
- state->m_has_zoom = 0;
+ m_support_8bpp = 0;
+ m_support_16x16 = 0;
+ m_has_zoom = 0;
- state->m_bg_tilemap_enable[0] = 1;
- state->m_bg_tilemap_enable[1] = 1;
- state->m_bg_tilemap_enable[2] = 1;
+ m_bg_tilemap_enable[0] = 1;
+ m_bg_tilemap_enable[1] = 1;
+ m_bg_tilemap_enable[2] = 1;
- state->m_bg_tilemap_enable16[0] = 0;
- state->m_bg_tilemap_enable16[1] = 0;
- state->m_bg_tilemap_enable16[2] = 0;
+ m_bg_tilemap_enable16[0] = 0;
+ m_bg_tilemap_enable16[1] = 0;
+ m_bg_tilemap_enable16[2] = 0;
- state->m_bg_tilemap_scrolldx[0] = 0;
- state->m_bg_tilemap_scrolldx[1] = 0;
- state->m_bg_tilemap_scrolldx[2] = 0;
+ m_bg_tilemap_scrolldx[0] = 0;
+ m_bg_tilemap_scrolldx[1] = 0;
+ m_bg_tilemap_scrolldx[2] = 0;
}
-VIDEO_START( metro_i4220 )
+VIDEO_START_MEMBER(metro_state,metro_i4220)
{
- metro_state *state = machine.driver_data<metro_state>();
- expand_gfx1(*state);
+ expand_gfx1(*this);
- state->m_support_8bpp = 1;
- state->m_support_16x16 = 0;
- state->m_has_zoom = 0;
+ m_support_8bpp = 1;
+ m_support_16x16 = 0;
+ m_has_zoom = 0;
- state->m_bg_tilemap_enable[0] = 1;
- state->m_bg_tilemap_enable[1] = 1;
- state->m_bg_tilemap_enable[2] = 1;
+ m_bg_tilemap_enable[0] = 1;
+ m_bg_tilemap_enable[1] = 1;
+ m_bg_tilemap_enable[2] = 1;
- state->m_bg_tilemap_enable16[0] = 0;
- state->m_bg_tilemap_enable16[1] = 0;
- state->m_bg_tilemap_enable16[2] = 0;
+ m_bg_tilemap_enable16[0] = 0;
+ m_bg_tilemap_enable16[1] = 0;
+ m_bg_tilemap_enable16[2] = 0;
- state->m_bg_tilemap_scrolldx[0] = -2;
- state->m_bg_tilemap_scrolldx[1] = -2;
- state->m_bg_tilemap_scrolldx[2] = -2;
+ m_bg_tilemap_scrolldx[0] = -2;
+ m_bg_tilemap_scrolldx[1] = -2;
+ m_bg_tilemap_scrolldx[2] = -2;
}
-VIDEO_START( metro_i4300 )
+VIDEO_START_MEMBER(metro_state,metro_i4300)
{
- metro_state *state = machine.driver_data<metro_state>();
- expand_gfx1(*state);
+ expand_gfx1(*this);
- state->m_support_8bpp = 1;
- state->m_support_16x16 = 1;
- state->m_has_zoom = 0;
+ m_support_8bpp = 1;
+ m_support_16x16 = 1;
+ m_has_zoom = 0;
- state->m_bg_tilemap_enable[0] = 1;
- state->m_bg_tilemap_enable[1] = 1;
- state->m_bg_tilemap_enable[2] = 1;
+ m_bg_tilemap_enable[0] = 1;
+ m_bg_tilemap_enable[1] = 1;
+ m_bg_tilemap_enable[2] = 1;
- state->m_bg_tilemap_enable16[0] = 0;
- state->m_bg_tilemap_enable16[1] = 0;
- state->m_bg_tilemap_enable16[2] = 0;
+ m_bg_tilemap_enable16[0] = 0;
+ m_bg_tilemap_enable16[1] = 0;
+ m_bg_tilemap_enable16[2] = 0;
- state->m_bg_tilemap_scrolldx[0] = 0;
- state->m_bg_tilemap_scrolldx[1] = 0;
- state->m_bg_tilemap_scrolldx[2] = 0;
+ m_bg_tilemap_scrolldx[0] = 0;
+ m_bg_tilemap_scrolldx[1] = 0;
+ m_bg_tilemap_scrolldx[2] = 0;
}
-VIDEO_START( blzntrnd )
+VIDEO_START_MEMBER(metro_state,blzntrnd)
{
- metro_state *state = machine.driver_data<metro_state>();
- VIDEO_START_CALL(metro_i4220);
+ VIDEO_START_CALL_MEMBER(metro_i4220);
- state->m_has_zoom = 1;
+ m_has_zoom = 1;
- state->m_k053936_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(metro_state::metro_k053936_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 256, 512);
+ m_k053936_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(metro_state::metro_k053936_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 512);
- state->m_bg_tilemap_scrolldx[0] = 8;
- state->m_bg_tilemap_scrolldx[1] = 8;
- state->m_bg_tilemap_scrolldx[2] = 8;
+ m_bg_tilemap_scrolldx[0] = 8;
+ m_bg_tilemap_scrolldx[1] = 8;
+ m_bg_tilemap_scrolldx[2] = 8;
}
-VIDEO_START( gstrik2 )
+VIDEO_START_MEMBER(metro_state,gstrik2)
{
- metro_state *state = machine.driver_data<metro_state>();
- VIDEO_START_CALL(metro_i4220);
+ VIDEO_START_CALL_MEMBER(metro_i4220);
- state->m_has_zoom = 1;
+ m_has_zoom = 1;
- state->m_k053936_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(metro_state::metro_k053936_gstrik2_get_tile_info),state), tilemap_mapper_delegate(FUNC(metro_state::tilemap_scan_gstrik2),state), 16, 16, 128, 256);
+ m_k053936_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(metro_state::metro_k053936_gstrik2_get_tile_info),this), tilemap_mapper_delegate(FUNC(metro_state::tilemap_scan_gstrik2),this), 16, 16, 128, 256);
- state->m_bg_tilemap_scrolldx[0] = 8;
- state->m_bg_tilemap_scrolldx[1] = 0;
- state->m_bg_tilemap_scrolldx[2] = 8;
+ m_bg_tilemap_scrolldx[0] = 8;
+ m_bg_tilemap_scrolldx[1] = 0;
+ m_bg_tilemap_scrolldx[2] = 8;
}
/***************************************************************************
diff --git a/src/mame/video/micro3d.c b/src/mame/video/micro3d.c
index bef6cc701ec..ebe673e3bfd 100644
--- a/src/mame/video/micro3d.c
+++ b/src/mame/video/micro3d.c
@@ -35,26 +35,24 @@ enum
*
*************************************/
-VIDEO_START( micro3d )
+void micro3d_state::video_start()
{
- micro3d_state *state = machine.driver_data<micro3d_state>();
/* Allocate 512x12 x 2 3D frame buffers */
- state->m_frame_buffers[0] = auto_alloc_array(machine, UINT16, 1024 * 512);
- state->m_frame_buffers[1] = auto_alloc_array(machine, UINT16, 1024 * 512);
- state->m_tmp_buffer = auto_alloc_array(machine, UINT16, 1024 * 512);
+ m_frame_buffers[0] = auto_alloc_array(machine(), UINT16, 1024 * 512);
+ m_frame_buffers[1] = auto_alloc_array(machine(), UINT16, 1024 * 512);
+ m_tmp_buffer = auto_alloc_array(machine(), UINT16, 1024 * 512);
}
-VIDEO_RESET( micro3d )
+void micro3d_state::video_reset()
{
- micro3d_state *state = machine.driver_data<micro3d_state>();
- state->m_pipeline_state = 0;
- state->m_creg = 0;
+ m_pipeline_state = 0;
+ m_creg = 0;
- state->m_drawing_buffer = 0;
- state->m_display_buffer = 1;
+ m_drawing_buffer = 0;
+ m_display_buffer = 1;
}
diff --git a/src/mame/video/midtunit.c b/src/mame/video/midtunit.c
index ff0e6f033b3..a79537bedc8 100644
--- a/src/mame/video/midtunit.c
+++ b/src/mame/video/midtunit.c
@@ -7,6 +7,7 @@
#include "emu.h"
#include "cpu/tms34010/tms34010.h"
#include "includes/midtunit.h"
+#include "includes/midwunit.h"
#include "includes/midxunit.h"
@@ -85,10 +86,10 @@ static struct
*
*************************************/
-VIDEO_START( midtunit )
+VIDEO_START_MEMBER(midtunit_state,midtunit)
{
/* allocate memory */
- local_videoram = auto_alloc_array(machine, UINT16, 0x100000/2);
+ local_videoram = auto_alloc_array(machine(), UINT16, 0x100000/2);
/* reset all the globals */
gfxbank_offset[0] = 0x000000;
@@ -96,27 +97,26 @@ VIDEO_START( midtunit )
memset(dma_register, 0, sizeof(dma_register));
memset(&dma_state, 0, sizeof(dma_state));
- dma_state.gfxrom = machine.driver_data<midtunit_state>()->m_gfxrom->base();
/* register for state saving */
- state_save_register_global(machine, midtunit_control);
- state_save_register_global_array(machine, gfxbank_offset);
- state_save_register_global_pointer(machine, local_videoram, 0x100000/sizeof(local_videoram[0]));
- state_save_register_global(machine, videobank_select);
- state_save_register_global_array(machine, dma_register);
+ state_save_register_global(machine(), midtunit_control);
+ state_save_register_global_array(machine(), gfxbank_offset);
+ state_save_register_global_pointer(machine(), local_videoram, 0x100000/sizeof(local_videoram[0]));
+ state_save_register_global(machine(), videobank_select);
+ state_save_register_global_array(machine(), dma_register);
}
-VIDEO_START( midwunit )
+VIDEO_START_MEMBER(midwunit_state,midwunit)
{
- VIDEO_START_CALL(midtunit);
+ VIDEO_START_CALL_MEMBER(midtunit);
midtunit_gfx_rom_large = 1;
}
-VIDEO_START( midxunit )
+VIDEO_START_MEMBER(midxunit_state,midxunit)
{
- VIDEO_START_CALL(midtunit);
+ VIDEO_START_CALL_MEMBER(midtunit);
midtunit_gfx_rom_large = 1;
videobank_select = 1;
}
diff --git a/src/mame/video/midvunit.c b/src/mame/video/midvunit.c
index 6c2b7695a41..af60bec2d28 100644
--- a/src/mame/video/midvunit.c
+++ b/src/mame/video/midvunit.c
@@ -50,18 +50,17 @@ static TIMER_CALLBACK( scanline_timer_cb )
}
-VIDEO_START( midvunit )
+void midvunit_state::video_start()
{
- midvunit_state *state = machine.driver_data<midvunit_state>();
- state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_timer_cb));
+ m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_timer_cb));
- state->m_poly = auto_alloc(machine, midvunit_renderer(*state));
+ m_poly = auto_alloc(machine(), midvunit_renderer(*this));
- state_save_register_global_array(machine, state->m_video_regs);
- state_save_register_global_array(machine, state->m_dma_data);
- state_save_register_global(machine, state->m_dma_data_index);
- state_save_register_global(machine, state->m_page_control);
- state_save_register_global(machine, state->m_video_changed);
+ state_save_register_global_array(machine(), m_video_regs);
+ state_save_register_global_array(machine(), m_dma_data);
+ state_save_register_global(machine(), m_dma_data_index);
+ state_save_register_global(machine(), m_page_control);
+ state_save_register_global(machine(), m_video_changed);
}
diff --git a/src/mame/video/midyunit.c b/src/mame/video/midyunit.c
index bf0c798c58b..09898758bf9 100644
--- a/src/mame/video/midyunit.c
+++ b/src/mame/video/midyunit.c
@@ -36,81 +36,76 @@ enum
*
*************************************/
-static VIDEO_START( common )
+VIDEO_START_MEMBER(midyunit_state,common)
{
- midyunit_state *state = machine.driver_data<midyunit_state>();
/* allocate memory */
- state->m_cmos_ram = auto_alloc_array(machine, UINT16, (0x2000 * 4)/2);
- state->m_local_videoram = auto_alloc_array_clear(machine, UINT16, 0x80000/2);
- state->m_pen_map = auto_alloc_array(machine, pen_t, 65536);
+ m_cmos_ram = auto_alloc_array(machine(), UINT16, (0x2000 * 4)/2);
+ m_local_videoram = auto_alloc_array_clear(machine(), UINT16, 0x80000/2);
+ m_pen_map = auto_alloc_array(machine(), pen_t, 65536);
- machine.device<nvram_device>("nvram")->set_base(state->m_cmos_ram, 0x2000 * 4);
+ machine().device<nvram_device>("nvram")->set_base(m_cmos_ram, 0x2000 * 4);
/* reset all the globals */
- state->m_cmos_page = 0;
- state->m_autoerase_enable = 0;
- state->m_yawdim_dma = 0;
+ m_cmos_page = 0;
+ m_autoerase_enable = 0;
+ m_yawdim_dma = 0;
/* reset DMA state */
- memset(state->m_dma_register, 0, sizeof(state->m_dma_register));
- memset(&state->m_dma_state, 0, sizeof(state->m_dma_state));
+ memset(m_dma_register, 0, sizeof(m_dma_register));
+ memset(&m_dma_state, 0, sizeof(m_dma_state));
/* register for state saving */
- state_save_register_global(machine, state->m_autoerase_enable);
- state_save_register_global_pointer(machine, state->m_local_videoram, 0x80000/2);
- state_save_register_global_pointer(machine, state->m_cmos_ram, (0x2000 * 4)/2);
- state_save_register_global(machine, state->m_videobank_select);
- state_save_register_global_array(machine, state->m_dma_register);
+ state_save_register_global(machine(), m_autoerase_enable);
+ state_save_register_global_pointer(machine(), m_local_videoram, 0x80000/2);
+ state_save_register_global_pointer(machine(), m_cmos_ram, (0x2000 * 4)/2);
+ state_save_register_global(machine(), m_videobank_select);
+ state_save_register_global_array(machine(), m_dma_register);
}
-VIDEO_START( midyunit_4bit )
+VIDEO_START_MEMBER(midyunit_state,midyunit_4bit)
{
- midyunit_state *state = machine.driver_data<midyunit_state>();
int i;
- VIDEO_START_CALL(common);
+ VIDEO_START_CALL_MEMBER(common);
/* init for 4-bit */
for (i = 0; i < 65536; i++)
- state->m_pen_map[i] = ((i & 0xf000) >> 8) | (i & 0x000f);
- state->m_palette_mask = 0x00ff;
+ m_pen_map[i] = ((i & 0xf000) >> 8) | (i & 0x000f);
+ m_palette_mask = 0x00ff;
}
-VIDEO_START( midyunit_6bit )
+VIDEO_START_MEMBER(midyunit_state,midyunit_6bit)
{
- midyunit_state *state = machine.driver_data<midyunit_state>();
int i;
- VIDEO_START_CALL(common);
+ VIDEO_START_CALL_MEMBER(common);
/* init for 6-bit */
for (i = 0; i < 65536; i++)
- state->m_pen_map[i] = ((i & 0xc000) >> 8) | (i & 0x0f3f);
- state->m_palette_mask = 0x0fff;
+ m_pen_map[i] = ((i & 0xc000) >> 8) | (i & 0x0f3f);
+ m_palette_mask = 0x0fff;
}
-VIDEO_START( mkyawdim )
+VIDEO_START_MEMBER(midyunit_state,mkyawdim)
{
- midyunit_state *state = machine.driver_data<midyunit_state>();
- VIDEO_START_CALL(midyunit_6bit);
- state->m_yawdim_dma = 1;
+ VIDEO_START_CALL_MEMBER(midyunit_6bit);
+ m_yawdim_dma = 1;
}
-VIDEO_START( midzunit )
+VIDEO_START_MEMBER(midyunit_state,midzunit)
{
- midyunit_state *state = machine.driver_data<midyunit_state>();
int i;
- VIDEO_START_CALL(common);
+ VIDEO_START_CALL_MEMBER(common);
/* init for 8-bit */
for (i = 0; i < 65536; i++)
- state->m_pen_map[i] = i & 0x1fff;
- state->m_palette_mask = 0x1fff;
+ m_pen_map[i] = i & 0x1fff;
+ m_palette_mask = 0x1fff;
}
diff --git a/src/mame/video/midzeus.c b/src/mame/video/midzeus.c
index d41d2ff9828..d8cfc742b4a 100644
--- a/src/mame/video/midzeus.c
+++ b/src/mame/video/midzeus.c
@@ -260,45 +260,45 @@ INLINE UINT8 get_texel_alt_4bit(const void *base, int y, int x, int width)
*
*************************************/
-VIDEO_START( midzeus )
+VIDEO_START_MEMBER(midzeus_state,midzeus)
{
int i;
/* allocate memory for "wave" RAM */
- waveram[0] = auto_alloc_array(machine, UINT32, WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8/4);
- waveram[1] = auto_alloc_array(machine, UINT32, WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 8/4);
+ waveram[0] = auto_alloc_array(machine(), UINT32, WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8/4);
+ waveram[1] = auto_alloc_array(machine(), UINT32, WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 8/4);
/* initialize a 5-5-5 palette */
for (i = 0; i < 32768; i++)
- palette_set_color_rgb(machine, i, pal5bit(i >> 10), pal5bit(i >> 5), pal5bit(i >> 0));
+ palette_set_color_rgb(machine(), i, pal5bit(i >> 10), pal5bit(i >> 5), pal5bit(i >> 0));
/* initialize polygon engine */
- poly = poly_alloc(machine, 10000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
+ poly = poly_alloc(machine(), 10000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
/* we need to cleanup on exit */
- machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(exit_handler), &machine));
+ machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(exit_handler), &machine()));
yoffs = 0;
texel_width = 256;
zeus_renderbase = waveram[1];
/* state saving */
- state_save_register_global_array(machine, zeus_fifo);
- state_save_register_global(machine, zeus_fifo_words);
- state_save_register_global_2d_array(machine, zeus_matrix);
- state_save_register_global_array(machine, zeus_point);
- state_save_register_global_array(machine, zeus_light);
- state_save_register_global(machine, zeus_palbase);
- state_save_register_global(machine, zeus_objdata);
- state_save_register_global(machine, zeus_cliprect.min_x);
- state_save_register_global(machine, zeus_cliprect.max_x);
- state_save_register_global(machine, zeus_cliprect.min_y);
- state_save_register_global(machine, zeus_cliprect.max_y);
- state_save_register_global_pointer(machine, waveram[0], WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8 / sizeof(waveram[0][0]));
- state_save_register_global_pointer(machine, waveram[1], WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 8 / sizeof(waveram[1][0]));
+ state_save_register_global_array(machine(), zeus_fifo);
+ state_save_register_global(machine(), zeus_fifo_words);
+ state_save_register_global_2d_array(machine(), zeus_matrix);
+ state_save_register_global_array(machine(), zeus_point);
+ state_save_register_global_array(machine(), zeus_light);
+ state_save_register_global(machine(), zeus_palbase);
+ state_save_register_global(machine(), zeus_objdata);
+ state_save_register_global(machine(), zeus_cliprect.min_x);
+ state_save_register_global(machine(), zeus_cliprect.max_x);
+ state_save_register_global(machine(), zeus_cliprect.min_y);
+ state_save_register_global(machine(), zeus_cliprect.max_y);
+ state_save_register_global_pointer(machine(), waveram[0], WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8 / sizeof(waveram[0][0]));
+ state_save_register_global_pointer(machine(), waveram[1], WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 8 / sizeof(waveram[1][0]));
/* hack */
- is_mk4b = strcmp(machine.system().name, "mk4b") == 0;
+ is_mk4b = strcmp(machine().system().name, "mk4b") == 0;
}
diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c
index 8da11922639..9f3b242665e 100644
--- a/src/mame/video/midzeus2.c
+++ b/src/mame/video/midzeus2.c
@@ -263,37 +263,37 @@ static TIMER_CALLBACK( int_timer_callback )
}
-VIDEO_START( midzeus2 )
+VIDEO_START_MEMBER(midzeus_state,midzeus2)
{
/* allocate memory for "wave" RAM */
- waveram[0] = auto_alloc_array(machine, UINT32, WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8/4);
- waveram[1] = auto_alloc_array(machine, UINT32, WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 12/4);
+ waveram[0] = auto_alloc_array(machine(), UINT32, WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8/4);
+ waveram[1] = auto_alloc_array(machine(), UINT32, WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 12/4);
/* initialize polygon engine */
- poly = poly_alloc(machine, 10000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
+ poly = poly_alloc(machine(), 10000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
/* we need to cleanup on exit */
- machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(exit_handler), &machine));
+ machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(exit_handler), &machine()));
zbase = 2.0f;
yoffs = 0;
texel_width = 256;
zeus_renderbase = waveram[1];
- int_timer = machine.scheduler().timer_alloc(FUNC(int_timer_callback));
+ int_timer = machine().scheduler().timer_alloc(FUNC(int_timer_callback));
/* save states */
- state_save_register_global_pointer(machine, waveram[0], WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8 / sizeof(waveram[0][0]));
- state_save_register_global_pointer(machine, waveram[1], WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 12 / sizeof(waveram[1][0]));
- state_save_register_global_array(machine, zeus_fifo);
- state_save_register_global(machine, zeus_fifo_words);
- state_save_register_global(machine, zeus_cliprect.min_x);
- state_save_register_global(machine, zeus_cliprect.max_x);
- state_save_register_global(machine, zeus_cliprect.min_y);
- state_save_register_global(machine, zeus_cliprect.max_y);
- state_save_register_global_2d_array(machine, zeus_matrix);
- state_save_register_global_array(machine, zeus_point);
- state_save_register_global(machine, zeus_texbase);
+ state_save_register_global_pointer(machine(), waveram[0], WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8 / sizeof(waveram[0][0]));
+ state_save_register_global_pointer(machine(), waveram[1], WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 12 / sizeof(waveram[1][0]));
+ state_save_register_global_array(machine(), zeus_fifo);
+ state_save_register_global(machine(), zeus_fifo_words);
+ state_save_register_global(machine(), zeus_cliprect.min_x);
+ state_save_register_global(machine(), zeus_cliprect.max_x);
+ state_save_register_global(machine(), zeus_cliprect.min_y);
+ state_save_register_global(machine(), zeus_cliprect.max_y);
+ state_save_register_global_2d_array(machine(), zeus_matrix);
+ state_save_register_global_array(machine(), zeus_point);
+ state_save_register_global(machine(), zeus_texbase);
}
diff --git a/src/mame/video/mikie.c b/src/mame/video/mikie.c
index 660c537a46a..f46e6fbac34 100644
--- a/src/mame/video/mikie.c
+++ b/src/mame/video/mikie.c
@@ -26,9 +26,9 @@
***************************************************************************/
-PALETTE_INIT( mikie )
+void mikie_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[4] = { 2200, 1000, 470, 220 };
double rweights[4], gweights[4], bweights[4];
int i;
@@ -40,7 +40,7 @@ PALETTE_INIT( mikie )
4, resistances, bweights, 470, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( mikie )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table,*/
@@ -83,7 +83,7 @@ PALETTE_INIT( mikie )
for (j = 0; j < 8; j++)
{
UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine.colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
+ colortable_entry_set_value(machine().colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
}
}
}
@@ -136,10 +136,9 @@ TILE_GET_INFO_MEMBER(mikie_state::get_bg_tile_info)
}
-VIDEO_START( mikie )
+void mikie_state::video_start()
{
- mikie_state *state = machine.driver_data<mikie_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mikie_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mikie_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/mitchell.c b/src/mame/video/mitchell.c
index 3d123f7a132..5bf0acf2eb0 100644
--- a/src/mame/video/mitchell.c
+++ b/src/mame/video/mitchell.c
@@ -33,20 +33,19 @@ TILE_GET_INFO_MEMBER(mitchell_state::get_tile_info)
***************************************************************************/
-VIDEO_START( pang )
+VIDEO_START_MEMBER(mitchell_state,pang)
{
- mitchell_state *state = machine.driver_data<mitchell_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mitchell_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap->set_transparent_pen(15);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mitchell_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap->set_transparent_pen(15);
/* OBJ RAM */
- state->m_objram = auto_alloc_array_clear(machine, UINT8, state->m_videoram.bytes());
+ m_objram = auto_alloc_array_clear(machine(), UINT8, m_videoram.bytes());
/* Palette RAM */
- state->m_generic_paletteram_8.allocate(2 * machine.total_colors());
+ m_generic_paletteram_8.allocate(2 * machine().total_colors());
- state->save_pointer(NAME(state->m_objram), state->m_videoram.bytes());
+ save_pointer(NAME(m_objram), m_videoram.bytes());
}
diff --git a/src/mame/video/mjkjidai.c b/src/mame/video/mjkjidai.c
index f2bd05964f2..428a6984109 100644
--- a/src/mame/video/mjkjidai.c
+++ b/src/mame/video/mjkjidai.c
@@ -25,10 +25,9 @@ TILE_GET_INFO_MEMBER(mjkjidai_state::get_tile_info)
***************************************************************************/
-VIDEO_START( mjkjidai )
+void mjkjidai_state::video_start()
{
- mjkjidai_state *state = machine.driver_data<mjkjidai_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mjkjidai_state::get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mjkjidai_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
}
diff --git a/src/mame/video/model1.c b/src/mame/video/model1.c
index 5664178f82f..3579b310acd 100644
--- a/src/mame/video/model1.c
+++ b/src/mame/video/model1.c
@@ -1443,27 +1443,26 @@ static void tgp_scan(running_machine &machine)
state->m_render_done = 0;
}
-VIDEO_START(model1)
+VIDEO_START_MEMBER(model1_state,model1)
{
- model1_state *state = machine.driver_data<model1_state>();
- state->m_paletteram16 = state->m_generic_paletteram_16;
+ m_paletteram16 = m_generic_paletteram_16;
- state->m_view = auto_alloc_clear(machine, struct view);
+ m_view = auto_alloc_clear(machine(), struct view);
- state->m_poly_rom = (UINT32 *)state->memregion("user1")->base();
- state->m_poly_ram = auto_alloc_array_clear(machine, UINT32, 0x400000);
- state->m_tgp_ram = auto_alloc_array_clear(machine, UINT16, 0x100000-0x40000);
- state->m_pointdb = auto_alloc_array_clear(machine, struct point, 1000000*2);
- state->m_quaddb = auto_alloc_array_clear(machine, struct quad_m1, 1000000);
- state->m_quadind = auto_alloc_array_clear(machine, struct quad_m1 *, 1000000);
+ m_poly_rom = (UINT32 *)memregion("user1")->base();
+ m_poly_ram = auto_alloc_array_clear(machine(), UINT32, 0x400000);
+ m_tgp_ram = auto_alloc_array_clear(machine(), UINT16, 0x100000-0x40000);
+ m_pointdb = auto_alloc_array_clear(machine(), struct point, 1000000*2);
+ m_quaddb = auto_alloc_array_clear(machine(), struct quad_m1, 1000000);
+ m_quadind = auto_alloc_array_clear(machine(), struct quad_m1 *, 1000000);
- state->m_pointpt = state->m_pointdb;
- state->m_quadpt = state->m_quaddb;
- state->m_listctl[0] = state->m_listctl[1] = 0;
+ m_pointpt = m_pointdb;
+ m_quadpt = m_quaddb;
+ m_listctl[0] = m_listctl[1] = 0;
- state_save_register_global_pointer(machine, state->m_tgp_ram, 0x100000-0x40000);
- state_save_register_global_pointer(machine, state->m_poly_ram, 0x40000);
- state_save_register_global_array(machine, state->m_listctl);
+ state_save_register_global_pointer(machine(), m_tgp_ram, 0x100000-0x40000);
+ state_save_register_global_pointer(machine(), m_poly_ram, 0x40000);
+ state_save_register_global_array(machine(), m_listctl);
}
SCREEN_UPDATE_RGB32(model1)
diff --git a/src/mame/video/model2.c b/src/mame/video/model2.c
index 6ac83320ac1..50328374fa8 100644
--- a/src/mame/video/model2.c
+++ b/src/mame/video/model2.c
@@ -2700,23 +2700,22 @@ static void model2_exit(running_machine &machine)
poly_free(state->m_poly);
}
-VIDEO_START(model2)
+VIDEO_START_MEMBER(model2_state,model2)
{
- model2_state *state = machine.driver_data<model2_state>();
- const rectangle &visarea = machine.primary_screen->visible_area();
+ const rectangle &visarea = machine().primary_screen->visible_area();
int width = visarea.width();
int height = visarea.height();
- state->m_sys24_bitmap.allocate(width, height+4);
+ m_sys24_bitmap.allocate(width, height+4);
- state->m_poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), 0);
- machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(model2_exit), &machine));
+ m_poly = poly_alloc(machine(), 4000, sizeof(poly_extra_data), 0);
+ machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(model2_exit), &machine()));
/* initialize the hardware rasterizer */
- model2_3d_init( machine, (UINT16*)state->memregion("user3")->base() );
+ model2_3d_init( machine(), (UINT16*)memregion("user3")->base() );
/* initialize the geometry engine */
- geo_init( machine, (UINT32*)state->memregion("user2")->base() );
+ geo_init( machine(), (UINT32*)memregion("user2")->base() );
}
SCREEN_UPDATE_RGB32(model2)
diff --git a/src/mame/video/model3.c b/src/mame/video/model3.c
index 148e1449416..19b9b485843 100644
--- a/src/mame/video/model3.c
+++ b/src/mame/video/model3.c
@@ -114,45 +114,44 @@ static void model3_exit(running_machine &machine)
poly_free(state->m_poly);
}
-VIDEO_START( model3 )
+void model3_state::video_start()
{
- model3_state *state = machine.driver_data<model3_state>();
- state->m_poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), 0);
- machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(model3_exit), &machine));
+ m_poly = poly_alloc(machine(), 4000, sizeof(poly_extra_data), 0);
+ machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(model3_exit), &machine()));
- machine.primary_screen->register_screen_bitmap(state->m_bitmap3d);
- machine.primary_screen->register_screen_bitmap(state->m_zbuffer);
+ machine().primary_screen->register_screen_bitmap(m_bitmap3d);
+ machine().primary_screen->register_screen_bitmap(m_zbuffer);
- state->m_m3_char_ram = auto_alloc_array_clear(machine, UINT64, 0x100000/8);
- state->m_m3_tile_ram = auto_alloc_array_clear(machine, UINT64, 0x8000/8);
+ m_m3_char_ram = auto_alloc_array_clear(machine(), UINT64, 0x100000/8);
+ m_m3_tile_ram = auto_alloc_array_clear(machine(), UINT64, 0x8000/8);
- state->m_pal_lookup = auto_alloc_array_clear(machine, UINT16, 65536);
+ m_pal_lookup = auto_alloc_array_clear(machine(), UINT16, 65536);
- state->m_texture_fifo = auto_alloc_array_clear(machine, UINT32, 0x100000/4);
+ m_texture_fifo = auto_alloc_array_clear(machine(), UINT32, 0x100000/4);
/* 2x 4MB texture sheets */
- state->m_texture_ram[0] = auto_alloc_array(machine, UINT16, 0x400000/2);
- state->m_texture_ram[1] = auto_alloc_array(machine, UINT16, 0x400000/2);
+ m_texture_ram[0] = auto_alloc_array(machine(), UINT16, 0x400000/2);
+ m_texture_ram[1] = auto_alloc_array(machine(), UINT16, 0x400000/2);
/* 1MB Display List RAM */
- state->m_display_list_ram = auto_alloc_array_clear(machine, UINT32, 0x100000/4);
+ m_display_list_ram = auto_alloc_array_clear(machine(), UINT32, 0x100000/4);
/* 4MB for nodes (< Step 2.0 have only 2MB) */
- state->m_culling_ram = auto_alloc_array_clear(machine, UINT32, 0x400000/4);
+ m_culling_ram = auto_alloc_array_clear(machine(), UINT32, 0x400000/4);
/* 4MB Polygon RAM */
- state->m_polygon_ram = auto_alloc_array_clear(machine, UINT32, 0x400000/4);
+ m_polygon_ram = auto_alloc_array_clear(machine(), UINT32, 0x400000/4);
- state->m_tick = 0;
- state->m_debug_layer_disable = 0;
- state->m_vid_reg0 = 0;
+ m_tick = 0;
+ m_debug_layer_disable = 0;
+ m_vid_reg0 = 0;
- state->m_viewport_focal_length = 300.;
- state->m_viewport_region_x = 0;
- state->m_viewport_region_y = 0;
- state->m_viewport_region_width = 496;
- state->m_viewport_region_height = 384;
+ m_viewport_focal_length = 300.;
+ m_viewport_region_x = 0;
+ m_viewport_region_y = 0;
+ m_viewport_region_width = 496;
+ m_viewport_region_height = 384;
- init_matrix_stack(machine);
+ init_matrix_stack(machine());
}
static void draw_tile_4bit(running_machine &machine, bitmap_ind16 &bitmap, int tx, int ty, int tilenum)
diff --git a/src/mame/video/moo.c b/src/mame/video/moo.c
index d8dd4619b78..459d61b2ca0 100644
--- a/src/mame/video/moo.c
+++ b/src/mame/video/moo.c
@@ -35,31 +35,30 @@ void moo_tile_callback( running_machine &machine, int layer, int *code, int *col
*color = state->m_layer_colorbase[layer] | (*color >> 2 & 0x0f);
}
-VIDEO_START(moo)
+VIDEO_START_MEMBER(moo_state,moo)
{
- moo_state *state = machine.driver_data<moo_state>();
- assert(machine.primary_screen->format() == BITMAP_FORMAT_RGB32);
+ assert(machine().primary_screen->format() == BITMAP_FORMAT_RGB32);
- state->m_alpha_enabled = 0;
+ m_alpha_enabled = 0;
- if (!strcmp(machine.system().name, "bucky") || !strcmp(machine.system().name, "buckyua") || !strcmp(machine.system().name, "buckyaa"))
+ if (!strcmp(machine().system().name, "bucky") || !strcmp(machine().system().name, "buckyua") || !strcmp(machine().system().name, "buckyaa"))
{
// Bucky doesn't chain tilemaps
- k056832_set_layer_association(state->m_k056832, 0);
+ k056832_set_layer_association(m_k056832, 0);
- k056832_set_layer_offs(state->m_k056832, 0, -2, 0);
- k056832_set_layer_offs(state->m_k056832, 1, 2, 0);
- k056832_set_layer_offs(state->m_k056832, 2, 4, 0);
- k056832_set_layer_offs(state->m_k056832, 3, 6, 0);
+ k056832_set_layer_offs(m_k056832, 0, -2, 0);
+ k056832_set_layer_offs(m_k056832, 1, 2, 0);
+ k056832_set_layer_offs(m_k056832, 2, 4, 0);
+ k056832_set_layer_offs(m_k056832, 3, 6, 0);
}
else
{
// other than the intro showing one blank line alignment is good through the game
- k056832_set_layer_offs(state->m_k056832, 0, -2 + 1, 0);
- k056832_set_layer_offs(state->m_k056832, 1, 2 + 1, 0);
- k056832_set_layer_offs(state->m_k056832, 2, 4 + 1, 0);
- k056832_set_layer_offs(state->m_k056832, 3, 6 + 1, 0);
+ k056832_set_layer_offs(m_k056832, 0, -2 + 1, 0);
+ k056832_set_layer_offs(m_k056832, 1, 2 + 1, 0);
+ k056832_set_layer_offs(m_k056832, 2, 4 + 1, 0);
+ k056832_set_layer_offs(m_k056832, 3, 6 + 1, 0);
}
}
diff --git a/src/mame/video/mosaic.c b/src/mame/video/mosaic.c
index 0be63e44352..e3a6b81cd6f 100644
--- a/src/mame/video/mosaic.c
+++ b/src/mame/video/mosaic.c
@@ -43,14 +43,13 @@ TILE_GET_INFO_MEMBER(mosaic_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( mosaic )
+void mosaic_state::video_start()
{
- mosaic_state *state = machine.driver_data<mosaic_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mosaic_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mosaic_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mosaic_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mosaic_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(0xff);
+ m_fg_tilemap->set_transparent_pen(0xff);
}
diff --git a/src/mame/video/mouser.c b/src/mame/video/mouser.c
index fb578c4152e..853dab65e28 100644
--- a/src/mame/video/mouser.c
+++ b/src/mame/video/mouser.c
@@ -16,12 +16,12 @@
#include "emu.h"
#include "includes/mouser.h"
-PALETTE_INIT( mouser )
+void mouser_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -40,7 +40,7 @@ PALETTE_INIT( mouser )
bit1 = BIT(*color_prom, 7);
b = 0x4f * bit0 + 0xa8 * bit1;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
}
diff --git a/src/mame/video/mrdo.c b/src/mame/video/mrdo.c
index 697d78749f7..9571144b4ac 100644
--- a/src/mame/video/mrdo.c
+++ b/src/mame/video/mrdo.c
@@ -42,9 +42,9 @@
***************************************************************************/
-PALETTE_INIT( mrdo )
+void mrdo_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
const int R1 = 150;
@@ -76,7 +76,7 @@ PALETTE_INIT( mrdo )
}
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
for (i = 0; i < 0x100; i++)
{
@@ -102,7 +102,7 @@ PALETTE_INIT( mrdo )
bits2 = (color_prom[a2] >> 4) & 0x03;
b = weight[bits0 + (bits2 << 2)];
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -110,7 +110,7 @@ PALETTE_INIT( mrdo )
/* characters */
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprites */
for (i = 0x100; i < 0x140; i++)
@@ -122,7 +122,7 @@ PALETTE_INIT( mrdo )
else
ctabentry &= 0x0f; /* low 4 bits are for sprite color n */
- colortable_entry_set_value(machine.colortable, i, ctabentry + ((ctabentry & 0x0c) << 3));
+ colortable_entry_set_value(machine().colortable, i, ctabentry + ((ctabentry & 0x0c) << 3));
}
}
@@ -162,24 +162,23 @@ TILE_GET_INFO_MEMBER(mrdo_state::get_fg_tile_info)
***************************************************************************/
-VIDEO_START( mrdo )
+void mrdo_state::video_start()
{
- mrdo_state *state = machine.driver_data<mrdo_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mrdo_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mrdo_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mrdo_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mrdo_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(0, 56);
- state->m_fg_tilemap->set_scrolldx(0, 56);
- state->m_bg_tilemap->set_scrolldy(0, 6);
- state->m_fg_tilemap->set_scrolldy(0, 6);
+ m_bg_tilemap->set_scrolldx(0, 56);
+ m_fg_tilemap->set_scrolldx(0, 56);
+ m_bg_tilemap->set_scrolldy(0, 6);
+ m_fg_tilemap->set_scrolldy(0, 6);
- state->m_flipscreen = 0;
+ m_flipscreen = 0;
- state->save_item(NAME(state->m_flipscreen));
+ save_item(NAME(m_flipscreen));
}
diff --git a/src/mame/video/mrjong.c b/src/mame/video/mrjong.c
index 492a5ed624c..79d7aa15acf 100644
--- a/src/mame/video/mrjong.c
+++ b/src/mame/video/mrjong.c
@@ -16,13 +16,13 @@
***************************************************************************/
-PALETTE_INIT( mrjong )
+void mrjong_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x10);
+ machine().colortable = colortable_alloc(machine(), 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -48,7 +48,7 @@ PALETTE_INIT( mrjong )
bit2 = BIT(color_prom[i], 7);
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -58,7 +58,7 @@ PALETTE_INIT( mrjong )
for (i = 0; i < 0x80; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -99,10 +99,9 @@ TILE_GET_INFO_MEMBER(mrjong_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( mrjong )
+void mrjong_state::video_start()
{
- mrjong_state *state = machine.driver_data<mrjong_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mrjong_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS_FLIP_XY, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mrjong_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS_FLIP_XY, 8, 8, 32, 32);
}
/*
diff --git a/src/mame/video/ms32.c b/src/mame/video/ms32.c
index de19af46efc..f575e79ab17 100644
--- a/src/mame/video/ms32.c
+++ b/src/mame/video/ms32.c
@@ -62,60 +62,58 @@ TILE_GET_INFO_MEMBER(ms32_state::get_ms32_extra_tile_info)
-VIDEO_START( ms32 )
+void ms32_state::video_start()
{
- ms32_state *state = machine.driver_data<ms32_state>();
- state->m_priram_8 = auto_alloc_array_clear(machine, UINT8, 0x2000);
- state->m_palram_16 = auto_alloc_array_clear(machine, UINT16, 0x20000);
- state->m_rozram_16 = auto_alloc_array_clear(machine, UINT16, 0x10000);
- state->m_lineram_16 = auto_alloc_array_clear(machine, UINT16, 0x1000);
- state->m_sprram_16 = auto_alloc_array_clear(machine, UINT16, 0x20000);
- state->m_bgram_16 = auto_alloc_array_clear(machine, UINT16, 0x4000);
- state->m_txram_16 = auto_alloc_array_clear(machine, UINT16, 0x4000);
+ m_priram_8 = auto_alloc_array_clear(machine(), UINT8, 0x2000);
+ m_palram_16 = auto_alloc_array_clear(machine(), UINT16, 0x20000);
+ m_rozram_16 = auto_alloc_array_clear(machine(), UINT16, 0x10000);
+ m_lineram_16 = auto_alloc_array_clear(machine(), UINT16, 0x1000);
+ m_sprram_16 = auto_alloc_array_clear(machine(), UINT16, 0x20000);
+ m_bgram_16 = auto_alloc_array_clear(machine(), UINT16, 0x4000);
+ m_txram_16 = auto_alloc_array_clear(machine(), UINT16, 0x4000);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ms32_state::get_ms32_tx_tile_info),state),TILEMAP_SCAN_ROWS,8, 8,64,64);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ms32_state::get_ms32_bg_tile_info),state),TILEMAP_SCAN_ROWS,16,16,64,64);
- state->m_bg_tilemap_alt = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ms32_state::get_ms32_bg_tile_info),state),TILEMAP_SCAN_ROWS,16,16,256,16); // alt layout, controller by register?
- state->m_roz_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ms32_state::get_ms32_roz_tile_info),state),TILEMAP_SCAN_ROWS,16,16,128,128);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ms32_state::get_ms32_tx_tile_info),this),TILEMAP_SCAN_ROWS,8, 8,64,64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ms32_state::get_ms32_bg_tile_info),this),TILEMAP_SCAN_ROWS,16,16,64,64);
+ m_bg_tilemap_alt = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ms32_state::get_ms32_bg_tile_info),this),TILEMAP_SCAN_ROWS,16,16,256,16); // alt layout, controller by register?
+ m_roz_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ms32_state::get_ms32_roz_tile_info),this),TILEMAP_SCAN_ROWS,16,16,128,128);
/* set up tile layers */
- machine.primary_screen->register_screen_bitmap(state->m_temp_bitmap_tilemaps);
- machine.primary_screen->register_screen_bitmap(state->m_temp_bitmap_sprites);
- machine.primary_screen->register_screen_bitmap(state->m_temp_bitmap_sprites_pri); // not actually being used for rendering, we embed pri info in the raw colour bitmap
+ machine().primary_screen->register_screen_bitmap(m_temp_bitmap_tilemaps);
+ machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites);
+ machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites_pri); // not actually being used for rendering, we embed pri info in the raw colour bitmap
- state->m_temp_bitmap_tilemaps.fill(0);
- state->m_temp_bitmap_sprites.fill(0);
- state->m_temp_bitmap_sprites_pri.fill(0);
+ m_temp_bitmap_tilemaps.fill(0);
+ m_temp_bitmap_sprites.fill(0);
+ m_temp_bitmap_sprites_pri.fill(0);
- state->m_tx_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap_alt->set_transparent_pen(0);
- state->m_roz_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap_alt->set_transparent_pen(0);
+ m_roz_tilemap->set_transparent_pen(0);
- state->m_reverse_sprite_order = 1;
+ m_reverse_sprite_order = 1;
/* i hate per game patches...how should priority really work? tetrisp2.c ? i can't follow it */
- if (!strcmp(machine.system().name,"kirarast")) state->m_reverse_sprite_order = 0;
- if (!strcmp(machine.system().name,"tp2m32")) state->m_reverse_sprite_order = 0;
- if (!strcmp(machine.system().name,"47pie2")) state->m_reverse_sprite_order = 0;
- if (!strcmp(machine.system().name,"47pie2o")) state->m_reverse_sprite_order = 0;
- if (!strcmp(machine.system().name,"hayaosi3")) state->m_reverse_sprite_order = 0;
- if (!strcmp(machine.system().name,"bnstars")) state->m_reverse_sprite_order = 0;
- if (!strcmp(machine.system().name,"wpksocv2")) state->m_reverse_sprite_order = 0;
+ if (!strcmp(machine().system().name,"kirarast")) m_reverse_sprite_order = 0;
+ if (!strcmp(machine().system().name,"tp2m32")) m_reverse_sprite_order = 0;
+ if (!strcmp(machine().system().name,"47pie2")) m_reverse_sprite_order = 0;
+ if (!strcmp(machine().system().name,"47pie2o")) m_reverse_sprite_order = 0;
+ if (!strcmp(machine().system().name,"hayaosi3")) m_reverse_sprite_order = 0;
+ if (!strcmp(machine().system().name,"bnstars")) m_reverse_sprite_order = 0;
+ if (!strcmp(machine().system().name,"wpksocv2")) m_reverse_sprite_order = 0;
// tp2m32 doesn't set the brightness registers so we need sensible defaults
- state->m_brt[0] = state->m_brt[1] = 0xffff;
+ m_brt[0] = m_brt[1] = 0xffff;
}
-VIDEO_START( f1superb )
+VIDEO_START_MEMBER(ms32_state,f1superb)
{
- ms32_state *state = machine.driver_data<ms32_state>();
- VIDEO_START_CALL( ms32 );
+ ms32_state::video_start();
- state->m_f1superb_extraram_16 = auto_alloc_array_clear(machine, UINT16, 0x10000);
- state->m_extra_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ms32_state::get_ms32_extra_tile_info),state),TILEMAP_SCAN_ROWS,2048,1,1,0x400);
+ m_f1superb_extraram_16 = auto_alloc_array_clear(machine(), UINT16, 0x10000);
+ m_extra_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ms32_state::get_ms32_extra_tile_info),this),TILEMAP_SCAN_ROWS,2048,1,1,0x400);
}
diff --git a/src/mame/video/msisaac.c b/src/mame/video/msisaac.c
index 44adf40b55d..a942a2bcee5 100644
--- a/src/mame/video/msisaac.c
+++ b/src/mame/video/msisaac.c
@@ -49,15 +49,14 @@ TILE_GET_INFO_MEMBER(msisaac_state::get_bg2_tile_info)
***************************************************************************/
-VIDEO_START( msisaac )
+void msisaac_state::video_start()
{
- msisaac_state *state = machine.driver_data<msisaac_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(msisaac_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(msisaac_state::get_bg2_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(msisaac_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(msisaac_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(msisaac_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(msisaac_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg2_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_bg2_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/mugsmash.c b/src/mame/video/mugsmash.c
index f3633646ca3..556d3a2a785 100644
--- a/src/mame/video/mugsmash.c
+++ b/src/mame/video/mugsmash.c
@@ -136,14 +136,13 @@ WRITE16_MEMBER(mugsmash_state::mugsmash_reg_w)
}
}
-VIDEO_START( mugsmash )
+void mugsmash_state::video_start()
{
- mugsmash_state *state = machine.driver_data<mugsmash_state>();
- state->m_tilemap1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mugsmash_state::get_mugsmash_tile_info1),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tilemap1->set_transparent_pen(0);
+ m_tilemap1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mugsmash_state::get_mugsmash_tile_info1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tilemap1->set_transparent_pen(0);
- state->m_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mugsmash_state::get_mugsmash_tile_info2),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mugsmash_state::get_mugsmash_tile_info2),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
}
SCREEN_UPDATE_IND16( mugsmash )
diff --git a/src/mame/video/munchmo.c b/src/mame/video/munchmo.c
index 32b341d6ee7..70931efb84b 100644
--- a/src/mame/video/munchmo.c
+++ b/src/mame/video/munchmo.c
@@ -2,12 +2,12 @@
#include "includes/munchmo.h"
-PALETTE_INIT( mnchmobl )
+void munchmo_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -26,7 +26,7 @@ PALETTE_INIT( mnchmobl )
bit1 = BIT(color_prom[i], 7);
b = 0x4f * bit0 + 0xa8 * bit1;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -41,10 +41,9 @@ WRITE8_MEMBER(munchmo_state::mnchmobl_flipscreen_w)
}
-VIDEO_START( mnchmobl )
+void munchmo_state::video_start()
{
- munchmo_state *state = machine.driver_data<munchmo_state>();
- state->m_tmpbitmap = auto_bitmap_ind16_alloc(machine, 512, 512);
+ m_tmpbitmap = auto_bitmap_ind16_alloc(machine(), 512, 512);
}
static void draw_status( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/mustache.c b/src/mame/video/mustache.c
index edea4a79b86..579243c565e 100644
--- a/src/mame/video/mustache.c
+++ b/src/mame/video/mustache.c
@@ -10,9 +10,9 @@
#include "includes/mustache.h"
-PALETTE_INIT(mustache)
+void mustache_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0;i < 256;i++)
@@ -40,7 +40,7 @@ PALETTE_INIT(mustache)
bit3 = (color_prom[i + 512] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -88,13 +88,12 @@ TILE_GET_INFO_MEMBER(mustache_state::get_bg_tile_info)
}
-VIDEO_START( mustache )
+void mustache_state::video_start()
{
- mustache_state *state = machine.driver_data<mustache_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mustache_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS_FLIP_X,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mustache_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS_FLIP_X,
8, 8, 64, 32);
- state->m_bg_tilemap->set_scroll_rows(4);
+ m_bg_tilemap->set_scroll_rows(4);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/mystston.c b/src/mame/video/mystston.c
index c2171935e24..fcc5727ba58 100644
--- a/src/mame/video/mystston.c
+++ b/src/mame/video/mystston.c
@@ -215,17 +215,16 @@ static void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_el
*
*************************************/
-static VIDEO_START( mystston )
+VIDEO_START_MEMBER(mystston_state,mystston)
{
- mystston_state *state = machine.driver_data<mystston_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mystston_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS_FLIP_X, 16, 16, 16, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mystston_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS_FLIP_X, 16, 16, 16, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mystston_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS_FLIP_X, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mystston_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS_FLIP_X, 8, 8, 32, 32);
+ m_fg_tilemap->set_transparent_pen(0);
/* create the interrupt timer */
- state->m_interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
+ m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(interrupt_callback));
}
@@ -236,11 +235,10 @@ static VIDEO_START( mystston )
*
*************************************/
-static VIDEO_RESET( mystston )
+VIDEO_RESET_MEMBER(mystston_state,mystston)
{
- mystston_state *state = machine.driver_data<mystston_state>();
- state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(FIRST_INT_VPOS - 1, INT_HPOS), FIRST_INT_VPOS);
+ m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(FIRST_INT_VPOS - 1, INT_HPOS), FIRST_INT_VPOS);
}
@@ -319,8 +317,8 @@ GFXDECODE_END
*************************************/
MACHINE_CONFIG_FRAGMENT( mystston_video )
- MCFG_VIDEO_START(mystston)
- MCFG_VIDEO_RESET(mystston)
+ MCFG_VIDEO_START_OVERRIDE(mystston_state,mystston)
+ MCFG_VIDEO_RESET_OVERRIDE(mystston_state,mystston)
MCFG_GFXDECODE(mystston)
MCFG_PALETTE_LENGTH(0x40)
diff --git a/src/mame/video/mystwarr.c b/src/mame/video/mystwarr.c
index 5f4658fbb57..93234ff27de 100644
--- a/src/mame/video/mystwarr.c
+++ b/src/mame/video/mystwarr.c
@@ -160,21 +160,20 @@ TILE_GET_INFO_MEMBER(mystwarr_state::get_gai_936_tile_info)
SET_TILE_INFO_MEMBER(0, tileno, colour, 0);
}
-VIDEO_START(gaiapols)
+VIDEO_START_MEMBER(mystwarr_state,gaiapols)
{
- mystwarr_state *state = machine.driver_data<mystwarr_state>();
- K055555_vh_start(machine);
- K054338_vh_start(machine);
+ K055555_vh_start(machine());
+ K054338_vh_start(machine());
- state->m_gametype = 0;
+ m_gametype = 0;
- K056832_vh_start(machine, "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0);
- mystwarr_decode_tiles(machine);
+ mystwarr_decode_tiles(machine());
- K055673_vh_start(machine, "gfx2", 1, -61, -22, gaiapols_sprite_callback); // stage2 brick walls
+ K055673_vh_start(machine(), "gfx2", 1, -61, -22, gaiapols_sprite_callback); // stage2 brick walls
- konamigx_mixer_init(machine, 0);
+ konamigx_mixer_init(machine(), 0);
K056832_set_LayerOffset(0, -2+2-1, 0-1);
K056832_set_LayerOffset(1, 0+2, 0);
@@ -184,8 +183,8 @@ VIDEO_START(gaiapols)
K053936_wraparound_enable(0, 1);
K053936GP_set_offset(0, -10, 0); // floor tiles in demo loop2 (Elaine vs. boss)
- state->m_ult_936_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mystwarr_state::get_gai_936_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 512, 512);
- state->m_ult_936_tilemap->set_transparent_pen(0);
+ m_ult_936_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mystwarr_state::get_gai_936_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 512, 512);
+ m_ult_936_tilemap->set_transparent_pen(0);
}
TILE_GET_INFO_MEMBER(mystwarr_state::get_ult_936_tile_info)
@@ -201,21 +200,20 @@ TILE_GET_INFO_MEMBER(mystwarr_state::get_ult_936_tile_info)
SET_TILE_INFO_MEMBER(0, tileno, colour, (dat1[tile_index]&0x40) ? TILE_FLIPX : 0);
}
-VIDEO_START(dadandrn)
+VIDEO_START_MEMBER(mystwarr_state,dadandrn)
{
- mystwarr_state *state = machine.driver_data<mystwarr_state>();
- K055555_vh_start(machine);
- K054338_vh_start(machine);
+ K055555_vh_start(machine());
+ K054338_vh_start(machine());
- state->m_gametype = 1;
+ m_gametype = 1;
- K056832_vh_start(machine, "gfx1", K056832_BPP_5, 0, NULL, game5bpp_tile_callback, 0);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game5bpp_tile_callback, 0);
- mystwarr_decode_tiles(machine);
+ mystwarr_decode_tiles(machine());
- K055673_vh_start(machine, "gfx2", 0, -42, -22, gaiapols_sprite_callback);
+ K055673_vh_start(machine(), "gfx2", 0, -42, -22, gaiapols_sprite_callback);
- konamigx_mixer_init(machine, 0);
+ konamigx_mixer_init(machine(), 0);
konamigx_mixer_primode(1);
@@ -227,50 +225,48 @@ VIDEO_START(dadandrn)
K053936_wraparound_enable(0, 1);
K053936GP_set_offset(0, -8, 0); // Brainy's laser
- state->m_ult_936_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(mystwarr_state::get_ult_936_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 512, 512);
- state->m_ult_936_tilemap->set_transparent_pen(0);
+ m_ult_936_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(mystwarr_state::get_ult_936_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 512, 512);
+ m_ult_936_tilemap->set_transparent_pen(0);
}
-VIDEO_START(mystwarr)
+VIDEO_START_MEMBER(mystwarr_state,mystwarr)
{
- mystwarr_state *state = machine.driver_data<mystwarr_state>();
- K055555_vh_start(machine);
- K054338_vh_start(machine);
+ K055555_vh_start(machine());
+ K054338_vh_start(machine());
- state->m_gametype = 0;
+ m_gametype = 0;
- K056832_vh_start(machine, "gfx1", K056832_BPP_5, 0, NULL, mystwarr_tile_callback, 0);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, mystwarr_tile_callback, 0);
- mystwarr_decode_tiles(machine);
+ mystwarr_decode_tiles(machine());
- K055673_vh_start(machine, "gfx2", 0, -48, -24, mystwarr_sprite_callback);
+ K055673_vh_start(machine(), "gfx2", 0, -48, -24, mystwarr_sprite_callback);
- konamigx_mixer_init(machine, 0);
+ konamigx_mixer_init(machine(), 0);
K056832_set_LayerOffset(0, -2-3, 0);
K056832_set_LayerOffset(1, 0-3, 0);
K056832_set_LayerOffset(2, 2-3, 0);
K056832_set_LayerOffset(3, 3-3, 0);
- state->m_cbparam = 0;
+ m_cbparam = 0;
}
-VIDEO_START(metamrph)
+VIDEO_START_MEMBER(mystwarr_state,metamrph)
{
- mystwarr_state *state = machine.driver_data<mystwarr_state>();
- state->m_gametype = 0;
+ m_gametype = 0;
- K055555_vh_start(machine);
- K054338_vh_start(machine);
+ K055555_vh_start(machine());
+ K054338_vh_start(machine());
- K056832_vh_start(machine, "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0);
- mystwarr_decode_tiles(machine);
+ mystwarr_decode_tiles(machine());
- K055673_vh_start(machine, "gfx2", 1, -51, -22, metamrph_sprite_callback);
+ K055673_vh_start(machine(), "gfx2", 1, -51, -22, metamrph_sprite_callback);
- konamigx_mixer_init(machine, 0);
+ konamigx_mixer_init(machine(), 0);
// other reference, floor at first boss
K056832_set_LayerOffset(0, -2+4, 0); // text
@@ -279,21 +275,20 @@ VIDEO_START(metamrph)
K056832_set_LayerOffset(3, 3+4, 0); // attract sky background to sea
}
-VIDEO_START(viostorm)
+VIDEO_START_MEMBER(mystwarr_state,viostorm)
{
- mystwarr_state *state = machine.driver_data<mystwarr_state>();
- state->m_gametype = 0;
+ m_gametype = 0;
- K055555_vh_start(machine);
- K054338_vh_start(machine);
+ K055555_vh_start(machine());
+ K054338_vh_start(machine());
- K056832_vh_start(machine, "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0);
- mystwarr_decode_tiles(machine);
+ mystwarr_decode_tiles(machine());
- K055673_vh_start(machine, "gfx2", 1, -62, -23, metamrph_sprite_callback);
+ K055673_vh_start(machine(), "gfx2", 1, -62, -23, metamrph_sprite_callback);
- konamigx_mixer_init(machine, 0);
+ konamigx_mixer_init(machine(), 0);
K056832_set_LayerOffset(0, -2+1, 0);
K056832_set_LayerOffset(1, 0+1, 0);
@@ -301,21 +296,20 @@ VIDEO_START(viostorm)
K056832_set_LayerOffset(3, 3+1, 0);
}
-VIDEO_START(martchmp)
+VIDEO_START_MEMBER(mystwarr_state,martchmp)
{
- mystwarr_state *state = machine.driver_data<mystwarr_state>();
- state->m_gametype = 0;
+ m_gametype = 0;
- K055555_vh_start(machine);
- K054338_vh_start(machine);
+ K055555_vh_start(machine());
+ K054338_vh_start(machine());
- K056832_vh_start(machine, "gfx1", K056832_BPP_5, 0, NULL, game5bpp_tile_callback, 0);
+ K056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game5bpp_tile_callback, 0);
- mystwarr_decode_tiles(machine);
+ mystwarr_decode_tiles(machine());
- K055673_vh_start(machine, "gfx2", 0, -58, -23, martchmp_sprite_callback);
+ K055673_vh_start(machine(), "gfx2", 0, -58, -23, martchmp_sprite_callback);
- konamigx_mixer_init(machine, 0);
+ konamigx_mixer_init(machine(), 0);
K056832_set_LayerOffset(0, -2-4, 0);
K056832_set_LayerOffset(1, 0-4, 0);
diff --git a/src/mame/video/n64.c b/src/mame/video/n64.c
index 17d6cfb0054..f66ee4d9820 100644
--- a/src/mame/video/n64.c
+++ b/src/mame/video/n64.c
@@ -3826,21 +3826,20 @@ n64_rdp::n64_rdp(n64_state &state) : poly_manager<UINT32, rdp_poly_state, 8, 320
_Fill[1] = &n64_rdp::_Fill32Bit;
}
-VIDEO_START(n64)
+void n64_state::video_start()
{
- n64_state *state = machine.driver_data<n64_state>();
- state->m_rdp = auto_alloc(machine, n64_rdp(*state));
+ m_rdp = auto_alloc(machine(), n64_rdp(*this));
- state->m_rdp->SetMachine(machine);
- state->m_rdp->InitInternalState();
+ m_rdp->SetMachine(machine());
+ m_rdp->InitInternalState();
- state->m_rdp->Blender.SetMachine(machine);
- state->m_rdp->Blender.SetProcessor(state->m_rdp);
+ m_rdp->Blender.SetMachine(machine());
+ m_rdp->Blender.SetProcessor(m_rdp);
- state->m_rdp->TexPipe.SetMachine(machine);
+ m_rdp->TexPipe.SetMachine(machine());
- state->m_rdp->AuxBuf = auto_alloc_array_clear(machine, UINT8, EXTENT_AUX_COUNT);
+ m_rdp->AuxBuf = auto_alloc_array_clear(machine(), UINT8, EXTENT_AUX_COUNT);
if (LOG_RDP_EXECUTION)
{
diff --git a/src/mame/video/n8080.c b/src/mame/video/n8080.c
index 906eaf09f8e..92d8e068595 100644
--- a/src/mame/video/n8080.c
+++ b/src/mame/video/n8080.c
@@ -17,30 +17,30 @@ WRITE8_MEMBER(n8080_state::n8080_video_control_w)
}
-PALETTE_INIT( n8080 )
+PALETTE_INIT_MEMBER(n8080_state,n8080)
{
int i;
for (i = 0; i < 8; i++)
- palette_set_color_rgb(machine, i, pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
+ palette_set_color_rgb(machine(), i, pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
}
-PALETTE_INIT( helifire )
+PALETTE_INIT_MEMBER(n8080_state,helifire)
{
int i;
- PALETTE_INIT_CALL(n8080);
+ PALETTE_INIT_CALL_MEMBER(n8080);
for (i = 0; i < 0x100; i++)
{
int level = 0xff * exp(-3 * i / 255.); /* capacitor discharge */
- palette_set_color(machine, 0x000 + 8 + i, MAKE_RGB(0x00, 0x00, level)); /* shades of blue */
- palette_set_color(machine, 0x100 + 8 + i, MAKE_RGB(0x00, 0xC0, level)); /* shades of blue w/ green star */
+ palette_set_color(machine(), 0x000 + 8 + i, MAKE_RGB(0x00, 0x00, level)); /* shades of blue */
+ palette_set_color(machine(), 0x100 + 8 + i, MAKE_RGB(0x00, 0xC0, level)); /* shades of blue w/ green star */
- palette_set_color(machine, 0x200 + 8 + i, MAKE_RGB(level, 0x00, 0x00)); /* shades of red */
- palette_set_color(machine, 0x300 + 8 + i, MAKE_RGB(level, 0xC0, 0x00)); /* shades of red w/ green star */
+ palette_set_color(machine(), 0x200 + 8 + i, MAKE_RGB(level, 0x00, 0x00)); /* shades of red */
+ palette_set_color(machine(), 0x300 + 8 + i, MAKE_RGB(level, 0xC0, 0x00)); /* shades of red w/ green star */
}
}
@@ -88,40 +88,37 @@ static void helifire_next_line( running_machine &machine )
}
-VIDEO_START( spacefev )
+VIDEO_START_MEMBER(n8080_state,spacefev)
{
- n8080_state *state = machine.driver_data<n8080_state>();
- state->m_cannon_timer = machine.scheduler().timer_alloc(FUNC(spacefev_stop_red_cannon));
+ m_cannon_timer = machine().scheduler().timer_alloc(FUNC(spacefev_stop_red_cannon));
- state->flip_screen_set_no_update(0);
+ flip_screen_set_no_update(0);
- state->save_item(NAME(state->m_spacefev_red_screen));
- state->save_item(NAME(state->m_spacefev_red_cannon));
+ save_item(NAME(m_spacefev_red_screen));
+ save_item(NAME(m_spacefev_red_cannon));
}
-VIDEO_START( sheriff )
+VIDEO_START_MEMBER(n8080_state,sheriff)
{
- n8080_state *state = machine.driver_data<n8080_state>();
- state->flip_screen_set_no_update(0);
+ flip_screen_set_no_update(0);
- state->save_item(NAME(state->m_sheriff_color_mode));
- state->save_item(NAME(state->m_sheriff_color_data));
+ save_item(NAME(m_sheriff_color_mode));
+ save_item(NAME(m_sheriff_color_data));
}
-VIDEO_START( helifire )
+VIDEO_START_MEMBER(n8080_state,helifire)
{
- n8080_state *state = machine.driver_data<n8080_state>();
UINT8 data = 0;
int i;
- state->save_item(NAME(state->m_helifire_mv));
- state->save_item(NAME(state->m_helifire_sc));
- state->save_item(NAME(state->m_helifire_flash));
- state->save_item(NAME(state->m_helifire_LSFR));
+ save_item(NAME(m_helifire_mv));
+ save_item(NAME(m_helifire_sc));
+ save_item(NAME(m_helifire_flash));
+ save_item(NAME(m_helifire_LSFR));
for (i = 0; i < 63; i++)
{
@@ -131,10 +128,10 @@ VIDEO_START( helifire )
data = (data << 1) | (bit & 1);
- state->m_helifire_LSFR[i] = data;
+ m_helifire_LSFR[i] = data;
}
- state->flip_screen_set_no_update(0);
+ flip_screen_set_no_update(0);
}
diff --git a/src/mame/video/namcofl.c b/src/mame/video/namcofl.c
index 5472df98243..3db44a24ddf 100644
--- a/src/mame/video/namcofl.c
+++ b/src/mame/video/namcofl.c
@@ -117,10 +117,9 @@ static int FLobjcode2tile( running_machine &machine, int code )
return code;
}
-VIDEO_START( namcofl )
+VIDEO_START_MEMBER(namcofl_state,namcofl)
{
- namcofl_state *state = machine.driver_data<namcofl_state>();
- state->namco_tilemap_init(NAMCOFL_TILEGFX, machine.root_device().memregion(NAMCOFL_TILEMASKREGION)->base(), TilemapCB );
- state->c355_obj_init(NAMCOFL_SPRITEGFX,0x0,namcos2_shared_state::c355_obj_code2tile_delegate(FUNC(FLobjcode2tile), &machine));
- state->c169_roz_init(NAMCOFL_ROTGFX,NAMCOFL_ROTMASKREGION);
+ namco_tilemap_init(NAMCOFL_TILEGFX, machine().root_device().memregion(NAMCOFL_TILEMASKREGION)->base(), TilemapCB );
+ c355_obj_init(NAMCOFL_SPRITEGFX,0x0,namcos2_shared_state::c355_obj_code2tile_delegate(FUNC(FLobjcode2tile), &machine()));
+ c169_roz_init(NAMCOFL_ROTGFX,NAMCOFL_ROTMASKREGION);
}
diff --git a/src/mame/video/namcona1.c b/src/mame/video/namcona1.c
index 7bab78b5cc5..36563f09815 100644
--- a/src/mame/video/namcona1.c
+++ b/src/mame/video/namcona1.c
@@ -275,32 +275,31 @@ static void UpdateGfx(running_machine &machine)
{
} /* UpdateGfx */
-VIDEO_START( namcona1 )
+void namcona1_state::video_start()
{
- namcona1_state *state = machine.driver_data<namcona1_state>();
static const tilemap_get_info_delegate get_info[4] = {
- tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info0),state),
- tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info1),state),
- tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info2),state),
- tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info3),state)
+ tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info0),this),
+ tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info1),this),
+ tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info2),this),
+ tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info3),this)
};
int i;
- state->m_roz_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcona1_state::roz_get_info),state), TILEMAP_SCAN_ROWS, 8,8,64,64 );
- state->m_roz_palette = -1;
+ m_roz_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcona1_state::roz_get_info),this), TILEMAP_SCAN_ROWS, 8,8,64,64 );
+ m_roz_palette = -1;
for( i=0; i<NAMCONA1_NUM_TILEMAPS; i++ )
{
- state->m_bg_tilemap[i] = &machine.tilemap().create(get_info[i], TILEMAP_SCAN_ROWS, 8,8,64,64 );
- state->m_tilemap_palette_bank[i] = -1;
+ m_bg_tilemap[i] = &machine().tilemap().create(get_info[i], TILEMAP_SCAN_ROWS, 8,8,64,64 );
+ m_tilemap_palette_bank[i] = -1;
}
- state->m_shaperam = auto_alloc_array(machine, UINT16, 0x2000*4/2 );
- state->m_cgram = auto_alloc_array(machine, UINT16, 0x1000*0x40/2 );
+ m_shaperam = auto_alloc_array(machine(), UINT16, 0x2000*4/2 );
+ m_cgram = auto_alloc_array(machine(), UINT16, 0x1000*0x40/2 );
- machine.gfx[0] = auto_alloc( machine, gfx_element( machine, cg_layout_8bpp, (UINT8 *)state->m_cgram, machine.total_colors()/256, 0 ));
- machine.gfx[1] = auto_alloc( machine, gfx_element( machine, cg_layout_4bpp, (UINT8 *)state->m_cgram, machine.total_colors()/16, 0 ));
- machine.gfx[2] = auto_alloc( machine, gfx_element( machine, shape_layout, (UINT8 *)state->m_shaperam, machine.total_colors()/2, 0 ));
+ machine().gfx[0] = auto_alloc( machine(), gfx_element( machine(), cg_layout_8bpp, (UINT8 *)m_cgram, machine().total_colors()/256, 0 ));
+ machine().gfx[1] = auto_alloc( machine(), gfx_element( machine(), cg_layout_4bpp, (UINT8 *)m_cgram, machine().total_colors()/16, 0 ));
+ machine().gfx[2] = auto_alloc( machine(), gfx_element( machine(), shape_layout, (UINT8 *)m_shaperam, machine().total_colors()/2, 0 ));
} /* namcona1_vh_start */
diff --git a/src/mame/video/namconb1.c b/src/mame/video/namconb1.c
index a44e0e9bd98..e6c0ec09533 100644
--- a/src/mame/video/namconb1.c
+++ b/src/mame/video/namconb1.c
@@ -162,11 +162,10 @@ NB1objcode2tile( running_machine &machine, int code )
return (code&0x7ff) + bank*0x800;
}
-VIDEO_START( namconb1 )
+VIDEO_START_MEMBER(namconb1_state,namconb1)
{
- namconb1_state *state = machine.driver_data<namconb1_state>();
- state->namco_tilemap_init(NAMCONB1_TILEGFX, machine.root_device().memregion(NAMCONB1_TILEMASKREGION)->base(), NB1TilemapCB );
- state->c355_obj_init(NAMCONB1_SPRITEGFX,0x0,namcos2_shared_state::c355_obj_code2tile_delegate(FUNC(NB1objcode2tile), &machine));
+ namco_tilemap_init(NAMCONB1_TILEGFX, machine().root_device().memregion(NAMCONB1_TILEMASKREGION)->base(), NB1TilemapCB );
+ c355_obj_init(NAMCONB1_SPRITEGFX,0x0,namcos2_shared_state::c355_obj_code2tile_delegate(FUNC(NB1objcode2tile), &machine()));
} /* namconb1 */
/****************************************************************************************************/
@@ -224,10 +223,9 @@ NB2objcode2tile( running_machine &machine, int code )
return code;
} /* NB2objcode2tile */
-VIDEO_START( namconb2 )
+VIDEO_START_MEMBER(namconb1_state,namconb2)
{
- namconb1_state *state = machine.driver_data<namconb1_state>();
- state->namco_tilemap_init(NAMCONB1_TILEGFX, machine.root_device().memregion(NAMCONB1_TILEMASKREGION)->base(), NB2TilemapCB );
- state->c355_obj_init(NAMCONB1_SPRITEGFX,0x0,namcos2_shared_state::c355_obj_code2tile_delegate(FUNC(NB2objcode2tile), &machine));
- state->c169_roz_init(NAMCONB1_ROTGFX,NAMCONB1_ROTMASKREGION);
+ namco_tilemap_init(NAMCONB1_TILEGFX, machine().root_device().memregion(NAMCONB1_TILEMASKREGION)->base(), NB2TilemapCB );
+ c355_obj_init(NAMCONB1_SPRITEGFX,0x0,namcos2_shared_state::c355_obj_code2tile_delegate(FUNC(NB2objcode2tile), &machine()));
+ c169_roz_init(NAMCONB1_ROTGFX,NAMCONB1_ROTMASKREGION);
} /* namconb2_vh_start */
diff --git a/src/mame/video/namcos1.c b/src/mame/video/namcos1.c
index 6e7da23f6d2..096e0bdd7f9 100644
--- a/src/mame/video/namcos1.c
+++ b/src/mame/video/namcos1.c
@@ -110,56 +110,55 @@ TILE_GET_INFO_MEMBER(namcos1_state::fg_get_info5)
***************************************************************************/
-VIDEO_START( namcos1 )
+void namcos1_state::video_start()
{
- namcos1_state *state = machine.driver_data<namcos1_state>();
int i;
- state->m_tilemap_maskdata = (UINT8 *)state->memregion("gfx1")->base();
+ m_tilemap_maskdata = (UINT8 *)memregion("gfx1")->base();
/* allocate videoram */
- state->m_videoram = auto_alloc_array(machine, UINT8, 0x8000);
- state->m_spriteram = auto_alloc_array(machine, UINT8, 0x1000);
+ m_videoram = auto_alloc_array(machine(), UINT8, 0x8000);
+ m_spriteram = auto_alloc_array(machine(), UINT8, 0x1000);
/* initialize playfields */
- state->m_bg_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::bg_get_info0),state),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_bg_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::bg_get_info1),state),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_bg_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::bg_get_info2),state),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_bg_tilemap[3] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::bg_get_info3),state),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_bg_tilemap[4] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::fg_get_info4),state),TILEMAP_SCAN_ROWS,8,8,36,28);
- state->m_bg_tilemap[5] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::fg_get_info5),state),TILEMAP_SCAN_ROWS,8,8,36,28);
-
- state->m_bg_tilemap[4]->set_scrolldx(73,512-73);
- state->m_bg_tilemap[5]->set_scrolldx(73,512-73);
- state->m_bg_tilemap[4]->set_scrolldy(0x10,0x110);
- state->m_bg_tilemap[5]->set_scrolldy(0x10,0x110);
+ m_bg_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::bg_get_info0),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_bg_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::bg_get_info1),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_bg_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::bg_get_info2),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_bg_tilemap[3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::bg_get_info3),this),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap[4] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::fg_get_info4),this),TILEMAP_SCAN_ROWS,8,8,36,28);
+ m_bg_tilemap[5] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcos1_state::fg_get_info5),this),TILEMAP_SCAN_ROWS,8,8,36,28);
+
+ m_bg_tilemap[4]->set_scrolldx(73,512-73);
+ m_bg_tilemap[5]->set_scrolldx(73,512-73);
+ m_bg_tilemap[4]->set_scrolldy(0x10,0x110);
+ m_bg_tilemap[5]->set_scrolldy(0x10,0x110);
/* register videoram to the save state system (post-allocation) */
- state_save_register_global_pointer(machine, state->m_videoram, 0x8000);
- state_save_register_global_array(machine, state->m_cus116);
- state_save_register_global_pointer(machine, state->m_spriteram, 0x1000);
- state_save_register_global_array(machine, state->m_playfield_control);
+ state_save_register_global_pointer(machine(), m_videoram, 0x8000);
+ state_save_register_global_array(machine(), m_cus116);
+ state_save_register_global_pointer(machine(), m_spriteram, 0x1000);
+ state_save_register_global_array(machine(), m_playfield_control);
/* set table for sprite color == 0x7f */
for (i = 0;i < 15;i++)
- state->m_drawmode_table[i] = DRAWMODE_SHADOW;
- state->m_drawmode_table[15] = DRAWMODE_NONE;
+ m_drawmode_table[i] = DRAWMODE_SHADOW;
+ m_drawmode_table[15] = DRAWMODE_NONE;
/* clear paletteram */
- memset(state->m_paletteram, 0, 0x8000);
- memset(state->m_cus116, 0, 0x10);
+ memset(m_paletteram, 0, 0x8000);
+ memset(m_cus116, 0, 0x10);
for (i = 0; i < 0x2000; i++)
- palette_set_color(machine, i, MAKE_RGB(0, 0, 0));
+ palette_set_color(machine(), i, MAKE_RGB(0, 0, 0));
/* all palette entries are not affected by shadow sprites... */
for (i = 0;i < 0x2000;i++)
- machine.shadow_table[i] = i;
+ machine().shadow_table[i] = i;
/* ... except for tilemap colors */
for (i = 0x0800;i < 0x1000;i++)
- machine.shadow_table[i] = i + 0x0800;
+ machine().shadow_table[i] = i + 0x0800;
- memset(state->m_playfield_control, 0, sizeof(state->m_playfield_control));
- state->m_copy_sprites = 0;
+ memset(m_playfield_control, 0, sizeof(m_playfield_control));
+ m_copy_sprites = 0;
}
diff --git a/src/mame/video/namcos21.c b/src/mame/video/namcos21.c
index 94aee1b2eac..0758276e4c0 100644
--- a/src/mame/video/namcos21.c
+++ b/src/mame/video/namcos21.c
@@ -113,15 +113,14 @@ CopyVisiblePolyFrameBuffer( running_machine &machine, bitmap_ind16 &bitmap, cons
}
} /* CopyVisiblePolyFrameBuffer */
-VIDEO_START( namcos21 )
+VIDEO_START_MEMBER(namcos21_state,namcos21)
{
- namcos21_state *state = machine.driver_data<namcos21_state>();
- if( state->m_gametype == NAMCOS21_WINRUN91 )
+ if( m_gametype == NAMCOS21_WINRUN91 )
{
- state->m_videoram = auto_alloc_array(machine, UINT8, 0x80000);
+ m_videoram = auto_alloc_array(machine(), UINT8, 0x80000);
}
- AllocatePolyFrameBuffer(machine);
- state->c355_obj_init(
+ AllocatePolyFrameBuffer(machine());
+ c355_obj_init(
0, /* gfx bank */
0xf, /* reverse palette mapping */
namcos2_shared_state::c355_obj_code2tile_delegate() );
diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c
index 1e8ed3a866b..a9906d965b3 100644
--- a/src/mame/video/namcos22.c
+++ b/src/mame/video/namcos22.c
@@ -2724,63 +2724,60 @@ static void namcos22_exit(running_machine &machine)
poly_free(state->m_poly);
}
-static VIDEO_START( common )
+VIDEO_START_MEMBER(namcos22_state,common)
{
- namcos22_state *state = machine.driver_data<namcos22_state>();
int code;
- state->m_mix_bitmap = auto_bitmap_ind16_alloc(machine,640,480);
- state->m_bgtilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcos22_state::TextTilemapGetInfo),state),TILEMAP_SCAN_ROWS,16,16,64,64 );
- state->m_bgtilemap->set_transparent_pen(0xf);
+ m_mix_bitmap = auto_bitmap_ind16_alloc(machine(),640,480);
+ m_bgtilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcos22_state::TextTilemapGetInfo),this),TILEMAP_SCAN_ROWS,16,16,64,64 );
+ m_bgtilemap->set_transparent_pen(0xf);
- state->m_mbDSPisActive = 0;
- memset( state->m_polygonram, 0xcc, 0x20000 );
+ m_mbDSPisActive = 0;
+ memset( m_polygonram, 0xcc, 0x20000 );
- for (code = 0; code < machine.gfx[GFX_TEXTURE_TILE]->elements(); code++)
- machine.gfx[GFX_TEXTURE_TILE]->decode(code);
+ for (code = 0; code < machine().gfx[GFX_TEXTURE_TILE]->elements(); code++)
+ machine().gfx[GFX_TEXTURE_TILE]->decode(code);
- Prepare3dTexture(machine, state->memregion("textilemap")->base(), machine.gfx[GFX_TEXTURE_TILE]->get_data(0) );
- state->m_dirtypal = auto_alloc_array(machine, UINT8, NAMCOS22_PALETTE_SIZE/4);
- state->m_mPtRomSize = state->memregion("pointrom")->bytes()/3;
- state->m_mpPolyL = state->memregion("pointrom")->base();
- state->m_mpPolyM = state->m_mpPolyL + state->m_mPtRomSize;
- state->m_mpPolyH = state->m_mpPolyM + state->m_mPtRomSize;
+ Prepare3dTexture(machine(), memregion("textilemap")->base(), machine().gfx[GFX_TEXTURE_TILE]->get_data(0) );
+ m_dirtypal = auto_alloc_array(machine(), UINT8, NAMCOS22_PALETTE_SIZE/4);
+ m_mPtRomSize = memregion("pointrom")->bytes()/3;
+ m_mpPolyL = memregion("pointrom")->base();
+ m_mpPolyM = m_mpPolyL + m_mPtRomSize;
+ m_mpPolyH = m_mpPolyM + m_mPtRomSize;
- state->m_poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), 0);
- machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(namcos22_reset), &machine));
- machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(namcos22_exit), &machine));
+ m_poly = poly_alloc(machine(), 4000, sizeof(poly_extra_data), 0);
+ machine().add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(namcos22_reset), &machine()));
+ machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(namcos22_exit), &machine()));
- machine.gfx[GFX_CHAR]->set_source((UINT8 *)state->m_cgram.target());
+ machine().gfx[GFX_CHAR]->set_source((UINT8 *)m_cgram.target());
}
-VIDEO_START( namcos22 )
+VIDEO_START_MEMBER(namcos22_state,namcos22)
{
- namcos22_state *state = machine.driver_data<namcos22_state>();
- state->m_mbSuperSystem22 = 0;
- VIDEO_START_CALL(common);
+ m_mbSuperSystem22 = 0;
+ VIDEO_START_CALL_MEMBER(common);
}
-VIDEO_START( namcos22s )
+VIDEO_START_MEMBER(namcos22_state,namcos22s)
{
- namcos22_state *state = machine.driver_data<namcos22_state>();
- state->m_mbSuperSystem22 = 1;
+ m_mbSuperSystem22 = 1;
// init spotram
- state->m_spotram = auto_alloc_array(machine, UINT16, SPOTRAM_SIZE);
- memset(state->m_spotram, 0, SPOTRAM_SIZE*2);
+ m_spotram = auto_alloc_array(machine(), UINT16, SPOTRAM_SIZE);
+ memset(m_spotram, 0, SPOTRAM_SIZE*2);
// init czram tables
int table;
for (table=0; table<4; table++)
{
- state->m_banked_czram[table] = auto_alloc_array(machine, UINT16, 0x100);
- memset(state->m_banked_czram[table], 0, 0x100*2);
- state->m_recalc_czram[table] = auto_alloc_array(machine, UINT8, 0x2000);
- memset(state->m_recalc_czram[table], 0, 0x2000);
- state->m_cz_was_written[table] = 0;
+ m_banked_czram[table] = auto_alloc_array(machine(), UINT16, 0x100);
+ memset(m_banked_czram[table], 0, 0x100*2);
+ m_recalc_czram[table] = auto_alloc_array(machine(), UINT8, 0x2000);
+ memset(m_recalc_czram[table], 0, 0x2000);
+ m_cz_was_written[table] = 0;
}
- VIDEO_START_CALL(common);
+ VIDEO_START_CALL_MEMBER(common);
}
SCREEN_UPDATE_RGB32( namcos22s )
diff --git a/src/mame/video/namcos86.c b/src/mame/video/namcos86.c
index 1a4249448ac..a606ace215b 100644
--- a/src/mame/video/namcos86.c
+++ b/src/mame/video/namcos86.c
@@ -32,10 +32,9 @@ Namco System 86 Video Hardware
***************************************************************************/
-PALETTE_INIT( namcos86 )
+void namcos86_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- namcos86_state *state = machine.driver_data<namcos86_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
rgb_t palette[512];
@@ -68,15 +67,15 @@ PALETTE_INIT( namcos86 )
/* tiles lookup table */
for (i = 0;i < 2048;i++)
- palette_set_color(machine, i, palette[*color_prom++]);
+ palette_set_color(machine(), i, palette[*color_prom++]);
/* sprites lookup table */
for (i = 0;i < 2048;i++)
- palette_set_color(machine, 2048 + i, palette[256 + *color_prom++]);
+ palette_set_color(machine(), 2048 + i, palette[256 + *color_prom++]);
/* color_prom now points to the beginning of the tile address decode PROM */
- state->m_tile_address_prom = color_prom; /* we'll need this at run time */
+ m_tile_address_prom = color_prom; /* we'll need this at run time */
}
@@ -132,20 +131,19 @@ TILE_GET_INFO_MEMBER(namcos86_state::get_tile_info3)
***************************************************************************/
-VIDEO_START( namcos86 )
+void namcos86_state::video_start()
{
- namcos86_state *state = machine.driver_data<namcos86_state>();
- state->m_bg_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcos86_state::get_tile_info0),state),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_bg_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcos86_state::get_tile_info1),state),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_bg_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcos86_state::get_tile_info2),state),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_bg_tilemap[3] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(namcos86_state::get_tile_info3),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcos86_state::get_tile_info0),this),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcos86_state::get_tile_info1),this),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcos86_state::get_tile_info2),this),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap[3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namcos86_state::get_tile_info3),this),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_bg_tilemap[0]->set_transparent_pen(7);
- state->m_bg_tilemap[1]->set_transparent_pen(7);
- state->m_bg_tilemap[2]->set_transparent_pen(7);
- state->m_bg_tilemap[3]->set_transparent_pen(7);
+ m_bg_tilemap[0]->set_transparent_pen(7);
+ m_bg_tilemap[1]->set_transparent_pen(7);
+ m_bg_tilemap[2]->set_transparent_pen(7);
+ m_bg_tilemap[3]->set_transparent_pen(7);
- state->m_spriteram = state->m_rthunder_spriteram + 0x1800;
+ m_spriteram = m_rthunder_spriteram + 0x1800;
}
diff --git a/src/mame/video/naughtyb.c b/src/mame/video/naughtyb.c
index c845fded434..ea4f752bb1a 100644
--- a/src/mame/video/naughtyb.c
+++ b/src/mame/video/naughtyb.c
@@ -56,9 +56,9 @@ static const res_net_info naughtyb_net_info =
***************************************************************************/
-PALETTE_INIT( naughtyb )
+void naughtyb_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[2] = { 270, 130 };
double weights[2];
int i;
@@ -69,7 +69,7 @@ PALETTE_INIT( naughtyb )
2, resistances, weights, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0;i < machine.total_colors(); i++)
+ for (i = 0;i < machine().total_colors(); i++)
{
int bit0, bit1;
int r, g, b;
@@ -89,7 +89,7 @@ PALETTE_INIT( naughtyb )
bit1 = (color_prom[i+0x100] >> 1) & 0x01;
b = combine_2_weights(weights, bit0, bit1);
- palette_set_color(machine, BITSWAP8(i,5,7,6,2,1,0,4,3), MAKE_RGB(r, g, b));
+ palette_set_color(machine(), BITSWAP8(i,5,7,6,2,1,0,4,3), MAKE_RGB(r, g, b));
}
}
@@ -99,13 +99,12 @@ PALETTE_INIT( naughtyb )
Start the video hardware emulation.
***************************************************************************/
-VIDEO_START( naughtyb )
+void naughtyb_state::video_start()
{
- naughtyb_state *state = machine.driver_data<naughtyb_state>();
- state->m_palreg = state->m_bankreg = 0;
+ m_palreg = m_bankreg = 0;
/* Naughty Boy has a virtual screen twice as large as the visible screen */
- state->m_tmpbitmap.allocate(68*8,28*8,machine.primary_screen->format());
+ m_tmpbitmap.allocate(68*8,28*8,machine().primary_screen->format());
}
diff --git a/src/mame/video/nbmj8688.c b/src/mame/video/nbmj8688.c
index 82e98dd57d8..054f02b9ea0 100644
--- a/src/mame/video/nbmj8688.c
+++ b/src/mame/video/nbmj8688.c
@@ -38,7 +38,7 @@ enum
******************************************************************************/
-PALETTE_INIT( mbmj8688_8bit )
+PALETTE_INIT_MEMBER(nbmj8688_state,mbmj8688_8bit)
{
int i;
int bit0, bit1, bit2, r, g, b;
@@ -63,11 +63,11 @@ PALETTE_INIT( mbmj8688_8bit )
bit2 = ((i >> 7) & 0x01);
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
-PALETTE_INIT( mbmj8688_12bit )
+PALETTE_INIT_MEMBER(nbmj8688_state,mbmj8688_12bit)
{
int i;
int r, g, b;
@@ -80,11 +80,11 @@ PALETTE_INIT( mbmj8688_12bit )
g = ((i & 0x38) >> 2) | (((i >> 8) & 0x02) >> 1);
b = ((i & 0xc0) >> 4) | (((i >> 8) & 0x0c) >> 2);
- palette_set_color_rgb(machine, i, pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(machine(), i, pal4bit(r), pal4bit(g), pal4bit(b));
}
}
-PALETTE_INIT( mbmj8688_16bit )
+PALETTE_INIT_MEMBER(nbmj8688_state,mbmj8688_16bit)
{
int i;
int r, g, b;
@@ -96,7 +96,7 @@ PALETTE_INIT( mbmj8688_16bit )
g = (((i & 0x3800) >> 9) | ((i & 0x0018) >> 3)); // G 5bit
b = (((i & 0xc000) >> 11) | ((i & 0x00e0) >> 5)); // B 5bit
- palette_set_color_rgb(machine, i, pal6bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(machine(), i, pal6bit(r), pal5bit(g), pal5bit(b));
}
}
@@ -546,50 +546,44 @@ static void common_video_start(running_machine &machine)
state->m_mjsikaku_scrolly = 0; // reset because crystalg/crystal2 don't write to this register
}
-VIDEO_START( mbmj8688_8bit )
+VIDEO_START_MEMBER(nbmj8688_state,mbmj8688_8bit)
{
- nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
- state->m_mjsikaku_gfxmode = GFXTYPE_8BIT;
- common_video_start(machine);
+ m_mjsikaku_gfxmode = GFXTYPE_8BIT;
+ common_video_start(machine());
}
-VIDEO_START( mbmj8688_hybrid_12bit )
+VIDEO_START_MEMBER(nbmj8688_state,mbmj8688_hybrid_12bit)
{
- nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
- state->m_mjsikaku_gfxmode = GFXTYPE_HYBRID_12BIT;
- common_video_start(machine);
+ m_mjsikaku_gfxmode = GFXTYPE_HYBRID_12BIT;
+ common_video_start(machine());
}
-VIDEO_START( mbmj8688_pure_12bit )
+VIDEO_START_MEMBER(nbmj8688_state,mbmj8688_pure_12bit)
{
- nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
- state->m_mjsikaku_gfxmode = GFXTYPE_PURE_12BIT;
- common_video_start(machine);
+ m_mjsikaku_gfxmode = GFXTYPE_PURE_12BIT;
+ common_video_start(machine());
}
-VIDEO_START( mbmj8688_hybrid_16bit )
+VIDEO_START_MEMBER(nbmj8688_state,mbmj8688_hybrid_16bit)
{
- nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
- state->m_mjsikaku_gfxmode = GFXTYPE_HYBRID_16BIT;
- common_video_start(machine);
+ m_mjsikaku_gfxmode = GFXTYPE_HYBRID_16BIT;
+ common_video_start(machine());
}
-VIDEO_START( mbmj8688_pure_16bit )
+VIDEO_START_MEMBER(nbmj8688_state,mbmj8688_pure_16bit)
{
- nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
- state->m_mjsikaku_gfxmode = GFXTYPE_PURE_16BIT;
- common_video_start(machine);
+ m_mjsikaku_gfxmode = GFXTYPE_PURE_16BIT;
+ common_video_start(machine());
}
-VIDEO_START( mbmj8688_pure_16bit_LCD )
+VIDEO_START_MEMBER(nbmj8688_state,mbmj8688_pure_16bit_LCD)
{
- nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
- state->m_mjsikaku_gfxmode = GFXTYPE_PURE_16BIT;
+ m_mjsikaku_gfxmode = GFXTYPE_PURE_16BIT;
- state->m_HD61830B_ram[0] = auto_alloc_array(machine, UINT8, 0x10000);
- state->m_HD61830B_ram[1] = auto_alloc_array(machine, UINT8, 0x10000);
+ m_HD61830B_ram[0] = auto_alloc_array(machine(), UINT8, 0x10000);
+ m_HD61830B_ram[1] = auto_alloc_array(machine(), UINT8, 0x10000);
- common_video_start(machine);
+ common_video_start(machine());
}
diff --git a/src/mame/video/nbmj8891.c b/src/mame/video/nbmj8891.c
index 907813b7c47..2712109cedf 100644
--- a/src/mame/video/nbmj8891.c
+++ b/src/mame/video/nbmj8891.c
@@ -469,40 +469,38 @@ static void nbmj8891_gfxdraw(running_machine &machine)
******************************************************************************/
-VIDEO_START( nbmj8891_1layer )
+VIDEO_START_MEMBER(nbmj8891_state,nbmj8891_1layer)
{
- nbmj8891_state *state = machine.driver_data<nbmj8891_state>();
- UINT8 *CLUT = state->memregion("protection")->base();
+ UINT8 *CLUT = memregion("protection")->base();
int i;
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap0);
- state->m_videoram0 = auto_alloc_array(machine, UINT8, width * height);
- state->m_palette = auto_alloc_array(machine, UINT8, 0x200);
- state->m_clut = auto_alloc_array(machine, UINT8, 0x800);
- memset(state->m_videoram0, 0xff, (width * height * sizeof(char)));
- state->m_gfxdraw_mode = 0;
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap0);
+ m_videoram0 = auto_alloc_array(machine(), UINT8, width * height);
+ m_palette = auto_alloc_array(machine(), UINT8, 0x200);
+ m_clut = auto_alloc_array(machine(), UINT8, 0x800);
+ memset(m_videoram0, 0xff, (width * height * sizeof(char)));
+ m_gfxdraw_mode = 0;
if (nb1413m3_type == NB1413M3_TAIWANMB)
- for (i = 0; i < 0x0800; i++) state->m_clut[i] = CLUT[i];
+ for (i = 0; i < 0x0800; i++) m_clut[i] = CLUT[i];
}
-VIDEO_START( nbmj8891_2layer )
+void nbmj8891_state::video_start()
{
- nbmj8891_state *state = machine.driver_data<nbmj8891_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
-
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap0);
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap1);
- state->m_videoram0 = auto_alloc_array(machine, UINT8, width * height);
- state->m_videoram1 = auto_alloc_array(machine, UINT8, width * height);
- state->m_palette = auto_alloc_array(machine, UINT8, 0x200);
- state->m_clut = auto_alloc_array(machine, UINT8, 0x800);
- memset(state->m_videoram0, 0xff, (width * height * sizeof(UINT8)));
- memset(state->m_videoram1, 0xff, (width * height * sizeof(UINT8)));
- state->m_gfxdraw_mode = 1;
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
+
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap0);
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap1);
+ m_videoram0 = auto_alloc_array(machine(), UINT8, width * height);
+ m_videoram1 = auto_alloc_array(machine(), UINT8, width * height);
+ m_palette = auto_alloc_array(machine(), UINT8, 0x200);
+ m_clut = auto_alloc_array(machine(), UINT8, 0x800);
+ memset(m_videoram0, 0xff, (width * height * sizeof(UINT8)));
+ memset(m_videoram1, 0xff, (width * height * sizeof(UINT8)));
+ m_gfxdraw_mode = 1;
}
/******************************************************************************
diff --git a/src/mame/video/nbmj8900.c b/src/mame/video/nbmj8900.c
index 792cd992479..9eb15312349 100644
--- a/src/mame/video/nbmj8900.c
+++ b/src/mame/video/nbmj8900.c
@@ -364,22 +364,21 @@ static void nbmj8900_gfxdraw(running_machine &machine)
******************************************************************************/
-VIDEO_START( nbmj8900_2layer )
+void nbmj8900_state::video_start()
{
- nbmj8900_state *state = machine.driver_data<nbmj8900_state>();
- state->m_screen_width = machine.primary_screen->width();
- state->m_screen_height = machine.primary_screen->height();
-
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap0);
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap1);
- state->m_videoram0 = auto_alloc_array(machine, UINT8, state->m_screen_width * state->m_screen_height);
- state->m_videoram1 = auto_alloc_array(machine, UINT8, state->m_screen_width * state->m_screen_height);
- state->m_palette = auto_alloc_array(machine, UINT8, 0x200);
- state->m_clut = auto_alloc_array(machine, UINT8, 0x800);
- memset(state->m_videoram0, 0xff, (state->m_screen_width * state->m_screen_height * sizeof(UINT8)));
- memset(state->m_videoram1, 0xff, (state->m_screen_width * state->m_screen_height * sizeof(UINT8)));
-// machine.pens[0x07f] = 0xff; /* palette_transparent_pen */
- state->m_gfxdraw_mode = 1;
+ m_screen_width = machine().primary_screen->width();
+ m_screen_height = machine().primary_screen->height();
+
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap0);
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap1);
+ m_videoram0 = auto_alloc_array(machine(), UINT8, m_screen_width * m_screen_height);
+ m_videoram1 = auto_alloc_array(machine(), UINT8, m_screen_width * m_screen_height);
+ m_palette = auto_alloc_array(machine(), UINT8, 0x200);
+ m_clut = auto_alloc_array(machine(), UINT8, 0x800);
+ memset(m_videoram0, 0xff, (m_screen_width * m_screen_height * sizeof(UINT8)));
+ memset(m_videoram1, 0xff, (m_screen_width * m_screen_height * sizeof(UINT8)));
+// machine().pens[0x07f] = 0xff; /* palette_transparent_pen */
+ m_gfxdraw_mode = 1;
}
/******************************************************************************
diff --git a/src/mame/video/nbmj8991.c b/src/mame/video/nbmj8991.c
index 279aa95cfdf..8b9c7febfa8 100644
--- a/src/mame/video/nbmj8991.c
+++ b/src/mame/video/nbmj8991.c
@@ -287,16 +287,15 @@ static void nbmj8991_gfxdraw(running_machine &machine)
******************************************************************************/
-VIDEO_START( nbmj8991 )
+VIDEO_START_MEMBER(nbmj8991_state,nbmj8991)
{
- nbmj8991_state *state = machine.driver_data<nbmj8991_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap);
- state->m_videoram = auto_alloc_array(machine, UINT8, width * height);
- state->m_clut = auto_alloc_array(machine, UINT8, 0x800);
- memset(state->m_videoram, 0x00, (width * height * sizeof(UINT8)));
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap);
+ m_videoram = auto_alloc_array(machine(), UINT8, width * height);
+ m_clut = auto_alloc_array(machine(), UINT8, 0x800);
+ memset(m_videoram, 0x00, (width * height * sizeof(UINT8)));
}
SCREEN_UPDATE_IND16( nbmj8991_type1 )
diff --git a/src/mame/video/nbmj9195.c b/src/mame/video/nbmj9195.c
index e43f31ecb97..28b8472216d 100644
--- a/src/mame/video/nbmj9195.c
+++ b/src/mame/video/nbmj9195.c
@@ -384,57 +384,54 @@ WRITE8_MEMBER(nbmj9195_state::nbmj9195_clut_1_w){ nbmj9195_clut_w(&space, offset
******************************************************************************/
-VIDEO_START( nbmj9195_1layer )
+VIDEO_START_MEMBER(nbmj9195_state,nbmj9195_1layer)
{
- nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
-
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[0]);
- state->m_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_palette = auto_alloc_array(machine, UINT8, 0x200);
- state->m_clut[0] = auto_alloc_array(machine, UINT8, 0x1000);
- state->m_scanline[0] = state->m_scanline[1] = SCANLINE_MIN;
- state->m_nb19010_busyflag = 1;
- state->m_gfxdraw_mode = 0;
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
+
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap[0]);
+ m_videoram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_palette = auto_alloc_array(machine(), UINT8, 0x200);
+ m_clut[0] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_scanline[0] = m_scanline[1] = SCANLINE_MIN;
+ m_nb19010_busyflag = 1;
+ m_gfxdraw_mode = 0;
}
-VIDEO_START( nbmj9195_2layer )
+void nbmj9195_state::video_start()
{
- nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
-
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[0]);
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[1]);
- state->m_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_palette = auto_alloc_array(machine, UINT8, 0x200);
- state->m_clut[0] = auto_alloc_array(machine, UINT8, 0x1000);
- state->m_clut[1] = auto_alloc_array(machine, UINT8, 0x1000);
- state->m_scanline[0] = state->m_scanline[1] = SCANLINE_MIN;
- state->m_nb19010_busyflag = 1;
- state->m_gfxdraw_mode = 1;
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
+
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap[0]);
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap[1]);
+ m_videoram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_videoram[1] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_palette = auto_alloc_array(machine(), UINT8, 0x200);
+ m_clut[0] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_clut[1] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_scanline[0] = m_scanline[1] = SCANLINE_MIN;
+ m_nb19010_busyflag = 1;
+ m_gfxdraw_mode = 1;
}
-VIDEO_START( nbmj9195_nb22090 )
+VIDEO_START_MEMBER(nbmj9195_state,nbmj9195_nb22090)
{
- nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
-
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[0]);
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[1]);
- state->m_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_videoworkram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_videoworkram[1] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_nb22090_palette = auto_alloc_array(machine, UINT8, 0xc00);
- state->m_clut[0] = auto_alloc_array(machine, UINT8, 0x1000);
- state->m_clut[1] = auto_alloc_array(machine, UINT8, 0x1000);
- state->m_scanline[0] = state->m_scanline[1] = SCANLINE_MIN;
- state->m_nb19010_busyflag = 1;
- state->m_gfxdraw_mode = 2;
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
+
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap[0]);
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap[1]);
+ m_videoram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_videoram[1] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_videoworkram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_videoworkram[1] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_nb22090_palette = auto_alloc_array(machine(), UINT8, 0xc00);
+ m_clut[0] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_clut[1] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_scanline[0] = m_scanline[1] = SCANLINE_MIN;
+ m_nb19010_busyflag = 1;
+ m_gfxdraw_mode = 2;
}
/******************************************************************************
diff --git a/src/mame/video/nemesis.c b/src/mame/video/nemesis.c
index 94c59186346..34f7da7511e 100644
--- a/src/mame/video/nemesis.c
+++ b/src/mame/video/nemesis.c
@@ -291,34 +291,33 @@ static void nemesis_postload(running_machine &machine)
/* claim a palette dirty array */
-VIDEO_START( nemesis )
+void nemesis_state::video_start()
{
- nemesis_state *state = machine.driver_data<nemesis_state>();
- state->m_spriteram_words = state->m_spriteram.bytes() / 2;
+ m_spriteram_words = m_spriteram.bytes() / 2;
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nemesis_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_foreground = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nemesis_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nemesis_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_foreground = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nemesis_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_background->set_transparent_pen(0);
- state->m_foreground->set_transparent_pen(0);
- state->m_background->set_scroll_rows(256);
- state->m_foreground->set_scroll_rows(256);
+ m_background->set_transparent_pen(0);
+ m_foreground->set_transparent_pen(0);
+ m_background->set_scroll_rows(256);
+ m_foreground->set_scroll_rows(256);
- memset(state->m_charram, 0, state->m_charram.bytes());
- memset(state->m_blank_tile, 0, ARRAY_LENGTH(state->m_blank_tile));
+ memset(m_charram, 0, m_charram.bytes());
+ memset(m_blank_tile, 0, ARRAY_LENGTH(m_blank_tile));
- machine.gfx[0]->set_source((UINT8 *)state->m_charram.target());
- machine.gfx[1]->set_source((UINT8 *)state->m_charram.target());
- machine.gfx[2]->set_source((UINT8 *)state->m_charram.target());
- machine.gfx[3]->set_source((UINT8 *)state->m_charram.target());
- machine.gfx[4]->set_source((UINT8 *)state->m_charram.target());
- machine.gfx[5]->set_source((UINT8 *)state->m_charram.target());
- machine.gfx[6]->set_source((UINT8 *)state->m_charram.target());
- machine.gfx[7]->set_source((UINT8 *)state->m_charram.target());
+ machine().gfx[0]->set_source((UINT8 *)m_charram.target());
+ machine().gfx[1]->set_source((UINT8 *)m_charram.target());
+ machine().gfx[2]->set_source((UINT8 *)m_charram.target());
+ machine().gfx[3]->set_source((UINT8 *)m_charram.target());
+ machine().gfx[4]->set_source((UINT8 *)m_charram.target());
+ machine().gfx[5]->set_source((UINT8 *)m_charram.target());
+ machine().gfx[6]->set_source((UINT8 *)m_charram.target());
+ machine().gfx[7]->set_source((UINT8 *)m_charram.target());
/* Set up save state */
- machine.save().register_postload(save_prepost_delegate(FUNC(nemesis_postload), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(nemesis_postload), &machine()));
}
diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c
index ecd6344b2bf..8a49ec95adf 100644
--- a/src/mame/video/neogeo.c
+++ b/src/mame/video/neogeo.c
@@ -845,54 +845,53 @@ WRITE16_MEMBER(neogeo_state::neogeo_video_register_w)
*
*************************************/
-VIDEO_START( neogeo )
+void neogeo_state::video_start()
{
- neogeo_state *state = machine.driver_data<neogeo_state>();
/* allocate memory not directly mapped */
- state->m_palettes[0] = auto_alloc_array(machine, UINT16, NUM_PENS);
- state->m_palettes[1] = auto_alloc_array(machine, UINT16, NUM_PENS);
- state->m_pens = auto_alloc_array(machine, pen_t, NUM_PENS);
- state->m_videoram = auto_alloc_array(machine, UINT16, 0x20000/2);
+ m_palettes[0] = auto_alloc_array(machine(), UINT16, NUM_PENS);
+ m_palettes[1] = auto_alloc_array(machine(), UINT16, NUM_PENS);
+ m_pens = auto_alloc_array(machine(), pen_t, NUM_PENS);
+ m_videoram = auto_alloc_array(machine(), UINT16, 0x20000/2);
/* clear allocated memory */
- memset(state->m_palettes[0], 0x00, NUM_PENS * sizeof(UINT16));
- memset(state->m_palettes[1], 0x00, NUM_PENS * sizeof(UINT16));
- memset(state->m_pens, 0x00, NUM_PENS * sizeof(pen_t));
- memset(state->m_videoram, 0x00, 0x20000);
+ memset(m_palettes[0], 0x00, NUM_PENS * sizeof(UINT16));
+ memset(m_palettes[1], 0x00, NUM_PENS * sizeof(UINT16));
+ memset(m_pens, 0x00, NUM_PENS * sizeof(pen_t));
+ memset(m_videoram, 0x00, 0x20000);
- compute_rgb_weights(machine);
- create_sprite_line_timer(machine);
- create_auto_animation_timer(machine);
- optimize_sprite_data(machine);
+ compute_rgb_weights(machine());
+ create_sprite_line_timer(machine());
+ create_auto_animation_timer(machine());
+ optimize_sprite_data(machine());
/* initialize values that are not modified on a reset */
- state->m_videoram_read_buffer = 0;
- state->m_videoram_offset = 0;
- state->m_videoram_modulo = 0;
- state->m_auto_animation_speed = 0;
- state->m_auto_animation_disabled = 0;
- state->m_auto_animation_counter = 0;
- state->m_auto_animation_frame_counter = 0;
+ m_videoram_read_buffer = 0;
+ m_videoram_offset = 0;
+ m_videoram_modulo = 0;
+ m_auto_animation_speed = 0;
+ m_auto_animation_disabled = 0;
+ m_auto_animation_counter = 0;
+ m_auto_animation_frame_counter = 0;
/* register for state saving */
- state->save_pointer(NAME(state->m_palettes[0]), NUM_PENS);
- state->save_pointer(NAME(state->m_palettes[1]), NUM_PENS);
- state->save_pointer(NAME(state->m_videoram), 0x20000/2);
- state->save_item(NAME(state->m_videoram_read_buffer));
- state->save_item(NAME(state->m_videoram_modulo));
- state->save_item(NAME(state->m_videoram_offset));
- state->save_item(NAME(state->m_fixed_layer_source));
- state->save_item(NAME(state->m_screen_dark));
- state->save_item(NAME(state->m_palette_bank));
- state->save_item(NAME(state->m_auto_animation_speed));
- state->save_item(NAME(state->m_auto_animation_disabled));
- state->save_item(NAME(state->m_auto_animation_counter));
- state->save_item(NAME(state->m_auto_animation_frame_counter));
+ save_pointer(NAME(m_palettes[0]), NUM_PENS);
+ save_pointer(NAME(m_palettes[1]), NUM_PENS);
+ save_pointer(NAME(m_videoram), 0x20000/2);
+ save_item(NAME(m_videoram_read_buffer));
+ save_item(NAME(m_videoram_modulo));
+ save_item(NAME(m_videoram_offset));
+ save_item(NAME(m_fixed_layer_source));
+ save_item(NAME(m_screen_dark));
+ save_item(NAME(m_palette_bank));
+ save_item(NAME(m_auto_animation_speed));
+ save_item(NAME(m_auto_animation_disabled));
+ save_item(NAME(m_auto_animation_counter));
+ save_item(NAME(m_auto_animation_frame_counter));
- machine.save().register_postload(save_prepost_delegate(FUNC(regenerate_pens), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(regenerate_pens), &machine()));
- state->m_region_zoomy = state->memregion("zoomy")->base();
+ m_region_zoomy = memregion("zoomy")->base();
}
@@ -903,11 +902,11 @@ VIDEO_START( neogeo )
*
*************************************/
-VIDEO_RESET( neogeo )
+void neogeo_state::video_reset()
{
- start_sprite_line_timer(machine);
- start_auto_animation_timer(machine);
- optimize_sprite_data(machine);
+ start_sprite_line_timer(machine());
+ start_auto_animation_timer(machine());
+ optimize_sprite_data(machine());
}
diff --git a/src/mame/video/news.c b/src/mame/video/news.c
index fef0ea99305..5305556723a 100644
--- a/src/mame/video/news.c
+++ b/src/mame/video/news.c
@@ -42,14 +42,13 @@ TILE_GET_INFO_MEMBER(news_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( news )
+void news_state::video_start()
{
- news_state *state = machine.driver_data<news_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(news_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(news_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(news_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(news_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/ninjakd2.c b/src/mame/video/ninjakd2.c
index ad944d07094..44b434315c3 100644
--- a/src/mame/video/ninjakd2.c
+++ b/src/mame/video/ninjakd2.c
@@ -124,87 +124,82 @@ static int stencil_arkarea( UINT16 pal );
static int stencil_robokid( UINT16 pal );
static int stencil_omegaf( UINT16 pal );
-VIDEO_START( ninjakd2 )
+void ninjakd2_state::video_start()
{
- ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
- videoram_alloc(machine, 0);
+ videoram_alloc(machine(), 0);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::ninjakd2_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::ninjakd2_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(TRANSPARENTCODE);
+ m_fg_tilemap->set_transparent_pen(TRANSPARENTCODE);
- state->m_robokid_sprites = 0;
- state->m_stencil_compare_function = stencil_ninjakd2;
+ m_robokid_sprites = 0;
+ m_stencil_compare_function = stencil_ninjakd2;
}
-VIDEO_START( mnight )
+VIDEO_START_MEMBER(ninjakd2_state,mnight)
{
- ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
- videoram_alloc(machine, 0);
+ videoram_alloc(machine(), 0);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::mnight_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::mnight_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(TRANSPARENTCODE);
+ m_fg_tilemap->set_transparent_pen(TRANSPARENTCODE);
- state->m_robokid_sprites = 0;
- state->m_stencil_compare_function = stencil_mnight;
+ m_robokid_sprites = 0;
+ m_stencil_compare_function = stencil_mnight;
}
-VIDEO_START( arkarea )
+VIDEO_START_MEMBER(ninjakd2_state,arkarea)
{
- ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
- videoram_alloc(machine, 0);
+ videoram_alloc(machine(), 0);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::mnight_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::mnight_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(TRANSPARENTCODE);
+ m_fg_tilemap->set_transparent_pen(TRANSPARENTCODE);
- state->m_robokid_sprites = 0;
- state->m_stencil_compare_function = stencil_arkarea;
+ m_robokid_sprites = 0;
+ m_stencil_compare_function = stencil_arkarea;
}
-VIDEO_START( robokid )
+VIDEO_START_MEMBER(ninjakd2_state,robokid)
{
- ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
- state->m_bank_mask = 1;
+ m_bank_mask = 1;
- videoram_alloc(machine, 0x0800);
+ videoram_alloc(machine(), 0x0800);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg0_tile_info),state), tilemap_mapper_delegate(FUNC(ninjakd2_state::robokid_bg_scan),state), 16, 16, 32, 32);
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg1_tile_info),state), tilemap_mapper_delegate(FUNC(ninjakd2_state::robokid_bg_scan),state), 16, 16, 32, 32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(ninjakd2_state::robokid_bg_scan),state), 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg0_tile_info),this), tilemap_mapper_delegate(FUNC(ninjakd2_state::robokid_bg_scan),this), 16, 16, 32, 32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg1_tile_info),this), tilemap_mapper_delegate(FUNC(ninjakd2_state::robokid_bg_scan),this), 16, 16, 32, 32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(ninjakd2_state::robokid_bg_scan),this), 16, 16, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(TRANSPARENTCODE);
- state->m_bg1_tilemap->set_transparent_pen(TRANSPARENTCODE);
- state->m_bg2_tilemap->set_transparent_pen(TRANSPARENTCODE);
+ m_fg_tilemap->set_transparent_pen(TRANSPARENTCODE);
+ m_bg1_tilemap->set_transparent_pen(TRANSPARENTCODE);
+ m_bg2_tilemap->set_transparent_pen(TRANSPARENTCODE);
- state->m_robokid_sprites = 1;
- state->m_stencil_compare_function = stencil_robokid;
+ m_robokid_sprites = 1;
+ m_stencil_compare_function = stencil_robokid;
}
-VIDEO_START( omegaf )
+VIDEO_START_MEMBER(ninjakd2_state,omegaf)
{
- ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
- state->m_bank_mask = 7;
+ m_bank_mask = 7;
- videoram_alloc(machine, 0x2000);
+ videoram_alloc(machine(), 0x2000);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg0_tile_info),state), tilemap_mapper_delegate(FUNC(ninjakd2_state::omegaf_bg_scan),state), 16, 16, 128, 32);
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg1_tile_info),state), tilemap_mapper_delegate(FUNC(ninjakd2_state::omegaf_bg_scan),state), 16, 16, 128, 32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(ninjakd2_state::omegaf_bg_scan),state), 16, 16, 128, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg0_tile_info),this), tilemap_mapper_delegate(FUNC(ninjakd2_state::omegaf_bg_scan),this), 16, 16, 128, 32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg1_tile_info),this), tilemap_mapper_delegate(FUNC(ninjakd2_state::omegaf_bg_scan),this), 16, 16, 128, 32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ninjakd2_state::robokid_get_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(ninjakd2_state::omegaf_bg_scan),this), 16, 16, 128, 32);
- state->m_fg_tilemap->set_transparent_pen(TRANSPARENTCODE);
- state->m_bg0_tilemap->set_transparent_pen(TRANSPARENTCODE);
- state->m_bg1_tilemap->set_transparent_pen(TRANSPARENTCODE);
- state->m_bg2_tilemap->set_transparent_pen(TRANSPARENTCODE);
+ m_fg_tilemap->set_transparent_pen(TRANSPARENTCODE);
+ m_bg0_tilemap->set_transparent_pen(TRANSPARENTCODE);
+ m_bg1_tilemap->set_transparent_pen(TRANSPARENTCODE);
+ m_bg2_tilemap->set_transparent_pen(TRANSPARENTCODE);
- state->m_robokid_sprites = 1;
- state->m_stencil_compare_function = stencil_omegaf;
+ m_robokid_sprites = 1;
+ m_stencil_compare_function = stencil_omegaf;
}
diff --git a/src/mame/video/ninjaw.c b/src/mame/video/ninjaw.c
index 1095717d769..8d62af1b405 100644
--- a/src/mame/video/ninjaw.c
+++ b/src/mame/video/ninjaw.c
@@ -4,12 +4,11 @@
/**********************************************************/
-VIDEO_START( ninjaw )
+void ninjaw_state::video_start()
{
- ninjaw_state *state = machine.driver_data<ninjaw_state>();
/* Ensure palette from correct TC0110PCR used for each screen */
- tc0100scn_set_colbanks(state->m_tc0100scn_1, 0x0, 0x100, 0x200);
+ tc0100scn_set_colbanks(m_tc0100scn_1, 0x0, 0x100, 0x200);
}
/************************************************************
diff --git a/src/mame/video/nitedrvr.c b/src/mame/video/nitedrvr.c
index 5ca23afe7a0..bec96cc9d2a 100644
--- a/src/mame/video/nitedrvr.c
+++ b/src/mame/video/nitedrvr.c
@@ -32,10 +32,9 @@ TILE_GET_INFO_MEMBER(nitedrvr_state::get_bg_tile_info)
-VIDEO_START( nitedrvr )
+void nitedrvr_state::video_start()
{
- nitedrvr_state *state = machine.driver_data<nitedrvr_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nitedrvr_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nitedrvr_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_box( bitmap_ind16 &bitmap, int bx, int by, int ex, int ey )
diff --git a/src/mame/video/niyanpai.c b/src/mame/video/niyanpai.c
index 8d150aafbf0..44d50a79a64 100644
--- a/src/mame/video/niyanpai.c
+++ b/src/mame/video/niyanpai.c
@@ -357,26 +357,25 @@ WRITE16_MEMBER(niyanpai_state::niyanpai_clutsel_2_w){ niyanpai_clutsel_w(machine
******************************************************************************/
-VIDEO_START( niyanpai )
+void niyanpai_state::video_start()
{
- niyanpai_state *state = machine.driver_data<niyanpai_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
-
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[0]);
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[1]);
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[2]);
- state->m_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_videoram[2] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_videoworkram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_videoworkram[1] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_videoworkram[2] = auto_alloc_array_clear(machine, UINT16, width * height);
- state->m_palette = auto_alloc_array(machine, UINT16, 0x480);
- state->m_clut[0] = auto_alloc_array(machine, UINT8, 0x1000);
- state->m_clut[1] = auto_alloc_array(machine, UINT8, 0x1000);
- state->m_clut[2] = auto_alloc_array(machine, UINT8, 0x1000);
- state->m_nb19010_busyflag = 1;
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
+
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap[0]);
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap[1]);
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap[2]);
+ m_videoram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_videoram[1] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_videoram[2] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_videoworkram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_videoworkram[1] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_videoworkram[2] = auto_alloc_array_clear(machine(), UINT16, width * height);
+ m_palette = auto_alloc_array(machine(), UINT16, 0x480);
+ m_clut[0] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_clut[1] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_clut[2] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_nb19010_busyflag = 1;
}
/******************************************************************************
diff --git a/src/mame/video/nmk16.c b/src/mame/video/nmk16.c
index 193ce512bce..8841b5caee5 100644
--- a/src/mame/video/nmk16.c
+++ b/src/mame/video/nmk16.c
@@ -120,92 +120,85 @@ static void nmk16_video_init(running_machine &machine)
}
-VIDEO_START( bioship )
+VIDEO_START_MEMBER(nmk16_state,bioship)
{
- nmk16_state *state = machine.driver_data<nmk16_state>();
- state->m_bg_tilemap0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),state),TILEMAP_SCAN_COLS,8,8,32,32);
+ m_bg_tilemap0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),this),TILEMAP_SCAN_COLS,8,8,32,32);
- state->m_bg_tilemap0->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_bg_tilemap0->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
- nmk16_video_init(machine);
- state->m_background_bitmap = auto_bitmap_ind16_alloc(machine,8192,512);
- state->m_bioship_background_bank=0;
- state->m_redraw_bitmap = 1;
+ nmk16_video_init(machine());
+ m_background_bitmap = auto_bitmap_ind16_alloc(machine(),8192,512);
+ m_bioship_background_bank=0;
+ m_redraw_bitmap = 1;
}
-VIDEO_START( strahl )
+VIDEO_START_MEMBER(nmk16_state,strahl)
{
- nmk16_state *state = machine.driver_data<nmk16_state>();
- state->m_bg_tilemap0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::strahl_get_fg_tile_info),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),state),TILEMAP_SCAN_COLS,8,8,32,32);
+ m_bg_tilemap0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::strahl_get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),this),TILEMAP_SCAN_COLS,8,8,32,32);
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
- nmk16_video_init(machine);
+ nmk16_video_init(machine());
}
-VIDEO_START( macross )
+VIDEO_START_MEMBER(nmk16_state,macross)
{
- nmk16_state *state = machine.driver_data<nmk16_state>();
- state->m_bg_tilemap0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),state),TILEMAP_SCAN_COLS,8,8,32,32);
+ m_bg_tilemap0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),this),TILEMAP_SCAN_COLS,8,8,32,32);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
- nmk16_video_init(machine);
+ nmk16_video_init(machine());
}
-VIDEO_START( gunnail )
+VIDEO_START_MEMBER(nmk16_state,gunnail)
{
- nmk16_state *state = machine.driver_data<nmk16_state>();
- state->m_bg_tilemap0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),state),TILEMAP_SCAN_COLS,8,8,64,32);
+ m_bg_tilemap0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,32);
- state->m_tx_tilemap->set_transparent_pen(15);
- state->m_bg_tilemap0->set_scroll_rows(512);
+ m_tx_tilemap->set_transparent_pen(15);
+ m_bg_tilemap0->set_scroll_rows(512);
- nmk16_video_init(machine);
- state->m_videoshift = 64; /* 384x224 screen, leftmost 64 pixels have to be retrieved */
+ nmk16_video_init(machine());
+ m_videoshift = 64; /* 384x224 screen, leftmost 64 pixels have to be retrieved */
/* from the other side of the tilemap (!) */
- state->m_simple_scroll = 0;
+ m_simple_scroll = 0;
}
-VIDEO_START( macross2 )
+VIDEO_START_MEMBER(nmk16_state,macross2)
{
- nmk16_state *state = machine.driver_data<nmk16_state>();
- state->m_bg_tilemap0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_bg_tilemap1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg1_tile_info),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_bg_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_bg_tilemap3 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg3_tile_info),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
+ m_bg_tilemap0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
+ m_bg_tilemap1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg1_tile_info),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
+ m_bg_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
+ m_bg_tilemap3 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg3_tile_info),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),state),TILEMAP_SCAN_COLS,8,8,64,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,32);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
- nmk16_video_init(machine);
- state->m_videoshift = 64; /* 384x224 screen, leftmost 64 pixels have to be retrieved */
+ nmk16_video_init(machine());
+ m_videoshift = 64; /* 384x224 screen, leftmost 64 pixels have to be retrieved */
/* from the other side of the tilemap (!) */
}
-VIDEO_START( raphero )
+VIDEO_START_MEMBER(nmk16_state,raphero)
{
- nmk16_state *state = machine.driver_data<nmk16_state>();
- VIDEO_START_CALL( macross2 );
- state->m_simple_scroll = 0;
+ VIDEO_START_CALL_MEMBER( macross2 );
+ m_simple_scroll = 0;
}
-VIDEO_START( bjtwin )
+VIDEO_START_MEMBER(nmk16_state,bjtwin)
{
- nmk16_state *state = machine.driver_data<nmk16_state>();
- state->m_bg_tilemap0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::bjtwin_get_bg_tile_info),state),TILEMAP_SCAN_COLS,8,8,64,32);
+ m_bg_tilemap0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::bjtwin_get_bg_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,32);
- nmk16_video_init(machine);
- state->m_videoshift = 64; /* 384x224 screen, leftmost 64 pixels have to be retrieved */
+ nmk16_video_init(machine());
+ m_videoshift = 64; /* 384x224 screen, leftmost 64 pixels have to be retrieved */
/* from the other side of the tilemap (!) */
}
@@ -888,59 +881,56 @@ SCREEN_VBLANK( strahl )
***************************************************************************/
-VIDEO_START( afega )
+VIDEO_START_MEMBER(nmk16_state,afega)
{
- nmk16_state *state = machine.driver_data<nmk16_state>();
- state->m_spriteram_old = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
- state->m_spriteram_old2 = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
+ m_spriteram_old = auto_alloc_array_clear(machine(), UINT16, 0x1000/2);
+ m_spriteram_old2 = auto_alloc_array_clear(machine(), UINT16, 0x1000/2);
- state->m_bg_tilemap0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),
+ m_bg_tilemap0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_bg0_tile_info),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),
16,16,
TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),state), TILEMAP_SCAN_COLS,
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8,8,
32,32);
- state->m_tx_tilemap->set_transparent_pen(0xf);
+ m_tx_tilemap->set_transparent_pen(0xf);
}
-VIDEO_START( grdnstrm )
+VIDEO_START_MEMBER(nmk16_state,grdnstrm)
{
- nmk16_state *state = machine.driver_data<nmk16_state>();
- state->m_spriteram_old = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
- state->m_spriteram_old2 = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
+ m_spriteram_old = auto_alloc_array_clear(machine(), UINT16, 0x1000/2);
+ m_spriteram_old2 = auto_alloc_array_clear(machine(), UINT16, 0x1000/2);
- state->m_bg_tilemap0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::get_tile_info_0_8bit),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),
+ m_bg_tilemap0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::get_tile_info_0_8bit),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),
16,16,
TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),state), TILEMAP_SCAN_COLS,
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8,8,
32,32);
- state->m_tx_tilemap->set_transparent_pen(0xf);
+ m_tx_tilemap->set_transparent_pen(0xf);
}
-VIDEO_START( firehawk )
+VIDEO_START_MEMBER(nmk16_state,firehawk)
{
- nmk16_state *state = machine.driver_data<nmk16_state>();
- state->m_spriteram_old = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
- state->m_spriteram_old2 = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
+ m_spriteram_old = auto_alloc_array_clear(machine(), UINT16, 0x1000/2);
+ m_spriteram_old2 = auto_alloc_array_clear(machine(), UINT16, 0x1000/2);
- state->m_bg_tilemap0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::get_tile_info_0_8bit),state), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),state),
+ m_bg_tilemap0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::get_tile_info_0_8bit),this), tilemap_mapper_delegate(FUNC(nmk16_state::afega_tilemap_scan_pages),this),
16,16,
TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),state), TILEMAP_SCAN_COLS,
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nmk16_state::macross_get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8,8,
32,32);
- state->m_tx_tilemap->set_transparent_pen(0xf);
+ m_tx_tilemap->set_transparent_pen(0xf);
}
diff --git a/src/mame/video/nova2001.c b/src/mame/video/nova2001.c
index 8fa8aa0917a..af5c1576a48 100644
--- a/src/mame/video/nova2001.c
+++ b/src/mame/video/nova2001.c
@@ -8,9 +8,9 @@
*
*************************************/
-PALETTE_INIT( nova2001 )
+PALETTE_INIT_MEMBER(nova2001_state,nova2001)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* Color #1 is used for palette animation. */
@@ -44,7 +44,7 @@ PALETTE_INIT( nova2001 )
/* blue component */
b = (((color_prom[entry] >> 4) & 0x0c) | intensity) * 0x11;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -152,38 +152,34 @@ TILE_GET_INFO_MEMBER(nova2001_state::raiders5_get_fg_tile_info)
*
*************************************/
-VIDEO_START( nova2001 )
+VIDEO_START_MEMBER(nova2001_state,nova2001)
{
- nova2001_state *state = machine.driver_data<nova2001_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::nova2001_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::nova2001_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(0, -7);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::nova2001_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::nova2001_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scrolldx(0, -7);
}
-VIDEO_START( pkunwar )
+VIDEO_START_MEMBER(nova2001_state,pkunwar)
{
- nova2001_state *state = machine.driver_data<nova2001_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::pkunwar_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::pkunwar_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_transparent_pen(0);
}
-VIDEO_START( ninjakun )
+VIDEO_START_MEMBER(nova2001_state,ninjakun)
{
- nova2001_state *state = machine.driver_data<nova2001_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::ninjakun_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::ninjakun_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(7, 0);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::ninjakun_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::ninjakun_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scrolldx(7, 0);
}
-VIDEO_START( raiders5 )
+VIDEO_START_MEMBER(nova2001_state,raiders5)
{
- nova2001_state *state = machine.driver_data<nova2001_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::raiders5_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::raiders5_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(7, 0);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::raiders5_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nova2001_state::raiders5_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scrolldx(7, 0);
}
diff --git a/src/mame/video/nycaptor.c b/src/mame/video/nycaptor.c
index 7588941a16d..e4f02d4893b 100644
--- a/src/mame/video/nycaptor.c
+++ b/src/mame/video/nycaptor.c
@@ -71,23 +71,22 @@ TILE_GET_INFO_MEMBER(nycaptor_state::get_tile_info)
}
-VIDEO_START( nycaptor )
+void nycaptor_state::video_start()
{
- nycaptor_state *state = machine.driver_data<nycaptor_state>();
- state->m_spriteram = auto_alloc_array(machine, UINT8, 160);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(nycaptor_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32 );
+ m_spriteram = auto_alloc_array(machine(), UINT8, 160);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(nycaptor_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32 );
- state->m_bg_tilemap->set_transmask(0, 0xf800, 0x7ff); //split 0
- state->m_bg_tilemap->set_transmask(1, 0xfe00, 0x01ff);//split 1
- state->m_bg_tilemap->set_transmask(2, 0xfffc, 0x0003);//split 2
- state->m_bg_tilemap->set_transmask(3, 0xfff0, 0x000f);//split 3
+ m_bg_tilemap->set_transmask(0, 0xf800, 0x7ff); //split 0
+ m_bg_tilemap->set_transmask(1, 0xfe00, 0x01ff);//split 1
+ m_bg_tilemap->set_transmask(2, 0xfffc, 0x0003);//split 2
+ m_bg_tilemap->set_transmask(3, 0xfff0, 0x000f);//split 3
- state->m_generic_paletteram_8.allocate(0x200);
- state->m_generic_paletteram2_8.allocate(0x200);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_generic_paletteram_8.allocate(0x200);
+ m_generic_paletteram2_8.allocate(0x200);
+ m_bg_tilemap->set_scroll_cols(32);
- state->save_pointer(NAME(state->m_spriteram), 160);
+ save_pointer(NAME(m_spriteram), 160);
}
WRITE8_MEMBER(nycaptor_state::nycaptor_videoram_w)
diff --git a/src/mame/video/offtwall.c b/src/mame/video/offtwall.c
index 29fbf6897b4..054dc352867 100644
--- a/src/mame/video/offtwall.c
+++ b/src/mame/video/offtwall.c
@@ -33,7 +33,7 @@ TILE_GET_INFO_MEMBER(offtwall_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( offtwall )
+VIDEO_START_MEMBER(offtwall_state,offtwall)
{
static const atarimo_desc modesc =
{
@@ -71,13 +71,12 @@ VIDEO_START( offtwall )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- offtwall_state *state = machine.driver_data<offtwall_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(offtwall_state::get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(offtwall_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
}
diff --git a/src/mame/video/ohmygod.c b/src/mame/video/ohmygod.c
index 14d52271fd4..b7ccaefdb40 100644
--- a/src/mame/video/ohmygod.c
+++ b/src/mame/video/ohmygod.c
@@ -26,10 +26,9 @@ TILE_GET_INFO_MEMBER(ohmygod_state::get_tile_info)
***************************************************************************/
-VIDEO_START( ohmygod )
+void ohmygod_state::video_start()
{
- ohmygod_state *state = machine.driver_data<ohmygod_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ohmygod_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ohmygod_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
}
diff --git a/src/mame/video/ojankohs.c b/src/mame/video/ojankohs.c
index 7b7008a6659..2a5d1bb0f3d 100644
--- a/src/mame/video/ojankohs.c
+++ b/src/mame/video/ojankohs.c
@@ -17,13 +17,13 @@
******************************************************************************/
-PALETTE_INIT( ojankoy )
+PALETTE_INIT_MEMBER(ojankohs_state,ojankoy)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
int bit0, bit1, bit2, bit3, bit4, r, g, b;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
bit0 = BIT(color_prom[0], 2);
bit1 = BIT(color_prom[0], 3);
@@ -31,20 +31,20 @@ PALETTE_INIT( ojankoy )
bit3 = BIT(color_prom[0], 5);
bit4 = BIT(color_prom[0], 6);
r = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4;
- bit0 = BIT(color_prom[machine.total_colors()], 5);
- bit1 = BIT(color_prom[machine.total_colors()], 6);
- bit2 = BIT(color_prom[machine.total_colors()], 7);
+ bit0 = BIT(color_prom[machine().total_colors()], 5);
+ bit1 = BIT(color_prom[machine().total_colors()], 6);
+ bit2 = BIT(color_prom[machine().total_colors()], 7);
bit3 = BIT(color_prom[0], 0);
bit4 = BIT(color_prom[0], 1);
g = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4;
- bit0 = BIT(color_prom[machine.total_colors()], 0);
- bit1 = BIT(color_prom[machine.total_colors()], 1);
- bit2 = BIT(color_prom[machine.total_colors()], 2);
- bit3 = BIT(color_prom[machine.total_colors()], 3);
- bit4 = BIT(color_prom[machine.total_colors()], 4);
+ bit0 = BIT(color_prom[machine().total_colors()], 0);
+ bit1 = BIT(color_prom[machine().total_colors()], 1);
+ bit2 = BIT(color_prom[machine().total_colors()], 2);
+ bit3 = BIT(color_prom[machine().total_colors()], 3);
+ bit4 = BIT(color_prom[machine().total_colors()], 4);
b = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
color_prom++;
}
}
@@ -257,34 +257,31 @@ WRITE8_MEMBER(ojankohs_state::ojankoc_videoram_w)
******************************************************************************/
-VIDEO_START( ojankohs )
+VIDEO_START_MEMBER(ojankohs_state,ojankohs)
{
- ojankohs_state *state = machine.driver_data<ojankohs_state>();
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ojankohs_state::ojankohs_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
-// state->m_videoram = auto_alloc_array(machine, UINT8, 0x1000);
-// state->m_colorram = auto_alloc_array(machine, UINT8, 0x1000);
-// state->m_paletteram = auto_alloc_array(machine, UINT8, 0x800);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ojankohs_state::ojankohs_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
+// m_videoram = auto_alloc_array(machine(), UINT8, 0x1000);
+// m_colorram = auto_alloc_array(machine(), UINT8, 0x1000);
+// m_paletteram = auto_alloc_array(machine(), UINT8, 0x800);
}
-VIDEO_START( ojankoy )
+VIDEO_START_MEMBER(ojankohs_state,ojankoy)
{
- ojankohs_state *state = machine.driver_data<ojankohs_state>();
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ojankohs_state::ojankoy_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
-// state->m_videoram = auto_alloc_array(machine, UINT8, 0x2000);
-// state->m_colorram = auto_alloc_array(machine, UINT8, 0x1000);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ojankohs_state::ojankoy_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
+// m_videoram = auto_alloc_array(machine(), UINT8, 0x2000);
+// m_colorram = auto_alloc_array(machine(), UINT8, 0x1000);
}
-VIDEO_START( ojankoc )
+VIDEO_START_MEMBER(ojankohs_state,ojankoc)
{
- ojankohs_state *state = machine.driver_data<ojankohs_state>();
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap);
- state->m_videoram.allocate(0x8000);
- state->m_paletteram.allocate(0x20);
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap);
+ m_videoram.allocate(0x8000);
+ m_paletteram.allocate(0x20);
- state->save_item(NAME(state->m_tmpbitmap));
+ save_item(NAME(m_tmpbitmap));
}
diff --git a/src/mame/video/oneshot.c b/src/mame/video/oneshot.c
index 2fed7650108..fd2dea76aa4 100644
--- a/src/mame/video/oneshot.c
+++ b/src/mame/video/oneshot.c
@@ -47,17 +47,16 @@ WRITE16_MEMBER(oneshot_state::oneshot_fg_videoram_w)
m_fg_tilemap->mark_tile_dirty(offset / 2);
}
-VIDEO_START( oneshot )
+void oneshot_state::video_start()
{
- oneshot_state *state = machine.driver_data<oneshot_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(oneshot_state::get_oneshot_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_mid_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(oneshot_state::get_oneshot_mid_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(oneshot_state::get_oneshot_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(oneshot_state::get_oneshot_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_mid_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(oneshot_state::get_oneshot_mid_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(oneshot_state::get_oneshot_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_mid_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_mid_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
static void draw_crosshairs( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/orbit.c b/src/mame/video/orbit.c
index 064048d7548..bf0dc8252b4 100644
--- a/src/mame/video/orbit.c
+++ b/src/mame/video/orbit.c
@@ -28,10 +28,9 @@ TILE_GET_INFO_MEMBER(orbit_state::get_tile_info)
}
-VIDEO_START( orbit )
+void orbit_state::video_start()
{
- orbit_state *state = machine.driver_data<orbit_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(orbit_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 30);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(orbit_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 30);
}
diff --git a/src/mame/video/othldrby.c b/src/mame/video/othldrby.c
index d34a97a13c5..d0a9b887d52 100644
--- a/src/mame/video/othldrby.c
+++ b/src/mame/video/othldrby.c
@@ -51,24 +51,23 @@ TILE_GET_INFO_MEMBER(othldrby_state::get_tile_info2)
***************************************************************************/
-VIDEO_START( othldrby )
+void othldrby_state::video_start()
{
- othldrby_state *state = machine.driver_data<othldrby_state>();
- state->m_bg_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(othldrby_state::get_tile_info0),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_bg_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(othldrby_state::get_tile_info1),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_bg_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(othldrby_state::get_tile_info2),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(othldrby_state::get_tile_info0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(othldrby_state::get_tile_info1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(othldrby_state::get_tile_info2),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_vram = auto_alloc_array(machine, UINT16, VIDEORAM_SIZE);
- state->m_buf_spriteram = auto_alloc_array(machine, UINT16, 2 * SPRITERAM_SIZE);
- state->m_buf_spriteram2 = state->m_buf_spriteram + SPRITERAM_SIZE;
+ m_vram = auto_alloc_array(machine(), UINT16, VIDEORAM_SIZE);
+ m_buf_spriteram = auto_alloc_array(machine(), UINT16, 2 * SPRITERAM_SIZE);
+ m_buf_spriteram2 = m_buf_spriteram + SPRITERAM_SIZE;
- state->m_bg_tilemap[0]->set_transparent_pen(0);
- state->m_bg_tilemap[1]->set_transparent_pen(0);
- state->m_bg_tilemap[2]->set_transparent_pen(0);
+ m_bg_tilemap[0]->set_transparent_pen(0);
+ m_bg_tilemap[1]->set_transparent_pen(0);
+ m_bg_tilemap[2]->set_transparent_pen(0);
- state->save_pointer(NAME(state->m_vram), VIDEORAM_SIZE);
- state->save_pointer(NAME(state->m_buf_spriteram), 2 * SPRITERAM_SIZE);
+ save_pointer(NAME(m_vram), VIDEORAM_SIZE);
+ save_pointer(NAME(m_buf_spriteram), 2 * SPRITERAM_SIZE);
}
diff --git a/src/mame/video/othunder.c b/src/mame/video/othunder.c
index 3942ce707b8..08aaabff766 100644
--- a/src/mame/video/othunder.c
+++ b/src/mame/video/othunder.c
@@ -3,13 +3,12 @@
#include "includes/othunder.h"
-VIDEO_START( othunder )
+void othunder_state::video_start()
{
/* Up to $800/8 big sprites, requires 0x100 * sizeof(*spritelist)
Multiply this by 32 to give room for the number of small sprites,
which are what actually get put in the structure. */
- othunder_state *state = machine.driver_data<othunder_state>();
- state->m_spritelist = auto_alloc_array(machine, struct othunder_tempsprite, 0x2000);
+ m_spritelist = auto_alloc_array(machine(), struct othunder_tempsprite, 0x2000);
}
diff --git a/src/mame/video/pacland.c b/src/mame/video/pacland.c
index 4e6388d1101..d7ccd16a1e8 100644
--- a/src/mame/video/pacland.c
+++ b/src/mame/video/pacland.c
@@ -88,63 +88,62 @@ static void switch_palette(running_machine &machine)
}
}
-PALETTE_INIT( pacland )
+void pacland_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- pacland_state *state = machine.driver_data<pacland_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 256);
+ machine().colortable = colortable_alloc(machine(), 256);
- state->m_color_prom = color_prom; /* we'll need this later */
+ m_color_prom = color_prom; /* we'll need this later */
/* skip the palette data, it will be initialized later */
color_prom += 2 * 0x400;
/* color_prom now points to the beginning of the lookup table */
for (i = 0;i < 0x400;i++)
- colortable_entry_set_value(machine.colortable, machine.gfx[0]->colorbase() + i, *color_prom++);
+ colortable_entry_set_value(machine().colortable, machine().gfx[0]->colorbase() + i, *color_prom++);
/* Background */
for (i = 0;i < 0x400;i++)
- colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + i, *color_prom++);
+ colortable_entry_set_value(machine().colortable, machine().gfx[1]->colorbase() + i, *color_prom++);
/* Sprites */
for (i = 0;i < 0x400;i++)
- colortable_entry_set_value(machine.colortable, machine.gfx[2]->colorbase() + i, *color_prom++);
+ colortable_entry_set_value(machine().colortable, machine().gfx[2]->colorbase() + i, *color_prom++);
- state->m_palette_bank = 0;
- switch_palette(machine);
+ m_palette_bank = 0;
+ switch_palette(machine());
/* precalculate transparency masks for sprites */
- state->m_transmask[0] = auto_alloc_array(machine, UINT32, 64);
- state->m_transmask[1] = auto_alloc_array(machine, UINT32, 64);
- state->m_transmask[2] = auto_alloc_array(machine, UINT32, 64);
+ m_transmask[0] = auto_alloc_array(machine(), UINT32, 64);
+ m_transmask[1] = auto_alloc_array(machine(), UINT32, 64);
+ m_transmask[2] = auto_alloc_array(machine(), UINT32, 64);
for (i = 0; i < 64; i++)
{
int palentry;
/* start with no transparency */
- state->m_transmask[0][i] = state->m_transmask[1][i] = state->m_transmask[2][i] = 0;
+ m_transmask[0][i] = m_transmask[1][i] = m_transmask[2][i] = 0;
/* iterate over all palette entries except the last one */
for (palentry = 0; palentry < 0x100; palentry++)
{
- UINT32 mask = colortable_get_transpen_mask(machine.colortable, machine.gfx[2], i, palentry);
+ UINT32 mask = colortable_get_transpen_mask(machine().colortable, machine().gfx[2], i, palentry);
/* transmask[0] is a mask that is used to draw only high priority sprite pixels; thus, pens
$00-$7F are opaque, and others are transparent */
if (palentry >= 0x80)
- state->m_transmask[0][i] |= mask;
+ m_transmask[0][i] |= mask;
/* transmask[1] is a normal drawing masking with palette entries $7F and $FF transparent */
if ((palentry & 0x7f) == 0x7f)
- state->m_transmask[1][i] |= mask;
+ m_transmask[1][i] |= mask;
/* transmask[2] is a mask of the topmost priority sprite pixels; thus pens $F0-$FE are
opaque, and others are transparent */
if (palentry < 0xf0 || palentry == 0xff)
- state->m_transmask[2][i] |= mask;
+ m_transmask[2][i] |= mask;
}
}
}
@@ -190,32 +189,31 @@ TILE_GET_INFO_MEMBER(pacland_state::get_fg_tile_info)
***************************************************************************/
-VIDEO_START( pacland )
+void pacland_state::video_start()
{
- pacland_state *state = machine.driver_data<pacland_state>();
int color;
- machine.primary_screen->register_screen_bitmap(state->m_fg_bitmap);
- state->m_fg_bitmap.fill(0xffff);
+ machine().primary_screen->register_screen_bitmap(m_fg_bitmap);
+ m_fg_bitmap.fill(0xffff);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pacland_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pacland_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pacland_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pacland_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_fg_tilemap->set_scroll_rows(32);
+ m_fg_tilemap->set_scroll_rows(32);
/* create one group per color code; for each group, set the transparency mask
to correspond to the pens that are 0x7f or 0xff */
- assert(machine.gfx[0]->colors() <= TILEMAP_NUM_GROUPS);
- for (color = 0; color < machine.gfx[0]->colors(); color++)
+ assert(machine().gfx[0]->colors() <= TILEMAP_NUM_GROUPS);
+ for (color = 0; color < machine().gfx[0]->colors(); color++)
{
- UINT32 mask = colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0x7f);
- mask |= colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0xff);
- state->m_fg_tilemap->set_transmask(color, mask, 0);
+ UINT32 mask = colortable_get_transpen_mask(machine().colortable, machine().gfx[0], color, 0x7f);
+ mask |= colortable_get_transpen_mask(machine().colortable, machine().gfx[0], color, 0xff);
+ m_fg_tilemap->set_transmask(color, mask, 0);
}
- state_save_register_global(machine, state->m_palette_bank);
- state_save_register_global(machine, state->m_scroll0);
- state_save_register_global(machine, state->m_scroll1);
+ state_save_register_global(machine(), m_palette_bank);
+ state_save_register_global(machine(), m_scroll0);
+ state_save_register_global(machine(), m_scroll1);
}
diff --git a/src/mame/video/pacman.c b/src/mame/video/pacman.c
index 4eaca441462..3edba7c7c28 100644
--- a/src/mame/video/pacman.c
+++ b/src/mame/video/pacman.c
@@ -61,9 +61,9 @@
***************************************************************************/
-PALETTE_INIT( pacman )
+PALETTE_INIT_MEMBER(pacman_state,pacman)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
int i;
@@ -75,7 +75,7 @@ PALETTE_INIT( pacman )
2, &resistances[1], bweights, 0, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 32);
+ machine().colortable = colortable_alloc(machine(), 32);
/* create a lookup table for the palette */
for (i = 0; i < 32; i++)
@@ -100,7 +100,7 @@ PALETTE_INIT( pacman )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -112,10 +112,10 @@ PALETTE_INIT( pacman )
UINT8 ctabentry = color_prom[i] & 0x0f;
/* first palette bank */
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
/* second palette bank */
- colortable_entry_set_value(machine.colortable, i + 64*4, 0x10 + ctabentry);
+ colortable_entry_set_value(machine().colortable, i + 64*4, 0x10 + ctabentry);
}
}
@@ -159,36 +159,34 @@ static void init_save_state(running_machine &machine)
}
-VIDEO_START( pacman )
+VIDEO_START_MEMBER(pacman_state,pacman)
{
- pacman_state *state = machine.driver_data<pacman_state>();
- init_save_state(machine);
+ init_save_state(machine());
- state->m_charbank = 0;
- state->m_spritebank = 0;
- state->m_palettebank = 0;
- state->m_colortablebank = 0;
- state->m_flipscreen = 0;
- state->m_bgpriority = 0;
- state->m_inv_spr = 0;
+ m_charbank = 0;
+ m_spritebank = 0;
+ m_palettebank = 0;
+ m_colortablebank = 0;
+ m_flipscreen = 0;
+ m_bgpriority = 0;
+ m_inv_spr = 0;
/* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
/* one pixel to the left to get a more correct placement */
- state->m_xoffsethack = 1;
+ m_xoffsethack = 1;
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pacman_state::pacman_get_tile_info),state), tilemap_mapper_delegate(FUNC(pacman_state::pacman_scan_rows),state), 8, 8, 36, 28 );
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pacman_state::pacman_get_tile_info),this), tilemap_mapper_delegate(FUNC(pacman_state::pacman_scan_rows),this), 8, 8, 36, 28 );
- state->m_bg_tilemap->set_scrolldx(0, 384 - 288 );
- state->m_bg_tilemap->set_scrolldy(0, 264 - 224 );
+ m_bg_tilemap->set_scrolldx(0, 384 - 288 );
+ m_bg_tilemap->set_scrolldy(0, 264 - 224 );
}
-VIDEO_START( birdiy )
+VIDEO_START_MEMBER(pacman_state,birdiy)
{
- pacman_state *state = machine.driver_data<pacman_state>();
- VIDEO_START_CALL( pacman );
- state->m_xoffsethack = 0;
- state->m_inv_spr = 1; // sprites are mirrored in X-axis compared to normal behaviour
+ VIDEO_START_CALL_MEMBER( pacman );
+ m_xoffsethack = 0;
+ m_inv_spr = 1; // sprites are mirrored in X-axis compared to normal behaviour
}
WRITE8_MEMBER(pacman_state::pacman_videoram_w)
@@ -318,24 +316,23 @@ SCREEN_UPDATE_IND16( pacman )
**************************************************************************/
-VIDEO_START( pengo )
+VIDEO_START_MEMBER(pacman_state,pengo)
{
- pacman_state *state = machine.driver_data<pacman_state>();
- init_save_state(machine);
+ init_save_state(machine());
- state->m_charbank = 0;
- state->m_spritebank = 0;
- state->m_palettebank = 0;
- state->m_colortablebank = 0;
- state->m_flipscreen = 0;
- state->m_bgpriority = 0;
- state->m_inv_spr = 0;
- state->m_xoffsethack = 0;
+ m_charbank = 0;
+ m_spritebank = 0;
+ m_palettebank = 0;
+ m_colortablebank = 0;
+ m_flipscreen = 0;
+ m_bgpriority = 0;
+ m_inv_spr = 0;
+ m_xoffsethack = 0;
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pacman_state::pacman_get_tile_info),state), tilemap_mapper_delegate(FUNC(pacman_state::pacman_scan_rows),state), 8, 8, 36, 28 );
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pacman_state::pacman_get_tile_info),this), tilemap_mapper_delegate(FUNC(pacman_state::pacman_scan_rows),this), 8, 8, 36, 28 );
- state->m_bg_tilemap->set_scrolldx(0, 384 - 288 );
- state->m_bg_tilemap->set_scrolldy(0, 264 - 224 );
+ m_bg_tilemap->set_scrolldx(0, 384 - 288 );
+ m_bg_tilemap->set_scrolldy(0, 264 - 224 );
}
WRITE8_MEMBER(pacman_state::pengo_palettebank_w)
@@ -385,23 +382,22 @@ TILE_GET_INFO_MEMBER(pacman_state::s2650_get_tile_info)
SET_TILE_INFO_MEMBER(0,code,attr & 0x1f,0);
}
-VIDEO_START( s2650games )
+VIDEO_START_MEMBER(pacman_state,s2650games)
{
- pacman_state *state = machine.driver_data<pacman_state>();
- init_save_state(machine);
+ init_save_state(machine());
- state->m_charbank = 0;
- state->m_spritebank = 0;
- state->m_palettebank = 0;
- state->m_colortablebank = 0;
- state->m_flipscreen = 0;
- state->m_bgpriority = 0;
- state->m_inv_spr = 0;
- state->m_xoffsethack = 1;
+ m_charbank = 0;
+ m_spritebank = 0;
+ m_palettebank = 0;
+ m_colortablebank = 0;
+ m_flipscreen = 0;
+ m_bgpriority = 0;
+ m_inv_spr = 0;
+ m_xoffsethack = 1;
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pacman_state::s2650_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32 );
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pacman_state::s2650_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32 );
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_scroll_cols(32);
}
SCREEN_UPDATE_IND16( s2650games )
@@ -556,24 +552,23 @@ static void jrpacman_mark_tile_dirty( running_machine &machine, int offset )
}
}
-VIDEO_START( jrpacman )
+VIDEO_START_MEMBER(pacman_state,jrpacman)
{
- pacman_state *state = machine.driver_data<pacman_state>();
- init_save_state(machine);
+ init_save_state(machine());
- state->m_charbank = 0;
- state->m_spritebank = 0;
- state->m_palettebank = 0;
- state->m_colortablebank = 0;
- state->m_flipscreen = 0;
- state->m_bgpriority = 0;
- state->m_inv_spr = 0;
- state->m_xoffsethack = 1;
+ m_charbank = 0;
+ m_spritebank = 0;
+ m_palettebank = 0;
+ m_colortablebank = 0;
+ m_flipscreen = 0;
+ m_bgpriority = 0;
+ m_inv_spr = 0;
+ m_xoffsethack = 1;
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pacman_state::jrpacman_get_tile_info),state),tilemap_mapper_delegate(FUNC(pacman_state::jrpacman_scan_rows),state),8,8,36,54 );
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pacman_state::jrpacman_get_tile_info),this),tilemap_mapper_delegate(FUNC(pacman_state::jrpacman_scan_rows),this),8,8,36,54 );
- state->m_bg_tilemap->set_transparent_pen(0 );
- state->m_bg_tilemap->set_scroll_cols(36 );
+ m_bg_tilemap->set_transparent_pen(0 );
+ m_bg_tilemap->set_scroll_cols(36 );
}
WRITE8_MEMBER(pacman_state::jrpacman_videoram_w)
diff --git a/src/mame/video/pandoras.c b/src/mame/video/pandoras.c
index e90e6cc06b3..7c7b37e0ac8 100644
--- a/src/mame/video/pandoras.c
+++ b/src/mame/video/pandoras.c
@@ -21,9 +21,9 @@
***************************************************************************/
-PALETTE_INIT( pandoras )
+void pandoras_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -36,7 +36,7 @@ PALETTE_INIT( pandoras )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -61,7 +61,7 @@ PALETTE_INIT( pandoras )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -71,14 +71,14 @@ PALETTE_INIT( pandoras )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* characters */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -105,12 +105,11 @@ TILE_GET_INFO_MEMBER(pandoras_state::get_tile_info0)
***************************************************************************/
-VIDEO_START( pandoras )
+void pandoras_state::video_start()
{
- pandoras_state *state = machine.driver_data<pandoras_state>();
- state->m_layer0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pandoras_state::get_tile_info0),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_layer0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pandoras_state::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->save_item(NAME(state->m_flipscreen));
+ save_item(NAME(m_flipscreen));
}
/***************************************************************************
diff --git a/src/mame/video/paradise.c b/src/mame/video/paradise.c
index 71384b85890..a23dab648a2 100644
--- a/src/mame/video/paradise.c
+++ b/src/mame/video/paradise.c
@@ -151,22 +151,21 @@ WRITE8_MEMBER(paradise_state::paradise_pixmap_w)
***************************************************************************/
-VIDEO_START( paradise )
+void paradise_state::video_start()
{
- paradise_state *state = machine.driver_data<paradise_state>();
- state->m_tilemap_0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(paradise_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 8, 8, 0x20, 0x20);
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(paradise_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS, 8, 8, 0x20, 0x20);
- state->m_tilemap_2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(paradise_state::get_tile_info_2),state), TILEMAP_SCAN_ROWS, 8, 8, 0x20, 0x20);
+ m_tilemap_0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(paradise_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 8, 8, 0x20, 0x20);
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(paradise_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 8, 8, 0x20, 0x20);
+ m_tilemap_2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(paradise_state::get_tile_info_2),this), TILEMAP_SCAN_ROWS, 8, 8, 0x20, 0x20);
/* pixmap */
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap);
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap);
- state->m_tilemap_0->set_transparent_pen(0x0f);
- state->m_tilemap_1->set_transparent_pen(0xff);
- state->m_tilemap_2->set_transparent_pen(0xff);
+ m_tilemap_0->set_transparent_pen(0x0f);
+ m_tilemap_1->set_transparent_pen(0xff);
+ m_tilemap_2->set_transparent_pen(0xff);
- state->save_item(NAME(state->m_tmpbitmap));
+ save_item(NAME(m_tmpbitmap));
}
diff --git a/src/mame/video/pass.c b/src/mame/video/pass.c
index c4259502677..27a243ad2a3 100644
--- a/src/mame/video/pass.c
+++ b/src/mame/video/pass.c
@@ -43,14 +43,13 @@ WRITE16_MEMBER(pass_state::pass_fg_videoram_w)
/* video update / start */
-VIDEO_START( pass )
+void pass_state::video_start()
{
- pass_state *state = machine.driver_data<pass_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pass_state::get_pass_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pass_state::get_pass_fg_tile_info),state), TILEMAP_SCAN_ROWS, 4, 4, 128, 64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pass_state::get_pass_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pass_state::get_pass_fg_tile_info),this), TILEMAP_SCAN_ROWS, 4, 4, 128, 64);
- state->m_fg_tilemap->set_transparent_pen(255);
+ m_fg_tilemap->set_transparent_pen(255);
}
SCREEN_UPDATE_IND16( pass )
diff --git a/src/mame/video/pastelg.c b/src/mame/video/pastelg.c
index 914bf9090ca..45082caea6b 100644
--- a/src/mame/video/pastelg.c
+++ b/src/mame/video/pastelg.c
@@ -19,13 +19,13 @@ static void pastelg_gfxdraw(running_machine &machine);
******************************************************************************/
-PALETTE_INIT( pastelg )
+void pastelg_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
int bit0, bit1, bit2, bit3, r, g, b;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
bit0 = (color_prom[0] >> 0) & 0x01;
bit1 = (color_prom[0] >> 1) & 0x01;
@@ -37,13 +37,13 @@ PALETTE_INIT( pastelg )
bit2 = (color_prom[0] >> 6) & 0x01;
bit3 = (color_prom[0] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
}
@@ -283,14 +283,13 @@ static void pastelg_gfxdraw(running_machine &machine)
******************************************************************************/
-VIDEO_START( pastelg )
+void pastelg_state::video_start()
{
- pastelg_state *state = machine.driver_data<pastelg_state>();
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
- state->m_videoram = auto_alloc_array_clear(machine, UINT8, width * height);
- state->m_clut = auto_alloc_array(machine, UINT8, 0x10);
+ m_videoram = auto_alloc_array_clear(machine(), UINT8, width * height);
+ m_clut = auto_alloc_array(machine(), UINT8, 0x10);
}
/******************************************************************************
diff --git a/src/mame/video/pbaction.c b/src/mame/video/pbaction.c
index 1bbbc43e546..ef351649808 100644
--- a/src/mame/video/pbaction.c
+++ b/src/mame/video/pbaction.c
@@ -68,13 +68,12 @@ TILE_GET_INFO_MEMBER(pbaction_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( pbaction )
+void pbaction_state::video_start()
{
- pbaction_state *state = machine.driver_data<pbaction_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pbaction_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pbaction_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pbaction_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pbaction_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/pcktgal.c b/src/mame/video/pcktgal.c
index d3e588b1de6..d143cca2d13 100644
--- a/src/mame/video/pcktgal.c
+++ b/src/mame/video/pcktgal.c
@@ -2,12 +2,12 @@
#include "includes/pcktgal.h"
#include "video/decbac06.h"
-PALETTE_INIT( pcktgal )
+void pcktgal_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -21,13 +21,13 @@ PALETTE_INIT( pcktgal )
bit2 = (color_prom[i] >> 6) & 0x01;
bit3 = (color_prom[i] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
diff --git a/src/mame/video/pgm.c b/src/mame/video/pgm.c
index 8fed628e7b3..47db2d3caac 100644
--- a/src/mame/video/pgm.c
+++ b/src/mame/video/pgm.c
@@ -613,29 +613,28 @@ TILE_GET_INFO_MEMBER(pgm_state::get_pgm_bg_tilemap_tile_info)
/*** Video - Start / Update ****************************************************/
-VIDEO_START( pgm )
+VIDEO_START_MEMBER(pgm_state,pgm)
{
- pgm_state *state = machine.driver_data<pgm_state>();
int i;
- state->m_bdata = state->memregion("sprmask")->base();
- state->m_bdatasize = state->memregion("sprmask")->bytes() - 1;
- state->m_aoffset = 0;
- state->m_boffset = 0;
+ m_bdata = memregion("sprmask")->base();
+ m_bdatasize = memregion("sprmask")->bytes() - 1;
+ m_aoffset = 0;
+ m_boffset = 0;
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pgm_state::get_pgm_tx_tilemap_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pgm_state::get_pgm_tx_tilemap_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_tx_tilemap->set_transparent_pen(15);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pgm_state::get_pgm_bg_tilemap_tile_info),state), TILEMAP_SCAN_ROWS, 32, 32, 64, 16);
- state->m_bg_tilemap->set_transparent_pen(31);
- state->m_bg_tilemap->set_scroll_rows(16 * 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pgm_state::get_pgm_bg_tilemap_tile_info),this), TILEMAP_SCAN_ROWS, 32, 32, 64, 16);
+ m_bg_tilemap->set_transparent_pen(31);
+ m_bg_tilemap->set_scroll_rows(16 * 32);
for (i = 0; i < 0x1200 / 2; i++)
- palette_set_color(machine, i, MAKE_RGB(0, 0, 0));
+ palette_set_color(machine(), i, MAKE_RGB(0, 0, 0));
- state->m_spritebufferram = auto_alloc_array_clear(machine, UINT16, 0xa00/2);
+ m_spritebufferram = auto_alloc_array_clear(machine(), UINT16, 0xa00/2);
- state->save_pointer(NAME(state->m_spritebufferram), 0xa00/2);
+ save_pointer(NAME(m_spritebufferram), 0xa00/2);
}
SCREEN_UPDATE_IND16( pgm )
diff --git a/src/mame/video/phoenix.c b/src/mame/video/phoenix.c
index 33dac40ff1e..5420043ba6f 100644
--- a/src/mame/video/phoenix.c
+++ b/src/mame/video/phoenix.c
@@ -76,58 +76,58 @@ static const res_net_info survival_net_info =
}
};
-PALETTE_INIT( phoenix )
+PALETTE_INIT_MEMBER(phoenix_state,phoenix)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
rgb_t *rgb;
- rgb = compute_res_net_all(machine, color_prom, &phoenix_decode_info, &phoenix_net_info);
+ rgb = compute_res_net_all(machine(), color_prom, &phoenix_decode_info, &phoenix_net_info);
/* native order */
for (i=0;i<256;i++)
{
int col;
col = ((i << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0x60);
- palette_set_color(machine,i,rgb[col]);
+ palette_set_color(machine(),i,rgb[col]);
}
- palette_normalize_range(machine.palette, 0, 255, 0, 255);
- auto_free(machine, rgb);
+ palette_normalize_range(machine().palette, 0, 255, 0, 255);
+ auto_free(machine(), rgb);
}
-PALETTE_INIT( survival )
+PALETTE_INIT_MEMBER(phoenix_state,survival)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
rgb_t *rgb;
- rgb = compute_res_net_all(machine, color_prom, &phoenix_decode_info, &survival_net_info);
+ rgb = compute_res_net_all(machine(), color_prom, &phoenix_decode_info, &survival_net_info);
/* native order */
for (i=0;i<256;i++)
{
int col;
col = ((i << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0x60);
- palette_set_color(machine,i,rgb[col]);
+ palette_set_color(machine(),i,rgb[col]);
}
- palette_normalize_range(machine.palette, 0, 255, 0, 255);
- auto_free(machine, rgb);
+ palette_normalize_range(machine().palette, 0, 255, 0, 255);
+ auto_free(machine(), rgb);
}
-PALETTE_INIT( pleiads )
+PALETTE_INIT_MEMBER(phoenix_state,pleiads)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
rgb_t *rgb;
- rgb = compute_res_net_all(machine, color_prom, &phoenix_decode_info, &pleiades_net_info);
+ rgb = compute_res_net_all(machine(), color_prom, &phoenix_decode_info, &pleiades_net_info);
/* native order */
for (i=0;i<256;i++)
{
int col;
col = ((i << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0xE0);
- palette_set_color(machine,i,rgb[col]);
+ palette_set_color(machine(),i,rgb[col]);
}
- palette_normalize_range(machine.palette, 0, 255, 0, 255);
- auto_free(machine, rgb);
+ palette_normalize_range(machine().palette, 0, 255, 0, 255);
+ auto_free(machine(), rgb);
}
/***************************************************************************
@@ -170,49 +170,48 @@ TILE_GET_INFO_MEMBER(phoenix_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( phoenix )
+VIDEO_START_MEMBER(phoenix_state,phoenix)
{
- phoenix_state *state = machine.driver_data<phoenix_state>();
- state->m_videoram_pg[0] = auto_alloc_array(machine, UINT8, 0x1000);
- state->m_videoram_pg[1] = auto_alloc_array(machine, UINT8, 0x1000);
+ m_videoram_pg[0] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_videoram_pg[1] = auto_alloc_array(machine(), UINT8, 0x1000);
- state->membank("bank1")->configure_entry(0, state->m_videoram_pg[0]);
- state->membank("bank1")->configure_entry(1, state->m_videoram_pg[1]);
- state->membank("bank1")->set_entry(0);
+ membank("bank1")->configure_entry(0, m_videoram_pg[0]);
+ membank("bank1")->configure_entry(1, m_videoram_pg[1]);
+ membank("bank1")->set_entry(0);
- state->m_videoram_pg_index = 0;
- state->m_palette_bank = 0;
- state->m_cocktail_mode = 0;
+ m_videoram_pg_index = 0;
+ m_palette_bank = 0;
+ m_cocktail_mode = 0;
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(phoenix_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(phoenix_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(phoenix_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(phoenix_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scrolldx(0, (HTOTAL - HBSTART));
- state->m_bg_tilemap->set_scrolldx(0, (HTOTAL - HBSTART));
- state->m_fg_tilemap->set_scrolldy(0, (VTOTAL - VBSTART));
- state->m_bg_tilemap->set_scrolldy(0, (VTOTAL - VBSTART));
+ m_fg_tilemap->set_scrolldx(0, (HTOTAL - HBSTART));
+ m_bg_tilemap->set_scrolldx(0, (HTOTAL - HBSTART));
+ m_fg_tilemap->set_scrolldy(0, (VTOTAL - VBSTART));
+ m_bg_tilemap->set_scrolldy(0, (VTOTAL - VBSTART));
- state_save_register_global_pointer(machine, state->m_videoram_pg[0], 0x1000);
- state_save_register_global_pointer(machine, state->m_videoram_pg[1], 0x1000);
- state_save_register_global(machine, state->m_videoram_pg_index);
- state_save_register_global(machine, state->m_palette_bank);
- state_save_register_global(machine, state->m_cocktail_mode);
+ state_save_register_global_pointer(machine(), m_videoram_pg[0], 0x1000);
+ state_save_register_global_pointer(machine(), m_videoram_pg[1], 0x1000);
+ state_save_register_global(machine(), m_videoram_pg_index);
+ state_save_register_global(machine(), m_palette_bank);
+ state_save_register_global(machine(), m_cocktail_mode);
/* some more candidates */
- state->m_pleiads_protection_question = 0;
- state->m_survival_protection_value = 0;
- state->m_survival_sid_value = 0;
- state->m_survival_input_readc = 0;
- state->m_survival_input_latches[0] = 0;
- state->m_survival_input_latches[1] = 0;
-
- state_save_register_global(machine, state->m_pleiads_protection_question);
- state_save_register_global(machine, state->m_survival_protection_value);
- state_save_register_global(machine, state->m_survival_sid_value);
- state_save_register_global(machine, state->m_survival_input_readc);
- state_save_register_global_array(machine, state->m_survival_input_latches);
+ m_pleiads_protection_question = 0;
+ m_survival_protection_value = 0;
+ m_survival_sid_value = 0;
+ m_survival_input_readc = 0;
+ m_survival_input_latches[0] = 0;
+ m_survival_input_latches[1] = 0;
+
+ state_save_register_global(machine(), m_pleiads_protection_question);
+ state_save_register_global(machine(), m_survival_protection_value);
+ state_save_register_global(machine(), m_survival_sid_value);
+ state_save_register_global(machine(), m_survival_input_readc);
+ state_save_register_global_array(machine(), m_survival_input_latches);
}
diff --git a/src/mame/video/pingpong.c b/src/mame/video/pingpong.c
index 4a5a0397d6a..977168e7ae7 100644
--- a/src/mame/video/pingpong.c
+++ b/src/mame/video/pingpong.c
@@ -30,13 +30,13 @@
bit 0 -- 1 kohm resistor -- RED
***************************************************************************/
-PALETTE_INIT( pingpong )
+void pingpong_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -62,7 +62,7 @@ PALETTE_INIT( pingpong )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -72,14 +72,14 @@ PALETTE_INIT( pingpong )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = BITSWAP8(color_prom[i],7,6,5,4,0,1,2,3);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -105,10 +105,9 @@ TILE_GET_INFO_MEMBER(pingpong_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( pingpong )
+void pingpong_state::video_start()
{
- pingpong_state *state = machine.driver_data<pingpong_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pingpong_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pingpong_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/pirates.c b/src/mame/video/pirates.c
index 046ff3805e0..dc8de290b17 100644
--- a/src/mame/video/pirates.c
+++ b/src/mame/video/pirates.c
@@ -33,17 +33,16 @@ TILE_GET_INFO_MEMBER(pirates_state::get_bg_tile_info)
/* video start / update */
-VIDEO_START(pirates)
+void pirates_state::video_start()
{
- pirates_state *state = machine.driver_data<pirates_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pirates_state::get_tx_tile_info),state),TILEMAP_SCAN_COLS,8,8,36,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pirates_state::get_tx_tile_info),this),TILEMAP_SCAN_COLS,8,8,36,32);
/* Not sure how big they can be, Pirates uses only 32 columns, Genix 44 */
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pirates_state::get_fg_tile_info),state),TILEMAP_SCAN_COLS,8,8,64,32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pirates_state::get_bg_tile_info),state),TILEMAP_SCAN_COLS, 8,8,64,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pirates_state::get_fg_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pirates_state::get_bg_tile_info),this),TILEMAP_SCAN_COLS, 8,8,64,32);
- state->m_tx_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/pitnrun.c b/src/mame/video/pitnrun.c
index 57a3f1e064f..8a825e425eb 100644
--- a/src/mame/video/pitnrun.c
+++ b/src/mame/video/pitnrun.c
@@ -113,9 +113,9 @@ static void pitnrun_spotlights(running_machine &machine)
}
-PALETTE_INIT (pitnrun)
+void pitnrun_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
int bit0,bit1,bit2,r,g,b;
for (i = 0;i < 32*3; i++)
@@ -133,7 +133,7 @@ PALETTE_INIT (pitnrun)
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
/* fake bg palette for lightning effect*/
@@ -155,22 +155,21 @@ PALETTE_INIT (pitnrun)
g/=3;
b/=3;
- palette_set_color_rgb(machine,i+16,(r>0xff)?0xff:r,(g>0xff)?0xff:g,(b>0xff)?0xff:b);
+ palette_set_color_rgb(machine(),i+16,(r>0xff)?0xff:r,(g>0xff)?0xff:g,(b>0xff)?0xff:b);
}
}
-VIDEO_START(pitnrun)
+void pitnrun_state::video_start()
{
- pitnrun_state *state = machine.driver_data<pitnrun_state>();
- state->m_fg = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pitnrun_state::get_tile_info1),state),TILEMAP_SCAN_ROWS,8,8,32,32 );
- state->m_bg = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pitnrun_state::get_tile_info2),state),TILEMAP_SCAN_ROWS,8,8,32*4,32 );
- state->m_fg->set_transparent_pen(0 );
- state->m_tmp_bitmap[0] = auto_bitmap_ind16_alloc(machine,128,128);
- state->m_tmp_bitmap[1] = auto_bitmap_ind16_alloc(machine,128,128);
- state->m_tmp_bitmap[2] = auto_bitmap_ind16_alloc(machine,128,128);
- state->m_tmp_bitmap[3] = auto_bitmap_ind16_alloc(machine,128,128);
- pitnrun_spotlights(machine);
+ m_fg = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pitnrun_state::get_tile_info1),this),TILEMAP_SCAN_ROWS,8,8,32,32 );
+ m_bg = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pitnrun_state::get_tile_info2),this),TILEMAP_SCAN_ROWS,8,8,32*4,32 );
+ m_fg->set_transparent_pen(0 );
+ m_tmp_bitmap[0] = auto_bitmap_ind16_alloc(machine(),128,128);
+ m_tmp_bitmap[1] = auto_bitmap_ind16_alloc(machine(),128,128);
+ m_tmp_bitmap[2] = auto_bitmap_ind16_alloc(machine(),128,128);
+ m_tmp_bitmap[3] = auto_bitmap_ind16_alloc(machine(),128,128);
+ pitnrun_spotlights(machine());
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/playch10.c b/src/mame/video/playch10.c
index 8e1b667887f..ac6d84f6c3f 100644
--- a/src/mame/video/playch10.c
+++ b/src/mame/video/playch10.c
@@ -14,10 +14,10 @@ WRITE8_MEMBER(playch10_state::playch10_videoram_w)
}
}
-PALETTE_INIT( playch10 )
+void playch10_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu");
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
+ ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
int i;
for (i = 0; i < 256; i++)
@@ -50,12 +50,12 @@ PALETTE_INIT( playch10 )
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
- ppu->init_palette_rgb(machine, 256);
+ ppu->init_palette_rgb(machine(), 256);
}
static void ppu_irq( device_t *device, int *ppu_regs )
@@ -89,23 +89,21 @@ TILE_GET_INFO_MEMBER(playch10_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( playch10 )
+void playch10_state::video_start()
{
- playch10_state *state = machine.driver_data<playch10_state>();
- const UINT8 *bios = state->memregion("maincpu")->base();
- state->m_pc10_bios = (bios[3] == 0x2a) ? 1 : 2;
+ const UINT8 *bios = memregion("maincpu")->base();
+ m_pc10_bios = (bios[3] == 0x2a) ? 1 : 2;
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playch10_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playch10_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
}
-VIDEO_START( playch10_hboard )
+VIDEO_START_MEMBER(playch10_state,playch10_hboard)
{
- playch10_state *state = machine.driver_data<playch10_state>();
- const UINT8 *bios = state->memregion("maincpu")->base();
- state->m_pc10_bios = (bios[3] == 0x2a) ? 1 : 2;
+ const UINT8 *bios = memregion("maincpu")->base();
+ m_pc10_bios = (bios[3] == 0x2a) ? 1 : 2;
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playch10_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playch10_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
}
diff --git a/src/mame/video/playmark.c b/src/mame/video/playmark.c
index c956fdd03e9..f1ee9f26ac5 100644
--- a/src/mame/video/playmark.c
+++ b/src/mame/video/playmark.c
@@ -104,132 +104,126 @@ TILE_GET_INFO_MEMBER(playmark_state::hrdtimes_get_bg_tile_info)
***************************************************************************/
-VIDEO_START( bigtwin )
+VIDEO_START_MEMBER(playmark_state,bigtwin)
{
- playmark_state *state = machine.driver_data<playmark_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::bigtwin_get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::bigtwin_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::bigtwin_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::bigtwin_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
- state->m_xoffset = 0;
- state->m_yoffset = 0;
- state->m_txt_tile_offset = 0;
+ m_xoffset = 0;
+ m_yoffset = 0;
+ m_txt_tile_offset = 0;
- state->m_pri_masks[0] = 0;
- state->m_pri_masks[1] = 0;
- state->m_pri_masks[2] = 0;
+ m_pri_masks[0] = 0;
+ m_pri_masks[1] = 0;
+ m_pri_masks[2] = 0;
}
-VIDEO_START( bigtwinb )
+VIDEO_START_MEMBER(playmark_state,bigtwinb)
{
- playmark_state *state = machine.driver_data<playmark_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::bigtwinb_get_tx_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_fg_tile_info),state),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_bg_tile_info),state),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::bigtwinb_get_tx_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_fg_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_bg_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(-4, -4);
+ m_bg_tilemap->set_scrolldx(-4, -4);
- state->m_xoffset = 1;
- state->m_yoffset = 0;
- state->m_txt_tile_offset = 0x8000;
+ m_xoffset = 1;
+ m_yoffset = 0;
+ m_txt_tile_offset = 0x8000;
- state->m_pri_masks[0] = 0;
- state->m_pri_masks[1] = 0;
- state->m_pri_masks[2] = 0;
+ m_pri_masks[0] = 0;
+ m_pri_masks[1] = 0;
+ m_pri_masks[2] = 0;
}
-VIDEO_START( wbeachvl )
+VIDEO_START_MEMBER(playmark_state,wbeachvl)
{
- playmark_state *state = machine.driver_data<playmark_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::wbeachvl_get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::wbeachvl_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::wbeachvl_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::wbeachvl_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::wbeachvl_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::wbeachvl_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
- state->m_tx_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_xoffset = 0;
- state->m_yoffset = 0;
- state->m_txt_tile_offset = 0;
+ m_xoffset = 0;
+ m_yoffset = 0;
+ m_txt_tile_offset = 0;
- state->m_pri_masks[0] = 0xfff0;
- state->m_pri_masks[1] = 0xfffc;
- state->m_pri_masks[2] = 0;
+ m_pri_masks[0] = 0xfff0;
+ m_pri_masks[1] = 0xfffc;
+ m_pri_masks[2] = 0;
}
-VIDEO_START( excelsr )
+VIDEO_START_MEMBER(playmark_state,excelsr)
{
- playmark_state *state = machine.driver_data<playmark_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::bigtwin_get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::bigtwin_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::bigtwin_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::bigtwin_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
- state->m_xoffset = 0;
- state->m_yoffset = 0;
- state->m_txt_tile_offset = 0;
+ m_xoffset = 0;
+ m_yoffset = 0;
+ m_txt_tile_offset = 0;
- state->m_pri_masks[0] = 0;
- state->m_pri_masks[1] = 0xfffc;
- state->m_pri_masks[2] = 0xfff0;
+ m_pri_masks[0] = 0;
+ m_pri_masks[1] = 0xfffc;
+ m_pri_masks[2] = 0xfff0;
}
-VIDEO_START( hotmind )
+VIDEO_START_MEMBER(playmark_state,hotmind)
{
- playmark_state *state = machine.driver_data<playmark_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_scrolldx(-14, -14);
- state->m_fg_tilemap->set_scrolldx(-14, -14);
- state->m_bg_tilemap->set_scrolldx(-14, -14);
+ m_tx_tilemap->set_scrolldx(-14, -14);
+ m_fg_tilemap->set_scrolldx(-14, -14);
+ m_bg_tilemap->set_scrolldx(-14, -14);
- state->m_xoffset = -9;
- state->m_yoffset = -8;
- state->m_txt_tile_offset = 0x9000;
+ m_xoffset = -9;
+ m_yoffset = -8;
+ m_txt_tile_offset = 0x9000;
- state->m_pri_masks[0] = 0xfff0;
- state->m_pri_masks[1] = 0xfffc;
- state->m_pri_masks[2] = 0;
+ m_pri_masks[0] = 0xfff0;
+ m_pri_masks[1] = 0xfffc;
+ m_pri_masks[2] = 0;
}
-VIDEO_START( hrdtimes )
+VIDEO_START_MEMBER(playmark_state,hrdtimes)
{
- playmark_state *state = machine.driver_data<playmark_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_tx_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_fg_tile_info),state),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_bg_tile_info),state),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_tx_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_fg_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(playmark_state::hrdtimes_get_bg_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_scrolldx(-14, -14);
- state->m_fg_tilemap->set_scrolldx(-10, -10);
- state->m_bg_tilemap->set_scrolldx(-12, -12);
+ m_tx_tilemap->set_scrolldx(-14, -14);
+ m_fg_tilemap->set_scrolldx(-10, -10);
+ m_bg_tilemap->set_scrolldx(-12, -12);
- state->m_xoffset = -8;
- state->m_yoffset = -8;
- state->m_txt_tile_offset = 0xfc00;
+ m_xoffset = -8;
+ m_yoffset = -8;
+ m_txt_tile_offset = 0xfc00;
- state->m_pri_masks[0] = 0xfff0;
- state->m_pri_masks[1] = 0xfffc;
- state->m_pri_masks[2] = 0;
+ m_pri_masks[0] = 0xfff0;
+ m_pri_masks[1] = 0xfffc;
+ m_pri_masks[2] = 0;
}
/***************************************************************************
diff --git a/src/mame/video/plygonet.c b/src/mame/video/plygonet.c
index 013d9840b47..cd2f91be9ac 100644
--- a/src/mame/video/plygonet.c
+++ b/src/mame/video/plygonet.c
@@ -78,9 +78,8 @@ TILEMAP_MAPPER_MEMBER(polygonet_state::plygonet_scan_cols)
return col * num_rows + (row^1);
}
-VIDEO_START( polygonet )
+void polygonet_state::video_start()
{
- polygonet_state *state = machine.driver_data<polygonet_state>();
static const gfx_layout charlayout =
{
8, 8, /* 8x8 */
@@ -93,28 +92,28 @@ VIDEO_START( polygonet )
};
/* find first empty slot to decode gfx */
- for (state->m_ttl_gfx_index = 0; state->m_ttl_gfx_index < MAX_GFX_ELEMENTS; state->m_ttl_gfx_index++)
- if (machine.gfx[state->m_ttl_gfx_index] == 0)
+ for (m_ttl_gfx_index = 0; m_ttl_gfx_index < MAX_GFX_ELEMENTS; m_ttl_gfx_index++)
+ if (machine().gfx[m_ttl_gfx_index] == 0)
break;
- assert(state->m_ttl_gfx_index != MAX_GFX_ELEMENTS);
+ assert(m_ttl_gfx_index != MAX_GFX_ELEMENTS);
/* decode the ttl layer's gfx */
- machine.gfx[state->m_ttl_gfx_index] = auto_alloc(machine, gfx_element(machine, charlayout, machine.root_device().memregion("gfx1")->base(), machine.total_colors() / 16, 0));
+ machine().gfx[m_ttl_gfx_index] = auto_alloc(machine(), gfx_element(machine(), charlayout, machine().root_device().memregion("gfx1")->base(), machine().total_colors() / 16, 0));
/* create the tilemap */
- state->m_ttl_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(polygonet_state::ttl_get_tile_info),state), tilemap_mapper_delegate(FUNC(polygonet_state::plygonet_scan),state), 8, 8, 64, 32);
+ m_ttl_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(polygonet_state::ttl_get_tile_info),this), tilemap_mapper_delegate(FUNC(polygonet_state::plygonet_scan),this), 8, 8, 64, 32);
- state->m_ttl_tilemap->set_transparent_pen(0);
+ m_ttl_tilemap->set_transparent_pen(0);
/* set up the roz t-map too */
- state->m_roz_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(polygonet_state::roz_get_tile_info),state), tilemap_mapper_delegate(FUNC(polygonet_state::plygonet_scan_cols),state), 16, 16, 32, 64);
- state->m_roz_tilemap->set_transparent_pen(0);
+ m_roz_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(polygonet_state::roz_get_tile_info),this), tilemap_mapper_delegate(FUNC(polygonet_state::plygonet_scan_cols),this), 16, 16, 32, 64);
+ m_roz_tilemap->set_transparent_pen(0);
/* save states */
- state->save_item(NAME(state->m_ttl_gfx_index));
- state->save_item(NAME(state->m_ttl_vram));
- state->save_item(NAME(state->m_roz_vram));
+ save_item(NAME(m_ttl_gfx_index));
+ save_item(NAME(m_ttl_vram));
+ save_item(NAME(m_roz_vram));
}
SCREEN_UPDATE_IND16( polygonet )
diff --git a/src/mame/video/pokechmp.c b/src/mame/video/pokechmp.c
index 1ab9d2889f3..32bad75dd1e 100644
--- a/src/mame/video/pokechmp.c
+++ b/src/mame/video/pokechmp.c
@@ -29,10 +29,9 @@ TILE_GET_INFO_MEMBER(pokechmp_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( pokechmp )
+void pokechmp_state::video_start()
{
- pokechmp_state *state = machine.driver_data<pokechmp_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pokechmp_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pokechmp_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
}
diff --git a/src/mame/video/polepos.c b/src/mame/video/polepos.c
index 28be78ff160..43323bbd409 100644
--- a/src/mame/video/polepos.c
+++ b/src/mame/video/polepos.c
@@ -25,14 +25,13 @@
***************************************************************************/
-PALETTE_INIT( polepos )
+PALETTE_INIT_MEMBER(polepos_state,polepos)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- polepos_state *state = machine.driver_data<polepos_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i, j;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 128);
+ machine().colortable = colortable_alloc(machine(), 128);
/*******************************************************
* Color PROMs
@@ -78,7 +77,7 @@ PALETTE_INIT( polepos )
bit3 = (color_prom[0x200 + i] >> 3) & 1;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable,i,MAKE_RGB(r,g,b));
}
/*******************************************************
@@ -89,8 +88,8 @@ PALETTE_INIT( polepos )
for (i = 0; i < 64*4; i++)
{
int color = color_prom[0x300 + i];
- colortable_entry_set_value(machine.colortable, 0x0000 + i, (color != 15) ? (0x020 + color) : 0x2f);
- colortable_entry_set_value(machine.colortable, 0x0100 + i, (color != 15) ? (0x060 + color) : 0x2f);
+ colortable_entry_set_value(machine().colortable, 0x0000 + i, (color != 15) ? (0x020 + color) : 0x2f);
+ colortable_entry_set_value(machine().colortable, 0x0100 + i, (color != 15) ? (0x060 + color) : 0x2f);
}
/*******************************************************
@@ -102,7 +101,7 @@ PALETTE_INIT( polepos )
for (i = 0; i < 64*4; i++)
{
int color = color_prom[0x400 + i];
- colortable_entry_set_value(machine.colortable, 0x0200 + i, 0x000 + color);
+ colortable_entry_set_value(machine().colortable, 0x0200 + i, 0x000 + color);
}
/*******************************************************
@@ -113,8 +112,8 @@ PALETTE_INIT( polepos )
for (i = 0; i < 64*16; i++)
{
int color = color_prom[0xc00 + i];
- colortable_entry_set_value(machine.colortable, 0x0300 + i, (color != 15) ? (0x010 + color) : 0x1f);
- colortable_entry_set_value(machine.colortable, 0x0700 + i, (color != 15) ? (0x050 + color) : 0x1f);
+ colortable_entry_set_value(machine().colortable, 0x0300 + i, (color != 15) ? (0x010 + color) : 0x1f);
+ colortable_entry_set_value(machine().colortable, 0x0700 + i, (color != 15) ? (0x050 + color) : 0x1f);
}
/*******************************************************
@@ -126,14 +125,14 @@ PALETTE_INIT( polepos )
for (i = 0; i < 64*16; i++)
{
int color = color_prom[0x800 + i];
- colortable_entry_set_value(machine.colortable, 0x0b00 + i, 0x040 + color);
+ colortable_entry_set_value(machine().colortable, 0x0b00 + i, 0x040 + color);
}
/* 136014-142, 136014-143, 136014-144 Vertical position modifiers */
for (i = 0; i < 256; i++)
{
j = color_prom[0x500 + i] + (color_prom[0x600 + i] << 4) + (color_prom[0x700 + i] << 8);
- state->m_vertical_position_modifier[i] = j;
+ m_vertical_position_modifier[i] = j;
}
}
@@ -191,13 +190,12 @@ TILE_GET_INFO_MEMBER(polepos_state::tx_get_tile_info)
***************************************************************************/
-VIDEO_START( polepos )
+VIDEO_START_MEMBER(polepos_state,polepos)
{
- polepos_state *state = machine.driver_data<polepos_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(polepos_state::bg_get_tile_info),state),TILEMAP_SCAN_COLS,8,8,64,16);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(polepos_state::tx_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(polepos_state::bg_get_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,16);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(polepos_state::tx_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- colortable_configure_tilemap_groups(machine.colortable, state->m_tx_tilemap, machine.gfx[0], 0x2f);
+ colortable_configure_tilemap_groups(machine().colortable, m_tx_tilemap, machine().gfx[0], 0x2f);
}
diff --git a/src/mame/video/policetr.c b/src/mame/video/policetr.c
index 98ab621518a..5f91cba831e 100644
--- a/src/mame/video/policetr.c
+++ b/src/mame/video/policetr.c
@@ -22,17 +22,16 @@
*
*************************************/
-VIDEO_START( policetr )
+void policetr_state::video_start()
{
- policetr_state *state = machine.driver_data<policetr_state>();
/* the source bitmap is in ROM */
- state->m_srcbitmap = state->memregion("gfx1")->base();
+ m_srcbitmap = memregion("gfx1")->base();
/* compute the height */
- state->m_srcbitmap_height_mask = (state->memregion("gfx1")->bytes() / SRCBITMAP_WIDTH) - 1;
+ m_srcbitmap_height_mask = (memregion("gfx1")->bytes() / SRCBITMAP_WIDTH) - 1;
/* the destination bitmap is not directly accessible to the CPU */
- state->m_dstbitmap = auto_alloc_array(machine, UINT8, DSTBITMAP_WIDTH * DSTBITMAP_HEIGHT);
+ m_dstbitmap = auto_alloc_array(machine(), UINT8, DSTBITMAP_WIDTH * DSTBITMAP_HEIGHT);
}
diff --git a/src/mame/video/polyplay.c b/src/mame/video/polyplay.c
index f483c659ded..918fa18dab3 100644
--- a/src/mame/video/polyplay.c
+++ b/src/mame/video/polyplay.c
@@ -13,19 +13,19 @@
#include "includes/polyplay.h"
-PALETTE_INIT( polyplay )
+void polyplay_state::palette_init()
{
- palette_set_color(machine,0,MAKE_RGB(0x00,0x00,0x00));
- palette_set_color(machine,1,MAKE_RGB(0xff,0xff,0xff));
-
- palette_set_color(machine,2,MAKE_RGB(0x00,0x00,0x00));
- palette_set_color(machine,3,MAKE_RGB(0xff,0x00,0x00));
- palette_set_color(machine,4,MAKE_RGB(0x00,0xff,0x00));
- palette_set_color(machine,5,MAKE_RGB(0xff,0xff,0x00));
- palette_set_color(machine,6,MAKE_RGB(0x00,0x00,0xff));
- palette_set_color(machine,7,MAKE_RGB(0xff,0x00,0xff));
- palette_set_color(machine,8,MAKE_RGB(0x00,0xff,0xff));
- palette_set_color(machine,9,MAKE_RGB(0xff,0xff,0xff));
+ palette_set_color(machine(),0,MAKE_RGB(0x00,0x00,0x00));
+ palette_set_color(machine(),1,MAKE_RGB(0xff,0xff,0xff));
+
+ palette_set_color(machine(),2,MAKE_RGB(0x00,0x00,0x00));
+ palette_set_color(machine(),3,MAKE_RGB(0xff,0x00,0x00));
+ palette_set_color(machine(),4,MAKE_RGB(0x00,0xff,0x00));
+ palette_set_color(machine(),5,MAKE_RGB(0xff,0xff,0x00));
+ palette_set_color(machine(),6,MAKE_RGB(0x00,0x00,0xff));
+ palette_set_color(machine(),7,MAKE_RGB(0xff,0x00,0xff));
+ palette_set_color(machine(),8,MAKE_RGB(0x00,0xff,0xff));
+ palette_set_color(machine(),9,MAKE_RGB(0xff,0xff,0xff));
}
@@ -39,10 +39,9 @@ WRITE8_MEMBER(polyplay_state::polyplay_characterram_w)
}
}
-VIDEO_START( polyplay )
+void polyplay_state::video_start()
{
- polyplay_state *state = machine.driver_data<polyplay_state>();
- machine.gfx[1]->set_source(state->m_characterram);
+ machine().gfx[1]->set_source(m_characterram);
}
diff --git a/src/mame/video/poolshrk.c b/src/mame/video/poolshrk.c
index 283c09ccabf..4a368cfdf02 100644
--- a/src/mame/video/poolshrk.c
+++ b/src/mame/video/poolshrk.c
@@ -16,13 +16,12 @@ TILE_GET_INFO_MEMBER(poolshrk_state::get_tile_info)
}
-VIDEO_START( poolshrk )
+void poolshrk_state::video_start()
{
- poolshrk_state *state = machine.driver_data<poolshrk_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(poolshrk_state::get_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(poolshrk_state::get_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/pooyan.c b/src/mame/video/pooyan.c
index 4caba227343..722575ec839 100644
--- a/src/mame/video/pooyan.c
+++ b/src/mame/video/pooyan.c
@@ -27,9 +27,9 @@
***************************************************************************/
-PALETTE_INIT( pooyan )
+void pooyan_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -42,7 +42,7 @@ PALETTE_INIT( pooyan )
2, resistances_b, bweights, 1000, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -67,7 +67,7 @@ PALETTE_INIT( pooyan )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -77,14 +77,14 @@ PALETTE_INIT( pooyan )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -114,10 +114,9 @@ TILE_GET_INFO_MEMBER(pooyan_state::get_bg_tile_info)
*
*************************************/
-VIDEO_START( pooyan )
+void pooyan_state::video_start()
{
- pooyan_state *state = machine.driver_data<pooyan_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pooyan_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pooyan_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/popeye.c b/src/mame/video/popeye.c
index 61a5e71f1c5..e6ed97664ec 100644
--- a/src/mame/video/popeye.c
+++ b/src/mame/video/popeye.c
@@ -113,22 +113,20 @@ static void convert_color_prom(running_machine &machine,const UINT8 *color_prom)
}
}
-PALETTE_INIT( popeye )
+void popeye_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- popeye_state *state = machine.driver_data<popeye_state>();
- state->m_invertmask = 0xff;
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
+ m_invertmask = 0xff;
- convert_color_prom(machine,color_prom);
+ convert_color_prom(machine(),color_prom);
}
-PALETTE_INIT( popeyebl )
+PALETTE_INIT_MEMBER(popeye_state,popeyebl)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- popeye_state *state = machine.driver_data<popeye_state>();
- state->m_invertmask = 0x00;
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
+ m_invertmask = 0x00;
- convert_color_prom(machine,color_prom);
+ convert_color_prom(machine(),color_prom);
}
static void set_background_palette(running_machine &machine,int bank)
@@ -241,40 +239,38 @@ TILE_GET_INFO_MEMBER(popeye_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( skyskipr )
+void popeye_state::video_start()
{
- popeye_state *state = machine.driver_data<popeye_state>();
- state->m_bitmapram = auto_alloc_array(machine, UINT8, popeye_bitmapram_size);
- state->m_tmpbitmap2 = auto_bitmap_ind16_alloc(machine,1024,1024); /* actually 1024x512 but not rolling over vertically? */
+ m_bitmapram = auto_alloc_array(machine(), UINT8, popeye_bitmapram_size);
+ m_tmpbitmap2 = auto_bitmap_ind16_alloc(machine(),1024,1024); /* actually 1024x512 but not rolling over vertically? */
- state->m_bitmap_type = TYPE_SKYSKIPR;
+ m_bitmap_type = TYPE_SKYSKIPR;
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(popeye_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(popeye_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_lastflip = 0;
+ m_lastflip = 0;
- state_save_register_global(machine, state->m_lastflip);
- state_save_register_global_bitmap(machine, state->m_tmpbitmap2);
- state_save_register_global_pointer(machine, state->m_bitmapram, popeye_bitmapram_size);
+ state_save_register_global(machine(), m_lastflip);
+ state_save_register_global_bitmap(machine(), m_tmpbitmap2);
+ state_save_register_global_pointer(machine(), m_bitmapram, popeye_bitmapram_size);
}
-VIDEO_START( popeye )
+VIDEO_START_MEMBER(popeye_state,popeye)
{
- popeye_state *state = machine.driver_data<popeye_state>();
- state->m_bitmapram = auto_alloc_array(machine, UINT8, popeye_bitmapram_size);
- state->m_tmpbitmap2 = auto_bitmap_ind16_alloc(machine,512,512);
+ m_bitmapram = auto_alloc_array(machine(), UINT8, popeye_bitmapram_size);
+ m_tmpbitmap2 = auto_bitmap_ind16_alloc(machine(),512,512);
- state->m_bitmap_type = TYPE_POPEYE;
+ m_bitmap_type = TYPE_POPEYE;
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(popeye_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(popeye_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_lastflip = 0;
+ m_lastflip = 0;
- state_save_register_global(machine, state->m_lastflip);
- state_save_register_global_bitmap(machine, state->m_tmpbitmap2);
- state_save_register_global_pointer(machine, state->m_bitmapram, popeye_bitmapram_size);
+ state_save_register_global(machine(), m_lastflip);
+ state_save_register_global_bitmap(machine(), m_tmpbitmap2);
+ state_save_register_global_pointer(machine(), m_bitmapram, popeye_bitmapram_size);
}
static void draw_background(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/popper.c b/src/mame/video/popper.c
index 1e320a28b9e..9445e57e1e4 100644
--- a/src/mame/video/popper.c
+++ b/src/mame/video/popper.c
@@ -44,15 +44,15 @@ static const res_net_info popper_net_info =
*
***************************************************************************/
-PALETTE_INIT( popper )
+void popper_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t *rgb;
- rgb = compute_res_net_all(machine, color_prom, &popper_decode_info, &popper_net_info);
- palette_set_colors(machine, 0, rgb, 64);
- palette_normalize_range(machine.palette, 0, 63, 0, 255);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &popper_decode_info, &popper_net_info);
+ palette_set_colors(machine(), 0, rgb, 64);
+ palette_normalize_range(machine().palette, 0, 63, 0, 255);
+ auto_free(machine(), rgb);
}
WRITE8_MEMBER(popper_state::popper_ol_videoram_w)
@@ -174,24 +174,23 @@ TILE_GET_INFO_MEMBER(popper_state::get_popper_ol_p0_tile_info)
0);
}
-VIDEO_START( popper )
+void popper_state::video_start()
{
- popper_state *state = machine.driver_data<popper_state>();
- state->m_p123_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(popper_state::get_popper_p123_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 33, 32 );
- state->m_p0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(popper_state::get_popper_p0_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 33, 32);
- state->m_ol_p123_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(popper_state::get_popper_ol_p123_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 2, 32);
- state->m_ol_p0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(popper_state::get_popper_ol_p0_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 2, 32);
-
- state->m_p123_tilemap->set_transmask(0, 0x0f, 0x01);
- state->m_p123_tilemap->set_transmask(1, 0x01, 0x0f);
- state->m_p0_tilemap->set_transmask(0, 0x0f, 0x0e);
- state->m_p0_tilemap->set_transmask(1, 0x0e, 0x0f);
- state->m_ol_p123_tilemap->set_transmask(0, 0x0f, 0x01);
- state->m_ol_p123_tilemap->set_transmask(1, 0x01, 0x0f);
- state->m_ol_p0_tilemap->set_transmask(0, 0x0f, 0x0e);
- state->m_ol_p0_tilemap->set_transmask(1, 0x0e, 0x0f);
-
- state->m_tilemap_clip = machine.primary_screen->visible_area();
+ m_p123_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(popper_state::get_popper_p123_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 33, 32 );
+ m_p0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(popper_state::get_popper_p0_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 33, 32);
+ m_ol_p123_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(popper_state::get_popper_ol_p123_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 2, 32);
+ m_ol_p0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(popper_state::get_popper_ol_p0_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 2, 32);
+
+ m_p123_tilemap->set_transmask(0, 0x0f, 0x01);
+ m_p123_tilemap->set_transmask(1, 0x01, 0x0f);
+ m_p0_tilemap->set_transmask(0, 0x0f, 0x0e);
+ m_p0_tilemap->set_transmask(1, 0x0e, 0x0f);
+ m_ol_p123_tilemap->set_transmask(0, 0x0f, 0x01);
+ m_ol_p123_tilemap->set_transmask(1, 0x01, 0x0f);
+ m_ol_p0_tilemap->set_transmask(0, 0x0f, 0x0e);
+ m_ol_p0_tilemap->set_transmask(1, 0x0e, 0x0f);
+
+ m_tilemap_clip = machine().primary_screen->visible_area();
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect )
diff --git a/src/mame/video/portrait.c b/src/mame/video/portrait.c
index bf43e569aff..d175ec01e35 100644
--- a/src/mame/video/portrait.c
+++ b/src/mame/video/portrait.c
@@ -62,25 +62,24 @@ TILE_GET_INFO_MEMBER(portrait_state::get_fg_tile_info)
get_tile_info( machine(), tileinfo, tile_index, m_fgvideoram );
}
-VIDEO_START( portrait )
+void portrait_state::video_start()
{
- portrait_state *state = machine.driver_data<portrait_state>();
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(portrait_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32 );
- state->m_foreground = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(portrait_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32 );
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(portrait_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32 );
+ m_foreground = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(portrait_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32 );
- state->m_foreground->set_transparent_pen(7 );
+ m_foreground->set_transparent_pen(7 );
}
-PALETTE_INIT( portrait )
+void portrait_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- UINT8* lookup = machine.root_device().memregion("tileattr")->base();
+ UINT8* lookup = machine().root_device().memregion("tileattr")->base();
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x40);
+ machine().colortable = colortable_alloc(machine(), 0x40);
/*
for (i = 0;i < 0x40;i++)
@@ -93,7 +92,7 @@ PALETTE_INIT( portrait )
g = (data >> 3) & 0x3;
b = (data >> 5) & 0x7;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(pal3bit(r), pal2bit(g), pal3bit(b)));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(pal3bit(r), pal2bit(g), pal3bit(b)));
color_prom++;
}
@@ -108,10 +107,10 @@ PALETTE_INIT( portrait )
g = (data >> 5) & 0x1f;
b = (data >> 10) & 0x1f;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b)));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b)));
// ?? the lookup seems to reference 0x3f colours, unless 1 bit is priority or similar?
- colortable_palette_set_color(machine.colortable, i+0x20, MAKE_RGB(pal5bit(r>>1), pal5bit(g>>1), pal5bit(b>>1)));
+ colortable_palette_set_color(machine().colortable, i+0x20, MAKE_RGB(pal5bit(r>>1), pal5bit(g>>1), pal5bit(b>>1)));
color_prom++;
}
@@ -121,7 +120,7 @@ PALETTE_INIT( portrait )
for (i = 0;i < 0x800;i++)
{
UINT8 ctabentry = lookup[i]&0x3f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
diff --git a/src/mame/video/powerins.c b/src/mame/video/powerins.c
index d44b585b98c..b2dd54814d8 100644
--- a/src/mame/video/powerins.c
+++ b/src/mame/video/powerins.c
@@ -186,18 +186,17 @@ WRITE16_MEMBER(powerins_state::powerins_vram_1_w)
***************************************************************************/
-VIDEO_START( powerins )
+void powerins_state::video_start()
{
- powerins_state *state = machine.driver_data<powerins_state>();
- state->m_tilemap_0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(powerins_state::get_tile_info_0),state),tilemap_mapper_delegate(FUNC(powerins_state::powerins_get_memory_offset_0),state),16,16,DIM_NX_0, DIM_NY_0 );
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(powerins_state::get_tile_info_1),state),TILEMAP_SCAN_COLS,8,8,DIM_NX_1, DIM_NY_1 );
+ m_tilemap_0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(powerins_state::get_tile_info_0),this),tilemap_mapper_delegate(FUNC(powerins_state::powerins_get_memory_offset_0),this),16,16,DIM_NX_0, DIM_NY_0 );
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(powerins_state::get_tile_info_1),this),TILEMAP_SCAN_COLS,8,8,DIM_NX_1, DIM_NY_1 );
- state->m_tilemap_0->set_scroll_rows(1);
- state->m_tilemap_0->set_scroll_cols(1);
+ m_tilemap_0->set_scroll_rows(1);
+ m_tilemap_0->set_scroll_cols(1);
- state->m_tilemap_1->set_scroll_rows(1);
- state->m_tilemap_1->set_scroll_cols(1);
- state->m_tilemap_1->set_transparent_pen(15);
+ m_tilemap_1->set_scroll_rows(1);
+ m_tilemap_1->set_scroll_cols(1);
+ m_tilemap_1->set_transparent_pen(15);
}
diff --git a/src/mame/video/prehisle.c b/src/mame/video/prehisle.c
index b0d1a772cef..e07945ebf67 100644
--- a/src/mame/video/prehisle.c
+++ b/src/mame/video/prehisle.c
@@ -89,24 +89,23 @@ TILE_GET_INFO_MEMBER(prehisle_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( prehisle )
+void prehisle_state::video_start()
{
- prehisle_state *state = machine.driver_data<prehisle_state>();
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(prehisle_state::get_bg2_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(prehisle_state::get_bg2_tile_info),this), TILEMAP_SCAN_COLS,
16, 16, 1024, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(prehisle_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(prehisle_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
16, 16, 256, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(prehisle_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(prehisle_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(15);
- state->m_fg_tilemap->set_transparent_pen(15);
+ m_bg_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
/* register for saving */
- state->save_item(NAME(state->m_invert_controls));
+ save_item(NAME(m_invert_controls));
}
/* sprite layout
diff --git a/src/mame/video/psikyo.c b/src/mame/video/psikyo.c
index e5db59d9d2b..a6d9038dd98 100644
--- a/src/mame/video/psikyo.c
+++ b/src/mame/video/psikyo.c
@@ -157,60 +157,59 @@ void psikyo_switch_banks( running_machine &machine, int tmap, int bank )
}
-VIDEO_START( psikyo )
+VIDEO_START_MEMBER(psikyo_state,psikyo)
{
- psikyo_state *state = machine.driver_data<psikyo_state>();
/* The Hardware is Capable of Changing the Dimensions of the Tilemaps, its safer to create
the various sized tilemaps now as opposed to later */
- state->m_tilemap_0_size0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 16, 16, 0x20, 0x80);
- state->m_tilemap_0_size1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x40);
- state->m_tilemap_0_size2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 16, 16, 0x80, 0x20);
- state->m_tilemap_0_size3 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 16, 16, 0x100, 0x10);
+ m_tilemap_0_size0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 16, 16, 0x20, 0x80);
+ m_tilemap_0_size1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x40);
+ m_tilemap_0_size2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 16, 16, 0x80, 0x20);
+ m_tilemap_0_size3 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 16, 16, 0x100, 0x10);
- state->m_tilemap_1_size0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS, 16, 16, 0x20, 0x80);
- state->m_tilemap_1_size1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x40);
- state->m_tilemap_1_size2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS, 16, 16, 0x80, 0x20);
- state->m_tilemap_1_size3 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS, 16, 16, 0x100, 0x10);
+ m_tilemap_1_size0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 16, 16, 0x20, 0x80);
+ m_tilemap_1_size1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x40);
+ m_tilemap_1_size2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 16, 16, 0x80, 0x20);
+ m_tilemap_1_size3 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 16, 16, 0x100, 0x10);
- state->m_spritebuf1 = auto_alloc_array(machine, UINT32, 0x2000 / 4);
- state->m_spritebuf2 = auto_alloc_array(machine, UINT32, 0x2000 / 4);
+ m_spritebuf1 = auto_alloc_array(machine(), UINT32, 0x2000 / 4);
+ m_spritebuf2 = auto_alloc_array(machine(), UINT32, 0x2000 / 4);
- state->m_tilemap_0_size0->set_scroll_rows(0x80 * 16); // line scrolling
- state->m_tilemap_0_size0->set_scroll_cols(1);
+ m_tilemap_0_size0->set_scroll_rows(0x80 * 16); // line scrolling
+ m_tilemap_0_size0->set_scroll_cols(1);
- state->m_tilemap_0_size1->set_scroll_rows(0x40 * 16); // line scrolling
- state->m_tilemap_0_size1->set_scroll_cols(1);
+ m_tilemap_0_size1->set_scroll_rows(0x40 * 16); // line scrolling
+ m_tilemap_0_size1->set_scroll_cols(1);
- state->m_tilemap_0_size2->set_scroll_rows(0x20 * 16); // line scrolling
- state->m_tilemap_0_size2->set_scroll_cols(1);
+ m_tilemap_0_size2->set_scroll_rows(0x20 * 16); // line scrolling
+ m_tilemap_0_size2->set_scroll_cols(1);
- state->m_tilemap_0_size3->set_scroll_rows(0x10 * 16); // line scrolling
- state->m_tilemap_0_size3->set_scroll_cols(1);
+ m_tilemap_0_size3->set_scroll_rows(0x10 * 16); // line scrolling
+ m_tilemap_0_size3->set_scroll_cols(1);
- state->m_tilemap_1_size0->set_scroll_rows(0x80 * 16); // line scrolling
- state->m_tilemap_1_size0->set_scroll_cols(1);
+ m_tilemap_1_size0->set_scroll_rows(0x80 * 16); // line scrolling
+ m_tilemap_1_size0->set_scroll_cols(1);
- state->m_tilemap_1_size1->set_scroll_rows(0x40 * 16); // line scrolling
- state->m_tilemap_1_size1->set_scroll_cols(1);
+ m_tilemap_1_size1->set_scroll_rows(0x40 * 16); // line scrolling
+ m_tilemap_1_size1->set_scroll_cols(1);
- state->m_tilemap_1_size2->set_scroll_rows(0x20 * 16); // line scrolling
- state->m_tilemap_1_size2->set_scroll_cols(1);
+ m_tilemap_1_size2->set_scroll_rows(0x20 * 16); // line scrolling
+ m_tilemap_1_size2->set_scroll_cols(1);
- state->m_tilemap_1_size3->set_scroll_rows(0x10 * 16); // line scrolling
- state->m_tilemap_1_size3->set_scroll_cols(1);
+ m_tilemap_1_size3->set_scroll_rows(0x10 * 16); // line scrolling
+ m_tilemap_1_size3->set_scroll_cols(1);
- state->save_pointer(NAME(state->m_spritebuf1), 0x2000 / 4);
- state->save_pointer(NAME(state->m_spritebuf2), 0x2000 / 4);
+ save_pointer(NAME(m_spritebuf1), 0x2000 / 4);
+ save_pointer(NAME(m_spritebuf2), 0x2000 / 4);
}
-VIDEO_START( sngkace )
+VIDEO_START_MEMBER(psikyo_state,sngkace)
{
- VIDEO_START_CALL( psikyo );
+ VIDEO_START_CALL_MEMBER( psikyo );
- psikyo_switch_banks(machine, 0, 0); // sngkace / samuraia don't use banking
- psikyo_switch_banks(machine, 1, 1); // They share "gfx2" to save memory on other boards
+ psikyo_switch_banks(machine(), 0, 0); // sngkace / samuraia don't use banking
+ psikyo_switch_banks(machine(), 1, 1); // They share "gfx2" to save memory on other boards
}
diff --git a/src/mame/video/psikyo4.c b/src/mame/video/psikyo4.c
index 7d0c156015b..3e4c13ff1bd 100644
--- a/src/mame/video/psikyo4.c
+++ b/src/mame/video/psikyo4.c
@@ -141,7 +141,7 @@ SCREEN_UPDATE_IND16( psikyo4_right )
return 0;
}
-VIDEO_START( psikyo4 )
+void psikyo4_state::video_start()
{
- machine.gfx[0]->set_granularity(32); /* 256 colour sprites with palette selectable on 32 colour boundaries */
+ machine().gfx[0]->set_granularity(32); /* 256 colour sprites with palette selectable on 32 colour boundaries */
}
diff --git a/src/mame/video/psikyosh.c b/src/mame/video/psikyosh.c
index 6529d9e510b..550157969c6 100644
--- a/src/mame/video/psikyosh.c
+++ b/src/mame/video/psikyosh.c
@@ -1219,17 +1219,16 @@ static void psikyosh_postlineblend( running_machine &machine, bitmap_rgb32 &bitm
}
-VIDEO_START( psikyosh )
+void psikyosh_state::video_start()
{
- psikyosh_state *state = machine.driver_data<psikyosh_state>();
- UINT8 *alphatable = state->m_alphatable;
+ UINT8 *alphatable = m_alphatable;
- machine.primary_screen->register_screen_bitmap(state->m_z_bitmap); /* z-buffer */
- state->m_zoom_bitmap.allocate(16*16, 16*16); /* temp buffer for assembling sprites */
- state->m_bg_bitmap.allocate(32*16, 32*16); /* temp buffer for assembling tilemaps */
- state->m_bg_zoom = auto_alloc_array(machine, UINT16, 256);
+ machine().primary_screen->register_screen_bitmap(m_z_bitmap); /* z-buffer */
+ m_zoom_bitmap.allocate(16*16, 16*16); /* temp buffer for assembling sprites */
+ m_bg_bitmap.allocate(32*16, 32*16); /* temp buffer for assembling tilemaps */
+ m_bg_zoom = auto_alloc_array(machine(), UINT16, 256);
- machine.gfx[1]->set_granularity(16); /* 256 colour sprites with palette selectable on 16 colour boundaries */
+ machine().gfx[1]->set_granularity(16); /* 256 colour sprites with palette selectable on 16 colour boundaries */
/* Pens 0xc0-0xff have a gradient of alpha values associated with them */
int i;
@@ -1245,13 +1244,13 @@ VIDEO_START( psikyosh )
/* precompute the background zoom table. verified against hardware.
unsure of the precision, we use .10 fixed point like the sprites */
for(i = 0; i < 0x100; i++) {
- state->m_bg_zoom[i] = (64 * 0x400) / (i + 64);
+ m_bg_zoom[i] = (64 * 0x400) / (i + 64);
}
- state->save_item(NAME(state->m_z_bitmap));
- state->save_item(NAME(state->m_zoom_bitmap));
- state->save_item(NAME(state->m_bg_bitmap));
- state->save_pointer(NAME(state->m_bg_zoom), 256);
+ save_item(NAME(m_z_bitmap));
+ save_item(NAME(m_zoom_bitmap));
+ save_item(NAME(m_bg_bitmap));
+ save_pointer(NAME(m_bg_zoom), 256);
}
diff --git a/src/mame/video/psychic5.c b/src/mame/video/psychic5.c
index e4d979a02b0..ca5bc859aa6 100644
--- a/src/mame/video/psychic5.c
+++ b/src/mame/video/psychic5.c
@@ -225,74 +225,70 @@ TILE_GET_INFO_MEMBER(psychic5_state::get_fg_tile_info)
Initialize and destroy video hardware emulation
***************************************************************************/
-VIDEO_START( psychic5 )
+VIDEO_START_MEMBER(psychic5_state,psychic5)
{
- psychic5_state *state = machine.driver_data<psychic5_state>();
/* info offset w h col row */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psychic5_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psychic5_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psychic5_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 64, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psychic5_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
- state->m_ps5_pagedram[0] = auto_alloc_array(machine, UINT8, 0x2000);
- state->m_ps5_pagedram[1] = auto_alloc_array(machine, UINT8, 0x2000);
+ m_ps5_pagedram[0] = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_ps5_pagedram[1] = auto_alloc_array(machine(), UINT8, 0x2000);
- state->m_bg_videoram = &state->m_ps5_pagedram[0][0x0000];
- state->m_ps5_dummy_bg_ram = &state->m_ps5_pagedram[0][0x1000];
- state->m_ps5_io_ram = &state->m_ps5_pagedram[1][0x0000];
- state->m_ps5_palette_ram = &state->m_ps5_pagedram[1][0x0400];
- state->m_fg_videoram = &state->m_ps5_pagedram[1][0x1000];
+ m_bg_videoram = &m_ps5_pagedram[0][0x0000];
+ m_ps5_dummy_bg_ram = &m_ps5_pagedram[0][0x1000];
+ m_ps5_io_ram = &m_ps5_pagedram[1][0x0000];
+ m_ps5_palette_ram = &m_ps5_pagedram[1][0x0400];
+ m_fg_videoram = &m_ps5_pagedram[1][0x1000];
- jal_blend_init(machine, 1);
+ jal_blend_init(machine(), 1);
- state->m_bg_palette_ram_base = 0x400;
- state->m_bg_palette_base = 0x100;
+ m_bg_palette_ram_base = 0x400;
+ m_bg_palette_base = 0x100;
}
-VIDEO_START( bombsa )
+VIDEO_START_MEMBER(psychic5_state,bombsa)
{
- psychic5_state *state = machine.driver_data<psychic5_state>();
/* info offset w h col row */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psychic5_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 128, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(psychic5_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psychic5_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(psychic5_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
- state->m_ps5_pagedram[0] = auto_alloc_array(machine, UINT8, 0x2000);
- state->m_ps5_pagedram[1] = auto_alloc_array(machine, UINT8, 0x2000);
+ m_ps5_pagedram[0] = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_ps5_pagedram[1] = auto_alloc_array(machine(), UINT8, 0x2000);
- state->m_bg_videoram = &state->m_ps5_pagedram[0][0x0000];
- state->m_ps5_dummy_bg_ram = &state->m_ps5_pagedram[0][0x1000];
- state->m_ps5_io_ram = &state->m_ps5_pagedram[1][0x0000];
- state->m_fg_videoram = &state->m_ps5_pagedram[1][0x0800];
- state->m_ps5_palette_ram = &state->m_ps5_pagedram[1][0x1000];
+ m_bg_videoram = &m_ps5_pagedram[0][0x0000];
+ m_ps5_dummy_bg_ram = &m_ps5_pagedram[0][0x1000];
+ m_ps5_io_ram = &m_ps5_pagedram[1][0x0000];
+ m_fg_videoram = &m_ps5_pagedram[1][0x0800];
+ m_ps5_palette_ram = &m_ps5_pagedram[1][0x1000];
- jal_blend_init(machine, 0);
+ jal_blend_init(machine(), 0);
- state->m_bg_palette_ram_base = 0x000;
- state->m_bg_palette_base = 0x000;
+ m_bg_palette_ram_base = 0x000;
+ m_bg_palette_base = 0x000;
}
-VIDEO_RESET( psychic5 )
+VIDEO_RESET_MEMBER(psychic5_state,psychic5)
{
- psychic5_state *state = machine.driver_data<psychic5_state>();
- state->m_bg_clip_mode = 0;
- state->m_ps5_vram_page = 0;
- state->m_bg_status = 0;
- memset(state->m_ps5_pagedram[0],0,0x2000);
- memset(state->m_ps5_pagedram[1],0,0x2000);
- state->m_palette_intensity = 0;
+ m_bg_clip_mode = 0;
+ m_ps5_vram_page = 0;
+ m_bg_status = 0;
+ memset(m_ps5_pagedram[0],0,0x2000);
+ memset(m_ps5_pagedram[1],0,0x2000);
+ m_palette_intensity = 0;
}
-VIDEO_RESET( bombsa )
+VIDEO_RESET_MEMBER(psychic5_state,bombsa)
{
- psychic5_state *state = machine.driver_data<psychic5_state>();
- state->m_ps5_vram_page = 0;
- state->m_bg_status = 0;
- state->m_title_screen = 0;
- memset(state->m_ps5_pagedram[0],0,0x2000);
- memset(state->m_ps5_pagedram[1],0,0x2000);
- state->m_palette_intensity = 0;
+ m_ps5_vram_page = 0;
+ m_bg_status = 0;
+ m_title_screen = 0;
+ memset(m_ps5_pagedram[0],0,0x2000);
+ memset(m_ps5_pagedram[1],0,0x2000);
+ m_palette_intensity = 0;
}
diff --git a/src/mame/video/punchout.c b/src/mame/video/punchout.c
index b9ff09dbd25..8a5ee38882b 100644
--- a/src/mame/video/punchout.c
+++ b/src/mame/video/punchout.c
@@ -119,38 +119,36 @@ TILEMAP_MAPPER_MEMBER(punchout_state::armwrest_bs1_scan_flipx)
}
-VIDEO_START( punchout )
+void punchout_state::video_start()
{
- punchout_state *state = machine.driver_data<punchout_state>();
- state->m_bg_top_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::top_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32);
- state->m_bg_bot_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bot_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_bg_bot_tilemap->set_scroll_rows(32);
+ m_bg_top_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::top_get_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
+ m_bg_bot_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bot_get_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_bg_bot_tilemap->set_scroll_rows(32);
- state->m_spr1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs1_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 16,32);
- state->m_spr2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs2_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 16,32);
+ m_spr1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs1_get_info),this), TILEMAP_SCAN_ROWS, 8,8, 16,32);
+ m_spr2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs2_get_info),this), TILEMAP_SCAN_ROWS, 8,8, 16,32);
- state->m_fg_tilemap = NULL;
+ m_fg_tilemap = NULL;
- state->m_spr1_tilemap->set_transparent_pen(0x07);
- state->m_spr2_tilemap->set_transparent_pen(0x03);
+ m_spr1_tilemap->set_transparent_pen(0x07);
+ m_spr2_tilemap->set_transparent_pen(0x03);
}
-VIDEO_START( armwrest )
+VIDEO_START_MEMBER(punchout_state,armwrest)
{
- punchout_state *state = machine.driver_data<punchout_state>();
- state->m_bg_top_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::armwrest_top_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32);
- state->m_bg_bot_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::armwrest_bot_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32);
-
- state->m_spr1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs1_get_info),state), tilemap_mapper_delegate(FUNC(punchout_state::armwrest_bs1_scan),state), 8,8, 32,16);
- state->m_spr1_tilemap_flipx = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs1_get_info),state), tilemap_mapper_delegate(FUNC(punchout_state::armwrest_bs1_scan_flipx),state), 8,8, 32,16);
- state->m_spr2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs2_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 16,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::armwrest_fg_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32);
-
- state->m_spr1_tilemap->set_transparent_pen(0x07);
- state->m_spr1_tilemap_flipx->set_transparent_pen(0x07);
- state->m_spr2_tilemap->set_transparent_pen(0x03);
- state->m_fg_tilemap->set_transparent_pen(0x07);
+ m_bg_top_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::armwrest_top_get_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
+ m_bg_bot_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::armwrest_bot_get_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
+
+ m_spr1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs1_get_info),this), tilemap_mapper_delegate(FUNC(punchout_state::armwrest_bs1_scan),this), 8,8, 32,16);
+ m_spr1_tilemap_flipx = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs1_get_info),this), tilemap_mapper_delegate(FUNC(punchout_state::armwrest_bs1_scan_flipx),this), 8,8, 32,16);
+ m_spr2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs2_get_info),this), TILEMAP_SCAN_ROWS, 8,8, 16,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::armwrest_fg_get_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
+
+ m_spr1_tilemap->set_transparent_pen(0x07);
+ m_spr1_tilemap_flipx->set_transparent_pen(0x07);
+ m_spr2_tilemap->set_transparent_pen(0x03);
+ m_fg_tilemap->set_transparent_pen(0x07);
}
diff --git a/src/mame/video/pushman.c b/src/mame/video/pushman.c
index da491d34912..a94da84f119 100644
--- a/src/mame/video/pushman.c
+++ b/src/mame/video/pushman.c
@@ -45,14 +45,13 @@ TILE_GET_INFO_MEMBER(pushman_state::get_text_tile_info)
***************************************************************************/
-VIDEO_START( pushman )
+void pushman_state::video_start()
{
- pushman_state *state = machine.driver_data<pushman_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pushman_state::get_back_tile_info),state), tilemap_mapper_delegate(FUNC(pushman_state::background_scan_rows),state), 32, 32, 128, 64);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pushman_state::get_text_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pushman_state::get_back_tile_info),this), tilemap_mapper_delegate(FUNC(pushman_state::background_scan_rows),this), 32, 32, 128, 64);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pushman_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(3);
+ m_tx_tilemap->set_transparent_pen(3);
}
diff --git a/src/mame/video/qdrmfgp.c b/src/mame/video/qdrmfgp.c
index 6ff2a75f065..9325f59007d 100644
--- a/src/mame/video/qdrmfgp.c
+++ b/src/mame/video/qdrmfgp.c
@@ -27,9 +27,9 @@ void qdrmfgp2_tile_callback(running_machine &machine, int layer, int *code, int
***************************************************************************/
-VIDEO_START( qdrmfgp )
+VIDEO_START_MEMBER(qdrmfgp_state,qdrmfgp)
{
- device_t *k056832 = machine.device("k056832");
+ device_t *k056832 = machine().device("k056832");
k056832_set_layer_association(k056832, 0);
@@ -39,9 +39,9 @@ VIDEO_START( qdrmfgp )
k056832_set_layer_offs(k056832, 3, 8, 0);
}
-VIDEO_START( qdrmfgp2 )
+VIDEO_START_MEMBER(qdrmfgp_state,qdrmfgp2)
{
- device_t *k056832 = machine.device("k056832");
+ device_t *k056832 = machine().device("k056832");
k056832_set_layer_association(k056832, 0);
diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c
index 3579e6dc519..0c62bc00129 100644
--- a/src/mame/video/qix.c
+++ b/src/mame/video/qix.c
@@ -41,17 +41,16 @@ static WRITE_LINE_DEVICE_HANDLER( display_enable_changed );
*
*************************************/
-static VIDEO_START( qix )
+VIDEO_START_MEMBER(qix_state,qix)
{
- qix_state *state = machine.driver_data<qix_state>();
/* allocate memory for the full video RAM */
- state->m_videoram.allocate(256 * 256);
+ m_videoram.allocate(256 * 256);
/* set up save states */
- state->save_item(NAME(state->m_flip));
- state->save_item(NAME(state->m_palette_bank));
- state->save_item(NAME(state->m_leds));
+ save_item(NAME(m_flip));
+ save_item(NAME(m_palette_bank));
+ save_item(NAME(m_leds));
}
@@ -422,7 +421,7 @@ MACHINE_CONFIG_FRAGMENT( qix_video )
MCFG_CPU_PROGRAM_MAP(qix_video_map)
MCFG_CPU_CONFIG(encryption_config) // for kram3
- MCFG_VIDEO_START(qix)
+ MCFG_VIDEO_START_OVERRIDE(qix_state,qix)
MCFG_MC6845_ADD(MC6845_TAG, MC6845, QIX_CHARACTER_CLOCK, mc6845_intf)
diff --git a/src/mame/video/quasar.c b/src/mame/video/quasar.c
index ceb992adcef..e6d99a4b225 100644
--- a/src/mame/video/quasar.c
+++ b/src/mame/video/quasar.c
@@ -19,19 +19,19 @@
#include "cpu/s2650/s2650.h"
#include "includes/quasar.h"
-PALETTE_INIT( quasar )
+PALETTE_INIT_MEMBER(quasar_state,quasar)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x500);
+ machine().colortable = colortable_alloc(machine(), 0x500);
/* standard 1 bit per color palette (background and sprites) */
for (i = 0; i < 8; i++)
{
rgb_t color = MAKE_RGB(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
- colortable_palette_set_color(machine.colortable, i, color);
+ colortable_palette_set_color(machine().colortable, i, color);
}
/* effects color map */
@@ -59,49 +59,48 @@ PALETTE_INIT( quasar )
b = 0x4f * bit0 + 0xa8 * bit1;
/* intensity 0 */
- colortable_palette_set_color(machine.colortable, 0x100 + i, RGB_BLACK);
+ colortable_palette_set_color(machine().colortable, 0x100 + i, RGB_BLACK);
/* intensity 1 */
color = MAKE_RGB(r >> 2, g >> 2, b >> 2);
- colortable_palette_set_color(machine.colortable, 0x200 + i, color);
+ colortable_palette_set_color(machine().colortable, 0x200 + i, color);
/* intensity 2 */
color = MAKE_RGB((r >> 2) + (r >> 3), (g >> 2) + (g >> 3), (b >> 2) + (b >> 2));
- colortable_palette_set_color(machine.colortable, 0x300 + i, color);
+ colortable_palette_set_color(machine().colortable, 0x300 + i, color);
/* intensity 3 */
color = MAKE_RGB(r >> 1, g >> 1, b >> 1);
- colortable_palette_set_color(machine.colortable, 0x400 + i, color);
+ colortable_palette_set_color(machine().colortable, 0x400 + i, color);
}
// Address 0-2 from graphic rom
// 3-5 from color ram
// 6-8 from sprite chips (Used for priority)
for (i = 0; i < 0x200; i++)
- colortable_entry_set_value(machine.colortable, i, color_prom[i] & 0x07);
+ colortable_entry_set_value(machine().colortable, i, color_prom[i] & 0x07);
/* background for collision */
for (i = 1; i < 8; i++)
- colortable_entry_set_value(machine.colortable, 0x200 + i, 7);
- colortable_entry_set_value(machine.colortable, 0x200, 0);
+ colortable_entry_set_value(machine().colortable, 0x200 + i, 7);
+ colortable_entry_set_value(machine().colortable, 0x200, 0);
/* effects */
for (i = 0; i < 0x400; i++)
- colortable_entry_set_value(machine.colortable, 0x208 + i, 0x100 + i);
+ colortable_entry_set_value(machine().colortable, 0x208 + i, 0x100 + i);
}
-VIDEO_START( quasar )
+VIDEO_START_MEMBER(quasar_state,quasar)
{
- quasar_state *state = machine.driver_data<quasar_state>();
- state->m_effectram = auto_alloc_array(machine, UINT8, 0x400);
+ m_effectram = auto_alloc_array(machine(), UINT8, 0x400);
/* create helper bitmap */
- machine.primary_screen->register_screen_bitmap(state->m_collision_background);
+ machine().primary_screen->register_screen_bitmap(m_collision_background);
/* register save */
- state->save_item(NAME(state->m_collision_background));
- state->save_pointer(NAME(state->m_effectram), 0x400);
+ save_item(NAME(m_collision_background));
+ save_pointer(NAME(m_effectram), 0x400);
}
SCREEN_UPDATE_IND16( quasar )
diff --git a/src/mame/video/quizdna.c b/src/mame/video/quizdna.c
index 9ac8a52de7d..08d7a88839b 100644
--- a/src/mame/video/quizdna.c
+++ b/src/mame/video/quizdna.c
@@ -44,21 +44,20 @@ TILE_GET_INFO_MEMBER(quizdna_state::get_fg_tile_info)
}
-VIDEO_START( quizdna )
+void quizdna_state::video_start()
{
- quizdna_state *state = machine.driver_data<quizdna_state>();
- state->m_flipscreen = -1;
- state->m_video_enable = 0;
- state->m_bg_xscroll[0] = 0;
- state->m_bg_xscroll[1] = 0;
+ m_flipscreen = -1;
+ m_video_enable = 0;
+ m_bg_xscroll[0] = 0;
+ m_bg_xscroll[1] = 0;
- state->m_bg_ram = auto_alloc_array(machine, UINT8, 0x2000);
- state->m_fg_ram = auto_alloc_array(machine, UINT8, 0x1000);
+ m_bg_ram = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_fg_ram = auto_alloc_array(machine(), UINT8, 0x1000);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(quizdna_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32 );
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(quizdna_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,16,8,32,32 );
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(quizdna_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32 );
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(quizdna_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,16,8,32,32 );
- state->m_fg_tilemap->set_transparent_pen(0 );
+ m_fg_tilemap->set_transparent_pen(0 );
}
WRITE8_MEMBER(quizdna_state::quizdna_bg_ram_w)
diff --git a/src/mame/video/quizpani.c b/src/mame/video/quizpani.c
index e021daba0bd..15b6640efca 100644
--- a/src/mame/video/quizpani.c
+++ b/src/mame/video/quizpani.c
@@ -66,12 +66,11 @@ WRITE16_MEMBER(quizpani_state::quizpani_tilesbank_w)
}
}
-VIDEO_START( quizpani )
+void quizpani_state::video_start()
{
- quizpani_state *state = machine.driver_data<quizpani_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(quizpani_state::bg_tile_info),state), tilemap_mapper_delegate(FUNC(quizpani_state::bg_scan),state),16,16,256,32);
- state->m_txt_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(quizpani_state::txt_tile_info),state),tilemap_mapper_delegate(FUNC(quizpani_state::bg_scan),state),16,16,256,32);
- state->m_txt_tilemap->set_transparent_pen(15);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(quizpani_state::bg_tile_info),this), tilemap_mapper_delegate(FUNC(quizpani_state::bg_scan),this),16,16,256,32);
+ m_txt_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(quizpani_state::txt_tile_info),this),tilemap_mapper_delegate(FUNC(quizpani_state::bg_scan),this),16,16,256,32);
+ m_txt_tilemap->set_transparent_pen(15);
}
SCREEN_UPDATE_IND16( quizpani )
diff --git a/src/mame/video/raiden.c b/src/mame/video/raiden.c
index 1a8d29a8542..faaa255e890 100644
--- a/src/mame/video/raiden.c
+++ b/src/mame/video/raiden.c
@@ -65,28 +65,26 @@ TILE_GET_INFO_MEMBER(raiden_state::get_text_tile_info)
0);
}
-VIDEO_START( raiden )
+void raiden_state::video_start()
{
- raiden_state *state = machine.driver_data<raiden_state>();
- state->m_bg_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_back_tile_info),state),TILEMAP_SCAN_COLS, 16,16,32,32);
- state->m_fg_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_fore_tile_info),state),TILEMAP_SCAN_COLS,16,16,32,32);
- state->m_tx_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_text_tile_info),state),TILEMAP_SCAN_COLS,8,8,32,32);
- state->m_alternate=0;
+ m_bg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_back_tile_info),this),TILEMAP_SCAN_COLS, 16,16,32,32);
+ m_fg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_fore_tile_info),this),TILEMAP_SCAN_COLS,16,16,32,32);
+ m_tx_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_text_tile_info),this),TILEMAP_SCAN_COLS,8,8,32,32);
+ m_alternate=0;
- state->m_fg_layer->set_transparent_pen(15);
- state->m_tx_layer->set_transparent_pen(15);
+ m_fg_layer->set_transparent_pen(15);
+ m_tx_layer->set_transparent_pen(15);
}
-VIDEO_START( raidena )
+VIDEO_START_MEMBER(raiden_state,raidena)
{
- raiden_state *state = machine.driver_data<raiden_state>();
- state->m_bg_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_back_tile_info),state),TILEMAP_SCAN_COLS, 16,16,32,32);
- state->m_fg_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_fore_tile_info),state),TILEMAP_SCAN_COLS,16,16,32,32);
- state->m_tx_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_text_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_alternate=1;
+ m_bg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_back_tile_info),this),TILEMAP_SCAN_COLS, 16,16,32,32);
+ m_fg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_fore_tile_info),this),TILEMAP_SCAN_COLS,16,16,32,32);
+ m_tx_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_alternate=1;
- state->m_fg_layer->set_transparent_pen(15);
- state->m_tx_layer->set_transparent_pen(15);
+ m_fg_layer->set_transparent_pen(15);
+ m_tx_layer->set_transparent_pen(15);
}
WRITE16_MEMBER(raiden_state::raiden_control_w)
diff --git a/src/mame/video/rainbow.c b/src/mame/video/rainbow.c
index 1212ccac42d..05fdb30fb31 100644
--- a/src/mame/video/rainbow.c
+++ b/src/mame/video/rainbow.c
@@ -70,18 +70,17 @@ the Y settings are active low.
*/
-VIDEO_START( jumping )
+VIDEO_START_MEMBER(rbisland_state,jumping)
{
- rbisland_state *state = machine.driver_data<rbisland_state>();
- pc080sn_set_trans_pen(state->m_pc080sn, 1, 15);
+ pc080sn_set_trans_pen(m_pc080sn, 1, 15);
- state->m_sprite_ctrl = 0;
- state->m_sprites_flipscreen = 0;
+ m_sprite_ctrl = 0;
+ m_sprites_flipscreen = 0;
/* not 100% sure Jumping needs to save both... */
- state->save_item(NAME(state->m_sprite_ctrl));
- state->save_item(NAME(state->m_sprites_flipscreen));
+ save_item(NAME(m_sprite_ctrl));
+ save_item(NAME(m_sprites_flipscreen));
}
diff --git a/src/mame/video/rallyx.c b/src/mame/video/rallyx.c
index 07f9e525e7d..9905b9f7287 100644
--- a/src/mame/video/rallyx.c
+++ b/src/mame/video/rallyx.c
@@ -55,9 +55,9 @@ needs more color combination to render its graphics.
***************************************************************************/
-PALETTE_INIT( rallyx )
+PALETTE_INIT_MEMBER(rallyx_state,rallyx)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -70,7 +70,7 @@ PALETTE_INIT( rallyx )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -95,7 +95,7 @@ PALETTE_INIT( rallyx )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -105,18 +105,18 @@ PALETTE_INIT( rallyx )
for (i = 0x000; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* bullets use colors 0x10-0x13 */
for (i = 0x100; i < 0x104; i++)
- colortable_entry_set_value(machine.colortable, i, (i - 0x100) | 0x10);
+ colortable_entry_set_value(machine().colortable, i, (i - 0x100) | 0x10);
}
-PALETTE_INIT( jungler )
+PALETTE_INIT_MEMBER(rallyx_state,jungler)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
static const int resistances_star[3] = { 150, 100 };
@@ -136,7 +136,7 @@ PALETTE_INIT( jungler )
2, resistances_b, bweights, 1000, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x60);
+ machine().colortable = colortable_alloc(machine(), 0x60);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -161,7 +161,7 @@ PALETTE_INIT( jungler )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* star pens */
@@ -185,7 +185,7 @@ PALETTE_INIT( jungler )
bit1 = ((i - 0x20) >> 5) & 0x01;
b = combine_2_weights(bweights_star, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -195,16 +195,16 @@ PALETTE_INIT( jungler )
for (i = 0x000; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* bullets use colors 0x10-0x13 */
for (i = 0x100; i < 0x104; i++)
- colortable_entry_set_value(machine.colortable, i, (i - 0x100) | 0x10);
+ colortable_entry_set_value(machine().colortable, i, (i - 0x100) | 0x10);
/* stars */
for (i = 0x104; i < 0x144; i++)
- colortable_entry_set_value(machine.colortable, i, (i - 0x104) + 0x20);
+ colortable_entry_set_value(machine().colortable, i, (i - 0x104) + 0x20);
}
@@ -339,76 +339,72 @@ static void rallyx_video_start_common( running_machine &machine )
state->m_drawmode_table[3] = DRAWMODE_NONE;
}
-VIDEO_START( rallyx )
+VIDEO_START_MEMBER(rallyx_state,rallyx)
{
- rallyx_state *state = machine.driver_data<rallyx_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::rallyx_bg_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::rallyx_fg_get_tile_info),state), tilemap_mapper_delegate(FUNC(rallyx_state::fg_tilemap_scan),state), 8, 8, 8, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::rallyx_bg_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::rallyx_fg_get_tile_info),this), tilemap_mapper_delegate(FUNC(rallyx_state::fg_tilemap_scan),this), 8, 8, 8, 32);
/* the scrolling tilemap is slightly misplaced in Rally X */
- state->m_bg_tilemap->set_scrolldx(3, 3);
+ m_bg_tilemap->set_scrolldx(3, 3);
- state->m_spriteram_base = 0x14;
+ m_spriteram_base = 0x14;
- rallyx_video_start_common(machine);
+ rallyx_video_start_common(machine());
}
-VIDEO_START( jungler )
+VIDEO_START_MEMBER(rallyx_state,jungler)
{
- rallyx_state *state = machine.driver_data<rallyx_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::rallyx_bg_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::rallyx_fg_get_tile_info),state), tilemap_mapper_delegate(FUNC(rallyx_state::fg_tilemap_scan),state), 8, 8, 8, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::rallyx_bg_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::rallyx_fg_get_tile_info),this), tilemap_mapper_delegate(FUNC(rallyx_state::fg_tilemap_scan),this), 8, 8, 8, 32);
- state->m_spriteram_base = 0x14;
+ m_spriteram_base = 0x14;
- rallyx_video_start_common(machine);
- calculate_star_field(machine);
+ rallyx_video_start_common(machine());
+ calculate_star_field(machine());
}
-VIDEO_START( locomotn )
+VIDEO_START_MEMBER(rallyx_state,locomotn)
{
- rallyx_state *state = machine.driver_data<rallyx_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::locomotn_bg_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::locomotn_fg_get_tile_info),state), tilemap_mapper_delegate(FUNC(rallyx_state::fg_tilemap_scan),state), 8, 8, 8, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::locomotn_bg_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::locomotn_fg_get_tile_info),this), tilemap_mapper_delegate(FUNC(rallyx_state::fg_tilemap_scan),this), 8, 8, 8, 32);
/* handle reduced visible area in some games */
- if (machine.primary_screen->visible_area().max_x == 32 * 8 - 1)
+ if (machine().primary_screen->visible_area().max_x == 32 * 8 - 1)
{
- state->m_bg_tilemap->set_scrolldx(0, 32);
- state->m_fg_tilemap->set_scrolldx(0, 32);
+ m_bg_tilemap->set_scrolldx(0, 32);
+ m_fg_tilemap->set_scrolldx(0, 32);
}
- state->m_spriteram_base = 0x14;
+ m_spriteram_base = 0x14;
- rallyx_video_start_common(machine);
- calculate_star_field(machine);
+ rallyx_video_start_common(machine());
+ calculate_star_field(machine());
}
-VIDEO_START( commsega )
+VIDEO_START_MEMBER(rallyx_state,commsega)
{
- rallyx_state *state = machine.driver_data<rallyx_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::locomotn_bg_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::locomotn_fg_get_tile_info),state), tilemap_mapper_delegate(FUNC(rallyx_state::fg_tilemap_scan),state), 8, 8, 8, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::locomotn_bg_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rallyx_state::locomotn_fg_get_tile_info),this), tilemap_mapper_delegate(FUNC(rallyx_state::fg_tilemap_scan),this), 8, 8, 8, 32);
/* handle reduced visible area in some games */
- if (machine.primary_screen->visible_area().max_x == 32 * 8 - 1)
+ if (machine().primary_screen->visible_area().max_x == 32 * 8 - 1)
{
- state->m_bg_tilemap->set_scrolldx(0, 32);
- state->m_fg_tilemap->set_scrolldx(0, 32);
+ m_bg_tilemap->set_scrolldx(0, 32);
+ m_fg_tilemap->set_scrolldx(0, 32);
}
/* commsega has more sprites and bullets than the other games */
- state->m_spriteram_base = 0x00;
+ m_spriteram_base = 0x00;
- rallyx_video_start_common(machine);
- calculate_star_field(machine);
+ rallyx_video_start_common(machine());
+ calculate_star_field(machine());
}
diff --git a/src/mame/video/rampart.c b/src/mame/video/rampart.c
index 5b9de153fd8..ba48f956917 100644
--- a/src/mame/video/rampart.c
+++ b/src/mame/video/rampart.c
@@ -18,7 +18,7 @@ static void rampart_bitmap_render(running_machine &machine, bitmap_ind16 &bitmap
*
*************************************/
-VIDEO_START( rampart )
+VIDEO_START_MEMBER(rampart_state,rampart)
{
static const atarimo_desc modesc =
{
@@ -58,7 +58,7 @@ VIDEO_START( rampart )
};
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* set the intial scroll offset */
atarimo_set_xscroll(0, -12);
diff --git a/src/mame/video/realbrk.c b/src/mame/video/realbrk.c
index 21fd6608ebc..cc22f5c3cfa 100644
--- a/src/mame/video/realbrk.c
+++ b/src/mame/video/realbrk.c
@@ -142,22 +142,21 @@ WRITE16_MEMBER(realbrk_state::realbrk_vram_2_w)
***************************************************************************/
-VIDEO_START(realbrk)
+void realbrk_state::video_start()
{
- realbrk_state *state = machine.driver_data<realbrk_state>();
/* Backgrounds */
- state->m_tilemap_0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x20);
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x20);
+ m_tilemap_0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x20);
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x20);
/* Text */
- state->m_tilemap_2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info_2),state), TILEMAP_SCAN_ROWS, 8, 8, 0x40, 0x20);
+ m_tilemap_2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info_2),this), TILEMAP_SCAN_ROWS, 8, 8, 0x40, 0x20);
- state->m_tilemap_0->set_transparent_pen(0);
- state->m_tilemap_1->set_transparent_pen(0);
- state->m_tilemap_2->set_transparent_pen(0);
+ m_tilemap_0->set_transparent_pen(0);
+ m_tilemap_1->set_transparent_pen(0);
+ m_tilemap_2->set_transparent_pen(0);
- state->m_tmpbitmap0 = auto_bitmap_ind16_alloc(machine,32,32);
- state->m_tmpbitmap1 = auto_bitmap_ind16_alloc(machine,32,32);
+ m_tmpbitmap0 = auto_bitmap_ind16_alloc(machine(),32,32);
+ m_tmpbitmap1 = auto_bitmap_ind16_alloc(machine(),32,32);
}
/***************************************************************************
diff --git a/src/mame/video/redalert.c b/src/mame/video/redalert.c
index f25880443bf..8726bc767b7 100644
--- a/src/mame/video/redalert.c
+++ b/src/mame/video/redalert.c
@@ -160,22 +160,20 @@ static void get_panther_pens(running_machine &machine, pen_t *pens)
*
*************************************/
-static VIDEO_START( redalert )
+VIDEO_START_MEMBER(redalert_state,redalert)
{
- redalert_state *state = machine.driver_data<redalert_state>();
- state->m_bitmap_colorram = auto_alloc_array(machine, UINT8, 0x0400);
+ m_bitmap_colorram = auto_alloc_array(machine(), UINT8, 0x0400);
- state->save_pointer(NAME(state->m_bitmap_colorram), 0x0400);
+ save_pointer(NAME(m_bitmap_colorram), 0x0400);
- state->m_control_xor = 0x00;
+ m_control_xor = 0x00;
}
-static VIDEO_START( ww3 )
+VIDEO_START_MEMBER(redalert_state,ww3)
{
- redalert_state *state = machine.driver_data<redalert_state>();
- VIDEO_START_CALL( redalert );
+ VIDEO_START_CALL_MEMBER( redalert );
- state->m_control_xor = 0x04;
+ m_control_xor = 0x04;
}
@@ -416,14 +414,14 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( redalert_video )
- MCFG_VIDEO_START(redalert)
+ MCFG_VIDEO_START_OVERRIDE(redalert_state,redalert)
MCFG_FRAGMENT_ADD( redalert_video_common )
MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( ww3_video )
- MCFG_VIDEO_START( ww3 )
+ MCFG_VIDEO_START_OVERRIDE(redalert_state, ww3 )
MCFG_FRAGMENT_ADD( redalert_video_common )
MACHINE_CONFIG_END
@@ -436,7 +434,7 @@ MACHINE_CONFIG_END
*************************************/
MACHINE_CONFIG_FRAGMENT( demoneye_video )
- MCFG_VIDEO_START(redalert)
+ MCFG_VIDEO_START_OVERRIDE(redalert_state,redalert)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -449,7 +447,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( panther_video )
- MCFG_VIDEO_START(ww3)
+ MCFG_VIDEO_START_OVERRIDE(redalert_state,ww3)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/video/redclash.c b/src/mame/video/redclash.c
index 8a6d0da92a8..e3018794b8b 100644
--- a/src/mame/video/redclash.c
+++ b/src/mame/video/redclash.c
@@ -18,13 +18,13 @@
***************************************************************************/
-PALETTE_INIT( redclash )
+PALETTE_INIT_MEMBER(ladybug_state,redclash)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x40);
+ machine().colortable = colortable_alloc(machine(), 0x40);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -47,7 +47,7 @@ PALETTE_INIT( redclash )
bit1 = (color_prom[i] >> 7) & 0x01;
b = 0x47 * bit0 + 0x97 * bit1;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* star colors */
@@ -70,7 +70,7 @@ PALETTE_INIT( redclash )
bit0 = ((i - 0x20) >> 0) & 0x01;
r = 0x47 * bit0;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -80,7 +80,7 @@ PALETTE_INIT( redclash )
for (i = 0; i < 0x20; i++)
{
UINT8 ctabentry = ((i << 3) & 0x18) | ((i >> 2) & 0x07);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites */
@@ -89,15 +89,15 @@ PALETTE_INIT( redclash )
UINT8 ctabentry = color_prom[(i - 0x20) >> 1];
ctabentry = BITSWAP8((color_prom[i - 0x20] >> 0) & 0x0f, 7,6,5,4,0,1,2,3);
- colortable_entry_set_value(machine.colortable, i + 0x00, ctabentry);
+ colortable_entry_set_value(machine().colortable, i + 0x00, ctabentry);
ctabentry = BITSWAP8((color_prom[i - 0x20] >> 4) & 0x0f, 7,6,5,4,0,1,2,3);
- colortable_entry_set_value(machine.colortable, i + 0x20, ctabentry);
+ colortable_entry_set_value(machine().colortable, i + 0x20, ctabentry);
}
/* stars */
for (i = 0x60; i < 0x80; i++)
- colortable_entry_set_value(machine.colortable, i, (i - 0x60) + 0x20);
+ colortable_entry_set_value(machine().colortable, i, (i - 0x60) + 0x20);
}
WRITE8_HANDLER( redclash_videoram_w )
@@ -176,12 +176,11 @@ TILE_GET_INFO_MEMBER(ladybug_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( redclash )
+VIDEO_START_MEMBER(ladybug_state,redclash)
{
- ladybug_state *state = machine.driver_data<ladybug_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ladybug_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ladybug_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap->set_transparent_pen(0);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/relief.c b/src/mame/video/relief.c
index cdc5f89f1fc..aee00c0a21e 100644
--- a/src/mame/video/relief.c
+++ b/src/mame/video/relief.c
@@ -44,7 +44,7 @@ TILE_GET_INFO_MEMBER(relief_state::get_playfield2_tile_info)
*
*************************************/
-VIDEO_START( relief )
+VIDEO_START_MEMBER(relief_state,relief)
{
static const atarimo_desc modesc =
{
@@ -82,20 +82,19 @@ VIDEO_START( relief )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- relief_state *state = machine.driver_data<relief_state>();
/* MOs are 5bpp but with a 4-bit color granularity */
- machine.gfx[1]->set_granularity(16);
+ machine().gfx[1]->set_granularity(16);
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(relief_state::get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(relief_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
/* initialize the second playfield */
- state->m_playfield2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(relief_state::get_playfield2_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
- state->m_playfield2_tilemap->set_transparent_pen(0);
+ m_playfield2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(relief_state::get_playfield2_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield2_tilemap->set_transparent_pen(0);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
}
diff --git a/src/mame/video/renegade.c b/src/mame/video/renegade.c
index 4b0fac4ef87..51340d0fe45 100644
--- a/src/mame/video/renegade.c
+++ b/src/mame/video/renegade.c
@@ -61,16 +61,15 @@ TILE_GET_INFO_MEMBER(renegade_state::get_fg_tilemap_info)
0);
}
-VIDEO_START( renegade )
+void renegade_state::video_start()
{
- renegade_state *state = machine.driver_data<renegade_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(renegade_state::get_bg_tilemap_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 16);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(renegade_state::get_fg_tilemap_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(renegade_state::get_bg_tilemap_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(renegade_state::get_fg_tilemap_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(256, 0);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scrolldx(256, 0);
- state_save_register_global(machine, state->m_scrollx);
+ state_save_register_global(machine(), m_scrollx);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/retofinv.c b/src/mame/video/retofinv.c
index e6276c06220..b333f3eac31 100644
--- a/src/mame/video/retofinv.c
+++ b/src/mame/video/retofinv.c
@@ -10,13 +10,13 @@
#include "includes/retofinv.h"
-PALETTE_INIT( retofinv )
+void retofinv_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -25,7 +25,7 @@ PALETTE_INIT( retofinv )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -42,14 +42,14 @@ PALETTE_INIT( retofinv )
else
ctabentry = 0;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites and bg tiles */
for (i = 0; i < 0x800; i++)
{
UINT8 ctabentry = BITSWAP8(color_prom[i],4,5,6,7,3,2,1,0);
- colortable_entry_set_value(machine.colortable, i + 0x200, ctabentry);
+ colortable_entry_set_value(machine().colortable, i + 0x200, ctabentry);
}
}
@@ -102,13 +102,12 @@ TILE_GET_INFO_MEMBER(retofinv_state::fg_get_tile_info)
***************************************************************************/
-VIDEO_START( retofinv )
+void retofinv_state::video_start()
{
- retofinv_state *state = machine.driver_data<retofinv_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(retofinv_state::bg_get_tile_info),state),tilemap_mapper_delegate(FUNC(retofinv_state::tilemap_scan),state),8,8,36,28);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(retofinv_state::fg_get_tile_info),state),tilemap_mapper_delegate(FUNC(retofinv_state::tilemap_scan),state),8,8,36,28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(retofinv_state::bg_get_tile_info),this),tilemap_mapper_delegate(FUNC(retofinv_state::tilemap_scan),this),8,8,36,28);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(retofinv_state::fg_get_tile_info),this),tilemap_mapper_delegate(FUNC(retofinv_state::tilemap_scan),this),8,8,36,28);
- colortable_configure_tilemap_groups(machine.colortable, state->m_fg_tilemap, machine.gfx[0], 0);
+ colortable_configure_tilemap_groups(machine().colortable, m_fg_tilemap, machine().gfx[0], 0);
}
diff --git a/src/mame/video/rltennis.c b/src/mame/video/rltennis.c
index 2b64155e730..f50bf00f9be 100644
--- a/src/mame/video/rltennis.c
+++ b/src/mame/video/rltennis.c
@@ -220,13 +220,12 @@ WRITE16_MEMBER(rltennis_state::rlt_blitter_w)
}
}
-VIDEO_START( rltennis )
+void rltennis_state::video_start()
{
- rltennis_state *state = machine.driver_data<rltennis_state>();
- state->m_tmp_bitmap[BITMAP_BG] = auto_bitmap_ind16_alloc(machine, 512, 256);
- state->m_tmp_bitmap[BITMAP_FG_1] = auto_bitmap_ind16_alloc(machine, 512, 256);
- state->m_tmp_bitmap[BITMAP_FG_2] = auto_bitmap_ind16_alloc(machine, 512, 256);
- state->m_tmp_bitmap[BITMAP_FG_DISPLAY] = auto_bitmap_ind16_alloc(machine, 512, 256);
+ m_tmp_bitmap[BITMAP_BG] = auto_bitmap_ind16_alloc(machine(), 512, 256);
+ m_tmp_bitmap[BITMAP_FG_1] = auto_bitmap_ind16_alloc(machine(), 512, 256);
+ m_tmp_bitmap[BITMAP_FG_2] = auto_bitmap_ind16_alloc(machine(), 512, 256);
+ m_tmp_bitmap[BITMAP_FG_DISPLAY] = auto_bitmap_ind16_alloc(machine(), 512, 256);
}
SCREEN_UPDATE_IND16( rltennis )
diff --git a/src/mame/video/rockrage.c b/src/mame/video/rockrage.c
index 1c1cec544b4..b48ea7765fd 100644
--- a/src/mame/video/rockrage.c
+++ b/src/mame/video/rockrage.c
@@ -2,17 +2,17 @@
#include "video/konicdev.h"
#include "includes/rockrage.h"
-PALETTE_INIT( rockrage )
+void rockrage_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x40);
+ machine().colortable = colortable_alloc(machine(), 0x40);
/* sprites */
for (i = 0x20; i < 0x40; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* characters */
for (i = 0x40; i < 0x140; i++)
@@ -20,10 +20,10 @@ PALETTE_INIT( rockrage )
UINT8 ctabentry;
ctabentry = (color_prom[(i - 0x40) + 0x000] & 0x0f) | 0x00;
- colortable_entry_set_value(machine.colortable, i + 0x000, ctabentry);
+ colortable_entry_set_value(machine().colortable, i + 0x000, ctabentry);
ctabentry = (color_prom[(i - 0x40) + 0x100] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i + 0x100, ctabentry);
+ colortable_entry_set_value(machine().colortable, i + 0x100, ctabentry);
}
}
diff --git a/src/mame/video/rocnrope.c b/src/mame/video/rocnrope.c
index 2d9bc96c55f..6f4e6a84726 100644
--- a/src/mame/video/rocnrope.c
+++ b/src/mame/video/rocnrope.c
@@ -29,9 +29,9 @@
***************************************************************************/
-PALETTE_INIT( rocnrope )
+void rocnrope_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -44,7 +44,7 @@ PALETTE_INIT( rocnrope )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( rocnrope )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -79,7 +79,7 @@ PALETTE_INIT( rocnrope )
for (i = 0; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -114,10 +114,9 @@ TILE_GET_INFO_MEMBER(rocnrope_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(1, code, color, flags);
}
-VIDEO_START( rocnrope )
+void rocnrope_state::video_start()
{
- rocnrope_state *state = machine.driver_data<rocnrope_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rocnrope_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rocnrope_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/rohga.c b/src/mame/video/rohga.c
index 09391d06cdc..5b070d03489 100644
--- a/src/mame/video/rohga.c
+++ b/src/mame/video/rohga.c
@@ -16,17 +16,17 @@ WRITE16_MEMBER(rohga_state::rohga_buffer_spriteram16_w)
m_spriteram->copy();
}
-VIDEO_START( rohga )
+VIDEO_START_MEMBER(rohga_state,rohga)
{
- machine.device<decospr_device>("spritegen1")->set_col_callback(rohga_col_callback);
- machine.device<decospr_device>("spritegen1")->set_pri_callback(rohga_pri_callback);
+ machine().device<decospr_device>("spritegen1")->set_col_callback(rohga_col_callback);
+ machine().device<decospr_device>("spritegen1")->set_pri_callback(rohga_pri_callback);
}
-VIDEO_START( schmeisr )
+VIDEO_START_MEMBER(rohga_state,schmeisr)
{
- VIDEO_START_CALL( rohga );
+ VIDEO_START_CALL_MEMBER( rohga );
// wire mods on pcb..
- machine.device<decospr_device>("spritegen1")->set_col_callback(schmeisr_col_callback);
+ machine().device<decospr_device>("spritegen1")->set_col_callback(schmeisr_col_callback);
}
@@ -112,10 +112,10 @@ SCREEN_UPDATE_IND16( rohga )
-VIDEO_START(wizdfire)
+VIDEO_START_MEMBER(rohga_state,wizdfire)
{
- machine.device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
- machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
}
// not amazingly efficient, called multiple times to pull a layer out of the sprite bitmaps, but keeps correct sprite<->sprite priorities
diff --git a/src/mame/video/rollerg.c b/src/mame/video/rollerg.c
index 0f726e18e48..9bb13fd3ff1 100644
--- a/src/mame/video/rollerg.c
+++ b/src/mame/video/rollerg.c
@@ -44,11 +44,10 @@ void rollerg_zoom_callback( running_machine &machine, int *code, int *color, int
***************************************************************************/
-VIDEO_START( rollerg )
+void rollerg_state::video_start()
{
- rollerg_state *state = machine.driver_data<rollerg_state>();
- state->m_sprite_colorbase = 16;
- state->m_zoom_colorbase = 0;
+ m_sprite_colorbase = 16;
+ m_zoom_colorbase = 0;
}
diff --git a/src/mame/video/rollrace.c b/src/mame/video/rollrace.c
index 875e83f3e63..161bba25783 100644
--- a/src/mame/video/rollrace.c
+++ b/src/mame/video/rollrace.c
@@ -20,13 +20,13 @@
bit 0 -- 1 kohm resistor -- RED/GREEN/BLUE
***************************************************************************/
-PALETTE_INIT( rollrace )
+void rollrace_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -36,18 +36,18 @@ PALETTE_INIT( rollrace )
bit2 = (color_prom[0] >> 2) & 0x01;
bit3 = (color_prom[0] >> 3) & 0x01;
r = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
- bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine().total_colors()] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
- bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[2*machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[2*machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[2*machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[2*machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
diff --git a/src/mame/video/rpunch.c b/src/mame/video/rpunch.c
index e1bc86ab953..6aa1e775a00 100644
--- a/src/mame/video/rpunch.c
+++ b/src/mame/video/rpunch.c
@@ -67,21 +67,20 @@ static TIMER_CALLBACK( crtc_interrupt_gen )
}
-VIDEO_START( rpunch )
+void rpunch_state::video_start()
{
- rpunch_state *state = machine.driver_data<rpunch_state>();
/* allocate tilemaps for the backgrounds */
- state->m_background[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rpunch_state::get_bg0_tile_info),state),TILEMAP_SCAN_COLS,8,8,64,64);
- state->m_background[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rpunch_state::get_bg1_tile_info),state),TILEMAP_SCAN_COLS,8,8,64,64);
+ m_background[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rpunch_state::get_bg0_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,64);
+ m_background[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rpunch_state::get_bg1_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,64);
/* configure the tilemaps */
- state->m_background[1]->set_transparent_pen(15);
+ m_background[1]->set_transparent_pen(15);
- if (state->m_bitmapram)
- memset(state->m_bitmapram, 0xff, state->m_bitmapram.bytes());
+ if (m_bitmapram)
+ memset(m_bitmapram, 0xff, m_bitmapram.bytes());
/* reset the timer */
- state->m_crtc_timer = machine.scheduler().timer_alloc(FUNC(crtc_interrupt_gen));
+ m_crtc_timer = machine().scheduler().timer_alloc(FUNC(crtc_interrupt_gen));
}
diff --git a/src/mame/video/runaway.c b/src/mame/video/runaway.c
index 1e5bbbc2e83..bae40598bcb 100644
--- a/src/mame/video/runaway.c
+++ b/src/mame/video/runaway.c
@@ -66,21 +66,19 @@ TILE_GET_INFO_MEMBER(runaway_state::qwak_get_tile_info)
-VIDEO_START( runaway )
+void runaway_state::video_start()
{
- runaway_state *state = machine.driver_data<runaway_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(runaway_state::runaway_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 30);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(runaway_state::runaway_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 30);
- state->save_item(NAME(state->m_tile_bank));
+ save_item(NAME(m_tile_bank));
}
-VIDEO_START( qwak )
+VIDEO_START_MEMBER(runaway_state,qwak)
{
- runaway_state *state = machine.driver_data<runaway_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(runaway_state::qwak_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 30);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(runaway_state::qwak_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 30);
- state->save_item(NAME(state->m_tile_bank));
+ save_item(NAME(m_tile_bank));
}
diff --git a/src/mame/video/rungun.c b/src/mame/video/rungun.c
index f1af1be7e6f..48cb19345a9 100644
--- a/src/mame/video/rungun.c
+++ b/src/mame/video/rungun.c
@@ -60,7 +60,7 @@ TILE_GET_INFO_MEMBER(rungun_state::get_rng_936_tile_info)
}
-VIDEO_START( rng )
+void rungun_state::video_start()
{
static const gfx_layout charlayout =
{
@@ -73,29 +73,28 @@ VIDEO_START( rng )
8*8*4
};
- rungun_state *state = machine.driver_data<rungun_state>();
int gfx_index;
- state->m_936_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rungun_state::get_rng_936_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 128, 128);
- state->m_936_tilemap->set_transparent_pen(0);
+ m_936_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rungun_state::get_rng_936_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 128, 128);
+ m_936_tilemap->set_transparent_pen(0);
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine.gfx[gfx_index] == 0)
+ if (machine().gfx[gfx_index] == 0)
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
// decode the ttl layer's gfx
- machine.gfx[gfx_index] = auto_alloc(machine, gfx_element(machine, charlayout, state->memregion("gfx3")->base(), machine.total_colors() / 16, 0));
- state->m_ttl_gfx_index = gfx_index;
+ machine().gfx[gfx_index] = auto_alloc(machine(), gfx_element(machine(), charlayout, memregion("gfx3")->base(), machine().total_colors() / 16, 0));
+ m_ttl_gfx_index = gfx_index;
// create the tilemap
- state->m_ttl_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(rungun_state::ttl_get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_ttl_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(rungun_state::ttl_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_ttl_tilemap->set_transparent_pen(0);
+ m_ttl_tilemap->set_transparent_pen(0);
- state->m_sprite_colorbase = 0x20;
+ m_sprite_colorbase = 0x20;
}
SCREEN_UPDATE_IND16(rng)
diff --git a/src/mame/video/sauro.c b/src/mame/video/sauro.c
index 2bf6156a2d6..557fa5233be 100644
--- a/src/mame/video/sauro.c
+++ b/src/mame/video/sauro.c
@@ -83,18 +83,17 @@ WRITE8_MEMBER(sauro_state::sauro_scroll_fg_w)
m_fg_tilemap->set_scrollx(0, scroll);
}
-VIDEO_START( sauro )
+VIDEO_START_MEMBER(sauro_state,sauro)
{
- sauro_state *state = machine.driver_data<sauro_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sauro_state::get_tile_info_bg),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sauro_state::get_tile_info_bg),this), TILEMAP_SCAN_COLS,
8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sauro_state::get_tile_info_fg),state), TILEMAP_SCAN_COLS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sauro_state::get_tile_info_fg),this), TILEMAP_SCAN_COLS,
8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_palette_bank = 0;
+ m_fg_tilemap->set_transparent_pen(0);
+ m_palette_bank = 0;
}
static void sauro_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -157,11 +156,10 @@ SCREEN_UPDATE_IND16( sauro )
/* Tricky Doc */
-VIDEO_START( trckydoc )
+VIDEO_START_MEMBER(sauro_state,trckydoc)
{
- sauro_state *state = machine.driver_data<sauro_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sauro_state::get_tile_info_bg),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sauro_state::get_tile_info_bg),this), TILEMAP_SCAN_COLS,
8, 8, 32, 32);
}
diff --git a/src/mame/video/sbasketb.c b/src/mame/video/sbasketb.c
index 8f229fe2ee0..97f3c9fe130 100644
--- a/src/mame/video/sbasketb.c
+++ b/src/mame/video/sbasketb.c
@@ -26,9 +26,9 @@
***************************************************************************/
-PALETTE_INIT( sbasketb )
+void sbasketb_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[4] = { 2000, 1000, 470, 220 };
double rweights[4], gweights[4], bweights[4];
int i;
@@ -40,7 +40,7 @@ PALETTE_INIT( sbasketb )
4, resistances, bweights, 1000, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( sbasketb )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table,*/
@@ -79,7 +79,7 @@ PALETTE_INIT( sbasketb )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0xf0;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites use colors 0-256 (?) in 16 banks */
@@ -90,7 +90,7 @@ PALETTE_INIT( sbasketb )
for (j = 0; j < 0x10; j++)
{
UINT8 ctabentry = (j << 4) | (color_prom[i + 0x100] & 0x0f);
- colortable_entry_set_value(machine.colortable, 0x100 + ((j << 8) | i), ctabentry);
+ colortable_entry_set_value(machine().colortable, 0x100 + ((j << 8) | i), ctabentry);
}
}
}
@@ -125,12 +125,11 @@ TILE_GET_INFO_MEMBER(sbasketb_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( sbasketb )
+void sbasketb_state::video_start()
{
- sbasketb_state *state = machine.driver_data<sbasketb_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sbasketb_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sbasketb_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scroll_cols(32);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/sbugger.c b/src/mame/video/sbugger.c
index 6912d8a7948..ea5773a864e 100644
--- a/src/mame/video/sbugger.c
+++ b/src/mame/video/sbugger.c
@@ -27,10 +27,9 @@ WRITE8_MEMBER(sbugger_state::sbugger_videoram_attr_w)
m_tilemap->mark_tile_dirty(offset);
}
-VIDEO_START(sbugger)
+void sbugger_state::video_start()
{
- sbugger_state *state = machine.driver_data<sbugger_state>();
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sbugger_state::get_sbugger_tile_info),state), TILEMAP_SCAN_ROWS, 8, 16, 64, 16);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sbugger_state::get_sbugger_tile_info),this), TILEMAP_SCAN_ROWS, 8, 16, 64, 16);
}
SCREEN_UPDATE_IND16(sbugger)
@@ -41,20 +40,20 @@ SCREEN_UPDATE_IND16(sbugger)
}
/* not right but so we can see things ok */
-PALETTE_INIT(sbugger)
+void sbugger_state::palette_init()
{
/* just some random colours for now */
int i;
for (i = 0;i < 256;i++)
{
- int r = machine.rand()|0x80;
- int g = machine.rand()|0x80;
- int b = machine.rand()|0x80;
+ int r = machine().rand()|0x80;
+ int g = machine().rand()|0x80;
+ int b = machine().rand()|0x80;
if (i == 0) r = g = b = 0;
- palette_set_color(machine,i*2+1,MAKE_RGB(r,g,b));
- palette_set_color(machine,i*2,MAKE_RGB(0,0,0));
+ palette_set_color(machine(),i*2+1,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i*2,MAKE_RGB(0,0,0));
}
diff --git a/src/mame/video/scotrsht.c b/src/mame/video/scotrsht.c
index d162c162021..e1e209978aa 100644
--- a/src/mame/video/scotrsht.c
+++ b/src/mame/video/scotrsht.c
@@ -3,13 +3,13 @@
/* Similar as Iron Horse */
-PALETTE_INIT( scotrsht )
+void scotrsht_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -18,7 +18,7 @@ PALETTE_INIT( scotrsht )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -32,7 +32,7 @@ PALETTE_INIT( scotrsht )
for (j = 0; j < 8; j++)
{
UINT8 ctabentry = ((~i & 0x100) >> 1) | (j << 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine.colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
+ colortable_entry_set_value(machine().colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
}
}
}
@@ -125,13 +125,12 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
}
}
-VIDEO_START( scotrsht )
+void scotrsht_state::video_start()
{
- scotrsht_state *state = machine.driver_data<scotrsht_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(scotrsht_state::scotrsht_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(scotrsht_state::scotrsht_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap->set_scroll_cols(64);
+ m_bg_tilemap->set_scroll_cols(64);
}
SCREEN_UPDATE_IND16( scotrsht )
diff --git a/src/mame/video/sderby.c b/src/mame/video/sderby.c
index 90782f47f74..1a33d1b7323 100644
--- a/src/mame/video/sderby.c
+++ b/src/mame/video/sderby.c
@@ -89,17 +89,16 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
}
-VIDEO_START( sderby )
+void sderby_state::video_start()
{
- sderby_state *state = machine.driver_data<sderby_state>();
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sderby_state::get_sderby_tile_info),state),TILEMAP_SCAN_ROWS, 16, 16,32,32);
- state->m_md_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sderby_state::get_sderby_md_tile_info),state),TILEMAP_SCAN_ROWS, 16, 16,32,32);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sderby_state::get_sderby_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16,32,32);
+ m_md_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sderby_state::get_sderby_md_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16,32,32);
- state->m_md_tilemap->set_transparent_pen(0);
+ m_md_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sderby_state::get_sderby_fg_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sderby_state::get_sderby_fg_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ m_fg_tilemap->set_transparent_pen(0);
}
SCREEN_UPDATE_IND16( sderby )
diff --git a/src/mame/video/segag80r.c b/src/mame/video/segag80r.c
index 4a76343634f..2ca2f5558c7 100644
--- a/src/mame/video/segag80r.c
+++ b/src/mame/video/segag80r.c
@@ -179,26 +179,25 @@ TILE_GET_INFO_MEMBER(segag80r_state::bg_get_tile_info)
*
*************************************/
-VIDEO_START( segag80r )
+void segag80r_state::video_start()
{
- segag80r_state *state = machine.driver_data<segag80r_state>();
- UINT8 *videoram = state->m_videoram;
+ UINT8 *videoram = m_videoram;
static const int rg_resistances[3] = { 4700, 2400, 1200 };
static const int b_resistances[2] = { 2000, 1000 };
/* compute the color output resistor weights at startup */
compute_resistor_weights(0, 255, -1.0,
- 3, rg_resistances, state->m_rweights, 220, 0,
- 3, rg_resistances, state->m_gweights, 220, 0,
- 2, b_resistances, state->m_bweights, 220, 0);
+ 3, rg_resistances, m_rweights, 220, 0,
+ 3, rg_resistances, m_gweights, 220, 0,
+ 2, b_resistances, m_bweights, 220, 0);
- machine.gfx[0]->set_source(&videoram[0x800]);
+ machine().gfx[0]->set_source(&videoram[0x800]);
/* allocate paletteram */
- state->m_generic_paletteram_8.allocate(0x80);
+ m_generic_paletteram_8.allocate(0x80);
/* initialize the particulars for each type of background PCB */
- switch (state->m_background_pcb)
+ switch (m_background_pcb)
{
/* nothing to do here */
case G80_BACKGROUND_NONE:
@@ -207,40 +206,40 @@ VIDEO_START( segag80r )
/* create a fixed background palette and two tilemaps, one horizontally scrolling */
/* and one vertically scrolling */
case G80_BACKGROUND_SPACEOD:
- spaceod_bg_init_palette(machine);
- state->m_spaceod_bg_htilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segag80r_state::spaceod_get_tile_info),state), tilemap_mapper_delegate(FUNC(segag80r_state::spaceod_scan_rows),state), 8,8, 128,32);
- state->m_spaceod_bg_vtilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segag80r_state::spaceod_get_tile_info),state), tilemap_mapper_delegate(FUNC(segag80r_state::spaceod_scan_rows),state), 8,8, 32,128);
+ spaceod_bg_init_palette(machine());
+ m_spaceod_bg_htilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segag80r_state::spaceod_get_tile_info),this), tilemap_mapper_delegate(FUNC(segag80r_state::spaceod_scan_rows),this), 8,8, 128,32);
+ m_spaceod_bg_vtilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segag80r_state::spaceod_get_tile_info),this), tilemap_mapper_delegate(FUNC(segag80r_state::spaceod_scan_rows),this), 8,8, 32,128);
break;
/* background tilemap is effectively 1 screen x n screens */
case G80_BACKGROUND_MONSTERB:
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segag80r_state::bg_get_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,machine.root_device().memregion("gfx2")->bytes() / 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segag80r_state::bg_get_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,machine().root_device().memregion("gfx2")->bytes() / 32);
break;
/* background tilemap is effectively 4 screens x n screens */
case G80_BACKGROUND_PIGNEWT:
case G80_BACKGROUND_SINDBADM:
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segag80r_state::bg_get_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 128,machine.root_device().memregion("gfx2")->bytes() / 128);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segag80r_state::bg_get_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 128,machine().root_device().memregion("gfx2")->bytes() / 128);
break;
}
/* register for save states */
- state_save_register_global(machine, state->m_video_control);
- state_save_register_global(machine, state->m_video_flip);
- state_save_register_global(machine, state->m_vblank_latch);
-
- state_save_register_global(machine, state->m_spaceod_hcounter);
- state_save_register_global(machine, state->m_spaceod_vcounter);
- state_save_register_global(machine, state->m_spaceod_fixed_color);
- state_save_register_global(machine, state->m_spaceod_bg_control);
- state_save_register_global(machine, state->m_spaceod_bg_detect);
-
- state_save_register_global(machine, state->m_bg_enable);
- state_save_register_global(machine, state->m_bg_char_bank);
- state_save_register_global(machine, state->m_bg_scrollx);
- state_save_register_global(machine, state->m_bg_scrolly);
-
- state_save_register_global(machine, state->m_pignewt_bg_color_offset);
+ state_save_register_global(machine(), m_video_control);
+ state_save_register_global(machine(), m_video_flip);
+ state_save_register_global(machine(), m_vblank_latch);
+
+ state_save_register_global(machine(), m_spaceod_hcounter);
+ state_save_register_global(machine(), m_spaceod_vcounter);
+ state_save_register_global(machine(), m_spaceod_fixed_color);
+ state_save_register_global(machine(), m_spaceod_bg_control);
+ state_save_register_global(machine(), m_spaceod_bg_detect);
+
+ state_save_register_global(machine(), m_bg_enable);
+ state_save_register_global(machine(), m_bg_char_bank);
+ state_save_register_global(machine(), m_bg_scrollx);
+ state_save_register_global(machine(), m_bg_scrolly);
+
+ state_save_register_global(machine(), m_pignewt_bg_color_offset);
}
diff --git a/src/mame/video/segag80v.c b/src/mame/video/segag80v.c
index fc706b56de1..6fce742c7da 100644
--- a/src/mame/video/segag80v.c
+++ b/src/mame/video/segag80v.c
@@ -323,15 +323,14 @@ static void sega_generate_vector_list(running_machine &machine)
***************************************************************************/
-VIDEO_START( segag80v )
+void segag80v_state::video_start()
{
- segag80v_state *state = machine.driver_data<segag80v_state>();
- assert_always(state->m_vectorram.bytes() != 0, "vectorram==0");
+ assert_always(m_vectorram.bytes() != 0, "vectorram==0");
- state->m_min_x =machine.primary_screen->visible_area().min_x;
- state->m_min_y =machine.primary_screen->visible_area().min_y;
+ m_min_x =machine().primary_screen->visible_area().min_x;
+ m_min_y =machine().primary_screen->visible_area().min_y;
- VIDEO_START_CALL(vector);
+ VIDEO_START_CALL_LEGACY(vector);
}
diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c
index be752ad6ada..0d6e9cd4a25 100644
--- a/src/mame/video/segas32.c
+++ b/src/mame/video/segas32.c
@@ -279,15 +279,15 @@ static void common_start(running_machine &machine, int multi32)
}
-VIDEO_START( system32 )
+VIDEO_START_MEMBER(segas32_state,system32)
{
- common_start(machine, 0);
+ common_start(machine(), 0);
}
-VIDEO_START( multi32 )
+VIDEO_START_MEMBER(segas32_state,multi32)
{
- common_start(machine, 1);
+ common_start(machine(), 1);
}
diff --git a/src/mame/video/seibuspi.c b/src/mame/video/seibuspi.c
index 0fba7332cff..16ef0ca15e4 100644
--- a/src/mame/video/seibuspi.c
+++ b/src/mame/video/seibuspi.c
@@ -457,66 +457,65 @@ TILE_GET_INFO_MEMBER(seibuspi_state::get_fore_tile_info)
SET_TILE_INFO_MEMBER(1, tile, color + 8, 0);
}
-VIDEO_START( spi )
+VIDEO_START_MEMBER(seibuspi_state,spi)
{
- seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i;
int region_length;
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seibuspi_state::get_text_tile_info),state), TILEMAP_SCAN_ROWS, 8,8,64,32 );
- state->m_back_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seibuspi_state::get_back_tile_info),state), TILEMAP_SCAN_COLS, 16,16,32,32 );
- state->m_mid_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seibuspi_state::get_mid_tile_info),state), TILEMAP_SCAN_COLS, 16,16,32,32 );
- state->m_fore_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seibuspi_state::get_fore_tile_info),state), TILEMAP_SCAN_COLS, 16,16,32,32 );
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seibuspi_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8,8,64,32 );
+ m_back_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seibuspi_state::get_back_tile_info),this), TILEMAP_SCAN_COLS, 16,16,32,32 );
+ m_mid_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seibuspi_state::get_mid_tile_info),this), TILEMAP_SCAN_COLS, 16,16,32,32 );
+ m_fore_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seibuspi_state::get_fore_tile_info),this), TILEMAP_SCAN_COLS, 16,16,32,32 );
- state->m_text_layer->set_transparent_pen(31);
- state->m_mid_layer->set_transparent_pen(63);
- state->m_fore_layer->set_transparent_pen(63);
+ m_text_layer->set_transparent_pen(31);
+ m_mid_layer->set_transparent_pen(63);
+ m_fore_layer->set_transparent_pen(63);
- state->m_tilemap_ram = auto_alloc_array_clear(machine, UINT32, 0x4000/4);
- state->m_palette_ram = auto_alloc_array_clear(machine, UINT32, 0x3000/4);
- state->m_sprite_ram = auto_alloc_array_clear(machine, UINT32, 0x1000/4);
+ m_tilemap_ram = auto_alloc_array_clear(machine(), UINT32, 0x4000/4);
+ m_palette_ram = auto_alloc_array_clear(machine(), UINT32, 0x3000/4);
+ m_sprite_ram = auto_alloc_array_clear(machine(), UINT32, 0x1000/4);
- state->m_sprite_bpp = 6;
- state->m_sprite_dma_length = 0x1000;
+ m_sprite_bpp = 6;
+ m_sprite_dma_length = 0x1000;
for (i=0; i < 6144; i++) {
- palette_set_color(machine, i, MAKE_RGB(0, 0, 0));
+ palette_set_color(machine(), i, MAKE_RGB(0, 0, 0));
}
- memset(state->m_alpha_table, 0, 6144 * sizeof(UINT8));
+ memset(m_alpha_table, 0, 6144 * sizeof(UINT8));
// sprites
- //for (i = 1792; i < 1808; i++) { state->m_alpha_table[i] = 1; } // breaks rdft
- for (i = 1840; i < 1856; i++) { state->m_alpha_table[i] = 1; }
- for (i = 1920; i < 1952; i++) { state->m_alpha_table[i] = 1; }
- //for (i = 1984; i < 2048; i++) { state->m_alpha_table[i] = 1; } // breaks batlball
- //for (i = 3840; i < 3904; i++) { state->m_alpha_table[i] = 1; } // breaks rdft
- for (i = 4032; i < 4096; i++) { state->m_alpha_table[i] = 1; }
+ //for (i = 1792; i < 1808; i++) { m_alpha_table[i] = 1; } // breaks rdft
+ for (i = 1840; i < 1856; i++) { m_alpha_table[i] = 1; }
+ for (i = 1920; i < 1952; i++) { m_alpha_table[i] = 1; }
+ //for (i = 1984; i < 2048; i++) { m_alpha_table[i] = 1; } // breaks batlball
+ //for (i = 3840; i < 3904; i++) { m_alpha_table[i] = 1; } // breaks rdft
+ for (i = 4032; i < 4096; i++) { m_alpha_table[i] = 1; }
// mid layer
- for (i = 4960; i < 4992; i++) { state->m_alpha_table[i] = 1; } // breaks ejanhs
- for (i = 5040; i < 5056; i++) { state->m_alpha_table[i] = 1; } // breaks ejanhs
- for (i = 5104; i < 5120; i++) { state->m_alpha_table[i] = 1; }
+ for (i = 4960; i < 4992; i++) { m_alpha_table[i] = 1; } // breaks ejanhs
+ for (i = 5040; i < 5056; i++) { m_alpha_table[i] = 1; } // breaks ejanhs
+ for (i = 5104; i < 5120; i++) { m_alpha_table[i] = 1; }
// fore layer
- for (i = 5552; i < 5568; i++) { state->m_alpha_table[i] = 1; } // breaks ejanhs
- for (i = 5616; i < 5632; i++) { state->m_alpha_table[i] = 1; } // breaks ejanhs
+ for (i = 5552; i < 5568; i++) { m_alpha_table[i] = 1; } // breaks ejanhs
+ for (i = 5616; i < 5632; i++) { m_alpha_table[i] = 1; } // breaks ejanhs
// text layer
- for (i = 6000; i < 6016; i++) { state->m_alpha_table[i] = 1; }
- for (i = 6128; i < 6144; i++) { state->m_alpha_table[i] = 1; }
+ for (i = 6000; i < 6016; i++) { m_alpha_table[i] = 1; }
+ for (i = 6128; i < 6144; i++) { m_alpha_table[i] = 1; }
- region_length = machine.root_device().memregion("gfx2")->bytes();
+ region_length = machine().root_device().memregion("gfx2")->bytes();
if (region_length <= 0x300000)
{
- state->m_bg_fore_layer_position = 0x2000;
+ m_bg_fore_layer_position = 0x2000;
}
else if (region_length <= 0x600000)
{
- state->m_bg_fore_layer_position = 0x4000;
+ m_bg_fore_layer_position = 0x4000;
}
else
{
- state->m_bg_fore_layer_position = 0x8000;
+ m_bg_fore_layer_position = 0x8000;
}
}
@@ -636,23 +635,22 @@ SCREEN_UPDATE_RGB32( spi )
return 0;
}
-VIDEO_START( sys386f2 )
+VIDEO_START_MEMBER(seibuspi_state,sys386f2)
{
- seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i;
- state->m_palette_ram = auto_alloc_array_clear(machine, UINT32, 0x4000/4);
- state->m_sprite_ram = auto_alloc_array_clear(machine, UINT32, 0x2000/4);
+ m_palette_ram = auto_alloc_array_clear(machine(), UINT32, 0x4000/4);
+ m_sprite_ram = auto_alloc_array_clear(machine(), UINT32, 0x2000/4);
- state->m_sprite_bpp = 8;
- state->m_sprite_dma_length = 0x2000;
- state->m_layer_enable = 0;
+ m_sprite_bpp = 8;
+ m_sprite_dma_length = 0x2000;
+ m_layer_enable = 0;
for (i=0; i < 8192; i++) {
- palette_set_color(machine, i, MAKE_RGB(0, 0, 0));
+ palette_set_color(machine(), i, MAKE_RGB(0, 0, 0));
}
- memset(state->m_alpha_table, 0, 8192 * sizeof(UINT8));
+ memset(m_alpha_table, 0, 8192 * sizeof(UINT8));
}
SCREEN_UPDATE_RGB32( sys386f2 )
diff --git a/src/mame/video/seicross.c b/src/mame/video/seicross.c
index e50cbf90997..2a3745d824d 100644
--- a/src/mame/video/seicross.c
+++ b/src/mame/video/seicross.c
@@ -25,13 +25,13 @@
bit 0 -- 1 kohm resistor -- RED
***************************************************************************/
-PALETTE_INIT( seicross )
+void seicross_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -50,7 +50,7 @@ PALETTE_INIT( seicross )
bit1 = (color_prom[i] >> 7) & 0x01;
b = 0x4f * bit0 + 0xa8 * bit1;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -85,14 +85,13 @@ TILE_GET_INFO_MEMBER(seicross_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( seicross )
+void seicross_state::video_start()
{
- seicross_state *state = machine.driver_data<seicross_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seicross_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seicross_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_scroll_cols(32);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/senjyo.c b/src/mame/video/senjyo.c
index de413a99540..3df0927c5b1 100644
--- a/src/mame/video/senjyo.c
+++ b/src/mame/video/senjyo.c
@@ -87,30 +87,29 @@ TILE_GET_INFO_MEMBER(senjyo_state::get_bg3_tile_info)
***************************************************************************/
-VIDEO_START( senjyo )
+void senjyo_state::video_start()
{
- senjyo_state *state = machine.driver_data<senjyo_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- if (state->m_is_senjyo)
+ if (m_is_senjyo)
{
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::senjyo_bg1_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::get_bg2_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 48); /* only 16x32 used by Star Force */
- state->m_bg3_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::get_bg3_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 56); /* only 16x32 used by Star Force */
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::senjyo_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 48); /* only 16x32 used by Star Force */
+ m_bg3_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::get_bg3_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 56); /* only 16x32 used by Star Force */
}
else
{
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::starforc_bg1_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::get_bg2_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 32); /* only 16x32 used by Star Force */
- state->m_bg3_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::get_bg3_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 32); /* only 16x32 used by Star Force */
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::starforc_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 32); /* only 16x32 used by Star Force */
+ m_bg3_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(senjyo_state::get_bg3_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 32); /* only 16x32 used by Star Force */
}
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_bg1_tilemap->set_transparent_pen(0);
- state->m_bg2_tilemap->set_transparent_pen(0);
- state->m_bg3_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scroll_cols(32);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_bg1_tilemap->set_transparent_pen(0);
+ m_bg2_tilemap->set_transparent_pen(0);
+ m_bg3_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_scroll_cols(32);
}
diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c
index 10edd61a92e..66d9c701a26 100644
--- a/src/mame/video/seta.c
+++ b/src/mame/video/seta.c
@@ -439,81 +439,78 @@ WRITE16_MEMBER(seta_state::twineagl_tilebank_w)
/* 2 layers */
-VIDEO_START( seta_2_layers )
+VIDEO_START_MEMBER(seta_state,seta_2_layers)
{
- seta_state *state = machine.driver_data<seta_state>();
- VIDEO_START_CALL( seta_no_layers );
+ VIDEO_START_CALL_MEMBER( seta_no_layers );
/* Each layer consists of 2 tilemaps: only one can be displayed
at any given time */
/* layer 0 */
- state->m_tilemap_0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS,
+ m_tilemap_0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS,
16,16, 64,32 );
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS,
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS,
16,16, 64,32 );
/* layer 1 */
- state->m_tilemap_2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_2),state), TILEMAP_SCAN_ROWS,
+ m_tilemap_2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_2),this), TILEMAP_SCAN_ROWS,
16,16, 64,32 );
- state->m_tilemap_3 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_3),state), TILEMAP_SCAN_ROWS,
+ m_tilemap_3 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_3),this), TILEMAP_SCAN_ROWS,
16,16, 64,32 );
- state->m_tilemaps_flip = 0;
- state->m_color_mode_shift = 3;
+ m_tilemaps_flip = 0;
+ m_color_mode_shift = 3;
- state->m_tilemap_0->set_transparent_pen(0);
- state->m_tilemap_1->set_transparent_pen(0);
- state->m_tilemap_2->set_transparent_pen(0);
- state->m_tilemap_3->set_transparent_pen(0);
+ m_tilemap_0->set_transparent_pen(0);
+ m_tilemap_1->set_transparent_pen(0);
+ m_tilemap_2->set_transparent_pen(0);
+ m_tilemap_3->set_transparent_pen(0);
}
/* 1 layer */
-VIDEO_START( seta_1_layer )
+VIDEO_START_MEMBER(seta_state,seta_1_layer)
{
- seta_state *state = machine.driver_data<seta_state>();
- VIDEO_START_CALL( seta_no_layers );
+ VIDEO_START_CALL_MEMBER( seta_no_layers );
/* Each layer consists of 2 tilemaps: only one can be displayed
at any given time */
/* layer 0 */
- state->m_tilemap_0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS,
+ m_tilemap_0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS,
16,16, 64,32 );
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS,
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS,
16,16, 64,32 );
- state->m_color_mode_shift = 4;
+ m_color_mode_shift = 4;
- state->m_tilemap_0->set_transparent_pen(0);
- state->m_tilemap_1->set_transparent_pen(0);
+ m_tilemap_0->set_transparent_pen(0);
+ m_tilemap_1->set_transparent_pen(0);
}
-VIDEO_START( twineagl_1_layer )
+VIDEO_START_MEMBER(seta_state,twineagl_1_layer)
{
- seta_state *state = machine.driver_data<seta_state>();
- VIDEO_START_CALL( seta_no_layers );
+ VIDEO_START_CALL_MEMBER( seta_no_layers );
/* Each layer consists of 2 tilemaps: only one can be displayed
at any given time */
/* layer 0 */
- state->m_tilemap_0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::twineagl_get_tile_info_0),state), TILEMAP_SCAN_ROWS,
+ m_tilemap_0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::twineagl_get_tile_info_0),this), TILEMAP_SCAN_ROWS,
16,16, 64,32 );
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::twineagl_get_tile_info_1),state), TILEMAP_SCAN_ROWS,
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(seta_state::twineagl_get_tile_info_1),this), TILEMAP_SCAN_ROWS,
16,16, 64,32 );
- state->m_tilemap_0->set_transparent_pen(0);
- state->m_tilemap_1->set_transparent_pen(0);
+ m_tilemap_0->set_transparent_pen(0);
+ m_tilemap_1->set_transparent_pen(0);
}
int setac_gfxbank_callback( running_machine &machine, UINT16 code, UINT8 color )
@@ -527,37 +524,35 @@ int setac_gfxbank_callback( running_machine &machine, UINT16 code, UINT8 color )
}
/* NO layers, only sprites */
-VIDEO_START( seta_no_layers )
+VIDEO_START_MEMBER(seta_state,seta_no_layers)
{
- seta_state *state = machine.driver_data<seta_state>();
- state->m_tilemap_0 = 0;
- state->m_tilemap_1 = 0;
- state->m_tilemap_2 = 0;
- state->m_tilemap_3 = 0;
+ m_tilemap_0 = 0;
+ m_tilemap_1 = 0;
+ m_tilemap_2 = 0;
+ m_tilemap_3 = 0;
- state->m_tilemaps_flip = 0;
+ m_tilemaps_flip = 0;
- state->m_global_offsets = game_offsets;
- while (state->m_global_offsets->gamename && strcmp(machine.system().name, state->m_global_offsets->gamename))
- state->m_global_offsets++;
- state->m_samples_bank = -1; // set the samples bank to an out of range value at start-up
+ m_global_offsets = game_offsets;
+ while (m_global_offsets->gamename && strcmp(machine().system().name, m_global_offsets->gamename))
+ m_global_offsets++;
+ m_samples_bank = -1; // set the samples bank to an out of range value at start-up
// position kludges
- machine.device<seta001_device>("spritegen")->set_fg_xoffsets(state->m_global_offsets->sprite_offs[1], state->m_global_offsets->sprite_offs[0]);
- machine.device<seta001_device>("spritegen")->set_fg_yoffsets( -0x0a, 0x0e );
+ machine().device<seta001_device>("spritegen")->set_fg_xoffsets(m_global_offsets->sprite_offs[1], m_global_offsets->sprite_offs[0]);
+ machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x0a, 0x0e );
// banking
- machine.device<seta001_device>("spritegen")->set_gfxbank_callback( setac_gfxbank_callback );
+ machine().device<seta001_device>("spritegen")->set_gfxbank_callback( setac_gfxbank_callback );
}
-VIDEO_START( oisipuzl_2_layers )
+VIDEO_START_MEMBER(seta_state,oisipuzl_2_layers)
{
- seta_state *state = machine.driver_data<seta_state>();
- VIDEO_START_CALL(seta_2_layers);
- state->m_tilemaps_flip = 1;
+ VIDEO_START_CALL_MEMBER(seta_2_layers);
+ m_tilemaps_flip = 1;
}
@@ -575,24 +570,24 @@ VIDEO_START( oisipuzl_2_layers )
The game can select to repeat every 16 colors to fill the 64 colors for the 6bpp gfx
or to use the first 64 colors of the palette regardless of the color code!
*/
-PALETTE_INIT( blandia )
+PALETTE_INIT_MEMBER(seta_state,blandia)
{
int color, pen;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x600*2);
+ machine().colortable = colortable_alloc(machine(), 0x600*2);
for (color = 0; color < 0x20; color++)
{
for (pen = 0; pen < 0x40; pen++)
{
// layer 2-3
- colortable_entry_set_value(machine.colortable, 0x0200 + ((color << 6) | pen), 0x200 + ((color << 4) | (pen & 0x0f)));
- colortable_entry_set_value(machine.colortable, 0x1200 + ((color << 6) | pen), 0x200 + pen);
+ colortable_entry_set_value(machine().colortable, 0x0200 + ((color << 6) | pen), 0x200 + ((color << 4) | (pen & 0x0f)));
+ colortable_entry_set_value(machine().colortable, 0x1200 + ((color << 6) | pen), 0x200 + pen);
// layer 0-1
- colortable_entry_set_value(machine.colortable, 0x0a00 + ((color << 6) | pen), 0x400 + ((color << 4) | (pen & 0x0f)));
- colortable_entry_set_value(machine.colortable, 0x1a00 + ((color << 6) | pen), 0x400 + pen);
+ colortable_entry_set_value(machine().colortable, 0x0a00 + ((color << 6) | pen), 0x400 + ((color << 4) | (pen & 0x0f)));
+ colortable_entry_set_value(machine().colortable, 0x1a00 + ((color << 6) | pen), 0x400 + pen);
}
}
@@ -600,7 +595,7 @@ PALETTE_INIT( blandia )
// what are used for palette from 0x800 to 0xBFF?
for(int i = 0; i < 0x2200; i++)
{
- colortable_entry_set_value(machine.colortable, 0x2200 + i, 0x600 + (i & 0x1ff));
+ colortable_entry_set_value(machine().colortable, 0x2200 + i, 0x600 + (i & 0x1ff));
}
}
@@ -608,90 +603,90 @@ PALETTE_INIT( blandia )
/* layers have 6 bits per pixel, but the color code has a 16 colors granularity,
even if the low 2 bits are ignored (so there are only 4 different palettes) */
-PALETTE_INIT( gundhara )
+PALETTE_INIT_MEMBER(seta_state,gundhara)
{
int color, pen;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x600);
+ machine().colortable = colortable_alloc(machine(), 0x600);
for (color = 0; color < 0x20; color++)
for (pen = 0; pen < 0x40; pen++)
{
- colortable_entry_set_value(machine.colortable, 0x0200 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
- colortable_entry_set_value(machine.colortable, 0x1200 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine().colortable, 0x0200 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
+ colortable_entry_set_value(machine().colortable, 0x1200 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff));
- colortable_entry_set_value(machine.colortable, 0x0a00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
- colortable_entry_set_value(machine.colortable, 0x1a00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine().colortable, 0x0a00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
+ colortable_entry_set_value(machine().colortable, 0x1a00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff));
}
}
/* layers have 6 bits per pixel, but the color code has a 16 colors granularity */
-PALETTE_INIT( jjsquawk )
+PALETTE_INIT_MEMBER(seta_state,jjsquawk)
{
int color, pen;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x600);
+ machine().colortable = colortable_alloc(machine(), 0x600);
for (color = 0; color < 0x20; color++)
for (pen = 0; pen < 0x40; pen++)
{
- colortable_entry_set_value(machine.colortable, 0x0200 + ((color << 6) | pen), 0x400 + (((color << 4) + pen) & 0x1ff)); // used by madshark
- colortable_entry_set_value(machine.colortable, 0x1200 + ((color << 6) | pen), 0x400 + (((color << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine().colortable, 0x0200 + ((color << 6) | pen), 0x400 + (((color << 4) + pen) & 0x1ff)); // used by madshark
+ colortable_entry_set_value(machine().colortable, 0x1200 + ((color << 6) | pen), 0x400 + (((color << 4) + pen) & 0x1ff));
- colortable_entry_set_value(machine.colortable, 0x0a00 + ((color << 6) | pen), 0x200 + (((color << 4) + pen) & 0x1ff)); // used by madshark
- colortable_entry_set_value(machine.colortable, 0x1a00 + ((color << 6) | pen), 0x200 + (((color << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine().colortable, 0x0a00 + ((color << 6) | pen), 0x200 + (((color << 4) + pen) & 0x1ff)); // used by madshark
+ colortable_entry_set_value(machine().colortable, 0x1a00 + ((color << 6) | pen), 0x200 + (((color << 4) + pen) & 0x1ff));
}
}
/* layer 0 is 6 bit per pixel, but the color code has a 16 colors granularity */
-PALETTE_INIT( zingzip )
+PALETTE_INIT_MEMBER(seta_state,zingzip)
{
int color, pen;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x600);
+ machine().colortable = colortable_alloc(machine(), 0x600);
for (color = 0; color < 0x20; color++)
for (pen = 0; pen < 0x40; pen++)
{
- colortable_entry_set_value(machine.colortable, 0x400 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
- colortable_entry_set_value(machine.colortable, 0xc00 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine().colortable, 0x400 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
+ colortable_entry_set_value(machine().colortable, 0xc00 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff));
}
}
// color prom
-PALETTE_INIT( inttoote )
+PALETTE_INIT_MEMBER(seta_state,inttoote)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int x;
for (x = 0; x < 0x200 ; x++)
{
int data = (color_prom[x*2] <<8) | color_prom[x*2+1];
- palette_set_color_rgb(machine, x, pal5bit(data >> 10),pal5bit(data >> 5),pal5bit(data >> 0));
+ palette_set_color_rgb(machine(), x, pal5bit(data >> 10),pal5bit(data >> 5),pal5bit(data >> 0));
}
}
-PALETTE_INIT( setaroul )
+PALETTE_INIT_MEMBER(seta_state,setaroul)
{
- machine.gfx[0]->set_granularity(16);
- machine.gfx[1]->set_granularity(16);
+ machine().gfx[0]->set_granularity(16);
+ machine().gfx[1]->set_granularity(16);
- PALETTE_INIT_CALL(inttoote);
+ PALETTE_INIT_CALL_MEMBER(inttoote);
}
-PALETTE_INIT( usclssic )
+PALETTE_INIT_MEMBER(seta_state,usclssic)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int color, pen;
int x;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x400);
+ machine().colortable = colortable_alloc(machine(), 0x400);
/* DECODE PROM */
for (x = 0; x < 0x200 ; x++)
@@ -701,16 +696,16 @@ PALETTE_INIT( usclssic )
rgb_t color = MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
if (x >= 0x100)
- colortable_palette_set_color(machine.colortable, x + 0x000, color);
+ colortable_palette_set_color(machine().colortable, x + 0x000, color);
else
- colortable_palette_set_color(machine.colortable, x + 0x300, color);
+ colortable_palette_set_color(machine().colortable, x + 0x300, color);
}
for (color = 0; color < 0x20; color++)
for (pen = 0; pen < 0x40; pen++)
{
- colortable_entry_set_value(machine.colortable, 0x200 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
- colortable_entry_set_value(machine.colortable, 0xa00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine().colortable, 0x200 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
+ colortable_entry_set_value(machine().colortable, 0xa00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff));
}
}
diff --git a/src/mame/video/seta2.c b/src/mame/video/seta2.c
index ef09a8b33f3..7e65cdea147 100644
--- a/src/mame/video/seta2.c
+++ b/src/mame/video/seta2.c
@@ -442,40 +442,37 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
***************************************************************************/
-VIDEO_START( seta2 )
+VIDEO_START_MEMBER(seta2_state,seta2)
{
- seta2_state *state = machine.driver_data<seta2_state>();
- machine.gfx[2]->set_granularity(16);
- machine.gfx[3]->set_granularity(16);
- machine.gfx[4]->set_granularity(16);
- machine.gfx[5]->set_granularity(16);
+ machine().gfx[2]->set_granularity(16);
+ machine().gfx[3]->set_granularity(16);
+ machine().gfx[4]->set_granularity(16);
+ machine().gfx[5]->set_granularity(16);
- state->m_buffered_spriteram = auto_alloc_array(machine, UINT16, state->m_spriteram.bytes()/2);
+ m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2);
- state->m_xoffset = 0;
- state->m_yoffset = 0;
+ m_xoffset = 0;
+ m_yoffset = 0;
//TODO:FIX
- //state_save_register_global_pointer(machine, state->m_vregs, 0x40);
+ //state_save_register_global_pointer(machine(), m_vregs, 0x40);
}
-VIDEO_START( seta2_xoffset )
+VIDEO_START_MEMBER(seta2_state,seta2_xoffset)
{
- seta2_state *state = machine.driver_data<seta2_state>();
- VIDEO_START_CALL(seta2);
+ VIDEO_START_CALL_MEMBER(seta2);
- state->m_xoffset = 0x200;
+ m_xoffset = 0x200;
}
-VIDEO_START( seta2_yoffset )
+VIDEO_START_MEMBER(seta2_state,seta2_yoffset)
{
- seta2_state *state = machine.driver_data<seta2_state>();
- VIDEO_START_CALL(seta2);
+ VIDEO_START_CALL_MEMBER(seta2);
- state->m_yoffset = 0x10;
+ m_yoffset = 0x10;
}
SCREEN_UPDATE_IND16( seta2 )
diff --git a/src/mame/video/sf.c b/src/mame/video/sf.c
index 6737b079d30..68241ba0662 100644
--- a/src/mame/video/sf.c
+++ b/src/mame/video/sf.c
@@ -51,16 +51,15 @@ TILE_GET_INFO_MEMBER(sf_state::get_tx_tile_info)
***************************************************************************/
-VIDEO_START( sf )
+void sf_state::video_start()
{
- sf_state *state = machine.driver_data<sf_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sf_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 2048, 16);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sf_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 2048, 16);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sf_state::get_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sf_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 2048, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sf_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 2048, 16);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sf_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(3);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(3);
}
diff --git a/src/mame/video/shadfrce.c b/src/mame/video/shadfrce.c
index a0d2bd047c7..b6732fc9ae0 100644
--- a/src/mame/video/shadfrce.c
+++ b/src/mame/video/shadfrce.c
@@ -61,19 +61,18 @@ WRITE16_MEMBER(shadfrce_state::shadfrce_bg1videoram_w)
-VIDEO_START( shadfrce )
+void shadfrce_state::video_start()
{
- shadfrce_state *state = machine.driver_data<shadfrce_state>();
- state->m_fgtilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(shadfrce_state::get_shadfrce_fgtile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
- state->m_fgtilemap->set_transparent_pen(0);
+ m_fgtilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(shadfrce_state::get_shadfrce_fgtile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ m_fgtilemap->set_transparent_pen(0);
- state->m_bg0tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(shadfrce_state::get_shadfrce_bg0tile_info),state),TILEMAP_SCAN_ROWS, 16, 16,32,32);
- state->m_bg0tilemap->set_transparent_pen(0);
+ m_bg0tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(shadfrce_state::get_shadfrce_bg0tile_info),this),TILEMAP_SCAN_ROWS, 16, 16,32,32);
+ m_bg0tilemap->set_transparent_pen(0);
- state->m_bg1tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(shadfrce_state::get_shadfrce_bg1tile_info),state),TILEMAP_SCAN_ROWS, 16, 16,32,32);
+ m_bg1tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(shadfrce_state::get_shadfrce_bg1tile_info),this),TILEMAP_SCAN_ROWS, 16, 16,32,32);
- state->m_spvideoram_old = auto_alloc_array(machine, UINT16, state->m_spvideoram.bytes()/2);
+ m_spvideoram_old = auto_alloc_array(machine(), UINT16, m_spvideoram.bytes()/2);
}
WRITE16_MEMBER(shadfrce_state::shadfrce_bg0scrollx_w)
diff --git a/src/mame/video/shangha3.c b/src/mame/video/shangha3.c
index b72652686d1..d8ceef60d08 100644
--- a/src/mame/video/shangha3.c
+++ b/src/mame/video/shangha3.c
@@ -63,23 +63,22 @@ Word | Bit(s) | Use
-VIDEO_START( shangha3 )
+void shangha3_state::video_start()
{
- shangha3_state *state = machine.driver_data<shangha3_state>();
int i;
- machine.primary_screen->register_screen_bitmap(state->m_rawbitmap);
+ machine().primary_screen->register_screen_bitmap(m_rawbitmap);
for (i = 0;i < 14;i++)
- state->m_drawmode_table[i] = DRAWMODE_SOURCE;
- state->m_drawmode_table[14] = state->m_do_shadows ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
- state->m_drawmode_table[15] = DRAWMODE_NONE;
+ m_drawmode_table[i] = DRAWMODE_SOURCE;
+ m_drawmode_table[14] = m_do_shadows ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
+ m_drawmode_table[15] = DRAWMODE_NONE;
- if (state->m_do_shadows)
+ if (m_do_shadows)
{
/* Prepare the shadow table */
for (i = 0;i < 128;i++)
- machine.shadow_table[i] = i+128;
+ machine().shadow_table[i] = i+128;
}
}
diff --git a/src/mame/video/shangkid.c b/src/mame/video/shangkid.c
index e6b97c2dbcc..1741510dc42 100644
--- a/src/mame/video/shangkid.c
+++ b/src/mame/video/shangkid.c
@@ -45,10 +45,9 @@ TILE_GET_INFO_MEMBER(shangkid_state::get_bg_tile_info){
(machine().root_device().memregion( "proms" )->base()[0x800+color*4]==2)?1:0;
}
-VIDEO_START( shangkid )
+VIDEO_START_MEMBER(shangkid_state,shangkid)
{
- shangkid_state *state = machine.driver_data<shangkid_state>();
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(shangkid_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(shangkid_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
}
WRITE8_MEMBER(shangkid_state::shangkid_videoram_w)
@@ -198,13 +197,13 @@ SCREEN_UPDATE_IND16( shangkid )
}
-PALETTE_INIT( dynamski )
+PALETTE_INIT_MEMBER(shangkid_state,dynamski)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -212,7 +211,7 @@ PALETTE_INIT( dynamski )
UINT16 data = (color_prom[i | 0x20] << 8) | color_prom[i];
rgb_t color = MAKE_RGB(pal5bit(data >> 1), pal5bit(data >> 6), pal5bit(data >> 11));
- colortable_palette_set_color(machine.colortable, i, color);
+ colortable_palette_set_color(machine().colortable, i, color);
}
/* color_prom now points to the beginning of the lookup table */
@@ -222,14 +221,14 @@ PALETTE_INIT( dynamski )
for (i = 0; i < 0x40; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites */
for (i = 0x40; i < 0x80; i++)
{
UINT8 ctabentry = (color_prom[(i - 0x40) + 0x100] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
diff --git a/src/mame/video/shaolins.c b/src/mame/video/shaolins.c
index abc3b71ce36..33eaf9c3ef9 100644
--- a/src/mame/video/shaolins.c
+++ b/src/mame/video/shaolins.c
@@ -26,9 +26,9 @@
bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE
***************************************************************************/
-PALETTE_INIT( shaolins )
+void shaolins_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[4] = { 2200, 1000, 470, 220 };
double rweights[4], gweights[4], bweights[4];
int i;
@@ -40,7 +40,7 @@ PALETTE_INIT( shaolins )
4, resistances, bweights, 470, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( shaolins )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table,*/
@@ -84,7 +84,7 @@ PALETTE_INIT( shaolins )
for (j = 0; j < 8; j++)
{
UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine.colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
+ colortable_entry_set_value(machine().colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
}
}
}
@@ -143,14 +143,13 @@ TILE_GET_INFO_MEMBER(shaolins_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( shaolins )
+void shaolins_state::video_start()
{
- shaolins_state *state = machine.driver_data<shaolins_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(shaolins_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(shaolins_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_scroll_cols(32);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/shisen.c b/src/mame/video/shisen.c
index ee966f786aa..2969e8c13c5 100644
--- a/src/mame/video/shisen.c
+++ b/src/mame/video/shisen.c
@@ -50,11 +50,10 @@ TILE_GET_INFO_MEMBER(shisen_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( sichuan2 )
+void shisen_state::video_start()
{
- shisen_state *state = machine.driver_data<shisen_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(shisen_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(shisen_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 64, 32);
}
diff --git a/src/mame/video/shootout.c b/src/mame/video/shootout.c
index dd668128c1c..8e66d9c90f9 100644
--- a/src/mame/video/shootout.c
+++ b/src/mame/video/shootout.c
@@ -7,13 +7,13 @@
#include "includes/shootout.h"
-PALETTE_INIT( shootout )
+void shootout_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -33,7 +33,7 @@ PALETTE_INIT( shootout )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -79,13 +79,12 @@ WRITE8_MEMBER(shootout_state::shootout_textram_w)
m_foreground->mark_tile_dirty(offset&0x3ff );
}
-VIDEO_START( shootout )
+void shootout_state::video_start()
{
- shootout_state *state = machine.driver_data<shootout_state>();
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(shootout_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_foreground = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(shootout_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_foreground->set_transparent_pen(0 );
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(shootout_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_foreground = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(shootout_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_foreground->set_transparent_pen(0 );
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_bits )
diff --git a/src/mame/video/shuuz.c b/src/mame/video/shuuz.c
index a1f3f25f86d..c635a8ea579 100644
--- a/src/mame/video/shuuz.c
+++ b/src/mame/video/shuuz.c
@@ -33,7 +33,7 @@ TILE_GET_INFO_MEMBER(shuuz_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( shuuz )
+VIDEO_START_MEMBER(shuuz_state,shuuz)
{
static const atarimo_desc modesc =
{
@@ -71,13 +71,12 @@ VIDEO_START( shuuz )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- shuuz_state *state = machine.driver_data<shuuz_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(shuuz_state::get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(shuuz_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
}
diff --git a/src/mame/video/sidearms.c b/src/mame/video/sidearms.c
index 4b73defabbe..cd6a5942fba 100644
--- a/src/mame/video/sidearms.c
+++ b/src/mame/video/sidearms.c
@@ -137,32 +137,31 @@ TILEMAP_MAPPER_MEMBER(sidearms_state::sidearms_tilemap_scan)
return ((offset & 0xf801) | ((offset & 0x0700) >> 7) | ((offset & 0x00fe) << 3)) & 0x7fff;
}
-VIDEO_START( sidearms )
+void sidearms_state::video_start()
{
- sidearms_state *state = machine.driver_data<sidearms_state>();
- state->m_tilerom = state->memregion("gfx4")->base();
+ m_tilerom = memregion("gfx4")->base();
- if (!state->m_gameid)
+ if (!m_gameid)
{
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sidearms_state::get_sidearms_bg_tile_info),state), tilemap_mapper_delegate(FUNC(sidearms_state::sidearms_tilemap_scan),state),
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sidearms_state::get_sidearms_bg_tile_info),this), tilemap_mapper_delegate(FUNC(sidearms_state::sidearms_tilemap_scan),this),
32, 32, 128, 128);
- state->m_bg_tilemap->set_transparent_pen(15);
+ m_bg_tilemap->set_transparent_pen(15);
}
else
{
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sidearms_state::get_philko_bg_tile_info),state), tilemap_mapper_delegate(FUNC(sidearms_state::sidearms_tilemap_scan),state), 32, 32, 128, 128);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sidearms_state::get_philko_bg_tile_info),this), tilemap_mapper_delegate(FUNC(sidearms_state::sidearms_tilemap_scan),this), 32, 32, 128, 128);
}
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sidearms_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sidearms_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 64, 64);
- state->m_fg_tilemap->set_transparent_pen(3);
+ m_fg_tilemap->set_transparent_pen(3);
- state->m_hflop_74a_n = 1;
- state->m_latch_374 = state->m_vcount_191 = state->m_hcount_191 = 0;
+ m_hflop_74a_n = 1;
+ m_latch_374 = m_vcount_191 = m_hcount_191 = 0;
- state->m_flipon = state->m_charon = state->m_staron = state->m_objon = state->m_bgon = 0;
+ m_flipon = m_charon = m_staron = m_objon = m_bgon = 0;
}
static void draw_sprites_region(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset, int end_offset )
diff --git a/src/mame/video/sidepckt.c b/src/mame/video/sidepckt.c
index 269ff6af3b0..b5dac7f1586 100644
--- a/src/mame/video/sidepckt.c
+++ b/src/mame/video/sidepckt.c
@@ -2,12 +2,12 @@
#include "includes/sidepckt.h"
-PALETTE_INIT( sidepckt )
+void sidepckt_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -24,13 +24,13 @@ PALETTE_INIT( sidepckt )
bit3 = (color_prom[i] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -61,15 +61,14 @@ TILE_GET_INFO_MEMBER(sidepckt_state::get_tile_info)
***************************************************************************/
-VIDEO_START( sidepckt )
+void sidepckt_state::video_start()
{
- sidepckt_state *state = machine.driver_data<sidepckt_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sidepckt_state::get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sidepckt_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg_tilemap->set_transmask(0,0xff,0x00); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1,0x01,0xfe); /* split type 1 has pen 0 transparent in front half */
+ m_bg_tilemap->set_transmask(0,0xff,0x00); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1,0x01,0xfe); /* split type 1 has pen 0 transparent in front half */
- machine.tilemap().set_flip_all(TILEMAP_FLIPX);
+ machine().tilemap().set_flip_all(TILEMAP_FLIPX);
}
diff --git a/src/mame/video/silkroad.c b/src/mame/video/silkroad.c
index 95b3dbe9567..6a3a6cd6937 100644
--- a/src/mame/video/silkroad.c
+++ b/src/mame/video/silkroad.c
@@ -123,16 +123,15 @@ WRITE32_MEMBER(silkroad_state::silkroad_fgram3_w)
m_fg3_tilemap->mark_tile_dirty(offset);
}
-VIDEO_START(silkroad)
+void silkroad_state::video_start()
{
- silkroad_state *state = machine.driver_data<silkroad_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(silkroad_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_fg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(silkroad_state::get_fg2_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_fg3_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(silkroad_state::get_fg3_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(silkroad_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_fg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(silkroad_state::get_fg2_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_fg3_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(silkroad_state::get_fg3_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_fg2_tilemap->set_transparent_pen(0);
- state->m_fg3_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_fg2_tilemap->set_transparent_pen(0);
+ m_fg3_tilemap->set_transparent_pen(0);
}
SCREEN_UPDATE_IND16(silkroad)
diff --git a/src/mame/video/simpl156.c b/src/mame/video/simpl156.c
index 49d6e90782d..0b03304530b 100644
--- a/src/mame/video/simpl156.c
+++ b/src/mame/video/simpl156.c
@@ -8,22 +8,21 @@
#include "video/decospr.h"
-VIDEO_START( simpl156 )
+void simpl156_state::video_start()
{
- simpl156_state *state = machine.driver_data<simpl156_state>();
/* allocate the ram as 16-bit (we do it here because the CPU is 32-bit) */
- state->m_pf1_rowscroll = auto_alloc_array_clear(machine, UINT16, 0x800/2);
- state->m_pf2_rowscroll = auto_alloc_array_clear(machine, UINT16, 0x800/2);
- state->m_spriteram = auto_alloc_array_clear(machine, UINT16, 0x2000/2);
- state->m_generic_paletteram_16.allocate(0x1000/2);
+ m_pf1_rowscroll = auto_alloc_array_clear(machine(), UINT16, 0x800/2);
+ m_pf2_rowscroll = auto_alloc_array_clear(machine(), UINT16, 0x800/2);
+ m_spriteram = auto_alloc_array_clear(machine(), UINT16, 0x2000/2);
+ m_generic_paletteram_16.allocate(0x1000/2);
- memset(state->m_spriteram, 0xff, 0x2000);
+ memset(m_spriteram, 0xff, 0x2000);
/* and register the allocated ram so that save states still work */
- state->save_pointer(NAME(state->m_pf1_rowscroll), 0x800/2);
- state->save_pointer(NAME(state->m_pf2_rowscroll), 0x800/2);
- state->save_pointer(NAME(state->m_spriteram), 0x2000/2);
+ save_pointer(NAME(m_pf1_rowscroll), 0x800/2);
+ save_pointer(NAME(m_pf2_rowscroll), 0x800/2);
+ save_pointer(NAME(m_spriteram), 0x2000/2);
}
SCREEN_UPDATE_IND16( simpl156 )
diff --git a/src/mame/video/skullxbo.c b/src/mame/video/skullxbo.c
index ae09ea53f98..96c8650ca26 100644
--- a/src/mame/video/skullxbo.c
+++ b/src/mame/video/skullxbo.c
@@ -43,7 +43,7 @@ TILE_GET_INFO_MEMBER(skullxbo_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( skullxbo )
+VIDEO_START_MEMBER(skullxbo_state,skullxbo)
{
static const atarimo_desc modesc =
{
@@ -81,17 +81,16 @@ VIDEO_START( skullxbo )
0, /* resulting value to indicate "special" */
0, /* callback routine for special entries */
};
- skullxbo_state *state = machine.driver_data<skullxbo_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(skullxbo_state::get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 16,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(skullxbo_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 16,8, 64,64);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(skullxbo_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 16,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(skullxbo_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 16,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/skydiver.c b/src/mame/video/skydiver.c
index 48f5467a60b..caed892a563 100644
--- a/src/mame/video/skydiver.c
+++ b/src/mame/video/skydiver.c
@@ -9,24 +9,23 @@
#include "sound/discrete.h"
-MACHINE_RESET( skydiver )
+void skydiver_state::machine_reset()
{
- skydiver_state *state = machine.driver_data<skydiver_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
/* reset all latches */
- state->skydiver_start_lamp_1_w(*space, 0, 0);
- state->skydiver_start_lamp_2_w(*space, 0, 0);
- state->skydiver_lamp_s_w(*space, 0, 0);
- state->skydiver_lamp_k_w(*space, 0, 0);
- state->skydiver_lamp_y_w(*space, 0, 0);
- state->skydiver_lamp_d_w(*space, 0, 0);
+ skydiver_start_lamp_1_w(*space, 0, 0);
+ skydiver_start_lamp_2_w(*space, 0, 0);
+ skydiver_lamp_s_w(*space, 0, 0);
+ skydiver_lamp_k_w(*space, 0, 0);
+ skydiver_lamp_y_w(*space, 0, 0);
+ skydiver_lamp_d_w(*space, 0, 0);
output_set_value("lampi", 0);
output_set_value("lampv", 0);
output_set_value("lampe", 0);
output_set_value("lampr", 0);
- state->skydiver_width_w(*space, 0, 0);
- state->skydiver_coin_lockout_w(*space, 0, 0);
+ skydiver_width_w(*space, 0, 0);
+ skydiver_coin_lockout_w(*space, 0, 0);
}
@@ -50,10 +49,9 @@ TILE_GET_INFO_MEMBER(skydiver_state::get_tile_info)
*
*************************************/
-VIDEO_START( skydiver )
+void skydiver_state::video_start()
{
- skydiver_state *state = machine.driver_data<skydiver_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(skydiver_state::get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(skydiver_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
}
diff --git a/src/mame/video/skyfox.c b/src/mame/video/skyfox.c
index 158f87d2e75..e59539a0d19 100644
--- a/src/mame/video/skyfox.c
+++ b/src/mame/video/skyfox.c
@@ -87,9 +87,9 @@ WRITE8_MEMBER(skyfox_state::skyfox_vregs_w)
***************************************************************************/
-PALETTE_INIT( skyfox )
+void skyfox_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 256; i++)
@@ -115,13 +115,13 @@ PALETTE_INIT( skyfox )
bit3 = (color_prom[i + 2*256] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
/* Grey scale for the background??? */
for (i = 0; i < 256; i++)
{
- palette_set_color(machine,i + 256, MAKE_RGB(i, i, i));
+ palette_set_color(machine(),i + 256, MAKE_RGB(i, i, i));
}
}
diff --git a/src/mame/video/skykid.c b/src/mame/video/skykid.c
index 758de8f1782..c818bc703d5 100644
--- a/src/mame/video/skykid.c
+++ b/src/mame/video/skykid.c
@@ -15,13 +15,13 @@
***************************************************************************/
-PALETTE_INIT( skykid )
+void skykid_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -30,7 +30,7 @@ PALETTE_INIT( skykid )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -38,13 +38,13 @@ PALETTE_INIT( skykid )
/* text palette */
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* tiles/sprites */
for (i = 0x100; i < 0x500; i++)
{
UINT8 ctabentry = color_prom[i - 0x100];
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -109,17 +109,16 @@ TILE_GET_INFO_MEMBER(skykid_state::bg_get_tile_info)
***************************************************************************/
-VIDEO_START( skykid )
+void skykid_state::video_start()
{
- skykid_state *state = machine.driver_data<skykid_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(skykid_state::tx_get_tile_info),state),tilemap_mapper_delegate(FUNC(skykid_state::tx_tilemap_scan),state), 8,8,36,28);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(skykid_state::bg_get_tile_info),state),TILEMAP_SCAN_ROWS, 8,8,64,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(skykid_state::tx_get_tile_info),this),tilemap_mapper_delegate(FUNC(skykid_state::tx_tilemap_scan),this), 8,8,36,28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(skykid_state::bg_get_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,64,32);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
- state_save_register_global(machine, state->m_priority);
- state_save_register_global(machine, state->m_scroll_x);
- state_save_register_global(machine, state->m_scroll_y);
+ state_save_register_global(machine(), m_priority);
+ state_save_register_global(machine(), m_scroll_x);
+ state_save_register_global(machine(), m_scroll_y);
}
diff --git a/src/mame/video/skyraid.c b/src/mame/video/skyraid.c
index cfc7575683f..7085e6b508b 100644
--- a/src/mame/video/skyraid.c
+++ b/src/mame/video/skyraid.c
@@ -8,11 +8,10 @@ Atari Sky Raider video emulation
#include "includes/skyraid.h"
-VIDEO_START( skyraid )
+void skyraid_state::video_start()
{
- skyraid_state *state = machine.driver_data<skyraid_state>();
- state->m_helper.allocate(128, 240);
+ m_helper.allocate(128, 240);
}
diff --git a/src/mame/video/slapfght.c b/src/mame/video/slapfght.c
index 520a8655bdf..421f968c40b 100644
--- a/src/mame/video/slapfght.c
+++ b/src/mame/video/slapfght.c
@@ -64,21 +64,19 @@ TILE_GET_INFO_MEMBER(slapfght_state::get_fix_tile_info)
***************************************************************************/
-VIDEO_START( perfrman )
+VIDEO_START_MEMBER(slapfght_state,perfrman)
{
- slapfght_state *state = machine.driver_data<slapfght_state>();
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(slapfght_state::get_pf_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(slapfght_state::get_pf_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_pf1_tilemap->set_transparent_pen(0);
+ m_pf1_tilemap->set_transparent_pen(0);
}
-VIDEO_START( slapfight )
+VIDEO_START_MEMBER(slapfght_state,slapfight)
{
- slapfght_state *state = machine.driver_data<slapfght_state>();
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(slapfght_state::get_pf1_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_fix_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(slapfght_state::get_fix_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(slapfght_state::get_pf1_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_fix_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(slapfght_state::get_fix_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_fix_tilemap->set_transparent_pen(0);
+ m_fix_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/slapshot.c b/src/mame/video/slapshot.c
index 92b249bb799..e87e3342222 100644
--- a/src/mame/video/slapshot.c
+++ b/src/mame/video/slapshot.c
@@ -4,30 +4,29 @@
/**********************************************************/
-VIDEO_START( slapshot )
+void slapshot_state::video_start()
{
- slapshot_state *state = machine.driver_data<slapshot_state>();
int i;
- state->m_spriteram_delayed = auto_alloc_array(machine, UINT16, state->m_spriteram.bytes() / 2);
- state->m_spriteram_buffered = auto_alloc_array(machine, UINT16, state->m_spriteram.bytes() / 2);
- state->m_spritelist = auto_alloc_array(machine, struct slapshot_tempsprite, 0x400);
+ m_spriteram_delayed = auto_alloc_array(machine(), UINT16, m_spriteram.bytes() / 2);
+ m_spriteram_buffered = auto_alloc_array(machine(), UINT16, m_spriteram.bytes() / 2);
+ m_spritelist = auto_alloc_array(machine(), struct slapshot_tempsprite, 0x400);
for (i = 0; i < 8; i ++)
- state->m_spritebank[i] = 0x400 * i;
-
- state->m_sprites_disabled = 1;
- state->m_sprites_active_area = 0;
-
- state->save_item(NAME(state->m_spritebank));
- state->save_item(NAME(state->m_sprites_disabled));
- state->save_item(NAME(state->m_sprites_active_area));
- state->save_item(NAME(state->m_sprites_master_scrollx));
- state->save_item(NAME(state->m_sprites_master_scrolly));
- state->save_item(NAME(state->m_sprites_flipscreen));
- state->save_item(NAME(state->m_prepare_sprites));
- state->save_pointer(NAME(state->m_spriteram_delayed), state->m_spriteram.bytes() / 2);
- state->save_pointer(NAME(state->m_spriteram_buffered), state->m_spriteram.bytes() / 2);
+ m_spritebank[i] = 0x400 * i;
+
+ m_sprites_disabled = 1;
+ m_sprites_active_area = 0;
+
+ save_item(NAME(m_spritebank));
+ save_item(NAME(m_sprites_disabled));
+ save_item(NAME(m_sprites_active_area));
+ save_item(NAME(m_sprites_master_scrollx));
+ save_item(NAME(m_sprites_master_scrolly));
+ save_item(NAME(m_sprites_flipscreen));
+ save_item(NAME(m_prepare_sprites));
+ save_pointer(NAME(m_spriteram_delayed), m_spriteram.bytes() / 2);
+ save_pointer(NAME(m_spriteram_buffered), m_spriteram.bytes() / 2);
}
/************************************************************
diff --git a/src/mame/video/snk.c b/src/mame/video/snk.c
index b81fcc7012d..93b112b7fa5 100644
--- a/src/mame/video/snk.c
+++ b/src/mame/video/snk.c
@@ -25,9 +25,9 @@
/**************************************************************************************/
-PALETTE_INIT( tnk3 )
+PALETTE_INIT_MEMBER(snk_state,tnk3)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
int num_colors = 0x400;
@@ -53,7 +53,7 @@ PALETTE_INIT( tnk3 )
bit3 = (color_prom[i + num_colors] >> 1) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -181,209 +181,198 @@ TILE_GET_INFO_MEMBER(snk_state::gwar_get_bg_tile_info)
/**************************************************************************************/
-static VIDEO_START( snk_3bpp_shadow )
+VIDEO_START_MEMBER(snk_state,snk_3bpp_shadow)
{
- snk_state *state = machine.driver_data<snk_state>();
int i;
- if(!(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if(!(machine().config().m_video_attributes & VIDEO_HAS_SHADOWS))
fatalerror("driver should use VIDEO_HAS_SHADOWS\n");
/* prepare shadow draw table */
- for(i = 0; i <= 5; i++) state->m_drawmode_table[i] = DRAWMODE_SOURCE;
- state->m_drawmode_table[6] = (machine.config().m_video_attributes & VIDEO_HAS_SHADOWS) ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
- state->m_drawmode_table[7] = DRAWMODE_NONE;
+ for(i = 0; i <= 5; i++) m_drawmode_table[i] = DRAWMODE_SOURCE;
+ m_drawmode_table[6] = (machine().config().m_video_attributes & VIDEO_HAS_SHADOWS) ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
+ m_drawmode_table[7] = DRAWMODE_NONE;
for (i = 0x000;i < 0x400;i++)
- machine.shadow_table[i] = i | 0x200;
+ machine().shadow_table[i] = i | 0x200;
}
-static VIDEO_START( snk_4bpp_shadow )
+VIDEO_START_MEMBER(snk_state,snk_4bpp_shadow)
{
- snk_state *state = machine.driver_data<snk_state>();
int i;
- if(!(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if(!(machine().config().m_video_attributes & VIDEO_HAS_SHADOWS))
fatalerror("driver should use VIDEO_HAS_SHADOWS\n");
/* prepare shadow draw table */
- for(i = 0; i <= 13; i++) state->m_drawmode_table[i] = DRAWMODE_SOURCE;
- state->m_drawmode_table[14] = DRAWMODE_SHADOW;
- state->m_drawmode_table[15] = DRAWMODE_NONE;
+ for(i = 0; i <= 13; i++) m_drawmode_table[i] = DRAWMODE_SOURCE;
+ m_drawmode_table[14] = DRAWMODE_SHADOW;
+ m_drawmode_table[15] = DRAWMODE_NONE;
/* all palette entries are not affected by shadow sprites... */
for (i = 0x000;i < 0x400;i++)
- machine.shadow_table[i] = i;
+ machine().shadow_table[i] = i;
/* ... except for tilemap colors */
for (i = 0x200;i < 0x300;i++)
- machine.shadow_table[i] = i + 0x100;
+ machine().shadow_table[i] = i + 0x100;
}
-VIDEO_START( marvins )
+VIDEO_START_MEMBER(snk_state,marvins)
{
- snk_state *state = machine.driver_data<snk_state>();
- VIDEO_START_CALL(snk_3bpp_shadow);
+ VIDEO_START_CALL_MEMBER(snk_3bpp_shadow);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_tx_tile_info),state), tilemap_mapper_delegate(FUNC(snk_state::marvins_tx_scan_cols),state), 8, 8, 36, 28);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_fg_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_bg_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_tx_tile_info),this), tilemap_mapper_delegate(FUNC(snk_state::marvins_tx_scan_cols),this), 8, 8, 36, 28);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_fg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_bg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
- state->m_tx_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_scrolldy(8, 8);
+ m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_scrolldy(8, 8);
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_fg_tilemap->set_scrolldx(15, 31);
- state->m_fg_tilemap->set_scrolldy(8, -32);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_scrolldx(15, 31);
+ m_fg_tilemap->set_scrolldy(8, -32);
- state->m_bg_tilemap->set_scrolldx(15, 31);
- state->m_bg_tilemap->set_scrolldy(8, -32);
+ m_bg_tilemap->set_scrolldx(15, 31);
+ m_bg_tilemap->set_scrolldy(8, -32);
- state->m_tx_tile_offset = 0;
+ m_tx_tile_offset = 0;
}
-VIDEO_START( jcross )
+VIDEO_START_MEMBER(snk_state,jcross)
{
- snk_state *state = machine.driver_data<snk_state>();
- VIDEO_START_CALL(snk_3bpp_shadow);
+ VIDEO_START_CALL_MEMBER(snk_3bpp_shadow);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_tx_tile_info),state), tilemap_mapper_delegate(FUNC(snk_state::marvins_tx_scan_cols),state), 8, 8, 36, 28);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::aso_get_bg_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 64, 64);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_tx_tile_info),this), tilemap_mapper_delegate(FUNC(snk_state::marvins_tx_scan_cols),this), 8, 8, 36, 28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::aso_get_bg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 64, 64);
- state->m_tx_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_scrolldy(8, 8);
+ m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_scrolldy(8, 8);
- state->m_bg_tilemap->set_scrolldx(15, 24);
- state->m_bg_tilemap->set_scrolldy(8, -32);
+ m_bg_tilemap->set_scrolldx(15, 24);
+ m_bg_tilemap->set_scrolldy(8, -32);
- state->m_num_sprites = 25;
- state->m_yscroll_mask = 0x1ff;
- state->m_bg_tile_offset = 0;
- state->m_tx_tile_offset = 0;
+ m_num_sprites = 25;
+ m_yscroll_mask = 0x1ff;
+ m_bg_tile_offset = 0;
+ m_tx_tile_offset = 0;
}
-VIDEO_START( sgladiat )
+VIDEO_START_MEMBER(snk_state,sgladiat)
{
- snk_state *state = machine.driver_data<snk_state>();
- VIDEO_START_CALL(snk_3bpp_shadow);
+ VIDEO_START_CALL_MEMBER(snk_3bpp_shadow);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_tx_tile_info),state), tilemap_mapper_delegate(FUNC(snk_state::marvins_tx_scan_cols),state), 8, 8, 36, 28);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::aso_get_bg_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_tx_tile_info),this), tilemap_mapper_delegate(FUNC(snk_state::marvins_tx_scan_cols),this), 8, 8, 36, 28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::aso_get_bg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
- state->m_tx_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_scrolldy(8, 8);
+ m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_scrolldy(8, 8);
- state->m_bg_tilemap->set_scrolldx(15, 24);
- state->m_bg_tilemap->set_scrolldy(8, -32);
+ m_bg_tilemap->set_scrolldx(15, 24);
+ m_bg_tilemap->set_scrolldy(8, -32);
- state->m_num_sprites = 25;
- state->m_yscroll_mask = 0x0ff;
- state->m_bg_tile_offset = 0;
- state->m_tx_tile_offset = 0;
+ m_num_sprites = 25;
+ m_yscroll_mask = 0x0ff;
+ m_bg_tile_offset = 0;
+ m_tx_tile_offset = 0;
}
-VIDEO_START( hal21 )
+VIDEO_START_MEMBER(snk_state,hal21)
{
- snk_state *state = machine.driver_data<snk_state>();
- VIDEO_START_CALL(jcross);
+ VIDEO_START_CALL_MEMBER(jcross);
- state->m_bg_tilemap->set_scrolldy(8, -32+256);
+ m_bg_tilemap->set_scrolldy(8, -32+256);
- state->m_num_sprites = 50;
- state->m_yscroll_mask = 0x1ff;
+ m_num_sprites = 50;
+ m_yscroll_mask = 0x1ff;
}
-VIDEO_START( aso )
+VIDEO_START_MEMBER(snk_state,aso)
{
- snk_state *state = machine.driver_data<snk_state>();
- VIDEO_START_CALL(jcross);
+ VIDEO_START_CALL_MEMBER(jcross);
- state->m_bg_tilemap->set_scrolldx(15+256, 24+256);
+ m_bg_tilemap->set_scrolldx(15+256, 24+256);
- state->m_num_sprites = 50;
- state->m_yscroll_mask = 0x1ff;
+ m_num_sprites = 50;
+ m_yscroll_mask = 0x1ff;
}
-VIDEO_START( tnk3 )
+VIDEO_START_MEMBER(snk_state,tnk3)
{
- snk_state *state = machine.driver_data<snk_state>();
- VIDEO_START_CALL(snk_3bpp_shadow);
+ VIDEO_START_CALL_MEMBER(snk_3bpp_shadow);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_tx_tile_info),state), tilemap_mapper_delegate(FUNC(snk_state::marvins_tx_scan_cols),state), 8, 8, 36, 28);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::tnk3_get_bg_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 64, 64);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::marvins_get_tx_tile_info),this), tilemap_mapper_delegate(FUNC(snk_state::marvins_tx_scan_cols),this), 8, 8, 36, 28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::tnk3_get_bg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 64, 64);
- state->m_tx_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_scrolldy(8, 8);
+ m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_scrolldy(8, 8);
- state->m_bg_tilemap->set_scrolldx(15, 24);
- state->m_bg_tilemap->set_scrolldy(8, -32);
+ m_bg_tilemap->set_scrolldx(15, 24);
+ m_bg_tilemap->set_scrolldy(8, -32);
- state->m_num_sprites = 50;
- state->m_yscroll_mask = 0x1ff;
- state->m_tx_tile_offset = 0;
+ m_num_sprites = 50;
+ m_yscroll_mask = 0x1ff;
+ m_tx_tile_offset = 0;
}
-VIDEO_START( ikari )
+VIDEO_START_MEMBER(snk_state,ikari)
{
- snk_state *state = machine.driver_data<snk_state>();
- VIDEO_START_CALL(snk_3bpp_shadow);
+ VIDEO_START_CALL_MEMBER(snk_3bpp_shadow);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::ikari_get_tx_tile_info),state), tilemap_mapper_delegate(FUNC(snk_state::marvins_tx_scan_cols),state), 8, 8, 36, 28);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::ikari_get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::ikari_get_tx_tile_info),this), tilemap_mapper_delegate(FUNC(snk_state::marvins_tx_scan_cols),this), 8, 8, 36, 28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::ikari_get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_scrolldy(8, 8);
+ m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_scrolldy(8, 8);
- state->m_bg_tilemap->set_scrolldx(15, 24);
- state->m_bg_tilemap->set_scrolldy(8, -32);
+ m_bg_tilemap->set_scrolldx(15, 24);
+ m_bg_tilemap->set_scrolldy(8, -32);
- state->m_tx_tile_offset = 0;
+ m_tx_tile_offset = 0;
}
-VIDEO_START( gwar )
+VIDEO_START_MEMBER(snk_state,gwar)
{
- snk_state *state = machine.driver_data<snk_state>();
int i;
/* prepare drawmode table */
- for(i = 0; i <= 14; i++) state->m_drawmode_table[i] = DRAWMODE_SOURCE;
- state->m_drawmode_table[15] = DRAWMODE_NONE;
+ for(i = 0; i <= 14; i++) m_drawmode_table[i] = DRAWMODE_SOURCE;
+ m_drawmode_table[15] = DRAWMODE_NONE;
- memset(state->m_empty_tile, 0xf, sizeof(state->m_empty_tile));
+ memset(m_empty_tile, 0xf, sizeof(m_empty_tile));
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::gwar_get_tx_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 50, 32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::gwar_get_bg_tile_info),state), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::gwar_get_tx_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 50, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk_state::gwar_get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
- state->m_bg_tilemap->set_scrolldx(16, 143);
- state->m_bg_tilemap->set_scrolldy(0, -32);
+ m_bg_tilemap->set_scrolldx(16, 143);
+ m_bg_tilemap->set_scrolldy(0, -32);
- state->m_tx_tile_offset = 0;
+ m_tx_tile_offset = 0;
- state->m_is_psychos = 0;
+ m_is_psychos = 0;
}
-VIDEO_START( psychos )
+VIDEO_START_MEMBER(snk_state,psychos)
{
- snk_state *state = machine.driver_data<snk_state>();
- VIDEO_START_CALL(gwar);
- state->m_is_psychos = 1;
+ VIDEO_START_CALL_MEMBER(gwar);
+ m_is_psychos = 1;
}
-VIDEO_START( tdfever )
+VIDEO_START_MEMBER(snk_state,tdfever)
{
- VIDEO_START_CALL(gwar);
- VIDEO_START_CALL(snk_4bpp_shadow);
+ VIDEO_START_CALL_MEMBER(gwar);
+ VIDEO_START_CALL_MEMBER(snk_4bpp_shadow);
}
/**************************************************************************************/
diff --git a/src/mame/video/snk6502.c b/src/mame/video/snk6502.c
index 275c0a76626..50648fc4329 100644
--- a/src/mame/video/snk6502.c
+++ b/src/mame/video/snk6502.c
@@ -22,13 +22,12 @@
Zarzon has a different PROM layout from the others.
***************************************************************************/
-PALETTE_INIT( snk6502 )
+PALETTE_INIT_MEMBER(snk6502_state,snk6502)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- snk6502_state *state = machine.driver_data<snk6502_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -56,22 +55,22 @@ PALETTE_INIT( snk6502 )
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- state->m_palette[i] = MAKE_RGB(r, g, b);
+ m_palette[i] = MAKE_RGB(r, g, b);
color_prom++;
}
- state->m_backcolor = 0; /* background color can be changed by the game */
+ m_backcolor = 0; /* background color can be changed by the game */
- for (i = 0; i < TOTAL_COLORS(machine,0); i++)
- palette_set_color(machine, COLOR(machine, 0, i), state->m_palette[i]);
+ for (i = 0; i < TOTAL_COLORS(machine(),0); i++)
+ palette_set_color(machine(), COLOR(machine(), 0, i), m_palette[i]);
- for (i = 0; i < TOTAL_COLORS(machine,1); i++)
+ for (i = 0; i < TOTAL_COLORS(machine(),1); i++)
{
if (i % 4 == 0)
- palette_set_color(machine, COLOR(machine, 1, i), state->m_palette[4 * state->m_backcolor + 0x20]);
+ palette_set_color(machine(), COLOR(machine(), 1, i), m_palette[4 * m_backcolor + 0x20]);
else
- palette_set_color(machine, COLOR(machine, 1, i), state->m_palette[i + 0x20]);
+ palette_set_color(machine(), COLOR(machine(), 1, i), m_palette[i + 0x20]);
}
}
@@ -172,26 +171,24 @@ TILE_GET_INFO_MEMBER(snk6502_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( snk6502 )
+VIDEO_START_MEMBER(snk6502_state,snk6502)
{
- snk6502_state *state = machine.driver_data<snk6502_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk6502_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk6502_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk6502_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk6502_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- machine.gfx[0]->set_source(state->m_charram);
+ machine().gfx[0]->set_source(m_charram);
}
-VIDEO_START( pballoon )
+VIDEO_START_MEMBER(snk6502_state,pballoon)
{
- snk6502_state *state = machine.driver_data<snk6502_state>();
- VIDEO_START_CALL( snk6502 );
+ VIDEO_START_CALL_MEMBER( snk6502 );
- state->m_bg_tilemap->set_scrolldy(-16, -16);
- state->m_fg_tilemap->set_scrolldy(-16, -16);
+ m_bg_tilemap->set_scrolldy(-16, -16);
+ m_fg_tilemap->set_scrolldy(-16, -16);
}
@@ -206,13 +203,12 @@ SCREEN_UPDATE_IND16( snk6502 )
/* Satan of Saturn */
-PALETTE_INIT( satansat )
+PALETTE_INIT_MEMBER(snk6502_state,satansat)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- snk6502_state *state = machine.driver_data<snk6502_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -240,22 +236,22 @@ PALETTE_INIT( satansat )
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- state->m_palette[i] = MAKE_RGB(r, g, b);
+ m_palette[i] = MAKE_RGB(r, g, b);
color_prom++;
}
- state->m_backcolor = 0; /* background color can be changed by the game */
+ m_backcolor = 0; /* background color can be changed by the game */
- for (i = 0; i < TOTAL_COLORS(machine,0); i++)
- palette_set_color(machine, COLOR(machine, 0, i), state->m_palette[4 * (i % 4) + (i / 4)]);
+ for (i = 0; i < TOTAL_COLORS(machine(),0); i++)
+ palette_set_color(machine(), COLOR(machine(), 0, i), m_palette[4 * (i % 4) + (i / 4)]);
- for (i = 0; i < TOTAL_COLORS(machine,1); i++)
+ for (i = 0; i < TOTAL_COLORS(machine(),1); i++)
{
if (i % 4 == 0)
- palette_set_color(machine, COLOR(machine, 1, i), state->m_palette[state->m_backcolor + 0x10]);
+ palette_set_color(machine(), COLOR(machine(), 1, i), m_palette[m_backcolor + 0x10]);
else
- palette_set_color(machine, COLOR(machine, 1, i), state->m_palette[4 * (i % 4) + (i / 4) + 0x10]);
+ palette_set_color(machine(), COLOR(machine(), 1, i), m_palette[4 * (i % 4) + (i / 4) + 0x10]);
}
}
@@ -307,14 +303,13 @@ TILE_GET_INFO_MEMBER(snk6502_state::satansat_get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( satansat )
+VIDEO_START_MEMBER(snk6502_state,satansat)
{
- snk6502_state *state = machine.driver_data<snk6502_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk6502_state::satansat_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk6502_state::satansat_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk6502_state::satansat_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk6502_state::satansat_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- machine.gfx[0]->set_source(state->m_charram);
+ machine().gfx[0]->set_source(m_charram);
}
diff --git a/src/mame/video/snk68.c b/src/mame/video/snk68.c
index c0f9dc31d02..38dc0b4558f 100644
--- a/src/mame/video/snk68.c
+++ b/src/mame/video/snk68.c
@@ -58,23 +58,21 @@ static void common_video_start(running_machine &machine)
state->m_fg_tilemap->set_scrolldy(0, machine.primary_screen->height() - 256);
}
-VIDEO_START( pow )
+void snk68_state::video_start()
{
- snk68_state *state = machine.driver_data<snk68_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk68_state::get_pow_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_fg_tile_offset = 0;
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk68_state::get_pow_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_fg_tile_offset = 0;
- common_video_start(machine);
+ common_video_start(machine());
}
-VIDEO_START( searchar )
+VIDEO_START_MEMBER(snk68_state,searchar)
{
- snk68_state *state = machine.driver_data<snk68_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snk68_state::get_searchar_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk68_state::get_searchar_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- common_video_start(machine);
+ common_video_start(machine());
}
/***************************************************************************
diff --git a/src/mame/video/snookr10.c b/src/mame/video/snookr10.c
index 4998d4578c9..b11d2dc7ded 100644
--- a/src/mame/video/snookr10.c
+++ b/src/mame/video/snookr10.c
@@ -55,9 +55,9 @@ WRITE8_MEMBER(snookr10_state::snookr10_colorram_w)
}
-PALETTE_INIT( snookr10 )
+void snookr10_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
/* GGBBBRRR */
int i;
@@ -71,7 +71,7 @@ PALETTE_INIT( snookr10 )
2, resistances_g, weights_g, 100, 0);
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -90,7 +90,7 @@ PALETTE_INIT( snookr10 )
bit1 = (color_prom[i] >> 7) & 0x01;
g = combine_2_weights(weights_g, bit0, bit1);
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
}
@@ -115,9 +115,9 @@ TILE_GET_INFO_MEMBER(snookr10_state::get_bg_tile_info)
* For more information, see the driver notes. *
**********************************************************/
-PALETTE_INIT( apple10 )
+PALETTE_INIT_MEMBER(snookr10_state,apple10)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
/* GGBBBRRR */
int i, cn;
@@ -131,7 +131,7 @@ PALETTE_INIT( apple10 )
2, resistances_g, weights_g, 100, 0);
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -153,7 +153,7 @@ PALETTE_INIT( apple10 )
/* encrypted color matrix */
cn = BITSWAP8(i,4,5,6,7,2,3,0,1);
- palette_set_color(machine, cn, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), cn, MAKE_RGB(r,g,b));
}
}
@@ -173,16 +173,14 @@ TILE_GET_INFO_MEMBER(snookr10_state::apple10_get_bg_tile_info)
}
-VIDEO_START( snookr10 )
+void snookr10_state::video_start()
{
- snookr10_state *state = machine.driver_data<snookr10_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snookr10_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 4, 8, 128, 30);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snookr10_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 128, 30);
}
-VIDEO_START( apple10 )
+VIDEO_START_MEMBER(snookr10_state,apple10)
{
- snookr10_state *state = machine.driver_data<snookr10_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(snookr10_state::apple10_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 4, 8, 128, 30);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snookr10_state::apple10_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 128, 30);
}
SCREEN_UPDATE_IND16( snookr10 )
diff --git a/src/mame/video/solomon.c b/src/mame/video/solomon.c
index a94c11e9e19..2197ff3b137 100644
--- a/src/mame/video/solomon.c
+++ b/src/mame/video/solomon.c
@@ -57,17 +57,16 @@ TILE_GET_INFO_MEMBER(solomon_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( solomon )
+void solomon_state::video_start()
{
- solomon_state *state = machine.driver_data<solomon_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(solomon_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(solomon_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(solomon_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(solomon_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/sonson.c b/src/mame/video/sonson.c
index 52236426d7e..cb528bbb32d 100644
--- a/src/mame/video/sonson.c
+++ b/src/mame/video/sonson.c
@@ -39,13 +39,13 @@
***************************************************************************/
-PALETTE_INIT( sonson )
+void sonson_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -74,7 +74,7 @@ PALETTE_INIT( sonson )
bit3 = (color_prom[i + 0x00] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -84,14 +84,14 @@ PALETTE_INIT( sonson )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites use colors 0x10-0x1f */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -129,12 +129,11 @@ TILE_GET_INFO_MEMBER(sonson_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( sonson )
+void sonson_state::video_start()
{
- sonson_state *state = machine.driver_data<sonson_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sonson_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sonson_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scroll_rows(32);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/spacefb.c b/src/mame/video/spacefb.c
index 92951f7293a..559310c88ec 100644
--- a/src/mame/video/spacefb.c
+++ b/src/mame/video/spacefb.c
@@ -65,9 +65,8 @@ WRITE8_MEMBER(spacefb_state::spacefb_port_2_w)
*
*************************************/
-VIDEO_START( spacefb )
+void spacefb_state::video_start()
{
- spacefb_state *state = machine.driver_data<spacefb_state>();
int width, height;
/* compute the color gun weights */
@@ -75,18 +74,18 @@ VIDEO_START( spacefb )
static const int resistances_b [] = { 470, 220 };
compute_resistor_weights(0, 0xff, -1.0,
- 3, resistances_rg, state->m_color_weights_rg, 470, 0,
- 2, resistances_b, state->m_color_weights_b, 470, 0,
+ 3, resistances_rg, m_color_weights_rg, 470, 0,
+ 2, resistances_b, m_color_weights_b, 470, 0,
0, 0, 0, 0, 0);
- width = machine.primary_screen->width();
- height = machine.primary_screen->height();
- state->m_object_present_map = auto_alloc_array(machine, UINT8, width * height);
+ width = machine().primary_screen->width();
+ height = machine().primary_screen->height();
+ m_object_present_map = auto_alloc_array(machine(), UINT8, width * height);
/* this start value positions the stars to match the flyer screen shot,
but most likely, the actual star position is random as the hardware
uses whatever value is on the shift register on power-up */
- state->m_star_shift_reg = 0x18f89;
+ m_star_shift_reg = 0x18f89;
}
diff --git a/src/mame/video/spbactn.c b/src/mame/video/spbactn.c
index 7c627e84c9e..26852ade003 100644
--- a/src/mame/video/spbactn.c
+++ b/src/mame/video/spbactn.c
@@ -106,13 +106,12 @@ static int draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const re
}
-VIDEO_START( spbactn )
+void spbactn_state::video_start()
{
- spbactn_state *state = machine.driver_data<spbactn_state>();
/* allocate bitmaps */
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_bg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_fg);
}
SCREEN_UPDATE_RGB32( spbactn )
diff --git a/src/mame/video/spdodgeb.c b/src/mame/video/spdodgeb.c
index 1d1848de7e2..90668196c26 100644
--- a/src/mame/video/spdodgeb.c
+++ b/src/mame/video/spdodgeb.c
@@ -3,13 +3,13 @@
#include "includes/spdodgeb.h"
-PALETTE_INIT( spdodgeb )
+void spdodgeb_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -27,13 +27,13 @@ PALETTE_INIT( spdodgeb )
bit3 = (color_prom[0] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
}
@@ -69,10 +69,9 @@ TILE_GET_INFO_MEMBER(spdodgeb_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( spdodgeb )
+void spdodgeb_state::video_start()
{
- spdodgeb_state *state = machine.driver_data<spdodgeb_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(spdodgeb_state::get_bg_tile_info),state),tilemap_mapper_delegate(FUNC(spdodgeb_state::background_scan),state),8,8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(spdodgeb_state::get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(spdodgeb_state::background_scan),this),8,8,64,32);
}
diff --git a/src/mame/video/speedatk.c b/src/mame/video/speedatk.c
index 10b21b5607b..ac4529b52bb 100644
--- a/src/mame/video/speedatk.c
+++ b/src/mame/video/speedatk.c
@@ -8,13 +8,13 @@
#include "video/mc6845.h"
-PALETTE_INIT( speedatk )
+void speedatk_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x10);
+ machine().colortable = colortable_alloc(machine(), 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -40,7 +40,7 @@ PALETTE_INIT( speedatk )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -49,7 +49,7 @@ PALETTE_INIT( speedatk )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -65,7 +65,7 @@ WRITE8_MEMBER(speedatk_state::speedatk_colorram_w)
m_colorram[offset] = data;
}
-VIDEO_START( speedatk )
+void speedatk_state::video_start()
{
}
diff --git a/src/mame/video/speedbal.c b/src/mame/video/speedbal.c
index 9ff44e0306b..ca110a1781d 100644
--- a/src/mame/video/speedbal.c
+++ b/src/mame/video/speedbal.c
@@ -34,17 +34,16 @@ TILE_GET_INFO_MEMBER(speedbal_state::get_tile_info_fg)
* *
*************************************/
-VIDEO_START( speedbal )
+void speedbal_state::video_start()
{
- speedbal_state *state = machine.driver_data<speedbal_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(speedbal_state::get_tile_info_bg),state), TILEMAP_SCAN_COLS_FLIP_X, 16, 16, 16, 16);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(speedbal_state::get_tile_info_fg),state), TILEMAP_SCAN_COLS_FLIP_X, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(speedbal_state::get_tile_info_bg),this), TILEMAP_SCAN_COLS_FLIP_X, 16, 16, 16, 16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(speedbal_state::get_tile_info_fg),this), TILEMAP_SCAN_COLS_FLIP_X, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transmask(0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1,0x00f7,0x0000); /* split type 1 has pen 0-2, 4-7 transparent in front half */
+ m_bg_tilemap->set_transmask(0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1,0x00f7,0x0000); /* split type 1 has pen 0-2, 4-7 transparent in front half */
- state->m_fg_tilemap->set_transmask(0,0xffff,0x0001); /* split type 0 is totally transparent in front half and has pen 0 transparent in back half */
- state->m_fg_tilemap->set_transmask(1,0x0001,0x0001); /* split type 1 has pen 0 transparent in front and back half */
+ m_fg_tilemap->set_transmask(0,0xffff,0x0001); /* split type 0 is totally transparent in front half and has pen 0 transparent in back half */
+ m_fg_tilemap->set_transmask(1,0x0001,0x0001); /* split type 1 has pen 0 transparent in front and back half */
}
diff --git a/src/mame/video/speedspn.c b/src/mame/video/speedspn.c
index 3bb6d2dbd19..0ff4501e245 100644
--- a/src/mame/video/speedspn.c
+++ b/src/mame/video/speedspn.c
@@ -12,11 +12,10 @@ TILE_GET_INFO_MEMBER(speedspn_state::get_speedspn_tile_info)
SET_TILE_INFO_MEMBER(0,code,attr & 0x3f,(attr & 0x80) ? TILE_FLIPX : 0);
}
-VIDEO_START(speedspn)
+void speedspn_state::video_start()
{
- speedspn_state *state = machine.driver_data<speedspn_state>();
- state->m_vidram = auto_alloc_array(machine, UINT8, 0x1000 * 2);
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(speedspn_state::get_speedspn_tile_info),state),TILEMAP_SCAN_COLS, 8, 8,64,32);
+ m_vidram = auto_alloc_array(machine(), UINT8, 0x1000 * 2);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(speedspn_state::get_speedspn_tile_info),this),TILEMAP_SCAN_COLS, 8, 8,64,32);
}
WRITE8_MEMBER(speedspn_state::speedspn_vidram_w)
diff --git a/src/mame/video/splash.c b/src/mame/video/splash.c
index b50bd789e4a..5aa25d7bf5b 100644
--- a/src/mame/video/splash.c
+++ b/src/mame/video/splash.c
@@ -165,17 +165,16 @@ static void draw_bitmap(running_machine &machine, bitmap_ind16 &bitmap, const re
***************************************************************************/
-VIDEO_START( splash )
+void splash_state::video_start()
{
- splash_state *state = machine.driver_data<splash_state>();
- state->m_bg_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(splash_state::get_tile_info_splash_tilemap0),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(splash_state::get_tile_info_splash_tilemap1),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_bg_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(splash_state::get_tile_info_splash_tilemap0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(splash_state::get_tile_info_splash_tilemap1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_bg_tilemap[0]->set_transparent_pen(0);
- state->m_bg_tilemap[1]->set_transparent_pen(0);
+ m_bg_tilemap[0]->set_transparent_pen(0);
+ m_bg_tilemap[1]->set_transparent_pen(0);
- state->m_bg_tilemap[0]->set_scrollx(0, 4);
+ m_bg_tilemap[0]->set_scrollx(0, 4);
}
/***************************************************************************
diff --git a/src/mame/video/sprcros2.c b/src/mame/video/sprcros2.c
index e9241eb3f98..5e579981f42 100644
--- a/src/mame/video/sprcros2.c
+++ b/src/mame/video/sprcros2.c
@@ -7,13 +7,13 @@ Super Cross II (JPN Ver.)
#include "includes/sprcros2.h"
-PALETTE_INIT( sprcros2 )
+void sprcros2_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -37,9 +37,9 @@ PALETTE_INIT( sprcros2 )
bit0 = (color_prom[i] >> 6) & 0x01;
bit1 = (color_prom[i] >> 7) & 0x01;
b = 0x47 * bit0 + 0xb8 * bit1;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -49,14 +49,14 @@ PALETTE_INIT( sprcros2 )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | ((color_prom[i + 0x100] & 0x0f) << 4);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites & fg */
for (i = 0x100; i < 0x300; i++)
{
UINT8 ctabentry = color_prom[i + 0x100];
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -131,14 +131,13 @@ TILE_GET_INFO_MEMBER(sprcros2_state::get_sprcros2_fgtile_info)
0);
}
-VIDEO_START( sprcros2 )
+void sprcros2_state::video_start()
{
- sprcros2_state *state = machine.driver_data<sprcros2_state>();
- state->m_bgtilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sprcros2_state::get_sprcros2_bgtile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fgtilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sprcros2_state::get_sprcros2_fgtile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bgtilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sprcros2_state::get_sprcros2_bgtile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fgtilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sprcros2_state::get_sprcros2_fgtile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- colortable_configure_tilemap_groups(machine.colortable, state->m_fgtilemap, machine.gfx[2], 0);
+ colortable_configure_tilemap_groups(machine().colortable, m_fgtilemap, machine().gfx[2], 0);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
diff --git a/src/mame/video/sprint2.c b/src/mame/video/sprint2.c
index 39e45cd6ad9..1c3885742f7 100644
--- a/src/mame/video/sprint2.c
+++ b/src/mame/video/sprint2.c
@@ -8,29 +8,29 @@
#include "includes/sprint2.h"
-PALETTE_INIT( sprint2 )
+void sprint2_state::palette_init()
{
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 4);
-
- colortable_palette_set_color(machine.colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
- colortable_palette_set_color(machine.colortable, 1, MAKE_RGB(0x5b, 0x5b, 0x5b));
- colortable_palette_set_color(machine.colortable, 2, MAKE_RGB(0xa4, 0xa4, 0xa4));
- colortable_palette_set_color(machine.colortable, 3, MAKE_RGB(0xff, 0xff, 0xff));
-
- colortable_entry_set_value(machine.colortable, 0x0, 1); /* black playfield */
- colortable_entry_set_value(machine.colortable, 0x1, 0);
- colortable_entry_set_value(machine.colortable, 0x2, 1); /* white playfield */
- colortable_entry_set_value(machine.colortable, 0x3, 3);
-
- colortable_entry_set_value(machine.colortable, 0x4, 1); /* car #1 */
- colortable_entry_set_value(machine.colortable, 0x5, 3);
- colortable_entry_set_value(machine.colortable, 0x6, 1); /* car #2 */
- colortable_entry_set_value(machine.colortable, 0x7, 0);
- colortable_entry_set_value(machine.colortable, 0x8, 1); /* car #3 */
- colortable_entry_set_value(machine.colortable, 0x9, 2);
- colortable_entry_set_value(machine.colortable, 0xa, 1); /* car #4 */
- colortable_entry_set_value(machine.colortable, 0xb, 2);
+ machine().colortable = colortable_alloc(machine(), 4);
+
+ colortable_palette_set_color(machine().colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
+ colortable_palette_set_color(machine().colortable, 1, MAKE_RGB(0x5b, 0x5b, 0x5b));
+ colortable_palette_set_color(machine().colortable, 2, MAKE_RGB(0xa4, 0xa4, 0xa4));
+ colortable_palette_set_color(machine().colortable, 3, MAKE_RGB(0xff, 0xff, 0xff));
+
+ colortable_entry_set_value(machine().colortable, 0x0, 1); /* black playfield */
+ colortable_entry_set_value(machine().colortable, 0x1, 0);
+ colortable_entry_set_value(machine().colortable, 0x2, 1); /* white playfield */
+ colortable_entry_set_value(machine().colortable, 0x3, 3);
+
+ colortable_entry_set_value(machine().colortable, 0x4, 1); /* car #1 */
+ colortable_entry_set_value(machine().colortable, 0x5, 3);
+ colortable_entry_set_value(machine().colortable, 0x6, 1); /* car #2 */
+ colortable_entry_set_value(machine().colortable, 0x7, 0);
+ colortable_entry_set_value(machine().colortable, 0x8, 1); /* car #3 */
+ colortable_entry_set_value(machine().colortable, 0x9, 2);
+ colortable_entry_set_value(machine().colortable, 0xa, 1); /* car #4 */
+ colortable_entry_set_value(machine().colortable, 0xb, 2);
}
@@ -42,12 +42,11 @@ TILE_GET_INFO_MEMBER(sprint2_state::get_tile_info)
}
-VIDEO_START( sprint2 )
+void sprint2_state::video_start()
{
- sprint2_state *state = machine.driver_data<sprint2_state>();
- machine.primary_screen->register_screen_bitmap(state->m_helper);
+ machine().primary_screen->register_screen_bitmap(m_helper);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sprint2_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sprint2_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
}
diff --git a/src/mame/video/sprint4.c b/src/mame/video/sprint4.c
index 13a9c224899..20f9611c712 100644
--- a/src/mame/video/sprint4.c
+++ b/src/mame/video/sprint4.c
@@ -9,29 +9,29 @@ Atari Sprint 4 video emulation
#include "includes/sprint4.h"
-PALETTE_INIT( sprint4 )
+void sprint4_state::palette_init()
{
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 6);
-
- colortable_palette_set_color(machine.colortable, 0, MAKE_RGB(0x00, 0x00, 0x00)); /* black */
- colortable_palette_set_color(machine.colortable, 1, MAKE_RGB(0xfc, 0xdf, 0x80)); /* peach */
- colortable_palette_set_color(machine.colortable, 2, MAKE_RGB(0xf0, 0x00, 0xf0)); /* violet */
- colortable_palette_set_color(machine.colortable, 3, MAKE_RGB(0x00, 0xf0, 0x0f)); /* green */
- colortable_palette_set_color(machine.colortable, 4, MAKE_RGB(0x30, 0x4f, 0xff)); /* blue */
- colortable_palette_set_color(machine.colortable, 5, MAKE_RGB(0xff, 0xff, 0xff)); /* white */
-
- colortable_entry_set_value(machine.colortable, 0, 0);
- colortable_entry_set_value(machine.colortable, 2, 0);
- colortable_entry_set_value(machine.colortable, 4, 0);
- colortable_entry_set_value(machine.colortable, 6, 0);
- colortable_entry_set_value(machine.colortable, 8, 0);
-
- colortable_entry_set_value(machine.colortable, 1, 1);
- colortable_entry_set_value(machine.colortable, 3, 2);
- colortable_entry_set_value(machine.colortable, 5, 3);
- colortable_entry_set_value(machine.colortable, 7, 4);
- colortable_entry_set_value(machine.colortable, 9, 5);
+ machine().colortable = colortable_alloc(machine(), 6);
+
+ colortable_palette_set_color(machine().colortable, 0, MAKE_RGB(0x00, 0x00, 0x00)); /* black */
+ colortable_palette_set_color(machine().colortable, 1, MAKE_RGB(0xfc, 0xdf, 0x80)); /* peach */
+ colortable_palette_set_color(machine().colortable, 2, MAKE_RGB(0xf0, 0x00, 0xf0)); /* violet */
+ colortable_palette_set_color(machine().colortable, 3, MAKE_RGB(0x00, 0xf0, 0x0f)); /* green */
+ colortable_palette_set_color(machine().colortable, 4, MAKE_RGB(0x30, 0x4f, 0xff)); /* blue */
+ colortable_palette_set_color(machine().colortable, 5, MAKE_RGB(0xff, 0xff, 0xff)); /* white */
+
+ colortable_entry_set_value(machine().colortable, 0, 0);
+ colortable_entry_set_value(machine().colortable, 2, 0);
+ colortable_entry_set_value(machine().colortable, 4, 0);
+ colortable_entry_set_value(machine().colortable, 6, 0);
+ colortable_entry_set_value(machine().colortable, 8, 0);
+
+ colortable_entry_set_value(machine().colortable, 1, 1);
+ colortable_entry_set_value(machine().colortable, 3, 2);
+ colortable_entry_set_value(machine().colortable, 5, 3);
+ colortable_entry_set_value(machine().colortable, 7, 4);
+ colortable_entry_set_value(machine().colortable, 9, 5);
}
@@ -47,12 +47,11 @@ TILE_GET_INFO_MEMBER(sprint4_state::sprint4_tile_info)
}
-VIDEO_START( sprint4 )
+void sprint4_state::video_start()
{
- sprint4_state *state = machine.driver_data<sprint4_state>();
- machine.primary_screen->register_screen_bitmap(state->m_helper);
+ machine().primary_screen->register_screen_bitmap(m_helper);
- state->m_playfield = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sprint4_state::sprint4_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_playfield = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sprint4_state::sprint4_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/sprint8.c b/src/mame/video/sprint8.c
index c1a66503095..a5a31392637 100644
--- a/src/mame/video/sprint8.c
+++ b/src/mame/video/sprint8.c
@@ -8,23 +8,23 @@ Atari Sprint 8 video emulation
#include "includes/sprint8.h"
-PALETTE_INIT( sprint8 )
+void sprint8_state::palette_init()
{
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x12);
+ machine().colortable = colortable_alloc(machine(), 0x12);
for (i = 0; i < 0x10; i++)
{
- colortable_entry_set_value(machine.colortable, 2 * i + 0, 0x10);
- colortable_entry_set_value(machine.colortable, 2 * i + 1, i);
+ colortable_entry_set_value(machine().colortable, 2 * i + 0, 0x10);
+ colortable_entry_set_value(machine().colortable, 2 * i + 1, i);
}
- colortable_entry_set_value(machine.colortable, 0x20, 0x10);
- colortable_entry_set_value(machine.colortable, 0x21, 0x10);
- colortable_entry_set_value(machine.colortable, 0x22, 0x10);
- colortable_entry_set_value(machine.colortable, 0x23, 0x11);
+ colortable_entry_set_value(machine().colortable, 0x20, 0x10);
+ colortable_entry_set_value(machine().colortable, 0x21, 0x10);
+ colortable_entry_set_value(machine().colortable, 0x22, 0x10);
+ colortable_entry_set_value(machine().colortable, 0x23, 0x11);
}
@@ -111,17 +111,16 @@ WRITE8_MEMBER(sprint8_state::sprint8_video_ram_w)
}
-VIDEO_START( sprint8 )
+void sprint8_state::video_start()
{
- sprint8_state *state = machine.driver_data<sprint8_state>();
- machine.primary_screen->register_screen_bitmap(state->m_helper1);
- machine.primary_screen->register_screen_bitmap(state->m_helper2);
+ machine().primary_screen->register_screen_bitmap(m_helper1);
+ machine().primary_screen->register_screen_bitmap(m_helper2);
- state->m_tilemap1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sprint8_state::get_tile_info1),state), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
- state->m_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sprint8_state::get_tile_info2),state), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
+ m_tilemap1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sprint8_state::get_tile_info1),this), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
+ m_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sprint8_state::get_tile_info2),this), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
- state->m_tilemap1->set_scrolly(0, +24);
- state->m_tilemap2->set_scrolly(0, +24);
+ m_tilemap1->set_scrolly(0, +24);
+ m_tilemap2->set_scrolly(0, +24);
}
diff --git a/src/mame/video/spy.c b/src/mame/video/spy.c
index a73934694a9..2fa4792046d 100644
--- a/src/mame/video/spy.c
+++ b/src/mame/video/spy.c
@@ -44,14 +44,13 @@ void spy_sprite_callback( running_machine &machine, int *code, int *color, int *
***************************************************************************/
-VIDEO_START( spy )
+void spy_state::video_start()
{
- spy_state *state = machine.driver_data<spy_state>();
- state->m_layer_colorbase[0] = 48;
- state->m_layer_colorbase[1] = 0;
- state->m_layer_colorbase[2] = 16;
- state->m_sprite_colorbase = 32;
+ m_layer_colorbase[0] = 48;
+ m_layer_colorbase[1] = 0;
+ m_layer_colorbase[2] = 16;
+ m_sprite_colorbase = 32;
}
diff --git a/src/mame/video/srmp2.c b/src/mame/video/srmp2.c
index ca481a9828e..a6dfb346604 100644
--- a/src/mame/video/srmp2.c
+++ b/src/mame/video/srmp2.c
@@ -9,32 +9,32 @@ Functions to emulate the video hardware of the machine.
#include "includes/srmp2.h"
#include "video/seta001.h"
-PALETTE_INIT( srmp2 )
+PALETTE_INIT_MEMBER(srmp2_state,srmp2)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int col;
- col = (color_prom[i] << 8) + color_prom[i + machine.total_colors()];
- palette_set_color_rgb(machine,i ^ 0x0f,pal5bit(col >> 10),pal5bit(col >> 5),pal5bit(col >> 0));
+ col = (color_prom[i] << 8) + color_prom[i + machine().total_colors()];
+ palette_set_color_rgb(machine(),i ^ 0x0f,pal5bit(col >> 10),pal5bit(col >> 5),pal5bit(col >> 0));
}
}
-PALETTE_INIT( srmp3 )
+PALETTE_INIT_MEMBER(srmp2_state,srmp3)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int col;
- col = (color_prom[i] << 8) + color_prom[i + machine.total_colors()];
- palette_set_color_rgb(machine,i,pal5bit(col >> 10),pal5bit(col >> 5),pal5bit(col >> 0));
+ col = (color_prom[i] << 8) + color_prom[i + machine().total_colors()];
+ palette_set_color_rgb(machine(),i,pal5bit(col >> 10),pal5bit(col >> 5),pal5bit(col >> 0));
}
}
diff --git a/src/mame/video/srumbler.c b/src/mame/video/srumbler.c
index 9c49e0996f8..567bb417912 100644
--- a/src/mame/video/srumbler.c
+++ b/src/mame/video/srumbler.c
@@ -45,16 +45,15 @@ TILE_GET_INFO_MEMBER(srumbler_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( srumbler )
+void srumbler_state::video_start()
{
- srumbler_state *state = machine.driver_data<srumbler_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(srumbler_state::get_fg_tile_info),state),TILEMAP_SCAN_COLS,8,8,64,32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(srumbler_state::get_bg_tile_info),state),TILEMAP_SCAN_COLS, 16,16,64,64);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(srumbler_state::get_fg_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(srumbler_state::get_bg_tile_info),this),TILEMAP_SCAN_COLS, 16,16,64,64);
- state->m_fg_tilemap->set_transparent_pen(3);
+ m_fg_tilemap->set_transparent_pen(3);
- state->m_bg_tilemap->set_transmask(0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1,0x07ff,0xf800); /* split type 1 has pens 0-10 transparent in front half */
+ m_bg_tilemap->set_transmask(0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1,0x07ff,0xf800); /* split type 1 has pens 0-10 transparent in front half */
}
diff --git a/src/mame/video/sshangha.c b/src/mame/video/sshangha.c
index dae744cb43b..0782b2e933a 100644
--- a/src/mame/video/sshangha.c
+++ b/src/mame/video/sshangha.c
@@ -20,10 +20,10 @@ WRITE16_MEMBER(sshangha_state::sshangha_video_w)
/******************************************************************************/
-VIDEO_START( sshangha )
+void sshangha_state::video_start()
{
- machine.device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
- machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen1")->alloc_sprite_bitmap();
+ machine().device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
}
/******************************************************************************/
diff --git a/src/mame/video/sslam.c b/src/mame/video/sslam.c
index 0bfbfa40e68..865ebb6a9a7 100644
--- a/src/mame/video/sslam.c
+++ b/src/mame/video/sslam.c
@@ -158,29 +158,27 @@ WRITE16_MEMBER(sslam_state::powerbls_bg_tileram_w)
m_bg_tilemap->mark_tile_dirty(offset>>1);
}
-VIDEO_START(sslam)
+VIDEO_START_MEMBER(sslam_state,sslam)
{
- sslam_state *state = machine.driver_data<sslam_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sslam_state::get_sslam_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_md_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sslam_state::get_sslam_md_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sslam_state::get_sslam_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sslam_state::get_sslam_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_md_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sslam_state::get_sslam_md_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sslam_state::get_sslam_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
- state->m_md_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_md_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
- state->m_sprites_x_offset = 0;
- state->save_item(NAME(state->m_sprites_x_offset));
+ m_sprites_x_offset = 0;
+ save_item(NAME(m_sprites_x_offset));
}
-VIDEO_START(powerbls)
+VIDEO_START_MEMBER(sslam_state,powerbls)
{
- sslam_state *state = machine.driver_data<sslam_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(sslam_state::get_powerbls_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(sslam_state::get_powerbls_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_sprites_x_offset = -21;
- state->save_item(NAME(state->m_sprites_x_offset));
+ m_sprites_x_offset = -21;
+ save_item(NAME(m_sprites_x_offset));
}
SCREEN_UPDATE_IND16(sslam)
diff --git a/src/mame/video/ssozumo.c b/src/mame/video/ssozumo.c
index ec8d01ed8e3..1401d09fa5e 100644
--- a/src/mame/video/ssozumo.c
+++ b/src/mame/video/ssozumo.c
@@ -12,9 +12,9 @@ Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/10/04
/**************************************************************************/
-PALETTE_INIT( ssozumo )
+void ssozumo_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int bit0, bit1, bit2, bit3, r, g, b;
int i;
@@ -36,7 +36,7 @@ PALETTE_INIT( ssozumo )
bit3 = (color_prom[64] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
}
@@ -130,17 +130,16 @@ TILE_GET_INFO_MEMBER(ssozumo_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( ssozumo )
+void ssozumo_state::video_start()
{
- ssozumo_state *state = machine.driver_data<ssozumo_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ssozumo_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS_FLIP_X,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ssozumo_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS_FLIP_X,
16, 16, 16, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ssozumo_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS_FLIP_X,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ssozumo_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS_FLIP_X,
8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/sspeedr.c b/src/mame/video/sspeedr.c
index cc27312c557..24c784dcf8a 100644
--- a/src/mame/video/sspeedr.c
+++ b/src/mame/video/sspeedr.c
@@ -239,10 +239,9 @@ static void draw_driver(running_machine &machine, bitmap_ind16 &bitmap, const re
}
-VIDEO_START( sspeedr )
+void sspeedr_state::video_start()
{
- sspeedr_state *state = machine.driver_data<sspeedr_state>();
- state->m_toggle = 0;
+ m_toggle = 0;
}
diff --git a/src/mame/video/ssrj.c b/src/mame/video/ssrj.c
index d25c4af0eca..4b58d3daa4c 100644
--- a/src/mame/video/ssrj.c
+++ b/src/mame/video/ssrj.c
@@ -216,17 +216,16 @@ static const UINT8 fakecols[4*4][8][3]=
};
-VIDEO_START( ssrj )
+void ssrj_state::video_start()
{
- ssrj_state *state = machine.driver_data<ssrj_state>();
- state->m_tilemap1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ssrj_state::get_tile_info1),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ssrj_state::get_tile_info2),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_tilemap4 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ssrj_state::get_tile_info4),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_tilemap2->set_transparent_pen(0);
- state->m_tilemap4->set_transparent_pen(0);
+ m_tilemap1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ssrj_state::get_tile_info1),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ssrj_state::get_tile_info2),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_tilemap4 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ssrj_state::get_tile_info4),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_tilemap2->set_transparent_pen(0);
+ m_tilemap4->set_transparent_pen(0);
- state->m_buffer_spriteram = auto_alloc_array(machine, UINT8, 0x0800);
+ m_buffer_spriteram = auto_alloc_array(machine(), UINT8, 0x0800);
}
@@ -266,12 +265,12 @@ static void draw_objects(running_machine &machine, bitmap_ind16 &bitmap, const r
}
-PALETTE_INIT( ssrj )
+void ssrj_state::palette_init()
{
int i, j;
for(i=0; i<4*4; i++)
for(j=0; j<8; j++)
- palette_set_color_rgb(machine, i*8+j, fakecols[i][j][0], fakecols[i][j][1], fakecols[i][j][2]);
+ palette_set_color_rgb(machine(), i*8+j, fakecols[i][j][0], fakecols[i][j][1], fakecols[i][j][2]);
}
SCREEN_UPDATE_IND16( ssrj )
diff --git a/src/mame/video/ssv.c b/src/mame/video/ssv.c
index cd5b4501591..7425e999920 100644
--- a/src/mame/video/ssv.c
+++ b/src/mame/video/ssv.c
@@ -192,20 +192,19 @@ static void ssv_drawgfx( bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_el
}
-VIDEO_START( ssv )
+void ssv_state::video_start()
{
- machine.gfx[0]->set_granularity(64); /* 256 colour sprites with palette selectable on 64 colour boundaries */
+ machine().gfx[0]->set_granularity(64); /* 256 colour sprites with palette selectable on 64 colour boundaries */
}
-VIDEO_START( eaglshot )
+VIDEO_START_MEMBER(ssv_state,eaglshot)
{
- ssv_state *state = machine.driver_data<ssv_state>();
- VIDEO_START_CALL(ssv);
+ ssv_state::video_start();
- state->m_eaglshot_gfxram = auto_alloc_array(machine, UINT16, 16 * 0x40000 / 2);
+ m_eaglshot_gfxram = auto_alloc_array(machine(), UINT16, 16 * 0x40000 / 2);
- machine.gfx[0]->set_source((UINT8 *)state->m_eaglshot_gfxram);
- machine.gfx[1]->set_source((UINT8 *)state->m_eaglshot_gfxram);
+ machine().gfx[0]->set_source((UINT8 *)m_eaglshot_gfxram);
+ machine().gfx[1]->set_source((UINT8 *)m_eaglshot_gfxram);
}
TILE_GET_INFO_MEMBER(ssv_state::get_tile_info_0)
@@ -222,16 +221,15 @@ WRITE16_MEMBER(ssv_state::gdfs_tmapram_w)
m_gdfs_tmap->mark_tile_dirty(offset);
}
-VIDEO_START( gdfs )
+VIDEO_START_MEMBER(ssv_state,gdfs)
{
- ssv_state *state = machine.driver_data<ssv_state>();
- VIDEO_START_CALL(ssv);
+ ssv_state::video_start();
- state->m_gdfs_tmap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ssv_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 16,16, 0x100,0x100);
+ m_gdfs_tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ssv_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 16,16, 0x100,0x100);
- state->m_gdfs_tmap->set_transparent_pen(0);
+ m_gdfs_tmap->set_transparent_pen(0);
}
/***************************************************************************
diff --git a/src/mame/video/st0016.c b/src/mame/video/st0016.c
index 78a20b8d301..e4400c5ae81 100644
--- a/src/mame/video/st0016.c
+++ b/src/mame/video/st0016.c
@@ -433,24 +433,24 @@ static void st0016_save_init(running_machine &machine)
}
-VIDEO_START( st0016 )
+VIDEO_START_MEMBER(st0016_state,st0016)
{
int gfx_index=0;
macs_cart_slot = 0;
- st0016_charram=auto_alloc_array(machine, UINT8, ST0016_MAX_CHAR_BANK*ST0016_CHAR_BANK_SIZE);
- st0016_spriteram=auto_alloc_array(machine, UINT8, ST0016_MAX_SPR_BANK*ST0016_SPR_BANK_SIZE);
- st0016_paletteram=auto_alloc_array(machine, UINT8, ST0016_MAX_PAL_BANK*ST0016_PAL_BANK_SIZE);
+ st0016_charram=auto_alloc_array(machine(), UINT8, ST0016_MAX_CHAR_BANK*ST0016_CHAR_BANK_SIZE);
+ st0016_spriteram=auto_alloc_array(machine(), UINT8, ST0016_MAX_SPR_BANK*ST0016_SPR_BANK_SIZE);
+ st0016_paletteram=auto_alloc_array(machine(), UINT8, ST0016_MAX_PAL_BANK*ST0016_PAL_BANK_SIZE);
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine.gfx[gfx_index] == 0)
+ if (machine().gfx[gfx_index] == 0)
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine.gfx[gfx_index] = auto_alloc(machine, gfx_element(machine, charlayout, (UINT8 *) st0016_charram, 0x40, 0));
+ machine().gfx[gfx_index] = auto_alloc(machine(), gfx_element(machine(), charlayout, (UINT8 *) st0016_charram, 0x40, 0));
st0016_ramgfx = gfx_index;
spr_dx=0;
@@ -459,32 +459,32 @@ VIDEO_START( st0016 )
switch(st0016_game&0x3f)
{
case 0: //renju kizoku
- machine.primary_screen->set_visible_area(0, 40*8-1, 0, 30*8-1);
+ machine().primary_screen->set_visible_area(0, 40*8-1, 0, 30*8-1);
spr_dx=0;
spr_dy=0;
break;
case 1: //neratte chu!
- machine.primary_screen->set_visible_area(8,41*8-1,0,30*8-1);
+ machine().primary_screen->set_visible_area(8,41*8-1,0,30*8-1);
spr_dx=0;
spr_dy=8;
break;
case 4: //mayjinsen 1&2
- machine.primary_screen->set_visible_area(0,32*8-1,0,28*8-1);
+ machine().primary_screen->set_visible_area(0,32*8-1,0,28*8-1);
break;
case 10:
- machine.primary_screen->set_visible_area(0,383,0,255);
+ machine().primary_screen->set_visible_area(0,383,0,255);
break;
case 11:
- machine.primary_screen->set_visible_area(0,383,0,383);
+ machine().primary_screen->set_visible_area(0,383,0,383);
break;
}
- st0016_save_init(machine);
+ st0016_save_init(machine());
}
diff --git a/src/mame/video/stactics.c b/src/mame/video/stactics.c
index aa4fee5dcfc..38dca203948 100644
--- a/src/mame/video/stactics.c
+++ b/src/mame/video/stactics.c
@@ -57,9 +57,9 @@ tilt the mirror up and down, and the monitor left and right.
*
*************************************/
-static PALETTE_INIT( stactics )
+PALETTE_INIT_MEMBER(stactics_state,stactics)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0x400; i++)
@@ -78,7 +78,7 @@ static PALETTE_INIT( stactics )
/* blue component */
int b = 0xff * bit2;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -359,19 +359,18 @@ static void update_artwork(running_machine &machine, stactics_state *state)
*
*************************************/
-static VIDEO_START( stactics )
+VIDEO_START_MEMBER(stactics_state,stactics)
{
- stactics_state *state = machine.driver_data<stactics_state>();
- state->m_y_scroll_d = 0;
- state->m_y_scroll_e = 0;
- state->m_y_scroll_f = 0;
+ m_y_scroll_d = 0;
+ m_y_scroll_e = 0;
+ m_y_scroll_f = 0;
- state->m_frame_count = 0;
- state->m_shot_standby = 1;
- state->m_shot_arrive = 0;
- state->m_beam_state = 0;
- state->m_old_beam_state = 0;
+ m_frame_count = 0;
+ m_shot_standby = 1;
+ m_shot_arrive = 0;
+ m_beam_state = 0;
+ m_old_beam_state = 0;
}
@@ -416,6 +415,6 @@ MACHINE_CONFIG_FRAGMENT( stactics_video )
MCFG_PALETTE_LENGTH(0x400)
- MCFG_PALETTE_INIT(stactics)
- MCFG_VIDEO_START(stactics)
+ MCFG_PALETTE_INIT_OVERRIDE(stactics_state,stactics)
+ MCFG_VIDEO_START_OVERRIDE(stactics_state,stactics)
MACHINE_CONFIG_END
diff --git a/src/mame/video/stadhero.c b/src/mame/video/stadhero.c
index 9f5712bbc7c..ed7144d1f63 100644
--- a/src/mame/video/stadhero.c
+++ b/src/mame/video/stadhero.c
@@ -55,11 +55,10 @@ TILE_GET_INFO_MEMBER(stadhero_state::get_pf1_tile_info)
0);
}
-VIDEO_START( stadhero )
+void stadhero_state::video_start()
{
- stadhero_state *state = machine.driver_data<stadhero_state>();
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(stadhero_state::get_pf1_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,32,32);
- state->m_pf1_tilemap->set_transparent_pen(0);
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(stadhero_state::get_pf1_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
+ m_pf1_tilemap->set_transparent_pen(0);
}
/******************************************************************************/
diff --git a/src/mame/video/starcrus.c b/src/mame/video/starcrus.c
index 95387baa09b..94c06a49d56 100644
--- a/src/mame/video/starcrus.c
+++ b/src/mame/video/starcrus.c
@@ -17,14 +17,13 @@ WRITE8_MEMBER(starcrus_state::starcrus_p1_y_w){ m_p1_y = data^0xff; }
WRITE8_MEMBER(starcrus_state::starcrus_p2_x_w){ m_p2_x = data^0xff; }
WRITE8_MEMBER(starcrus_state::starcrus_p2_y_w){ m_p2_y = data^0xff; }
-VIDEO_START( starcrus )
+void starcrus_state::video_start()
{
- starcrus_state *state = machine.driver_data<starcrus_state>();
- state->m_ship1_vid = auto_bitmap_ind16_alloc(machine, 16, 16);
- state->m_ship2_vid = auto_bitmap_ind16_alloc(machine, 16, 16);
+ m_ship1_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
+ m_ship2_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
- state->m_proj1_vid = auto_bitmap_ind16_alloc(machine, 16, 16);
- state->m_proj2_vid = auto_bitmap_ind16_alloc(machine, 16, 16);
+ m_proj1_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
+ m_proj2_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
}
WRITE8_MEMBER(starcrus_state::starcrus_ship_parm_1_w)
diff --git a/src/mame/video/starfire.c b/src/mame/video/starfire.c
index 70f80ee2f69..7f0c67fee95 100644
--- a/src/mame/video/starfire.c
+++ b/src/mame/video/starfire.c
@@ -15,19 +15,18 @@ static TIMER_CALLBACK( starfire_scanline_callback );
*
*************************************/
-VIDEO_START( starfire )
+void starfire_state::video_start()
{
- starfire_state *state = machine.driver_data<starfire_state>();
- machine.primary_screen->register_screen_bitmap(state->m_starfire_screen);
- state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(starfire_scanline_callback));
- state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(STARFIRE_VBEND), STARFIRE_VBEND);
+ machine().primary_screen->register_screen_bitmap(m_starfire_screen);
+ m_scanline_timer = machine().scheduler().timer_alloc(FUNC(starfire_scanline_callback));
+ m_scanline_timer->adjust(machine().primary_screen->time_until_pos(STARFIRE_VBEND), STARFIRE_VBEND);
/* register for state saving */
- state->save_item(NAME(state->m_starfire_vidctrl));
- state->save_item(NAME(state->m_starfire_vidctrl1));
- state->save_item(NAME(state->m_starfire_color));
- state->save_item(NAME(state->m_starfire_colors));
+ save_item(NAME(m_starfire_vidctrl));
+ save_item(NAME(m_starfire_vidctrl1));
+ save_item(NAME(m_starfire_color));
+ save_item(NAME(m_starfire_colors));
}
diff --git a/src/mame/video/starshp1.c b/src/mame/video/starshp1.c
index 7b739ad1e8e..e3e21201cf5 100644
--- a/src/mame/video/starshp1.c
+++ b/src/mame/video/starshp1.c
@@ -21,7 +21,7 @@ static void set_pens(starshp1_state *state, colortable_t *colortable)
}
-PALETTE_INIT( starshp1 )
+void starshp1_state::palette_init()
{
int i;
@@ -38,10 +38,10 @@ PALETTE_INIT( starshp1 )
};
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 8);
+ machine().colortable = colortable_alloc(machine(), 8);
for (i = 0; i < sizeof(colortable_source) / sizeof(colortable_source[0]); i++)
- colortable_entry_set_value(machine.colortable, i, colortable_source[i]);
+ colortable_entry_set_value(machine().colortable, i, colortable_source[i]);
}
@@ -53,20 +53,19 @@ TILE_GET_INFO_MEMBER(starshp1_state::get_tile_info)
}
-VIDEO_START( starshp1 )
+void starshp1_state::video_start()
{
- starshp1_state *state = machine.driver_data<starshp1_state>();
UINT16 val = 0;
int i;
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(starshp1_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(starshp1_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrollx(0, -8);
+ m_bg_tilemap->set_scrollx(0, -8);
- state->m_LSFR = auto_alloc_array(machine, UINT16, 0x10000);
+ m_LSFR = auto_alloc_array(machine(), UINT16, 0x10000);
for (i = 0; i < 0x10000; i++)
{
@@ -75,12 +74,12 @@ VIDEO_START( starshp1 )
(val >> 0x7) ^
(val >> 0x1) ^ 1;
- state->m_LSFR[i] = val;
+ m_LSFR[i] = val;
val = (val << 1) | (bit & 1);
}
- machine.primary_screen->register_screen_bitmap(state->m_helper);
+ machine().primary_screen->register_screen_bitmap(m_helper);
}
diff --git a/src/mame/video/stfight.c b/src/mame/video/stfight.c
index 6b742f93166..e9d91595806 100644
--- a/src/mame/video/stfight.c
+++ b/src/mame/video/stfight.c
@@ -30,40 +30,40 @@
*/
-PALETTE_INIT( stfight )
+void stfight_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* text uses colors 0xc0-0xcf */
for (i = 0; i < 0x40; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0xc0;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* fg uses colors 0x40-0x7f */
for (i = 0x40; i < 0x140; i++)
{
UINT8 ctabentry = (color_prom[i + 0x1c0] & 0x0f) | ((color_prom[i + 0x0c0] & 0x03) << 4) | 0x40;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* bg uses colors 0-0x3f */
for (i = 0x140; i < 0x240; i++)
{
UINT8 ctabentry = (color_prom[i + 0x2c0] & 0x0f) | ((color_prom[i + 0x1c0] & 0x03) << 4);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* bg uses colors 0x80-0xbf */
for (i = 0x240; i < 0x340; i++)
{
UINT8 ctabentry = (color_prom[i + 0x3c0] & 0x0f) | ((color_prom[i + 0x2c0] & 0x03) << 4) | 0x80;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -155,15 +155,14 @@ TILE_GET_INFO_MEMBER(stfight_state::get_tx_tile_info)
***************************************************************************/
-VIDEO_START( stfight )
+void stfight_state::video_start()
{
- stfight_state *state = machine.driver_data<stfight_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(stfight_state::get_bg_tile_info),state),tilemap_mapper_delegate(FUNC(stfight_state::bg_scan),state),16,16,128,256);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(stfight_state::get_fg_tile_info),state),tilemap_mapper_delegate(FUNC(stfight_state::fg_scan),state),16,16,128,256);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(stfight_state::get_tx_tile_info),state),TILEMAP_SCAN_ROWS, 8,8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(stfight_state::get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(stfight_state::bg_scan),this),16,16,128,256);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(stfight_state::get_fg_tile_info),this),tilemap_mapper_delegate(FUNC(stfight_state::fg_scan),this),16,16,128,256);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(stfight_state::get_tx_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,32,32);
- state->m_fg_tilemap->set_transparent_pen(0x0f);
- colortable_configure_tilemap_groups(machine.colortable, state->m_tx_tilemap, machine.gfx[0], 0xcf);
+ m_fg_tilemap->set_transparent_pen(0x0f);
+ colortable_configure_tilemap_groups(machine().colortable, m_tx_tilemap, machine().gfx[0], 0xcf);
}
diff --git a/src/mame/video/stlforce.c b/src/mame/video/stlforce.c
index 9f7a504f1db..febac73db54 100644
--- a/src/mame/video/stlforce.c
+++ b/src/mame/video/stlforce.c
@@ -176,20 +176,19 @@ SCREEN_UPDATE_IND16( stlforce )
return 0;
}
-VIDEO_START( stlforce )
+void stlforce_state::video_start()
{
- stlforce_state *state = machine.driver_data<stlforce_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(stlforce_state::get_stlforce_bg_tile_info),state), TILEMAP_SCAN_COLS, 16,16,64,16);
- state->m_mlow_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(stlforce_state::get_stlforce_mlow_tile_info),state), TILEMAP_SCAN_COLS, 16,16,64,16);
- state->m_mhigh_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(stlforce_state::get_stlforce_mhigh_tile_info),state),TILEMAP_SCAN_COLS, 16,16,64,16);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(stlforce_state::get_stlforce_tx_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(stlforce_state::get_stlforce_bg_tile_info),this), TILEMAP_SCAN_COLS, 16,16,64,16);
+ m_mlow_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(stlforce_state::get_stlforce_mlow_tile_info),this), TILEMAP_SCAN_COLS, 16,16,64,16);
+ m_mhigh_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(stlforce_state::get_stlforce_mhigh_tile_info),this),TILEMAP_SCAN_COLS, 16,16,64,16);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(stlforce_state::get_stlforce_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8,64,32);
- state->m_mlow_tilemap->set_transparent_pen(0);
- state->m_mhigh_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_mlow_tilemap->set_transparent_pen(0);
+ m_mhigh_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scroll_rows(256);
- state->m_mlow_tilemap->set_scroll_rows(256);
- state->m_mhigh_tilemap->set_scroll_rows(256);
+ m_bg_tilemap->set_scroll_rows(256);
+ m_mlow_tilemap->set_scroll_rows(256);
+ m_mhigh_tilemap->set_scroll_rows(256);
}
diff --git a/src/mame/video/strnskil.c b/src/mame/video/strnskil.c
index f46fc149cf0..4d1fe13bd11 100644
--- a/src/mame/video/strnskil.c
+++ b/src/mame/video/strnskil.c
@@ -12,13 +12,13 @@ Video hardware driver by Uki
#include "includes/strnskil.h"
-PALETTE_INIT( strnskil )
+void strnskil_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -27,7 +27,7 @@ PALETTE_INIT( strnskil )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -37,7 +37,7 @@ PALETTE_INIT( strnskil )
for (i = 0; i < 0x400; i++)
{
UINT8 ctabentry = color_prom[i];
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -70,13 +70,12 @@ TILE_GET_INFO_MEMBER(strnskil_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( strnskil )
+void strnskil_state::video_start()
{
- strnskil_state *state = machine.driver_data<strnskil_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(strnskil_state::get_bg_tile_info),state), TILEMAP_SCAN_COLS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(strnskil_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap->set_scroll_rows(32);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/stvvdp2.c b/src/mame/video/stvvdp2.c
index 617434793eb..7c32bd6d64f 100644
--- a/src/mame/video/stvvdp2.c
+++ b/src/mame/video/stvvdp2.c
@@ -2105,7 +2105,7 @@ static struct stv_vdp2_debugging
UINT8 win; /*Enters into Window effect debug menu*/
UINT32 error; /*bits for VDP2 error logging*/
UINT8 roz; /*Debug roz on screen*/
-} debug;
+} vdpdebug;
/* Not sure if to use this for the rotating tilemaps as well or just use different draw functions, might add too much bloat */
static struct stv_vdp2_tilemap_capabilities
@@ -2272,15 +2272,15 @@ static void stv_vdp2_fill_rotation_parameter_table( running_machine &machine, UI
if(LOG_ROZ == 2)
{
if(machine.input().code_pressed_once(JOYCODE_Y_UP_SWITCH))
- debug.roz++;
+ vdpdebug.roz++;
if(machine.input().code_pressed_once(JOYCODE_Y_DOWN_SWITCH))
- debug.roz--;
+ vdpdebug.roz--;
- if(debug.roz > 10)
- debug.roz = 10;
+ if(vdpdebug.roz > 10)
+ vdpdebug.roz = 10;
- switch(debug.roz)
+ switch(vdpdebug.roz)
{
case 0: popmessage( "Rotation parameter Table (%d)", rot_parameter ); break;
case 1: popmessage( "xst = %x, yst = %x, zst = %x", RP.xst, RP.yst, RP.zst ); break;
@@ -5815,23 +5815,22 @@ static int stv_vdp2_start (running_machine &machine)
}
/* maybe we should move this to video/stv.c */
-VIDEO_START( stv_vdp2 )
+VIDEO_START_MEMBER(saturn_state,stv_vdp2)
{
- saturn_state *state = machine.driver_data<saturn_state>();
- machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap);
- stv_vdp2_start(machine);
- stv_vdp1_start(machine);
- debug.l_en = 0xff;
- debug.error = 0xffffffff;
- debug.roz = 0;
- machine.gfx[0]->set_source(state->m_vdp2.gfx_decode);
- machine.gfx[1]->set_source(state->m_vdp2.gfx_decode);
- machine.gfx[2]->set_source(state->m_vdp2.gfx_decode);
- machine.gfx[3]->set_source(state->m_vdp2.gfx_decode);
- machine.gfx[4]->set_source(state->m_vdp1.gfx_decode);
- machine.gfx[5]->set_source(state->m_vdp1.gfx_decode);
- machine.gfx[6]->set_source(state->m_vdp1.gfx_decode);
- machine.gfx[7]->set_source(state->m_vdp1.gfx_decode);
+ machine().primary_screen->register_screen_bitmap(m_tmpbitmap);
+ stv_vdp2_start(machine());
+ stv_vdp1_start(machine());
+ vdpdebug.l_en = 0xff;
+ vdpdebug.error = 0xffffffff;
+ vdpdebug.roz = 0;
+ machine().gfx[0]->set_source(m_vdp2.gfx_decode);
+ machine().gfx[1]->set_source(m_vdp2.gfx_decode);
+ machine().gfx[2]->set_source(m_vdp2.gfx_decode);
+ machine().gfx[3]->set_source(m_vdp2.gfx_decode);
+ machine().gfx[4]->set_source(m_vdp1.gfx_decode);
+ machine().gfx[5]->set_source(m_vdp1.gfx_decode);
+ machine().gfx[6]->set_source(m_vdp1.gfx_decode);
+ machine().gfx[7]->set_source(m_vdp1.gfx_decode);
}
void stv_vdp2_dynamic_res_change(running_machine &machine)
@@ -6648,33 +6647,33 @@ SCREEN_UPDATE_RGB32( stv_vdp2 )
#if DEBUG_MODE
if(screen.machine().input().code_pressed_once(KEYCODE_T))
{
- debug.l_en^=1;
- popmessage("NBG3 %sabled",debug.l_en & 1 ? "en" : "dis");
+ vdpdebug.l_en^=1;
+ popmessage("NBG3 %sabled",vdpdebug.l_en & 1 ? "en" : "dis");
}
if(screen.machine().input().code_pressed_once(KEYCODE_Y))
{
- debug.l_en^=2;
- popmessage("NBG2 %sabled",debug.l_en & 2 ? "en" : "dis");
+ vdpdebug.l_en^=2;
+ popmessage("NBG2 %sabled",vdpdebug.l_en & 2 ? "en" : "dis");
}
if(screen.machine().input().code_pressed_once(KEYCODE_U))
{
- debug.l_en^=4;
- popmessage("NBG1 %sabled",debug.l_en & 4 ? "en" : "dis");
+ vdpdebug.l_en^=4;
+ popmessage("NBG1 %sabled",vdpdebug.l_en & 4 ? "en" : "dis");
}
if(screen.machine().input().code_pressed_once(KEYCODE_I))
{
- debug.l_en^=8;
- popmessage("NBG0 %sabled",debug.l_en & 8 ? "en" : "dis");
+ vdpdebug.l_en^=8;
+ popmessage("NBG0 %sabled",vdpdebug.l_en & 8 ? "en" : "dis");
}
if(screen.machine().input().code_pressed_once(KEYCODE_K))
{
- debug.l_en^=0x10;
- popmessage("RBG0 %sabled",debug.l_en & 0x10 ? "en" : "dis");
+ vdpdebug.l_en^=0x10;
+ popmessage("RBG0 %sabled",vdpdebug.l_en & 0x10 ? "en" : "dis");
}
if(screen.machine().input().code_pressed_once(KEYCODE_O))
{
- debug.l_en^=0x20;
- popmessage("SPRITE %sabled",debug.l_en & 0x20 ? "en" : "dis");
+ vdpdebug.l_en^=0x20;
+ popmessage("SPRITE %sabled",vdpdebug.l_en & 0x20 ? "en" : "dis");
}
#endif
@@ -6689,12 +6688,12 @@ SCREEN_UPDATE_RGB32( stv_vdp2 )
/*If a plane has a priority value of zero it isn't shown at all.*/
for(pri=1;pri<8;pri++)
{
- if (debug.l_en & 1) { if(pri==STV_VDP2_N3PRIN) stv_vdp2_draw_NBG3(screen.machine(), state->m_tmpbitmap,cliprect); }
- if (debug.l_en & 2) { if(pri==STV_VDP2_N2PRIN) stv_vdp2_draw_NBG2(screen.machine(), state->m_tmpbitmap,cliprect); }
- if (debug.l_en & 4) { if(pri==STV_VDP2_N1PRIN) stv_vdp2_draw_NBG1(screen.machine(), state->m_tmpbitmap,cliprect); }
- if (debug.l_en & 8) { if(pri==STV_VDP2_N0PRIN) stv_vdp2_draw_NBG0(screen.machine(), state->m_tmpbitmap,cliprect); }
- if (debug.l_en & 0x10) { if(pri==STV_VDP2_R0PRIN) stv_vdp2_draw_RBG0(screen.machine(), state->m_tmpbitmap,cliprect); }
- if (debug.l_en & 0x20) { draw_sprites(screen.machine(),state->m_tmpbitmap,cliprect,pri); }
+ if (vdpdebug.l_en & 1) { if(pri==STV_VDP2_N3PRIN) stv_vdp2_draw_NBG3(screen.machine(), state->m_tmpbitmap,cliprect); }
+ if (vdpdebug.l_en & 2) { if(pri==STV_VDP2_N2PRIN) stv_vdp2_draw_NBG2(screen.machine(), state->m_tmpbitmap,cliprect); }
+ if (vdpdebug.l_en & 4) { if(pri==STV_VDP2_N1PRIN) stv_vdp2_draw_NBG1(screen.machine(), state->m_tmpbitmap,cliprect); }
+ if (vdpdebug.l_en & 8) { if(pri==STV_VDP2_N0PRIN) stv_vdp2_draw_NBG0(screen.machine(), state->m_tmpbitmap,cliprect); }
+ if (vdpdebug.l_en & 0x10) { if(pri==STV_VDP2_R0PRIN) stv_vdp2_draw_RBG0(screen.machine(), state->m_tmpbitmap,cliprect); }
+ if (vdpdebug.l_en & 0x20) { draw_sprites(screen.machine(),state->m_tmpbitmap,cliprect,pri); }
}
}
diff --git a/src/mame/video/suna16.c b/src/mame/video/suna16.c
index 730a67012d1..be42e0b7018 100644
--- a/src/mame/video/suna16.c
+++ b/src/mame/video/suna16.c
@@ -89,11 +89,10 @@ WRITE16_MEMBER(suna16_state::bestbest_flipscreen_w)
***************************************************************************/
-VIDEO_START( suna16 )
+void suna16_state::video_start()
{
- suna16_state *state = machine.driver_data<suna16_state>();
- state->m_paletteram = auto_alloc_array(machine, UINT16, machine.total_colors());
+ m_paletteram = auto_alloc_array(machine(), UINT16, machine().total_colors());
}
READ16_MEMBER(suna16_state::suna16_paletteram16_r)
diff --git a/src/mame/video/suna8.c b/src/mame/video/suna8.c
index 3d50299eb29..9f62694ea61 100644
--- a/src/mame/video/suna8.c
+++ b/src/mame/video/suna8.c
@@ -205,9 +205,9 @@ static void suna8_vh_start_common(running_machine &machine, int dim)
#endif
}
-VIDEO_START( suna8_textdim0 ) { suna8_vh_start_common(machine, 0); }
-VIDEO_START( suna8_textdim8 ) { suna8_vh_start_common(machine, 8); }
-VIDEO_START( suna8_textdim12 ) { suna8_vh_start_common(machine, 12); }
+VIDEO_START_MEMBER(suna8_state,suna8_textdim0){ suna8_vh_start_common(machine(), 0); }
+VIDEO_START_MEMBER(suna8_state,suna8_textdim8){ suna8_vh_start_common(machine(), 8); }
+VIDEO_START_MEMBER(suna8_state,suna8_textdim12){ suna8_vh_start_common(machine(), 12); }
/***************************************************************************
diff --git a/src/mame/video/superchs.c b/src/mame/video/superchs.c
index d183c3a9129..0173c78779e 100644
--- a/src/mame/video/superchs.c
+++ b/src/mame/video/superchs.c
@@ -2,10 +2,9 @@
#include "video/taitoic.h"
#include "includes/superchs.h"
-VIDEO_START( superchs )
+void superchs_state::video_start()
{
- superchs_state *state = machine.driver_data<superchs_state>();
- state->m_spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000);
+ m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x4000);
}
/************************************************************
diff --git a/src/mame/video/superqix.c b/src/mame/video/superqix.c
index aa91ae6204b..992004c2381 100644
--- a/src/mame/video/superqix.c
+++ b/src/mame/video/superqix.c
@@ -47,26 +47,24 @@ TILE_GET_INFO_MEMBER(superqix_state::sqix_get_bg_tile_info)
***************************************************************************/
-VIDEO_START( pbillian )
+VIDEO_START_MEMBER(superqix_state,pbillian)
{
- superqix_state *state = machine.driver_data<superqix_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(superqix_state::pb_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(superqix_state::pb_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8,32,32);
}
-VIDEO_START( superqix )
+VIDEO_START_MEMBER(superqix_state,superqix)
{
- superqix_state *state = machine.driver_data<superqix_state>();
- state->m_fg_bitmap[0] = auto_bitmap_ind16_alloc(machine, 256, 256);
- state->m_fg_bitmap[1] = auto_bitmap_ind16_alloc(machine, 256, 256);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(superqix_state::sqix_get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_bitmap[0] = auto_bitmap_ind16_alloc(machine(), 256, 256);
+ m_fg_bitmap[1] = auto_bitmap_ind16_alloc(machine(), 256, 256);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(superqix_state::sqix_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_transmask(0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1,0x0001,0xfffe); /* split type 1 has pen 0 transparent in front half */
+ m_bg_tilemap->set_transmask(0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1,0x0001,0xfffe); /* split type 1 has pen 0 transparent in front half */
- state->save_item(NAME(state->m_gfxbank));
- state->save_item(NAME(state->m_show_bitmap));
- state->save_item(NAME(*state->m_fg_bitmap[0]));
- state->save_item(NAME(*state->m_fg_bitmap[1]));
+ save_item(NAME(m_gfxbank));
+ save_item(NAME(m_show_bitmap));
+ save_item(NAME(*m_fg_bitmap[0]));
+ save_item(NAME(*m_fg_bitmap[1]));
}
diff --git a/src/mame/video/suprloco.c b/src/mame/video/suprloco.c
index 62aa928ed91..f5b12ac10ea 100644
--- a/src/mame/video/suprloco.c
+++ b/src/mame/video/suprloco.c
@@ -28,9 +28,9 @@
I'm not sure about the resistor values, I'm using the Galaxian ones.
***************************************************************************/
-PALETTE_INIT( suprloco )
+void suprloco_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
@@ -54,15 +54,15 @@ PALETTE_INIT( suprloco )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
/* hack: generate a second bank of sprite palette with red changed to purple */
if (i >= 256)
{
if ((i & 0x0f) == 0x09)
- palette_set_color(machine,i+256,MAKE_RGB(r,g,0xff));
+ palette_set_color(machine(),i+256,MAKE_RGB(r,g,0xff));
else
- palette_set_color(machine,i+256,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i+256,MAKE_RGB(r,g,b));
}
}
}
@@ -94,12 +94,11 @@ TILE_GET_INFO_MEMBER(suprloco_state::get_tile_info)
***************************************************************************/
-VIDEO_START( suprloco )
+void suprloco_state::video_start()
{
- suprloco_state *state = machine.driver_data<suprloco_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(suprloco_state::get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(suprloco_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg_tilemap->set_scroll_rows(32);
+ m_bg_tilemap->set_scroll_rows(32);
}
diff --git a/src/mame/video/suprnova.c b/src/mame/video/suprnova.c
index c62b9c87fca..24ba6d8a651 100644
--- a/src/mame/video/suprnova.c
+++ b/src/mame/video/suprnova.c
@@ -346,42 +346,40 @@ WRITE32_MEMBER(skns_state::skns_v3_regs_w)
}
-VIDEO_START(skns)
+void skns_state::video_start()
{
- skns_state *state = machine.driver_data<skns_state>();
- state->m_spritegen = machine.device<sknsspr_device>("spritegen");
+ m_spritegen = machine().device<sknsspr_device>("spritegen");
- state->m_tilemap_A = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(skns_state::get_tilemap_A_tile_info),state),TILEMAP_SCAN_ROWS,16,16,64, 64);
- state->m_tilemap_A->set_transparent_pen(0);
+ m_tilemap_A = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(skns_state::get_tilemap_A_tile_info),this),TILEMAP_SCAN_ROWS,16,16,64, 64);
+ m_tilemap_A->set_transparent_pen(0);
- state->m_tilemap_B = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(skns_state::get_tilemap_B_tile_info),state),TILEMAP_SCAN_ROWS,16,16,64, 64);
- state->m_tilemap_B->set_transparent_pen(0);
+ m_tilemap_B = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(skns_state::get_tilemap_B_tile_info),this),TILEMAP_SCAN_ROWS,16,16,64, 64);
+ m_tilemap_B->set_transparent_pen(0);
- state->m_sprite_bitmap.allocate(1024,1024);
+ m_sprite_bitmap.allocate(1024,1024);
- state->m_tilemap_bitmap_lower.allocate(320,240);
- state->m_tilemap_bitmapflags_lower.allocate(320,240);
+ m_tilemap_bitmap_lower.allocate(320,240);
+ m_tilemap_bitmapflags_lower.allocate(320,240);
- state->m_tilemap_bitmap_higher.allocate(320,240);
- state->m_tilemap_bitmapflags_higher.allocate(320,240);
+ m_tilemap_bitmap_higher.allocate(320,240);
+ m_tilemap_bitmapflags_higher.allocate(320,240);
- machine.gfx[2]->set_granularity(256);
- machine.gfx[3]->set_granularity(256);
+ machine().gfx[2]->set_granularity(256);
+ machine().gfx[3]->set_granularity(256);
}
-VIDEO_RESET( skns )
+void skns_state::video_reset()
{
- skns_state *state = machine.driver_data<skns_state>();
- state->m_depthA = state->m_depthB = 0;
- state->m_use_spc_bright = state->m_use_v3_bright = 1;
- state->m_bright_spc_b= state->m_bright_spc_g = state->m_bright_spc_r = 0x00;
- state->m_bright_spc_b_trans = state->m_bright_spc_g_trans = state->m_bright_spc_r_trans = 0x00;
- state->m_bright_v3_b = state->m_bright_v3_g = state->m_bright_v3_r = 0x00;
- state->m_bright_v3_b_trans = state->m_bright_v3_g_trans = state->m_bright_v3_r_trans = 0x00;
-
- state->m_spc_changed = state->m_v3_changed = state->m_palette_updated = 0;
- state->m_alt_enable_background = state->m_alt_enable_sprites = 1;
+ m_depthA = m_depthB = 0;
+ m_use_spc_bright = m_use_v3_bright = 1;
+ m_bright_spc_b= m_bright_spc_g = m_bright_spc_r = 0x00;
+ m_bright_spc_b_trans = m_bright_spc_g_trans = m_bright_spc_r_trans = 0x00;
+ m_bright_v3_b = m_bright_v3_g = m_bright_v3_r = 0x00;
+ m_bright_v3_b_trans = m_bright_v3_g_trans = m_bright_v3_r_trans = 0x00;
+
+ m_spc_changed = m_v3_changed = m_palette_updated = 0;
+ m_alt_enable_background = m_alt_enable_sprites = 1;
}
static void supernova_draw_a( running_machine &machine, bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const rectangle &cliprect, int tran )
diff --git a/src/mame/video/suprridr.c b/src/mame/video/suprridr.c
index 64c8f969fc7..3e1793c6c30 100644
--- a/src/mame/video/suprridr.c
+++ b/src/mame/video/suprridr.c
@@ -35,14 +35,13 @@ TILE_GET_INFO_MEMBER(suprridr_state::get_tile_info2)
*
*************************************/
-VIDEO_START( suprridr )
+void suprridr_state::video_start()
{
- suprridr_state *state = machine.driver_data<suprridr_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(suprridr_state::get_tile_info2),state), TILEMAP_SCAN_ROWS, 8,8, 32,32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(suprridr_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32);
- state->m_bg_tilemap_noscroll = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(suprridr_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(suprridr_state::get_tile_info2),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(suprridr_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
+ m_bg_tilemap_noscroll = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(suprridr_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
@@ -53,9 +52,9 @@ VIDEO_START( suprridr )
*
*************************************/
-PALETTE_INIT( suprridr )
+void suprridr_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 96; i++)
@@ -77,7 +76,7 @@ PALETTE_INIT( suprridr )
bit1 = (*color_prom >> 7) & 0x01;
b = 0x4f * bit0 + 0xa8 * bit1;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
}
diff --git a/src/mame/video/suprslam.c b/src/mame/video/suprslam.c
index 5624c001a0f..66d7511e020 100644
--- a/src/mame/video/suprslam.c
+++ b/src/mame/video/suprslam.c
@@ -138,14 +138,13 @@ TILE_GET_INFO_MEMBER(suprslam_state::get_suprslam_bg_tile_info)
}
-VIDEO_START( suprslam )
+void suprslam_state::video_start()
{
- suprslam_state *state = machine.driver_data<suprslam_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(suprslam_state::get_suprslam_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_screen_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(suprslam_state::get_suprslam_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(suprslam_state::get_suprslam_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_screen_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(suprslam_state::get_suprslam_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_screen_tilemap->set_transparent_pen(15);
+ m_screen_tilemap->set_transparent_pen(15);
}
SCREEN_UPDATE_IND16( suprslam )
diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c
index ef12b9eefdb..0e1427c41ed 100644
--- a/src/mame/video/system1.c
+++ b/src/mame/video/system1.c
@@ -148,15 +148,15 @@ static void video_start_common(running_machine &machine, int pagecount)
}
-VIDEO_START( system1 )
+void system1_state::video_start()
{
- video_start_common(machine, 2);
+ video_start_common(machine(), 2);
}
-VIDEO_START( system2 )
+VIDEO_START_MEMBER(system1_state,system2)
{
- video_start_common(machine, 8);
+ video_start_common(machine(), 8);
}
diff --git a/src/mame/video/system16.c b/src/mame/video/system16.c
index d7a1e132699..8c0cac79484 100644
--- a/src/mame/video/system16.c
+++ b/src/mame/video/system16.c
@@ -363,108 +363,106 @@ WRITE16_MEMBER(segas1x_bootleg_state::sys16_textram_w)
/***************************************************************************/
-VIDEO_START( system16 )
+VIDEO_START_MEMBER(segas1x_bootleg_state,system16)
{
- segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
/* Normal colors */
compute_resistor_weights(0, 255, -1.0,
- 6, resistances_normal, state->m_weights[0][0], 0, 0,
- 6, resistances_normal, state->m_weights[0][1], 0, 0,
- 6, resistances_normal, state->m_weights[0][2], 0, 0
+ 6, resistances_normal, m_weights[0][0], 0, 0,
+ 6, resistances_normal, m_weights[0][1], 0, 0,
+ 6, resistances_normal, m_weights[0][2], 0, 0
);
/* Shadow/Highlight colors */
compute_resistor_weights(0, 255, -1.0,
- 6, resistances_sh, state->m_weights[1][0], 0, 0,
- 6, resistances_sh, state->m_weights[1][1], 0, 0,
- 6, resistances_sh, state->m_weights[1][2], 0, 0
+ 6, resistances_sh, m_weights[1][0], 0, 0,
+ 6, resistances_sh, m_weights[1][1], 0, 0,
+ 6, resistances_sh, m_weights[1][2], 0, 0
);
- if (!state->m_bg1_trans)
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_bg_map),state),
+ if (!m_bg1_trans)
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_bg_map),this),
8,8,
64*2,32*2 );
else
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_bg_map),state),
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_bg_map),this),
8,8,
64*2,32*2 );
- state->m_foreground = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_fg_tile_info),state), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_bg_map),state),
+ m_foreground = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_bg_map),this),
8,8,
64*2,32*2 );
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_text_tile_info),state), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_text_map),state),
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_text_tile_info),this), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_text_map),this),
8,8,
40,28 );
{
- if (state->m_bg1_trans) state->m_background->set_transparent_pen(0);
- state->m_foreground->set_transparent_pen(0);
- state->m_text_layer->set_transparent_pen(0);
+ if (m_bg1_trans) m_background->set_transparent_pen(0);
+ m_foreground->set_transparent_pen(0);
+ m_text_layer->set_transparent_pen(0);
- state->m_tile_bank0 = 0;
- state->m_tile_bank1 = 1;
+ m_tile_bank0 = 0;
+ m_tile_bank1 = 1;
- state->m_fg_scrollx = 0;
- state->m_fg_scrolly = 0;
+ m_fg_scrollx = 0;
+ m_fg_scrolly = 0;
- state->m_bg_scrollx = 0;
- state->m_bg_scrolly = 0;
+ m_bg_scrollx = 0;
+ m_bg_scrolly = 0;
- state->m_refreshenable = 1;
+ m_refreshenable = 1;
/* common defaults */
- state->m_tilebank_switch = 0x1000;
+ m_tilebank_switch = 0x1000;
// Defaults for sys16 games
- state->m_textlayer_lo_min = 0;
- state->m_textlayer_lo_max = 0x7f;
- state->m_textlayer_hi_min = 0x80;
- state->m_textlayer_hi_max = 0xff;
+ m_textlayer_lo_min = 0;
+ m_textlayer_lo_max = 0x7f;
+ m_textlayer_hi_min = 0x80;
+ m_textlayer_hi_max = 0xff;
- state->m_system18 = 0;
+ m_system18 = 0;
}
- setup_system16_bootleg_spritebanking(machine);
+ setup_system16_bootleg_spritebanking(machine());
}
-VIDEO_START( system18old )
+VIDEO_START_MEMBER(segas1x_bootleg_state,system18old)
{
- segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
- VIDEO_START_CALL(system16);
+ VIDEO_START_CALL_MEMBER(system16);
- state->m_bg1_trans = 1;
+ m_bg1_trans = 1;
- state->m_background2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_bg_map),state),
+ m_background2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_bg_map),this),
8,8,
64*2,32*2 );
- state->m_foreground2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_fg2_tile_info),state), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_bg_map),state),
+ m_foreground2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_fg2_tile_info),this), tilemap_mapper_delegate(FUNC(segas1x_bootleg_state::sys16_bg_map),this),
8,8,
64*2,32*2 );
- state->m_foreground2->set_transparent_pen(0);
+ m_foreground2->set_transparent_pen(0);
- if (state->m_splittab_fg_x)
+ if (m_splittab_fg_x)
{
- state->m_foreground ->set_scroll_rows(64);
- state->m_foreground2 ->set_scroll_rows(64);
+ m_foreground ->set_scroll_rows(64);
+ m_foreground2 ->set_scroll_rows(64);
}
- if (state->m_splittab_bg_x)
+ if (m_splittab_bg_x)
{
- state->m_background ->set_scroll_rows(64);
- state->m_background2 ->set_scroll_rows(64);
+ m_background ->set_scroll_rows(64);
+ m_background2 ->set_scroll_rows(64);
}
- state->m_textlayer_lo_min = 0;
- state->m_textlayer_lo_max = 0x1f;
- state->m_textlayer_hi_min = 0x20;
- state->m_textlayer_hi_max = 0xff;
+ m_textlayer_lo_min = 0;
+ m_textlayer_lo_max = 0x1f;
+ m_textlayer_hi_min = 0x20;
+ m_textlayer_hi_max = 0xff;
- state->m_system18 = 1;
+ m_system18 = 1;
}
@@ -557,53 +555,52 @@ WRITE16_MEMBER(segas1x_bootleg_state::s16a_bootleg_tilemapselect_w)
}
-VIDEO_START( s16a_bootleg )
+VIDEO_START_MEMBER(segas1x_bootleg_state,s16a_bootleg)
{
- segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
/* Normal colors */
compute_resistor_weights(0, 255, -1.0,
- 6, resistances_normal, state->m_weights[0][0], 0, 0,
- 6, resistances_normal, state->m_weights[0][1], 0, 0,
- 6, resistances_normal, state->m_weights[0][2], 0, 0
+ 6, resistances_normal, m_weights[0][0], 0, 0,
+ 6, resistances_normal, m_weights[0][1], 0, 0,
+ 6, resistances_normal, m_weights[0][2], 0, 0
);
/* Shadow/Highlight colors */
compute_resistor_weights(0, 255, -1.0,
- 6, resistances_sh, state->m_weights[1][0], 0, 0,
- 6, resistances_sh, state->m_weights[1][1], 0, 0,
- 6, resistances_sh, state->m_weights[1][2], 0, 0
+ 6, resistances_sh, m_weights[1][0], 0, 0,
+ 6, resistances_sh, m_weights[1][1], 0, 0,
+ 6, resistances_sh, m_weights[1][2], 0, 0
);
- state->m_text_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_s16a_bootleg_tile_infotxt),state), TILEMAP_SCAN_ROWS, 8,8, 64,32 );
+ m_text_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_s16a_bootleg_tile_infotxt),this), TILEMAP_SCAN_ROWS, 8,8, 64,32 );
// the system16a bootlegs have simple tilemaps instead of the paged system
- state->m_bg_tilemaps[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_s16a_bootleg_tile_info0),state), TILEMAP_SCAN_ROWS, 8,8, 64,32 );
- state->m_bg_tilemaps[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_s16a_bootleg_tile_info1),state), TILEMAP_SCAN_ROWS, 8,8, 64,32 );
+ m_bg_tilemaps[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_s16a_bootleg_tile_info0),this), TILEMAP_SCAN_ROWS, 8,8, 64,32 );
+ m_bg_tilemaps[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas1x_bootleg_state::get_s16a_bootleg_tile_info1),this), TILEMAP_SCAN_ROWS, 8,8, 64,32 );
- state->m_text_tilemap->set_transparent_pen(0);
- state->m_bg_tilemaps[0]->set_transparent_pen(0);
- state->m_bg_tilemaps[1]->set_transparent_pen(0);
+ m_text_tilemap->set_transparent_pen(0);
+ m_bg_tilemaps[0]->set_transparent_pen(0);
+ m_bg_tilemaps[1]->set_transparent_pen(0);
}
-VIDEO_START( s16a_bootleg_wb3bl )
+VIDEO_START_MEMBER(segas1x_bootleg_state,s16a_bootleg_wb3bl)
{
- VIDEO_START_CALL(s16a_bootleg);
- setup_system16_bootleg_spritebanking(machine);
+ VIDEO_START_CALL_MEMBER(s16a_bootleg);
+ setup_system16_bootleg_spritebanking(machine());
}
-VIDEO_START( s16a_bootleg_shinobi )
+VIDEO_START_MEMBER(segas1x_bootleg_state,s16a_bootleg_shinobi)
{
- VIDEO_START_CALL(s16a_bootleg);
- setup_system16_bootleg_spritebanking(machine);
+ VIDEO_START_CALL_MEMBER(s16a_bootleg);
+ setup_system16_bootleg_spritebanking(machine());
}
-VIDEO_START( s16a_bootleg_passsht )
+VIDEO_START_MEMBER(segas1x_bootleg_state,s16a_bootleg_passsht)
{
- VIDEO_START_CALL(s16a_bootleg);
- setup_system16_bootleg_spritebanking(machine);
+ VIDEO_START_CALL_MEMBER(s16a_bootleg);
+ setup_system16_bootleg_spritebanking(machine());
}
// Passing Shot (2 player), Shinobi (Datsu), Wonderboy 3
diff --git a/src/mame/video/tagteam.c b/src/mame/video/tagteam.c
index 16892f5409a..4fc79c9b3b0 100644
--- a/src/mame/video/tagteam.c
+++ b/src/mame/video/tagteam.c
@@ -32,14 +32,14 @@ static const res_net_decode_info tagteam_decode_info =
{ 0x07, 0x07, 0x03 } /* masks */
};
-PALETTE_INIT( tagteam )
+void tagteam_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t *rgb;
- rgb = compute_res_net_all(machine, color_prom, &tagteam_decode_info, &tagteam_net_info);
- palette_set_colors(machine, 0x00, rgb, 0x20);
- auto_free(machine, rgb);
+ rgb = compute_res_net_all(machine(), color_prom, &tagteam_decode_info, &tagteam_net_info);
+ palette_set_colors(machine(), 0x00, rgb, 0x20);
+ auto_free(machine(), rgb);
}
@@ -135,10 +135,9 @@ TILE_GET_INFO_MEMBER(tagteam_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( tagteam )
+void tagteam_state::video_start()
{
- tagteam_state *state = machine.driver_data<tagteam_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tagteam_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS_FLIP_X,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tagteam_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS_FLIP_X,
8, 8, 32, 32);
}
diff --git a/src/mame/video/tail2nos.c b/src/mame/video/tail2nos.c
index defd3bf893a..165b0f43999 100644
--- a/src/mame/video/tail2nos.c
+++ b/src/mame/video/tail2nos.c
@@ -53,18 +53,17 @@ static void tail2nos_postload(running_machine &machine)
}
}
-VIDEO_START( tail2nos )
+void tail2nos_state::video_start()
{
- tail2nos_state *state = machine.driver_data<tail2nos_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tail2nos_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tail2nos_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap->set_transparent_pen(15);
+ m_bg_tilemap->set_transparent_pen(15);
- state->m_zoomdata = (UINT16 *)state->memregion("gfx3")->base();
+ m_zoomdata = (UINT16 *)memregion("gfx3")->base();
- state->save_pointer(NAME(state->m_zoomdata), 0x20000 / 2);
- machine.save().register_postload(save_prepost_delegate(FUNC(tail2nos_postload), &machine));
+ save_pointer(NAME(m_zoomdata), 0x20000 / 2);
+ machine().save().register_postload(save_prepost_delegate(FUNC(tail2nos_postload), &machine()));
}
diff --git a/src/mame/video/taito_b.c b/src/mame/video/taito_b.c
index 676904f92db..c42aae5a6ff 100644
--- a/src/mame/video/taito_b.c
+++ b/src/mame/video/taito_b.c
@@ -38,81 +38,75 @@ WRITE16_MEMBER(taitob_state::realpunc_video_ctrl_w)
COMBINE_DATA(&m_realpunc_video_ctrl);
}
-static VIDEO_START( taitob_core )
+VIDEO_START_MEMBER(taitob_state,taitob_core)
{
- taitob_state *state = machine.driver_data<taitob_state>();
- state->m_framebuffer[0] = auto_bitmap_ind16_alloc(machine, 512, 256);
- state->m_framebuffer[1] = auto_bitmap_ind16_alloc(machine, 512, 256);
- state->m_pixel_bitmap = NULL; /* only hitice needs this */
+ m_framebuffer[0] = auto_bitmap_ind16_alloc(machine(), 512, 256);
+ m_framebuffer[1] = auto_bitmap_ind16_alloc(machine(), 512, 256);
+ m_pixel_bitmap = NULL; /* only hitice needs this */
- state->save_item(NAME(state->m_pixel_scroll));
+ save_item(NAME(m_pixel_scroll));
- state->save_item(NAME(*state->m_framebuffer[0]));
- state->save_item(NAME(*state->m_framebuffer[1]));
+ save_item(NAME(*m_framebuffer[0]));
+ save_item(NAME(*m_framebuffer[1]));
}
-VIDEO_START( taitob_color_order0 )
+VIDEO_START_MEMBER(taitob_state,taitob_color_order0)
{
/*graphics are shared, only that they use different palette*/
/*this is the basic layout used in: Nastar, Ashura Blaster, Hit the Ice, Rambo3, Tetris*/
/*Note that in both this and color order 1 pixel_color_base/color_granularity is equal to sprites color base. Pure coincidence? */
- taitob_state *state = machine.driver_data<taitob_state>();
- state->m_b_sp_color_base = 0x40 * 16; /*sprites */
+ m_b_sp_color_base = 0x40 * 16; /*sprites */
/* bg, fg, tx color_base are set in the tc0180vcu interface */
- VIDEO_START_CALL(taitob_core);
+ VIDEO_START_CALL_MEMBER(taitob_core);
}
-VIDEO_START( taitob_color_order1 )
+VIDEO_START_MEMBER(taitob_state,taitob_color_order1)
{
/* this is the reversed layout used in: Crime City, Puzzle Bobble */
- taitob_state *state = machine.driver_data<taitob_state>();
- state->m_b_sp_color_base = 0x80 * 16;
+ m_b_sp_color_base = 0x80 * 16;
- VIDEO_START_CALL(taitob_core);
+ VIDEO_START_CALL_MEMBER(taitob_core);
}
-VIDEO_START( taitob_color_order2 )
+VIDEO_START_MEMBER(taitob_state,taitob_color_order2)
{
/*this is used in: rambo3a, masterw, silentd, selfeena, ryujin */
- taitob_state *state = machine.driver_data<taitob_state>();
- state->m_b_sp_color_base = 0x10 * 16;
+ m_b_sp_color_base = 0x10 * 16;
- VIDEO_START_CALL(taitob_core);
+ VIDEO_START_CALL_MEMBER(taitob_core);
}
-VIDEO_START( hitice )
+VIDEO_START_MEMBER(taitob_state,hitice)
{
- taitob_state *state = machine.driver_data<taitob_state>();
- VIDEO_START_CALL(taitob_color_order0);
+ VIDEO_START_CALL_MEMBER(taitob_color_order0);
- state->m_b_fg_color_base = 0x80; /* hitice also uses this for the pixel_bitmap */
+ m_b_fg_color_base = 0x80; /* hitice also uses this for the pixel_bitmap */
- state->m_pixel_bitmap = auto_bitmap_ind16_alloc(machine, 1024, 512);
+ m_pixel_bitmap = auto_bitmap_ind16_alloc(machine(), 1024, 512);
- state->save_item(NAME(*state->m_pixel_bitmap));
+ save_item(NAME(*m_pixel_bitmap));
}
-VIDEO_RESET( hitice )
+VIDEO_RESET_MEMBER(taitob_state,hitice)
{
/* kludge: clear the bitmap on startup */
- hitice_clear_pixel_bitmap(machine);
+ hitice_clear_pixel_bitmap(machine());
}
-VIDEO_START( realpunc )
+VIDEO_START_MEMBER(taitob_state,realpunc)
{
- taitob_state *state = machine.driver_data<taitob_state>();
- state->m_realpunc_bitmap = auto_bitmap_ind16_alloc(machine, machine.primary_screen->width(), machine.primary_screen->height());
+ m_realpunc_bitmap = auto_bitmap_ind16_alloc(machine(), machine().primary_screen->width(), machine().primary_screen->height());
- VIDEO_START_CALL(taitob_color_order0);
+ VIDEO_START_CALL_MEMBER(taitob_color_order0);
}
diff --git a/src/mame/video/taito_f2.c b/src/mame/video/taito_f2.c
index 10b7b8f14f4..75f4e41f02e 100644
--- a/src/mame/video/taito_f2.c
+++ b/src/mame/video/taito_f2.c
@@ -75,148 +75,142 @@ static void taitof2_core_vh_start (running_machine &machine, int sprite_type, in
/* ( spritetype, hide, hideflip, xoffs, yoffs, flipx, flipy, textflipx, textflipy) */
/**************************************************************************************/
-VIDEO_START( taitof2_default )
+VIDEO_START_MEMBER(taitof2_state,taitof2_default)
{
- taitof2_core_vh_start(machine, 0, 0, 0);
+ taitof2_core_vh_start(machine(), 0, 0, 0);
}
-VIDEO_START( taitof2_megab ) /* Megab, Liquidk */
+VIDEO_START_MEMBER(taitof2_state,taitof2_megab)/* Megab, Liquidk */
{
- taitof2_core_vh_start(machine, 0, 3, 3);
+ taitof2_core_vh_start(machine(), 0, 3, 3);
}
-VIDEO_START( taitof2_quiz ) /* Quiz Crayons, Quiz Jinsei */
+VIDEO_START_MEMBER(taitof2_state,taitof2_quiz)/* Quiz Crayons, Quiz Jinsei */
{
- taitof2_core_vh_start(machine, 3, 3, 3);
+ taitof2_core_vh_start(machine(), 3, 3, 3);
}
-VIDEO_START( taitof2_finalb )
+VIDEO_START_MEMBER(taitof2_state,taitof2_finalb)
{
- taitof2_core_vh_start(machine, 0, 1, 1);
+ taitof2_core_vh_start(machine(), 0, 1, 1);
}
-VIDEO_START( taitof2_ssi )
+VIDEO_START_MEMBER(taitof2_state,taitof2_ssi)
{
- taitof2_core_vh_start(machine, 0, 3, 3);
+ taitof2_core_vh_start(machine(), 0, 3, 3);
}
-VIDEO_START( taitof2_growl )
+VIDEO_START_MEMBER(taitof2_state,taitof2_growl)
{
- taitof2_core_vh_start(machine, 0, 3, 3);
+ taitof2_core_vh_start(machine(), 0, 3, 3);
}
-VIDEO_START( taitof2_ninjak )
+VIDEO_START_MEMBER(taitof2_state,taitof2_ninjak)
{
- taitof2_core_vh_start(machine, 0, 0, 0);
+ taitof2_core_vh_start(machine(), 0, 0, 0);
}
-VIDEO_START( taitof2_qzchikyu )
+VIDEO_START_MEMBER(taitof2_state,taitof2_qzchikyu)
{
- taitof2_core_vh_start(machine, 0, 0, 4);
+ taitof2_core_vh_start(machine(), 0, 0, 4);
}
-VIDEO_START( taitof2_solfigtr )
+VIDEO_START_MEMBER(taitof2_state,taitof2_solfigtr)
{
- taitof2_core_vh_start(machine, 0, 3, -3);
+ taitof2_core_vh_start(machine(), 0, 3, -3);
}
-VIDEO_START( taitof2_koshien )
+VIDEO_START_MEMBER(taitof2_state,taitof2_koshien)
{
- taitof2_core_vh_start(machine, 0, 1, - 1);
+ taitof2_core_vh_start(machine(), 0, 1, - 1);
}
-VIDEO_START( taitof2_gunfront )
+VIDEO_START_MEMBER(taitof2_state,taitof2_gunfront)
{
- taitof2_core_vh_start(machine, 0, 3, 3);
+ taitof2_core_vh_start(machine(), 0, 3, 3);
}
-VIDEO_START( taitof2_thundfox )
+VIDEO_START_MEMBER(taitof2_state,taitof2_thundfox)
{
- taitof2_core_vh_start(machine, 0, 3, -3);
+ taitof2_core_vh_start(machine(), 0, 3, -3);
}
-VIDEO_START( taitof2_mjnquest )
+VIDEO_START_MEMBER(taitof2_state,taitof2_mjnquest)
{
- taitof2_state *state = machine.driver_data<taitof2_state>();
- taitof2_core_vh_start(machine, 0, 0, 0);
+ taitof2_core_vh_start(machine(), 0, 0, 0);
- tc0100scn_set_bg_tilemask(state->m_tc0100scn, 0x7fff);
+ tc0100scn_set_bg_tilemask(m_tc0100scn, 0x7fff);
}
-VIDEO_START( taitof2_footchmp )
+VIDEO_START_MEMBER(taitof2_state,taitof2_footchmp)
{
- taitof2_state *state = machine.driver_data<taitof2_state>();
- taitof2_core_vh_start(machine, 0, 3, 3);
+ taitof2_core_vh_start(machine(), 0, 3, 3);
- state->m_game = FOOTCHMP;
+ m_game = FOOTCHMP;
}
-VIDEO_START( taitof2_hthero )
+VIDEO_START_MEMBER(taitof2_state,taitof2_hthero)
{
- taitof2_state *state = machine.driver_data<taitof2_state>();
- taitof2_core_vh_start(machine, 0, 3, 3);
+ taitof2_core_vh_start(machine(), 0, 3, 3);
- state->m_game = FOOTCHMP;
+ m_game = FOOTCHMP;
}
-VIDEO_START( taitof2_deadconx )
+VIDEO_START_MEMBER(taitof2_state,taitof2_deadconx)
{
- taitof2_core_vh_start(machine, 0, 3, 3);
+ taitof2_core_vh_start(machine(), 0, 3, 3);
}
-VIDEO_START( taitof2_deadconxj )
+VIDEO_START_MEMBER(taitof2_state,taitof2_deadconxj)
{
- taitof2_core_vh_start(machine, 0, 3, 3);
+ taitof2_core_vh_start(machine(), 0, 3, 3);
}
-VIDEO_START( taitof2_metalb )
+VIDEO_START_MEMBER(taitof2_state,taitof2_metalb)
{
- taitof2_core_vh_start(machine, 0, 3, 3);
+ taitof2_core_vh_start(machine(), 0, 3, 3);
}
-VIDEO_START( taitof2_yuyugogo )
+VIDEO_START_MEMBER(taitof2_state,taitof2_yuyugogo)
{
- taitof2_core_vh_start(machine, 1, 3, 3);
+ taitof2_core_vh_start(machine(), 1, 3, 3);
}
-VIDEO_START( taitof2_yesnoj )
+VIDEO_START_MEMBER(taitof2_state,taitof2_yesnoj)
{
- taitof2_core_vh_start(machine, 0, 3, 3);
+ taitof2_core_vh_start(machine(), 0, 3, 3);
}
-VIDEO_START( taitof2_dinorex )
+VIDEO_START_MEMBER(taitof2_state,taitof2_dinorex)
{
- taitof2_core_vh_start(machine, 3, 3, 3);
+ taitof2_core_vh_start(machine(), 3, 3, 3);
}
-VIDEO_START( taitof2_dondokod ) /* dondokod, cameltry */
+VIDEO_START_MEMBER(taitof2_state,taitof2_dondokod)/* dondokod, cameltry */
{
- taitof2_state *state = machine.driver_data<taitof2_state>();
- state->m_pivot_xdisp = -16;
- state->m_pivot_ydisp = 0;
- taitof2_core_vh_start(machine, 0, 3, 3);
+ m_pivot_xdisp = -16;
+ m_pivot_ydisp = 0;
+ taitof2_core_vh_start(machine(), 0, 3, 3);
}
-VIDEO_START( taitof2_pulirula )
+VIDEO_START_MEMBER(taitof2_state,taitof2_pulirula)
{
- taitof2_state *state = machine.driver_data<taitof2_state>();
- state->m_pivot_xdisp = -10; /* alignment seems correct (see level 2, falling */
- state->m_pivot_ydisp = 16; /* block of ice after armour man) */
- taitof2_core_vh_start(machine, 2, 3, 3);
+ m_pivot_xdisp = -10; /* alignment seems correct (see level 2, falling */
+ m_pivot_ydisp = 16; /* block of ice after armour man) */
+ taitof2_core_vh_start(machine(), 2, 3, 3);
}
-VIDEO_START( taitof2_driftout )
+VIDEO_START_MEMBER(taitof2_state,taitof2_driftout)
{
- taitof2_state *state = machine.driver_data<taitof2_state>();
- state->m_pivot_xdisp = -16;
- state->m_pivot_ydisp = 16;
- taitof2_core_vh_start(machine, 0, 3, 3);
+ m_pivot_xdisp = -16;
+ m_pivot_ydisp = 16;
+ taitof2_core_vh_start(machine(), 0, 3, 3);
}
diff --git a/src/mame/video/taito_f3.c b/src/mame/video/taito_f3.c
index 8f327514003..d6ed5fe0c5c 100644
--- a/src/mame/video/taito_f3.c
+++ b/src/mame/video/taito_f3.c
@@ -529,147 +529,146 @@ SCREEN_VBLANK( f3 )
}
}
-VIDEO_START( f3 )
+VIDEO_START_MEMBER(taito_f3_state,f3)
{
- taito_f3_state *state = machine.driver_data<taito_f3_state>();
const struct F3config *pCFG=&f3_config_table[0];
int i;
- state->m_f3_alpha_level_2as=127;
- state->m_f3_alpha_level_2ad=127;
- state->m_f3_alpha_level_3as=127;
- state->m_f3_alpha_level_3ad=127;
- state->m_f3_alpha_level_2bs=127;
- state->m_f3_alpha_level_2bd=127;
- state->m_f3_alpha_level_3bs=127;
- state->m_f3_alpha_level_3bd=127;
- state->m_alpha_level_last = -1;
-
- state->m_pdest_2a = 0x10;
- state->m_pdest_2b = 0x20;
- state->m_tr_2a = 0;
- state->m_tr_2b = 1;
- state->m_pdest_3a = 0x40;
- state->m_pdest_3b = 0x80;
- state->m_tr_3a = 0;
- state->m_tr_3b = 1;
-
- state->m_spritelist=0;
- state->m_spriteram16_buffered=0;
- state->m_pf_line_inf=0;
- state->m_tile_opaque_sp=0;
+ m_f3_alpha_level_2as=127;
+ m_f3_alpha_level_2ad=127;
+ m_f3_alpha_level_3as=127;
+ m_f3_alpha_level_3ad=127;
+ m_f3_alpha_level_2bs=127;
+ m_f3_alpha_level_2bd=127;
+ m_f3_alpha_level_3bs=127;
+ m_f3_alpha_level_3bd=127;
+ m_alpha_level_last = -1;
+
+ m_pdest_2a = 0x10;
+ m_pdest_2b = 0x20;
+ m_tr_2a = 0;
+ m_tr_2b = 1;
+ m_pdest_3a = 0x40;
+ m_pdest_3b = 0x80;
+ m_tr_3a = 0;
+ m_tr_3b = 1;
+
+ m_spritelist=0;
+ m_spriteram16_buffered=0;
+ m_pf_line_inf=0;
+ m_tile_opaque_sp=0;
/* Setup individual game */
do {
- if (pCFG->name==state->m_f3_game)
+ if (pCFG->name==m_f3_game)
{
break;
}
pCFG++;
} while(pCFG->name);
- state->m_f3_game_config=pCFG;
+ m_f3_game_config=pCFG;
- state->m_f3_vram = auto_alloc_array_clear(machine, UINT16, 0x2000/2);
- state->m_f3_pf_data = auto_alloc_array_clear(machine, UINT16, 0xc000/2);
- state->m_videoram = auto_alloc_array_clear(machine, UINT16, 0x2000/2);
- state->m_f3_line_ram = auto_alloc_array_clear(machine, UINT16, 0x10000/2);
- state->m_f3_pivot_ram = auto_alloc_array_clear(machine, UINT16, 0x10000/2);
- state->m_spriteram = auto_alloc_array_clear(machine, UINT16, 0x10000/2);
+ m_f3_vram = auto_alloc_array_clear(machine(), UINT16, 0x2000/2);
+ m_f3_pf_data = auto_alloc_array_clear(machine(), UINT16, 0xc000/2);
+ m_videoram = auto_alloc_array_clear(machine(), UINT16, 0x2000/2);
+ m_f3_line_ram = auto_alloc_array_clear(machine(), UINT16, 0x10000/2);
+ m_f3_pivot_ram = auto_alloc_array_clear(machine(), UINT16, 0x10000/2);
+ m_spriteram = auto_alloc_array_clear(machine(), UINT16, 0x10000/2);
- if (state->m_f3_game_config->extend) {
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info1),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_pf2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info2),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_pf3_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info3),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_pf4_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info4),state),TILEMAP_SCAN_ROWS,16,16,64,32);
+ if (m_f3_game_config->extend) {
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info1),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_pf2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info2),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_pf3_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info3),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_pf4_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info4),this),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_f3_pf_data_1=state->m_f3_pf_data+(0x0000/2);
- state->m_f3_pf_data_2=state->m_f3_pf_data+(0x2000/2);
- state->m_f3_pf_data_3=state->m_f3_pf_data+(0x4000/2);
- state->m_f3_pf_data_4=state->m_f3_pf_data+(0x6000/2);
+ m_f3_pf_data_1=m_f3_pf_data+(0x0000/2);
+ m_f3_pf_data_2=m_f3_pf_data+(0x2000/2);
+ m_f3_pf_data_3=m_f3_pf_data+(0x4000/2);
+ m_f3_pf_data_4=m_f3_pf_data+(0x6000/2);
- state->m_width_mask=0x3ff;
- state->m_twidth_mask=0x7f;
- state->m_twidth_mask_bit=7;
+ m_width_mask=0x3ff;
+ m_twidth_mask=0x7f;
+ m_twidth_mask_bit=7;
- state->m_pf1_tilemap->set_transparent_pen(0);
- state->m_pf2_tilemap->set_transparent_pen(0);
- state->m_pf3_tilemap->set_transparent_pen(0);
- state->m_pf4_tilemap->set_transparent_pen(0);
+ m_pf1_tilemap->set_transparent_pen(0);
+ m_pf2_tilemap->set_transparent_pen(0);
+ m_pf3_tilemap->set_transparent_pen(0);
+ m_pf4_tilemap->set_transparent_pen(0);
} else {
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info1),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_pf2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info2),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_pf3_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info3),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_pf4_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info4),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_pf5_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info5),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_pf6_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info6),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_pf7_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info7),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_pf8_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info8),state),TILEMAP_SCAN_ROWS,16,16,32,32);
-
- state->m_f3_pf_data_1=state->m_f3_pf_data+(0x0000/2);
- state->m_f3_pf_data_2=state->m_f3_pf_data+(0x1000/2);
- state->m_f3_pf_data_3=state->m_f3_pf_data+(0x2000/2);
- state->m_f3_pf_data_4=state->m_f3_pf_data+(0x3000/2);
- state->m_f3_pf_data_5=state->m_f3_pf_data+(0x4000/2);
- state->m_f3_pf_data_6=state->m_f3_pf_data+(0x5000/2);
- state->m_f3_pf_data_7=state->m_f3_pf_data+(0x6000/2);
- state->m_f3_pf_data_8=state->m_f3_pf_data+(0x7000/2);
-
- state->m_width_mask=0x1ff;
- state->m_twidth_mask=0x3f;
- state->m_twidth_mask_bit=6;
-
- state->m_pf1_tilemap->set_transparent_pen(0);
- state->m_pf2_tilemap->set_transparent_pen(0);
- state->m_pf3_tilemap->set_transparent_pen(0);
- state->m_pf4_tilemap->set_transparent_pen(0);
- state->m_pf5_tilemap->set_transparent_pen(0);
- state->m_pf6_tilemap->set_transparent_pen(0);
- state->m_pf7_tilemap->set_transparent_pen(0);
- state->m_pf8_tilemap->set_transparent_pen(0);
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info1),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_pf2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info2),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_pf3_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info3),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_pf4_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info4),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_pf5_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info5),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_pf6_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info6),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_pf7_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info7),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_pf8_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info8),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+
+ m_f3_pf_data_1=m_f3_pf_data+(0x0000/2);
+ m_f3_pf_data_2=m_f3_pf_data+(0x1000/2);
+ m_f3_pf_data_3=m_f3_pf_data+(0x2000/2);
+ m_f3_pf_data_4=m_f3_pf_data+(0x3000/2);
+ m_f3_pf_data_5=m_f3_pf_data+(0x4000/2);
+ m_f3_pf_data_6=m_f3_pf_data+(0x5000/2);
+ m_f3_pf_data_7=m_f3_pf_data+(0x6000/2);
+ m_f3_pf_data_8=m_f3_pf_data+(0x7000/2);
+
+ m_width_mask=0x1ff;
+ m_twidth_mask=0x3f;
+ m_twidth_mask_bit=6;
+
+ m_pf1_tilemap->set_transparent_pen(0);
+ m_pf2_tilemap->set_transparent_pen(0);
+ m_pf3_tilemap->set_transparent_pen(0);
+ m_pf4_tilemap->set_transparent_pen(0);
+ m_pf5_tilemap->set_transparent_pen(0);
+ m_pf6_tilemap->set_transparent_pen(0);
+ m_pf7_tilemap->set_transparent_pen(0);
+ m_pf8_tilemap->set_transparent_pen(0);
}
- state->m_spriteram16_buffered = auto_alloc_array(machine, UINT16, 0x10000/2);
- state->m_spritelist = auto_alloc_array(machine, struct tempsprite, 0x400);
- state->m_sprite_end = state->m_spritelist;
- state->m_vram_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info_vram),state),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_pixel_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info_pixel),state),TILEMAP_SCAN_COLS,8,8,64,32);
- state->m_pf_line_inf = auto_alloc_array(machine, struct f3_playfield_line_inf, 5);
- state->m_sa_line_inf = auto_alloc_array(machine, struct f3_spritealpha_line_inf, 1);
- machine.primary_screen->register_screen_bitmap(state->m_pri_alp_bitmap);
- state->m_tile_opaque_sp = auto_alloc_array(machine, UINT8, machine.gfx[2]->elements());
+ m_spriteram16_buffered = auto_alloc_array(machine(), UINT16, 0x10000/2);
+ m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x400);
+ m_sprite_end = m_spritelist;
+ m_vram_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info_vram),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_pixel_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info_pixel),this),TILEMAP_SCAN_COLS,8,8,64,32);
+ m_pf_line_inf = auto_alloc_array(machine(), struct f3_playfield_line_inf, 5);
+ m_sa_line_inf = auto_alloc_array(machine(), struct f3_spritealpha_line_inf, 1);
+ machine().primary_screen->register_screen_bitmap(m_pri_alp_bitmap);
+ m_tile_opaque_sp = auto_alloc_array(machine(), UINT8, machine().gfx[2]->elements());
for (i=0; i<8; i++)
- state->m_tile_opaque_pf[i] = auto_alloc_array(machine, UINT8, machine.gfx[1]->elements());
+ m_tile_opaque_pf[i] = auto_alloc_array(machine(), UINT8, machine().gfx[1]->elements());
- state->m_vram_layer->set_transparent_pen(0);
- state->m_pixel_layer->set_transparent_pen(0);
+ m_vram_layer->set_transparent_pen(0);
+ m_pixel_layer->set_transparent_pen(0);
/* Palettes have 4 bpp indexes despite up to 6 bpp data. The unused */
/* top bits in the gfx data are cleared later. */
- machine.gfx[1]->set_granularity(16);
- machine.gfx[2]->set_granularity(16);
+ machine().gfx[1]->set_granularity(16);
+ machine().gfx[2]->set_granularity(16);
- state->m_flipscreen = 0;
- memset(state->m_spriteram16_buffered,0,0x10000);
- memset(state->m_spriteram,0,0x10000);
+ m_flipscreen = 0;
+ memset(m_spriteram16_buffered,0,0x10000);
+ memset(m_spriteram,0,0x10000);
- state_save_register_global_array(machine, state->m_f3_control_0);
- state_save_register_global_array(machine, state->m_f3_control_1);
+ state_save_register_global_array(machine(), m_f3_control_0);
+ state_save_register_global_array(machine(), m_f3_control_1);
- machine.gfx[0]->set_source((UINT8 *)state->m_f3_vram);
- machine.gfx[3]->set_source((UINT8 *)state->m_f3_pivot_ram);
+ machine().gfx[0]->set_source((UINT8 *)m_f3_vram);
+ machine().gfx[3]->set_source((UINT8 *)m_f3_pivot_ram);
- state->m_f3_skip_this_frame=0;
+ m_f3_skip_this_frame=0;
- state->m_sprite_lag=state->m_f3_game_config->sprite_lag;
+ m_sprite_lag=m_f3_game_config->sprite_lag;
- init_alpha_blend_func(machine);
+ init_alpha_blend_func(machine());
{
- gfx_element *sprite_gfx = machine.gfx[2];
+ gfx_element *sprite_gfx = machine().gfx[2];
int c;
for (c = 0;c < sprite_gfx->elements();c++)
@@ -686,14 +685,14 @@ VIDEO_START( f3 )
}
dp += sprite_gfx->rowbytes();
}
- if(chk_trans_or_opa==1) state->m_tile_opaque_sp[c]=1;
- else state->m_tile_opaque_sp[c]=0;
+ if(chk_trans_or_opa==1) m_tile_opaque_sp[c]=1;
+ else m_tile_opaque_sp[c]=0;
}
}
{
- gfx_element *pf_gfx = machine.gfx[1];
+ gfx_element *pf_gfx = machine().gfx[1];
int c;
for (c = 0;c < pf_gfx->elements();c++)
@@ -718,7 +717,7 @@ VIDEO_START( f3 )
}
dp += pf_gfx->rowbytes();
}
- state->m_tile_opaque_pf[extra_planes][c]=chk_trans_or_opa;
+ m_tile_opaque_pf[extra_planes][c]=chk_trans_or_opa;
}
}
}
diff --git a/src/mame/video/taito_l.c b/src/mame/video/taito_l.c
index 5329d8d8d5d..a2f50d2948d 100644
--- a/src/mame/video/taito_l.c
+++ b/src/mame/video/taito_l.c
@@ -57,24 +57,23 @@ TILE_GET_INFO_MEMBER(taitol_state::get_ch1a_tile_info)
***************************************************************************/
-VIDEO_START( taitol )
+VIDEO_START_MEMBER(taitol_state,taitol)
{
- taitol_state *state = machine.driver_data<taitol_state>();
int i;
- state->m_bg18_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taitol_state::get_bg18_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg19_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taitol_state::get_bg19_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_ch1a_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taitol_state::get_ch1a_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg18_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taitol_state::get_bg18_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg19_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taitol_state::get_bg19_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_ch1a_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taitol_state::get_ch1a_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg18_tilemap->set_transparent_pen(0);
- state->m_ch1a_tilemap->set_transparent_pen(0);
+ m_bg18_tilemap->set_transparent_pen(0);
+ m_ch1a_tilemap->set_transparent_pen(0);
for (i = 0; i < 256; i++)
- palette_set_color(machine, i, MAKE_RGB(0, 0, 0));
+ palette_set_color(machine(), i, MAKE_RGB(0, 0, 0));
- state->m_ch1a_tilemap->set_scrolldx(-8, -8);
- state->m_bg18_tilemap->set_scrolldx(28, -11);
- state->m_bg19_tilemap->set_scrolldx(38, -21);
+ m_ch1a_tilemap->set_scrolldx(-8, -8);
+ m_bg18_tilemap->set_scrolldx(28, -11);
+ m_bg19_tilemap->set_scrolldx(38, -21);
}
diff --git a/src/mame/video/taito_z.c b/src/mame/video/taito_z.c
index 9b085eb0cb8..17942d9ffaa 100644
--- a/src/mame/video/taito_z.c
+++ b/src/mame/video/taito_z.c
@@ -4,14 +4,13 @@
/**********************************************************/
-VIDEO_START( taitoz )
+VIDEO_START_MEMBER(taitoz_state,taitoz)
{
- taitoz_state *state = machine.driver_data<taitoz_state>();
- state->m_road_palbank = 3;
- state->m_sci_spriteframe = 0;
+ m_road_palbank = 3;
+ m_sci_spriteframe = 0;
- state->save_item(NAME(state->m_road_palbank));
- state->save_item(NAME(state->m_sci_spriteframe));
+ save_item(NAME(m_road_palbank));
+ save_item(NAME(m_sci_spriteframe));
}
/********************************************************
diff --git a/src/mame/video/taitoair.c b/src/mame/video/taitoair.c
index 262dba41fad..16c21d3f3a1 100644
--- a/src/mame/video/taitoair.c
+++ b/src/mame/video/taitoair.c
@@ -551,16 +551,15 @@ READ16_MEMBER(taitoair_state::dsp_y_return_r)
return res;
}
-VIDEO_START( taitoair )
+void taitoair_state::video_start()
{
- taitoair_state *state = machine.driver_data<taitoair_state>();
int width, height;
- width = machine.primary_screen->width();
- height = machine.primary_screen->height();
- state->m_framebuffer[0] = auto_bitmap_ind16_alloc(machine, width, height);
- state->m_framebuffer[1] = auto_bitmap_ind16_alloc(machine, width, height);
- //state->m_buffer3d = auto_bitmap_ind16_alloc(machine, width, height);
+ width = machine().primary_screen->width();
+ height = machine().primary_screen->height();
+ m_framebuffer[0] = auto_bitmap_ind16_alloc(machine(), width, height);
+ m_framebuffer[1] = auto_bitmap_ind16_alloc(machine(), width, height);
+ //m_buffer3d = auto_bitmap_ind16_alloc(machine(), width, height);
}
SCREEN_UPDATE_IND16( taitoair )
diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c
index b9862aa9997..a3e6b8a3ba0 100644
--- a/src/mame/video/taitojc.c
+++ b/src/mame/video/taitojc.c
@@ -298,36 +298,35 @@ static void taitojc_exit(running_machine &machine)
{
}
-VIDEO_START( taitojc )
+void taitojc_state::video_start()
{
- taitojc_state *state = machine.driver_data<taitojc_state>();
- machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(taitojc_exit), &machine));
+ machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(taitojc_exit), &machine()));
/* find first empty slot to decode gfx */
- for (state->m_gfx_index = 0; state->m_gfx_index < MAX_GFX_ELEMENTS; state->m_gfx_index++)
- if (machine.gfx[state->m_gfx_index] == 0)
+ for (m_gfx_index = 0; m_gfx_index < MAX_GFX_ELEMENTS; m_gfx_index++)
+ if (machine().gfx[m_gfx_index] == 0)
break;
- assert(state->m_gfx_index != MAX_GFX_ELEMENTS);
+ assert(m_gfx_index != MAX_GFX_ELEMENTS);
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taitojc_state::taitojc_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taitojc_state::taitojc_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
- state->m_tilemap->set_transparent_pen(0);
+ m_tilemap->set_transparent_pen(0);
- state->m_char_ram = auto_alloc_array_clear(machine, UINT32, 0x4000/4);
- state->m_tile_ram = auto_alloc_array_clear(machine, UINT32, 0x4000/4);
+ m_char_ram = auto_alloc_array_clear(machine(), UINT32, 0x4000/4);
+ m_tile_ram = auto_alloc_array_clear(machine(), UINT32, 0x4000/4);
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine.gfx[state->m_gfx_index] = auto_alloc(machine, gfx_element(machine, taitojc_char_layout, (UINT8 *)state->m_char_ram, machine.total_colors() / 16, 0));
+ machine().gfx[m_gfx_index] = auto_alloc(machine(), gfx_element(machine(), taitojc_char_layout, (UINT8 *)m_char_ram, machine().total_colors() / 16, 0));
- state->m_texture = auto_alloc_array(machine, UINT8, 0x400000);
+ m_texture = auto_alloc_array(machine(), UINT8, 0x400000);
- machine.primary_screen->register_screen_bitmap(state->m_framebuffer);
- machine.primary_screen->register_screen_bitmap(state->m_zbuffer);
+ machine().primary_screen->register_screen_bitmap(m_framebuffer);
+ machine().primary_screen->register_screen_bitmap(m_zbuffer);
/* create renderer */
- state->m_renderer = auto_alloc(machine, taitojc_renderer(machine, &state->m_framebuffer, &state->m_zbuffer, state->m_texture));
+ m_renderer = auto_alloc(machine(), taitojc_renderer(machine(), &m_framebuffer, &m_zbuffer, m_texture));
}
SCREEN_UPDATE_IND16( taitojc )
diff --git a/src/mame/video/taitosj.c b/src/mame/video/taitosj.c
index 2746e1799b6..c5bb9be7a10 100644
--- a/src/mame/video/taitosj.c
+++ b/src/mame/video/taitosj.c
@@ -171,28 +171,27 @@ static void compute_draw_order(running_machine &machine)
}
-VIDEO_START( taitosj )
+void taitosj_state::video_start()
{
- taitosj_state *state = machine.driver_data<taitosj_state>();
int i;
- state->m_sprite_layer_collbitmap1.allocate(16,16);
+ m_sprite_layer_collbitmap1.allocate(16,16);
for (i = 0; i < 3; i++)
{
- machine.primary_screen->register_screen_bitmap(state->m_layer_bitmap[i]);
- machine.primary_screen->register_screen_bitmap(state->m_sprite_layer_collbitmap2[i]);
+ machine().primary_screen->register_screen_bitmap(m_layer_bitmap[i]);
+ machine().primary_screen->register_screen_bitmap(m_sprite_layer_collbitmap2[i]);
}
- state->m_sprite_sprite_collbitmap1.allocate(32,32);
- state->m_sprite_sprite_collbitmap2.allocate(32,32);
+ m_sprite_sprite_collbitmap1.allocate(32,32);
+ m_sprite_sprite_collbitmap2.allocate(32,32);
- machine.gfx[0]->set_source(state->m_characterram);
- machine.gfx[1]->set_source(state->m_characterram);
- machine.gfx[2]->set_source(state->m_characterram + 0x1800);
- machine.gfx[3]->set_source(state->m_characterram + 0x1800);
+ machine().gfx[0]->set_source(m_characterram);
+ machine().gfx[1]->set_source(m_characterram);
+ machine().gfx[2]->set_source(m_characterram + 0x1800);
+ machine().gfx[3]->set_source(m_characterram + 0x1800);
- compute_draw_order(machine);
+ compute_draw_order(machine());
}
diff --git a/src/mame/video/tank8.c b/src/mame/video/tank8.c
index 9b0fa3c1f7f..a5ead4dfa5e 100644
--- a/src/mame/video/tank8.c
+++ b/src/mame/video/tank8.c
@@ -8,29 +8,29 @@ Atari Tank 8 video emulation
#include "includes/tank8.h"
-PALETTE_INIT( tank8 )
+void tank8_state::palette_init()
{
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x0a);
+ machine().colortable = colortable_alloc(machine(), 0x0a);
- colortable_palette_set_color(machine.colortable, 8, MAKE_RGB(0x00, 0x00, 0x00));
- colortable_palette_set_color(machine.colortable, 9, MAKE_RGB(0xff, 0xff, 0xff));
+ colortable_palette_set_color(machine().colortable, 8, MAKE_RGB(0x00, 0x00, 0x00));
+ colortable_palette_set_color(machine().colortable, 9, MAKE_RGB(0xff, 0xff, 0xff));
for (i = 0; i < 8; i++)
{
- colortable_entry_set_value(machine.colortable, 2 * i + 0, 8);
- colortable_entry_set_value(machine.colortable, 2 * i + 1, i);
+ colortable_entry_set_value(machine().colortable, 2 * i + 0, 8);
+ colortable_entry_set_value(machine().colortable, 2 * i + 1, i);
}
/* walls */
- colortable_entry_set_value(machine.colortable, 0x10, 8);
- colortable_entry_set_value(machine.colortable, 0x11, 9);
+ colortable_entry_set_value(machine().colortable, 0x10, 8);
+ colortable_entry_set_value(machine().colortable, 0x11, 9);
/* mines */
- colortable_entry_set_value(machine.colortable, 0x12, 8);
- colortable_entry_set_value(machine.colortable, 0x13, 9);
+ colortable_entry_set_value(machine().colortable, 0x12, 8);
+ colortable_entry_set_value(machine().colortable, 0x13, 9);
}
@@ -99,18 +99,17 @@ TILE_GET_INFO_MEMBER(tank8_state::tank8_get_tile_info)
-VIDEO_START( tank8 )
+void tank8_state::video_start()
{
- tank8_state *state = machine.driver_data<tank8_state>();
- machine.primary_screen->register_screen_bitmap(state->m_helper1);
- machine.primary_screen->register_screen_bitmap(state->m_helper2);
- machine.primary_screen->register_screen_bitmap(state->m_helper3);
+ machine().primary_screen->register_screen_bitmap(m_helper1);
+ machine().primary_screen->register_screen_bitmap(m_helper2);
+ machine().primary_screen->register_screen_bitmap(m_helper3);
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tank8_state::tank8_get_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tank8_state::tank8_get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
/* VBLANK starts on scanline #256 and ends on scanline #24 */
- state->m_tilemap->set_scrolly(0, 2 * 24);
+ m_tilemap->set_scrolly(0, 2 * 24);
}
diff --git a/src/mame/video/tankbatt.c b/src/mame/video/tankbatt.c
index 03dcab7cb70..a966c30c242 100644
--- a/src/mame/video/tankbatt.c
+++ b/src/mame/video/tankbatt.c
@@ -15,16 +15,16 @@
Convert the color PROMs into a more useable format.
***************************************************************************/
-PALETTE_INIT( tankbatt )
+void tankbatt_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
#define RES_1 0xc0 /* this is a guess */
#define RES_2 0x3f /* this is a guess */
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -49,13 +49,13 @@ PALETTE_INIT( tankbatt )
b = RES_1 * bit3;
if (bit3) b += RES_2 * bit0;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0; i < 0x200; i += 2)
{
- colortable_entry_set_value(machine.colortable, i + 0, 0);
- colortable_entry_set_value(machine.colortable, i + 1, i >> 1);
+ colortable_entry_set_value(machine().colortable, i + 0, 0);
+ colortable_entry_set_value(machine().colortable, i + 1, i >> 1);
}
}
@@ -75,10 +75,9 @@ TILE_GET_INFO_MEMBER(tankbatt_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( tankbatt )
+void tankbatt_state::video_start()
{
- tankbatt_state *state = machine.driver_data<tankbatt_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tankbatt_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tankbatt_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_bullets(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/tankbust.c b/src/mame/video/tankbust.c
index 2f569130e3f..d7fc231a5a9 100644
--- a/src/mame/video/tankbust.c
+++ b/src/mame/video/tankbust.c
@@ -74,17 +74,16 @@ TILE_GET_INFO_MEMBER(tankbust_state::get_txt_tile_info)
***************************************************************************/
-VIDEO_START( tankbust )
+void tankbust_state::video_start()
{
- tankbust_state *state = machine.driver_data<tankbust_state>();
/* not scrollable */
- state->m_txt_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tankbust_state::get_txt_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_txt_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tankbust_state::get_txt_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
/* scrollable */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tankbust_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tankbust_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_txt_tilemap->set_transparent_pen(0);
+ m_txt_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/taotaido.c b/src/mame/video/taotaido.c
index 0fddf0df71f..13f517c4394 100644
--- a/src/mame/video/taotaido.c
+++ b/src/mame/video/taotaido.c
@@ -180,16 +180,15 @@ TILEMAP_MAPPER_MEMBER(taotaido_state::taotaido_tilemap_scan_rows)
return row*0x40 + (col&0x3f) + ((col&0x40)<<6);
}
-VIDEO_START(taotaido)
+void taotaido_state::video_start()
{
- taotaido_state *state = machine.driver_data<taotaido_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(taotaido_state::taotaido_bg_tile_info),state),tilemap_mapper_delegate(FUNC(taotaido_state::taotaido_tilemap_scan_rows),state),16,16,128,64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taotaido_state::taotaido_bg_tile_info),this),tilemap_mapper_delegate(FUNC(taotaido_state::taotaido_tilemap_scan_rows),this),16,16,128,64);
- state->m_spriteram_old = auto_alloc_array(machine, UINT16, 0x2000/2);
- state->m_spriteram_older = auto_alloc_array(machine, UINT16, 0x2000/2);
+ m_spriteram_old = auto_alloc_array(machine(), UINT16, 0x2000/2);
+ m_spriteram_older = auto_alloc_array(machine(), UINT16, 0x2000/2);
- state->m_spriteram2_old = auto_alloc_array(machine, UINT16, 0x10000/2);
- state->m_spriteram2_older = auto_alloc_array(machine, UINT16, 0x10000/2);
+ m_spriteram2_old = auto_alloc_array(machine(), UINT16, 0x10000/2);
+ m_spriteram2_older = auto_alloc_array(machine(), UINT16, 0x10000/2);
}
diff --git a/src/mame/video/targeth.c b/src/mame/video/targeth.c
index dc7b90753bb..a01e06f4692 100644
--- a/src/mame/video/targeth.c
+++ b/src/mame/video/targeth.c
@@ -69,13 +69,12 @@ WRITE16_MEMBER(targeth_state::targeth_vram_w)
***************************************************************************/
-VIDEO_START( targeth )
+void targeth_state::video_start()
{
- targeth_state *state = machine.driver_data<targeth_state>();
- state->m_pant[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(targeth_state::get_tile_info_targeth_screen0),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_pant[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(targeth_state::get_tile_info_targeth_screen1),state),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_pant[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(targeth_state::get_tile_info_targeth_screen0),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_pant[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(targeth_state::get_tile_info_targeth_screen1),this),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_pant[0]->set_transparent_pen(0);
+ m_pant[0]->set_transparent_pen(0);
}
diff --git a/src/mame/video/tatsumi.c b/src/mame/video/tatsumi.c
index da8ca04ae40..ec0889f732b 100644
--- a/src/mame/video/tatsumi.c
+++ b/src/mame/video/tatsumi.c
@@ -186,50 +186,46 @@ TILE_GET_INFO_MEMBER(tatsumi_state::get_tile_info_bigfight_1)
/********************************************************************/
-VIDEO_START( apache3 )
+VIDEO_START_MEMBER(tatsumi_state,apache3)
{
- tatsumi_state *state = machine.driver_data<tatsumi_state>();
- state->m_tx_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_text_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,64);
- state->m_shadow_pen_array = auto_alloc_array_clear(machine, UINT8, 8192);
- state->m_temp_bitmap.allocate(512, 512);
- state->m_apache3_road_x_ram = auto_alloc_array(machine, UINT8, 512);
+ m_tx_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_shadow_pen_array = auto_alloc_array_clear(machine(), UINT8, 8192);
+ m_temp_bitmap.allocate(512, 512);
+ m_apache3_road_x_ram = auto_alloc_array(machine(), UINT8, 512);
- state->m_tx_layer->set_transparent_pen(0);
+ m_tx_layer->set_transparent_pen(0);
}
-VIDEO_START( roundup5 )
+VIDEO_START_MEMBER(tatsumi_state,roundup5)
{
- tatsumi_state *state = machine.driver_data<tatsumi_state>();
- state->m_tx_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_text_tile_info),state),TILEMAP_SCAN_ROWS,8,8,128,64);
- state->m_shadow_pen_array = auto_alloc_array_clear(machine, UINT8, 8192);
- state->m_roundup5_vram = auto_alloc_array(machine, UINT16, (0x48000 * 4)/2);
+ m_tx_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,64);
+ m_shadow_pen_array = auto_alloc_array_clear(machine(), UINT8, 8192);
+ m_roundup5_vram = auto_alloc_array(machine(), UINT16, (0x48000 * 4)/2);
- state->m_tx_layer->set_transparent_pen(0);
+ m_tx_layer->set_transparent_pen(0);
- machine.gfx[1]->set_source((UINT8 *)state->m_roundup5_vram);
+ machine().gfx[1]->set_source((UINT8 *)m_roundup5_vram);
}
-VIDEO_START( cyclwarr )
+VIDEO_START_MEMBER(tatsumi_state,cyclwarr)
{
- tatsumi_state *state = machine.driver_data<tatsumi_state>();
- state->m_layer0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_0),state),TILEMAP_SCAN_ROWS,8,8,64,512);
- //state->m_layer1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_0),state),TILEMAP_SCAN_ROWS,8,8,64,512);
- state->m_layer1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_0),state),TILEMAP_SCAN_ROWS,8,8,128,256);
- state->m_layer2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_1),state),TILEMAP_SCAN_ROWS,8,8,64,512);
- state->m_layer3 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_1),state),TILEMAP_SCAN_ROWS,8,8,64,512);
+ m_layer0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_0),this),TILEMAP_SCAN_ROWS,8,8,64,512);
+ //m_layer1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_0),this),TILEMAP_SCAN_ROWS,8,8,64,512);
+ m_layer1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_0),this),TILEMAP_SCAN_ROWS,8,8,128,256);
+ m_layer2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_1),this),TILEMAP_SCAN_ROWS,8,8,64,512);
+ m_layer3 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_1),this),TILEMAP_SCAN_ROWS,8,8,64,512);
- state->m_shadow_pen_array = auto_alloc_array_clear(machine, UINT8, 8192);
+ m_shadow_pen_array = auto_alloc_array_clear(machine(), UINT8, 8192);
}
-VIDEO_START( bigfight )
+VIDEO_START_MEMBER(tatsumi_state,bigfight)
{
- tatsumi_state *state = machine.driver_data<tatsumi_state>();
- state->m_layer0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_0),state),TILEMAP_SCAN_ROWS,8,8,128,256);
- state->m_layer1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_0),state),TILEMAP_SCAN_ROWS,8,8,128,256);
- state->m_layer2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_1),state),TILEMAP_SCAN_ROWS,8,8,128,256);
- state->m_layer3 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_1),state),TILEMAP_SCAN_ROWS,8,8,128,256);
+ m_layer0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_0),this),TILEMAP_SCAN_ROWS,8,8,128,256);
+ m_layer1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_0),this),TILEMAP_SCAN_ROWS,8,8,128,256);
+ m_layer2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_1),this),TILEMAP_SCAN_ROWS,8,8,128,256);
+ m_layer3 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tatsumi_state::get_tile_info_bigfight_1),this),TILEMAP_SCAN_ROWS,8,8,128,256);
- state->m_shadow_pen_array = auto_alloc_array_clear(machine, UINT8, 8192);
+ m_shadow_pen_array = auto_alloc_array_clear(machine(), UINT8, 8192);
}
/********************************************************************/
diff --git a/src/mame/video/tbowl.c b/src/mame/video/tbowl.c
index 95845200e8e..46114e51a63 100644
--- a/src/mame/video/tbowl.c
+++ b/src/mame/video/tbowl.c
@@ -187,16 +187,15 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
/*** Video Start / Update ***/
-VIDEO_START( tbowl )
+void tbowl_state::video_start()
{
- tbowl_state *state = machine.driver_data<tbowl_state>();
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tbowl_state::get_tx_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tbowl_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS, 16, 16,128,32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tbowl_state::get_bg2_tile_info),state),TILEMAP_SCAN_ROWS, 16, 16,128,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tbowl_state::get_tx_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tbowl_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16,128,32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tbowl_state::get_bg2_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16,128,32);
- state->m_tx_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_bg2_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_bg2_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/tceptor.c b/src/mame/video/tceptor.c
index 32cb46baca5..bef73fd73f0 100644
--- a/src/mame/video/tceptor.c
+++ b/src/mame/video/tceptor.c
@@ -18,14 +18,13 @@
/*******************************************************************/
-PALETTE_INIT( tceptor )
+void tceptor_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- tceptor_state *state = machine.driver_data<tceptor_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x400);
+ machine().colortable = colortable_alloc(machine(), 0x400);
/* create a lookup table for the palette */
for (i = 0; i < 0x400; i++)
@@ -34,7 +33,7 @@ PALETTE_INIT( tceptor )
int g = pal4bit(color_prom[i + 0x400]);
int b = pal4bit(color_prom[i + 0x800]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -53,36 +52,36 @@ PALETTE_INIT( tceptor )
for (i = 0; i < 0x0400; i++)
{
int ctabentry = color_prom[i];
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites lookup table (1024 colors) */
for (i = 0x0400; i < 0x0800; i++)
{
int ctabentry = color_prom[i] | 0x300;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* background: no lookup PROM, use directly (512 colors) */
for (i = 0x0a00; i < 0x0c00; i++)
{
int ctabentry = i & 0x1ff;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* road lookup table (256 colors) */
for (i = 0x0f00; i < 0x1000; i++)
{
int ctabentry = color_prom[i - 0x700] | 0x200;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* setup sprite mask color map */
/* tceptor2: only 0x23 */
- memset(state->m_is_mask_spr, 0, sizeof state->m_is_mask_spr);
+ memset(m_is_mask_spr, 0, sizeof m_is_mask_spr);
for (i = 0; i < 0x400; i++)
- if (colortable_entry_get_value(machine.colortable, i | 0x400) == SPR_MASK_COLOR)
- state->m_is_mask_spr[i >> 4] = 1;
+ if (colortable_entry_get_value(machine().colortable, i | 0x400) == SPR_MASK_COLOR)
+ m_is_mask_spr[i >> 4] = 1;
}
@@ -365,47 +364,46 @@ static void decode_sprite32(running_machine &machine, const char * region)
decode_sprite(machine, state->m_sprite32, &spr32_layout, dst);
}
-VIDEO_START( tceptor )
+void tceptor_state::video_start()
{
- tceptor_state *state = machine.driver_data<tceptor_state>();
int gfx_index;
- state->m_sprite_ram_buffered = auto_alloc_array_clear(machine, UINT16, 0x200/2);
+ m_sprite_ram_buffered = auto_alloc_array_clear(machine(), UINT16, 0x200/2);
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine.gfx[gfx_index] == 0)
+ if (machine().gfx[gfx_index] == 0)
break;
assert(gfx_index + 4 <= MAX_GFX_ELEMENTS);
- state->m_bg = gfx_index++;
- decode_bg(machine, "gfx2");
+ m_bg = gfx_index++;
+ decode_bg(machine(), "gfx2");
- state->m_sprite16 = gfx_index++;
- decode_sprite16(machine, "gfx3");
+ m_sprite16 = gfx_index++;
+ decode_sprite16(machine(), "gfx3");
- state->m_sprite32 = gfx_index++;
- decode_sprite32(machine, "gfx4");
+ m_sprite32 = gfx_index++;
+ decode_sprite32(machine(), "gfx4");
/* allocate temp bitmaps */
- machine.primary_screen->register_screen_bitmap(state->m_temp_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_temp_bitmap);
- state->m_c45_road->set_transparent_color(colortable_entry_get_value(machine.colortable, 0xfff));
+ m_c45_road->set_transparent_color(colortable_entry_get_value(machine().colortable, 0xfff));
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tceptor_state::get_tx_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 34, 28);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tceptor_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 34, 28);
- state->m_tx_tilemap->set_scrollx(0, -2*8);
- state->m_tx_tilemap->set_scrolly(0, 0);
- colortable_configure_tilemap_groups(machine.colortable, state->m_tx_tilemap, machine.gfx[0], 7);
+ m_tx_tilemap->set_scrollx(0, -2*8);
+ m_tx_tilemap->set_scrolly(0, 0);
+ colortable_configure_tilemap_groups(machine().colortable, m_tx_tilemap, machine().gfx[0], 7);
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tceptor_state::get_bg1_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tceptor_state::get_bg2_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tceptor_state::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tceptor_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state_save_register_global_pointer(machine, state->m_sprite_ram_buffered, 0x200 / 2);
- state_save_register_global(machine, state->m_bg1_scroll_x);
- state_save_register_global(machine, state->m_bg1_scroll_y);
- state_save_register_global(machine, state->m_bg2_scroll_x);
- state_save_register_global(machine, state->m_bg2_scroll_y);
+ state_save_register_global_pointer(machine(), m_sprite_ram_buffered, 0x200 / 2);
+ state_save_register_global(machine(), m_bg1_scroll_x);
+ state_save_register_global(machine(), m_bg1_scroll_y);
+ state_save_register_global(machine(), m_bg2_scroll_x);
+ state_save_register_global(machine(), m_bg2_scroll_y);
}
diff --git a/src/mame/video/tecmo.c b/src/mame/video/tecmo.c
index 4ae54866f3e..73705795271 100644
--- a/src/mame/video/tecmo.c
+++ b/src/mame/video/tecmo.c
@@ -79,27 +79,26 @@ TILE_GET_INFO_MEMBER(tecmo_state::get_tx_tile_info)
***************************************************************************/
-VIDEO_START( tecmo )
+VIDEO_START_MEMBER(tecmo_state,tecmo)
{
- tecmo_state *state = machine.driver_data<tecmo_state>();
- if (state->m_video_type == 2) /* gemini */
+ if (m_video_type == 2) /* gemini */
{
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo_state::gemini_get_bg_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,16);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo_state::gemini_get_fg_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,16);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo_state::gemini_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo_state::gemini_get_fg_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,16);
}
else /* rygar, silkworm */
{
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,16);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,16);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,16);
}
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo_state::get_tx_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,32,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo_state::get_tx_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_scrolldx(-48,256+48);
- state->m_fg_tilemap->set_scrolldx(-48,256+48);
+ m_bg_tilemap->set_scrolldx(-48,256+48);
+ m_fg_tilemap->set_scrolldx(-48,256+48);
}
diff --git a/src/mame/video/tecmo16.c b/src/mame/video/tecmo16.c
index c0668abfb4f..26c14d9acdb 100644
--- a/src/mame/video/tecmo16.c
+++ b/src/mame/video/tecmo16.c
@@ -53,73 +53,70 @@ TILE_GET_INFO_MEMBER(tecmo16_state::tx_get_tile_info)
/******************************************************************************/
-VIDEO_START( fstarfrc )
+void tecmo16_state::video_start()
{
- tecmo16_state *state = machine.driver_data<tecmo16_state>();
/* set up tile layers */
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_bg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_fg);
/* set up sprites */
- machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_sprite_bitmap);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::fg_get_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::bg_get_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::tx_get_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::fg_get_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::bg_get_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::tx_get_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_scrolly(0,-16);
- state->m_flipscreen = 0;
- state->m_game_is_riot = 0;
+ m_tx_tilemap->set_scrolly(0,-16);
+ m_flipscreen = 0;
+ m_game_is_riot = 0;
}
-VIDEO_START( ginkun )
+VIDEO_START_MEMBER(tecmo16_state,ginkun)
{
- tecmo16_state *state = machine.driver_data<tecmo16_state>();
/* set up tile layers */
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_bg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_fg);
/* set up sprites */
- machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_sprite_bitmap);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::fg_get_tile_info),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::bg_get_tile_info),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::tx_get_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::fg_get_tile_info),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::bg_get_tile_info),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::tx_get_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_transparent_pen(0);
- state->m_flipscreen = 0;
- state->m_game_is_riot = 0;
+ m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
+ m_flipscreen = 0;
+ m_game_is_riot = 0;
}
-VIDEO_START( riot )
+VIDEO_START_MEMBER(tecmo16_state,riot)
{
- tecmo16_state *state = machine.driver_data<tecmo16_state>();
/* set up tile layers */
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
- machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_bg);
+ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_fg);
/* set up sprites */
- machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
-
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::fg_get_tile_info),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::bg_get_tile_info),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::tx_get_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
-
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_bg_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_scrolldy(-16,-16);
- state->m_flipscreen = 0;
- state->m_game_is_riot = 1;
+ machine().primary_screen->register_screen_bitmap(m_sprite_bitmap);
+
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::fg_get_tile_info),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::bg_get_tile_info),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmo16_state::tx_get_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+
+ m_fg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_scrolldy(-16,-16);
+ m_flipscreen = 0;
+ m_game_is_riot = 1;
}
/******************************************************************************/
diff --git a/src/mame/video/tecmosys.c b/src/mame/video/tecmosys.c
index 6c4a8943930..5e631ab8bb1 100644
--- a/src/mame/video/tecmosys.c
+++ b/src/mame/video/tecmosys.c
@@ -328,28 +328,27 @@ SCREEN_UPDATE_RGB32(tecmosys)
return 0;
}
-VIDEO_START(tecmosys)
+void tecmosys_state::video_start()
{
- tecmosys_state *state = machine.driver_data<tecmosys_state>();
- state->m_sprite_bitmap.allocate(320,240);
- state->m_sprite_bitmap.fill(0x4000);
+ m_sprite_bitmap.allocate(320,240);
+ m_sprite_bitmap.fill(0x4000);
- state->m_tmp_tilemap_composebitmap.allocate(320,240);
- state->m_tmp_tilemap_renderbitmap.allocate(320,240);
+ m_tmp_tilemap_composebitmap.allocate(320,240);
+ m_tmp_tilemap_renderbitmap.allocate(320,240);
- state->m_tmp_tilemap_composebitmap.fill(0x0000);
- state->m_tmp_tilemap_renderbitmap.fill(0x0000);
+ m_tmp_tilemap_composebitmap.fill(0x0000);
+ m_tmp_tilemap_renderbitmap.fill(0x0000);
- state->m_txt_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmosys_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32*2,32*2);
- state->m_txt_tilemap->set_transparent_pen(0);
+ m_txt_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmosys_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32*2,32*2);
+ m_txt_tilemap->set_transparent_pen(0);
- state->m_bg0tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg0tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_bg0tilemap->set_transparent_pen(0);
+ m_bg0tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg0tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_bg0tilemap->set_transparent_pen(0);
- state->m_bg1tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg1tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_bg1tilemap->set_transparent_pen(0);
+ m_bg1tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg1tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_bg1tilemap->set_transparent_pen(0);
- state->m_bg2tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg2tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_bg2tilemap->set_transparent_pen(0);
+ m_bg2tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg2tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_bg2tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/tehkanwc.c b/src/mame/video/tehkanwc.c
index a67ef7fb922..bf215b1985a 100644
--- a/src/mame/video/tehkanwc.c
+++ b/src/mame/video/tehkanwc.c
@@ -85,16 +85,15 @@ TILE_GET_INFO_MEMBER(tehkanwc_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( tehkanwc )
+void tehkanwc_state::video_start()
{
- tehkanwc_state *state = machine.driver_data<tehkanwc_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tehkanwc_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tehkanwc_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
16, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tehkanwc_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tehkanwc_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
/*
diff --git a/src/mame/video/terracre.c b/src/mame/video/terracre.c
index 371bbbaa5d3..6541c611065 100644
--- a/src/mame/video/terracre.c
+++ b/src/mame/video/terracre.c
@@ -89,13 +89,13 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
}
}
-PALETTE_INIT( amazon )
+void terracre_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -104,7 +104,7 @@ PALETTE_INIT( amazon )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -112,7 +112,7 @@ PALETTE_INIT( amazon )
/* characters use colors 0-0x0f */
for (i = 0; i < 0x10; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* background tiles use colors 0xc0-0xff in four banks */
/* the bottom two bits of the color code select the palette bank for */
@@ -126,7 +126,7 @@ PALETTE_INIT( amazon )
else
ctabentry = 0xc0 | (i & 0x0f) | ((i & 0x30) >> 0);
- colortable_entry_set_value(machine.colortable, 0x10 + i, ctabentry);
+ colortable_entry_set_value(machine().colortable, 0x10 + i, ctabentry);
}
/* sprites use colors 128-191 in four banks */
@@ -144,7 +144,7 @@ PALETTE_INIT( amazon )
else
ctabentry = 0x80 | ((i & 0x03) << 4) | (color_prom[i >> 4] & 0x0f);
- colortable_entry_set_value(machine.colortable, 0x110 + i_swapped, ctabentry);
+ colortable_entry_set_value(machine().colortable, 0x110 + i_swapped, ctabentry);
}
}
@@ -183,16 +183,15 @@ WRITE16_MEMBER(terracre_state::amazon_scrollx_w)
m_background->set_scrollx(0,m_xscroll);
}
-VIDEO_START( amazon )
+void terracre_state::video_start()
{
- terracre_state *state = machine.driver_data<terracre_state>();
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(terracre_state::get_bg_tile_info),state),TILEMAP_SCAN_COLS,16,16,64,32);
- state->m_foreground = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(terracre_state::get_fg_tile_info),state),TILEMAP_SCAN_COLS,8,8,64,32);
- state->m_foreground->set_transparent_pen(0xf);
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(terracre_state::get_bg_tile_info),this),TILEMAP_SCAN_COLS,16,16,64,32);
+ m_foreground = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(terracre_state::get_fg_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,32);
+ m_foreground->set_transparent_pen(0xf);
/* register for saving */
- state_save_register_global(machine, state->m_xscroll);
- state_save_register_global(machine, state->m_yscroll);
+ state_save_register_global(machine(), m_xscroll);
+ state_save_register_global(machine(), m_yscroll);
}
SCREEN_UPDATE_IND16( amazon )
diff --git a/src/mame/video/tetrisp2.c b/src/mame/video/tetrisp2.c
index 3e151acc1be..d5b2c4300b9 100644
--- a/src/mame/video/tetrisp2.c
+++ b/src/mame/video/tetrisp2.c
@@ -234,63 +234,59 @@ WRITE16_MEMBER(tetrisp2_state::rocknms_sub_vram_rot_w)
-VIDEO_START( tetrisp2 )
+VIDEO_START_MEMBER(tetrisp2_state,tetrisp2)
{
- tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
- state->m_flipscreen_old = -1;
+ m_flipscreen_old = -1;
- state->m_tilemap_bg = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_bg),state),TILEMAP_SCAN_ROWS,16,16,NX_0,NY_0);
- state->m_tilemap_fg = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_fg),state),TILEMAP_SCAN_ROWS,8,8,NX_1,NY_1);
- state->m_tilemap_rot = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rot),state),TILEMAP_SCAN_ROWS,16,16,NX_0*2,NY_0*2);
- state->m_tilemap_bg->set_transparent_pen(0);
- state->m_tilemap_fg->set_transparent_pen(0);
- state->m_tilemap_rot->set_transparent_pen(0);
+ m_tilemap_bg = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_bg),this),TILEMAP_SCAN_ROWS,16,16,NX_0,NY_0);
+ m_tilemap_fg = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_fg),this),TILEMAP_SCAN_ROWS,8,8,NX_1,NY_1);
+ m_tilemap_rot = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rot),this),TILEMAP_SCAN_ROWS,16,16,NX_0*2,NY_0*2);
+ m_tilemap_bg->set_transparent_pen(0);
+ m_tilemap_fg->set_transparent_pen(0);
+ m_tilemap_rot->set_transparent_pen(0);
// should be smaller and mirrored like m32 I guess
- state->m_priority = auto_alloc_array(machine, UINT8, 0x40000);
- ms32_rearrange_sprites(machine, "gfx1");
+ m_priority = auto_alloc_array(machine(), UINT8, 0x40000);
+ ms32_rearrange_sprites(machine(), "gfx1");
}
-VIDEO_START( nndmseal )
+VIDEO_START_MEMBER(tetrisp2_state,nndmseal)
{
- tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
- VIDEO_START_CALL( tetrisp2 );
- state->m_tilemap_bg->set_scrolldx(-4,-4);
+ VIDEO_START_CALL_MEMBER( tetrisp2 );
+ m_tilemap_bg->set_scrolldx(-4,-4);
}
-VIDEO_START( rockntread )
+VIDEO_START_MEMBER(tetrisp2_state,rockntread)
{
- tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
- state->m_flipscreen_old = -1;
+ m_flipscreen_old = -1;
- state->m_tilemap_bg = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_bg),state),TILEMAP_SCAN_ROWS,16, 16, 256, 16); // rockn ms(main),1,2,3,4
- state->m_tilemap_fg = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_fg),state),TILEMAP_SCAN_ROWS,8, 8, 64, 64);
- state->m_tilemap_rot = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rot),state),TILEMAP_SCAN_ROWS,16, 16, 128, 128);
+ m_tilemap_bg = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_bg),this),TILEMAP_SCAN_ROWS,16, 16, 256, 16); // rockn ms(main),1,2,3,4
+ m_tilemap_fg = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_fg),this),TILEMAP_SCAN_ROWS,8, 8, 64, 64);
+ m_tilemap_rot = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rot),this),TILEMAP_SCAN_ROWS,16, 16, 128, 128);
- state->m_tilemap_bg->set_transparent_pen(0);
- state->m_tilemap_fg->set_transparent_pen(0);
- state->m_tilemap_rot->set_transparent_pen(0);
+ m_tilemap_bg->set_transparent_pen(0);
+ m_tilemap_fg->set_transparent_pen(0);
+ m_tilemap_rot->set_transparent_pen(0);
// should be smaller and mirrored like m32 I guess
- state->m_priority = auto_alloc_array(machine, UINT8, 0x40000);
- ms32_rearrange_sprites(machine, "gfx1");
+ m_priority = auto_alloc_array(machine(), UINT8, 0x40000);
+ ms32_rearrange_sprites(machine(), "gfx1");
}
-VIDEO_START( rocknms )
+VIDEO_START_MEMBER(tetrisp2_state,rocknms)
{
- tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
- VIDEO_START_CALL( rockntread );
+ VIDEO_START_CALL_MEMBER( rockntread );
- state->m_tilemap_sub_bg = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rocknms_sub_bg),state),TILEMAP_SCAN_ROWS,16, 16, 32, 256); // rockn ms(sub)
- state->m_tilemap_sub_fg = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rocknms_sub_fg),state),TILEMAP_SCAN_ROWS,8, 8, 64, 64);
- state->m_tilemap_sub_rot = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rocknms_sub_rot),state),TILEMAP_SCAN_ROWS,16, 16, 128, 128);
+ m_tilemap_sub_bg = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rocknms_sub_bg),this),TILEMAP_SCAN_ROWS,16, 16, 32, 256); // rockn ms(sub)
+ m_tilemap_sub_fg = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rocknms_sub_fg),this),TILEMAP_SCAN_ROWS,8, 8, 64, 64);
+ m_tilemap_sub_rot = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rocknms_sub_rot),this),TILEMAP_SCAN_ROWS,16, 16, 128, 128);
- state->m_tilemap_sub_bg->set_transparent_pen(0);
- state->m_tilemap_sub_fg->set_transparent_pen(0);
- state->m_tilemap_sub_rot->set_transparent_pen(0);
+ m_tilemap_sub_bg->set_transparent_pen(0);
+ m_tilemap_sub_fg->set_transparent_pen(0);
+ m_tilemap_sub_rot->set_transparent_pen(0);
- ms32_rearrange_sprites(machine, "gfx5");
+ ms32_rearrange_sprites(machine(), "gfx5");
}
@@ -746,24 +742,23 @@ TILE_GET_INFO_MEMBER(tetrisp2_state::stepstag_get_tile_info_fg)
0);
}
-VIDEO_START( stepstag )
+VIDEO_START_MEMBER(stepstag_state,stepstag)
{
- stepstag_state *state = machine.driver_data<stepstag_state>();
- state->m_flipscreen_old = -1;
+ m_flipscreen_old = -1;
- state->m_tilemap_bg = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_bg),state),TILEMAP_SCAN_ROWS,16,16,NX_0,NY_0);
+ m_tilemap_bg = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_bg),this),TILEMAP_SCAN_ROWS,16,16,NX_0,NY_0);
// Temporary hack
- state->m_tilemap_fg = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::stepstag_get_tile_info_fg),state),TILEMAP_SCAN_ROWS,8,8,NX_1,NY_1);
- state->m_tilemap_rot = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rot),state),TILEMAP_SCAN_ROWS,16,16,NX_0*2,NY_0*2);
- state->m_tilemap_bg->set_transparent_pen(0);
- state->m_tilemap_fg->set_transparent_pen(0);
- state->m_tilemap_rot->set_transparent_pen(0);
+ m_tilemap_fg = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::stepstag_get_tile_info_fg),this),TILEMAP_SCAN_ROWS,8,8,NX_1,NY_1);
+ m_tilemap_rot = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tetrisp2_state::get_tile_info_rot),this),TILEMAP_SCAN_ROWS,16,16,NX_0*2,NY_0*2);
+ m_tilemap_bg->set_transparent_pen(0);
+ m_tilemap_fg->set_transparent_pen(0);
+ m_tilemap_rot->set_transparent_pen(0);
// should be smaller and mirrored like m32 I guess
- state->m_priority = auto_alloc_array(machine, UINT8, 0x40000);
+ m_priority = auto_alloc_array(machine(), UINT8, 0x40000);
- ms32_rearrange_sprites(machine, "sprites_horiz");
- ms32_rearrange_sprites(machine, "sprites_vert");
+ ms32_rearrange_sprites(machine(), "sprites_horiz");
+ ms32_rearrange_sprites(machine(), "sprites_vert");
}
SCREEN_UPDATE_IND16( stepstag_left )
diff --git a/src/mame/video/thedeep.c b/src/mame/video/thedeep.c
index a6afa9b2d74..fda1cb79152 100644
--- a/src/mame/video/thedeep.c
+++ b/src/mame/video/thedeep.c
@@ -84,12 +84,12 @@ WRITE8_MEMBER(thedeep_state::thedeep_vram_1_w)
***************************************************************************/
-PALETTE_INIT( thedeep )
+void thedeep_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0;i < 512;i++)
- palette_set_color_rgb(machine,i,pal4bit(color_prom[0x400 + i] >> 0),pal4bit(color_prom[0x400 + i] >> 4),pal4bit(color_prom[0x200 + i] >> 0));
+ palette_set_color_rgb(machine(),i,pal4bit(color_prom[0x400 + i] >> 0),pal4bit(color_prom[0x400 + i] >> 4),pal4bit(color_prom[0x200 + i] >> 0));
}
/***************************************************************************
@@ -98,16 +98,15 @@ PALETTE_INIT( thedeep )
***************************************************************************/
-VIDEO_START( thedeep )
+void thedeep_state::video_start()
{
- thedeep_state *state = machine.driver_data<thedeep_state>();
- state->m_tilemap_0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(thedeep_state::get_tile_info_0),state),tilemap_mapper_delegate(FUNC(thedeep_state::tilemap_scan_rows_back),state),16,16,0x20,0x20);
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(thedeep_state::get_tile_info_1),state),TILEMAP_SCAN_ROWS,8,8,0x20,0x20);
+ m_tilemap_0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(thedeep_state::get_tile_info_0),this),tilemap_mapper_delegate(FUNC(thedeep_state::tilemap_scan_rows_back),this),16,16,0x20,0x20);
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(thedeep_state::get_tile_info_1),this),TILEMAP_SCAN_ROWS,8,8,0x20,0x20);
- state->m_tilemap_0->set_transparent_pen(0 );
- state->m_tilemap_1->set_transparent_pen(0 );
+ m_tilemap_0->set_transparent_pen(0 );
+ m_tilemap_1->set_transparent_pen(0 );
- state->m_tilemap_0->set_scroll_cols(0x20); // column scroll for the background
+ m_tilemap_0->set_scroll_cols(0x20); // column scroll for the background
}
/***************************************************************************
diff --git a/src/mame/video/thepit.c b/src/mame/video/thepit.c
index 04c49cfe314..48bf8863e2c 100644
--- a/src/mame/video/thepit.c
+++ b/src/mame/video/thepit.c
@@ -26,9 +26,9 @@
***************************************************************************/
-PALETTE_INIT( thepit )
+void thepit_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 32; i++)
@@ -50,13 +50,13 @@ PALETTE_INIT( thepit )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
/* allocate primary colors for the background and foreground
this is wrong, but I don't know where to pick the colors from */
for (i = 0; i < 8; i++)
- palette_set_color_rgb(machine, i + 32, pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0));
+ palette_set_color_rgb(machine(), i + 32, pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0));
}
@@ -67,9 +67,9 @@ PALETTE_INIT( thepit )
***************************************************************************/
-PALETTE_INIT( suprmous )
+PALETTE_INIT_MEMBER(thepit_state,suprmous)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 32; i++)
@@ -78,13 +78,13 @@ PALETTE_INIT( suprmous )
UINT8 g = BITSWAP8(color_prom[i + 0x20], 0, 1, 2, 3, 4, 5, 6, 7);
UINT8 r = (b>>5&7)<<2 | (g>>6&3);
- palette_set_color_rgb(machine, i, pal5bit(r), pal5bit(g), pal4bit(b));
+ palette_set_color_rgb(machine(), i, pal5bit(r), pal5bit(g), pal4bit(b));
}
/* allocate primary colors for the background and foreground
this is wrong, but I don't know where to pick the colors from */
for (i = 0; i < 8; i++)
- palette_set_color_rgb(machine, i + 32, pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0));
+ palette_set_color_rgb(machine(), i + 32, pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0));
}
@@ -120,20 +120,19 @@ TILE_GET_INFO_MEMBER(thepit_state::get_tile_info)
*
*************************************/
-VIDEO_START( thepit )
+void thepit_state::video_start()
{
- thepit_state *state = machine.driver_data<thepit_state>();
- state->m_solid_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(thepit_state::solid_get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_solid_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(thepit_state::solid_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(thepit_state::get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_tilemap->set_transparent_pen(0);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(thepit_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_tilemap->set_transparent_pen(0);
- state->m_solid_tilemap->set_scroll_cols(32);
- state->m_tilemap->set_scroll_cols(32);
+ m_solid_tilemap->set_scroll_cols(32);
+ m_tilemap->set_scroll_cols(32);
- state->m_dummy_tile = auto_alloc_array_clear(machine, UINT8, 8*8);
+ m_dummy_tile = auto_alloc_array_clear(machine(), UINT8, 8*8);
- state->m_graphics_bank = 0; /* only used in intrepid */
+ m_graphics_bank = 0; /* only used in intrepid */
}
diff --git a/src/mame/video/thief.c b/src/mame/video/thief.c
index 3ddc18d3f47..93ebb208de2 100644
--- a/src/mame/video/thief.c
+++ b/src/mame/video/thief.c
@@ -90,14 +90,13 @@ WRITE8_MEMBER(thief_state::thief_videoram_w){
/***************************************************************************/
-VIDEO_START( thief ){
- thief_state *state = machine.driver_data<thief_state>();
- memset( &state->m_coprocessor, 0x00, sizeof(state->m_coprocessor) );
+void thief_state::video_start(){
+ memset( &m_coprocessor, 0x00, sizeof(m_coprocessor) );
- state->m_videoram = auto_alloc_array_clear(machine, UINT8, 0x2000*4*2 );
+ m_videoram = auto_alloc_array_clear(machine(), UINT8, 0x2000*4*2 );
- state->m_coprocessor.image_ram = auto_alloc_array(machine, UINT8, 0x2000 );
- state->m_coprocessor.context_ram = auto_alloc_array(machine, UINT8, 0x400 );
+ m_coprocessor.image_ram = auto_alloc_array(machine(), UINT8, 0x2000 );
+ m_coprocessor.context_ram = auto_alloc_array(machine(), UINT8, 0x400 );
}
SCREEN_UPDATE_IND16( thief ){
diff --git a/src/mame/video/thoop2.c b/src/mame/video/thoop2.c
index 7f1d22538b1..2911c17590c 100644
--- a/src/mame/video/thoop2.c
+++ b/src/mame/video/thoop2.c
@@ -77,19 +77,18 @@ WRITE16_MEMBER(thoop2_state::thoop2_vram_w)
***************************************************************************/
-VIDEO_START( thoop2 )
+void thoop2_state::video_start()
{
- thoop2_state *state = machine.driver_data<thoop2_state>();
int i;
- state->m_pant[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(thoop2_state::get_tile_info_thoop2_screen0),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_pant[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(thoop2_state::get_tile_info_thoop2_screen1),state),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_pant[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(thoop2_state::get_tile_info_thoop2_screen0),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_pant[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(thoop2_state::get_tile_info_thoop2_screen1),this),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_pant[0]->set_transmask(0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
- state->m_pant[1]->set_transmask(0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
+ m_pant[0]->set_transmask(0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
+ m_pant[1]->set_transmask(0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
for (i = 0; i < 5; i++){
- state->m_sprite_table[i] = auto_alloc_array(machine, int, 512);
+ m_sprite_table[i] = auto_alloc_array(machine(), int, 512);
}
}
diff --git a/src/mame/video/thunderj.c b/src/mame/video/thunderj.c
index 6557e532f6b..c4639014327 100644
--- a/src/mame/video/thunderj.c
+++ b/src/mame/video/thunderj.c
@@ -56,7 +56,7 @@ TILE_GET_INFO_MEMBER(thunderj_state::get_playfield2_tile_info)
*
*************************************/
-VIDEO_START( thunderj )
+VIDEO_START_MEMBER(thunderj_state,thunderj)
{
static const atarimo_desc modesc =
{
@@ -94,21 +94,20 @@ VIDEO_START( thunderj )
0, /* resulting value to indicate "special" */
NULL /* callback routine for special entries */
};
- thunderj_state *state = machine.driver_data<thunderj_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(thunderj_state::get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(thunderj_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
/* initialize the second playfield */
- state->m_playfield2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(thunderj_state::get_playfield2_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
- state->m_playfield2_tilemap->set_transparent_pen(0);
+ m_playfield2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(thunderj_state::get_playfield2_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield2_tilemap->set_transparent_pen(0);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(thunderj_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(thunderj_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/thunderx.c b/src/mame/video/thunderx.c
index b15ff39c33c..8e85e55e616 100644
--- a/src/mame/video/thunderx.c
+++ b/src/mame/video/thunderx.c
@@ -48,15 +48,14 @@ void thunderx_sprite_callback( running_machine &machine, int *code,int *color, i
***************************************************************************/
-VIDEO_START( scontra )
+void thunderx_state::video_start()
{
- thunderx_state *state = machine.driver_data<thunderx_state>();
- state->m_layer_colorbase[0] = 48;
- state->m_layer_colorbase[1] = 0;
- state->m_layer_colorbase[2] = 16;
- state->m_sprite_colorbase = 32;
+ m_layer_colorbase[0] = 48;
+ m_layer_colorbase[1] = 0;
+ m_layer_colorbase[2] = 16;
+ m_sprite_colorbase = 32;
- palette_set_shadow_factor(machine,7.0/8.0);
+ palette_set_shadow_factor(machine(),7.0/8.0);
}
diff --git a/src/mame/video/tiamc1.c b/src/mame/video/tiamc1.c
index 5c66fab78b0..b97a3ba02a8 100644
--- a/src/mame/video/tiamc1.c
+++ b/src/mame/video/tiamc1.c
@@ -77,9 +77,8 @@ WRITE8_MEMBER(tiamc1_state::tiamc1_palette_w)
palette_set_color(machine(), offset, m_palette[data]);
}
-PALETTE_INIT( tiamc1 )
+void tiamc1_state::palette_init()
{
- tiamc1_state *state = machine.driver_data<tiamc1_state>();
// Voltage computed by Proteus
//static const float g_v[8]={1.05f,0.87f,0.81f,0.62f,0.44f,0.25f,0.19f,0.00f};
//static const float r_v[8]={1.37f,1.13f,1.00f,0.75f,0.63f,0.38f,0.25f,0.00f};
@@ -94,7 +93,7 @@ PALETTE_INIT( tiamc1 )
int r, g, b, ir, ig, ib;
float tcol;
- state->m_palette = auto_alloc_array(machine, rgb_t, 256);
+ m_palette = auto_alloc_array(machine(), rgb_t, 256);
for (col = 0; col < 256; col++) {
ir = (col >> 3) & 7;
@@ -107,7 +106,7 @@ PALETTE_INIT( tiamc1 )
tcol = 255.0f * b_v[ib] / b_v[0];
b = 255 - (((int)tcol) & 255);
- state->m_palette[col] = MAKE_RGB(r,g,b);
+ m_palette[col] = MAKE_RGB(r,g,b);
}
}
@@ -121,37 +120,36 @@ TILE_GET_INFO_MEMBER(tiamc1_state::get_bg2_tile_info)
SET_TILE_INFO_MEMBER(0, m_tileram[tile_index + 1024], 0, 0);
}
-VIDEO_START( tiamc1 )
+void tiamc1_state::video_start()
{
- tiamc1_state *state = machine.driver_data<tiamc1_state>();
UINT8 *video_ram;
- video_ram = auto_alloc_array_clear(machine, UINT8, 0x3040);
+ video_ram = auto_alloc_array_clear(machine(), UINT8, 0x3040);
- state->m_charram = video_ram + 0x0800; /* Ram is banked */
- state->m_tileram = video_ram + 0x0000;
+ m_charram = video_ram + 0x0800; /* Ram is banked */
+ m_tileram = video_ram + 0x0000;
- state->m_spriteram_y = video_ram + 0x3000;
- state->m_spriteram_x = video_ram + 0x3010;
- state->m_spriteram_n = video_ram + 0x3020;
- state->m_spriteram_a = video_ram + 0x3030;
+ m_spriteram_y = video_ram + 0x3000;
+ m_spriteram_x = video_ram + 0x3010;
+ m_spriteram_n = video_ram + 0x3020;
+ m_spriteram_a = video_ram + 0x3030;
- state_save_register_global_pointer(machine, video_ram, 0x3040);
+ state_save_register_global_pointer(machine(), video_ram, 0x3040);
- state->m_bg_tilemap1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tiamc1_state::get_bg1_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tiamc1_state::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_bg_tilemap2 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tiamc1_state::get_bg2_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tiamc1_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_bg_vshift = 0;
- state->m_bg_hshift = 0;
+ m_bg_vshift = 0;
+ m_bg_hshift = 0;
- state_save_register_global(machine, state->m_layers_ctrl);
- state_save_register_global(machine, state->m_bg_vshift);
- state_save_register_global(machine, state->m_bg_hshift);
+ state_save_register_global(machine(), m_layers_ctrl);
+ state_save_register_global(machine(), m_bg_vshift);
+ state_save_register_global(machine(), m_bg_hshift);
- machine.gfx[0]->set_source(state->m_charram);
+ machine().gfx[0]->set_source(m_charram);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/tigeroad.c b/src/mame/video/tigeroad.c
index 9cfd543a195..96af6a2dbe6 100644
--- a/src/mame/video/tigeroad.c
+++ b/src/mame/video/tigeroad.c
@@ -141,19 +141,18 @@ TILEMAP_MAPPER_MEMBER(tigeroad_state::tigeroad_tilemap_scan)
return 2 * (col % 8) + 16 * ((127 - row) % 8) + 128 * (col / 8) + 2048 * ((127 - row) / 8);
}
-VIDEO_START( tigeroad )
+void tigeroad_state::video_start()
{
- tigeroad_state *state = machine.driver_data<tigeroad_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tigeroad_state::get_bg_tile_info),state), tilemap_mapper_delegate(FUNC(tigeroad_state::tigeroad_tilemap_scan),state),
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tigeroad_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(tigeroad_state::tigeroad_tilemap_scan),this),
32, 32, 128, 128);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tigeroad_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tigeroad_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_bg_tilemap->set_transmask(0, 0xffff, 0);
- state->m_bg_tilemap->set_transmask(1, 0x1ff, 0xfe00);
+ m_bg_tilemap->set_transmask(0, 0xffff, 0);
+ m_bg_tilemap->set_transmask(1, 0x1ff, 0xfe00);
- state->m_fg_tilemap->set_transparent_pen(3);
+ m_fg_tilemap->set_transparent_pen(3);
}
SCREEN_UPDATE_IND16( tigeroad )
diff --git a/src/mame/video/timelimt.c b/src/mame/video/timelimt.c
index 69e4375f03b..b4c1b2cfbdc 100644
--- a/src/mame/video/timelimt.c
+++ b/src/mame/video/timelimt.c
@@ -20,11 +20,11 @@
***************************************************************************/
-PALETTE_INIT( timelimt ) {
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+void timelimt_state::palette_init(){
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -43,7 +43,7 @@ PALETTE_INIT( timelimt ) {
bit1 = (*color_prom >> 7) & 0x01;
b = 0x4f * bit0 + 0xa8 * bit1;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
}
@@ -65,16 +65,15 @@ TILE_GET_INFO_MEMBER(timelimt_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, videoram[tile_index], 0, 0);
}
-VIDEO_START( timelimt )
+void timelimt_state::video_start()
{
- timelimt_state *state = machine.driver_data<timelimt_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(timelimt_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(timelimt_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 64, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(timelimt_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(timelimt_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
/***************************************************************************/
diff --git a/src/mame/video/timeplt.c b/src/mame/video/timeplt.c
index 52b4ddaa5a7..9d541d3485d 100644
--- a/src/mame/video/timeplt.c
+++ b/src/mame/video/timeplt.c
@@ -37,9 +37,9 @@
***************************************************************************/
-PALETTE_INIT( timeplt )
+void timeplt_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
rgb_t palette[32];
int i;
@@ -75,11 +75,11 @@ PALETTE_INIT( timeplt )
/* sprites */
for (i = 0; i < 64 * 4; i++)
- palette_set_color(machine, 32 * 4 + i, palette[*color_prom++ & 0x0f]);
+ palette_set_color(machine(), 32 * 4 + i, palette[*color_prom++ & 0x0f]);
/* characters */
for (i = 0; i < 32 * 4; i++)
- palette_set_color(machine, i, palette[(*color_prom++ & 0x0f) + 0x10]);
+ palette_set_color(machine(), i, palette[(*color_prom++ & 0x0f) + 0x10]);
}
@@ -120,16 +120,14 @@ TILE_GET_INFO_MEMBER(timeplt_state::get_chkun_tile_info)
*
*************************************/
-VIDEO_START( timeplt )
+void timeplt_state::video_start()
{
- timeplt_state *state = machine.driver_data<timeplt_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(timeplt_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(timeplt_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
-VIDEO_START( chkun )
+VIDEO_START_MEMBER(timeplt_state,chkun)
{
- timeplt_state *state = machine.driver_data<timeplt_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(timeplt_state::get_chkun_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(timeplt_state::get_chkun_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/tmnt.c b/src/mame/video/tmnt.c
index 62792be26a7..9b88d50b19d 100644
--- a/src/mame/video/tmnt.c
+++ b/src/mame/video/tmnt.c
@@ -220,89 +220,82 @@ void prmrsocr_sprite_callback( running_machine &machine, int *code, int *color,
***************************************************************************/
-VIDEO_START( cuebrick )
+VIDEO_START_MEMBER(tmnt_state,cuebrick)
{
- tmnt_state *state = machine.driver_data<tmnt_state>();
- state->m_layer_colorbase[0] = 0;
- state->m_layer_colorbase[1] = 32;
- state->m_layer_colorbase[2] = 40;
- state->m_sprite_colorbase = 16;
+ m_layer_colorbase[0] = 0;
+ m_layer_colorbase[1] = 32;
+ m_layer_colorbase[2] = 40;
+ m_sprite_colorbase = 16;
}
-VIDEO_START( mia )
+VIDEO_START_MEMBER(tmnt_state,mia)
{
- tmnt_state *state = machine.driver_data<tmnt_state>();
- state->m_layer_colorbase[0] = 0;
- state->m_layer_colorbase[1] = 32;
- state->m_layer_colorbase[2] = 40;
- state->m_sprite_colorbase = 16;
+ m_layer_colorbase[0] = 0;
+ m_layer_colorbase[1] = 32;
+ m_layer_colorbase[2] = 40;
+ m_sprite_colorbase = 16;
- state->m_tmnt_priorityflag = 0;
- state->save_item(NAME(state->m_tmnt_priorityflag));
+ m_tmnt_priorityflag = 0;
+ save_item(NAME(m_tmnt_priorityflag));
}
-VIDEO_START( tmnt )
+VIDEO_START_MEMBER(tmnt_state,tmnt)
{
- tmnt_state *state = machine.driver_data<tmnt_state>();
- state->m_layer_colorbase[0] = 0;
- state->m_layer_colorbase[1] = 32;
- state->m_layer_colorbase[2] = 40;
- state->m_sprite_colorbase = 16;
+ m_layer_colorbase[0] = 0;
+ m_layer_colorbase[1] = 32;
+ m_layer_colorbase[2] = 40;
+ m_sprite_colorbase = 16;
- state->m_tmnt_priorityflag = 0;
- state->save_item(NAME(state->m_tmnt_priorityflag));
+ m_tmnt_priorityflag = 0;
+ save_item(NAME(m_tmnt_priorityflag));
- palette_set_shadow_factor(machine,0.75);
+ palette_set_shadow_factor(machine(),0.75);
}
-VIDEO_START( lgtnfght ) /* also tmnt2, ssriders */
+VIDEO_START_MEMBER(tmnt_state,lgtnfght)/* also tmnt2, ssriders */
{
- tmnt_state *state = machine.driver_data<tmnt_state>();
- k05324x_set_z_rejection(state->m_k053245, 0);
+ k05324x_set_z_rejection(m_k053245, 0);
- state->m_dim_c = state->m_dim_v = state->m_lastdim = state->m_lasten = 0;
+ m_dim_c = m_dim_v = m_lastdim = m_lasten = 0;
- state->save_item(NAME(state->m_dim_c));
- state->save_item(NAME(state->m_dim_v));
- state->save_item(NAME(state->m_lastdim));
- state->save_item(NAME(state->m_lasten));
+ save_item(NAME(m_dim_c));
+ save_item(NAME(m_dim_v));
+ save_item(NAME(m_lastdim));
+ save_item(NAME(m_lasten));
}
-VIDEO_START( glfgreat )
+VIDEO_START_MEMBER(tmnt_state,glfgreat)
{
- tmnt_state *state = machine.driver_data<tmnt_state>();
- state->m_roz_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tmnt_state::glfgreat_get_roz_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 512, 512);
- state->m_roz_tilemap->set_transparent_pen(0);
+ m_roz_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tmnt_state::glfgreat_get_roz_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 512, 512);
+ m_roz_tilemap->set_transparent_pen(0);
- state->m_glfgreat_roz_rom_bank = 0;
- state->m_glfgreat_roz_char_bank = 0;
- state->m_glfgreat_roz_rom_mode = 0;
- state->save_item(NAME(state->m_glfgreat_roz_rom_bank));
- state->save_item(NAME(state->m_glfgreat_roz_char_bank));
- state->save_item(NAME(state->m_glfgreat_roz_rom_mode));
+ m_glfgreat_roz_rom_bank = 0;
+ m_glfgreat_roz_char_bank = 0;
+ m_glfgreat_roz_rom_mode = 0;
+ save_item(NAME(m_glfgreat_roz_rom_bank));
+ save_item(NAME(m_glfgreat_roz_char_bank));
+ save_item(NAME(m_glfgreat_roz_rom_mode));
}
-VIDEO_START( prmrsocr )
+VIDEO_START_MEMBER(tmnt_state,prmrsocr)
{
- tmnt_state *state = machine.driver_data<tmnt_state>();
- state->m_roz_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tmnt_state::prmrsocr_get_roz_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 512, 256);
- state->m_roz_tilemap->set_transparent_pen(0);
+ m_roz_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tmnt_state::prmrsocr_get_roz_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 512, 256);
+ m_roz_tilemap->set_transparent_pen(0);
- state->m_prmrsocr_sprite_bank = 0;
- state->m_glfgreat_roz_char_bank = 0;
- state->save_item(NAME(state->m_prmrsocr_sprite_bank));
- state->save_item(NAME(state->m_glfgreat_roz_char_bank));
+ m_prmrsocr_sprite_bank = 0;
+ m_glfgreat_roz_char_bank = 0;
+ save_item(NAME(m_prmrsocr_sprite_bank));
+ save_item(NAME(m_glfgreat_roz_char_bank));
}
-VIDEO_START( blswhstl )
+VIDEO_START_MEMBER(tmnt_state,blswhstl)
{
- tmnt_state *state = machine.driver_data<tmnt_state>();
- state->m_blswhstl_rombank = -1;
- state->save_item(NAME(state->m_blswhstl_rombank));
+ m_blswhstl_rombank = -1;
+ save_item(NAME(m_blswhstl_rombank));
}
diff --git a/src/mame/video/tnzs.c b/src/mame/video/tnzs.c
index 32bf8654766..2b4d02436bb 100644
--- a/src/mame/video/tnzs.c
+++ b/src/mame/video/tnzs.c
@@ -30,15 +30,15 @@
***************************************************************************/
-PALETTE_INIT( arknoid2 )
+PALETTE_INIT_MEMBER(tnzs_state,arknoid2)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i, col;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
col = (color_prom[i] << 8) + color_prom[i + 512];
- palette_set_color_rgb(machine, i, pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0));
+ palette_set_color_rgb(machine(), i, pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0));
}
}
diff --git a/src/mame/video/toaplan1.c b/src/mame/video/toaplan1.c
index 059ef28fe56..3fc181d50a1 100644
--- a/src/mame/video/toaplan1.c
+++ b/src/mame/video/toaplan1.c
@@ -329,54 +329,52 @@ static void register_common(running_machine &machine)
}
-VIDEO_START( rallybik )
+VIDEO_START_MEMBER(toaplan1_state,rallybik)
{
- toaplan1_state *state = machine.driver_data<toaplan1_state>();
- toaplan1_create_tilemaps(machine);
- toaplan1_paletteram_alloc(machine);
- toaplan1_vram_alloc(machine);
+ toaplan1_create_tilemaps(machine());
+ toaplan1_paletteram_alloc(machine());
+ toaplan1_vram_alloc(machine());
- state->m_buffered_spriteram = auto_alloc_array_clear(machine, UINT16, state->m_spriteram.bytes()/2);
- state->save_pointer(NAME(state->m_buffered_spriteram), state->m_spriteram.bytes()/2);
+ m_buffered_spriteram = auto_alloc_array_clear(machine(), UINT16, m_spriteram.bytes()/2);
+ save_pointer(NAME(m_buffered_spriteram), m_spriteram.bytes()/2);
- state->m_scrollx_offs1 = 0x00d + 6;
- state->m_scrollx_offs2 = 0x00d + 4;
- state->m_scrollx_offs3 = 0x00d + 2;
- state->m_scrollx_offs4 = 0x00d + 0;
- state->m_scrolly_offs = 0x111;
+ m_scrollx_offs1 = 0x00d + 6;
+ m_scrollx_offs2 = 0x00d + 4;
+ m_scrollx_offs3 = 0x00d + 2;
+ m_scrollx_offs4 = 0x00d + 0;
+ m_scrolly_offs = 0x111;
- state->m_bcu_flipscreen = -1;
- state->m_fcu_flipscreen = 0;
- state->m_reset = 0;
+ m_bcu_flipscreen = -1;
+ m_fcu_flipscreen = 0;
+ m_reset = 0;
- register_common(machine);
+ register_common(machine());
- machine.save().register_postload(save_prepost_delegate(FUNC(rallybik_flipscreen), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(rallybik_flipscreen), &machine()));
}
-VIDEO_START( toaplan1 )
+VIDEO_START_MEMBER(toaplan1_state,toaplan1)
{
- toaplan1_state *state = machine.driver_data<toaplan1_state>();
- toaplan1_create_tilemaps(machine);
- toaplan1_paletteram_alloc(machine);
- toaplan1_vram_alloc(machine);
- toaplan1_spritevram_alloc(machine);
+ toaplan1_create_tilemaps(machine());
+ toaplan1_paletteram_alloc(machine());
+ toaplan1_vram_alloc(machine());
+ toaplan1_spritevram_alloc(machine());
- state->m_scrollx_offs1 = 0x1ef + 6;
- state->m_scrollx_offs2 = 0x1ef + 4;
- state->m_scrollx_offs3 = 0x1ef + 2;
- state->m_scrollx_offs4 = 0x1ef + 0;
- state->m_scrolly_offs = 0x101;
+ m_scrollx_offs1 = 0x1ef + 6;
+ m_scrollx_offs2 = 0x1ef + 4;
+ m_scrollx_offs3 = 0x1ef + 2;
+ m_scrollx_offs4 = 0x1ef + 0;
+ m_scrolly_offs = 0x101;
- state->m_bcu_flipscreen = -1;
- state->m_fcu_flipscreen = 0;
- state->m_reset = 1;
+ m_bcu_flipscreen = -1;
+ m_fcu_flipscreen = 0;
+ m_reset = 1;
- register_common(machine);
+ register_common(machine());
- machine.save().register_postload(save_prepost_delegate(FUNC(toaplan1_flipscreen), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(toaplan1_flipscreen), &machine()));
}
diff --git a/src/mame/video/toaplan2.c b/src/mame/video/toaplan2.c
index ed2828ddf99..36ebb963cb0 100644
--- a/src/mame/video/toaplan2.c
+++ b/src/mame/video/toaplan2.c
@@ -78,112 +78,106 @@ static void truxton2_postload(running_machine &machine)
machine.gfx[2]->mark_dirty(i);
}
-VIDEO_START( toaplan2 )
+VIDEO_START_MEMBER(toaplan2_state,toaplan2)
{
- toaplan2_state *state = machine.driver_data<toaplan2_state>();
/* cache the VDP device */
- state->m_vdp0 = machine.device<gp9001vdp_device>("gp9001vdp0");
- state->m_vdp1 = machine.device<gp9001vdp_device>("gp9001vdp1");
+ m_vdp0 = machine().device<gp9001vdp_device>("gp9001vdp0");
+ m_vdp1 = machine().device<gp9001vdp_device>("gp9001vdp1");
/* our current VDP implementation needs this bitmap to work with */
- machine.primary_screen->register_screen_bitmap(state->m_custom_priority_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_custom_priority_bitmap);
- if (state->m_vdp0 != NULL)
+ if (m_vdp0 != NULL)
{
- state->m_secondary_render_bitmap.reset();
- state->m_vdp0->custom_priority_bitmap = &state->m_custom_priority_bitmap;
+ m_secondary_render_bitmap.reset();
+ m_vdp0->custom_priority_bitmap = &m_custom_priority_bitmap;
}
- if (state->m_vdp1 != NULL)
+ if (m_vdp1 != NULL)
{
- machine.primary_screen->register_screen_bitmap(state->m_secondary_render_bitmap);
- state->m_vdp1->custom_priority_bitmap = &state->m_custom_priority_bitmap;
+ machine().primary_screen->register_screen_bitmap(m_secondary_render_bitmap);
+ m_vdp1->custom_priority_bitmap = &m_custom_priority_bitmap;
}
- register_state_save(machine);
+ register_state_save(machine());
}
-VIDEO_START( truxton2 )
+VIDEO_START_MEMBER(toaplan2_state,truxton2)
{
- toaplan2_state *state = machine.driver_data<toaplan2_state>();
- VIDEO_START_CALL( toaplan2 );
+ VIDEO_START_CALL_MEMBER( toaplan2 );
/* Create the Text tilemap for this game */
- machine.gfx[2]->set_source(reinterpret_cast<UINT8 *>(state->m_tx_gfxram16.target()));
- machine.save().register_postload(save_prepost_delegate(FUNC(truxton2_postload), &machine));
+ machine().gfx[2]->set_source(reinterpret_cast<UINT8 *>(m_tx_gfxram16.target()));
+ machine().save().register_postload(save_prepost_delegate(FUNC(truxton2_postload), &machine()));
- truxton2_create_tx_tilemap(machine);
- state->m_tx_tilemap->set_scrolldx(0x1d4 +1, 0x2a);
+ truxton2_create_tx_tilemap(machine());
+ m_tx_tilemap->set_scrolldx(0x1d4 +1, 0x2a);
}
-VIDEO_START( fixeightbl )
+VIDEO_START_MEMBER(toaplan2_state,fixeightbl)
{
- toaplan2_state *state = machine.driver_data<toaplan2_state>();
- VIDEO_START_CALL( toaplan2 );
+ VIDEO_START_CALL_MEMBER( toaplan2 );
/* Create the Text tilemap for this game */
- truxton2_create_tx_tilemap(machine);
+ truxton2_create_tx_tilemap(machine());
/* This bootleg has additional layer offsets on the VDP */
- state->m_vdp0->bg.extra_xoffset.normal = -0x1d6 -26;
- state->m_vdp0->bg.extra_yoffset.normal = -0x1ef -15;
+ m_vdp0->bg.extra_xoffset.normal = -0x1d6 -26;
+ m_vdp0->bg.extra_yoffset.normal = -0x1ef -15;
- state->m_vdp0->fg.extra_xoffset.normal = -0x1d8 -22;
- state->m_vdp0->fg.extra_yoffset.normal = -0x1ef -15;
+ m_vdp0->fg.extra_xoffset.normal = -0x1d8 -22;
+ m_vdp0->fg.extra_yoffset.normal = -0x1ef -15;
- state->m_vdp0->top.extra_xoffset.normal = -0x1da -18;
- state->m_vdp0->top.extra_yoffset.normal = -0x1ef -15;
+ m_vdp0->top.extra_xoffset.normal = -0x1da -18;
+ m_vdp0->top.extra_yoffset.normal = -0x1ef -15;
- state->m_vdp0->sp.extra_xoffset.normal = 8;//-0x1cc -64;
- state->m_vdp0->sp.extra_yoffset.normal = 8;//-0x1ef -128;
+ m_vdp0->sp.extra_xoffset.normal = 8;//-0x1cc -64;
+ m_vdp0->sp.extra_yoffset.normal = 8;//-0x1ef -128;
- state->m_vdp0->init_scroll_regs();
+ m_vdp0->init_scroll_regs();
- state->m_tx_tilemap->set_scrolldx(0, 0);
+ m_tx_tilemap->set_scrolldx(0, 0);
}
-VIDEO_START( bgaregga )
+VIDEO_START_MEMBER(toaplan2_state,bgaregga)
{
- toaplan2_state *state = machine.driver_data<toaplan2_state>();
- VIDEO_START_CALL( toaplan2 );
+ VIDEO_START_CALL_MEMBER( toaplan2 );
/* Create the Text tilemap for this game */
- truxton2_create_tx_tilemap(machine);
- state->m_tx_tilemap->set_scrolldx(0x1d4, 0x2a);
+ truxton2_create_tx_tilemap(machine());
+ m_tx_tilemap->set_scrolldx(0x1d4, 0x2a);
}
-VIDEO_START( bgareggabl )
+VIDEO_START_MEMBER(toaplan2_state,bgareggabl)
{
- toaplan2_state *state = machine.driver_data<toaplan2_state>();
- VIDEO_START_CALL( toaplan2 );
+ VIDEO_START_CALL_MEMBER( toaplan2 );
/* Create the Text tilemap for this game */
- truxton2_create_tx_tilemap(machine);
- state->m_tx_tilemap->set_scrolldx(0x04, 0x2a);
+ truxton2_create_tx_tilemap(machine());
+ m_tx_tilemap->set_scrolldx(0x04, 0x2a);
}
-VIDEO_START( batrider )
+VIDEO_START_MEMBER(toaplan2_state,batrider)
{
- toaplan2_state *state = machine.driver_data<toaplan2_state>();
- VIDEO_START_CALL( toaplan2 );
+ VIDEO_START_CALL_MEMBER( toaplan2 );
- state->m_vdp0->sp.use_sprite_buffer = 0; // disable buffering on this game
+ m_vdp0->sp.use_sprite_buffer = 0; // disable buffering on this game
/* Create the Text tilemap for this game */
- state->m_tx_gfxram16.allocate(RAIZING_TX_GFXRAM_SIZE/2);
- machine.gfx[2]->set_source(reinterpret_cast<UINT8 *>(state->m_tx_gfxram16.target()));
- machine.save().register_postload(save_prepost_delegate(FUNC(truxton2_postload), &machine));
+ m_tx_gfxram16.allocate(RAIZING_TX_GFXRAM_SIZE/2);
+ machine().gfx[2]->set_source(reinterpret_cast<UINT8 *>(m_tx_gfxram16.target()));
+ machine().save().register_postload(save_prepost_delegate(FUNC(truxton2_postload), &machine()));
- truxton2_create_tx_tilemap(machine);
- state->m_tx_tilemap->set_scrolldx(0x1d4, 0x2a);
+ truxton2_create_tx_tilemap(machine());
+ m_tx_tilemap->set_scrolldx(0x1d4, 0x2a);
/* Has special banking */
- state->m_vdp0->gp9001_gfxrom_is_banked = 1;
+ m_vdp0->gp9001_gfxrom_is_banked = 1;
}
WRITE16_MEMBER(toaplan2_state::toaplan2_txvideoram16_w)
diff --git a/src/mame/video/toki.c b/src/mame/video/toki.c
index fdf6edee0bd..cd18668f057 100644
--- a/src/mame/video/toki.c
+++ b/src/mame/video/toki.c
@@ -82,16 +82,15 @@ TILE_GET_INFO_MEMBER(toki_state::get_fore_tile_info)
*
*************************************/
-VIDEO_START( toki )
+void toki_state::video_start()
{
- toki_state *state = machine.driver_data<toki_state>();
- state->m_text_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(toki_state::get_text_tile_info),state),TILEMAP_SCAN_ROWS, 8,8,32,32);
- state->m_background_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(toki_state::get_back_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_foreground_layer = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(toki_state::get_fore_tile_info),state),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_text_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(toki_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,32,32);
+ m_background_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(toki_state::get_back_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
+ m_foreground_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(toki_state::get_fore_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
- state->m_text_layer->set_transparent_pen(15);
- state->m_background_layer->set_transparent_pen(15);
- state->m_foreground_layer->set_transparent_pen(15);
+ m_text_layer->set_transparent_pen(15);
+ m_background_layer->set_transparent_pen(15);
+ m_foreground_layer->set_transparent_pen(15);
}
/*************************************/
diff --git a/src/mame/video/toobin.c b/src/mame/video/toobin.c
index 58f5371c3a9..55eb06527cc 100644
--- a/src/mame/video/toobin.c
+++ b/src/mame/video/toobin.c
@@ -44,7 +44,7 @@ TILE_GET_INFO_MEMBER(toobin_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( toobin )
+VIDEO_START_MEMBER(toobin_state,toobin)
{
static const atarimo_desc modesc =
{
@@ -82,22 +82,21 @@ VIDEO_START( toobin )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- toobin_state *state = machine.driver_data<toobin_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(toobin_state::get_playfield_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 128,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(toobin_state::get_playfield_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 128,64);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(toobin_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,48);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(toobin_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,48);
+ m_alpha_tilemap->set_transparent_pen(0);
/* allocate a playfield bitmap for rendering */
- machine.primary_screen->register_screen_bitmap(state->m_pfbitmap);
+ machine().primary_screen->register_screen_bitmap(m_pfbitmap);
- state->save_item(NAME(state->m_brightness));
+ save_item(NAME(m_brightness));
}
diff --git a/src/mame/video/toypop.c b/src/mame/video/toypop.c
index 87eb475176f..01378d914f1 100644
--- a/src/mame/video/toypop.c
+++ b/src/mame/video/toypop.c
@@ -18,11 +18,11 @@
***************************************************************************/
-PALETTE_INIT( toypop )
+void toypop_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 256);
+ machine().colortable = colortable_alloc(machine(), 256);
for (int i = 0;i < 256;i++)
{
@@ -47,7 +47,7 @@ PALETTE_INIT( toypop )
bit3 = (color_prom[i+0x200] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r,g,b));
}
for (int i = 0;i < 256;i++)
@@ -55,17 +55,17 @@ PALETTE_INIT( toypop )
UINT8 entry;
// characters
- colortable_entry_set_value(machine.colortable, i + 0*256, (color_prom[i + 0x300] & 0x0f) | 0x70);
- colortable_entry_set_value(machine.colortable, i + 1*256, (color_prom[i + 0x300] & 0x0f) | 0xf0);
+ colortable_entry_set_value(machine().colortable, i + 0*256, (color_prom[i + 0x300] & 0x0f) | 0x70);
+ colortable_entry_set_value(machine().colortable, i + 1*256, (color_prom[i + 0x300] & 0x0f) | 0xf0);
// sprites
entry = color_prom[i + 0x500];
- colortable_entry_set_value(machine.colortable, i + 2*256, entry);
+ colortable_entry_set_value(machine().colortable, i + 2*256, entry);
}
for (int i = 0;i < 16;i++)
{
// background
- colortable_entry_set_value(machine.colortable, i + 3*256 + 0*16, 0x60 + i);
- colortable_entry_set_value(machine.colortable, i + 3*256 + 1*16, 0xe0 + i);
+ colortable_entry_set_value(machine().colortable, i + 3*256 + 0*16, 0x60 + i);
+ colortable_entry_set_value(machine().colortable, i + 3*256 + 1*16, 0xe0 + i);
}
}
@@ -110,12 +110,11 @@ TILE_GET_INFO_MEMBER(toypop_state::get_tile_info)
***************************************************************************/
-VIDEO_START( toypop )
+void toypop_state::video_start()
{
- toypop_state *state = machine.driver_data<toypop_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(toypop_state::get_tile_info),state), tilemap_mapper_delegate(FUNC(toypop_state::tilemap_scan),state),8,8,36,28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(toypop_state::get_tile_info),this), tilemap_mapper_delegate(FUNC(toypop_state::tilemap_scan),this),8,8,36,28);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/tp84.c b/src/mame/video/tp84.c
index 634c902fcdf..f468c6cbb46 100644
--- a/src/mame/video/tp84.c
+++ b/src/mame/video/tp84.c
@@ -41,9 +41,9 @@
220 ohm
100 ohm
*/
-PALETTE_INIT( tp84 )
+void tp84_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[4] = { 1000, 470, 220, 100 };
double weights[4];
int i;
@@ -55,7 +55,7 @@ PALETTE_INIT( tp84 )
0, 0, 0, 0, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x100);
+ machine().colortable = colortable_alloc(machine(), 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -84,7 +84,7 @@ PALETTE_INIT( tp84 )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(weights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -98,7 +98,7 @@ PALETTE_INIT( tp84 )
for (j = 0; j < 8; j++)
{
UINT8 ctabentry = ((~i & 0x100) >> 1) | (j << 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine.colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
+ colortable_entry_set_value(machine().colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
}
}
}
@@ -142,11 +142,10 @@ TILE_GET_INFO_MEMBER(tp84_state::get_fg_tile_info)
}
-VIDEO_START( tp84 )
+void tp84_state::video_start()
{
- tp84_state *state = machine.driver_data<tp84_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tp84_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tp84_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tp84_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tp84_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/trackfld.c b/src/mame/video/trackfld.c
index 1e2ffd822cd..afa5c61704c 100644
--- a/src/mame/video/trackfld.c
+++ b/src/mame/video/trackfld.c
@@ -29,9 +29,9 @@
***************************************************************************/
-PALETTE_INIT( trackfld )
+PALETTE_INIT_MEMBER(trackfld_state,trackfld)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -44,7 +44,7 @@ PALETTE_INIT( trackfld )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( trackfld )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -79,14 +79,14 @@ PALETTE_INIT( trackfld )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* characters */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -171,20 +171,18 @@ TILE_GET_INFO_MEMBER(trackfld_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(1, code, color, flags);
}
-VIDEO_START( trackfld )
+VIDEO_START_MEMBER(trackfld_state,trackfld)
{
- trackfld_state *state = machine.driver_data<trackfld_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(trackfld_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap->set_scroll_rows(32);
- state->m_sprites_gfx_banked = 0;
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(trackfld_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap->set_scroll_rows(32);
+ m_sprites_gfx_banked = 0;
}
-VIDEO_START( atlantol )
+VIDEO_START_MEMBER(trackfld_state,atlantol)
{
- trackfld_state *state = machine.driver_data<trackfld_state>();
- VIDEO_START_CALL( trackfld );
- state->m_sprites_gfx_banked = 1;
+ VIDEO_START_CALL_MEMBER( trackfld );
+ m_sprites_gfx_banked = 1;
}
diff --git a/src/mame/video/travrusa.c b/src/mame/video/travrusa.c
index d2d7503ffa3..93bd2ec64b1 100644
--- a/src/mame/video/travrusa.c
+++ b/src/mame/video/travrusa.c
@@ -37,13 +37,13 @@ J Clegg
***************************************************************************/
-PALETTE_INIT( travrusa )
+void travrusa_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x90);
+ machine().colortable = colortable_alloc(machine(), 0x90);
/* create a lookup table for the palette */
for (i = 0; i < 0x80; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( travrusa )
bit2 = (color_prom[i] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0x80; i < 0x90; i++)
@@ -95,7 +95,7 @@ PALETTE_INIT( travrusa )
bit2 = (color_prom[(i - 0x80) + 0x200] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -103,23 +103,23 @@ PALETTE_INIT( travrusa )
/* characters */
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprites */
for (i = 0x80; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i - 0x80] & 0x0f) | 0x80;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
-PALETTE_INIT( shtrider )
+PALETTE_INIT_MEMBER(travrusa_state,shtrider)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x90);
+ machine().colortable = colortable_alloc(machine(), 0x90);
/* create a lookup table for the palette */
for (i = 0; i < 0x80; i++)
@@ -145,7 +145,7 @@ PALETTE_INIT( shtrider )
bit2 = (color_prom[i + 0x100] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0x80; i < 0x90; i++)
@@ -171,7 +171,7 @@ PALETTE_INIT( shtrider )
bit2 = (color_prom[(i - 0x80) + 0x200] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -179,13 +179,13 @@ PALETTE_INIT( shtrider )
/* characters */
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* sprites */
for (i = 0x80; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i - 0x80] & 0x0f) | 0x80;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -219,18 +219,17 @@ TILE_GET_INFO_MEMBER(travrusa_state::get_tile_info)
***************************************************************************/
-VIDEO_START( travrusa )
+void travrusa_state::video_start()
{
- travrusa_state *state = machine.driver_data<travrusa_state>();
- state->save_item(NAME(state->m_scrollx));
+ save_item(NAME(m_scrollx));
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(travrusa_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(travrusa_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_bg_tilemap->set_transmask(0, 0xff, 0x00); /* split type 0 is totally transparent in front half */
- state->m_bg_tilemap->set_transmask(1, 0x3f, 0xc0); /* split type 1 has pens 6 and 7 opaque - tunnels */
+ m_bg_tilemap->set_transmask(0, 0xff, 0x00); /* split type 0 is totally transparent in front half */
+ m_bg_tilemap->set_transmask(1, 0x3f, 0xc0); /* split type 1 has pens 6 and 7 opaque - tunnels */
- state->m_bg_tilemap->set_scroll_rows(4);
+ m_bg_tilemap->set_scroll_rows(4);
}
diff --git a/src/mame/video/triplhnt.c b/src/mame/video/triplhnt.c
index f60ee819a46..5e92058af4b 100644
--- a/src/mame/video/triplhnt.c
+++ b/src/mame/video/triplhnt.c
@@ -16,12 +16,11 @@ TILE_GET_INFO_MEMBER(triplhnt_state::get_tile_info)
}
-VIDEO_START( triplhnt )
+void triplhnt_state::video_start()
{
- triplhnt_state *state = machine.driver_data<triplhnt_state>();
- machine.primary_screen->register_screen_bitmap(state->m_helper);
+ machine().primary_screen->register_screen_bitmap(m_helper);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(triplhnt_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(triplhnt_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
}
diff --git a/src/mame/video/truco.c b/src/mame/video/truco.c
index 83d64aac12c..486fca15156 100644
--- a/src/mame/video/truco.c
+++ b/src/mame/video/truco.c
@@ -9,11 +9,11 @@
#include "emu.h"
#include "includes/truco.h"
-PALETTE_INIT( truco )
+void truco_state::palette_init()
{
int i;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int r = ( i & 0x8 ) ? 0xff : 0x00;
int g = ( i & 0x4 ) ? 0xff : 0x00;
@@ -27,7 +27,7 @@ PALETTE_INIT( truco )
b >>= 1;
}
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
diff --git a/src/mame/video/trucocl.c b/src/mame/video/trucocl.c
index 579efd4af64..3853ba63294 100644
--- a/src/mame/video/trucocl.c
+++ b/src/mame/video/trucocl.c
@@ -36,13 +36,13 @@ Daughterboard: Custom made, plugged in the 2 roms and Z80 mainboard sockets.
#include "includes/trucocl.h"
-PALETTE_INIT( trucocl )
+void trucocl_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0;i < 32;i++)
- palette_set_color_rgb(machine,i,pal4bit(color_prom[i] >> 0),pal4bit(color_prom[i+32] >> 0),pal4bit(color_prom[i+32] >> 4));
+ palette_set_color_rgb(machine(),i,pal4bit(color_prom[i] >> 0),pal4bit(color_prom[i+32] >> 0),pal4bit(color_prom[i+32] >> 4));
}
WRITE8_MEMBER(trucocl_state::trucocl_videoram_w)
@@ -71,10 +71,9 @@ TILE_GET_INFO_MEMBER(trucocl_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(gfxsel,code,colour,0);
}
-VIDEO_START( trucocl )
+void trucocl_state::video_start()
{
- trucocl_state *state = machine.driver_data<trucocl_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(trucocl_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32 );
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(trucocl_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32 );
}
SCREEN_UPDATE_IND16( trucocl )
diff --git a/src/mame/video/tryout.c b/src/mame/video/tryout.c
index cade4f1f8a0..284f5296219 100644
--- a/src/mame/video/tryout.c
+++ b/src/mame/video/tryout.c
@@ -9,12 +9,12 @@
#include "includes/tryout.h"
-PALETTE_INIT( tryout )
+void tryout_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -34,7 +34,7 @@ PALETTE_INIT( tryout )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -163,18 +163,17 @@ TILEMAP_MAPPER_MEMBER(tryout_state::get_bg_memory_offset)
return a;
}
-VIDEO_START( tryout )
+void tryout_state::video_start()
{
- tryout_state *state = machine.driver_data<tryout_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tryout_state::get_fg_tile_info),state),tilemap_mapper_delegate(FUNC(tryout_state::get_fg_memory_offset),state),8,8,32,32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tryout_state::get_bg_tile_info),state),tilemap_mapper_delegate(FUNC(tryout_state::get_bg_memory_offset),state),16,16,64,16);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tryout_state::get_fg_tile_info),this),tilemap_mapper_delegate(FUNC(tryout_state::get_fg_memory_offset),this),8,8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tryout_state::get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(tryout_state::get_bg_memory_offset),this),16,16,64,16);
- state->m_vram=auto_alloc_array(machine, UINT8, 8 * 0x800);
- state->m_vram_gfx=auto_alloc_array(machine, UINT8, 0x6000);
+ m_vram=auto_alloc_array(machine(), UINT8, 8 * 0x800);
+ m_vram_gfx=auto_alloc_array(machine(), UINT8, 0x6000);
- machine.gfx[2]->set_source(state->m_vram_gfx);
+ machine().gfx[2]->set_source(m_vram_gfx);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
diff --git a/src/mame/video/tsamurai.c b/src/mame/video/tsamurai.c
index 3d00d6fb44a..8d4f061d952 100644
--- a/src/mame/video/tsamurai.c
+++ b/src/mame/video/tsamurai.c
@@ -44,14 +44,13 @@ TILE_GET_INFO_MEMBER(tsamurai_state::get_fg_tile_info)
***************************************************************************/
-VIDEO_START( tsamurai )
+VIDEO_START_MEMBER(tsamurai_state,tsamurai)
{
- tsamurai_state *state = machine.driver_data<tsamurai_state>();
- state->m_background = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tsamurai_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_foreground = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tsamurai_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_background = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tsamurai_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_foreground = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tsamurai_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_background->set_transparent_pen(0);
- state->m_foreground->set_transparent_pen(0);
+ m_background->set_transparent_pen(0);
+ m_foreground->set_transparent_pen(0);
}
@@ -244,10 +243,9 @@ TILE_GET_INFO_MEMBER(tsamurai_state::get_vsgongf_tile_info)
0);
}
-VIDEO_START( vsgongf )
+VIDEO_START_MEMBER(tsamurai_state,vsgongf)
{
- tsamurai_state *state = machine.driver_data<tsamurai_state>();
- state->m_foreground = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tsamurai_state::get_vsgongf_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_foreground = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tsamurai_state::get_vsgongf_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
}
SCREEN_UPDATE_IND16( vsgongf )
diff --git a/src/mame/video/tubep.c b/src/mame/video/tubep.c
index f6d20b34611..af48171bf94 100644
--- a/src/mame/video/tubep.c
+++ b/src/mame/video/tubep.c
@@ -131,10 +131,9 @@
***************************************************************************/
-PALETTE_INIT( tubep )
+PALETTE_INIT_MEMBER(tubep_state,tubep)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- tubep_state *state = machine.driver_data<tubep_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i,r,g,b;
/* background/sprites palette variables */
@@ -190,7 +189,7 @@ PALETTE_INIT( tubep )
bit1 = (*color_prom >> 7) & 0x01;
b = combine_2_weights(weights_txt_b, bit0, bit1);
- palette_set_color(machine,i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i, MAKE_RGB(r,g,b));
color_prom++;
}
@@ -198,7 +197,7 @@ PALETTE_INIT( tubep )
/* sprites use the second PROM to control 8 x LS368. We copy content of this PROM over here */
for (i = 0; i < 32; i++)
{
- state->m_prom2[i] = *color_prom;
+ m_prom2[i] = *color_prom;
color_prom++;
}
@@ -331,68 +330,66 @@ PALETTE_INIT( tubep )
/*logerror("Calculate [%x:%x] (active resistors:r=%i g=%i b=%i) = ", i, shade, active_r, active_g, active_b);*/
/*logerror("r:%3i g:%3i b:%3i\n",r,g,b );*/
- palette_set_color(machine,32+i*0x40+sh, MAKE_RGB(r,g,b));
+ palette_set_color(machine(),32+i*0x40+sh, MAKE_RGB(r,g,b));
}
}
}
-VIDEO_START( tubep )
+VIDEO_START_MEMBER(tubep_state,tubep)
{
- tubep_state *state = machine.driver_data<tubep_state>();
- state->m_spritemap = auto_alloc_array(machine, UINT8, 256*256*2);
+ m_spritemap = auto_alloc_array(machine(), UINT8, 256*256*2);
/* Set up save state */
- state_save_register_global(machine, state->m_romD_addr);
- state_save_register_global(machine, state->m_romEF_addr);
- state_save_register_global(machine, state->m_E16_add_b);
- state_save_register_global(machine, state->m_HINV);
- state_save_register_global(machine, state->m_VINV);
- state_save_register_global(machine, state->m_XSize);
- state_save_register_global(machine, state->m_YSize);
- state_save_register_global(machine, state->m_mark_1);
- state_save_register_global(machine, state->m_mark_2);
- state_save_register_global(machine, state->m_colorram_addr_hi);
- state_save_register_global(machine, state->m_ls273_g6);
- state_save_register_global(machine, state->m_ls273_j6);
- state_save_register_global(machine, state->m_romHI_addr_mid);
- state_save_register_global(machine, state->m_romHI_addr_msb);
- state_save_register_global(machine, state->m_DISP);
- state_save_register_global(machine, state->m_background_romsel);
- state_save_register_global(machine, state->m_color_A4);
- state_save_register_global(machine, state->m_ls175_b7);
- state_save_register_global(machine, state->m_ls175_e8);
- state_save_register_global(machine, state->m_ls377_data);
- state_save_register_global(machine, state->m_page);
+ state_save_register_global(machine(), m_romD_addr);
+ state_save_register_global(machine(), m_romEF_addr);
+ state_save_register_global(machine(), m_E16_add_b);
+ state_save_register_global(machine(), m_HINV);
+ state_save_register_global(machine(), m_VINV);
+ state_save_register_global(machine(), m_XSize);
+ state_save_register_global(machine(), m_YSize);
+ state_save_register_global(machine(), m_mark_1);
+ state_save_register_global(machine(), m_mark_2);
+ state_save_register_global(machine(), m_colorram_addr_hi);
+ state_save_register_global(machine(), m_ls273_g6);
+ state_save_register_global(machine(), m_ls273_j6);
+ state_save_register_global(machine(), m_romHI_addr_mid);
+ state_save_register_global(machine(), m_romHI_addr_msb);
+ state_save_register_global(machine(), m_DISP);
+ state_save_register_global(machine(), m_background_romsel);
+ state_save_register_global(machine(), m_color_A4);
+ state_save_register_global(machine(), m_ls175_b7);
+ state_save_register_global(machine(), m_ls175_e8);
+ state_save_register_global(machine(), m_ls377_data);
+ state_save_register_global(machine(), m_page);
}
-VIDEO_RESET( tubep )
+VIDEO_RESET_MEMBER(tubep_state,tubep)
{
- tubep_state *state = machine.driver_data<tubep_state>();
- memset(state->m_spritemap,0,256*256*2);
-
- state->m_romD_addr = 0;
- state->m_romEF_addr = 0;
- state->m_E16_add_b = 0;
- state->m_HINV = 0;
- state->m_VINV = 0;
- state->m_XSize = 0;
- state->m_YSize = 0;
- state->m_mark_1 = 0;
- state->m_mark_2 = 0;
- state->m_colorram_addr_hi = 0;
- state->m_ls273_g6 = 0;
- state->m_ls273_j6 = 0;
- state->m_romHI_addr_mid = 0;
- state->m_romHI_addr_msb = 0;
- state->m_DISP = 0;
- state->m_background_romsel = 0;
- state->m_color_A4 = 0;
- state->m_ls175_b7 = 0x0f | 0xf0;
- state->m_ls175_e8 = 0x0f;
- state->m_ls377_data = 0;
- state->m_page = 0;
+ memset(m_spritemap,0,256*256*2);
+
+ m_romD_addr = 0;
+ m_romEF_addr = 0;
+ m_E16_add_b = 0;
+ m_HINV = 0;
+ m_VINV = 0;
+ m_XSize = 0;
+ m_YSize = 0;
+ m_mark_1 = 0;
+ m_mark_2 = 0;
+ m_colorram_addr_hi = 0;
+ m_ls273_g6 = 0;
+ m_ls273_j6 = 0;
+ m_romHI_addr_mid = 0;
+ m_romHI_addr_msb = 0;
+ m_DISP = 0;
+ m_background_romsel = 0;
+ m_color_A4 = 0;
+ m_ls175_b7 = 0x0f | 0xf0;
+ m_ls175_e8 = 0x0f;
+ m_ls377_data = 0;
+ m_page = 0;
}
@@ -684,9 +681,9 @@ SCREEN_UPDATE_IND16( tubep )
***************************************************************************/
-PALETTE_INIT( rjammer )
+PALETTE_INIT_MEMBER(tubep_state,rjammer)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
static const int resistors_rg[3] = { 1000, 470, 220 };
@@ -699,7 +696,7 @@ PALETTE_INIT( rjammer )
2, resistors_b, weights_b, 470, 0,
0, 0, 0, 0, 0 );
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -718,7 +715,7 @@ PALETTE_INIT( rjammer )
bit1 = (*color_prom >> 7) & 0x01;
b = combine_2_weights(weights_b, bit0, bit1);
- palette_set_color(machine,i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i, MAKE_RGB(r,g,b));
color_prom++;
}
diff --git a/src/mame/video/tumbleb.c b/src/mame/video/tumbleb.c
index b1281822308..6b0c102a37c 100644
--- a/src/mame/video/tumbleb.c
+++ b/src/mame/video/tumbleb.c
@@ -233,75 +233,70 @@ static void tumbleb_tilemap_redraw(running_machine &machine)
state->m_pf2_alt_tilemap->mark_all_dirty();
}
-VIDEO_START( pangpang )
+VIDEO_START_MEMBER(tumbleb_state,pangpang)
{
- tumbleb_state *state = machine.driver_data<tumbleb_state>();
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::pangpang_get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_pf1_alt_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::pangpang_get_bg1_tile_info),state), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),state), 16, 16, 64, 32);
- state->m_pf2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::pangpang_get_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),state), 16, 16, 64, 32);
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::pangpang_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_pf1_alt_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::pangpang_get_bg1_tile_info),this), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),this), 16, 16, 64, 32);
+ m_pf2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::pangpang_get_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),this), 16, 16, 64, 32);
- state->m_pf1_tilemap->set_transparent_pen(0);
- state->m_pf1_alt_tilemap->set_transparent_pen(0);
+ m_pf1_tilemap->set_transparent_pen(0);
+ m_pf1_alt_tilemap->set_transparent_pen(0);
- machine.save().register_postload(save_prepost_delegate(FUNC(tumbleb_tilemap_redraw), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(tumbleb_tilemap_redraw), &machine()));
}
-VIDEO_START( tumblepb )
+VIDEO_START_MEMBER(tumbleb_state,tumblepb)
{
- tumbleb_state *state = machine.driver_data<tumbleb_state>();
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_pf1_alt_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg1_tile_info),state), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),state), 16, 16, 64, 32);
- state->m_pf2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),state), 16, 16, 64, 32);
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_pf1_alt_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg1_tile_info),this), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),this), 16, 16, 64, 32);
+ m_pf2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),this), 16, 16, 64, 32);
- state->m_pf1_tilemap->set_transparent_pen(0);
- state->m_pf1_alt_tilemap->set_transparent_pen(0);
+ m_pf1_tilemap->set_transparent_pen(0);
+ m_pf1_alt_tilemap->set_transparent_pen(0);
- machine.save().register_postload(save_prepost_delegate(FUNC(tumbleb_tilemap_redraw), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(tumbleb_tilemap_redraw), &machine()));
}
-VIDEO_START( sdfight )
+VIDEO_START_MEMBER(tumbleb_state,sdfight)
{
- tumbleb_state *state = machine.driver_data<tumbleb_state>();
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); // 64*64 to prevent bad tilemap wrapping? - check real behavior
- state->m_pf1_alt_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg1_tile_info),state), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),state), 16, 16, 64, 32);
- state->m_pf2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),state), 16, 16, 64, 32);
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); // 64*64 to prevent bad tilemap wrapping? - check real behavior
+ m_pf1_alt_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg1_tile_info),this), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),this), 16, 16, 64, 32);
+ m_pf2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),this), 16, 16, 64, 32);
- state->m_pf1_tilemap->set_transparent_pen(0);
- state->m_pf1_alt_tilemap->set_transparent_pen(0);
+ m_pf1_tilemap->set_transparent_pen(0);
+ m_pf1_alt_tilemap->set_transparent_pen(0);
- machine.save().register_postload(save_prepost_delegate(FUNC(tumbleb_tilemap_redraw), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(tumbleb_tilemap_redraw), &machine()));
}
-VIDEO_START( fncywld )
+VIDEO_START_MEMBER(tumbleb_state,fncywld)
{
- tumbleb_state *state = machine.driver_data<tumbleb_state>();
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fncywld_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_pf1_alt_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fncywld_bg1_tile_info),state), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),state), 16, 16, 64, 32);
- state->m_pf2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fncywld_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),state), 16, 16, 64, 32);
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fncywld_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_pf1_alt_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fncywld_bg1_tile_info),this), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),this), 16, 16, 64, 32);
+ m_pf2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fncywld_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),this), 16, 16, 64, 32);
- state->m_pf1_tilemap->set_transparent_pen(15);
- state->m_pf1_alt_tilemap->set_transparent_pen(15);
+ m_pf1_tilemap->set_transparent_pen(15);
+ m_pf1_alt_tilemap->set_transparent_pen(15);
- machine.save().register_postload(save_prepost_delegate(FUNC(tumbleb_tilemap_redraw), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(tumbleb_tilemap_redraw), &machine()));
}
-VIDEO_START( suprtrio )
+VIDEO_START_MEMBER(tumbleb_state,suprtrio)
{
- tumbleb_state *state = machine.driver_data<tumbleb_state>();
- state->m_pf1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_pf1_alt_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg1_tile_info),state), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),state), 16, 16, 64, 32);
- state->m_pf2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg2_tile_info),state), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),state), 16, 16, 64, 32);
+ m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_pf1_alt_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg1_tile_info),this), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),this), 16, 16, 64, 32);
+ m_pf2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tumbleb_state::get_bg2_tile_info),this), tilemap_mapper_delegate(FUNC(tumbleb_state::tumblep_scan),this), 16, 16, 64, 32);
- state->m_pf1_alt_tilemap->set_transparent_pen(0);
+ m_pf1_alt_tilemap->set_transparent_pen(0);
- machine.save().register_postload(save_prepost_delegate(FUNC(tumbleb_tilemap_redraw), &machine));
+ machine().save().register_postload(save_prepost_delegate(FUNC(tumbleb_tilemap_redraw), &machine()));
}
/******************************************************************************/
diff --git a/src/mame/video/tunhunt.c b/src/mame/video/tunhunt.c
index b88c24e30d4..ec4dbd19b08 100644
--- a/src/mame/video/tunhunt.c
+++ b/src/mame/video/tunhunt.c
@@ -65,24 +65,23 @@ TILE_GET_INFO_MEMBER(tunhunt_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( tunhunt )
+void tunhunt_state::video_start()
{
/*
Motion Object RAM contains 64 lines of run-length encoded data.
We keep track of dirty lines and cache the expanded bitmap.
With max RLE expansion, bitmap size is 256x64.
*/
- tunhunt_state *state = machine.driver_data<tunhunt_state>();
- state->m_tmpbitmap.allocate(256, 64, machine.primary_screen->format());
+ m_tmpbitmap.allocate(256, 64, machine().primary_screen->format());
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(tunhunt_state::get_fg_tile_info),state), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tunhunt_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scrollx(0, 64);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_scrollx(0, 64);
}
-PALETTE_INIT( tunhunt )
+void tunhunt_state::palette_init()
{
int i;
@@ -92,11 +91,11 @@ PALETTE_INIT( tunhunt )
*/
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x10);
+ machine().colortable = colortable_alloc(machine(), 0x10);
/* motion objects/box */
for (i = 0; i < 0x10; i++)
- colortable_entry_set_value(machine.colortable, i, i);
+ colortable_entry_set_value(machine().colortable, i, i);
/* AlphaNumerics (1bpp)
* 2 bits of hilite select from 4 different background colors
@@ -105,26 +104,26 @@ PALETTE_INIT( tunhunt )
*/
/* alpha hilite#0 */
- colortable_entry_set_value(machine.colortable, 0x10, 0x0); /* background color#0 (transparent) */
- colortable_entry_set_value(machine.colortable, 0x11, 0x4); /* foreground color */
+ colortable_entry_set_value(machine().colortable, 0x10, 0x0); /* background color#0 (transparent) */
+ colortable_entry_set_value(machine().colortable, 0x11, 0x4); /* foreground color */
/* alpha hilite#1 */
- colortable_entry_set_value(machine.colortable, 0x12, 0x5); /* background color#1 */
- colortable_entry_set_value(machine.colortable, 0x13, 0x4); /* foreground color */
+ colortable_entry_set_value(machine().colortable, 0x12, 0x5); /* background color#1 */
+ colortable_entry_set_value(machine().colortable, 0x13, 0x4); /* foreground color */
/* alpha hilite#2 */
- colortable_entry_set_value(machine.colortable, 0x14, 0x6); /* background color#2 */
- colortable_entry_set_value(machine.colortable, 0x15, 0x4); /* foreground color */
+ colortable_entry_set_value(machine().colortable, 0x14, 0x6); /* background color#2 */
+ colortable_entry_set_value(machine().colortable, 0x15, 0x4); /* foreground color */
/* alpha hilite#3 */
- colortable_entry_set_value(machine.colortable, 0x16, 0xf); /* background color#3 */
- colortable_entry_set_value(machine.colortable, 0x17, 0x4); /* foreground color */
+ colortable_entry_set_value(machine().colortable, 0x16, 0xf); /* background color#3 */
+ colortable_entry_set_value(machine().colortable, 0x17, 0x4); /* foreground color */
/* shell graphics; these are either 1bpp (2 banks) or 2bpp. It isn't clear which.
* In any event, the following pens are associated with the shell graphics:
*/
- colortable_entry_set_value(machine.colortable, 0x18, 0);
- colortable_entry_set_value(machine.colortable, 0x19, 4);//1;
+ colortable_entry_set_value(machine().colortable, 0x18, 0);
+ colortable_entry_set_value(machine().colortable, 0x19, 4);//1;
}
/*
diff --git a/src/mame/video/turbo.c b/src/mame/video/turbo.c
index 7e763bcb612..7267737ade4 100644
--- a/src/mame/video/turbo.c
+++ b/src/mame/video/turbo.c
@@ -39,7 +39,7 @@ static const UINT32 sprite_expand[16] =
*
*************************************/
-PALETTE_INIT( turbo )
+PALETTE_INIT_MEMBER(turbo_state,turbo)
{
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -73,12 +73,12 @@ PALETTE_INIT( turbo )
bit1 = (i >> 7) & 1;
b = combine_2_weights(bweights, bit0, bit1);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
-PALETTE_INIT( subroc3d )
+PALETTE_INIT_MEMBER(turbo_state,subroc3d)
{
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -112,12 +112,12 @@ PALETTE_INIT( subroc3d )
bit1 = (i >> 7) & 1;
b = combine_2_weights(bweights, bit0, bit1);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
-PALETTE_INIT( buckrog )
+PALETTE_INIT_MEMBER(turbo_state,buckrog)
{
static const int resistances[4] = { 2200, 1000, 500, 250 };
double rweights[3], gweights[3], bweights[4];
@@ -153,7 +153,7 @@ PALETTE_INIT( buckrog )
bit3 = (i >> 7) & 1;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -172,25 +172,23 @@ TILE_GET_INFO_MEMBER(turbo_state::get_fg_tile_info)
}
-VIDEO_START( turbo )
+VIDEO_START_MEMBER(turbo_state,turbo)
{
- turbo_state *state = machine.driver_data<turbo_state>();
/* initialize the foreground tilemap */
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(turbo_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(turbo_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
}
-VIDEO_START( buckrog )
+VIDEO_START_MEMBER(turbo_state,buckrog)
{
- turbo_state *state = machine.driver_data<turbo_state>();
/* initialize the foreground tilemap */
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(turbo_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(turbo_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
/* allocate the bitmap RAM */
- state->m_buckrog_bitmap_ram = auto_alloc_array(machine, UINT8, 0xe000);
- state->save_pointer(NAME(state->m_buckrog_bitmap_ram), 0xe000);
+ m_buckrog_bitmap_ram = auto_alloc_array(machine(), UINT8, 0xe000);
+ save_pointer(NAME(m_buckrog_bitmap_ram), 0xe000);
}
diff --git a/src/mame/video/twin16.c b/src/mame/video/twin16.c
index 9f8480a7aa4..7969d3b4a58 100644
--- a/src/mame/video/twin16.c
+++ b/src/mame/video/twin16.c
@@ -491,28 +491,27 @@ TILE_GET_INFO_MEMBER(twin16_state::get_text_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( twin16 )
+VIDEO_START_MEMBER(twin16_state,twin16)
{
- twin16_state *state = machine.driver_data<twin16_state>();
- state->m_text_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(twin16_state::get_text_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_text_tilemap->set_transparent_pen(0);
+ m_text_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(twin16_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_text_tilemap->set_transparent_pen(0);
- palette_set_shadow_factor(machine,0.4); // screenshots estimate
+ palette_set_shadow_factor(machine(),0.4); // screenshots estimate
- memset(state->m_sprite_buffer,0xff,0x800*sizeof(UINT16));
- state->m_sprite_busy = 0;
- state->m_sprite_timer = machine.scheduler().timer_alloc(FUNC(twin16_sprite_tick));
- state->m_sprite_timer->adjust(attotime::never);
+ memset(m_sprite_buffer,0xff,0x800*sizeof(UINT16));
+ m_sprite_busy = 0;
+ m_sprite_timer = machine().scheduler().timer_alloc(FUNC(twin16_sprite_tick));
+ m_sprite_timer->adjust(attotime::never);
/* register for savestates */
- state_save_register_global_array(machine, state->m_sprite_buffer);
- state_save_register_global_array(machine, state->m_scrollx);
- state_save_register_global_array(machine, state->m_scrolly);
-
- state_save_register_global(machine, state->m_need_process_spriteram);
- state_save_register_global(machine, state->m_gfx_bank);
- state_save_register_global(machine, state->m_video_register);
- state_save_register_global(machine, state->m_sprite_busy);
+ state_save_register_global_array(machine(), m_sprite_buffer);
+ state_save_register_global_array(machine(), m_scrollx);
+ state_save_register_global_array(machine(), m_scrolly);
+
+ state_save_register_global(machine(), m_need_process_spriteram);
+ state_save_register_global(machine(), m_gfx_bank);
+ state_save_register_global(machine(), m_video_register);
+ state_save_register_global(machine(), m_sprite_busy);
}
SCREEN_UPDATE_IND16( twin16 )
diff --git a/src/mame/video/twincobr.c b/src/mame/video/twincobr.c
index 361843e9a28..8d0f66396be 100644
--- a/src/mame/video/twincobr.c
+++ b/src/mame/video/twincobr.c
@@ -98,44 +98,43 @@ static void twincobr_create_tilemaps(running_machine &machine)
state->m_tx_tilemap->set_transparent_pen(0);
}
-VIDEO_START( toaplan0 )
+VIDEO_START_MEMBER(twincobr_state,toaplan0)
{
- twincobr_state *state = machine.driver_data<twincobr_state>();
/* the video RAM is accessed via ports, it's not memory mapped */
- state->m_txvideoram_size = 0x0800;
- state->m_bgvideoram_size = 0x2000; /* banked two times 0x1000 */
- state->m_fgvideoram_size = 0x1000;
-
- twincobr_create_tilemaps(machine);
-
- state->m_txvideoram16 = auto_alloc_array_clear(machine, UINT16, state->m_txvideoram_size);
- state->m_fgvideoram16 = auto_alloc_array_clear(machine, UINT16, state->m_fgvideoram_size);
- state->m_bgvideoram16 = auto_alloc_array_clear(machine, UINT16, state->m_bgvideoram_size);
-
- state->m_display_on = 0;
- twincobr_display(machine, state->m_display_on);
-
- state_save_register_global_pointer(machine, state->m_txvideoram16, state->m_txvideoram_size);
- state_save_register_global_pointer(machine, state->m_fgvideoram16, state->m_fgvideoram_size);
- state_save_register_global_pointer(machine, state->m_bgvideoram16, state->m_bgvideoram_size);
- state_save_register_global(machine, state->m_txoffs);
- state_save_register_global(machine, state->m_fgoffs);
- state_save_register_global(machine, state->m_bgoffs);
- state_save_register_global(machine, state->m_scroll_x);
- state_save_register_global(machine, state->m_scroll_y);
- state_save_register_global(machine, state->m_txscrollx);
- state_save_register_global(machine, state->m_fgscrollx);
- state_save_register_global(machine, state->m_bgscrollx);
- state_save_register_global(machine, state->m_txscrolly);
- state_save_register_global(machine, state->m_fgscrolly);
- state_save_register_global(machine, state->m_bgscrolly);
- state_save_register_global(machine, state->m_display_on);
- state_save_register_global(machine, state->m_fg_rom_bank);
- state_save_register_global(machine, state->m_bg_ram_bank);
- state_save_register_global(machine, state->m_flip_screen);
- state_save_register_global(machine, state->m_wardner_sprite_hack);
- machine.save().register_postload(save_prepost_delegate(FUNC(twincobr_restore_screen), &machine));
+ m_txvideoram_size = 0x0800;
+ m_bgvideoram_size = 0x2000; /* banked two times 0x1000 */
+ m_fgvideoram_size = 0x1000;
+
+ twincobr_create_tilemaps(machine());
+
+ m_txvideoram16 = auto_alloc_array_clear(machine(), UINT16, m_txvideoram_size);
+ m_fgvideoram16 = auto_alloc_array_clear(machine(), UINT16, m_fgvideoram_size);
+ m_bgvideoram16 = auto_alloc_array_clear(machine(), UINT16, m_bgvideoram_size);
+
+ m_display_on = 0;
+ twincobr_display(machine(), m_display_on);
+
+ state_save_register_global_pointer(machine(), m_txvideoram16, m_txvideoram_size);
+ state_save_register_global_pointer(machine(), m_fgvideoram16, m_fgvideoram_size);
+ state_save_register_global_pointer(machine(), m_bgvideoram16, m_bgvideoram_size);
+ state_save_register_global(machine(), m_txoffs);
+ state_save_register_global(machine(), m_fgoffs);
+ state_save_register_global(machine(), m_bgoffs);
+ state_save_register_global(machine(), m_scroll_x);
+ state_save_register_global(machine(), m_scroll_y);
+ state_save_register_global(machine(), m_txscrollx);
+ state_save_register_global(machine(), m_fgscrollx);
+ state_save_register_global(machine(), m_bgscrollx);
+ state_save_register_global(machine(), m_txscrolly);
+ state_save_register_global(machine(), m_fgscrolly);
+ state_save_register_global(machine(), m_bgscrolly);
+ state_save_register_global(machine(), m_display_on);
+ state_save_register_global(machine(), m_fg_rom_bank);
+ state_save_register_global(machine(), m_bg_ram_bank);
+ state_save_register_global(machine(), m_flip_screen);
+ state_save_register_global(machine(), m_wardner_sprite_hack);
+ machine().save().register_postload(save_prepost_delegate(FUNC(twincobr_restore_screen), &machine()));
}
static void twincobr_restore_screen(running_machine &machine)
diff --git a/src/mame/video/tx1.c b/src/mame/video/tx1.c
index 15e5845c6d5..a41a14404a8 100644
--- a/src/mame/video/tx1.c
+++ b/src/mame/video/tx1.c
@@ -110,9 +110,9 @@ enum
***************************************************************************/
-PALETTE_INIT( tx1 )
+PALETTE_INIT_MEMBER(tx1_state,tx1)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
static const res_net_info tx1_net_info =
@@ -133,7 +133,7 @@ PALETTE_INIT( tx1 )
g = compute_res_net(color_prom[i + 0x400] & 0xf, 1, &tx1_net_info);
b = compute_res_net(color_prom[i + 0x500] & 0xf, 2, &tx1_net_info);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -1102,22 +1102,21 @@ static void tx1_draw_objects(running_machine &machine, UINT8 *bitmap)
*
*************************************/
-VIDEO_START( tx1 )
+VIDEO_START_MEMBER(tx1_state,tx1)
{
- tx1_state *state = machine.driver_data<tx1_state>();
/* Allocate a large bitmap that covers the three screens */
- state->m_bitmap = auto_bitmap_ind16_alloc(machine, 768, 256);
+ m_bitmap = auto_bitmap_ind16_alloc(machine(), 768, 256);
/* Allocate some bitmaps */
- state->m_chr_bmp = auto_alloc_array(machine, UINT8, 256 * 3 * 240);
- state->m_obj_bmp = auto_alloc_array(machine, UINT8, 256 * 3 * 240);
- state->m_rod_bmp = auto_alloc_array(machine, UINT8, 256 * 3 * 240);
+ m_chr_bmp = auto_alloc_array(machine(), UINT8, 256 * 3 * 240);
+ m_obj_bmp = auto_alloc_array(machine(), UINT8, 256 * 3 * 240);
+ m_rod_bmp = auto_alloc_array(machine(), UINT8, 256 * 3 * 240);
/* Set a timer to run the interrupts */
- state->m_interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
+ m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(interrupt_callback));
/* /CUDISP CRTC interrupt */
- state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
+ m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
}
SCREEN_VBLANK( tx1 )
@@ -1247,9 +1246,9 @@ SCREEN_UPDATE_IND16( tx1_right )
***************************************************************************/
-PALETTE_INIT( buggyboy )
+PALETTE_INIT_MEMBER(tx1_state,buggyboy)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < 0x100; i++)
@@ -1278,7 +1277,7 @@ PALETTE_INIT( buggyboy )
bit4 = BIT(color_prom[i + 0x300], 0);
b = 0x06 * bit4 + 0x0d * bit0 + 0x1e * bit1 + 0x41 * bit2 + 0x8a * bit3;
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
}
@@ -2996,34 +2995,32 @@ static void bb_combine_layers(running_machine &machine, bitmap_ind16 &bitmap, in
}
}
-VIDEO_START( buggyboy )
+VIDEO_START_MEMBER(tx1_state,buggyboy)
{
- tx1_state *state = machine.driver_data<tx1_state>();
/* Allocate some bitmaps */
- state->m_chr_bmp = auto_alloc_array(machine, UINT8, 3 * 256 * 240);
- state->m_obj_bmp = auto_alloc_array(machine, UINT8, 3 * 256 * 240);
- state->m_rod_bmp = auto_alloc_array(machine, UINT8, 3 * 256 * 240);
+ m_chr_bmp = auto_alloc_array(machine(), UINT8, 3 * 256 * 240);
+ m_obj_bmp = auto_alloc_array(machine(), UINT8, 3 * 256 * 240);
+ m_rod_bmp = auto_alloc_array(machine(), UINT8, 3 * 256 * 240);
/* Set a timer to run the interrupts */
- state->m_interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
+ m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(interrupt_callback));
/* /CUDISP CRTC interrupt */
- state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
+ m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
}
-VIDEO_START( buggybjr )
+VIDEO_START_MEMBER(tx1_state,buggybjr)
{
- tx1_state *state = machine.driver_data<tx1_state>();
/* Allocate some bitmaps */
- state->m_chr_bmp = auto_alloc_array(machine, UINT8, 256 * 240);
- state->m_obj_bmp = auto_alloc_array(machine, UINT8, 256 * 240);
- state->m_rod_bmp = auto_alloc_array(machine, UINT8, 256 * 240);
+ m_chr_bmp = auto_alloc_array(machine(), UINT8, 256 * 240);
+ m_obj_bmp = auto_alloc_array(machine(), UINT8, 256 * 240);
+ m_rod_bmp = auto_alloc_array(machine(), UINT8, 256 * 240);
/* Set a timer to run the interrupts */
- state->m_interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
+ m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(interrupt_callback));
/* /CUDISP CRTC interrupt */
- state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
+ m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
}
SCREEN_VBLANK( buggyboy )
diff --git a/src/mame/video/ultraman.c b/src/mame/video/ultraman.c
index 986cda5c945..e74e6efd357 100644
--- a/src/mame/video/ultraman.c
+++ b/src/mame/video/ultraman.c
@@ -53,13 +53,12 @@ void ultraman_zoom_callback_2(running_machine &machine, int *code, int *color, i
***************************************************************************/
-VIDEO_START( ultraman )
+void ultraman_state::video_start()
{
- ultraman_state *state = machine.driver_data<ultraman_state>();
- state->m_sprite_colorbase = 192;
- state->m_zoom_colorbase[0] = 0;
- state->m_zoom_colorbase[1] = 64;
- state->m_zoom_colorbase[2] = 128;
+ m_sprite_colorbase = 192;
+ m_zoom_colorbase[0] = 0;
+ m_zoom_colorbase[1] = 64;
+ m_zoom_colorbase[2] = 128;
}
diff --git a/src/mame/video/ultratnk.c b/src/mame/video/ultratnk.c
index c3c71c63723..bd520a0e5cb 100644
--- a/src/mame/video/ultratnk.c
+++ b/src/mame/video/ultratnk.c
@@ -9,28 +9,28 @@ Atari Ultra Tank video emulation
#include "audio/sprint4.h"
-PALETTE_INIT( ultratnk )
+void ultratnk_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 4);
-
- colortable_palette_set_color(machine.colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
- colortable_palette_set_color(machine.colortable, 1, MAKE_RGB(0xa4, 0xa4, 0xa4));
- colortable_palette_set_color(machine.colortable, 2, MAKE_RGB(0x5b, 0x5b, 0x5b));
- colortable_palette_set_color(machine.colortable, 3, MAKE_RGB(0xff, 0xff, 0xff));
-
- colortable_entry_set_value(machine.colortable, 0, color_prom[0x00] & 3);
- colortable_entry_set_value(machine.colortable, 2, color_prom[0x00] & 3);
- colortable_entry_set_value(machine.colortable, 4, color_prom[0x00] & 3);
- colortable_entry_set_value(machine.colortable, 6, color_prom[0x00] & 3);
- colortable_entry_set_value(machine.colortable, 8, color_prom[0x00] & 3);
-
- colortable_entry_set_value(machine.colortable, 1, color_prom[0x01] & 3);
- colortable_entry_set_value(machine.colortable, 3, color_prom[0x02] & 3);
- colortable_entry_set_value(machine.colortable, 5, color_prom[0x04] & 3);
- colortable_entry_set_value(machine.colortable, 7, color_prom[0x08] & 3);
- colortable_entry_set_value(machine.colortable, 9, color_prom[0x10] & 3);
+ machine().colortable = colortable_alloc(machine(), 4);
+
+ colortable_palette_set_color(machine().colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
+ colortable_palette_set_color(machine().colortable, 1, MAKE_RGB(0xa4, 0xa4, 0xa4));
+ colortable_palette_set_color(machine().colortable, 2, MAKE_RGB(0x5b, 0x5b, 0x5b));
+ colortable_palette_set_color(machine().colortable, 3, MAKE_RGB(0xff, 0xff, 0xff));
+
+ colortable_entry_set_value(machine().colortable, 0, color_prom[0x00] & 3);
+ colortable_entry_set_value(machine().colortable, 2, color_prom[0x00] & 3);
+ colortable_entry_set_value(machine().colortable, 4, color_prom[0x00] & 3);
+ colortable_entry_set_value(machine().colortable, 6, color_prom[0x00] & 3);
+ colortable_entry_set_value(machine().colortable, 8, color_prom[0x00] & 3);
+
+ colortable_entry_set_value(machine().colortable, 1, color_prom[0x01] & 3);
+ colortable_entry_set_value(machine().colortable, 3, color_prom[0x02] & 3);
+ colortable_entry_set_value(machine().colortable, 5, color_prom[0x04] & 3);
+ colortable_entry_set_value(machine().colortable, 7, color_prom[0x08] & 3);
+ colortable_entry_set_value(machine().colortable, 9, color_prom[0x10] & 3);
}
@@ -46,12 +46,11 @@ TILE_GET_INFO_MEMBER(ultratnk_state::ultratnk_tile_info)
}
-VIDEO_START( ultratnk )
+void ultratnk_state::video_start()
{
- ultratnk_state *state = machine.driver_data<ultratnk_state>();
- machine.primary_screen->register_screen_bitmap(state->m_helper);
+ machine().primary_screen->register_screen_bitmap(m_helper);
- state->m_playfield = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(ultratnk_state::ultratnk_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_playfield = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(ultratnk_state::ultratnk_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
diff --git a/src/mame/video/undrfire.c b/src/mame/video/undrfire.c
index f90db20e939..70c8eb840f0 100644
--- a/src/mame/video/undrfire.c
+++ b/src/mame/video/undrfire.c
@@ -6,15 +6,14 @@
/******************************************************************/
-VIDEO_START( undrfire )
+void undrfire_state::video_start()
{
- undrfire_state *state = machine.driver_data<undrfire_state>();
int i;
- state->m_spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000);
+ m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x4000);
for (i = 0; i < 16384; i++) /* Fix later - some weird colours in places */
- palette_set_color(machine, i, MAKE_RGB(0,0,0));
+ palette_set_color(machine(), i, MAKE_RGB(0,0,0));
}
/***************************************************************
diff --git a/src/mame/video/unico.c b/src/mame/video/unico.c
index 4aec338de36..233ada4ca2a 100644
--- a/src/mame/video/unico.c
+++ b/src/mame/video/unico.c
@@ -131,68 +131,66 @@ WRITE32_MEMBER(unico_state::unico_vram32_w)
***************************************************************************/
-VIDEO_START( unico )
+VIDEO_START_MEMBER(unico_state,unico)
{
- unico_state *state = machine.driver_data<unico_state>();
- state->m_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info),state),TILEMAP_SCAN_ROWS,
+ m_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info),this),TILEMAP_SCAN_ROWS,
16,16, 0x40, 0x40);
- state->m_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info),state),TILEMAP_SCAN_ROWS,
+ m_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info),this),TILEMAP_SCAN_ROWS,
16,16, 0x40, 0x40);
- state->m_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info),state),TILEMAP_SCAN_ROWS,
+ m_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info),this),TILEMAP_SCAN_ROWS,
16,16, 0x40, 0x40);
- state->m_tilemap[0]->set_user_data(&state->m_vram[0x8000/2]);
- state->m_tilemap[1]->set_user_data(&state->m_vram[0x0000/2]);
- state->m_tilemap[2]->set_user_data(&state->m_vram[0x4000/2]);
+ m_tilemap[0]->set_user_data(&m_vram[0x8000/2]);
+ m_tilemap[1]->set_user_data(&m_vram[0x0000/2]);
+ m_tilemap[2]->set_user_data(&m_vram[0x4000/2]);
- state->m_sprites_scrolldx = -0x3f;
- state->m_sprites_scrolldy = -0x0e;
+ m_sprites_scrolldx = -0x3f;
+ m_sprites_scrolldy = -0x0e;
- state->m_tilemap[0]->set_scrolldx(-0x32,0);
- state->m_tilemap[1]->set_scrolldx(-0x30,0);
- state->m_tilemap[2]->set_scrolldx(-0x2e,0);
+ m_tilemap[0]->set_scrolldx(-0x32,0);
+ m_tilemap[1]->set_scrolldx(-0x30,0);
+ m_tilemap[2]->set_scrolldx(-0x2e,0);
- state->m_tilemap[0]->set_scrolldy(-0x0f,0);
- state->m_tilemap[1]->set_scrolldy(-0x0f,0);
- state->m_tilemap[2]->set_scrolldy(-0x0f,0);
+ m_tilemap[0]->set_scrolldy(-0x0f,0);
+ m_tilemap[1]->set_scrolldy(-0x0f,0);
+ m_tilemap[2]->set_scrolldy(-0x0f,0);
- state->m_tilemap[0]->set_transparent_pen(0x00);
- state->m_tilemap[1]->set_transparent_pen(0x00);
- state->m_tilemap[2]->set_transparent_pen(0x00);
+ m_tilemap[0]->set_transparent_pen(0x00);
+ m_tilemap[1]->set_transparent_pen(0x00);
+ m_tilemap[2]->set_transparent_pen(0x00);
}
-VIDEO_START( zeropnt2 )
+VIDEO_START_MEMBER(unico_state,zeropnt2)
{
- unico_state *state = machine.driver_data<unico_state>();
- state->m_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info32),state),TILEMAP_SCAN_ROWS,
+ m_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info32),this),TILEMAP_SCAN_ROWS,
16,16, 0x40, 0x40);
- state->m_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info32),state),TILEMAP_SCAN_ROWS,
+ m_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info32),this),TILEMAP_SCAN_ROWS,
16,16, 0x40, 0x40);
- state->m_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info32),state),TILEMAP_SCAN_ROWS,
+ m_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(unico_state::get_tile_info32),this),TILEMAP_SCAN_ROWS,
16,16, 0x40, 0x40);
- state->m_tilemap[0]->set_user_data(&state->m_vram32[0x8000/4]);
- state->m_tilemap[1]->set_user_data(&state->m_vram32[0x0000/4]);
- state->m_tilemap[2]->set_user_data(&state->m_vram32[0x4000/4]);
+ m_tilemap[0]->set_user_data(&m_vram32[0x8000/4]);
+ m_tilemap[1]->set_user_data(&m_vram32[0x0000/4]);
+ m_tilemap[2]->set_user_data(&m_vram32[0x4000/4]);
- state->m_sprites_scrolldx = -0x3f;
- state->m_sprites_scrolldy = -0x0e;
+ m_sprites_scrolldx = -0x3f;
+ m_sprites_scrolldy = -0x0e;
- state->m_tilemap[0]->set_scrolldx(-0x32,0);
- state->m_tilemap[1]->set_scrolldx(-0x30,0);
- state->m_tilemap[2]->set_scrolldx(-0x2e,0);
+ m_tilemap[0]->set_scrolldx(-0x32,0);
+ m_tilemap[1]->set_scrolldx(-0x30,0);
+ m_tilemap[2]->set_scrolldx(-0x2e,0);
- state->m_tilemap[0]->set_scrolldy(-0x0f,0);
- state->m_tilemap[1]->set_scrolldy(-0x0f,0);
- state->m_tilemap[2]->set_scrolldy(-0x0f,0);
+ m_tilemap[0]->set_scrolldy(-0x0f,0);
+ m_tilemap[1]->set_scrolldy(-0x0f,0);
+ m_tilemap[2]->set_scrolldy(-0x0f,0);
- state->m_tilemap[0]->set_transparent_pen(0x00);
- state->m_tilemap[1]->set_transparent_pen(0x00);
- state->m_tilemap[2]->set_transparent_pen(0x00);
+ m_tilemap[0]->set_transparent_pen(0x00);
+ m_tilemap[1]->set_transparent_pen(0x00);
+ m_tilemap[2]->set_transparent_pen(0x00);
}
diff --git a/src/mame/video/usgames.c b/src/mame/video/usgames.c
index b38d98ae9ff..ed6a5463be4 100644
--- a/src/mame/video/usgames.c
+++ b/src/mame/video/usgames.c
@@ -2,7 +2,7 @@
#include "includes/usgames.h"
-PALETTE_INIT(usgames)
+void usgames_state::palette_init()
{
int j;
@@ -25,7 +25,7 @@ PALETTE_INIT(usgames)
g = 0x7f * g * (i + 1);
b = 0x7f * b * (i + 1);
- palette_set_color(machine,j,MAKE_RGB(r, g, b));
+ palette_set_color(machine(),j,MAKE_RGB(r, g, b));
}
}
@@ -41,11 +41,10 @@ TILE_GET_INFO_MEMBER(usgames_state::get_usgames_tile_info)
SET_TILE_INFO_MEMBER(0,tileno,colour,0);
}
-VIDEO_START(usgames)
+void usgames_state::video_start()
{
- usgames_state *state = machine.driver_data<usgames_state>();
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(usgames_state::get_usgames_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
- machine.gfx[0]->set_source(state->m_charram);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(usgames_state::get_usgames_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ machine().gfx[0]->set_source(m_charram);
}
diff --git a/src/mame/video/vastar.c b/src/mame/video/vastar.c
index 82f5a18c9f1..43c54ae82eb 100644
--- a/src/mame/video/vastar.c
+++ b/src/mame/video/vastar.c
@@ -65,20 +65,19 @@ TILE_GET_INFO_MEMBER(vastar_state::get_bg2_tile_info)
***************************************************************************/
-VIDEO_START( vastar )
+void vastar_state::video_start()
{
- vastar_state *state = machine.driver_data<vastar_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(vastar_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(vastar_state::get_bg1_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(vastar_state::get_bg2_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vastar_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vastar_state::get_bg1_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vastar_state::get_bg2_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_bg1_tilemap->set_transparent_pen(0);
- state->m_bg2_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_bg1_tilemap->set_transparent_pen(0);
+ m_bg2_tilemap->set_transparent_pen(0);
- state->m_bg1_tilemap->set_scroll_cols(32);
- state->m_bg2_tilemap->set_scroll_cols(32);
+ m_bg1_tilemap->set_scroll_cols(32);
+ m_bg2_tilemap->set_scroll_cols(32);
}
diff --git a/src/mame/video/vball.c b/src/mame/video/vball.c
index ea232120292..001a2f7fc68 100644
--- a/src/mame/video/vball.c
+++ b/src/mame/video/vball.c
@@ -37,15 +37,14 @@ TILE_GET_INFO_MEMBER(vball_state::get_bg_tile_info)
}
-VIDEO_START( vb )
+void vball_state::video_start()
{
- vball_state *state = machine.driver_data<vball_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(vball_state::get_bg_tile_info),state),tilemap_mapper_delegate(FUNC(vball_state::background_scan),state), 8, 8,64,64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vball_state::get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(vball_state::background_scan),this), 8, 8,64,64);
- state->m_bg_tilemap->set_scroll_rows(32);
- state->m_gfxset=0;
- state->m_vb_bgprombank=0xff;
- state->m_vb_spprombank=0xff;
+ m_bg_tilemap->set_scroll_rows(32);
+ m_gfxset=0;
+ m_vb_bgprombank=0xff;
+ m_vb_spprombank=0xff;
}
WRITE8_MEMBER(vball_state::vb_videoram_w)
diff --git a/src/mame/video/vectrex.c b/src/mame/video/vectrex.c
index 6400e5bf3c6..96b0a8c6d35 100644
--- a/src/mame/video/vectrex.c
+++ b/src/mame/video/vectrex.c
@@ -277,31 +277,30 @@ static TIMER_CALLBACK(update_signal)
*********************************************************************/
-VIDEO_START(vectrex)
+void vectrex_state::video_start()
{
- vectrex_state *state = machine.driver_data<vectrex_state>();
- screen_device *screen = machine.first_screen();
+ screen_device *screen = machine().first_screen();
const rectangle &visarea = screen->visible_area();
- state->m_x_center=(visarea.width() / 2) << 16;
- state->m_y_center=(visarea.height() / 2) << 16;
- state->m_x_max = visarea.max_x << 16;
- state->m_y_max = visarea.max_y << 16;
+ m_x_center=(visarea.width() / 2) << 16;
+ m_y_center=(visarea.height() / 2) << 16;
+ m_x_max = visarea.max_x << 16;
+ m_y_max = visarea.max_y << 16;
- state->m_imager_freq = 1;
+ m_imager_freq = 1;
- state->vector_add_point_function = vectrex_add_point;
- state->m_imager_timer = machine.scheduler().timer_alloc(FUNC(vectrex_imager_eye));
- state->m_imager_timer->adjust(
- attotime::from_hz(state->m_imager_freq),
+ vector_add_point_function = vectrex_add_point;
+ m_imager_timer = machine().scheduler().timer_alloc(FUNC(vectrex_imager_eye));
+ m_imager_timer->adjust(
+ attotime::from_hz(m_imager_freq),
2,
- attotime::from_hz(state->m_imager_freq));
+ attotime::from_hz(m_imager_freq));
- state->m_lp_t = machine.scheduler().timer_alloc(FUNC(lightpen_trigger));
+ m_lp_t = machine().scheduler().timer_alloc(FUNC(lightpen_trigger));
- state->m_refresh = machine.scheduler().timer_alloc(FUNC(vectrex_refresh));
+ m_refresh = machine().scheduler().timer_alloc(FUNC(vectrex_refresh));
- VIDEO_START_CALL(vector);
+ VIDEO_START_CALL_LEGACY(vector);
}
@@ -485,19 +484,18 @@ WRITE8_MEMBER(vectrex_state::raaspec_led_w)
}
-VIDEO_START(raaspec)
+VIDEO_START_MEMBER(vectrex_state,raaspec)
{
- vectrex_state *state = machine.driver_data<vectrex_state>();
- screen_device *screen = machine.first_screen();
+ screen_device *screen = machine().first_screen();
const rectangle &visarea = screen->visible_area();
- state->m_x_center=(visarea.width() / 2) << 16;
- state->m_y_center=(visarea.height() / 2) << 16;
- state->m_x_max = visarea.max_x << 16;
- state->m_y_max = visarea.max_y << 16;
+ m_x_center=(visarea.width() / 2) << 16;
+ m_y_center=(visarea.height() / 2) << 16;
+ m_x_max = visarea.max_x << 16;
+ m_y_max = visarea.max_y << 16;
- state->vector_add_point_function = vectrex_add_point;
- state->m_refresh = machine.scheduler().timer_alloc(FUNC(vectrex_refresh));
+ vector_add_point_function = vectrex_add_point;
+ m_refresh = machine().scheduler().timer_alloc(FUNC(vectrex_refresh));
- VIDEO_START_CALL(vector);
+ VIDEO_START_CALL_LEGACY(vector);
}
diff --git a/src/mame/video/victory.c b/src/mame/video/victory.c
index 218a1bf7202..ef9d0cefd52 100644
--- a/src/mame/video/victory.c
+++ b/src/mame/video/victory.c
@@ -38,29 +38,28 @@ static int command7(running_machine &machine);
*
*************************************/
-VIDEO_START( victory )
+void victory_state::video_start()
{
- victory_state *state = machine.driver_data<victory_state>();
/* allocate bitmapram */
- state->m_rram = auto_alloc_array(machine, UINT8, 0x4000);
- state->m_gram = auto_alloc_array(machine, UINT8, 0x4000);
- state->m_bram = auto_alloc_array(machine, UINT8, 0x4000);
+ m_rram = auto_alloc_array(machine(), UINT8, 0x4000);
+ m_gram = auto_alloc_array(machine(), UINT8, 0x4000);
+ m_bram = auto_alloc_array(machine(), UINT8, 0x4000);
/* allocate bitmaps */
- state->m_bgbitmap = auto_alloc_array(machine, UINT8, 256 * 256);
- state->m_fgbitmap = auto_alloc_array(machine, UINT8, 256 * 256);
+ m_bgbitmap = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_fgbitmap = auto_alloc_array(machine(), UINT8, 256 * 256);
/* reset globals */
- state->m_vblank_irq = 0;
- state->m_fgcoll = state->m_fgcollx = state->m_fgcolly = 0;
- state->m_bgcoll = state->m_bgcollx = state->m_bgcolly = 0;
- state->m_scrollx = state->m_scrolly = 0;
- state->m_video_control = 0;
- memset(&state->m_micro, 0, sizeof(state->m_micro));
- state->m_micro.timer = machine.scheduler().timer_alloc(FUNC_NULL);
+ m_vblank_irq = 0;
+ m_fgcoll = m_fgcollx = m_fgcolly = 0;
+ m_bgcoll = m_bgcollx = m_bgcolly = 0;
+ m_scrollx = m_scrolly = 0;
+ m_video_control = 0;
+ memset(&m_micro, 0, sizeof(m_micro));
+ m_micro.timer = machine().scheduler().timer_alloc(FUNC_NULL);
/* register for state saving */
- state_save_register_global_array(machine, state->m_paletteram);
+ state_save_register_global_array(machine(), m_paletteram);
}
diff --git a/src/mame/video/videopin.c b/src/mame/video/videopin.c
index 994cf906058..826d2da9bda 100644
--- a/src/mame/video/videopin.c
+++ b/src/mame/video/videopin.c
@@ -25,10 +25,9 @@ TILE_GET_INFO_MEMBER(videopin_state::get_tile_info)
}
-VIDEO_START( videopin )
+void videopin_state::video_start()
{
- videopin_state *state = machine.driver_data<videopin_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(videopin_state::get_tile_info),state), tilemap_mapper_delegate(FUNC(videopin_state::get_memory_offset),state), 8, 8, 48, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(videopin_state::get_tile_info),this), tilemap_mapper_delegate(FUNC(videopin_state::get_memory_offset),this), 8, 8, 48, 32);
}
diff --git a/src/mame/video/vigilant.c b/src/mame/video/vigilant.c
index 30fbdcd355c..96eccc339c5 100644
--- a/src/mame/video/vigilant.c
+++ b/src/mame/video/vigilant.c
@@ -17,23 +17,21 @@
static const rectangle bottomvisiblearea(16*8, 48*8-1, 6*8, 32*8-1);
-VIDEO_START( vigilant )
+void vigilant_state::video_start()
{
- vigilant_state *state = machine.driver_data<vigilant_state>();
- state->m_bg_bitmap = auto_bitmap_ind16_alloc(machine,512*4,256);
+ m_bg_bitmap = auto_bitmap_ind16_alloc(machine(),512*4,256);
}
-VIDEO_RESET( vigilant )
+void vigilant_state::video_reset()
{
- vigilant_state *state = machine.driver_data<vigilant_state>();
- state->m_horiz_scroll_low = 0;
- state->m_horiz_scroll_high = 0;
- state->m_rear_horiz_scroll_low = 0;
- state->m_rear_horiz_scroll_high = 0;
- state->m_rear_color = 0;
- state->m_rear_disable = 1;
- state->m_rear_refresh = 1;
+ m_horiz_scroll_low = 0;
+ m_horiz_scroll_high = 0;
+ m_rear_horiz_scroll_low = 0;
+ m_rear_horiz_scroll_high = 0;
+ m_rear_color = 0;
+ m_rear_disable = 1;
+ m_rear_refresh = 1;
}
diff --git a/src/mame/video/vindictr.c b/src/mame/video/vindictr.c
index 32ba3b9aa11..0d63f15f341 100644
--- a/src/mame/video/vindictr.c
+++ b/src/mame/video/vindictr.c
@@ -42,7 +42,7 @@ TILE_GET_INFO_MEMBER(vindictr_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( vindictr )
+VIDEO_START_MEMBER(vindictr_state,vindictr)
{
static const atarimo_desc modesc =
{
@@ -80,22 +80,21 @@ VIDEO_START( vindictr )
0, /* resulting value to indicate "special" */
NULL /* callback routine for special entries */
};
- vindictr_state *state = machine.driver_data<vindictr_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(vindictr_state::get_playfield_tile_info),state), TILEMAP_SCAN_COLS, 8,8, 64,64);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vindictr_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(vindictr_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vindictr_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
/* save states */
- state->save_item(NAME(state->m_playfield_tile_bank));
- state->save_item(NAME(state->m_playfield_xscroll));
- state->save_item(NAME(state->m_playfield_yscroll));
+ save_item(NAME(m_playfield_tile_bank));
+ save_item(NAME(m_playfield_xscroll));
+ save_item(NAME(m_playfield_yscroll));
}
diff --git a/src/mame/video/volfied.c b/src/mame/video/volfied.c
index 483452f28dc..8a7e5227605 100644
--- a/src/mame/video/volfied.c
+++ b/src/mame/video/volfied.c
@@ -6,17 +6,16 @@
INITIALISATION AND CLEAN-UP
******************************************************/
-VIDEO_START( volfied )
+void volfied_state::video_start()
{
- volfied_state *state = machine.driver_data<volfied_state>();
- state->m_video_ram = auto_alloc_array(machine, UINT16, 0x40000);
+ m_video_ram = auto_alloc_array(machine(), UINT16, 0x40000);
- state->m_video_ctrl = 0;
- state->m_video_mask = 0;
+ m_video_ctrl = 0;
+ m_video_mask = 0;
- state->save_pointer(NAME(state->m_video_ram), 0x40000);
- state->save_item(NAME(state->m_video_ctrl));
- state->save_item(NAME(state->m_video_mask));
+ save_pointer(NAME(m_video_ram), 0x40000);
+ save_item(NAME(m_video_ctrl));
+ save_item(NAME(m_video_mask));
}
diff --git a/src/mame/video/vsnes.c b/src/mame/video/vsnes.c
index 02fe6419851..f6a8c4d8b9d 100644
--- a/src/mame/video/vsnes.c
+++ b/src/mame/video/vsnes.c
@@ -3,18 +3,18 @@
#include "includes/vsnes.h"
-PALETTE_INIT( vsnes )
+PALETTE_INIT_MEMBER(vsnes_state,vsnes)
{
- ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu1");
- ppu->init_palette_rgb(machine, 0 );
+ ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu1");
+ ppu->init_palette_rgb(machine(), 0 );
}
-PALETTE_INIT( vsdual )
+PALETTE_INIT_MEMBER(vsnes_state,vsdual)
{
- ppu2c0x_device *ppu1 = machine.device<ppu2c0x_device>("ppu1");
- ppu2c0x_device *ppu2 = machine.device<ppu2c0x_device>("ppu2");
- ppu1->init_palette_rgb(machine, 0 );
- ppu2->init_palette_rgb(machine, 8*4*16 );
+ ppu2c0x_device *ppu1 = machine().device<ppu2c0x_device>("ppu1");
+ ppu2c0x_device *ppu2 = machine().device<ppu2c0x_device>("ppu2");
+ ppu1->init_palette_rgb(machine(), 0 );
+ ppu2->init_palette_rgb(machine(), 8*4*16 );
}
static void ppu_irq_1( device_t *device, int *ppu_regs )
@@ -49,11 +49,11 @@ const ppu2c0x_interface vsnes_ppu_interface_2 =
ppu_irq_2 /* irq */
};
-VIDEO_START( vsnes )
+VIDEO_START_MEMBER(vsnes_state,vsnes )
{
}
-VIDEO_START( vsdual )
+VIDEO_START_MEMBER(vsnes_state,vsdual )
{
}
diff --git a/src/mame/video/vulgus.c b/src/mame/video/vulgus.c
index 22cb8aaf33d..df8fd908f24 100644
--- a/src/mame/video/vulgus.c
+++ b/src/mame/video/vulgus.c
@@ -16,12 +16,12 @@
***************************************************************************/
-PALETTE_INIT( vulgus )
+void vulgus_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- machine.colortable = colortable_alloc(machine, 256);
+ machine().colortable = colortable_alloc(machine(), 256);
for (i = 0;i < 256;i++)
{
@@ -43,7 +43,7 @@ PALETTE_INIT( vulgus )
bit3 = (color_prom[2*256] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
@@ -52,20 +52,20 @@ PALETTE_INIT( vulgus )
/* characters use colors 32-47 (?) */
- for (i = 0;i < machine.gfx[0]->colors() * machine.gfx[0]->granularity();i++)
- colortable_entry_set_value(machine.colortable, machine.gfx[0]->colorbase() + i, 32 + *color_prom++);
+ for (i = 0;i < machine().gfx[0]->colors() * machine().gfx[0]->granularity();i++)
+ colortable_entry_set_value(machine().colortable, machine().gfx[0]->colorbase() + i, 32 + *color_prom++);
/* sprites use colors 16-31 */
- for (i = 0;i < machine.gfx[2]->colors() * machine.gfx[2]->granularity();i++)
- colortable_entry_set_value(machine.colortable, machine.gfx[2]->colorbase() + i, 16 + *color_prom++);
+ for (i = 0;i < machine().gfx[2]->colors() * machine().gfx[2]->granularity();i++)
+ colortable_entry_set_value(machine().colortable, machine().gfx[2]->colorbase() + i, 16 + *color_prom++);
/* background tiles use colors 0-15, 64-79, 128-143, 192-207 in four banks */
- for (i = 0;i < machine.gfx[1]->colors() * machine.gfx[1]->granularity() / 4;i++)
+ for (i = 0;i < machine().gfx[1]->colors() * machine().gfx[1]->granularity() / 4;i++)
{
- colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + 0*32*8 + i, *color_prom);
- colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + 1*32*8 + i, *color_prom + 64);
- colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + 2*32*8 + i, *color_prom + 128);
- colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + 3*32*8 + i, *color_prom + 192);
+ colortable_entry_set_value(machine().colortable, machine().gfx[1]->colorbase() + 0*32*8 + i, *color_prom);
+ colortable_entry_set_value(machine().colortable, machine().gfx[1]->colorbase() + 1*32*8 + i, *color_prom + 64);
+ colortable_entry_set_value(machine().colortable, machine().gfx[1]->colorbase() + 2*32*8 + i, *color_prom + 128);
+ colortable_entry_set_value(machine().colortable, machine().gfx[1]->colorbase() + 3*32*8 + i, *color_prom + 192);
color_prom++;
}
}
@@ -111,13 +111,12 @@ TILE_GET_INFO_MEMBER(vulgus_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( vulgus )
+void vulgus_state::video_start()
{
- vulgus_state *state = machine.driver_data<vulgus_state>();
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(vulgus_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,32,32);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(vulgus_state::get_bg_tile_info),state),TILEMAP_SCAN_COLS,16,16,32,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vulgus_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vulgus_state::get_bg_tile_info),this),TILEMAP_SCAN_COLS,16,16,32,32);
- colortable_configure_tilemap_groups(machine.colortable, state->m_fg_tilemap, machine.gfx[0], 47);
+ colortable_configure_tilemap_groups(machine().colortable, m_fg_tilemap, machine().gfx[0], 47);
}
diff --git a/src/mame/video/warpwarp.c b/src/mame/video/warpwarp.c
index e9854bea3e8..44c5eede81a 100644
--- a/src/mame/video/warpwarp.c
+++ b/src/mame/video/warpwarp.c
@@ -18,24 +18,24 @@ static const rgb_t geebee_palette[] =
MAKE_RGB(0x7f,0x7f,0x7f) /* grey */
};
-PALETTE_INIT( geebee )
-{
- palette_set_color(machine, 0, geebee_palette[0]);
- palette_set_color(machine, 1, geebee_palette[1]);
- palette_set_color(machine, 2, geebee_palette[1]);
- palette_set_color(machine, 3, geebee_palette[0]);
- palette_set_color(machine, 4, geebee_palette[0]);
- palette_set_color(machine, 5, geebee_palette[2]);
- palette_set_color(machine, 6, geebee_palette[2]);
- palette_set_color(machine, 7, geebee_palette[0]);
+PALETTE_INIT_MEMBER(warpwarp_state,geebee)
+{
+ palette_set_color(machine(), 0, geebee_palette[0]);
+ palette_set_color(machine(), 1, geebee_palette[1]);
+ palette_set_color(machine(), 2, geebee_palette[1]);
+ palette_set_color(machine(), 3, geebee_palette[0]);
+ palette_set_color(machine(), 4, geebee_palette[0]);
+ palette_set_color(machine(), 5, geebee_palette[2]);
+ palette_set_color(machine(), 6, geebee_palette[2]);
+ palette_set_color(machine(), 7, geebee_palette[0]);
}
-PALETTE_INIT( navarone )
+PALETTE_INIT_MEMBER(warpwarp_state,navarone)
{
- palette_set_color(machine, 0, geebee_palette[0]);
- palette_set_color(machine, 1, geebee_palette[1]);
- palette_set_color(machine, 2, geebee_palette[1]);
- palette_set_color(machine, 3, geebee_palette[0]);
+ palette_set_color(machine(), 0, geebee_palette[0]);
+ palette_set_color(machine(), 1, geebee_palette[1]);
+ palette_set_color(machine(), 2, geebee_palette[1]);
+ palette_set_color(machine(), 3, geebee_palette[0]);
}
@@ -59,7 +59,7 @@ PALETTE_INIT( navarone )
***************************************************************************/
-PALETTE_INIT( warpwarp )
+PALETTE_INIT_MEMBER(warpwarp_state,warpwarp)
{
int i;
static const int resistances_tiles_rg[] = { 1600, 820, 390 };
@@ -95,11 +95,11 @@ PALETTE_INIT( warpwarp )
bit1 = (i >> 7) & 0x01;
b = combine_2_weights(weights_tiles_b, bit0, bit1);
- palette_set_color(machine, (i * 2) + 0, RGB_BLACK);
- palette_set_color(machine, (i * 2) + 1, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), (i * 2) + 0, RGB_BLACK);
+ palette_set_color(machine(), (i * 2) + 1, MAKE_RGB(r, g, b));
}
- palette_set_color(machine, 0x200, MAKE_RGB(weight_ball[0], weight_ball[0], weight_ball[0]));
+ palette_set_color(machine(), 0x200, MAKE_RGB(weight_ball[0], weight_ball[0], weight_ball[0]));
}
@@ -164,22 +164,19 @@ TILE_GET_INFO_MEMBER(warpwarp_state::warpwarp_get_tile_info)
***************************************************************************/
-VIDEO_START( geebee )
+VIDEO_START_MEMBER(warpwarp_state,geebee)
{
- warpwarp_state *state = machine.driver_data<warpwarp_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(warpwarp_state::geebee_get_tile_info),state),tilemap_mapper_delegate(FUNC(warpwarp_state::tilemap_scan),state),8,8,34,28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(warpwarp_state::geebee_get_tile_info),this),tilemap_mapper_delegate(FUNC(warpwarp_state::tilemap_scan),this),8,8,34,28);
}
-VIDEO_START( navarone )
+VIDEO_START_MEMBER(warpwarp_state,navarone)
{
- warpwarp_state *state = machine.driver_data<warpwarp_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(warpwarp_state::navarone_get_tile_info),state),tilemap_mapper_delegate(FUNC(warpwarp_state::tilemap_scan),state),8,8,34,28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(warpwarp_state::navarone_get_tile_info),this),tilemap_mapper_delegate(FUNC(warpwarp_state::tilemap_scan),this),8,8,34,28);
}
-VIDEO_START( warpwarp )
+VIDEO_START_MEMBER(warpwarp_state,warpwarp)
{
- warpwarp_state *state = machine.driver_data<warpwarp_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(warpwarp_state::warpwarp_get_tile_info),state),tilemap_mapper_delegate(FUNC(warpwarp_state::tilemap_scan),state),8,8,34,28);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(warpwarp_state::warpwarp_get_tile_info),this),tilemap_mapper_delegate(FUNC(warpwarp_state::tilemap_scan),this),8,8,34,28);
}
diff --git a/src/mame/video/warriorb.c b/src/mame/video/warriorb.c
index 89288adb269..df06f51b9c6 100644
--- a/src/mame/video/warriorb.c
+++ b/src/mame/video/warriorb.c
@@ -4,12 +4,11 @@
/**********************************************************/
-VIDEO_START( warriorb )
+void warriorb_state::video_start()
{
- warriorb_state *state = machine.driver_data<warriorb_state>();
/* Ensure palette from correct TC0110PCR used for each screen */
- tc0100scn_set_colbanks(state->m_tc0100scn_1, 0x0, 0x100, 0x0);
+ tc0100scn_set_colbanks(m_tc0100scn_1, 0x0, 0x100, 0x0);
}
diff --git a/src/mame/video/wc90.c b/src/mame/video/wc90.c
index c99651dd9e1..33563faa443 100644
--- a/src/mame/video/wc90.c
+++ b/src/mame/video/wc90.c
@@ -72,26 +72,24 @@ TILE_GET_INFO_MEMBER(wc90_state::track_get_fg_tile_info)
***************************************************************************/
-VIDEO_START( wc90 )
+void wc90_state::video_start()
{
- wc90_state *state = machine.driver_data<wc90_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS, 16,16,64,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::get_tx_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS, 16,16,64,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::get_tx_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
}
-VIDEO_START( wc90t )
+VIDEO_START_MEMBER(wc90_state,wc90t)
{
- wc90_state *state = machine.driver_data<wc90_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::track_get_bg_tile_info),state),TILEMAP_SCAN_ROWS, 16,16,64,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::track_get_fg_tile_info),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::get_tx_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::track_get_bg_tile_info),this),TILEMAP_SCAN_ROWS, 16,16,64,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::track_get_fg_tile_info),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wc90_state::get_tx_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_tx_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_tx_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/wc90b.c b/src/mame/video/wc90b.c
index 59384bbe8c9..d9b2f3b4ff3 100644
--- a/src/mame/video/wc90b.c
+++ b/src/mame/video/wc90b.c
@@ -47,15 +47,14 @@ TILE_GET_INFO_MEMBER(wc90b_state::get_tx_tile_info)
***************************************************************************/
-VIDEO_START( wc90b )
+void wc90b_state::video_start()
{
- wc90b_state *state = machine.driver_data<wc90b_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wc90b_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS, 16,16,64,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wc90b_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_tx_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wc90b_state::get_tx_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wc90b_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS, 16,16,64,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wc90b_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_tx_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wc90b_state::get_tx_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
- state->m_fg_tilemap->set_transparent_pen(15);
- state->m_tx_tilemap->set_transparent_pen(15);
+ m_fg_tilemap->set_transparent_pen(15);
+ m_tx_tilemap->set_transparent_pen(15);
}
diff --git a/src/mame/video/wecleman.c b/src/mame/video/wecleman.c
index 109b1151803..b7db1b9eaaa 100644
--- a/src/mame/video/wecleman.c
+++ b/src/mame/video/wecleman.c
@@ -878,9 +878,8 @@ WRITE16_MEMBER(wecleman_state::wecleman_paletteram16_SSSSBBBBGGGGRRRR_word_w)
Initializations
***************************************************************************/
-VIDEO_START( wecleman )
+VIDEO_START_MEMBER(wecleman_state,wecleman)
{
- wecleman_state *state = machine.driver_data<wecleman_state>();
/*
Sprite banking - each bank is 0x20000 bytes (we support 0x40 bank codes)
This game has ROMs for 16 banks
@@ -896,75 +895,75 @@ VIDEO_START( wecleman )
UINT8 *buffer;
int i, j;
- assert(machine.primary_screen->format() == BITMAP_FORMAT_RGB32);
- buffer = auto_alloc_array(machine, UINT8, 0x12c00); // working buffer for sprite operations
+ assert(machine().primary_screen->format() == BITMAP_FORMAT_RGB32);
+ buffer = auto_alloc_array(machine(), UINT8, 0x12c00); // working buffer for sprite operations
- state->m_gameid = 0;
- state->m_gfx_bank = bank;
- state->m_spr_offsx = -0xbc + BMP_PAD;
- state->m_spr_offsy = 1 + BMP_PAD;
- state->m_cloud_blend = BLEND_MAX;
- state->m_cloud_ds = 0;
- state->m_cloud_visible = 0;
- state->m_black_pen = get_black_pen(machine);
+ m_gameid = 0;
+ m_gfx_bank = bank;
+ m_spr_offsx = -0xbc + BMP_PAD;
+ m_spr_offsy = 1 + BMP_PAD;
+ m_cloud_blend = BLEND_MAX;
+ m_cloud_ds = 0;
+ m_cloud_visible = 0;
+ m_black_pen = get_black_pen(machine());
- state->m_rgb_half = (UINT16*)(buffer + 0x00000);
- state->m_t32x32pm = (int*)(buffer + 0x10020);
- state->m_spr_ptr_list = (struct sprite **)(buffer + 0x12000);
- state->m_spr_idx_list = (int *)(buffer + 0x12400);
- state->m_spr_pri_list = (int *)(buffer + 0x12800);
+ m_rgb_half = (UINT16*)(buffer + 0x00000);
+ m_t32x32pm = (int*)(buffer + 0x10020);
+ m_spr_ptr_list = (struct sprite **)(buffer + 0x12000);
+ m_spr_idx_list = (int *)(buffer + 0x12400);
+ m_spr_pri_list = (int *)(buffer + 0x12800);
for (i=0; i<0x8000; i++)
{
j = i>>1;
- state->m_rgb_half[i] = (j&0xf) | (j&0x1e0) | (j&0x3c00);
+ m_rgb_half[i] = (j&0xf) | (j&0x1e0) | (j&0x3c00);
}
for (j=0; j<0x20; j++)
{
for (i=-0x1f; i<0x20; i++)
{
- *(state->m_t32x32pm + (j<<6) + i) = i * j;
+ *(m_t32x32pm + (j<<6) + i) = i * j;
}
}
- state->m_sprite_list = auto_alloc_array_clear(machine, struct sprite, NUM_SPRITES);
+ m_sprite_list = auto_alloc_array_clear(machine(), struct sprite, NUM_SPRITES);
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wecleman_state::wecleman_get_bg_tile_info),state),
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wecleman_state::wecleman_get_bg_tile_info),this),
TILEMAP_SCAN_ROWS,
/* We draw part of the road below */
8,8,
PAGE_NX * 2, PAGE_NY * 2 );
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wecleman_state::wecleman_get_fg_tile_info),state),
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wecleman_state::wecleman_get_fg_tile_info),this),
TILEMAP_SCAN_ROWS,
8,8,
PAGE_NX * 2, PAGE_NY * 2);
- state->m_txt_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wecleman_state::wecleman_get_txt_tile_info),state),
+ m_txt_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wecleman_state::wecleman_get_txt_tile_info),this),
TILEMAP_SCAN_ROWS,
8,8,
PAGE_NX * 1, PAGE_NY * 1);
- state->m_bg_tilemap->set_scroll_rows(TILEMAP_DIMY); /* Screen-wise scrolling */
- state->m_bg_tilemap->set_scroll_cols(1);
- state->m_bg_tilemap->set_transparent_pen(0);
+ m_bg_tilemap->set_scroll_rows(TILEMAP_DIMY); /* Screen-wise scrolling */
+ m_bg_tilemap->set_scroll_cols(1);
+ m_bg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scroll_rows(TILEMAP_DIMY); /* Screen-wise scrolling */
- state->m_fg_tilemap->set_scroll_cols(1);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_scroll_rows(TILEMAP_DIMY); /* Screen-wise scrolling */
+ m_fg_tilemap->set_scroll_cols(1);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_txt_tilemap->set_scroll_rows(1);
- state->m_txt_tilemap->set_scroll_cols(1);
- state->m_txt_tilemap->set_transparent_pen(0);
+ m_txt_tilemap->set_scroll_rows(1);
+ m_txt_tilemap->set_scroll_cols(1);
+ m_txt_tilemap->set_transparent_pen(0);
- state->m_txt_tilemap->set_scrollx(0, 512-320-16 -BMP_PAD);
- state->m_txt_tilemap->set_scrolly(0, -BMP_PAD );
+ m_txt_tilemap->set_scrollx(0, 512-320-16 -BMP_PAD);
+ m_txt_tilemap->set_scrolly(0, -BMP_PAD );
// patches out a mysterious pixel floating in the sky (tile decoding bug?)
- *const_cast<UINT8 *>(machine.gfx[0]->get_data(0xaca)+7) = 0;
+ *const_cast<UINT8 *>(machine().gfx[0]->get_data(0xaca)+7) = 0;
}
// Callbacks for the K051316
@@ -981,9 +980,8 @@ void hotchase_zoom_callback_1(running_machine &machine, int *code,int *color,int
*color = ((*color & 0x3f) << 1) | ((*code & 0x80) >> 7);
}
-VIDEO_START( hotchase )
+VIDEO_START_MEMBER(wecleman_state,hotchase)
{
- wecleman_state *state = machine.driver_data<wecleman_state>();
/*
Sprite banking - each bank is 0x20000 bytes (we support 0x40 bank codes)
This game has ROMs for 0x30 banks
@@ -998,17 +996,17 @@ VIDEO_START( hotchase )
UINT8 *buffer;
- buffer = auto_alloc_array(machine, UINT8, 0x400); // reserve 1k for sprite list
+ buffer = auto_alloc_array(machine(), UINT8, 0x400); // reserve 1k for sprite list
- state->m_gameid = 1;
- state->m_gfx_bank = bank;
- state->m_spr_offsx = -0xc0;
- state->m_spr_offsy = 0;
- state->m_black_pen = get_black_pen(machine);
+ m_gameid = 1;
+ m_gfx_bank = bank;
+ m_spr_offsx = -0xc0;
+ m_spr_offsy = 0;
+ m_black_pen = get_black_pen(machine());
- state->m_spr_ptr_list = (struct sprite **)buffer;
+ m_spr_ptr_list = (struct sprite **)buffer;
- state->m_sprite_list = auto_alloc_array_clear(machine, struct sprite, NUM_SPRITES);
+ m_sprite_list = auto_alloc_array_clear(machine(), struct sprite, NUM_SPRITES);
}
diff --git a/src/mame/video/welltris.c b/src/mame/video/welltris.c
index e79b44aca81..ee35801995d 100644
--- a/src/mame/video/welltris.c
+++ b/src/mame/video/welltris.c
@@ -210,12 +210,11 @@ WRITE16_MEMBER(welltris_state::welltris_charvideoram_w)
m_char_tilemap->mark_tile_dirty(offset);
}
-VIDEO_START( welltris )
+void welltris_state::video_start()
{
- welltris_state *state = machine.driver_data<welltris_state>();
- state->m_char_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(welltris_state::get_welltris_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_char_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(welltris_state::get_welltris_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- state->m_char_tilemap->set_transparent_pen(15);
+ m_char_tilemap->set_transparent_pen(15);
}
static void draw_background(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/wgp.c b/src/mame/video/wgp.c
index ea107655230..ee80ce3b7a1 100644
--- a/src/mame/video/wgp.c
+++ b/src/mame/video/wgp.c
@@ -67,14 +67,14 @@ static void wgp_core_vh_start( running_machine &machine, int piv_xoffs, int piv_
state->save_item(NAME(state->m_piv_scrolly));
}
-VIDEO_START( wgp )
+void wgp_state::video_start()
{
- wgp_core_vh_start(machine, 32, 16);
+ wgp_core_vh_start(machine(), 32, 16);
}
-VIDEO_START( wgp2 )
+VIDEO_START_MEMBER(wgp_state,wgp2)
{
- wgp_core_vh_start(machine, 32, 16);
+ wgp_core_vh_start(machine(), 32, 16);
}
diff --git a/src/mame/video/williams.c b/src/mame/video/williams.c
index 767da2199e7..44abff7fe49 100644
--- a/src/mame/video/williams.c
+++ b/src/mame/video/williams.c
@@ -130,37 +130,34 @@ static void state_save_register(running_machine &machine)
}
-VIDEO_START( williams )
+VIDEO_START_MEMBER(williams_state,williams)
{
- williams_state *state = machine.driver_data<williams_state>();
- blitter_init(machine, state->m_blitter_config, NULL);
- create_palette_lookup(machine);
- state_save_register(machine);
+ blitter_init(machine(), m_blitter_config, NULL);
+ create_palette_lookup(machine());
+ state_save_register(machine());
}
-VIDEO_START( blaster )
+VIDEO_START_MEMBER(williams_state,blaster)
{
- williams_state *state = machine.driver_data<williams_state>();
- blitter_init(machine, state->m_blitter_config, state->memregion("proms")->base());
- create_palette_lookup(machine);
- state_save_register(machine);
+ blitter_init(machine(), m_blitter_config, memregion("proms")->base());
+ create_palette_lookup(machine());
+ state_save_register(machine());
}
-VIDEO_START( williams2 )
+VIDEO_START_MEMBER(williams_state,williams2)
{
- williams_state *state = machine.driver_data<williams_state>();
- blitter_init(machine, state->m_blitter_config, NULL);
+ blitter_init(machine(), m_blitter_config, NULL);
/* allocate paletteram */
- state->m_generic_paletteram_8.allocate(0x400 * 2);
+ m_generic_paletteram_8.allocate(0x400 * 2);
/* create the tilemap */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(williams_state::get_tile_info),state), TILEMAP_SCAN_COLS, 24,16, 128,16);
- state->m_bg_tilemap->set_scrolldx(2, 0);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(williams_state::get_tile_info),this), TILEMAP_SCAN_COLS, 24,16, 128,16);
+ m_bg_tilemap->set_scrolldx(2, 0);
- state_save_register(machine);
+ state_save_register(machine());
}
diff --git a/src/mame/video/wiping.c b/src/mame/video/wiping.c
index 6bd338a5ad1..f92bce300f0 100644
--- a/src/mame/video/wiping.c
+++ b/src/mame/video/wiping.c
@@ -17,9 +17,9 @@
***************************************************************************/
-PALETTE_INIT( wiping )
+void wiping_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances_rg[3] = { 1000, 470, 220 };
static const int resistances_b [2] = { 470, 220 };
double rweights[3], gweights[3], bweights[2];
@@ -32,7 +32,7 @@ PALETTE_INIT( wiping )
2, &resistances_b[0], bweights, 470, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -57,7 +57,7 @@ PALETTE_INIT( wiping )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -67,14 +67,14 @@ PALETTE_INIT( wiping )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i ^ 0x03] & 0x0f;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites use colors 16-31 */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i ^ 0x03] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
diff --git a/src/mame/video/wiz.c b/src/mame/video/wiz.c
index 9a5c8887306..df558670b99 100644
--- a/src/mame/video/wiz.c
+++ b/src/mame/video/wiz.c
@@ -10,14 +10,13 @@
#include "includes/wiz.h"
-VIDEO_START( wiz )
+void wiz_state::video_start()
{
- wiz_state *state = machine.driver_data<wiz_state>();
- state_save_register_global_array(machine, state->m_char_bank);
- state_save_register_global_array(machine, state->m_palbank);
- state_save_register_global(machine, state->m_flipx);
- state_save_register_global(machine, state->m_flipy);
- state_save_register_global(machine, state->m_bgpen);
+ state_save_register_global_array(machine(), m_char_bank);
+ state_save_register_global_array(machine(), m_palbank);
+ state_save_register_global(machine(), m_flipx);
+ state_save_register_global(machine(), m_flipy);
+ state_save_register_global(machine(), m_bgpen);
}
/***************************************************************************
@@ -33,13 +32,13 @@ VIDEO_START( wiz )
bit 0 -- 1 kohm resistor -- RED/GREEN/BLUE
***************************************************************************/
-PALETTE_INIT( wiz )
+void wiz_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -49,18 +48,18 @@ PALETTE_INIT( wiz )
bit2 = (color_prom[0] >> 2) & 0x01;
bit3 = (color_prom[0] >> 3) & 0x01;
r = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
- bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine().total_colors()] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
- bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[2*machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[2*machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[2*machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[2*machine().total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
diff --git a/src/mame/video/wolfpack.c b/src/mame/video/wolfpack.c
index 9a783603f34..dcba9c42837 100644
--- a/src/mame/video/wolfpack.c
+++ b/src/mame/video/wolfpack.c
@@ -8,40 +8,40 @@ Atari Wolf Pack (prototype) video emulation
#include "includes/wolfpack.h"
-PALETTE_INIT( wolfpack )
+void wolfpack_state::palette_init()
{
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 8);
+ machine().colortable = colortable_alloc(machine(), 8);
- colortable_palette_set_color(machine.colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
- colortable_palette_set_color(machine.colortable, 1, MAKE_RGB(0xc1, 0xc1, 0xc1));
- colortable_palette_set_color(machine.colortable, 2, MAKE_RGB(0x81, 0x81, 0x81));
- colortable_palette_set_color(machine.colortable, 3, MAKE_RGB(0x48, 0x48, 0x48));
+ colortable_palette_set_color(machine().colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
+ colortable_palette_set_color(machine().colortable, 1, MAKE_RGB(0xc1, 0xc1, 0xc1));
+ colortable_palette_set_color(machine().colortable, 2, MAKE_RGB(0x81, 0x81, 0x81));
+ colortable_palette_set_color(machine().colortable, 3, MAKE_RGB(0x48, 0x48, 0x48));
for (i = 0; i < 4; i++)
{
- rgb_t color = colortable_palette_get_color(machine.colortable, i);
+ rgb_t color = colortable_palette_get_color(machine().colortable, i);
- colortable_palette_set_color(machine.colortable, 4 + i,
+ colortable_palette_set_color(machine().colortable, 4 + i,
MAKE_RGB(RGB_RED(color) < 0xb8 ? RGB_RED(color) + 0x48 : 0xff,
RGB_GREEN(color) < 0xb8 ? RGB_GREEN(color) + 0x48 : 0xff,
RGB_BLUE(color) < 0xb8 ? RGB_BLUE(color) + 0x48 : 0xff));
}
- colortable_entry_set_value(machine.colortable, 0x00, 0);
- colortable_entry_set_value(machine.colortable, 0x01, 1);
- colortable_entry_set_value(machine.colortable, 0x02, 1);
- colortable_entry_set_value(machine.colortable, 0x03, 0);
- colortable_entry_set_value(machine.colortable, 0x04, 0);
- colortable_entry_set_value(machine.colortable, 0x05, 2);
- colortable_entry_set_value(machine.colortable, 0x06, 0);
- colortable_entry_set_value(machine.colortable, 0x07, 3);
- colortable_entry_set_value(machine.colortable, 0x08, 4);
- colortable_entry_set_value(machine.colortable, 0x09, 5);
- colortable_entry_set_value(machine.colortable, 0x0a, 6);
- colortable_entry_set_value(machine.colortable, 0x0b, 7);
+ colortable_entry_set_value(machine().colortable, 0x00, 0);
+ colortable_entry_set_value(machine().colortable, 0x01, 1);
+ colortable_entry_set_value(machine().colortable, 0x02, 1);
+ colortable_entry_set_value(machine().colortable, 0x03, 0);
+ colortable_entry_set_value(machine().colortable, 0x04, 0);
+ colortable_entry_set_value(machine().colortable, 0x05, 2);
+ colortable_entry_set_value(machine().colortable, 0x06, 0);
+ colortable_entry_set_value(machine().colortable, 0x07, 3);
+ colortable_entry_set_value(machine().colortable, 0x08, 4);
+ colortable_entry_set_value(machine().colortable, 0x09, 5);
+ colortable_entry_set_value(machine().colortable, 0x0a, 6);
+ colortable_entry_set_value(machine().colortable, 0x0b, 7);
}
@@ -95,16 +95,15 @@ WRITE8_MEMBER(wolfpack_state::wolfpack_torpedo_v_w)
}
-VIDEO_START( wolfpack )
+void wolfpack_state::video_start()
{
- wolfpack_state *state = machine.driver_data<wolfpack_state>();
UINT16 val = 0;
int i;
- state->m_LFSR = auto_alloc_array(machine, UINT8, 0x8000);
+ m_LFSR = auto_alloc_array(machine(), UINT8, 0x8000);
- machine.primary_screen->register_screen_bitmap(state->m_helper);
+ machine().primary_screen->register_screen_bitmap(m_helper);
for (i = 0; i < 0x8000; i++)
{
@@ -112,10 +111,10 @@ VIDEO_START( wolfpack )
val = (val << 1) | (bit & 1);
- state->m_LFSR[i] = (val & 0xc00) == 0xc00;
+ m_LFSR[i] = (val & 0xc00) == 0xc00;
}
- state->m_current_index = 0x80;
+ m_current_index = 0x80;
}
diff --git a/src/mame/video/wrally.c b/src/mame/video/wrally.c
index 840caf4e051..9efc4ecfb27 100644
--- a/src/mame/video/wrally.c
+++ b/src/mame/video/wrally.c
@@ -62,14 +62,13 @@ TILE_GET_INFO_MEMBER(wrally_state::get_tile_info_wrally_screen1)
***************************************************************************/
-VIDEO_START( wrally )
+void wrally_state::video_start()
{
- wrally_state *state = machine.driver_data<wrally_state>();
- state->m_pant[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wrally_state::get_tile_info_wrally_screen0),state),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_pant[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wrally_state::get_tile_info_wrally_screen1),state),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_pant[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wrally_state::get_tile_info_wrally_screen0),this),TILEMAP_SCAN_ROWS,16,16,64,32);
+ m_pant[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wrally_state::get_tile_info_wrally_screen1),this),TILEMAP_SCAN_ROWS,16,16,64,32);
- state->m_pant[0]->set_transmask(0,0xff01,0x00ff); /* this layer is split in two (pens 1..7, pens 8-15) */
- state->m_pant[1]->set_transparent_pen(0);
+ m_pant[0]->set_transmask(0,0xff01,0x00ff); /* this layer is split in two (pens 1..7, pens 8-15) */
+ m_pant[1]->set_transparent_pen(0);
}
diff --git a/src/mame/video/wwfsstar.c b/src/mame/video/wwfsstar.c
index f68c7f44974..ff60c5348c1 100644
--- a/src/mame/video/wwfsstar.c
+++ b/src/mame/video/wwfsstar.c
@@ -205,15 +205,14 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
*******************************************************************************/
-VIDEO_START( wwfsstar )
+void wwfsstar_state::video_start()
{
- wwfsstar_state *state = machine.driver_data<wwfsstar_state>();
- state->m_fg0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wwfsstar_state::get_fg0_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,32,32);
- state->m_fg0_tilemap->set_transparent_pen(0);
+ m_fg0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wwfsstar_state::get_fg0_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
+ m_fg0_tilemap->set_transparent_pen(0);
- state->m_bg0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wwfsstar_state::get_bg0_tile_info),state),tilemap_mapper_delegate(FUNC(wwfsstar_state::bg0_scan),state), 16, 16,32,32);
- state->m_fg0_tilemap->set_transparent_pen(0);
+ m_bg0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wwfsstar_state::get_bg0_tile_info),this),tilemap_mapper_delegate(FUNC(wwfsstar_state::bg0_scan),this), 16, 16,32,32);
+ m_fg0_tilemap->set_transparent_pen(0);
}
SCREEN_UPDATE_IND16( wwfsstar )
diff --git a/src/mame/video/wwfwfest.c b/src/mame/video/wwfwfest.c
index df5aa3c69ea..6c624af76d8 100644
--- a/src/mame/video/wwfwfest.c
+++ b/src/mame/video/wwfwfest.c
@@ -219,34 +219,32 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
Draw Order / Priority seems to affect where the scroll values are used also.
*******************************************************************************/
-VIDEO_START( wwfwfest )
+void wwfwfest_state::video_start()
{
- wwfwfest_state *state = machine.driver_data<wwfwfest_state>();
- state_save_register_global(machine, state->m_pri);
- state_save_register_global(machine, state->m_bg0_scrollx);
- state_save_register_global(machine, state->m_bg0_scrolly);
- state_save_register_global(machine, state->m_bg1_scrollx);
- state_save_register_global(machine, state->m_bg1_scrolly);
+ state_save_register_global(machine(), m_pri);
+ state_save_register_global(machine(), m_bg0_scrollx);
+ state_save_register_global(machine(), m_bg0_scrolly);
+ state_save_register_global(machine(), m_bg1_scrollx);
+ state_save_register_global(machine(), m_bg1_scrolly);
- state->m_fg0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wwfwfest_state::get_fg0_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,64,32);
- state->m_bg1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wwfwfest_state::get_bg1_tile_info),state),TILEMAP_SCAN_ROWS, 16, 16,32,32);
- state->m_bg0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wwfwfest_state::get_bg0_tile_info),state),TILEMAP_SCAN_ROWS, 16, 16,32,32);
+ m_fg0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wwfwfest_state::get_fg0_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,64,32);
+ m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wwfwfest_state::get_bg1_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16,32,32);
+ m_bg0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wwfwfest_state::get_bg0_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16,32,32);
- state->m_fg0_tilemap->set_transparent_pen(0);
- state->m_bg1_tilemap->set_transparent_pen(0);
- state->m_bg0_tilemap->set_transparent_pen(0);
+ m_fg0_tilemap->set_transparent_pen(0);
+ m_bg1_tilemap->set_transparent_pen(0);
+ m_bg0_tilemap->set_transparent_pen(0);
- state->m_sprite_xoff = state->m_bg0_dx = state->m_bg1_dx[0] = state->m_bg1_dx[1] = 0;
+ m_sprite_xoff = m_bg0_dx = m_bg1_dx[0] = m_bg1_dx[1] = 0;
}
-VIDEO_START( wwfwfstb )
+VIDEO_START_MEMBER(wwfwfest_state,wwfwfstb)
{
- wwfwfest_state *state = machine.driver_data<wwfwfest_state>();
- VIDEO_START_CALL(wwfwfest);
+ wwfwfest_state::video_start();
- state->m_sprite_xoff = 2;
- state->m_bg0_dx = state->m_bg1_dx[0] = -4;
- state->m_bg1_dx[1] = -2;
+ m_sprite_xoff = 2;
+ m_bg0_dx = m_bg1_dx[0] = -4;
+ m_bg1_dx[1] = -2;
}
SCREEN_UPDATE_IND16( wwfwfest )
diff --git a/src/mame/video/xain.c b/src/mame/video/xain.c
index 92ba62ddd53..56697d5911b 100644
--- a/src/mame/video/xain.c
+++ b/src/mame/video/xain.c
@@ -83,16 +83,15 @@ TILE_GET_INFO_MEMBER(xain_state::get_char_tile_info)
***************************************************************************/
-VIDEO_START( xain )
+void xain_state::video_start()
{
- xain_state *state = machine.driver_data<xain_state>();
- state->m_bgram0_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(xain_state::get_bgram0_tile_info),state),tilemap_mapper_delegate(FUNC(xain_state::back_scan),state),16,16,32,32);
- state->m_bgram1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(xain_state::get_bgram1_tile_info),state),tilemap_mapper_delegate(FUNC(xain_state::back_scan),state),16,16,32,32);
- state->m_char_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(xain_state::get_char_tile_info),state),TILEMAP_SCAN_ROWS, 8, 8,32,32);
+ m_bgram0_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(xain_state::get_bgram0_tile_info),this),tilemap_mapper_delegate(FUNC(xain_state::back_scan),this),16,16,32,32);
+ m_bgram1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(xain_state::get_bgram1_tile_info),this),tilemap_mapper_delegate(FUNC(xain_state::back_scan),this),16,16,32,32);
+ m_char_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(xain_state::get_char_tile_info),this),TILEMAP_SCAN_ROWS, 8, 8,32,32);
- state->m_bgram0_tilemap->set_transparent_pen(0);
- state->m_bgram1_tilemap->set_transparent_pen(0);
- state->m_char_tilemap->set_transparent_pen(0);
+ m_bgram0_tilemap->set_transparent_pen(0);
+ m_bgram1_tilemap->set_transparent_pen(0);
+ m_char_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/xevious.c b/src/mame/video/xevious.c
index 5908d638e38..67c8a9d70c3 100644
--- a/src/mame/video/xevious.c
+++ b/src/mame/video/xevious.c
@@ -24,13 +24,13 @@
bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE
***************************************************************************/
-PALETTE_INIT( xevious )
+PALETTE_INIT_MEMBER(xevious_state,xevious)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- #define TOTAL_COLORS(gfxn) (machine.gfx[gfxn]->colors() * machine.gfx[gfxn]->granularity())
+ #define TOTAL_COLORS(gfxn) (machine().gfx[gfxn]->colors() * machine().gfx[gfxn]->granularity())
- machine.colortable = colortable_alloc(machine, 128+1);
+ machine().colortable = colortable_alloc(machine(), 128+1);
for (i = 0;i < 128;i++)
{
@@ -55,12 +55,12 @@ PALETTE_INIT( xevious )
bit3 = (color_prom[2*256] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
/* color 0x80 is used by sprites to mark transparency */
- colortable_palette_set_color(machine.colortable,0x80,MAKE_RGB(0,0,0));
+ colortable_palette_set_color(machine().colortable,0x80,MAKE_RGB(0,0,0));
color_prom += 128; /* the bottom part of the PROM is unused */
color_prom += 2*256;
@@ -69,7 +69,7 @@ PALETTE_INIT( xevious )
/* background tiles */
for (i = 0;i < TOTAL_COLORS(1);i++)
{
- colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + i,
+ colortable_entry_set_value(machine().colortable, machine().gfx[1]->colorbase() + i,
(color_prom[0] & 0x0f) | ((color_prom[TOTAL_COLORS(1)] & 0x0f) << 4));
color_prom++;
@@ -81,7 +81,7 @@ PALETTE_INIT( xevious )
{
int c = (color_prom[0] & 0x0f) | ((color_prom[TOTAL_COLORS(2)] & 0x0f) << 4);
- colortable_entry_set_value(machine.colortable, machine.gfx[2]->colorbase() + i,
+ colortable_entry_set_value(machine().colortable, machine().gfx[2]->colorbase() + i,
(c & 0x80) ? (c & 0x7f) : 0x80);
color_prom++;
@@ -91,19 +91,19 @@ PALETTE_INIT( xevious )
/* foreground characters */
for (i = 0;i < TOTAL_COLORS(0);i++)
{
- colortable_entry_set_value(machine.colortable, machine.gfx[0]->colorbase() + i,
+ colortable_entry_set_value(machine().colortable, machine().gfx[0]->colorbase() + i,
(i % 2 != 0) ? (i / 2) : 0x80);
}
}
-PALETTE_INIT( battles )
+PALETTE_INIT_MEMBER(xevious_state,battles)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- machine.colortable = colortable_alloc(machine, 128+1);
+ machine().colortable = colortable_alloc(machine(), 128+1);
for (i = 0;i < 128;i++)
{
@@ -128,12 +128,12 @@ PALETTE_INIT( battles )
bit3 = (color_prom[2*256] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine().colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
/* color 0x80 is used by sprites to mark transparency */
- colortable_palette_set_color(machine.colortable,0x80,MAKE_RGB(0,0,0));
+ colortable_palette_set_color(machine().colortable,0x80,MAKE_RGB(0,0,0));
color_prom += 128; /* the bottom part of the PROM is unused */
color_prom += 2*256;
@@ -142,7 +142,7 @@ PALETTE_INIT( battles )
/* background tiles */
for (i = 0;i < TOTAL_COLORS(1);i++)
{
- colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + i,
+ colortable_entry_set_value(machine().colortable, machine().gfx[1]->colorbase() + i,
(color_prom[0] & 0x0f) | ((color_prom[0x400] & 0x0f) << 4));
color_prom++;
@@ -154,7 +154,7 @@ PALETTE_INIT( battles )
{
int c = (color_prom[0] & 0x0f) | ((color_prom[0x400] & 0x0f) << 4);
- colortable_entry_set_value(machine.colortable, machine.gfx[2]->colorbase() + i,
+ colortable_entry_set_value(machine().colortable, machine().gfx[2]->colorbase() + i,
(c & 0x80) ? (c & 0x7f) : 0x80);
color_prom++;
@@ -163,7 +163,7 @@ PALETTE_INIT( battles )
/* foreground characters */
for (i = 0;i < TOTAL_COLORS(0);i++)
{
- colortable_entry_set_value(machine.colortable, machine.gfx[0]->colorbase() + i,
+ colortable_entry_set_value(machine().colortable, machine().gfx[0]->colorbase() + i,
(i % 2 != 0) ? (i / 2) : 0x80);
}
}
@@ -213,22 +213,21 @@ TILE_GET_INFO_MEMBER(xevious_state::get_bg_tile_info)
***************************************************************************/
-VIDEO_START( xevious )
+VIDEO_START_MEMBER(xevious_state,xevious)
{
- xevious_state *state = machine.driver_data<xevious_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(xevious_state::get_bg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(xevious_state::get_fg_tile_info),state),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(xevious_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(xevious_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
- state->m_bg_tilemap->set_scrolldx(-20,288+27);
- state->m_bg_tilemap->set_scrolldy(-16,-16);
- state->m_fg_tilemap->set_scrolldx(-32,288+32);
- state->m_fg_tilemap->set_scrolldy(-18,-10);
- state->m_fg_tilemap->set_transparent_pen(0);
- state->m_xevious_bs[0] = 0;
- state->m_xevious_bs[1] = 0;
+ m_bg_tilemap->set_scrolldx(-20,288+27);
+ m_bg_tilemap->set_scrolldy(-16,-16);
+ m_fg_tilemap->set_scrolldx(-32,288+32);
+ m_fg_tilemap->set_scrolldy(-18,-10);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_xevious_bs[0] = 0;
+ m_xevious_bs[1] = 0;
- state->save_item(NAME(state->m_xevious_bs));
+ save_item(NAME(m_xevious_bs));
}
diff --git a/src/mame/video/xexex.c b/src/mame/video/xexex.c
index 25ae912b104..c9d3aea3471 100644
--- a/src/mame/video/xexex.c
+++ b/src/mame/video/xexex.c
@@ -31,19 +31,18 @@ void xexex_tile_callback(running_machine &machine, int layer, int *code, int *co
*color = state->m_layer_colorbase[layer] | (*color >> 2 & 0x0f);
}
-VIDEO_START( xexex )
+void xexex_state::video_start()
{
- xexex_state *state = machine.driver_data<xexex_state>();
- assert(machine.primary_screen->format() == BITMAP_FORMAT_RGB32);
+ assert(machine().primary_screen->format() == BITMAP_FORMAT_RGB32);
- state->m_cur_alpha = 0;
+ m_cur_alpha = 0;
// Xexex has relative plane offsets of -2,2,4,6 vs. -2,0,2,3 in MW and GX.
- k056832_set_layer_offs(state->m_k056832, 0, -2, 16);
- k056832_set_layer_offs(state->m_k056832, 1, 2, 16);
- k056832_set_layer_offs(state->m_k056832, 2, 4, 16);
- k056832_set_layer_offs(state->m_k056832, 3, 6, 16);
+ k056832_set_layer_offs(m_k056832, 0, -2, 16);
+ k056832_set_layer_offs(m_k056832, 1, 2, 16);
+ k056832_set_layer_offs(m_k056832, 2, 4, 16);
+ k056832_set_layer_offs(m_k056832, 3, 6, 16);
}
SCREEN_UPDATE_RGB32( xexex )
diff --git a/src/mame/video/xmen.c b/src/mame/video/xmen.c
index b0decf56b85..81633249b1f 100644
--- a/src/mame/video/xmen.c
+++ b/src/mame/video/xmen.c
@@ -51,17 +51,16 @@ void xmen_sprite_callback( running_machine &machine, int *code, int *color, int
***************************************************************************/
-VIDEO_START( xmen6p )
+VIDEO_START_MEMBER(xmen_state,xmen6p)
{
- xmen_state *state = machine.driver_data<xmen_state>();
- k053247_get_ram(state->m_k053246, &state->m_k053247_ram);
+ k053247_get_ram(m_k053246, &m_k053247_ram);
- state->m_screen_left = auto_bitmap_ind16_alloc(machine, 64 * 8, 32 * 8);
- state->m_screen_right = auto_bitmap_ind16_alloc(machine, 64 * 8, 32 * 8);
+ m_screen_left = auto_bitmap_ind16_alloc(machine(), 64 * 8, 32 * 8);
+ m_screen_right = auto_bitmap_ind16_alloc(machine(), 64 * 8, 32 * 8);
- state->save_item(NAME(*state->m_screen_left));
- state->save_item(NAME(*state->m_screen_right));
+ save_item(NAME(*m_screen_left));
+ save_item(NAME(*m_screen_right));
}
diff --git a/src/mame/video/xorworld.c b/src/mame/video/xorworld.c
index f51b3fe3089..8707fe03714 100644
--- a/src/mame/video/xorworld.c
+++ b/src/mame/video/xorworld.c
@@ -16,12 +16,12 @@
***************************************************************************/
-PALETTE_INIT( xorworld )
+void xorworld_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0;i < machine.total_colors();i++){
+ for (i = 0;i < machine().total_colors();i++){
int bit0,bit1,bit2,bit3;
int r,g,b;
@@ -32,18 +32,18 @@ PALETTE_INIT( xorworld )
bit3 = (color_prom[0] >> 3) & 0x01;
r = 0x0e*bit0 + 0x1e*bit1 + 0x44*bit2 + 0x8f*bit3;
/* green component */
- bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine().total_colors()] >> 3) & 0x01;
g = 0x0e*bit0 + 0x1e*bit1 + 0x44*bit2 + 0x8f*bit3;
/* blue component */
- bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[2*machine().total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[2*machine().total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[2*machine().total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[2*machine().total_colors()] >> 3) & 0x01;
b = 0x0e*bit0 + 0x1e * bit1 + 0x44*bit2 + 0x8f*bit3;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
color_prom++;
}
@@ -75,10 +75,9 @@ TILE_GET_INFO_MEMBER(xorworld_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, data >> 12, 0);
}
-VIDEO_START( xorworld )
+void xorworld_state::video_start()
{
- xorworld_state *state = machine.driver_data<xorworld_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(xorworld_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(xorworld_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 32, 32);
}
diff --git a/src/mame/video/xxmissio.c b/src/mame/video/xxmissio.c
index 1f79ee204e6..d2ce281c21b 100644
--- a/src/mame/video/xxmissio.c
+++ b/src/mame/video/xxmissio.c
@@ -66,17 +66,16 @@ TILE_GET_INFO_MEMBER(xxmissio_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
-VIDEO_START( xxmissio )
+void xxmissio_state::video_start()
{
- xxmissio_state *state = machine.driver_data<xxmissio_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(xxmissio_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
- state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(xxmissio_state::get_fg_tile_info),state), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(xxmissio_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
+ m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(xxmissio_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_cols(1);
- state->m_bg_tilemap->set_scroll_rows(1);
- state->m_bg_tilemap->set_scrolldx(2, 12);
+ m_bg_tilemap->set_scroll_cols(1);
+ m_bg_tilemap->set_scroll_rows(1);
+ m_bg_tilemap->set_scrolldx(2, 12);
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/xybots.c b/src/mame/video/xybots.c
index 28d1781d579..05b31aa909f 100644
--- a/src/mame/video/xybots.c
+++ b/src/mame/video/xybots.c
@@ -43,7 +43,7 @@ TILE_GET_INFO_MEMBER(xybots_state::get_playfield_tile_info)
*
*************************************/
-VIDEO_START( xybots )
+VIDEO_START_MEMBER(xybots_state,xybots)
{
static const atarimo_desc modesc =
{
@@ -81,17 +81,16 @@ VIDEO_START( xybots )
0, /* resulting value to indicate "special" */
NULL /* callback routine for special entries */
};
- xybots_state *state = machine.driver_data<xybots_state>();
/* initialize the playfield */
- state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(xybots_state::get_playfield_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(xybots_state::get_playfield_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
/* initialize the motion objects */
- atarimo_init(machine, 0, &modesc);
+ atarimo_init(machine(), 0, &modesc);
/* initialize the alphanumerics */
- state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(xybots_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32);
- state->m_alpha_tilemap->set_transparent_pen(0);
+ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(xybots_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
+ m_alpha_tilemap->set_transparent_pen(0);
}
diff --git a/src/mame/video/xyonix.c b/src/mame/video/xyonix.c
index 4f1a9765411..556b8d71369 100644
--- a/src/mame/video/xyonix.c
+++ b/src/mame/video/xyonix.c
@@ -1,13 +1,13 @@
#include "emu.h"
#include "includes/xyonix.h"
-PALETTE_INIT( xyonix )
+void xyonix_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0;i < machine.total_colors();i++)
+ for (i = 0;i < machine().total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -26,7 +26,7 @@ PALETTE_INIT( xyonix )
bit1 = (color_prom[i] >> 4) & 0x01;
b = 0x4f * bit0 + 0xa8 * bit1;
- palette_set_color(machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),i,MAKE_RGB(r,g,b));
}
}
@@ -48,11 +48,10 @@ WRITE8_MEMBER(xyonix_state::xyonix_vidram_w)
m_tilemap->mark_tile_dirty((offset-1)&0x0fff);
}
-VIDEO_START(xyonix)
+void xyonix_state::video_start()
{
- xyonix_state *state = machine.driver_data<xyonix_state>();
- state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(xyonix_state::get_xyonix_tile_info),state), TILEMAP_SCAN_ROWS, 4, 8, 80, 32);
+ m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(xyonix_state::get_xyonix_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 80, 32);
}
SCREEN_UPDATE_IND16(xyonix)
diff --git a/src/mame/video/yiear.c b/src/mame/video/yiear.c
index cd5e4ee2649..c93cd698222 100644
--- a/src/mame/video/yiear.c
+++ b/src/mame/video/yiear.c
@@ -28,12 +28,12 @@
***************************************************************************/
-PALETTE_INIT( yiear )
+void yiear_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -55,7 +55,7 @@ PALETTE_INIT( yiear )
bit2 = (*color_prom >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
color_prom++;
}
}
@@ -97,10 +97,9 @@ TILE_GET_INFO_MEMBER(yiear_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, 0, flags);
}
-VIDEO_START( yiear )
+void yiear_state::video_start()
{
- yiear_state *state = machine.driver_data<yiear_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(yiear_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(yiear_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/yunsun16.c b/src/mame/video/yunsun16.c
index fbee4371774..93375d1fb7d 100644
--- a/src/mame/video/yunsun16.c
+++ b/src/mame/video/yunsun16.c
@@ -92,23 +92,22 @@ WRITE16_MEMBER(yunsun16_state::yunsun16_vram_1_w)
***************************************************************************/
-VIDEO_START( yunsun16 )
+void yunsun16_state::video_start()
{
- yunsun16_state *state = machine.driver_data<yunsun16_state>();
- state->m_tilemap_0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(yunsun16_state::get_tile_info_0),state),tilemap_mapper_delegate(FUNC(yunsun16_state::yunsun16_tilemap_scan_pages),state),
+ m_tilemap_0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(yunsun16_state::get_tile_info_0),this),tilemap_mapper_delegate(FUNC(yunsun16_state::yunsun16_tilemap_scan_pages),this),
16,16, TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(yunsun16_state::get_tile_info_1),state),tilemap_mapper_delegate(FUNC(yunsun16_state::yunsun16_tilemap_scan_pages),state),
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(yunsun16_state::get_tile_info_1),this),tilemap_mapper_delegate(FUNC(yunsun16_state::yunsun16_tilemap_scan_pages),this),
16,16, TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- state->m_tilemap_0->set_scrolldx(-0x34, 0);
- state->m_tilemap_1->set_scrolldx(-0x38, 0);
+ m_tilemap_0->set_scrolldx(-0x34, 0);
+ m_tilemap_1->set_scrolldx(-0x38, 0);
- state->m_tilemap_0->set_scrolldy(-0x10, 0);
- state->m_tilemap_1->set_scrolldy(-0x10, 0);
+ m_tilemap_0->set_scrolldy(-0x10, 0);
+ m_tilemap_1->set_scrolldy(-0x10, 0);
- state->m_tilemap_0->set_transparent_pen(0xff);
- state->m_tilemap_1->set_transparent_pen(0xff);
+ m_tilemap_0->set_transparent_pen(0xff);
+ m_tilemap_1->set_transparent_pen(0xff);
}
diff --git a/src/mame/video/yunsung8.c b/src/mame/video/yunsung8.c
index 970ee1927b1..e9feeabfa26 100644
--- a/src/mame/video/yunsung8.c
+++ b/src/mame/video/yunsung8.c
@@ -169,14 +169,13 @@ TILE_GET_INFO_MEMBER(yunsung8_state::get_tile_info_1)
***************************************************************************/
-VIDEO_START( yunsung8 )
+void yunsung8_state::video_start()
{
- yunsung8_state *state = machine.driver_data<yunsung8_state>();
- state->m_tilemap_0 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(yunsung8_state::get_tile_info_0),state), TILEMAP_SCAN_ROWS, 8, 8, DIM_NX_0, DIM_NY_0 );
- state->m_tilemap_1 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(yunsung8_state::get_tile_info_1),state), TILEMAP_SCAN_ROWS, 8, 8, DIM_NX_1, DIM_NY_1 );
+ m_tilemap_0 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(yunsung8_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 8, 8, DIM_NX_0, DIM_NY_0 );
+ m_tilemap_1 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(yunsung8_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 8, 8, DIM_NX_1, DIM_NY_1 );
- state->m_tilemap_1->set_transparent_pen(0);
+ m_tilemap_1->set_transparent_pen(0);
}
diff --git a/src/mame/video/zac2650.c b/src/mame/video/zac2650.c
index 50a77ee77ab..04c3534b7d0 100644
--- a/src/mame/video/zac2650.c
+++ b/src/mame/video/zac2650.c
@@ -119,17 +119,16 @@ TILE_GET_INFO_MEMBER(zac2650_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, 0, 0);
}
-VIDEO_START( tinvader )
+void zac2650_state::video_start()
{
- zac2650_state *state = machine.driver_data<zac2650_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(zac2650_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS,
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(zac2650_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
24, 24, 32, 32);
- machine.primary_screen->register_screen_bitmap(state->m_bitmap);
- machine.primary_screen->register_screen_bitmap(state->m_spritebitmap);
+ machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().primary_screen->register_screen_bitmap(m_spritebitmap);
- machine.gfx[1]->set_source(state->m_s2636_0_ram);
- machine.gfx[2]->set_source(state->m_s2636_0_ram);
+ machine().gfx[1]->set_source(m_s2636_0_ram);
+ machine().gfx[2]->set_source(m_s2636_0_ram);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/zaccaria.c b/src/mame/video/zaccaria.c
index 6790d7b0d69..f606f43a5b3 100644
--- a/src/mame/video/zaccaria.c
+++ b/src/mame/video/zaccaria.c
@@ -33,9 +33,9 @@ Here's the hookup from the proms (82s131) to the r-g-b-outputs
***************************************************************************/
-PALETTE_INIT( zaccaria )
+void zaccaria_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i, j, k;
static const int resistances_rg[] = { 1200, 1000, 820 };
static const int resistances_b[] = { 1000, 820 };
@@ -48,7 +48,7 @@ PALETTE_INIT( zaccaria )
0, 0, 0, 0, 0);
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x200);
+ machine().colortable = colortable_alloc(machine(), 0x200);
for (i = 0; i < 0x200; i++)
{
@@ -61,7 +61,7 @@ PALETTE_INIT( zaccaria )
black anyway.
*/
if (((i % 64) / 8) == 0)
- colortable_palette_set_color(machine.colortable, i, RGB_BLACK);
+ colortable_palette_set_color(machine().colortable, i, RGB_BLACK);
else
{
int bit0, bit1, bit2;
@@ -84,7 +84,7 @@ PALETTE_INIT( zaccaria )
bit1 = (color_prom[i + 0x200] >> 0) & 0x01;
b = combine_2_weights(weights_b, bit0, bit1);
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
}
@@ -96,13 +96,13 @@ PALETTE_INIT( zaccaria )
for (j = 0;j < 4;j++)
for (k = 0;k < 8;k++)
/* swap j and k to make the colors sequential */
- colortable_entry_set_value(machine.colortable, 0 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2*j);
+ colortable_entry_set_value(machine().colortable, 0 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2*j);
for (i = 0;i < 8;i++)
for (j = 0;j < 4;j++)
for (k = 0;k < 8;k++)
/* swap j and k to make the colors sequential */
- colortable_entry_set_value(machine.colortable, 256 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2*j+1);
+ colortable_entry_set_value(machine().colortable, 256 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2*j+1);
}
@@ -131,12 +131,11 @@ TILE_GET_INFO_MEMBER(zaccaria_state::get_tile_info)
***************************************************************************/
-VIDEO_START( zaccaria )
+void zaccaria_state::video_start()
{
- zaccaria_state *state = machine.driver_data<zaccaria_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(zaccaria_state::get_tile_info),state),TILEMAP_SCAN_ROWS,8,8,32,32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(zaccaria_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_scroll_cols(32);
}
diff --git a/src/mame/video/zaxxon.c b/src/mame/video/zaxxon.c
index dbdd901dd3b..0fbfe975500 100644
--- a/src/mame/video/zaxxon.c
+++ b/src/mame/video/zaxxon.c
@@ -15,10 +15,9 @@
*
*************************************/
-PALETTE_INIT( zaxxon )
+void zaxxon_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
- zaxxon_state *state = machine.driver_data<zaxxon_state>();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
int i;
@@ -30,7 +29,7 @@ PALETTE_INIT( zaxxon )
2, &resistances[1], bweights, 470, 0);
/* initialize the palette with these colors */
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2;
int r, g, b;
@@ -52,11 +51,11 @@ PALETTE_INIT( zaxxon )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- palette_set_color(machine, i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the character color codes */
- state->m_color_codes = &color_prom[256];
+ m_color_codes = &color_prom[256];
}
@@ -145,33 +144,30 @@ static void video_start_common(running_machine &machine, tilemap_get_info_delega
}
-VIDEO_START( zaxxon )
+void zaxxon_state::video_start()
{
- zaxxon_state *state = machine.driver_data<zaxxon_state>();
- video_start_common(machine, tilemap_get_info_delegate(FUNC(zaxxon_state::zaxxon_get_fg_tile_info),state));
+ video_start_common(machine(), tilemap_get_info_delegate(FUNC(zaxxon_state::zaxxon_get_fg_tile_info),this));
}
-VIDEO_START( razmataz )
+VIDEO_START_MEMBER(zaxxon_state,razmataz)
{
- zaxxon_state *state = machine.driver_data<zaxxon_state>();
- video_start_common(machine, tilemap_get_info_delegate(FUNC(zaxxon_state::razmataz_get_fg_tile_info),state));
+ video_start_common(machine(), tilemap_get_info_delegate(FUNC(zaxxon_state::razmataz_get_fg_tile_info),this));
}
-VIDEO_START( congo )
+VIDEO_START_MEMBER(zaxxon_state,congo)
{
- zaxxon_state *state = machine.driver_data<zaxxon_state>();
/* allocate our own spriteram since it is not accessible by the main CPU */
- state->m_spriteram.allocate(0x100);
+ m_spriteram.allocate(0x100);
/* register for save states */
- state->save_item(NAME(state->m_congo_fg_bank));
- state->save_item(NAME(state->m_congo_color_bank));
- state->save_item(NAME(state->m_congo_custom));
+ save_item(NAME(m_congo_fg_bank));
+ save_item(NAME(m_congo_color_bank));
+ save_item(NAME(m_congo_custom));
- video_start_common(machine, tilemap_get_info_delegate(FUNC(zaxxon_state::congo_get_fg_tile_info),state));
+ video_start_common(machine(), tilemap_get_info_delegate(FUNC(zaxxon_state::congo_get_fg_tile_info),this));
}
diff --git a/src/mame/video/zodiack.c b/src/mame/video/zodiack.c
index bc3ddd9e4ef..46862c31497 100644
--- a/src/mame/video/zodiack.c
+++ b/src/mame/video/zodiack.c
@@ -46,13 +46,13 @@ WRITE8_MEMBER( zodiack_state::flipscreen_w )
}
}
-PALETTE_INIT( zodiack )
+PALETTE_INIT_MEMBER(zodiack_state,zodiack)
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x31);
+ machine().colortable = colortable_alloc(machine(), 0x31);
/* create a lookup table for the palette */
for (i = 0; i < 0x30; i++)
@@ -78,25 +78,25 @@ PALETTE_INIT( zodiack )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* white for bullets */
- colortable_palette_set_color(machine.colortable, 0x30, RGB_WHITE);
+ colortable_palette_set_color(machine().colortable, 0x30, RGB_WHITE);
for (i = 0; i < 0x20; i++)
if ((i & 3) == 0)
- colortable_entry_set_value(machine.colortable, i, 0);
+ colortable_entry_set_value(machine().colortable, i, 0);
for (i = 0; i < 0x10; i += 2)
{
- colortable_entry_set_value(machine.colortable, 0x20 + i, 32 + (i / 2));
- colortable_entry_set_value(machine.colortable, 0x21 + i, 40 + (i / 2));
+ colortable_entry_set_value(machine().colortable, 0x20 + i, 32 + (i / 2));
+ colortable_entry_set_value(machine().colortable, 0x21 + i, 40 + (i / 2));
}
/* bullet */
- colortable_entry_set_value(machine.colortable, 0x30, 0);
- colortable_entry_set_value(machine.colortable, 0x31, 0x30);
+ colortable_entry_set_value(machine().colortable, 0x30, 0);
+ colortable_entry_set_value(machine().colortable, 0x31, 0x30);
}
TILE_GET_INFO_MEMBER(zodiack_state::get_bg_tile_info)